Commit 1e055d3f authored by Adam Blank's avatar Adam Blank
Browse files

Initial commit

parents
Showing with 678 additions and 0 deletions
+678 -0
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.13" />
<entry key="copy-libs" value="false" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>
\ No newline at end of file
<component name="libraryTable">
<library name="com.github.javaparser:javaparser-core:3.5.12" type="repository">
<properties maven-id="com.github.javaparser:javaparser-core:3.5.12" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/javaparser/javaparser-core/3.5.12/javaparser-core-3.5.12.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="org.hamcrest:hamcrest-all:1.3" type="repository">
<properties maven-id="org.hamcrest:hamcrest-all:1.3" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="org.junit.jupiter:junit-jupiter-params:5.4.0-SNAPSHOT" type="repository">
<properties maven-id="org.junit.jupiter:junit-jupiter-params:5.4.0-SNAPSHOT" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-params/5.4.0-SNAPSHOT/junit-jupiter-params-5.4.0-SNAPSHOT.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/jupiter/junit-jupiter-api/5.4.0-SNAPSHOT/junit-jupiter-api-5.4.0-SNAPSHOT.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.4.0-SNAPSHOT/junit-platform-commons-1.4.0-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/doc" />
<option name="OPTION_SCOPE" value="public" />
<option name="OTHER_OPTIONS" value="-link https://docs.oracle.com/javase/8/docs/api/" />
<option name="OPTION_INCLUDE_LIBS" value="true" />
</component>
<component name="PreferredVcsStorage">
<preferredVcsName>ApexVCS</preferredVcsName>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/project03-guitar.iml" filepath="$PROJECT_DIR$/project03-guitar.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$USER_HOME$" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="data-structures" />
<orderEntry type="library" name="com.github.javaparser:javaparser-core:3.5.12" level="project" />
<orderEntry type="library" scope="TEST" name="org.hamcrest:hamcrest-all:1.3" level="project" />
<orderEntry type="library" name="org.junit.jupiter:junit-jupiter-params:5.4.0-SNAPSHOT" level="project" />
</component>
</module>
\ No newline at end of file
package edu.caltech.cs2.datastructures;
import edu.caltech.cs2.interfaces.IDeque;
import edu.caltech.cs2.interfaces.IQueue;
import edu.caltech.cs2.interfaces.IStack;
import java.util.Iterator;
public class ArrayDeque<E> implements IDeque<E>, IQueue<E>, IStack<E> {
@Override
public void addFront(E e) {
}
@Override
public void addBack(E e) {
}
@Override
public E removeFront() {
return null;
}
@Override
public E removeBack() {
return null;
}
@Override
public boolean enqueue(E e) {
return false;
}
@Override
public E dequeue() {
return null;
}
@Override
public boolean push(E e) {
return false;
}
@Override
public E pop() {
return null;
}
@Override
public E peek() {
return null;
}
@Override
public E peekFront() {
return null;
}
@Override
public E peekBack() {
return null;
}
@Override
public Iterator<E> iterator() {
return null;
}
@Override
public int size() {
return 0;
}
}
package edu.caltech.cs2.datastructures;
import edu.caltech.cs2.interfaces.IFixedSizeQueue;
import java.util.Iterator;
public class CircularArrayFixedSizeQueue<E> implements IFixedSizeQueue<E> {
@Override
public boolean isFull() {
return false;
}
@Override
public int capacity() {
return 0;
}
@Override
public boolean enqueue(E e) {
return false;
}
@Override
public E dequeue() {
return null;
}
@Override
public E peek() {
return null;
}
@Override
public int size() {
return 0;
}
@Override
public Iterator<E> iterator() {
return null;
}
}
package edu.caltech.cs2.datastructures;
import edu.caltech.cs2.interfaces.IDeque;
import edu.caltech.cs2.interfaces.IQueue;
import edu.caltech.cs2.interfaces.IStack;
import java.util.Iterator;
public class LinkedDeque<E> implements IDeque<E>, IQueue<E>, IStack<E> {
@Override
public void addFront(E e) {
}
@Override
public void addBack(E e) {
}
@Override
public E removeFront() {
return null;
}
@Override
public E removeBack() {
return null;
}
@Override
public boolean enqueue(E e) {
return false;
}
@Override
public E dequeue() {
return null;
}
@Override
public boolean push(E e) {
return false;
}
@Override
public E pop() {
return null;
}
@Override
public E peek() {
return null;
}
@Override
public E peekFront() {
return null;
}
@Override
public E peekBack() {
return null;
}
@Override
public Iterator<E> iterator() {
return null;
}
@Override
public int size() {
return 0;
}
}
\ No newline at end of file
package edu.caltech.cs2.interfaces;
import java.util.Iterator;
/**
* This interface represents some group or collection of elements.
* @param <E> Element type
*/
public interface ICollection<E> extends Iterable<E> {
/**
* Add an element to the collection.
* @param e Element to add
*/
public void add(E e);
/**
* Removes all elements from the collection.
*/
public void clear();
/**
* Generates an iterator over the collection.
* @return Iterator over the collection
*/
public Iterator<E> iterator();
/**
* Checks if an element is contained in the collection.
* @param e Element to check for
* @return True if element is contained in collection, false otherwise
*/
default public boolean contains(E e) {
for (E item : this) {
if (e == null ? item == null : e.equals(item)) {
return true;
}
}
return false;
}
/**
* Calculates the size of the collection.
* @return Number of elements in the collection
*/
public int size();
/**
* Checks whether the collection contains no elements.
* @return True if no elements are contained, false otherwise
*/
default public boolean isEmpty() {
return this.size() == 0;
}
}
package edu.caltech.cs2.interfaces;
/**
* This interface represents a deque - a data structure that can add and remove elements from either end of a list.
* @param <E> Element type
*/
public interface IDeque<E> extends ICollection<E> {
/**
* Add an element to the front end of the deque.
* @param e Element to add
*/
public void addFront(E e);
/**
* Add an element to the back end of the deque.
* @param e Element to add
*/
public void addBack(E e);
/**
* Adds an element to the collection.
* @param e Element to add
*/
default public void add(E e){
this.addFront(e);
}
/**
* Adds a collection of elements to this collection.
* @param c Collection of elements to add
*/
default public void addAll(ICollection<E> c) {
for (E e : c) {
this.add(e);
}
}
/**
* Removes and returns the element at the front end of the deque. Returns null if deque is empty.
* @return Element at front, if one exists; null otherwise
*/
public E removeFront();
/**
* Removes and returns the element at the back end of the deque. Returns null if deque is empty.
* @return Element at back, if one exists; null otherwise
*/
public E removeBack();
/**
* Removes all elements in the deque.
*/
default public void clear() {
while (!this.isEmpty()) {
this.removeBack();
}
}
/**
* Returns (but does not remove) the element at one end of the deque. Returns null if deque is empty.
* Note: The side you peek from should be chosen such that both the IQueue and IStack interfaces are implemented correctly.
* @return Element at one end, if one exists; null otherwise
*/
public E peek();
/**
* Returns (but does not remove) the element at the front end of the deque. Returns null if deque is empty.
* @return Element at front, if one exists; null otherwise
*/
public E peekFront();
/**
* Returns (but does not remove) the element at the back end of the deque. Returns null if deque is empty.
* @return Element at back, if one exists; null otherwise
*/
public E peekBack();
}
package edu.caltech.cs2.interfaces;
/**
* This interface represents a fixed-size queue - a queue with a constant and finite capacity.
* @param <E> Element type
*/
public interface IFixedSizeQueue<E> extends IQueue<E> {
/**
* Checks whether the fixed-size queue is full.
* @return True if full, false otherwise
*/
public boolean isFull();
/**
* Calculates the maximum capacity of the queue.
* @return Maximum capacity of the queue
*/
public int capacity();
}
\ No newline at end of file
package edu.caltech.cs2.interfaces;
/**
* This interface represents a queue - a data structure that can add elements at one end and remove them from the other.
* @param <E> Element type
*/
public interface IQueue<E> extends Iterable<E> {
/**
* Adds an element to the back of the queue.
* @param e Element to add
* @return True if successful, false otherwise (i.e. fixed data structure is full)
*/
public boolean enqueue(E e);
/**
* Removes and returns the element at the front of the queue. Returns null if queue is empty.
* @return Element at front of queue, if one exists; null otherwise
*/
public E dequeue();
/**
* Returns (but does not remove) the element at the front of the queue. Returns null if queue is empty.
* @return Element at front of queue, if one exists; null otherwise
*/
public E peek();
/**
* Calculates the size of the queue.
* @return Number of elements in the queue
*/
public int size();
}
package edu.caltech.cs2.interfaces;
/**
* This interface represents a stack - a data structure that can add elements remove elements from a single end.
* @param <E> Element type
*/
public interface IStack<E> extends Iterable<E> {
/**
* Adds an element to the top of the stack.
* @param e Element to add
* @return True if successful, false otherwise (i.e. fixed data structure is full)
*/
public boolean push(E e);
/**
* Removes and returns the element at the top of the stack. Returns null if stack is empty.
* @return Element at top of the stack, if one exists; null otherwise
*/
public E pop();
/**
* Returns (but does not remove) the element at the top of the stack. Returns null if stack is empty.
* @return Element at top of the stack, if one exists; null otherwise
*/
public E peek();
/**
* Calculates the size of the stack.
* @return Number of elements in the stack
*/
public int size();
}
package edu.caltech.cs2.project03;
import edu.caltech.cs2.datastructures.CircularArrayFixedSizeQueue;
import edu.caltech.cs2.interfaces.IQueue;
import java.util.Random;
public class CircularArrayFixedSizeQueueGuitarString {
public CircularArrayFixedSizeQueueGuitarString(double frequency) {
}
public int length() {
return -1;
}
public void pluck() {
}
public void tic() {
}
public double sample() {
return 0;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment