|
Neo4j Community | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.neo4j.tooling.wrap.WrappedRelationship<G>
public abstract class WrappedRelationship<G extends WrappedGraphDatabase>
| Field Summary | |
|---|---|
protected G |
graphdb
|
| Constructor Summary | |
|---|---|
protected |
WrappedRelationship(G graphdb)
|
| Method Summary | |
|---|---|
protected abstract T |
actual()
|
void |
delete()
Deletes this relationship. |
boolean |
equals(Object obj)
|
Node |
getEndNode()
Returns the end node of this relationship. |
GraphDatabaseService |
getGraphDatabase()
Get the GraphDatabaseService that this Node or
Relationship belongs to. |
long |
getId()
Returns the unique id of this relationship. |
Node[] |
getNodes()
Returns the two nodes that are attached to this relationship. |
Node |
getOtherNode(Node node)
A convenience operation that, given a node that is attached to this relationship, returns the other node. |
Object |
getProperty(String key)
Returns the property value associated with the given key. |
Object |
getProperty(String key,
Object defaultValue)
Returns the property value associated with the given key, or a default value. |
Iterable<String> |
getPropertyKeys()
Returns all existing property keys, or an empty iterable if this property container has no properties. |
Iterable<Object> |
getPropertyValues()
Returns all currently valid property values, or an empty iterable if this node has no properties. |
Node |
getStartNode()
Returns the start node of this relationship. |
RelationshipType |
getType()
Returns the type of this relationship. |
int |
hashCode()
|
boolean |
hasProperty(String key)
Returns true if this property container has a property
accessible through the given key, false otherwise. |
boolean |
isType(RelationshipType type)
Indicates whether this relationship is of the type type. |
Object |
removeProperty(String key)
Removes the property associated with the given key and returns the old value. |
void |
setProperty(String key,
Object value)
Sets the property value for the given key to value. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.neo4j.graphdb.PropertyContainer |
|---|
getGraphDatabase, getProperty, getProperty, getPropertyKeys, getPropertyValues, hasProperty, removeProperty, setProperty |
| Field Detail |
|---|
protected final G extends WrappedGraphDatabase graphdb
| Constructor Detail |
|---|
protected WrappedRelationship(G graphdb)
| Method Detail |
|---|
public long getId()
Relationship
getId in interface Relationshippublic void delete()
Relationshipdelete() has returned is invalid and will lead to
unspecified behavior.
delete in interface Relationshippublic Node getStartNode()
Relationshipdirections as arguments to the
relationship accessors in Node, see the
class documentation of Relationship.
getStartNode in interface Relationshippublic Node getEndNode()
Relationshipdirections as arguments to the
relationship accessors in Node, see the
class documentation of Relationship.
getEndNode in interface Relationshippublic Node getOtherNode(Node node)
Relationshipnode is
a start node, the end node will be returned, and vice versa. This is a
very convenient operation when you're manually traversing the node space
by invoking one of the getRelationships()
operations on a node. For example, to get the node "at the other end" of
a relationship, use the following:
Node endNode = node.getSingleRelationship( MyRels.REL_TYPE ).getOtherNode( node );
This operation will throw a runtime exception if node is
neither this relationship's start node nor its end node.
getOtherNode in interface Relationshipnode - the start or end node of this relationship
public Node[] getNodes()
Relationship
getNodes in interface Relationshippublic RelationshipType getType()
Relationshipcreation. Remember that relationship
types are semantically equivalent if their
names are equal. This is NOT the same as checking for identity equality using the
== operator. If you want to know whether this relationship is of a
certain type, use the isType()
operation.
getType in interface Relationshippublic boolean isType(RelationshipType type)
Relationshiptype.
This is a convenience method that checks for equality using the contract
specified by RelationshipType, i.e. by checking for equal
names.
isType in interface Relationshiptype - the type to check
true if this relationship is of the type
type, false otherwise or if
nullprotected abstract T actual()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Objectpublic GraphDatabaseService getGraphDatabase()
PropertyContainerGraphDatabaseService that this Node or
Relationship belongs to.
getGraphDatabase in interface PropertyContainerpublic boolean hasProperty(String key)
PropertyContainertrue if this property container has a property
accessible through the given key, false otherwise. If key is
null, this method returns false.
hasProperty in interface PropertyContainerkey - the property key
true if this property container has a property
accessible through the given key, false otherwisepublic Object getProperty(String key)
PropertyContainerString or an array of any of the valid types.
If there's no property associated with key an unchecked
exception is raised. The idiomatic way to avoid an exception for an
unknown key and instead get null back is to use a default
value: Object valueOrNull =
nodeOrRel.getProperty( key, null )
getProperty in interface PropertyContainerkey - the property key
public Object getProperty(String key,
Object defaultValue)
PropertyContainerString or an array of any of the valid types.
getProperty in interface PropertyContainerkey - the property keydefaultValue - the default value that will be returned if no
property value was associated with the given key
public void setProperty(String key,
Object value)
PropertyContainervalue. The
property value must be one of the valid property types, i.e:
boolean or boolean[]byte or byte[]short or short[]int or int[]long or long[]float or float[]double or double[]char or char[]java.lang.String or String[]
This means that null is not an accepted property value.
setProperty in interface PropertyContainerkey - the key with which the new property value will be associatedvalue - the new property value, of one of the valid property typespublic Object removeProperty(String key)
PropertyContainernull
will be returned.
removeProperty in interface PropertyContainerkey - the property key
public Iterable<String> getPropertyKeys()
PropertyContainer
getPropertyKeys in interface PropertyContainerpublic Iterable<Object> getPropertyValues()
PropertyContainerString or an array of any of the
supported types.
Note: This method is deprecated and will be removed in
future releases. Use a combination of PropertyContainer.getPropertyKeys() and
PropertyContainer.getProperty(String) to achieve the same result.
getPropertyValues in interface PropertyContainer
|
Neo4j Community | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||