public interface TitanElement extends com.tinkerpop.blueprints.Element, Comparable<TitanElement>, com.thinkaurelius.titan.util.datastructures.Removable
TitanRelation
and TitanVertex
.
Entities have a life cycle state which reflects the current state of the entity with respect
to the TitanTransaction
in which it occurs. An entity may be in any one of these states
and any given time:
getId()
(use hasId()
to determine if a given entity has a unique ID).TitanVertex
,
TitanRelation
Modifier and Type | Method and Description |
---|---|
Object |
getId()
Returns a unique identifier for this entity.
|
long |
getID()
Unique identifier for this entity.
|
<O> O |
getProperty(String key)
Retrieves the value associated with the given key on this vertex and casts it to the specified type.
|
<O> O |
getProperty(TitanKey key)
Retrieves the value associated with the given key on this vertex and casts it to the specified type.
|
boolean |
hasId()
Checks whether this entity has a unique identifier.
|
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.
|
void |
remove()
Deletes this entity from the graph.
|
<O> O |
removeProperty(String key)
Removes the value associated with the given key for this vertex (if exists).
|
<O> O |
removeProperty(TitanType type)
Removes the value associated with the given key for this vertex (if exists).
|
void |
setProperty(String key,
Object value)
Sets the value for the given key on this element.
|
void |
setProperty(TitanKey key,
Object value)
Sets the value for the given key on this element.
|
compareTo
Object getId()
getId
in interface com.tinkerpop.blueprints.Element
IllegalStateException
- if the entity does not (yet) have a unique identifierhasId()
long getID()
getId()
for the permanent id.boolean hasId()
getID()
void remove()
Graph.removeEdge(com.tinkerpop.blueprints.Edge)
or Graph.removeEdge(com.tinkerpop.blueprints.Edge)
to remove an entity unconditionally.remove
in interface com.tinkerpop.blueprints.Element
remove
in interface com.thinkaurelius.titan.util.datastructures.Removable
IllegalStateException
- if the entity cannot be deleted or if the user does not
have permission to remove the entityvoid setProperty(String key, Object value)
TypeMaker.unique(com.tinkerpop.blueprints.Direction)
).setProperty
in interface com.tinkerpop.blueprints.Element
key
- the string identifying the keyvalue
- the object valuevoid setProperty(TitanKey key, Object value)
TypeMaker.unique(com.tinkerpop.blueprints.Direction)
).key
- the keyvalue
- the object value<O> O getProperty(TitanKey key)
key
- key<O> O getProperty(String key)
getProperty
in interface com.tinkerpop.blueprints.Element
key
- string identifying a key<O> O removeProperty(String key)
removeProperty
in interface com.tinkerpop.blueprints.Element
key
- the string identifying the keyremoveProperty(TitanType)
<O> O removeProperty(TitanType type)
type
- the keyboolean isNew()
boolean isLoaded()
boolean isRemoved()
Copyright © 2012-2013. All Rights Reserved.