com.browseengine.bobo.util
Class BigNestedIntArray.BufferedLoader

java.lang.Object
  extended by com.browseengine.bobo.util.BigNestedIntArray.Loader
      extended by com.browseengine.bobo.util.BigNestedIntArray.BufferedLoader
Enclosing class:
BigNestedIntArray

public static final class BigNestedIntArray.BufferedLoader
extends BigNestedIntArray.Loader

A loader that buffer all data in memory, then load them to BigNestedIntArray. Data does not need to be sorted prior to the operation. Note that this loader supports only non-negative integer data.


Field Summary
 
Fields inherited from class com.browseengine.bobo.util.BigNestedIntArray.Loader
reuseUsage
 
Constructor Summary
BigNestedIntArray.BufferedLoader(int size)
           
BigNestedIntArray.BufferedLoader(int size, int maxItems, BigIntBuffer buffer)
           
 
Method Summary
 boolean add(int id, int val)
          adds a pair of id and value to the buffer
 int capacity()
           
 void load()
          loads data
 void reset(int size, int maxItems, BigIntBuffer buffer)
          resets loader.
 
Methods inherited from class com.browseengine.bobo.util.BigNestedIntArray.Loader
add, allocate, copyPageTo, finish, initialize, reserve, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigNestedIntArray.BufferedLoader

public BigNestedIntArray.BufferedLoader(int size,
                                        int maxItems,
                                        BigIntBuffer buffer)

BigNestedIntArray.BufferedLoader

public BigNestedIntArray.BufferedLoader(int size)
Method Detail

reset

public void reset(int size,
                  int maxItems,
                  BigIntBuffer buffer)
resets loader. This also resets underlying BigIntBuffer.


add

public final boolean add(int id,
                         int val)
adds a pair of id and value to the buffer

Parameters:
id -
val -

load

public final void load()
Description copied from class: BigNestedIntArray.Loader
loads data

Specified by:
load in class BigNestedIntArray.Loader

capacity

public final int capacity()


Copyright © 2011. All Rights Reserved.