public class List
extends java.lang.Object
Constructor and Description |
---|
List()
Creates an empty list.
|
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.Object o)
Adds the specified object to the end of the list.
|
void |
clear()
Completely empties the list.
|
void |
concat(List l)
Concatenates a specified list to the list.
|
int |
count()
Deprecated.
use getLength() instead to not change the currently selected object.
|
int |
getLength()
Returns the amount of elements in the list.
|
java.lang.Object |
getObject()
Returns the content of the currently selected object if a currently selected object exists.
|
boolean |
hasAccess()
Returns whether a currently selected object exists.
|
void |
insert(java.lang.Object o)
If there is a currently selected object the specified element is added before it.
|
boolean |
isEmpty()
Returns whether the list is empty.
|
boolean |
isType(java.lang.Class c)
Returns whether all contents of the list are objects of the specified class and sets the currently selected
object to the first object.
|
boolean |
isTypeOrNull(java.lang.Class c)
Returns whether all contents of the list are objects of the specified class or null and sets the currently
selected object to the first object.
|
void |
next()
If the list is not empty, a currently selected object exists and the currently selected object is not the last
element in the list the current pointer moves to the next object.
|
void |
previous()
If there is a currently selected object the previous object becomes the currently selected object.
|
void |
print()
Prints all entries of the list, one line per entry, using .toString() to get its String representation.
|
void |
remove()
If there is a currently selected object it is removed from the list and the object behind it becomes the new
currently selected object.
|
void |
reverse()
Inverts the list.
|
void |
setObject(java.lang.Object o)
Replaces the content of the currently selected object with the specified content if there is any.
|
boolean |
sharesNoEntry(List l)
Checks whether the list has no entry that fits Object.equals() for any object in the specified list.
|
static boolean |
sharesNoEntry(List a,
List b)
Checks whether two lists have no entries that fit Object.equals().
|
void |
toFirst()
Moves the currently selected object pointer to the first object of the list.
|
void |
toLast()
Moves the currently selected object pointer to the last object of the list.
|
public boolean isEmpty()
public void clear()
public boolean hasAccess()
public void next()
public void toFirst()
public void toLast()
public java.lang.Object getObject()
public void setObject(java.lang.Object o)
o
- any object.public void append(java.lang.Object o)
o
- any object.public void insert(java.lang.Object o)
o
- any object.public void previous()
public void concat(List l)
l
- any list.public void remove()
@Deprecated public int count()
public int getLength()
public void reverse()
public void print()
public boolean isTypeOrNull(java.lang.Class c)
c
- an object of the Class to check the list's content objects against.public boolean isType(java.lang.Class c)
c
- an object of the Class to check the list's content objects against.public static boolean sharesNoEntry(List a, List b)
a
- any list.b
- a second list.public boolean sharesNoEntry(List l)
l
- any list.