public interface Element
Element is the base class for both Vertex and Edge. An Element has an identifier
that must be unique to its inheriting classes (Vertex or Edge). An Element can maintain a
collection of Property objects. Typically, objects are Java primitives (e.g. String, long, int, boolean,
etc.)| Modifier and Type | Interface and Description |
|---|---|
static class |
Element.Exceptions
Common exceptions to use with an element.
|
static interface |
Element.Iterators
An interface that provides access to iterators over properties of an
Element, without constructing a
Traversal object. |
| Modifier and Type | Method and Description |
|---|---|
Graph |
graph()
Get the graph that this element is within.
|
java.lang.Object |
id()
Gets the unique identifier for the graph
Element. |
Element.Iterators |
iterators()
Gets the iterators for the
Element. |
default java.util.Set<java.lang.String> |
keys()
Get the keys of the properties associated with this element.
|
java.lang.String |
label()
Gets the label for the graph
Element which helps categorize it. |
default <V> Property<V> |
property(java.lang.String key)
Get a
Property for the Element given its key. |
<V> Property<V> |
property(java.lang.String key,
V value)
Add or set a property value for the
Element given its key. |
void |
remove()
Removes the
Element from the graph. |
default <V> V |
value(java.lang.String key)
Get the value of a
Property given it's key. |
java.lang.Object id()
Element.java.lang.String label()
Element which helps categorize it.Graph graph()
default java.util.Set<java.lang.String> keys()
HashSet.default <V> Property<V> property(java.lang.String key)
Property for the Element given its key.
The default implementation calls the raw Element#iterators#propertyIterator.<V> Property<V> property(java.lang.String key, V value)
Element given its key.default <V> V value(java.lang.String key)
throws java.util.NoSuchElementException
Property given it's key.
The default implementation calls property(java.lang.String) and then returns the associated value.java.util.NoSuchElementException - if the property does not exist on the Element.void remove()
Element from the graph.Element.Iterators iterators()
Element. Iterators provide low-level access to the data associated with
an Element as they do not come with the overhead of Traversal
construction. Use iterators in places where performance is most crucial.Copyright © 2013-2015 TinkerPop. All Rights Reserved.