com.bigdata.relation.rule
Class Slice

java.lang.Object
  extended by com.bigdata.relation.rule.Slice
All Implemented Interfaces:
ISlice, Externalizable, Serializable

public class Slice
extends Object
implements ISlice, Externalizable

Default implementation.

Version:
$Id: Slice.java 3509 2010-09-05 18:16:01Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Field Summary
static ISlice ALL
          A slice corresponding to all results (offset is zero, limit is Long.MAX_VALUE).
 
Constructor Summary
Slice(long offset, long limit)
           
 
Method Summary
 long getLast()
          The index of the last solution that we will generate (OFFSET + LIMIT).
 long getLimit()
          The maximum #of solutions to be returned to the caller.
 long getOffset()
          The first solution to be returned to the caller.
 void readExternal(ObjectInput in)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL

public static final transient ISlice ALL
A slice corresponding to all results (offset is zero, limit is Long.MAX_VALUE).

Constructor Detail

Slice

public Slice(long offset,
             long limit)
Parameters:
offset -
limit -
Throws:
IllegalArgumentException - if offset is negative.
IllegalArgumentException - if limit is non-positive.
Method Detail

getOffset

public long getOffset()
Description copied from interface: ISlice
The first solution to be returned to the caller. A value of ZERO (0) indicates that all solutions should be returned.

Specified by:
getOffset in interface ISlice

getLimit

public long getLimit()
Description copied from interface: ISlice
The maximum #of solutions to be returned to the caller. A value of Long.MAX_VALUE indicates that there is no limit.

Specified by:
getLimit in interface ISlice

getLast

public long getLast()
Description copied from interface: ISlice
The index of the last solution that we will generate (OFFSET + LIMIT). If OFFSET + LIMIT would be greater than Long.MAX_VALUE, then use Long.MAX_VALUE instead.

Specified by:
getLast in interface ISlice

toString

public String toString()
Overrides:
toString in class Object

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.