
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(ORidBag ridBag) |
| 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) |
protected 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! Only for internal usage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ORidBag(ORidBag ridBag)
public ORidBag()
public ORidBag(int iTopThreshold,
int iBottomThreshold)
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 ORecordLazyMultiValuepublic void convertLinks2Records()
ORecordLazyMultiValueOAutoConvertToRecord.setAutoConvertToRecord(boolean)convertLinks2Records in interface ORecordLazyMultiValuepublic boolean convertRecords2Links()
ORecordLazyMultiValueconvertRecords2Links in interface ORecordLazyMultiValuepublic boolean isAutoConvertToRecord()
isAutoConvertToRecord in interface OAutoConvertToRecordpublic void setAutoConvertToRecord(boolean convertToRecord)
setAutoConvertToRecord in interface OAutoConvertToRecordpublic boolean detach()
ODetachabledetach in interface ODetachablepublic boolean isEmbedded()
public int toStream(BytesContainer bytesContainer) throws OSerializationException
OSerializationExceptionpublic void checkAndConvert()
public OStringBuilderSerializable toStream(StringBuilder output) throws OSerializationException
toStream in interface OStringBuilderSerializableOSerializationExceptionpublic void delete()
public OStringBuilderSerializable fromStream(StringBuilder input) throws OSerializationException
fromStream in interface OStringBuilderSerializableOSerializationExceptionpublic void fromStream(byte[] stream)
public void fromStream(BytesContainer stream)
public void addChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
OTrackedMultiValueaddChangeListener in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>changeListener - Change listener instance.public void removeRecordChangeListener(OMultiValueChangeListener<OIdentifiable,OIdentifiable> changeListener)
OTrackedMultiValueremoveRecordChangeListener in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>changeListener - Change listener instance.public Object returnOriginalState(List<OMultiValueChangeEvent<OIdentifiable,OIdentifiable>> multiValueChangeEvents)
OTrackedMultiValuereturnOriginalState 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
IOExceptionprotected ORidBagDelegate getDelegate()
public void fireCollectionChangedEvent(OMultiValueChangeEvent<OIdentifiable,OIdentifiable> event)
fireCollectionChangedEvent in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>public void replace(OMultiValueChangeEvent<Object,Object> event, Object newValue)
replace in interface OTrackedMultiValue<OIdentifiable,OIdentifiable>Copyright © 2009–2025 OrientDB. All rights reserved.