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 PatternNode

    java.lang.Object
      org.neo4j.graphmatching.AbstractPatternObject<Node>
          org.neo4j.graphmatching.PatternNode

    public class PatternNode

extends AbstractPatternObject<Node>

Represents a pattern for matching a `Node`.

Field Summary
`static PatternGroup` | `DEFAULT_PATTERN_GROUP` The default `PatternGroup`.

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

Constructor Summary
`PatternNode()` Create a new pattern node in the default `PatternGroup` with a blank label.
`PatternNode(PatternGroup group)` Create a new pattern node in the specified `PatternGroup` with a blank label.
`PatternNode(PatternGroup group, String label)` Create a new pattern node in the specified `PatternGroup` with the specified label.
`PatternNode(String label)` Create a new pattern node in the default `PatternGroup` with the specified label.

Method Summary
`PatternRelationship` | `createOptionalRelationshipTo(PatternNode otherNode)` Create a directed, optional `PatternRelationship` from this node, to the specified other node.
`PatternRelationship` | `createOptionalRelationshipTo(PatternNode otherNode, Direction dir)` Create an optional `PatternRelationship` between this node and the specified other node, with the specified direction.
`PatternRelationship` | `createOptionalRelationshipTo(PatternNode otherNode, RelationshipType type)` Create a directed, optional `PatternRelationship` of the specified `RelationshipType` from this node to the specified other node.
`PatternRelationship` | `createOptionalRelationshipTo(PatternNode otherNode, RelationshipType type, Direction dir)` Create an optional `PatternRelationship` of the specified `RelationshipType` between this node and the specified other node, with the specified direction.
`PatternRelationship` | `createRelationshipTo(PatternNode otherNode)` Create a directed, required `PatternRelationship` from this node, to the specified other node.
`PatternRelationship` | `createRelationshipTo(PatternNode otherNode, Direction dir)` Create a required `PatternRelationship` between this node and the specified other node, with the specified direction.
`PatternRelationship` | `createRelationshipTo(PatternNode otherNode, RelationshipType type)` Create a directed, required `PatternRelationship` of the specified `RelationshipType` from this node to the specified other node.
`PatternRelationship` | `createRelationshipTo(PatternNode otherNode, RelationshipType type, Direction dir)` Create a required `PatternRelationship` of the specified `RelationshipType` between this node and the specified other node, with the specified direction.
`Iterable<PatternRelationship>` | `getAllRelationships()` Get all `PatternRelationship`s associated with this pattern node.
`PatternGroup` | `getGroup()` Get the `PatternGroup` of this pattern node.
`Iterable<PatternRelationship>` | `getRelationships(boolean optional)` Get the optional or the required `PatternRelationship`s associated with this pattern node.
`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`

Field Detail

### DEFAULT_PATTERN_GROUP

    public static final PatternGroup DEFAULT_PATTERN_GROUP

  The default `PatternGroup`.

Constructor Detail

### PatternNode

    public PatternNode()

  Create a new pattern node in the default `PatternGroup` with a blank label.

### PatternNode

    public PatternNode(String label)

  Create a new pattern node in the default `PatternGroup` with the specified label.

  Parameters:
    `label` - the label of this pattern node.

### PatternNode

    public PatternNode(PatternGroup group)

  Create a new pattern node in the specified `PatternGroup` with a blank label.

  Parameters:
    `group` - the `PatternGroup` of this pattern node.

### PatternNode

    public PatternNode(PatternGroup group,
                       String label)

  Create a new pattern node in the specified `PatternGroup` with the specified label.

  Parameters:
    `group` - the `PatternGroup` of this pattern node.
    `label` - the label of this pattern node.

Method Detail

### getGroup

    public PatternGroup getGroup()

  Get the `PatternGroup` of this pattern node.

  Returns:
    the `PatternGroup` this pattern node belongs to.

### getAllRelationships

    public Iterable<PatternRelationship> getAllRelationships()

  Get all `PatternRelationship`s associated with this pattern node. This includes both the required and the optional `PatternRelationship`s.

  Returns:
    the `PatternRelationship`s associated with this pattern node.

### getRelationships

    public Iterable<PatternRelationship> getRelationships(boolean optional)

  Get the optional or the required `PatternRelationship`s associated with this pattern node.

  Parameters:
    `optional` - if `true` return only the optional `PatternRelationship`s, else return only the required.
  Returns:
    the set of optional or required `PatternRelationship`s.

### createRelationshipTo

    public PatternRelationship createRelationshipTo(PatternNode otherNode)

  Create a directed, required `PatternRelationship` from this node, to the specified other node.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
  Returns:
    the newly created `PatternRelationship`.

### createRelationshipTo

    public PatternRelationship createRelationshipTo(PatternNode otherNode,
                                                    Direction dir)

  Create a required `PatternRelationship` between this node and the specified other node, with the specified direction.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `dir` - the direction of the relationship. Use `Direction.OUTGOING` to create a relationship from this node to the other node. Use `Direction.INCOMING` to create a relationship from the other node to this node. Use `Direction.BOTH` to create a relationship where the direction does not matter.
  Returns:
    the newly created `PatternRelationship`.

### createRelationshipTo

    public PatternRelationship createRelationshipTo(PatternNode otherNode,
                                                    RelationshipType type)

  Create a directed, required `PatternRelationship` of the specified `RelationshipType` from this node to the specified other node.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `type` - the `RelationshipType` of the relationship.
  Returns:
    the newly created `PatternRelationship`.

### createRelationshipTo

    public PatternRelationship createRelationshipTo(PatternNode otherNode,
                                                    RelationshipType type,
                                                    Direction dir)

  Create a required `PatternRelationship` of the specified `RelationshipType` between this node and the specified other node, with the specified direction.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `type` - the `RelationshipType` of the relationship.
    `dir` - the direction of the relationship. Use `Direction.OUTGOING` to create a relationship from this node to the other node. Use `Direction.INCOMING` to create a relationship from the other node to this node. Use `Direction.BOTH` to create a relationship where the direction does not matter.
  Returns:
    the newly created `PatternRelationship`.

### createOptionalRelationshipTo

    public PatternRelationship createOptionalRelationshipTo(PatternNode otherNode)

  Create a directed, optional `PatternRelationship` from this node, to the specified other node.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
  Returns:
    the newly created `PatternRelationship`.

### createOptionalRelationshipTo

    public PatternRelationship createOptionalRelationshipTo(PatternNode otherNode,
                                                            Direction dir)

  Create an optional `PatternRelationship` between this node and the specified other node, with the specified direction.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `dir` - the direction of the relationship. Use `Direction.OUTGOING` to create a relationship from this node to the other node. Use `Direction.INCOMING` to create a relationship from the other node to this node. Use `Direction.BOTH` to create a relationship where the direction does not matter.
  Returns:
    the newly created `PatternRelationship`.

### createOptionalRelationshipTo

    public PatternRelationship createOptionalRelationshipTo(PatternNode otherNode,
                                                            RelationshipType type)

  Create a directed, optional `PatternRelationship` of the specified `RelationshipType` from this node to the specified other node.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `type` - the `RelationshipType` of the relationship.
  Returns:
    the newly created `PatternRelationship`.

### createOptionalRelationshipTo

    public PatternRelationship createOptionalRelationshipTo(PatternNode otherNode,
                                                            RelationshipType type,
                                                            Direction dir)

  Create an optional `PatternRelationship` of the specified `RelationshipType` between this node and the specified other node, with the specified direction.

  Parameters:
    `otherNode` - the node at the other end of the relationship.
    `type` - the `RelationshipType` of the relationship.
    `dir` - the direction of the relationship. Use `Direction.OUTGOING` to create a relationship from this node to the other node. Use `Direction.INCOMING` to create a relationship from the other node to this node. Use `Direction.BOTH` to create a relationship where the direction does not matter.
  Returns:
    the newly created `PatternRelationship`.

### 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.