Class OTrackedList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
java.util.ArrayList<T>
com.orientechnologies.orient.core.db.record.OTrackedList<T>
- All Implemented Interfaces:
ORecordElement,OTrackedMultiValue<Integer,,T> Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess,SequencedCollection<T>
- Direct Known Subclasses:
ORecordLazyList
public class OTrackedList<T>
extends ArrayList<T>
implements ORecordElement, OTrackedMultiValue<Integer,T>, Serializable
Implementation of ArrayList bound to a source ORecord object to keep track of changes for literal
types. This avoid to call the makeDirty() by hand when the list is changed.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.db.record.ORecordElement
ORecordElement.STATUS -
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionOTrackedList(ORecordElement iSourceRecord) OTrackedList(ORecordElement iRecord, Collection<? extends T> iOrigin, Class<?> iGenericClass) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(Collection<? extends T> c) booleanaddInternal(T element) voidclear()voiddisableTracking(ORecordElement parent) voidenableTracking(ORecordElement parent) Class<?> getOwner()booleanbooleanremove(int index) booleanbooleanremoveAll(Collection<?> c) voidreplace(OMultiValueChangeEvent<Object, Object> event, Object newValue) voidreset()returnOriginalState(List<OMultiValueChangeEvent<Integer, T>> multiValueChangeEvents) Reverts all operations that were performed on collection and return original collection state.<RET> RETsetDirty()Marks the instance as dirty.voidsetInternal(int index, T element) voidMethods inherited from class java.util.ArrayList
addAll, addFirst, addLast, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
sourceRecord
-
genericClass
-
-
Constructor Details
-
OTrackedList
public OTrackedList(ORecordElement iRecord, Collection<? extends T> iOrigin, Class<?> iGenericClass) -
OTrackedList
-
-
Method Details
-
getOwner
- Specified by:
getOwnerin interfaceORecordElement- Returns:
- Returns record element which contains given one.
-
add
-
addInternal
- Specified by:
addInternalin interfaceOTrackedMultiValue<Integer,T>
-
addAll
-
add
-
setInternal
-
set
-
remove
-
remove
-
removeAll
-
clear
public void clear() -
reset
public void reset() -
setDirty
public <RET> RET setDirty()Description copied from interface:ORecordElementMarks the instance as dirty. The dirty status could be propagated up if the implementation supports ownership concept.- Specified by:
setDirtyin interfaceORecordElement- Returns:
- The object it self. Useful to call methods in chain.
-
setDirtyNoChanged
public void setDirtyNoChanged()- Specified by:
setDirtyNoChangedin interfaceORecordElement
-
returnOriginalState
Description copied from interface:OTrackedMultiValueReverts all operations that were performed on collection and return original collection state.- Specified by:
returnOriginalStatein interfaceOTrackedMultiValue<Integer,T> - Parameters:
multiValueChangeEvents- List of operations that were performed on collection.- Returns:
- Original collection state.
-
getGenericClass
- Specified by:
getGenericClassin interfaceOTrackedMultiValue<Integer,T>
-
replace
- Specified by:
replacein interfaceOTrackedMultiValue<Integer,T>
-
enableTracking
- Specified by:
enableTrackingin interfaceOTrackedMultiValue<Integer,T>
-
disableTracking
- Specified by:
disableTrackingin interfaceOTrackedMultiValue<Integer,T>
-
transactionClear
public void transactionClear()- Specified by:
transactionClearin interfaceOTrackedMultiValue<Integer,T>
-
isModified
public boolean isModified()- Specified by:
isModifiedin interfaceOTrackedMultiValue<Integer,T>
-
isTransactionModified
public boolean isTransactionModified()- Specified by:
isTransactionModifiedin interfaceOTrackedMultiValue<Integer,T>
-
getTimeLine
- Specified by:
getTimeLinein interfaceOTrackedMultiValue<Integer,T>
-
getTransactionTimeLine
- Specified by:
getTransactionTimeLinein interfaceOTrackedMultiValue<Integer,T>
-