Class OCompositeKey
java.lang.Object
com.orientechnologies.orient.core.index.OCompositeKey
- All Implemented Interfaces:
ODocumentSerializable,Serializable,Comparable<OCompositeKey>
- Direct Known Subclasses:
OLuceneCompositeKey
public class OCompositeKey
extends Object
implements Comparable<OCompositeKey>, Serializable, ODocumentSerializable
Container for the list of heterogeneous values that are going to be stored in in index as
composite keys.
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com), Artem Orobets
- See Also:
-
Field Summary
Fields inherited from interface com.orientechnologies.orient.core.serialization.ODocumentSerializable
CLASS_NAME -
Constructor Summary
ConstructorsConstructorDescriptionOCompositeKey(int size) OCompositeKey(Object... keys) OCompositeKey(List<?> keys) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd new key value to the list of already registered values.intcompareTo(OCompositeKey otherKey) Performs partial comparison of two composite keys.booleanvoidfromDocument(ODocument document) voidfromStream(ORecordSerializerNetworkV37 serializer, DataInput in) getKeys()inthashCode()voidreset()Clears the keys array for reuse of the objectvoidtoStream(ORecordSerializerNetworkV37 serializer, DataOutput out, OSerializationContext ctx) toString()
-
Constructor Details
-
OCompositeKey
-
OCompositeKey
-
OCompositeKey
public OCompositeKey() -
OCompositeKey
public OCompositeKey(int size)
-
-
Method Details
-
reset
public void reset()Clears the keys array for reuse of the object -
getKeys
-
addKey
Add new key value to the list of already registered values.If passed in value is
OCompositeKeyitself then its values will be copied in current index. But key itself will not be added.- Parameters:
key- Key to add.
-
compareTo
Performs partial comparison of two composite keys.Two objects will be equal if the common subset of their keys is equal. For example if first object contains two keys and second contains four keys then only first two keys will be compared.
- Specified by:
compareToin interfaceComparable<OCompositeKey>- Parameters:
otherKey- Key to compare.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
equals
-
hashCode
public int hashCode() -
toString
-
toDocument
- Specified by:
toDocumentin interfaceODocumentSerializable
-
fromDocument
- Specified by:
fromDocumentin interfaceODocumentSerializable
-
toStream
public void toStream(ORecordSerializerNetworkV37 serializer, DataOutput out, OSerializationContext ctx) throws IOException - Throws:
IOException
-
fromStream
- Throws:
IOException
-