Package com.arcadedb.graph
Class ImmutableEdge
- java.lang.Object
-
- com.arcadedb.database.BaseRecord
-
- com.arcadedb.database.BaseDocument
-
- com.arcadedb.database.ImmutableDocument
-
- com.arcadedb.graph.ImmutableEdge
-
- All Implemented Interfaces:
Document
,Identifiable
,Record
,Edge
,Externalizable
,Serializable
public class ImmutableEdge extends ImmutableDocument implements Edge
Immutable read-only edge. It is returned from database on read operations such as queries or lookups and graph traversal. To modify an edge usemodify()
to have the MutableEdge instance created form the current record.- Author:
- Luca Garulli ([email protected])
- See Also:
MutableEdge
, Serialized Form
-
-
Field Summary
-
Fields inherited from class com.arcadedb.database.BaseDocument
propertiesStartingPosition, type
-
Fields inherited from class com.arcadedb.database.BaseRecord
buffer, database, rid
-
Fields inherited from interface com.arcadedb.database.Document
RECORD_TYPE
-
Fields inherited from interface com.arcadedb.graph.Edge
RECORD_TYPE
-
-
Constructor Summary
Constructors Constructor Description ImmutableEdge(Database graph, DocumentType type, RID rid, Binary buffer)
ImmutableEdge(Database graph, DocumentType type, RID edgeRID, RID out, RID in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Edge
asEdge()
Returns the edge record.Edge
asEdge(boolean loadContent)
Returns the edge record.protected boolean
checkForLazyLoading()
Object
get(String propertyName)
RID
getIn()
Vertex
getInVertex()
RID
getOut()
Vertex
getOutVertex()
byte
getRecordType()
Vertex
getVertex(Vertex.DIRECTION iDirection)
MutableEdge
modify()
JSONObject
toJSON(boolean includeMetadata)
Map<String,Object>
toMap(boolean includeMetadata)
Returns a map containing the document properties.String
toString()
-
Methods inherited from class com.arcadedb.database.ImmutableDocument
getPropertyNames, has, propertiesAsMap, toMap
-
Methods inherited from class com.arcadedb.database.BaseDocument
asDocument, asDocument, detach, getBinary, getBoolean, getByte, getCalendar, getDate, getDecimal, getDouble, getEmbedded, getFloat, getInstant, getInteger, getList, getLocalDate, getLocalDateTime, getLong, getMap, getShort, getString, getType, getTypeName, getZonedDateTime, readExternal, reload, writeExternal
-
Methods inherited from class com.arcadedb.database.BaseRecord
asVertex, asVertex, delete, equals, getBuffer, getDatabase, getIdentity, getRecord, getRecord, hashCode, setBuffer
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.arcadedb.database.Document
asDocument, asDocument, detach, getBinary, getBoolean, getByte, getCalendar, getDate, getDecimal, getDouble, getEmbedded, getFloat, getInstant, getInteger, getList, getLocalDate, getLocalDateTime, getLong, getMap, getPropertyNames, getShort, getString, getType, getTypeName, getZonedDateTime, has, propertiesAsMap, toMap
-
Methods inherited from interface com.arcadedb.database.Identifiable
asVertex, asVertex, getRecord, getRecord
-
Methods inherited from interface com.arcadedb.database.Record
delete, getDatabase, getIdentity, reload, toJSON
-
-
-
-
Constructor Detail
-
ImmutableEdge
public ImmutableEdge(Database graph, DocumentType type, RID edgeRID, RID out, RID in)
-
ImmutableEdge
public ImmutableEdge(Database graph, DocumentType type, RID rid, Binary buffer)
-
-
Method Detail
-
modify
public MutableEdge modify()
-
get
public Object get(String propertyName)
- Specified by:
get
in interfaceDocument
- Overrides:
get
in classImmutableDocument
-
getOutVertex
public Vertex getOutVertex()
- Specified by:
getOutVertex
in interfaceEdge
-
getInVertex
public Vertex getInVertex()
- Specified by:
getInVertex
in interfaceEdge
-
getVertex
public Vertex getVertex(Vertex.DIRECTION iDirection)
-
getRecordType
public byte getRecordType()
- Specified by:
getRecordType
in interfaceRecord
- Overrides:
getRecordType
in classBaseDocument
-
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 interfaceEdge
- Specified by:
asEdge
in interfaceIdentifiable
- Overrides:
asEdge
in classBaseRecord
- 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 interfaceEdge
- Specified by:
asEdge
in interfaceIdentifiable
- Overrides:
asEdge
in classBaseRecord
- Parameters:
loadContent
- specifies if pre-load the record content- Returns:
- the
Edge
-
toMap
public Map<String,Object> toMap(boolean includeMetadata)
Description copied from interface:Document
Returns a map containing the document properties.- Specified by:
toMap
in interfaceDocument
- Overrides:
toMap
in classImmutableDocument
- Parameters:
includeMetadata
- true to include metadata such as `@rid`, `@type` and `@cat`, otherwise only the document properties
-
toJSON
public JSONObject toJSON(boolean includeMetadata)
- Specified by:
toJSON
in interfaceRecord
- Overrides:
toJSON
in classImmutableDocument
-
toString
public String toString()
- Overrides:
toString
in classImmutableDocument
-
checkForLazyLoading
protected boolean checkForLazyLoading()
- Overrides:
checkForLazyLoading
in classImmutableDocument
-
-