Package com.arcadedb.database
Class RID
- java.lang.Object
-
- com.arcadedb.database.RID
-
- All Implemented Interfaces:
Identifiable
,Serializable
,Comparable<Identifiable>
public class RID extends Object implements Identifiable, Comparable<Identifiable>, Serializable
It represents the logical address of a record in the database. The record id is composed by the bucket id (the bucket containing the record) and the offset as the absolute position of the record in the bucket.
Immutable class.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
asDocument()
Returns the document record.Document
asDocument(boolean loadContent)
Returns the document record.Edge
asEdge()
Returns the edge record.Edge
asEdge(boolean loadContent)
Returns the edge record.Vertex
asVertex()
Returns the vertex record.Vertex
asVertex(boolean loadContent)
Returns the vertex record.int
compareTo(Identifiable o)
boolean
equals(Object obj)
int
getBucketId()
Database
getDatabase()
RID
getIdentity()
Returns the RID (Record ID) for the current object.long
getPosition()
Record
getRecord()
Returns the generic record by pre-loading also its content.Record
getRecord(boolean loadContent)
Returns the generic record.int
hashCode()
static boolean
is(Object value)
boolean
isValid()
String
toString()
-
-
-
Method Detail
-
is
public static boolean is(Object value)
-
getBucketId
public int getBucketId()
-
getPosition
public long getPosition()
-
getIdentity
public RID getIdentity()
Description copied from interface:Identifiable
Returns the RID (Record ID) for the current object.- Specified by:
getIdentity
in interfaceIdentifiable
- Returns:
- the
RID
-
getRecord
public Record getRecord()
Description copied from interface:Identifiable
Returns the generic record by pre-loading also its content.- Specified by:
getRecord
in interfaceIdentifiable
- Returns:
- the
Record
-
getRecord
public Record getRecord(boolean loadContent)
Description copied from interface:Identifiable
Returns the generic record.- Specified by:
getRecord
in interfaceIdentifiable
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Record
-
asDocument
public Document asDocument()
Description copied from interface:Identifiable
Returns the document record. If the record is not a document, a UnsupportedOperationException exception is thrown.- Specified by:
asDocument
in interfaceIdentifiable
- Returns:
- the
Document
-
asDocument
public Document asDocument(boolean loadContent)
Description copied from interface:Identifiable
Returns the document record. If the record is not a document, a UnsupportedOperationException exception is thrown.- Specified by:
asDocument
in interfaceIdentifiable
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Document
-
asVertex
public Vertex asVertex()
Description copied from interface:Identifiable
Returns the vertex record. If the record is not a vertex, a UnsupportedOperationException exception is thrown.- Specified by:
asVertex
in interfaceIdentifiable
- Returns:
- the
Vertex
-
asVertex
public Vertex asVertex(boolean loadContent)
Description copied from interface:Identifiable
Returns the vertex record. If the record is not a vertex, a UnsupportedOperationException exception is thrown.- Specified by:
asVertex
in interfaceIdentifiable
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Vertex
-
asEdge
public Edge asEdge()
Description copied from interface:Identifiable
Returns the edge record. If the record is not an edge, a UnsupportedOperationException exception is thrown. *- Specified by:
asEdge
in interfaceIdentifiable
- Returns:
- the
Edge
-
asEdge
public Edge asEdge(boolean loadContent)
Description copied from interface:Identifiable
Returns the edge record. If the record is not an edge, a UnsupportedOperationException exception is thrown.- Specified by:
asEdge
in interfaceIdentifiable
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Edge
-
compareTo
public int compareTo(Identifiable o)
- Specified by:
compareTo
in interfaceComparable<Identifiable>
-
getDatabase
public Database getDatabase()
-
isValid
public boolean isValid()
-
-