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

## com.hp.hpl.jena.graph.query
Class Element

    java.lang.Object
      com.hp.hpl.jena.graph.query.Element

Direct Known Subclasses:
  Bind, Bound, Fixed

    public abstract class Element

extends java.lang.Object

An Element of a matching triple. Elements have associated indexes, their place in the Domain storing the matching values. Subclasses represent constants, binding occurances of variables, and bound instances of variables.

Author:
  hedgehog

Field Summary
`static Element` | `ANY` The constant ANY matches anything and binds nothing

Method Summary
`abstract Node` | `asNodeMatch(Domain d)` Answer a Node suitable as a pattern-match element in a TripleMatch approximating this Element.
`int` | `getIndex()` Answer this Element's index in the Domains it is compiled for.
`abstract boolean` | `match(Domain d, Node x)` Answer true if this Element matches x given the bindings in d.
`java.lang.String` | `toString()`

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

Field Detail

### ANY

    public static final Element ANY

  The constant ANY matches anything and binds nothing

Method Detail

### getIndex

    public int getIndex()

  Answer this Element's index in the Domains it is compiled for.

### match

    public abstract boolean match(Domain d,
                                  Node x)

  Answer true if this Element matches x given the bindings in d. May side-effect d by (re)binding if this element is a variable.

  Parameters:
    `d` - the variable bindings to read/update for variables
    `x` - the value to match
  Returns:
    true if the match succeeded

### asNodeMatch

    public abstract Node asNodeMatch(Domain d)

  Answer a Node suitable as a pattern-match element in a TripleMatch approximating this Element. Thus Bind elements map to null (or Node.ANY).

  Parameters:
    `d` - the domain holding the variable bindings
  Returns:
    the matched value (null if none, ie binding occurance or ANY)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP