|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.AnnotatedEntityList<T>
T - an extension of AnnotatedEntitypublic class AnnotatedEntityList<T extends AnnotatedEntity>
Class for a list of AnnotatedEntitys where
elements can be accessed either by index or by the name
of the AnnotatedEntity.
| Constructor Summary | |
|---|---|
AnnotatedEntityList()
Creates a new AnnotatedEntityList with an initial
capacity of 10. |
|
AnnotatedEntityList(int initialCapacity)
Creates a new AnnotatedEntityList with given initial
capacity. |
|
| Method Summary | ||
|---|---|---|
void |
add(int idx,
T entity)
Adds the AnnotatedEntity entity
at index idx to the list. |
|
void |
add(T... entities)
Adds all AnnotatedEntitys in entities
to the list. |
|
void |
addAll(Collection<? extends T> entities)
Adds all AnnotatedEntitys in entities
to the list. |
|
T |
get(int index)
Returns the AnnotatedEntity at index index
in the list. |
|
T |
get(String name)
Returns the AnnotatedEntity with name name
in the list. |
|
String[] |
getNames()
Returns the names of all AnnotatedEntitys in the list. |
|
T |
remove(int idx)
Removes and returns the AnnotatedEntity at index idx. |
|
void |
set(int idx,
T entity)
Replaces the AnnotatedEntity at index idx with
the AnnotatedEntity entity/code> |
|
int |
size()
Returns the number of AnnotatedEntitys (not the capacity)
in the AnnotatedEntityList. |
|
|
toArray(E[] ar)
Returns the AnnotatedEntitys in this list
as an array. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotatedEntityList()
AnnotatedEntityList with an initial
capacity of 10.
public AnnotatedEntityList(int initialCapacity)
AnnotatedEntityList with given initial
capacity.
initialCapacity - the initial capacity| Method Detail |
|---|
public void set(int idx,
T entity)
AnnotatedEntity at index idx with
the AnnotatedEntity entity/code>
- Parameters:
idx - the indexentity - the new AnnotatedEntity at index idx
public T remove(int idx)
AnnotatedEntity at index idx.
idx - the index of the AnnotatedEntity to be removed
AnnotatedEntity that has been at index idx
public void add(int idx,
T entity)
AnnotatedEntity entity
at index idx to the list. If entities contains AnnotatedEntitys with duplicate names,
or an AnnotatedEntity with identical name already exists in the list,
an IllegalArgumentException is thrown.
idx - the indexentity - the added AnnotatedEntityList.add(int, Object)public void add(T... entities)
AnnotatedEntitys in entities
to the list. If entities contains AnnotatedEntitys with duplicate names,
or an AnnotatedEntity with identical name already exists in the list,
an IllegalArgumentException is thrown.
entities - the added AnnotatedEntitypublic void addAll(Collection<? extends T> entities)
AnnotatedEntitys in entities
to the list. If entities contains AnnotatedEntitys with duplicate names,
or an AnnotatedEntity with identical name already exists in the list,
an IllegalArgumentException is thrown.
entities - the added AnnotatedEntitypublic T get(int index)
AnnotatedEntity at index index
in the list.
index - the index
AnnotatedEntity at indexpublic T get(String name)
AnnotatedEntity with name name
in the list.
name - the name
AnnotatedEntity with name nameAnnotatedEntity.getName()public int size()
AnnotatedEntitys (not the capacity)
in the AnnotatedEntityList.
AnnotatedEntityspublic String[] getNames()
AnnotatedEntitys in the list.
AnnotatedEntity.getName()public <E extends T> E[] toArray(E[] ar)
AnnotatedEntitys in this list
as an array. This method behaves exactly like ArrayList.toArray(Object[]).
E - a sub-type of AnnotatedEntityar - an array of the desired type
AnnotatedEntitys in this list as an array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||