|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.AnnotatedEntityList<T>
T
- an extension of AnnotatedEntity
public class AnnotatedEntityList<T extends AnnotatedEntity>
Class for a list of AnnotatedEntity
s 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 AnnotatedEntity s in entities
to the list. |
|
void |
addAll(Collection<? extends T> entities)
Adds all AnnotatedEntity s 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 AnnotatedEntity s 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 AnnotatedEntity s (not the capacity)
in the AnnotatedEntityList . |
|
|
toArray(E[] ar)
Returns the AnnotatedEntity s 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 capacityMethod 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
remove
public T remove(int idx)
- Removes and returns the
AnnotatedEntity
at index idx
.
- Parameters:
idx
- the index of the AnnotatedEntity
to be removed
- Returns:
- the
AnnotatedEntity
that has been at index idx
add
public void add(int idx,
T entity)
- Adds the
AnnotatedEntity
entity
at index idx
to the list. If entities
contains AnnotatedEntity
s with duplicate names,
or an AnnotatedEntity
with identical name already exists in the list,
an IllegalArgumentException
is thrown.
- Parameters:
idx
- the indexentity
- the added AnnotatedEntity
- See Also:
List.add(int, Object)
add
public void add(T... entities)
- Adds all
AnnotatedEntity
s in entities
to the list. If entities
contains AnnotatedEntity
s with duplicate names,
or an AnnotatedEntity
with identical name already exists in the list,
an IllegalArgumentException
is thrown.
- Parameters:
entities
- the added AnnotatedEntity
addAll
public void addAll(Collection<? extends T> entities)
- Adds all
AnnotatedEntity
s in entities
to the list. If entities
contains AnnotatedEntity
s with duplicate names,
or an AnnotatedEntity
with identical name already exists in the list,
an IllegalArgumentException
is thrown.
- Parameters:
entities
- the added AnnotatedEntity
get
public T get(int index)
- Returns the
AnnotatedEntity
at index index
in the list.
- Parameters:
index
- the index
- Returns:
- the
AnnotatedEntity
at index
get
public T get(String name)
- Returns the
AnnotatedEntity
with name name
in the list.
- Parameters:
name
- the name
- Returns:
- the
AnnotatedEntity
with name name
- See Also:
AnnotatedEntity.getName()
size
public int size()
- Returns the number of
AnnotatedEntity
s (not the capacity)
in the AnnotatedEntityList
.
- Returns:
- the number of
AnnotatedEntity
s
getNames
public String[] getNames()
- Returns the names of all
AnnotatedEntity
s in the list.
- Returns:
- the names
- See Also:
AnnotatedEntity.getName()
toArray
public <E extends T> E[] toArray(E[] ar)
- Returns the
AnnotatedEntity
s in this list
as an array. This method behaves exactly like ArrayList.toArray(Object[])
.
- Type Parameters:
E
- a sub-type of AnnotatedEntity
- Parameters:
ar
- an array of the desired type
- Returns:
- the
AnnotatedEntity
s in this list as an array
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD