Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Neo4j Community
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.neo4j.graphmatching
Class PatternRelationship

    java.lang.Object
      org.neo4j.graphmatching.AbstractPatternObject<Relationship>
          org.neo4j.graphmatching.PatternRelationship

    public class PatternRelationship

extends AbstractPatternObject<Relationship>

Represents a pattern for matching a `Relationship`.

Field Summary

Fields inherited from class org.neo4j.graphmatching.AbstractPatternObject
`label`

Method Summary
`Direction` | `getDirectionFrom(PatternNode fromNode)` Get the direction in which relationships are discovered using this relationship pattern from the specified node.
`PatternNode` | `getFirstNode()` Get the first pattern node that this pattern relationship relates.
`PatternNode` | `getOtherNode(PatternNode node)` Get the `PatternNode` that this pattern relationship relates, that is not the specified node.
`PatternNode` | `getSecondNode()` Get the second pattern node that this pattern relationship relates.
`RelationshipType` | `getType()` Get the `RelationshipType` a relationship must have in order to match this pattern relationship.
`boolean` | `isOptional()` Does this pattern relationship represent a relationship that has to exist in the subgraph to consider the subgraph a match of the pattern, or is it an optional relationship.
`String` | `toString()`

Methods inherited from class org.neo4j.graphmatching.AbstractPatternObject
`addPropertyConstraint, getAssociation, getLabel, getPropertyConstraints, setAssociation, setLabel`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Method Detail

### getOtherNode

    public PatternNode getOtherNode(PatternNode node)

  Get the `PatternNode` that this pattern relationship relates, that is not the specified node.

  Parameters:
    `node` - one of the `PatternNode`s this pattern relationship relates.
  Returns:
    the other pattern node.

### getFirstNode

    public PatternNode getFirstNode()

  Get the first pattern node that this pattern relationship relates.

  Returns:
    the first pattern node.

### getSecondNode

    public PatternNode getSecondNode()

  Get the second pattern node that this pattern relationship relates.

  Returns:
    the second pattern node.

### isOptional

    public boolean isOptional()

  Does this pattern relationship represent a relationship that has to exist in the subgraph to consider the subgraph a match of the pattern, or is it an optional relationship.

  Returns:
    `true` if this pattern relationship represents an optional relationship, `false` if it represents a required relationship.

### getType

    public RelationshipType getType()

  Get the `RelationshipType` a relationship must have in order to match this pattern relationship. Will return `null` if a relationship with any `RelationshipType` will match.

  Returns:
    the `RelationshipType` of this relationship pattern.

### getDirectionFrom

    public Direction getDirectionFrom(PatternNode fromNode)

  Get the direction in which relationships are discovered using this relationship pattern from the specified node. May be `outgoing`, `incoming`, or `both`.

  Parameters:
    `fromNode` - the pattern node to find the direction of this pattern relationship from.
  Returns:
    the direction to discover relationships matching this pattern in.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Neo4j Community
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011 The Neo4j Graph Database Project. All Rights Reserved.