Package oracle.rules.sdk2.dictionary
Class DictionaryComponentTable<T extends DictionaryComponent>
java.lang.Object
oracle.rules.sdk2.dictionary.DictionaryObject
oracle.rules.sdk2.dictionary.DictionaryComponentTable<T>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>
- Direct Known Subclasses:
DictionaryLinkTable,ModelComponentTable,RuleComponentTable
public abstract class DictionaryComponentTable<T extends DictionaryComponent>
extends DictionaryObject
implements List<T>
A dictionary component table is a List of DictionaryComponents.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal void_clear()_remove(int index) final booleanadd()Add a new element to the table and return the new element.abstract Tadd(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"voidUsed internally by subclasses.booleanUsed internally by subclasses.booleanaddAll(int index, Collection<? extends T> c) booleanaddAll(Collection<? extends T> c) Used internally by subclasses.voidclear()remove all elements in the tablebooleanreturn if the the table contains the objectbooleancontainsAll(Collection<?> c) returns true if the table contains all of the components in the Collection argumentCopy "from" object component of type T to this component table that holds components of type T.voidCut (remove) the given component from this table.Get the Dictionary Components in this table that match the given patternget(int index) retrieve the ith element from the tableGet DOIDs referenced by this Object and descendants.Get all DOIDs referenced by this Object and descendants.getByAlias(String alias) Get a DictionaryComponent from this table by its alias.getByAlias(String alias, boolean translate) Get a DictionaryComponent from this table by its (translated) alias.Get a DictionaryComponent from this table by its ID.Get a DictionaryComponent from this table by its name.Get all ExprParsers that are directly or Indirectly referenced by this dictionary Object and its descendantsgetLast()Get the last entry in the tableseemark(int[])The following prototype related operations do not bump the change count of the dictionary: 1.intget the index of the Object argumentbooleanisEmpty()return if the table is emptybooleanisLocked()Whether the table is locked (is readonly)iterator()intlistIterator(int index) voidmark(int[] index) Mark the rows with the given indexesmove(int index, boolean up) Shift the entry defined by index either up or down one entry in the table.voidmove(int fromIndex, int toIndex, boolean replace) Move the DictionaryComponent with the given id from its current location to the location of the second id.ordering(List<? extends DictionaryComponent> list) Paste a cut or existing component at the end of this tableremove(int index) Remove the DictionaryComponent at the given index from the tablebooleanremove the DictionaryComponent from this tablebooleanremoveAll(Collection<?> c) remove all of the elements in the Collection from this tableremoveByAlias(String alias) Remove the DictionaryComponent with the given alias from the tableremoveByID(DOID id) Remove the DictionaryComponent with the given id from the tableremoveByName(String name) Remove the DictionaryComponent with the given name from the tableintvoidvoidreorder this table according to a list of indexes.booleanretainAll(Collection<?> c) Used internally by subclasses.intsize()return the size of the tablevoidvoidstatic voidsort(List<? extends DictionaryComponent> list, String prop, boolean ascending) Sorts the components in the given list by the property and sort order specifiedsubList(int fromIndex, int toIndex) Not SupportedObject[]toArray()<U> U[]toArray(U[] a) voidunMark()Clear marks.voidvalidate(List<SDKException> errors, List<SDKWarning> warnings) Validate the entire dictionary object and its decendants.voidvalidate(List<SDKException> errors, List<SDKWarning> warnings, int modelChangeLowerBound, int ruleChangeLowerBound) Validate each DictionaryObject in the table.Methods inherited from class oracle.rules.sdk2.dictionary.DictionaryObject
_clearID, equals, exists, getAEReferenceCount, getCombinedDataModel, getContainedIDs, getContainedIDs, getDataModel, getDictionary, getID, getIndent, getObjectPath, getObjectType, getParentByClass, getParentComponent, getParentComponentTable, getParentObject, getReferences, getRuleSet, getState, getWarnings, hashCode, isModified, setID, validateMethods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
equals, hashCode, replaceAll, sort, spliterator
-
Field Details
-
SORT_ASCEND
- See Also:
-
SORT_DECEND
- See Also:
-
SORT
- See Also:
-
-
Method Details
-
getProtoType
The following prototype related operations do not bump the change count of the dictionary: 1. Getting a prototype from a DictionaryComponentTable. This could be either through getProtoType() or by explicit calls to initProtoType() followed by removeProtoType(). There is an explicit check in initProtoType() to prevent an increment to the change count. There is NO check while removing a prototype since it does not have an effect anyway. We expect this behavior to be retained for proper functioning of Verbal Rules. 2. Operations performed on components marked as a prototype. This is accomplished by a check for isPrototype() in DictionaryObject._makeUpdateable(). 3. Operations on parents tables originating from children marked as a prototype. Currently, these include the following: a. Addition of a fact binding in the parent because an expression is set on a prototype SimpleTest b. Deletion of unreferenced auto patterns in a STT via an explicit call to protoTypeST.getParentComponentTable()).deleteUnreferencedAutoPatternsForPrototype(); This is accomplished by opening a window for a prototype operation on the table and closing it after the operation is complete. These windows are currently used in: a. DictionaryComponentTable.initProtoType() b. SimpleTestTable.addPun(...) c. SimpleTestTable.deleteUnreferencedAutoPatternsForPrototype() 4. DictionaryObject constructor checks if parent is a prototype. if so, sets the current object as prototype. 5. Assume that a prototype object cannot be converted to a non-prototype object and vice versa.- Returns:
- a prototype dictionary component to use for getting Choices and Options for the component's properties
-
initProtoType
-
removeProtoType
public void removeProtoType() -
getByName
Get a DictionaryComponent from this table by its name.- Parameters:
name- name of component- Returns:
- the component
-
getByID
Get a DictionaryComponent from this table by its ID.- Parameters:
id- ID of component- Returns:
- the component
-
getByAlias
Get a DictionaryComponent from this table by its (translated) alias.- Parameters:
alias- alias of componenttranslate- flag- Returns:
- the component
-
getByAlias
Get a DictionaryComponent from this table by its alias.- Parameters:
alias- alias of component- Returns:
- the component
-
removeByID
Remove the DictionaryComponent with the given id from the table- Parameters:
id- the id returned by DictionaryComponent.getId()- Returns:
- the removed component
- Throws:
DeleteException- if the component cannot be removed (e.g. a Java Method)
-
removeByName
Remove the DictionaryComponent with the given name from the table- Parameters:
name- the name returned by DictionaryComponent.getName()- Throws:
DeleteException
-
removeByAlias
Remove the DictionaryComponent with the given alias from the table- Parameters:
alias- the alias returned by DictionaryComponent.getAlias()- Throws:
DeleteException
-
validate
public void validate(List<SDKException> errors, List<SDKWarning> warnings, int modelChangeLowerBound, int ruleChangeLowerBound) Validate each DictionaryObject in the table.- Overrides:
validatein classDictionaryObject- Parameters:
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.
-
validate
Description copied from class:DictionaryObjectValidate the entire dictionary object and its decendants. Not incremental.- Specified by:
validatein classDictionaryObject- Parameters:
errors- a List of error exceptions to append to.warnings- a List of warning exceptions to append to.- See Also:
-
size
public int size()return the size of the table- Specified by:
sizein interfaceCollection<T extends DictionaryComponent>- Specified by:
sizein interfaceList<T extends DictionaryComponent>
-
isEmpty
public boolean isEmpty()return if the table is empty- Specified by:
isEmptyin interfaceCollection<T extends DictionaryComponent>- Specified by:
isEmptyin interfaceList<T extends DictionaryComponent>
-
contains
return if the the table contains the object- Specified by:
containsin interfaceCollection<T extends DictionaryComponent>- Specified by:
containsin interfaceList<T extends DictionaryComponent>
-
getAEReferences
Description copied from class:DictionaryObjectGet DOIDs referenced by this Object and descendants. By convention, properties of type DOID and DOID[] are not considered. This basically makes this useful for finding DOIDs referenced in IDTables and in Expressions and Actions. Note that a parent contains its children but (usually) does not reference them.- Specified by:
getAEReferencesin classDictionaryObject- Returns:
- list of the DOIDs
-
getAllReferences
Description copied from class:DictionaryObjectGet all DOIDs referenced by this Object and descendants.- Specified by:
getAllReferencesin classDictionaryObject- Returns:
- list of the DOIDs
-
getExprParserReferences
Description copied from class:DictionaryObjectGet all ExprParsers that are directly or Indirectly referenced by this dictionary Object and its descendants- Specified by:
getExprParserReferencesin classDictionaryObject- Returns:
- Collection of Expression Parsers
-
iterator
- Specified by:
iteratorin interfaceCollection<T extends DictionaryComponent>- Specified by:
iteratorin interfaceIterable<T extends DictionaryComponent>- Specified by:
iteratorin interfaceList<T extends DictionaryComponent>
-
listIterator
- Specified by:
listIteratorin interfaceList<T extends DictionaryComponent>
-
listIterator
- Specified by:
listIteratorin interfaceList<T extends DictionaryComponent>
-
toArray
- Specified by:
toArrayin interfaceCollection<T extends DictionaryComponent>- Specified by:
toArrayin interfaceList<T extends DictionaryComponent>
-
toArray
public <U> U[] toArray(U[] a) - Specified by:
toArrayin interfaceCollection<T extends DictionaryComponent>- Specified by:
toArrayin interfaceList<T extends DictionaryComponent>
-
add
Used internally by subclasses.- Specified by:
addin interfaceCollection<T extends DictionaryComponent>- Specified by:
addin interfaceList<T extends DictionaryComponent>- Parameters:
o- component to be added, must be of correct type for table.
-
add
Used internally by subclasses.- Specified by:
addin interfaceList<T extends DictionaryComponent>- Parameters:
index- at which to place the new row.element- to be added, must be of correct type for table.
-
containsAll
returns true if the table contains all of the components in the Collection argument- Specified by:
containsAllin interfaceCollection<T extends DictionaryComponent>- Specified by:
containsAllin interfaceList<T extends DictionaryComponent>
-
addAll
Used internally by subclasses.- Specified by:
addAllin interfaceCollection<T extends DictionaryComponent>- Specified by:
addAllin interfaceList<T extends DictionaryComponent>
-
addAll
- Specified by:
addAllin interfaceList<T extends DictionaryComponent>
-
removeAll
remove all of the elements in the Collection from this table- Specified by:
removeAllin interfaceCollection<T extends DictionaryComponent>- Specified by:
removeAllin interfaceList<T extends DictionaryComponent>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T extends DictionaryComponent>- Specified by:
retainAllin interfaceList<T extends DictionaryComponent>
-
_clear
public final void _clear() -
clear
public void clear()remove all elements in the table- Specified by:
clearin interfaceCollection<T extends DictionaryComponent>- Specified by:
clearin interfaceList<T extends DictionaryComponent>
-
get
retrieve the ith element from the table- Specified by:
getin interfaceList<T extends DictionaryComponent>
-
set
Used internally by subclasses.- Specified by:
setin interfaceList<T extends DictionaryComponent>- Parameters:
index- at which to replace the new row.element- to replace existing, must be of correct type for table.
-
remove
Remove the DictionaryComponent at the given index from the table- Specified by:
removein interfaceList<T extends DictionaryComponent>- Parameters:
index- the index of the RuleCompoonent in the table.- Returns:
- the Object which was removed.
-
remove
remove the DictionaryComponent from this table- Specified by:
removein interfaceCollection<T extends DictionaryComponent>- Specified by:
removein interfaceList<T extends DictionaryComponent>
-
_remove
-
_remove
-
move
public 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. Shift the row currently at that location up, or replace it.- Parameters:
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 index
-
move
Shift the entry defined by index either up or down one entry in the table. The direction up==true will swap the entry with the one with index -1. The direction up==false will swap the entry with the one with index + 1.- Parameters:
index-up- boolean- Returns:
- the item moved
-
indexOf
get the index of the Object argument- Specified by:
indexOfin interfaceList<T extends DictionaryComponent>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T extends DictionaryComponent>
-
subList
Not Supported- Specified by:
subListin interfaceList<T extends DictionaryComponent>- Throws:
UnsupportedOperationException
-
add
Add a new element to the table and return the new element.- Returns:
- new table element
- Throws:
UnsupportedOperationException- if table is locked.
-
add
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"- Returns:
- new table element
-
copyTo
Copy "from" object component of type T to this component table that holds components of type T. The copy is a deep copy. The two objects may be in different dictionaries.- Parameters:
from- component to copy to this table- Returns:
- copy of component
-
copyTo
-
cut
Cut (remove) the given component from this table. Usepaste(T)to paste the component into this or a different table- Parameters:
dc-
-
paste
Paste a cut or existing component at the end of this table- Parameters:
dc- the component to paste into the table- Returns:
- component pasted
-
reorder
reorder this table according to a list of indexes. e.g. to reverse a list of 3 elements, use ordering (2,1,0).- Parameters:
ordering- a list of indexes the same size as this list.
-
ordering
-
getLast
Get the last entry in the table- Returns:
- entry at position size() - 1
-
mark
public void mark(int[] index) Mark the rows with the given indexes- Parameters:
index- an Array containing row numbers (not ID's) to be removed
-
unMark
public void unMark()Clear marks. Set all rows to unmarked. -
getMarked
seemark(int[])- Returns:
- an Array of the marked RuleComponents
-
removeMarked
- Returns:
- the number of rows removed
- Throws:
DeleteException- See Also:
-
sort
-
sort
-
sort
Sorts the components in the given list by the property and sort order specified- Parameters:
list- Collection of components to be sortedprop- Property value to be sorted byascending- true if ascending sort order, false if descending sort order
-
filter
Get the Dictionary Components in this table that match the given pattern- Parameters:
filterPattern- pattern for filteringtranslate- boolean value to indicate if the translated value should be used for filtering- Returns:
- list of DictionaryComponents filtered based on pattern given
-
isLocked
public boolean isLocked()Whether the table is locked (is readonly)- Returns:
- whether the table is readonly
-