File tree 1 file changed +44
-18
lines changed
1 file changed +44
-18
lines changed Original file line number Diff line number Diff line change 6
6
* This interface is to define bacis functionality expected out of any implementation class
7
7
* Since this is a data structure it should have the flexibility to contain any kind of object hence it has been made generic
8
8
* Any implementation class need not to be thread safe or it could be depending on the implementation class how does it want to behave.
9
+ *
9
10
* @param <T>
10
11
*/
11
12
public interface DataStructure <T > extends Iterator <T > {
12
13
13
- //Method to add element in the structure
14
- public boolean add (T t );
15
-
16
- //Method to remove the given object from structure
17
- public boolean remove (T o );
18
-
19
- //Method to get Iterator to parse on the given structure
20
- public Iterator <T > iterator ();
21
-
22
- //Method to check if structure is empty
23
- public boolean isEmpty ();
24
-
25
- //Method to get all the elements of data structure in array
26
- public Object [] toArray ();
27
-
28
- //Method to get the size or number of elements in structure
29
- public int size ();
30
-
14
+ /**
15
+ * Method to add element in the structure
16
+ *
17
+ * @param t element
18
+ * @return boolean
19
+ */
20
+ boolean add (T t );
21
+
22
+ /**
23
+ * Method to remove the given object from structure
24
+ *
25
+ * @param o element
26
+ * @return boolean
27
+ */
28
+ boolean remove (T o );
29
+
30
+ /**
31
+ * Method to get Iterator to parse on the given structure
32
+ *
33
+ * @return iterator
34
+ */
35
+ Iterator <T > iterator ();
36
+
37
+ /**
38
+ * Method to check if structure is empty
39
+ *
40
+ * @return boolean
41
+ */
42
+ boolean isEmpty ();
43
+
44
+ /**
45
+ * Method to get all the elements of data structure in array
46
+ *
47
+ * @return arr
48
+ */
49
+ Object [] toArray ();
50
+
51
+ /**
52
+ * Method to get the size or number of elements in structure
53
+ *
54
+ * @return size
55
+ */
56
+ int size ();
31
57
}
You can’t perform that action at this time.
0 commit comments