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.reasoner.rulesys
Class Node_RuleVariable

    java.lang.Object
      com.hp.hpl.jena.graph.Node
          com.hp.hpl.jena.graph.Node_Fluid
              com.hp.hpl.jena.graph.Node_Variable
                  com.hp.hpl.jena.reasoner.rulesys.Node_RuleVariable

    public class Node_RuleVariable

extends Node_Variable

A variation on the normal Node_Variable which support for value bindings. Currently the forward rule system stores the values externally but requires variables to have an offset index in the rule environment vector. The variables can also suport prolog-like reference chains and trails but these are not yet used.

Note that this should not be used in a real Triple, in particular it should not end up in a Graph. It is only needed for the rule systems.

Version:
  $Revision: 1.20 $ on $Date: 2008/01/02 12:07:47 $
Author:
  Dave Reynolds

Nested Class Summary

Nested classes/interfaces inherited from class com.hp.hpl.jena.graph.Node_Variable
`Node_Variable.VariableName`

Nested classes/interfaces inherited from class com.hp.hpl.jena.graph.Node
`Node.NotLiteral`

Field Summary
`static Node_RuleVariable` | `WILD` A static wildcard - like Node.ANY but tests equl to other Node_RuleVariables

Fields inherited from class com.hp.hpl.jena.graph.Node
`ANY, NULL`

Constructor Summary
`Node_RuleVariable(java.lang.String label, int index)` Constructor

Method Summary
`Node_RuleVariable` | `cloneNode()` Clone the rule variable to allow multiple rule instaces to be active at the same time.
`Node` | `deref()` Dereference a variable by following the reference chain.
`int` | `getIndex()` Returns the variable's index in a binding vector.
`Node` | `getRawBoundValue()` Return the raw value to which this variable is bound (via LP binding) with no dereferencing.
`boolean` | `isUnbound()` Test if the variable is unbound (in the brule sense).
`static boolean` | `sameNodeAs(Node n, Node m)` Compare two nodes, taking into account variable indices.
`boolean` | `sameValueAs(java.lang.Object o)` Test that two nodes are semantically equivalent.
`void` | `setIndex(int index)` Changes the variable's index.
`void` | `simpleBind(Node node)` Binds a value to the brule version of the variable.
`java.lang.String` | `toString()` printable form
`void` | `unbind()` Set the variable to be unbound (in the brule sense)

Methods inherited from class com.hp.hpl.jena.graph.Node_Variable
`equals, getName, isVariable, variable, visitWith`

Methods inherited from class com.hp.hpl.jena.graph.Node_Fluid
`isConcrete`

Methods inherited from class com.hp.hpl.jena.graph.Node
`cache, create, create, create, createAnon, createAnon, createLiteral, createLiteral, createLiteral, createLiteral, createUncachedLiteral, createURI, createVariable, getBlankNodeId, getBlankNodeLabel, getIndexingValue, getLiteral, getLiteralDatatype, getLiteralDatatypeURI, getLiteralIsXML, getLiteralLanguage, getLiteralLexicalForm, getLiteralValue, getLocalName, getNameSpace, getType, getURI, hashCode, hasURI, isBlank, isLiteral, isURI, matches, toString, toString, toString`

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

Field Detail

### WILD

    public static final Node_RuleVariable WILD

  A static wildcard - like Node.ANY but tests equl to other Node_RuleVariables

Constructor Detail

### Node_RuleVariable

    public Node_RuleVariable(java.lang.String label,
                             int index)

  Constructor

  Parameters:
    `label` - the text label for the variable
    `index` - the calculated index of this variable in the rule

Method Detail

### getIndex

    public int getIndex()

  Returns the variable's index in a binding vector.

  Returns:
    int

### setIndex

    public void setIndex(int index)

  Changes the variable's index. This is used in LP rules which classify the variables into different sequences.

### simpleBind

    public void simpleBind(Node node)

  Binds a value to the brule version of the variable. Does not follow any reference trail, assues we have already been derefenced.

  Parameters:
    `node` - a concrete Node value or another Node_RuleVariable to alias to

### deref

    public Node deref()

  Dereference a variable by following the reference chain.

  Returns:
    either a concrete node value or the last variable in the reference chain.

### getRawBoundValue

    public Node getRawBoundValue()

  Return the raw value to which this variable is bound (via LP binding) with no dereferencing.

### unbind

    public void unbind()

  Set the variable to be unbound (in the brule sense)

### isUnbound

    public boolean isUnbound()

  Test if the variable is unbound (in the brule sense).

### cloneNode

    public Node_RuleVariable cloneNode()

  Clone the rule variable to allow multiple rule instaces to be active at the same time.

### toString

    public java.lang.String toString()

  printable form

  Overrides:
    `toString` in class `Node_Variable`

### sameValueAs

    public boolean sameValueAs(java.lang.Object o)

  Test that two nodes are semantically equivalent.

  Overrides:
    `sameValueAs` in class `Node`

### sameNodeAs

    public static boolean sameNodeAs(Node n,
                                     Node m)

  Compare two nodes, taking into account variable indices.

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