com.bigdata.btree.raba
Class ReadOnlyValuesRaba

java.lang.Object
  extended by com.bigdata.btree.raba.AbstractRaba
      extended by com.bigdata.btree.raba.ReadOnlyValuesRaba
All Implemented Interfaces:
IRaba, Iterable<byte[]>

public class ReadOnlyValuesRaba
extends AbstractRaba

Immutable implementation allows nulls but does not support search.

Version:
$Id: ReadOnlyValuesRaba.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
static ReadOnlyValuesRaba EMPTY
          A read-only empty values raba.
 
Fields inherited from class com.bigdata.btree.raba.AbstractRaba
a, capacity, fromIndex, toIndex
 
Constructor Summary
ReadOnlyValuesRaba(byte[][] a)
          Create a view of a byte[][].
ReadOnlyValuesRaba(int size, byte[][] a)
          Create a view of a byte[][].
ReadOnlyValuesRaba(int fromIndex, int toIndex, byte[][] a)
          Create a view of a byte[][] slice.
ReadOnlyValuesRaba(int fromIndex, int toIndex, int capacity, byte[][] a)
          Create a view from a slice of a byte[][].
 
Method Summary
 boolean isKeys()
          No.
 boolean isReadOnly()
          This view is read-only.
 
Methods inherited from class com.bigdata.btree.raba.AbstractRaba
add, add, add, assertNotFull, assertNotReadOnly, assertNullAllowed, capacity, copy, get, isEmpty, isFull, isNull, iterator, length, rangeCheck, resize, search, set, size, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final transient ReadOnlyValuesRaba EMPTY
A read-only empty values raba.

Constructor Detail

ReadOnlyValuesRaba

public ReadOnlyValuesRaba(byte[][] a)
Create a view of a byte[][]. All elements in the array are visible in the view.

Parameters:
a - The backing byte[][].

ReadOnlyValuesRaba

public ReadOnlyValuesRaba(int size,
                          byte[][] a)
Create a view of a byte[][]. All elements in the array are visible in the view. The elements in the array from index ZERO (0) through index size-1 are assumed to have valid data.

Parameters:
size - The #of elements with valid data.
a - The backing byte[][].

ReadOnlyValuesRaba

public ReadOnlyValuesRaba(int fromIndex,
                          int toIndex,
                          byte[][] a)
Create a view of a byte[][] slice. The slice will include only those elements between the fromIndex and the toIndex. The capacity will be the #of elements. AbstractRaba.isFull() will report true .

Note: This constructor is used when we split an IKeyArrayIndexProcedure based on a key-range partitioned index.

Parameters:
fromIndex - The index of the first visible in the view (inclusive lower bound).
toIndex - The index of the first element beyond the view (exclusive upper bound). If toIndex == fromIndex then the view is empty.
a - The backing byte[][].

ReadOnlyValuesRaba

public ReadOnlyValuesRaba(int fromIndex,
                          int toIndex,
                          int capacity,
                          byte[][] a)
Create a view from a slice of a byte[][].

Parameters:
fromIndex - The index of the first element in the byte[][] which is visible in the view (inclusive lower bound).
toIndex - The index of the first element in the byte[][] which lies beyond the view (exclusive upper bound).
capacity - The #of elements which may be used in the view.
a - The backing byte[][].
Method Detail

isReadOnly

public final boolean isReadOnly()
This view is read-only.


isKeys

public final boolean isKeys()
No.

Returns:
true if the IRaba represents B+Tree keys and false if it represents B+Tree values.


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