Class ListObjectImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
-
- de.uni_trier.wi2.procake.data.object.base.impl.CollectionObjectImpl
-
- de.uni_trier.wi2.procake.data.object.base.impl.ListObjectImpl
-
- All Implemented Interfaces:
CollectionObject,ListObject,DataObject,PropertyHandler
public class ListObjectImpl extends CollectionObjectImpl implements ListObject
- Author:
- Rainer Maximini
-
-
Field Summary
-
Fields inherited from class de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
objectId
-
Fields inherited from interface de.uni_trier.wi2.procake.data.object.base.CollectionObject
COMPONENT, COMPONENT_KEY, LOG_WRONG_ELEMENT_TYPE
-
Fields inherited from interface de.uni_trier.wi2.procake.data.object.base.ListObject
COMPONENT, COMPONENT_KEY, LOG_INDEX_OUT_OF_BOUNDS
-
-
Constructor Summary
Constructors Constructor Description ListObjectImpl(ListClass dataClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertSameValueAsIn(DataObject object)DataObjectcopy()Makes a deep copy of the data objectDataObjectelementAt(int index)Collection<DataObject>getCollection()ListClassgetListClass()List<DataObject>getValues()Returns a list of DataObjects contained in this ListObject.booleanhasSameValueAsIn(DataObject object)This method makes a deep compare.intindexOf(DataObject object)Searches for the first occurence of the given data object, testing for equality using theequalsmethod.intindexOf(DataObject object, int index)Searches for the first occurence of the given object, beginning the search atindex, and testing for equality using theequalsmethod.voidinsertAt(DataObject value, int index)Inserts the specified data object in this list at the specifiedindex.voidremoveAt(int index)Deletes the object at the specified index.voidsetValues(List<DataObject> values)Sets the DataObjects of this ListObject.-
Methods inherited from class de.uni_trier.wi2.procake.data.object.base.impl.CollectionObjectImpl
addAll, addValue, contains, getCollectionClass, getValue, iterator, removeValue, size, toDetailedString, toString
-
Methods inherited from class de.uni_trier.wi2.procake.data.object.impl.DataObjectImpl
addProperty, addProperty, deepCopy, getAllProperties, getAllPropertyNodes, getDataClass, getId, getModel, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasClassName, hasProperties, hasSystemClassName, isAggregate, isAtomic, isBoolean, isByteArray, isChronologic, isCollection, isDataflowWrapper, isDataReference, isDate, isDouble, isInteger, isInterval, isKindOf, isList, isMemberOf, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isSequence, isSet, isString, isSubWorkflow, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, removeId, removeProperty, setDataClass, setId, toXML
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.data.object.base.CollectionObject
addAll, addValue, contains, getCollectionClass, getValue, iterator, removeValue, size
-
Methods inherited from interface de.uni_trier.wi2.procake.data.object.DataObject
getDataClass, getId, getModel, hasClassName, hasSystemClassName, isAggregate, isAtomic, isBoolean, isByteArray, isChronologic, isCollection, isDataflowWrapper, isDataReference, isDate, isDouble, isInteger, isInterval, isKindOf, isList, isMemberOf, isNESTConstraintEdge, isNESTControlflowEdge, isNESTControlflowNode, isNESTDataflowEdge, isNESTDataNode, isNESTEdge, isNESTGraph, isNESTNode, isNESTPartOfEdge, isNESTSequenceNode, isNESTSequentialWorkflow, isNESTSubWorkflowNode, isNESTTaskNode, isNESTWorkflow, isNESTWorkflowNode, isNode, isNumeric, isSequence, isSet, isString, isSubWorkflow, isTask, isTime, isTimestamp, isUnion, isURI, isVoid, isWorkflow, removeId, setDataClass, setId, toDetailedString, toXML
-
Methods inherited from interface de.uni_trier.wi2.procake.data.PropertyHandler
addProperty, addProperty, getAllProperties, getAllPropertyNodes, getProperty, getPropertyNames, getPropertyNode, getPropertyRootNode, hasProperties, removeProperty
-
-
-
-
Constructor Detail
-
ListObjectImpl
public ListObjectImpl(ListClass dataClass)
-
-
Method Detail
-
elementAt
public DataObject elementAt(int index) throws IndexOutOfBoundsException
- Specified by:
elementAtin interfaceListObject- Throws:
IndexOutOfBoundsException
-
getValues
public List<DataObject> getValues()
Description copied from interface:ListObjectReturns a list of DataObjects contained in this ListObject.- Specified by:
getValuesin interfaceListObject- Returns:
- A list of DataObjects contained in this ListObject
-
setValues
public void setValues(List<DataObject> values)
Description copied from interface:ListObjectSets the DataObjects of this ListObject. If a type of an element is incompatible with the elementClass aInvalidTypeExceptionis thrown.- Specified by:
setValuesin interfaceListObject
-
getCollection
public Collection<DataObject> getCollection()
- Specified by:
getCollectionin interfaceCollectionObject
-
getListClass
public ListClass getListClass()
- Specified by:
getListClassin interfaceListObject
-
hasSameValueAsIn
public boolean hasSameValueAsIn(DataObject object)
Description copied from interface:DataObjectThis method makes a deep compare. For atomic objects this is equal to theequalmethod. For sets, lists, aggregates, and others a deeper comparision is performed.- Specified by:
hasSameValueAsInin interfaceDataObject- Overrides:
hasSameValueAsInin classDataObjectImpl- Parameters:
object- The object to compare.- Returns:
trueif the givenobjecthas the same value(s) as this one.
-
assertSameValueAsIn
public void assertSameValueAsIn(DataObject object) throws AssertSameValueAsInException
- Specified by:
assertSameValueAsInin interfaceDataObject- Overrides:
assertSameValueAsInin classDataObjectImpl- Throws:
AssertSameValueAsInException
-
indexOf
public int indexOf(DataObject object)
Description copied from interface:ListObjectSearches for the first occurence of the given data object, testing for equality using theequalsmethod.- Specified by:
indexOfin interfaceListObject- Parameters:
object- the data object that should be searched- Returns:
- the index of the first occurrence of the argument in this list; returns
-1if the object is not found. - See Also:
Object.equals(Object)
-
indexOf
public int indexOf(DataObject object, int index) throws IndexOutOfBoundsException
Description copied from interface:ListObjectSearches for the first occurence of the given object, beginning the search atindex, and testing for equality using theequalsmethod.- Specified by:
indexOfin interfaceListObject- Parameters:
object- the data object that should be searchedindex- the non-negative index to start searching from.- Returns:
- the index of the first occurrence of the object argument in this list at position
indexor later in the vector; returns-1if the object is not found. (Returns-1ifindex>= the current size of this list.) - Throws:
IndexOutOfBoundsException- if the index was invalid.- See Also:
Object.equals(Object)
-
insertAt
public void insertAt(DataObject value, int index) throws IndexOutOfBoundsException, InvalidTypeException
Description copied from interface:ListObjectInserts the specified data object in this list at the specifiedindex. Each object in this list with an index greater or equal to the specifiedindexis shifted upward to have an index one greater than the value it had previously.The index must be a value greater than or equal to
0and less than or equal to the current size of the list. (If the index is equal to the current size of the list, the new object is appended to the list.)- Specified by:
insertAtin interfaceListObject- Parameters:
value- the data object to insert.index- where to insert the new object.- Throws:
IndexOutOfBoundsException- if the index was invalid.InvalidTypeException- if the value type is incompatible to the element type.
-
removeAt
public void removeAt(int index) throws IndexOutOfBoundsExceptionDescription copied from interface:ListObjectDeletes the object at the specified index. Each object in this list with an index greater or equal to the specifiedindexis shifted downward to have an index one smaller than the value it had previously. The size of this list is decreased by1.The index must be a value greater than or equal to
0and less than the current size of the list.- Specified by:
removeAtin interfaceListObject- Parameters:
index- the index of the object to remove.- Throws:
IndexOutOfBoundsException- if the index was invalid.
-
copy
public DataObject copy()
Description copied from interface:DataObjectMakes a deep copy of the data object- Specified by:
copyin interfaceDataObject- Overrides:
copyin classDataObjectImpl- Returns:
- deep copy of the data object
-
-