forked from sensei-thundercleese/closet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListInt.java
More file actions
30 lines (22 loc) · 828 Bytes
/
Copy pathListInt.java
File metadata and controls
30 lines (22 loc) · 828 Bytes
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
/*==================================================
interface ListInt
Declares methods that will be implemented by any
class wishing to adhere to this specification.
This interface specifies behaviors of a list of ints.
==================================================*/
public interface ListInt {
// Return number of meaningful elements in the list
int size();
// Append an int to the end. Return true.
boolean add( int num );
// Insert an int at index
void add( int index, int num );
// Retrieve the int at index
int get( int index );
// Overwrite the int at index
int set( int index, int num );
// Remove the int at index,
// shifting any elements after it to the left.
// Return removed value.
int remove( int index );
}//end interface ListInt