org.basex.query.xpath.locpath
Class Steps

java.lang.Object
  extended by org.basex.query.xpath.locpath.Steps

public final class Steps
extends java.lang.Object

Location Steps.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Constructor Summary
Steps()
           
 
Method Summary
 void add(int s, Step step)
          Adds the specified step at the specified position.
 void add(Step step)
          Adds the specified step.
 boolean compile(XPContext ctx)
          Optimizes the location steps.
 Nod eval(XPContext ctx)
          Evaluates the location steps.
 Step get(int s)
          Returns the specified step.
 Step last()
          Returns the last location step.
 void plan(Serializer ser)
          Serializes the abstract syntax tree.
 void remove(int s)
          Removes the specified step.
 boolean sameAs(Steps stps)
          Returns the location steps for equality.
 void set(int s, Step step)
          Sets the specified step.
 int size()
          Returns the number of location steps.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Steps

public Steps()
Method Detail

size

public int size()
Returns the number of location steps.

Returns:
number of steps

get

public Step get(int s)
Returns the specified step.

Parameters:
s - step index
Returns:
location step

last

public Step last()
Returns the last location step.

Returns:
location step

set

public void set(int s,
                Step step)
Sets the specified step.

Parameters:
s - step index
step - step to be set

add

public void add(int s,
                Step step)
Adds the specified step at the specified position.

Parameters:
s - step index
step - step to be added

add

public void add(Step step)
Adds the specified step.

Parameters:
step - step to be added

remove

public void remove(int s)
Removes the specified step.

Parameters:
s - step index

eval

public Nod eval(XPContext ctx)
         throws QueryException
Evaluates the location steps.

Parameters:
ctx - query context
Returns:
result of check
Throws:
QueryException - evaluation exception

compile

public boolean compile(XPContext ctx)
                throws QueryException
Optimizes the location steps.

Parameters:
ctx - query context
Returns:
false if location step yields no results
Throws:
QueryException - evaluation exception

sameAs

public boolean sameAs(Steps stps)
Returns the location steps for equality.

Parameters:
stps - location steps to be compared
Returns:
result of check

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

plan

public void plan(Serializer ser)
          throws java.io.IOException
Serializes the abstract syntax tree.

Parameters:
ser - serializer
Throws:
java.io.IOException - exception