Interface Element
- 
- All Known Subinterfaces:
- Edge,- Vertex,- VertexProperty<V>
 
 public interface ElementAnElementis the base class for bothVertexandEdge. AnElementhas an identifier that must be unique to its inheriting classes (VertexorEdge). AnElementcan maintain a collection ofPropertyobjects. Typically, objects are Java primitives (e.g. String, long, int, boolean, etc.)- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Interface Description static classElement.ExceptionsCommon exceptions to use with an element.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Graphgraph()Get the graph that this element is within.Objectid()Gets the unique identifier for the graphElement.default Set<String>keys()Get the keys of the properties associated with this element.Stringlabel()Gets the label for the graphElementwhich helps categorize it.<V> Iterator<? extends Property<V>>properties(String... propertyKeys)Get anIteratorof properties where thepropertyKeysis meant to be a filter on the available keys.default <V> Property<V>property(String key)Get aPropertyfor theElementgiven its key.<V> Property<V>property(String key, V value)Add or set a property value for theElementgiven its key.voidremove()Removes theElementfrom the graph.default <V> Vvalue(String key)Get the value of aPropertygiven it's key.default <V> Iterator<V>values(String... propertyKeys)Get the values of properties as anIterator.
 
- 
- 
- 
Method Detail- 
idObject id() Gets the unique identifier for the graphElement.- Returns:
- The id of the element
 
 - 
labelString label() Gets the label for the graphElementwhich helps categorize it.- Returns:
- The label of the element
 
 - 
graphGraph graph() Get the graph that this element is within.- Returns:
- the graph of this element
 
 - 
keysdefault Set<String> keys() Get the keys of the properties associated with this element. The default implementation iterators the properties and stores the keys into aHashSet.- Returns:
- The property key set
 
 - 
propertydefault <V> Property<V> property(String key) Get aPropertyfor theElementgiven its key. The default implementation calls the rawproperties(java.lang.String...).
 - 
property<V> Property<V> property(String key, V value) Add or set a property value for theElementgiven its key.
 - 
valuedefault <V> V value(String key) throws NoSuchElementException Get the value of aPropertygiven it's key. The default implementation callsproperty(java.lang.String)and then returns the associated value.- Throws:
- NoSuchElementException- if the property does not exist on the- Element.
 
 - 
removevoid remove() Removes theElementfrom the graph.
 - 
valuesdefault <V> Iterator<V> values(String... propertyKeys) Get the values of properties as anIterator.
 
- 
 
-