public abstract class DictionaryComponentTable<T extends DictionaryComponent> extends DictionaryObject implements java.util.List<T>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SORT |
static java.lang.String |
SORT_ASCEND |
static java.lang.String |
SORT_DECEND |
Modifier and Type | Method and Description |
---|---|
T |
add()
Add a new element to the table and return the new element.
|
abstract T |
add(int index)
Add a new element to the table at the specified location
and return the new element
Must be abstract because generics cannot do "new T"
|
boolean |
add(T o)
Used internally by subclasses.
|
void |
clear()
remove all elements in the table
|
boolean |
contains(java.lang.Object o)
return if the the table contains the object
|
boolean |
containsAll(java.util.Collection<?> c)
returns true if the table contains all of the components in the
Collection argument
|
T |
copyTo(int index,
T from) |
void |
cut(T dc)
Cut (remove) the given component from this table.
|
java.util.List<T> |
filter(java.lang.String filterPattern,
boolean translate)
Get the Dictionary Components in this table that match the given pattern
|
T |
get(int index)
retrieve the ith element from the table
|
java.util.List<DOID> |
getAEReferences()
Get DOIDs referenced by this Object and descendants.
|
java.util.List<DOID> |
getAllReferences()
Get all DOIDs referenced by this Object and descendants.
|
T |
getByAlias(java.lang.String alias)
Get a DictionaryComponent from this table by its alias.
|
T |
getByAlias(java.lang.String alias,
boolean translate)
Get a DictionaryComponent from this table by its (translated) alias.
|
T |
getByID(DOID id)
Get a DictionaryComponent from this table by its ID.
|
T |
getByName(java.lang.String name)
Get a DictionaryComponent from this table by its name.
|
T |
getLast()
Get the last entry in the table
|
DictionaryComponent[] |
getMarked()
|
T |
getProtoType()
The following prototype related operations do not bump the change count of the dictionary:
1.
|
int |
indexOf(java.lang.Object o)
get the index of the Object argument
|
boolean |
isEmpty()
return if the table is empty
|
boolean |
isLocked()
Whether the table is locked (is readonly)
|
java.util.Iterator<T> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
java.util.ListIterator<T> |
listIterator()
Returns a list iterator over the elements in this list (in proper
sequence).
|
java.util.ListIterator<T> |
listIterator(int index)
Returns a list iterator over the elements in this list (in proper
sequence), starting at the specified position in the list.
|
void |
mark(int[] index)
Mark the rows with the given indexes
|
T |
move(int index,
boolean up)
Shift the entry defined by index either
up or down one entry in the table.
|
void |
move(int fromIndex,
int toIndex,
boolean replace)
Move the DictionaryComponent with the given id from its
current location to the location of the second id.
|
static java.util.List<java.lang.Integer> |
ordering(java.util.List<? extends DictionaryComponent> list) |
T |
paste(T dc)
Paste a cut or existing component at the end of this table
|
T |
remove(int index)
Remove the DictionaryComponent at the given index from the table
|
boolean |
remove(java.lang.Object o)
remove the DictionaryComponent from this table
|
boolean |
removeAll(java.util.Collection<?> c)
remove all of the elements in the Collection from this table
|
T |
removeByAlias(java.lang.String alias)
Remove the DictionaryComponent with the given alias from the table
|
T |
removeByID(DOID id)
Remove the DictionaryComponent with the given id from the table
|
T |
removeByName(java.lang.String name)
Remove the DictionaryComponent with the given name from the table
|
int |
removeMarked() |
void |
reorder(java.util.List<java.lang.Integer> ordering)
reorder this table according to a list of indexes.
|
T |
set(int index,
T element)
Used internally by subclasses.
|
int |
size()
return the size of the table
|
static void |
sort(java.util.List<? extends DictionaryComponent> list,
java.lang.String prop,
boolean ascending)
Sorts the components in the given list by the property and sort order specified
|
void |
sort(java.lang.String prop) |
void |
sort(java.lang.String prop,
boolean ascending) |
java.util.List<T> |
subList(int fromIndex,
int toIndex)
Not Supported
|
java.lang.Object[] |
toArray()
Returns an array containing all of the elements in this list in proper
sequence (from first to last element).
|
<U> U[] |
toArray(U[] a)
Returns an array containing all of the elements in this list in
proper sequence (from first to last element); the runtime type of
the returned array is that of the specified array.
|
void |
unMark()
Clear marks.
|
void |
validate(java.util.List<SDKException> errors,
java.util.List<SDKWarning> warnings)
Validate the entire dictionary object and its decendants.
|
void |
validate(java.util.List<SDKException> errors,
java.util.List<SDKWarning> warnings,
int modelChangeLowerBound,
int ruleChangeLowerBound)
Validate each DictionaryObject in the table.
|
equals, exists, getCombinedDataModel, getContainedIDs, getContainedIDs, getDataModel, getDictionary, getID, getObjectPath, getObjectType, getParentByClass, getParentComponent, getParentComponentTable, getParentObject, getReferences, getRuleSet, getState, getWarnings, hashCode, isModified, validate
public static final java.lang.String SORT_ASCEND
public static final java.lang.String SORT_DECEND
public static final java.lang.String SORT
public T getProtoType()
public T getByName(java.lang.String name)
name
- name of componentpublic T getByID(DOID id)
id
- ID of componentpublic T getByAlias(java.lang.String alias, boolean translate)
alias
- alias of componenttranslate
- flagpublic T getByAlias(java.lang.String alias)
alias
- alias of componentpublic T removeByID(DOID id) throws DeleteException
id
- the id returned by DictionaryComponent.getId()DeleteException
- if the component cannot be removed (e.g. a Java Method)public T removeByName(java.lang.String name) throws DeleteException
name
- the name returned by DictionaryComponent.getName()DeleteException
public T removeByAlias(java.lang.String alias) throws DeleteException
alias
- the alias returned by DictionaryComponent.getAlias()DeleteException
public void validate(java.util.List<SDKException> errors, java.util.List<SDKWarning> warnings, int modelChangeLowerBound, int ruleChangeLowerBound)
validate
in class DictionaryObject
errors
- validation errorswarnings
- validation warningsmodelChangeLowerBound
- determines what needs to be re-validated based on changes to the dictionaryruleChangeLowerBound
- smallest RuleComponent.CreationUpdateNumber modified in thix tx.
Rulesets and rules with UpdateNumber >= modelChangeLowerBound will be revalidated.
a value of 0 will force revalidation of all rulesets. A value of Integer.MAX_VALUE
will skip validation of all rulesets.public void validate(java.util.List<SDKException> errors, java.util.List<SDKWarning> warnings)
DictionaryObject
validate
in class DictionaryObject
errors
- a List of error exceptions to append to.warnings
- a List of warning exceptions to append to.DictionaryObject.validate(List,List,int,int)
public int size()
size
in interface java.util.Collection<T extends DictionaryComponent>
size
in interface java.util.List<T extends DictionaryComponent>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<T extends DictionaryComponent>
isEmpty
in interface java.util.List<T extends DictionaryComponent>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<T extends DictionaryComponent>
contains
in interface java.util.List<T extends DictionaryComponent>
o
- element whose presence in this list is to be testedpublic java.util.List<DOID> getAEReferences()
DictionaryObject
getAEReferences
in class DictionaryObject
public java.util.List<DOID> getAllReferences()
DictionaryObject
getAllReferences
in class DictionaryObject
public java.util.Iterator<T> iterator()
java.util.List
iterator
in interface java.lang.Iterable<T extends DictionaryComponent>
iterator
in interface java.util.Collection<T extends DictionaryComponent>
iterator
in interface java.util.List<T extends DictionaryComponent>
public java.util.ListIterator<T> listIterator()
java.util.List
listIterator
in interface java.util.List<T extends DictionaryComponent>
public java.util.ListIterator<T> listIterator(int index)
java.util.List
next
.
An initial call to previous
would
return the element with the specified index minus one.listIterator
in interface java.util.List<T extends DictionaryComponent>
index
- index of the first element to be returned from the
list iterator (by a call to next
)public java.lang.Object[] toArray()
java.util.List
The returned array will be "safe" in that no references to it are maintained by this list. (In other words, this method must allocate a new array even if this list is backed by an array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
toArray
in interface java.util.Collection<T extends DictionaryComponent>
toArray
in interface java.util.List<T extends DictionaryComponent>
Arrays.asList(Object[])
public <U> U[] toArray(U[] a)
java.util.List
If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the list is set to null. (This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.)
Like the List.toArray()
method, this method acts as bridge between
array-based and collection-based APIs. Further, this method allows
precise control over the runtime type of the output array, and may,
under certain circumstances, be used to save allocation costs.
Suppose x is a list known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:
String[] y = x.toArray(new String[0]);Note that toArray(new Object[0]) is identical in function to toArray().
toArray
in interface java.util.Collection<T extends DictionaryComponent>
toArray
in interface java.util.List<T extends DictionaryComponent>
a
- the array into which the elements of this list are to
be stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.public boolean add(T o)
add
in interface java.util.Collection<T extends DictionaryComponent>
add
in interface java.util.List<T extends DictionaryComponent>
o
- component to be added, must be of correct type for table.Collection.add(E)
)public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<T extends DictionaryComponent>
containsAll
in interface java.util.List<T extends DictionaryComponent>
c
- collection to be checked for containment in this listList.contains(Object)
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<T extends DictionaryComponent>
removeAll
in interface java.util.List<T extends DictionaryComponent>
c
- collection containing elements to be removed from this listList.remove(Object)
,
List.contains(Object)
public void clear()
clear
in interface java.util.Collection<T extends DictionaryComponent>
clear
in interface java.util.List<T extends DictionaryComponent>
public T get(int index)
get
in interface java.util.List<T extends DictionaryComponent>
index
- index of the element to returnpublic T set(int index, T element)
set
in interface java.util.List<T extends DictionaryComponent>
index
- at which to replace the new row.element
- to replace existing, must be of correct type for table.public T remove(int index)
remove
in interface java.util.List<T extends DictionaryComponent>
index
- the index of the RuleCompoonent in the table.public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<T extends DictionaryComponent>
remove
in interface java.util.List<T extends DictionaryComponent>
o
- element to be removed from this list, if presentpublic void move(int fromIndex, int toIndex, boolean replace)
fromIndex
- the index of the row to movetoIndex
- move row to this locationreplace
- if true, replace existing row at toIndex, if false move existing row to next higher indexpublic T move(int index, boolean up)
index
- up
- booleanpublic int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<T extends DictionaryComponent>
o
- element to search forpublic java.util.List<T> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<T extends DictionaryComponent>
fromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subListjava.lang.UnsupportedOperationException
public T add()
java.lang.UnsupportedOperationException
- if table is locked.public abstract T add(int index)
public void cut(T dc)
DictionaryComponentTable.paste(T)
to paste
the component into this or a different tabledc
- public T paste(T dc)
dc
- the component to paste into the tablepublic void reorder(java.util.List<java.lang.Integer> ordering)
ordering
- a list of indexes the same size as this list.public static java.util.List<java.lang.Integer> ordering(java.util.List<? extends DictionaryComponent> list)
public T getLast()
public void mark(int[] index)
index
- an Array containing row numbers (not ID's) to be removedpublic void unMark()
public DictionaryComponent[] getMarked()
public int removeMarked() throws DeleteException
DeleteException
DictionaryComponentTable.mark(int[])
public void sort(java.lang.String prop)
public void sort(java.lang.String prop, boolean ascending)
public static void sort(java.util.List<? extends DictionaryComponent> list, java.lang.String prop, boolean ascending)
list
- Collection of components to be sortedprop
- Property value to be sorted byascending
- true if ascending sort order, false if descending sort orderpublic java.util.List<T> filter(java.lang.String filterPattern, boolean translate)
filterPattern
- pattern for filteringtranslate
- boolean value to indicate if the translated value should be used for filteringpublic boolean isLocked()