Browse Source

myarraylist finished probably

Jennifer Chao 6 years ago
parent
commit
f31208baa2
3 changed files with 25 additions and 27 deletions
  1. 7
    11
      src/main/java/MyArrayList.java
  2. 2
    0
      src/main/java/MySet.java
  3. 16
    16
      src/test/java/MyArrayListTest.java

+ 7
- 11
src/main/java/MyArrayList.java View File

@@ -97,22 +97,18 @@ public class MyArrayList<T> {
97 97
         return false;
98 98
     }
99 99
 
100
-    public int indexOf(T value) {
101
-        return 0;
102
-    }
103
-
104
-    public int lastIndexOf(T value) {
105
-        return 0; // -1 if doesnt contain
106
-    }
100
+//    public int indexOf(T value) {
101
+//        return 0;
102
+//    }
103
+//
104
+//    public int lastIndexOf(T value) {
105
+//        return 0; // -1 if doesnt contain
106
+//    }
107 107
 
108 108
     public int size() {
109 109
         return size;
110 110
     }
111 111
 
112
-    public T[] toArray() {
113
-        return null;
114
-    }
115
-
116 112
     public T[] getOriginalArray() {
117 113
         return originalArray;
118 114
     }

+ 2
- 0
src/main/java/MySet.java View File

@@ -0,0 +1,2 @@
1
+public class MySet {
2
+}

+ 16
- 16
src/test/java/MyArrayListTest.java View File

@@ -16,22 +16,22 @@ public class MyArrayListTest {
16 16
     }
17 17
 
18 18
 
19
-    @Test
20
-    public void test(){
21
-        Integer[] i = new Integer[0];
22
-        System.out.println(i.getClass());
23
-
24
-        Object[] objects = new Object[0];
25
-        System.out.println(objects.getClass());
26
-
27
-        populateArray();
28
-        System.out.println(testArray.get(0).getClass());
29
-
30
-        MyArrayList<String> testStringArray = new MyArrayList<>();
31
-        testStringArray.add("Meow");
32
-        System.out.println(testStringArray.get(0).getClass());
33
-        // System.out.println(testStringArray.getOriginalArray()[0]);
34
-    }
19
+//    @Test
20
+//    public void test(){
21
+//        Integer[] i = new Integer[0];
22
+//        System.out.println(i.getClass());
23
+//
24
+//        Object[] objects = new Object[0];
25
+//        System.out.println(objects.getClass());
26
+//
27
+//        populateArray();
28
+//        System.out.println(testArray.get(0).getClass());
29
+//
30
+//        MyArrayList<String> testStringArray = new MyArrayList<>();
31
+//        testStringArray.add("Meow");
32
+//        System.out.println(testStringArray.get(0).getClass());
33
+//        // System.out.println(testStringArray.getOriginalArray()[0]);
34
+//    }
35 35
 
36 36
     @Test
37 37
     public void initiateSizeOnConstruction() {