public class ORidBag extends Object implements OStringBuilderSerializable, Iterable<OIdentifiable>, ORecordLazyMultiValue, OTrackedMultiValue<OIdentifiable,OIdentifiable>, OCollection<OIdentifiable>
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.Constructor and Description |
---|
ORidBag() |
ORidBag(int iTopThreshold,
int iBottomThreshold) |
ORidBag(OBonsaiCollectionPointer pointer,
Map<OIdentifiable,Change> changes,
UUID uuid) |
ORidBag(ORidBag ridBag) |
ORidBag(UUID uuid) |
Modifier and Type | Method and Description |
---|---|
void |
add(OIdentifiable identifiable) |
void |
addAll(Collection<OIdentifiable> values) |
void |
addChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
Add change listener.
|
void |
checkAndConvert() |
boolean |
contains(OIdentifiable identifiable)
THIS IS VERY EXPENSIVE METHOD AND CAN NOT BE CALLED IN REMOTE STORAGE.
|
void |
convertLinks2Records()
Browse all the set to convert all the items into records.
|
boolean |
convertRecords2Links()
Browse all the set to convert all the items into links.
|
ORidBag |
copy() |
void |
debugPrint(PrintStream writer) |
void |
delete() |
boolean |
detach()
Detaches the object.
|
void |
fireCollectionChangedEvent(OMultiValueChangeEvent<OIdentifiable,OIdentifiable> event) |
void |
fromStream(byte[] stream) |
void |
fromStream(BytesContainer stream) |
static ORidBag |
fromStream(String value) |
OStringBuilderSerializable |
fromStream(StringBuilder input) |
NavigableMap<OIdentifiable,Change> |
getChanges() |
ORidBagDelegate |
getDelegate() |
Class<?> |
getGenericClass() |
OBonsaiCollectionPointer |
getPointer() |
UUID |
getTemporaryId()
Temporary id of collection to track changes in remote mode.
|
protected void |
init() |
boolean |
isAutoConvertToRecord() |
boolean |
isEmbedded() |
boolean |
isEmpty() |
Iterator<OIdentifiable> |
iterator() |
void |
notifySaved(OBonsaiCollectionPointer newPointer)
Notify collection that changes has been saved.
|
Iterator<OIdentifiable> |
rawIterator() |
void |
remove(OIdentifiable identifiable) |
void |
removeRecordChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
Remove change listener.
|
void |
replace(OMultiValueChangeEvent<Object,Object> event,
Object newValue) |
Object |
returnOriginalState(List<OMultiValueChangeEvent<OIdentifiable,OIdentifiable>> multiValueChangeEvents)
Reverts all operations that were performed on collection and return original collection state.
|
void |
setAutoConvertToRecord(boolean convertToRecord) |
void |
setOwner(ORecord owner) |
int |
size() |
int |
toStream(BytesContainer bytesContainer) |
OStringBuilderSerializable |
toStream(StringBuilder output) |
String |
toString() |
boolean |
tryMerge(ORidBag otherValue,
boolean iMergeSingleItemsOfMultiValueFields)
IMPORTANT!
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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 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
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 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 void addChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
OTrackedMultiValue
addChangeListener
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
changeListener
- Change listener instance.public void removeRecordChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
OTrackedMultiValue
removeRecordChangeListener
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
changeListener
- Change listener instance.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(ORecord owner)
public UUID getTemporaryId()
WARNING! Method is for internal usage.
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 void fireCollectionChangedEvent(OMultiValueChangeEvent<OIdentifiable,OIdentifiable> event)
fireCollectionChangedEvent
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
public NavigableMap<OIdentifiable,Change> getChanges()
public void replace(OMultiValueChangeEvent<Object,Object> event, Object newValue)
replace
in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>
Copyright © 2009–2020 OrientDB. All rights reserved.