-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListInt.java
More file actions
33 lines (28 loc) · 1.03 KB
/
Copy pathListInt.java
File metadata and controls
33 lines (28 loc) · 1.03 KB
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
public interface ListInt {
// add - adds value to end of the array
// precond: int value - value to add to the end
// postcond:
void add(Comparable value);
// add - adds value to the given index
// precond: int index - index to add to
// int value - value to add
// postcond:
void add(int index, Comparable value);
// remove - removes the value at the given index
// precond: int index - index to remove the value from
// postcond:
void remove(int index);
// get - returns value at an index
// precond: int index - index to retrieve
// postcond: int - value at the specified index
Comparable get(int index);
// set - changes value at index, returns old value
// precond: int index - index to give value to
// int value - value to set
// postcond: int - old value at index
Comparable set(int index, Comparable value);
// size - returns size of array data
// precond:
// postcond: int - length of array data
int size();
}