public class ComponentListImpl<C extends ModelComponent> extends ScannableList<C> implements java.lang.Iterable<C>, IndexedComponentList
Constructor and Description |
---|
ComponentListImpl(java.lang.Class<C> type,
CompositeComponent comp) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(C comp) |
void |
add(C comp,
int idx) |
void |
addComponents(ModelComponent[] comps,
int[] indices,
int ncomps)
Returns true if the added components are stateless
|
boolean |
addNumbered(C comp,
int number) |
void |
clear() |
void |
componentChanged(ComponentChangeEvent e) |
C |
get(java.lang.String nameOrNumber) |
C |
getByNumber(int num)
get (int idx) is provided by ScannableList
|
int |
getNumberLimit() |
boolean |
getOneBasedNumbering() |
int |
indexOf(ModelComponent comp) |
void |
invalidateNumbers()
Force update of numbering (for example, if a component's number
has been manually changed)
|
int |
nextComponentNumber() |
int |
numComponents() |
boolean |
postscanComponent(java.util.Deque<ScanToken> tokens,
CompositeComponent ancestor) |
C |
remove(int idx) |
boolean |
remove(java.lang.Object obj) |
void |
removeAll() |
boolean |
removeAll(java.util.Collection<?> objs) |
void |
removeComponents(ModelComponent[] comps,
int[] indices,
int ncomps)
Returns true if the added components are stateless
|
void |
resetNumbersToIndices()
Reset the number map so that numbers and indices match.
|
boolean |
scanAndStoreComponent(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
boolean |
scanAndStoreComponentByName(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
void |
scanBegin() |
void |
scanEnd() |
C |
set(int idx,
C comp) |
C |
setNumbered(int idx,
C comp,
int number) |
void |
setOneBasedNumbering(boolean enable) |
void |
updateNameMap(java.lang.String newName,
java.lang.String oldName,
ModelComponent comp) |
void |
writeComponents(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor) |
void |
writeComponentsByName(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor) |
add, addAll, contains, contains, containsAll, copy, createComponent, ensureCapacity, get, getTypeParameter, isEmpty, isWritable, iterator, retainAll, scan, size, toArray, toArray, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public ComponentListImpl(java.lang.Class<C> type, CompositeComponent comp)
public C get(java.lang.String nameOrNumber)
public C getByNumber(int num)
public int numComponents()
numComponents
in interface IndexedComponentList
public int indexOf(ModelComponent comp)
indexOf
in class ScannableList<C extends ModelComponent>
public int getNumberLimit()
public void componentChanged(ComponentChangeEvent e)
public void updateNameMap(java.lang.String newName, java.lang.String oldName, ModelComponent comp)
public int nextComponentNumber()
public boolean add(C comp)
add
in interface java.util.Collection<C extends ModelComponent>
add
in class ScannableList<C extends ModelComponent>
public void add(C comp, int idx)
public boolean addNumbered(C comp, int number)
public C set(int idx, C comp)
set
in class ScannableList<C extends ModelComponent>
public void addComponents(ModelComponent[] comps, int[] indices, int ncomps)
public boolean remove(java.lang.Object obj)
remove
in interface java.util.Collection<C extends ModelComponent>
remove
in class ScannableList<C extends ModelComponent>
public C remove(int idx)
remove
in class ScannableList<C extends ModelComponent>
public void removeComponents(ModelComponent[] comps, int[] indices, int ncomps)
public void removeAll()
public boolean removeAll(java.util.Collection<?> objs)
removeAll
in interface java.util.Collection<C extends ModelComponent>
removeAll
in class ScannableList<C extends ModelComponent>
public void clear()
clear
in interface java.util.Collection<C extends ModelComponent>
clear
in class ScannableList<C extends ModelComponent>
public void setOneBasedNumbering(boolean enable)
public boolean getOneBasedNumbering()
public void writeComponents(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
java.io.IOException
public void writeComponentsByName(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
java.io.IOException
public boolean scanAndStoreComponentByName(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
java.io.IOException
public void scanBegin()
public void scanEnd()
public boolean scanAndStoreComponent(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
java.io.IOException
public boolean postscanComponent(java.util.Deque<ScanToken> tokens, CompositeComponent ancestor) throws java.io.IOException
java.io.IOException
public void resetNumbersToIndices()
public void invalidateNumbers()