Question: using java have the program read the text file and for it to spit out a output im pretty sure all the coding is right

using java have the program read the text file and for it to spit out a output im pretty sure all the coding is right just cant find out why my program isn't reading this text file

using java have the program read the text file and for it

// DB7.java CS5151/6051 cheng 2019 // chase test for lossless join // Usage: java DB7 F R1 R2 ... // DB7.java CS5151/6051 cheng 2019 // chase test for lossless join // Usage: java DB7 F R1 R2 ... // F is a file that has the first line all the attributes and // then an FD a line with a space between the left-hand side and the right-hand side // R1, R2, ... are attribute sets in a proposed decomposition

import java.io.*; import java.util.*;

public class DB7{

class FD{ HashSet lhs; char rhs; public FD(HashSet l, char r){ lhs = l; rhs = r; } public boolean equals(Object obj){ FD fd2 = (FD)obj; return lhs.equals(fd2.lhs) && rhs == fd2.rhs; } public void print(){ lhs.forEach(c -> System.out.print(c)); System.out.println(" " + rhs); } };

HashSet R = new HashSet(); // all attributes HashSet F = new HashSet(); // the set of FDs int[][] tableau = null; int rows = 0; int cols = 0; char[] attributes = null; HashMap att2col = new HashMap(); int n = 0; int m = 0; int l = 0; boolean changed = false;

public DB7(String[] args){ // 1. split FDs so each FD has a single attribute on the right Scanner in = null; try { in = new Scanner(new File(args[0])); } catch (FileNotFoundException e){ System.err.println(args[0] + " not found"); System.exit(1); } String line = in.nextLine(); cols = line.length(); attributes = new char[cols]; for (int i = 0; i l = new HashSet(); String[] terms = in.nextLine().split(" "); for (int i = 0; i

void printTableau(){ for (int i = 0; i

void chase(){ // Your code needed do { changed = false; F.forEach(fd -> { fd.print(); for (m = 1; m { int col = att2col.get(c); if (tableau[m][col] == tableau[l][col]) n++; }); if (n == fd.lhs.size()){ // tuples m and l agree on all shared attributes int col = att2col.get(fd.rhs); // they should also agree on col if (tableau[m][col] != tableau[l][col]){ if (tableau[m][col] == -1) tableau[l][col] = -1; else if (tableau[l][col] == -1) tableau[m][col] = -1; else tableau[m][col] = -1; changed = true; printTableau(); } } } }); } while (changed == true); }

void conclusion(){ // Your code to idensity whether the decomposition is lossless if (changed) System.out.println("lossless"); else System.out.println("not lossless"); }

public static void main(String [] args){

if (args.length - - x 1412 Notepad Format Vww Help File di FABCDE CEA Windows CRLF) L 1. Colt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!