-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathList.java
More file actions
80 lines (69 loc) · 1.67 KB
/
Copy pathList.java
File metadata and controls
80 lines (69 loc) · 1.67 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package edu.cofc.cs.csci230;
/**
* List interface that "closely" resembles the List interface
* in the java.util package
*
* http://docs.oracle.com/javase/7/docs/api/java/util/List.html
*
* @author CSCI 230: Data Structures and Algorithms Fall 2016
*
* @param <AnyType>
*/
public interface List <AnyType> {
/**
* Appends the specified element to the end of this list.
*
* @param t
*/
public void add( AnyType t );
/**
* Inserts the specified element at the specified position in this list.
*
* @param index
* @param t
* @throws IndexOutOfBoundsException
*/
public void add( int index, AnyType t ) throws IndexOutOfBoundsException;
/**
* Replaces the element at the specified position in this list with the specified element.
*
* @param index
* @param t
* @throws IndexOutOfBoundsException
*/
public void set( int index, AnyType t ) throws IndexOutOfBoundsException;
/**
* Removes the element at the specified position in this list.
*
* @param index
* @return
* @throws IndexOutOfBoundsException
*/
public AnyType remove( int index ) throws IndexOutOfBoundsException;
/**
* Returns the element at the specified position in this list.
*
* @param index
* @return
* @throws IndexOutOfBoundsException
*/
public AnyType get( int index ) throws IndexOutOfBoundsException;
/**
* Returns the number of elements in this list.
*
* @return
*/
public int size();
/**
* Returns true if this list contains no elements.
*
* @return
*/
public Boolean isEmpty();
/**
* Removes all of the elements from this list.
*
*/
public void clear();
public int getCap();
} // end List interface definition