Class ORecordLazyList
java.lang.Object
java.util.AbstractCollection<OIdentifiable>
java.util.AbstractList<OIdentifiable>
java.util.ArrayList<OIdentifiable>
com.orientechnologies.orient.core.db.record.OTrackedList<OIdentifiable>
com.orientechnologies.orient.core.db.record.ORecordLazyList
- All Implemented Interfaces:
OSizeable,OAutoConvertToRecord,ODetachable,ORecordElement,ORecordLazyMultiValue,OTrackedMultiValue<Integer,,OIdentifiable> Serializable,Cloneable,Iterable<OIdentifiable>,Collection<OIdentifiable>,List<OIdentifiable>,RandomAccess
Lazy implementation of ArrayList. It's bound to a source ORecord object to keep track of changes.
This avoid to call the makeDirty() by hand when the list is changed. It handles an internal
contentType to speed up some operations like conversion to/from record/links.
- 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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanFields inherited from class com.orientechnologies.orient.core.db.record.OTrackedList
genericClass, sourceRecordFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionORecordLazyList(ORecordElement iSourceRecord) ORecordLazyList(ORecordElement iSourceRecord, Collection<? extends OIdentifiable> iOrigin) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, OIdentifiable e) booleanadd(OIdentifiable e) booleanaddAll(Collection<? extends OIdentifiable> c) booleanvoidclear()booleanbooleanvoidBrowse all the set to convert all the items into records.booleanBrowse all the set to convert all the items into links.booleandetach()Detaches the object.get(int index) intbooleanbooleanisEmpty()iterator()intbooleanlazyLoad(boolean iInvalidateStream) listIterator(int index) rawGet(int index) remove(int iIndex) booleanvoidreplace(OMultiValueChangeEvent<Object, Object> event, Object newValue) set(int index, OIdentifiable e) voidsetAutoConvertToRecord(boolean convertToDocument) intsize()Object[]toArray()<T> T[]toArray(T[] a) toString()Methods inherited from class com.orientechnologies.orient.core.db.record.OTrackedList
disableTracking, enableTracking, getGenericClass, getOwner, getTimeLine, getTransactionTimeLine, isModified, isTransactionModified, removeAll, reset, returnOriginalState, setDirty, setDirtyNoChanged, setInternal, transactionClearMethods inherited from class java.util.ArrayList
addAll, clone, ensureCapacity, equals, forEach, hashCode, removeIf, removeRange, replaceAll, retainAll, sort, spliterator, subList, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods 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
-
Field Details
-
contentType
-
autoConvertToRecord
protected boolean autoConvertToRecord -
ridOnly
protected boolean ridOnly
-
-
Constructor Details
-
ORecordLazyList
public ORecordLazyList() -
ORecordLazyList
-
ORecordLazyList
-
-
Method Details
-
addAll
- Specified by:
addAllin interfaceCollection<OIdentifiable>- Specified by:
addAllin interfaceList<OIdentifiable>- Overrides:
addAllin classOTrackedList<OIdentifiable>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<OIdentifiable>- Specified by:
isEmptyin interfaceList<OIdentifiable>- Overrides:
isEmptyin classArrayList<OIdentifiable>
-
rawIterator
- Specified by:
rawIteratorin interfaceORecordLazyMultiValue- Returns:
- iterator that just returns the elements without conversion.
-
rawGet
-
iterator
- Specified by:
iteratorin interfaceCollection<OIdentifiable>- Specified by:
iteratorin interfaceIterable<OIdentifiable>- Specified by:
iteratorin interfaceList<OIdentifiable>- Overrides:
iteratorin classArrayList<OIdentifiable>
-
listIterator
- Specified by:
listIteratorin interfaceList<OIdentifiable>- Overrides:
listIteratorin classArrayList<OIdentifiable>
-
listIterator
- Specified by:
listIteratorin interfaceList<OIdentifiable>- Overrides:
listIteratorin classArrayList<OIdentifiable>
-
contains
- Specified by:
containsin interfaceCollection<OIdentifiable>- Specified by:
containsin interfaceList<OIdentifiable>- Overrides:
containsin classArrayList<OIdentifiable>
-
add
- Specified by:
addin interfaceCollection<OIdentifiable>- Specified by:
addin interfaceList<OIdentifiable>- Overrides:
addin classOTrackedList<OIdentifiable>
-
add
- Specified by:
addin interfaceList<OIdentifiable>- Overrides:
addin classOTrackedList<OIdentifiable>
-
addInternal
- Specified by:
addInternalin interfaceOTrackedMultiValue<Integer,OIdentifiable> - Overrides:
addInternalin classOTrackedList<OIdentifiable>
-
set
- Specified by:
setin interfaceList<OIdentifiable>- Overrides:
setin classOTrackedList<OIdentifiable>
-
get
- Specified by:
getin interfaceList<OIdentifiable>- Overrides:
getin classArrayList<OIdentifiable>
-
indexOf
- Specified by:
indexOfin interfaceList<OIdentifiable>- Overrides:
indexOfin classArrayList<OIdentifiable>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<OIdentifiable>- Overrides:
lastIndexOfin classArrayList<OIdentifiable>
-
remove
- Specified by:
removein interfaceList<OIdentifiable>- Overrides:
removein classOTrackedList<OIdentifiable>
-
remove
- Specified by:
removein interfaceCollection<OIdentifiable>- Specified by:
removein interfaceList<OIdentifiable>- Overrides:
removein classOTrackedList<OIdentifiable>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<OIdentifiable>- Specified by:
clearin interfaceList<OIdentifiable>- Overrides:
clearin classOTrackedList<OIdentifiable>
-
size
public int size()- Specified by:
sizein interfaceCollection<OIdentifiable>- Specified by:
sizein interfaceList<OIdentifiable>- Specified by:
sizein interfaceOSizeable- Overrides:
sizein classArrayList<OIdentifiable>
-
toArray
- Specified by:
toArrayin interfaceCollection<OIdentifiable>- Specified by:
toArrayin interfaceList<OIdentifiable>- Overrides:
toArrayin classArrayList<OIdentifiable>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<OIdentifiable>- Specified by:
toArrayin interfaceList<OIdentifiable>- Overrides:
toArrayin classArrayList<OIdentifiable>
-
convertLinks2Records
public void convertLinks2Records()Description copied from interface:ORecordLazyMultiValueBrowse all the set to convert all the items into records.It converts only items that already loaded into memory from storage. To convert records that will be fetched from disk later use
OAutoConvertToRecord.setAutoConvertToRecord(boolean)- Specified by:
convertLinks2Recordsin interfaceORecordLazyMultiValue
-
convertRecords2Links
public boolean convertRecords2Links()Description copied from interface:ORecordLazyMultiValueBrowse all the set to convert all the items into links.- Specified by:
convertRecords2Linksin interfaceORecordLazyMultiValue- Returns:
-
isAutoConvertToRecord
public boolean isAutoConvertToRecord()- Specified by:
isAutoConvertToRecordin interfaceOAutoConvertToRecord
-
setAutoConvertToRecord
public void setAutoConvertToRecord(boolean convertToDocument) - Specified by:
setAutoConvertToRecordin interfaceOAutoConvertToRecord
-
toString
- Overrides:
toStringin classAbstractCollection<OIdentifiable>
-
copy
-
lazyLoad
public boolean lazyLoad(boolean iInvalidateStream) -
detach
public boolean detach()Description copied from interface:ODetachableDetaches the object.- Specified by:
detachin interfaceODetachable- Returns:
- true if the object has been fully detached, otherwise false
-
clearDeletedRecords
public boolean clearDeletedRecords() -
replace
- Specified by:
replacein interfaceOTrackedMultiValue<Integer,OIdentifiable> - Overrides:
replacein classOTrackedList<OIdentifiable>
-