-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPListInterface.java
More file actions
38 lines (27 loc) · 1.13 KB
/
PListInterface.java
File metadata and controls
38 lines (27 loc) · 1.13 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
34
35
36
37
38
public interface PListInterface {
public void add(Object item);
// adds item to the start of the PList
public void append(Object item);
// places item at the end of the PList
public void concatenate(PListInterface plist);
// joins plist to this PList to create a longer list
public void delete(int index);
// removes the item at index from the PList.
// if the index does not exist, nothing happens
public Object get(int index);
// returns the data item at index
public void insert(Object item, int index);
// places item at the specified index
// if the index is past the end of the list,
// item is added at the end of the PList
public int length();
// returns length of the PListInterface
public void print();
// displays to the screen the items in PList from beginning to end
// this is an option used for testing and verification
public void remove(Object item);
// removes the data entry that matches item from the PList
public void sort();
// sorts all items in PList by comparing the toString() values
// of each data item
}