-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMyList.java
41 lines (36 loc) · 1.01 KB
/
MyList.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
This interface specifies the basic operations of any list-like object.
This interface contains a variation of the methods of the
standard java.util.List interface.
*/
public interface MyList {
/**
Adds an element at the end of the list.
*/
public void append(Object o);
/**
Inserts an element at the specified index
Throws NoSuchElementException if index is out of bounds.
*/
public void insertAt(int index, Object o);
/**
Removes the element at the specified index
Throws NoSuchElementException if index is out of bounds.
*/
public void removeAt(int index);
/**
Returns the element at the specified index
Throws NoSuchElementException if index is out of bounds.
*/
public Object getAt(int index);
/**
Returns the size of the list.
@return the number of elements in the list
*/
public int getSize();
/**
Returns a list iterator for this list.
@return a list iterator for this list
*/
public MyListIterator getIterator();
}