first commit

This commit is contained in:
2019-08-13 11:40:00 -05:00
commit a03be258da
155 changed files with 1145534 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
package barnestr;
import java.util.List;
public interface AutoCompleter {
void initialize(String filename);
List allThatBeginsWith(String prefix);
long getLastOperationTime();
}

View File

@@ -0,0 +1,39 @@
package barnestr;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class ForEachArrayStrategy implements AutoCompleter{
ArrayList<String> entries = new ArrayList<>();
@Override
public void initialize(String filename) {
//TODO
try(Scanner in = new Scanner(new File(filename))) {
while(in.hasNext()) {
if (filename.endsWith(".csv")) {
String[] line = in.nextLine().split(",");
entries.add()
} else if (filename.endsWith(".txt")) {
entries.add(in.next());
}
}
} catch (FileNotFoundException e) {
}
}
@Override
public List allThatBeginsWith(String prefix) {
return null;
}
@Override
public long getLastOperationTime() {
return 0;
}
}

View File

@@ -0,0 +1,20 @@
package barnestr;
import java.util.List;
public class ForEachLinkedStrategy implements AutoCompleter{
@Override
public void initialize(String filename) {
}
@Override
public List allThatBeginsWith(String prefix) {
return null;
}
@Override
public long getLastOperationTime() {
return 0;
}
}

View File

@@ -0,0 +1,20 @@
package barnestr;
import java.util.List;
public class IndexArrayStrategy implements AutoCompleter{
@Override
public void initialize(String filename) {
}
@Override
public List allThatBeginsWith(String prefix) {
return null;
}
@Override
public long getLastOperationTime() {
return 0;
}
}

View File

@@ -0,0 +1,20 @@
package barnestr;
import java.util.List;
public class IndexLinkedStrategy implements AutoCompleter{
@Override
public void initialize(String filename) {
}
@Override
public List allThatBeginsWith(String prefix) {
return null;
}
@Override
public long getLastOperationTime() {
return 0;
}
}

View File

@@ -0,0 +1,7 @@
package barnestr;
public class Lab4 {
public static void main(String[] args) {
}
}

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.RadioMenuItem?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="360.0" prefWidth="360.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="barnestr.Lab4Controller">
<children>
<MenuBar>
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Strategy">
<items>
<RadioMenuItem fx:id="radioArrayListIndex" mnemonicParsing="false" selected="true" text="ArrayList Index">
<toggleGroup>
<ToggleGroup fx:id="strategy" />
</toggleGroup>
</RadioMenuItem>
<RadioMenuItem fx:id="radioLinkedListIndex" mnemonicParsing="false" text="LinkedList Index" toggleGroup="$strategy" />
<RadioMenuItem fx:id="radioArrayListFor" mnemonicParsing="false" text="ArrayList For-Each" toggleGroup="$strategy" />
<RadioMenuItem fx:id="radioLinkedListFor" mnemonicParsing="false" text="LinkedList For-Each" toggleGroup="$strategy" />
</items>
</Menu>
</menus>
</MenuBar>
<VBox prefHeight="330.0" prefWidth="340.0">
<children>
<Label text="Search:" />
<TextField fx:id="textSearch" prefWidth="300.0">
<font>
<Font size="16.0" />
</font>
</TextField>
<Label text="Matches:">
<padding>
<Insets top="5.0" />
</padding>
</Label>
<TextArea fx:id="textMatches" prefHeight="230.0" prefWidth="340.0">
<font>
<Font size="16.0" />
</font>
</TextArea>
<BorderPane prefHeight="25.0" prefWidth="340.0">
<left>
<Label fx:id="labelTime" text="Time Required:" BorderPane.alignment="CENTER" />
</left>
<right>
<Label fx:id="labelMatches" text="Matches found:" textAlignment="CENTER" BorderPane.alignment="CENTER" />
</right>
</BorderPane>
</children>
<VBox.margin>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
</VBox.margin>
</VBox>
</children>
</VBox>

View File

@@ -0,0 +1,65 @@
package barnestr;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.stage.FileChooser;
import java.net.URL;
import java.util.ResourceBundle;
public class Lab4Controller implements Initializable{
@FXML
private RadioMenuItem radioArrayListIndex;
@FXML
private RadioMenuItem radioLinkedListIndex;
@FXML
private RadioMenuItem radioArrayListFor;
@FXML
private RadioMenuItem radioLinkedListFor;
@FXML
private ToggleGroup strategy;
@FXML
private TextField textSearch;
@FXML
private TextArea textMatches;
@FXML
private Label labelTime;
@FXML
private Label labelMatches;
@Override
public void initialize(URL location, ResourceBundle resources) {
}
@FXML
void close(ActionEvent event) {
Platform.exit();
}
@FXML
void load(ActionEvent event) {
try {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Open Dictionary File");
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Dictionary Files","*txt", "*.csv"));
}catch(Exception e) {
}
}
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff