T - the type of item for this list (e.g. Note, Match, etc.).public abstract class BaseList<T> extends Object implements Iterable<T>
BaseList must be supported in the CloneFactory.| Modifier | Constructor and Description |
|---|---|
protected |
BaseList()
Creates an empty
BaseList object. |
protected |
BaseList(BaseList<T> original)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
T |
add(T object)
Adds an object to this list.
|
void |
clear()
Removes all objects in this list.
|
T |
get(int index)
Gets the object at a given index position.
|
boolean |
isEmpty()
Indicates if this list is empty.
|
Iterator<T> |
iterator() |
void |
remove(int index)
Removes from this list the object at the given index position.
|
void |
remove(T object)
Removes a given object from this list.
|
T |
set(int index,
T object)
Replaces an existing object by a new one at a given index position.
|
int |
size()
Gets the number of objects in this list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected BaseList()
BaseList object.public int size()
public boolean isEmpty()
public void clear()
public T add(T object)
object - the object to add.public void remove(int index)
index - the index position.IndexOutOfBoundsException - if the index is invalid.public void remove(T object)
object - the object to remove.public T get(int index)
index - the index position.IndexOutOfBoundsException - if the index is invalid.public T set(int index, T object)
index - the index position.object - the new object to set.IndexOutOfBoundsException - if the index is invalid.Copyright © 2020. All rights reserved.