Commit c890606abc21eb07e7fdfcbda6984eb4527fa2d5

Authored by Adrian Chirita
1 parent 0b118bec

siste versjon

.classpath
... ... @@ -2,6 +2,7 @@
2 2 <classpath>
3 3 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4 4 <classpathentry kind="src" path="src"/>
  5 + <classpathentry kind="src" path="test"/>
5 6 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
6 7 <classpathentry kind="output" path="bin"/>
7 8 </classpath>
... ...
src/oblig_2/Tree.java deleted
1   -package oblig_2;
2   -
3   -import java.util.Collection;
4   -
5   -public interface Tree<E> extends Collection<E> {
6   - public boolean search(E e);
7   - public boolean insert(E e);
8   - public boolean delete(E e);
9   - public int getSize();
10   - public default void inorder() {
11   - }
12   - public default void postorder() {
13   - }
14   - public default void preorder() {
15   - }
16   - @Override
17   - public default boolean isEmpty() {
18   - return this.size() == 0;
19   - }
20   - @Override
21   - public default boolean contains(Object e) {
22   - return search((E)e);
23   - }
24   - @Override
25   - public default boolean add(E e) {
26   - return insert(e);
27   - }
28   - @Override
29   - public default boolean remove(Object e) {
30   - return delete((E) e);
31   - }
32   - @Override
33   - public default int size() {
34   - return getSize();
35   - }
36   - @Override
37   - public default boolean containsAll(Collection<?> c) {
38   - return false;
39   - }
40   - @Override
41   - public default boolean addAll(Collection<? extends E> c) {
42   - return false;
43   - }
44   - @Override
45   - public default boolean removeAll(Collection<?> c) {
46   - return false;
47   - }
48   - @Override
49   - public default boolean retainAll(Collection<?> c) {
50   - return false;
51   - }
52   - @Override
53   - public default Object[] toArray() {
54   - return null;
55   - }
56   - @Override
57   - public default <T> T[] toArray(T[] array) {
58   - return null;
59   - }
60   -}
src/oblig_2/Main.java renamed to src/oppgave1/Main.java
1   -package oblig_2;
  1 +package oppgave1;
2 2  
3 3 import java.util.Iterator;
4 4 import java.util.LinkedList;
... ...
src/oblig_2/MyList.java renamed to src/oppgave1/MyList.java
1   -package oblig_2;
  1 +package oppgave1;
2 2  
3 3  
4 4 import java.util.Collection;
... ...
src/oblig_2/TwoWayLinkedList.java renamed to src/oppgave1/TwoWayLinkedList.java
1   -package oblig_2;
  1 +package oppgave1;
2 2 import java.util.Iterator;
3 3  
4 4 import java.util.ListIterator;
5   -import oblig_2.TwoWayLinkedList;
  5 +
  6 +import oppgave1.TwoWayLinkedList;
6 7  
7 8 public class TwoWayLinkedList<E> implements MyList<E> {
8 9 private Node<E> head, tail;
... ...
src/test/TwoWayLinkedListTest.java renamed to test/oppgave1/TwoWayLinkedListTest.java
1   -package test;
  1 +package oppgave1;
2 2  
3 3 import java.util.Iterator;
4   -
5 4 import java.util.ListIterator;
6 5  
7 6 import static org.junit.Assert.*;
... ... @@ -9,7 +8,7 @@ import static org.hamcrest.CoreMatchers.*;
9 8 import org.junit.Before;
10 9 import org.junit.Test;
11 10  
12   -import oblig_2.TwoWayLinkedList;
  11 +import oppgave1.TwoWayLinkedList;
13 12  
14 13 public class TwoWayLinkedListTest {
15 14  
... ...