public class ORidBag extends Object implements OStringBuilderSerializable, Iterable<OIdentifiable>, ORecordLazyMultiValue, OTrackedMultiValue<OIdentifiable,OIdentifiable>, OCollection<OIdentifiable>, ORecordElement
OIdentifiable
. Bag is similar to set but can contain
several entering of the same object.Could be tree based and embedded representation.
OSBTreeBonsai
.OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD
and OGlobalConfiguration.RID_BAG_SBTREEBONSAI_TO_EMBEDDED_THRESHOLD
. Collection
interface because some operations could not be efficiently
implemented and that's why should be avoided.ORecordElement.STATUS
Constructor and Description |
---|
ORidBag() |
ORidBag(int iTopThreshold,
int iBottomThreshold) |
ORidBag(OBonsaiCollectionPointer pointer,
Map<OIdentifiable,Change> changes,
UUID uuid) |
ORidBag(ORidBag ridBag) |
ORidBag(ORidBagDelegate delegate) |
ORidBag(UUID uuid) |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
nestedDisable, nestedEnabled, nestedTransactionClear
forEach, spliterator
public ORidBag(ORidBag ridBag)
public ORidBag()
public ORidBag(int iTopThreshold, int iBottomThreshold)
public ORidBag(UUID uuid)
public ORidBag(OBonsaiCollectionPointer pointer, Map<OIdentifiable,Change> changes, UUID uuid)
public ORidBag(ORidBagDelegate delegate)
public ORidBag copy()
public boolean contains(OIdentifiable identifiable)
identifiable
- Object to check.public void addAll(Collection<OIdentifiable> values)
public void add(OIdentifiable identifiable)
add
in interface OCollection<OIdentifiable>
public void remove(OIdentifiable identifiable)
remove
in interface OCollection<OIdentifiable>
public boolean isEmpty()
public Iterator<OIdentifiable> iterator()
iterator
in interface Iterable<OIdentifiable>
public Iterator<OIdentifiable> rawIterator()
rawIterator
in interface ORecordLazyMultiValue
public void convertLinks2Records()
ORecordLazyMultiValue
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)
convertLinks2Records
in interface ORecordLazyMultiValue
public boolean convertRecords2Links()
ORecordLazyMultiValue
convertRecords2Links
in interface ORecordLazyMultiValue
public boolean isAutoConvertToRecord()
isAutoConvertToRecord
in interface OAutoConvertToRecord
public void setAutoConvertToRecord(boolean convertToRecord)
setAutoConvertToRecord
in interface OAutoConvertToRecord
public boolean detach()
ODetachable
detach
in interface ODetachable
public boolean isEmbedded()
public boolean isToSerializeEmbedded()
public int toStream(BytesContainer bytesContainer) throws OSerializationException
OSerializationException
public void checkAndConvert()
public OStringBuilderSerializable toStream(StringBuilder output) throws OSerializationException
toStream
in interface OStringBuilderSerializable
OSerializationException
public void delete()
public OStringBuilderSerializable fromStream(StringBuilder input) throws OSerializationException
fromStream
in interface OStringBuilderSerializable
OSerializationException
public void fromStream(byte[] stream)
public void fromStream(BytesContainer stream)
public Object returnOriginalState(List<OMultiValueChangeEvent<OIdentifiable,OIdentifiable>> multiValueChangeEvents)
OTrackedMultiValue
returnOriginalState
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
multiValueChangeEvents
- List of operations that were performed on collection.public Class<?> getGenericClass()
getGenericClass
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public void setOwner(ORecordElement owner)
public UUID getTemporaryId()
WARNING! Method is for internal usage.
public void setTemporaryId(UUID uuid)
public void notifySaved(OBonsaiCollectionPointer newPointer)
WARNING! Method is for internal usage.
newPointer
- new collection pointerpublic OBonsaiCollectionPointer getPointer()
public boolean tryMerge(ORidBag otherValue, boolean iMergeSingleItemsOfMultiValueFields)
protected void init()
public void debugPrint(PrintStream writer) throws IOException
IOException
public ORidBagDelegate getDelegate()
public NavigableMap<OIdentifiable,Change> getChanges()
public void replace(OMultiValueChangeEvent<Object,Object> event, Object newValue)
replace
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public void enableTracking(ORecordElement parent)
enableTracking
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public void disableTracking(ORecordElement document)
disableTracking
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public void transactionClear()
transactionClear
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public boolean isModified()
isModified
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public OMultiValueChangeTimeLine<Object,Object> getTimeLine()
getTimeLine
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public <RET> RET setDirty()
ORecordElement
setDirty
in interface ORecordElement
public void setDirtyNoChanged()
setDirtyNoChanged
in interface ORecordElement
public ORecordElement getOwner()
getOwner
in interface ORecordElement
public boolean isTransactionModified()
isTransactionModified
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public OMultiValueChangeTimeLine<OIdentifiable,OIdentifiable> getTransactionTimeLine()
getTransactionTimeLine
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public void makeTree()
public void makeEmbedded()
Copyright © 2009–2020 OrientDB. All rights reserved.