org.usergrid.persistence.query.ir
Class SliceNode

java.lang.Object
  extended by org.usergrid.persistence.query.ir.QueryNode
      extended by org.usergrid.persistence.query.ir.SliceNode

public class SliceNode
extends QueryNode

A node which has 1 or more query Slices that can be unioned together. I.E and && operation with either 1 or more children

Author:
tnine

Constructor Summary
SliceNode(int id)
          Set the id for construction.
 
Method Summary
 Collection<QuerySlice> getAllSlices()
          Get all slices in our context
 QuerySlice getSlice(String fieldName)
          Get the slice by field name if it exists.
 void removeSlice(String fieldName, CollectionInfo info)
          Remove this slice by name.
 void setFinish(String fieldName, Object finish, boolean inclusive)
          Set the finish.
 void setStart(String fieldName, Object start, boolean inclusive)
          Set the start value.
 String toString()
           
 void visit(NodeVisitor visitor)
          Visit this node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SliceNode

public SliceNode(int id)
Set the id for construction. Just a counter. Used for creating tokens and things like tokens where the same property can be used in 2 different subtrees

Parameters:
id -
Method Detail

setStart

public void setStart(String fieldName,
                     Object start,
                     boolean inclusive)
Set the start value. If the range pair doesn't exist, it's created

Parameters:
start - The start value. this will be processed and turned into an indexed value
includeEnd -

setFinish

public void setFinish(String fieldName,
                      Object finish,
                      boolean inclusive)
Set the finish. If finish value is greater than the existing, I.E. null or higher comparison, then

Parameters:
fieldName -
value -
inclusive -

getSlice

public QuerySlice getSlice(String fieldName)
Get the slice by field name if it exists. Null otherwise

Parameters:
fieldName -
Returns:

removeSlice

public void removeSlice(String fieldName,
                        CollectionInfo info)
Remove this slice by name. Useful when using subkeys

Parameters:
fieldName -

getAllSlices

public Collection<QuerySlice> getAllSlices()
Get all slices in our context

Returns:

visit

public void visit(NodeVisitor visitor)
           throws Exception
Description copied from class: QueryNode
Visit this node

Specified by:
visit in class QueryNode
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.