public class List
extends java.lang.Object
implements IList
Constructor and Description |
---|
List()
List constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object o)
Appends an object to the end of the list.
|
boolean |
add(java.lang.Object o,
int idx)
Adds a new element to the list at the index specified as an argument.
|
int |
find(java.lang.Object o)
Returns the index at which the object passed as an argument can be found
in the list.
|
java.lang.Object |
get(int idx)
Returns the list element stored at the index specified as an argument.
|
int |
getLength()
Returns the number of elements in the list.
|
java.lang.Object |
remove(int idx)
Removes the list element located at the index specified as an argument.
|
java.lang.String |
toString()
Returns a String representation of the list elements.
|
public void add(java.lang.Object o)
add
in interface IList
public boolean add(java.lang.Object o, int idx)
add
in interface IList
idx
- the index at which the new element should be found once it
has been added to the list.public int find(java.lang.Object o)
find
in interface IList
public java.lang.Object get(int idx)
get
in interface IList
public int getLength()
getLength
in interface IList
public java.lang.Object remove(int idx)
remove
in interface IList
public java.lang.String toString()
toString
in interface IList
toString
in class java.lang.Object