Class Node
- java.lang.Object
-
- com.redislabs.redisgraph.graph_entities.GraphEntity
-
- com.redislabs.redisgraph.graph_entities.Node
-
public class Node extends GraphEntity
* A class represent an node (graph entity). In addition to the base class id and properties, a node has labels.
-
-
Field Summary
-
Fields inherited from class com.redislabs.redisgraph.graph_entities.GraphEntity
id, propertyMap
-
-
Constructor Summary
Constructors Constructor Description Node()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLabel(String label)
boolean
equals(Object o)
String
getLabel(int index)
int
getNumberOfLabels()
int
hashCode()
void
removeLabel(String label)
String
toString()
-
Methods inherited from class com.redislabs.redisgraph.graph_entities.GraphEntity
addProperty, addProperty, getEntityPropertyNames, getId, getNumberOfProperties, getProperty, removeProperty, setId
-
-
-
-
Method Detail
-
addLabel
public void addLabel(String label)
- Parameters:
label
- - a label to be add
-
removeLabel
public void removeLabel(String label)
- Parameters:
label
- - a label to be removed
-
getLabel
public String getLabel(int index)
- Parameters:
index
- - label index- Returns:
- the property label
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= getNumberOfLabels()
)
-
getNumberOfLabels
public int getNumberOfLabels()
- Returns:
- the number of labels
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classGraphEntity
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGraphEntity
-
toString
public String toString()
- Specified by:
toString
in classGraphEntity
-
-