public class ComputerGraph.ComputerElement extends Object implements Element, WrappedElement<Element>
Element.Exceptions
Constructor and Description |
---|
ComputerElement(Element element) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
Element |
getBaseElement() |
Graph |
graph()
Get the graph that this element is within.
|
int |
hashCode() |
Object |
id()
Gets the unique identifier for the graph
Element . |
Set<String> |
keys()
Get the keys of the properties associated with this element.
|
String |
label()
Gets the label for the graph
Element which helps categorize it. |
<V> Iterator<? extends Property<V>> |
properties(String... propertyKeys)
Get an
Iterator of properties where the propertyKeys is meant to be a filter on the available
keys. |
<V> Property<V> |
property(String key)
Get a
Property for the Element given its key. |
<V> Property<V> |
property(String key,
V value)
Add or set a property value for the
Element given its key. |
void |
remove()
Removes the
Element from the graph. |
String |
toString() |
<V> V |
value(String key)
Get the value of a
Property given it's key. |
<V> Iterator<V> |
values(String... propertyKeys)
Get the values of properties as an
Iterator . |
public ComputerElement(Element element)
public Object id()
Element
Element
.public String label()
Element
Element
which helps categorize it.public Graph graph()
Element
public Set<String> keys()
Element
HashSet
.public <V> Property<V> property(String key)
Element
Property
for the Element
given its key.
The default implementation calls the raw Element.properties(java.lang.String...)
.public <V> Property<V> property(String key, V value)
Element
Element
given its key.public <V> V value(String key) throws NoSuchElementException
Element
Property
given it's key.
The default implementation calls Element.property(java.lang.String)
and then returns the associated value.value
in interface Element
NoSuchElementException
- if the property does not exist on the Element
.public void remove()
Element
Element
from the graph.public <V> Iterator<? extends Property<V>> properties(String... propertyKeys)
Element
Iterator
of properties where the propertyKeys
is meant to be a filter on the available
keys. If no keys are provide then return all the properties.properties
in interface Element
public <V> Iterator<V> values(String... propertyKeys)
Element
Iterator
.public Element getBaseElement()
getBaseElement
in interface WrappedElement<Element>
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.