public abstract class AbstractElement extends Object implements InternalElement, Comparable<JanusGraphElement>
For the id, it holds that: id<0: Temporary id, will be assigned id>0 when the transaction is committed id=0: Virtual or implicit element that does not physically exist in the database id>0: Physically persisted element
| Constructor and Description |
|---|
AbstractElement(long id) |
| Modifier and Type | Method and Description |
|---|---|
InternalVertex |
clone() |
static int |
compare(JanusGraphElement e1,
JanusGraphElement e2) |
int |
compareTo(JanusGraphElement other) |
boolean |
equals(Object other) |
protected long |
getCompareId()
Long identifier used to compare elements.
|
int |
hashCode() |
boolean |
hasId()
Checks whether this entity has a unique identifier.
|
boolean |
isInvisible()
Whether this element is invisible and should only be returned to queries that explicitly ask for invisible elements.
|
boolean |
isLoaded()
Checks whether this entity has been loaded into the current transaction and not yet modified.
|
boolean |
isNew()
Checks whether this entity has been newly created in the current transaction.
|
boolean |
isRemoved()
Checks whether this entity has been deleted into the current transaction.
|
static boolean |
isTemporaryId(long elementId) |
long |
longId()
Unique identifier for this entity.
|
void |
setId(long id) |
finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetLifeCycle, graph, it, txid, property, remove, valueOrNullpublic static boolean isTemporaryId(long elementId)
public int compareTo(JanusGraphElement other)
compareTo in interface Comparable<JanusGraphElement>public static int compare(JanusGraphElement e1, JanusGraphElement e2)
public InternalVertex clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionprotected long getCompareId()
longId()
but some instances of elements may be considered the same even if their ids differ. In that case,
this method should be overwritten to return an id that can be used for comparison.public long longId()
JanusGraphElementJanusGraphElement.id() for the permanent id.longId in interface IdfiablelongId in interface JanusGraphElementpublic boolean hasId()
JanusGraphElementNote that some entities may never be assigned an identifier and others will only be assigned an identifier at the end of a transaction.
hasId in interface JanusGraphElementJanusGraphElement.longId()public void setId(long id)
setId in interface InternalElementpublic boolean isInvisible()
InternalElementisInvisible in interface InternalElementpublic boolean isNew()
JanusGraphElementisNew in interface JanusGraphElementpublic boolean isLoaded()
JanusGraphElementisLoaded in interface JanusGraphElementpublic boolean isRemoved()
JanusGraphElementisRemoved in interface JanusGraphElementCopyright © 2012–2023. All rights reserved.