com.browseengine.bobo.util
Class BigNestedIntArray

java.lang.Object
  extended by com.browseengine.bobo.util.BigNestedIntArray

public final class BigNestedIntArray
extends Object

write-once big nested int array

Author:
ymatsuda

Nested Class Summary
static class BigNestedIntArray.BufferedLoader
          A loader that buffer all data in memory, then load them to BigNestedIntArray.
static class BigNestedIntArray.Loader
           
 
Field Summary
static int MAX_ITEMS
           
 
Constructor Summary
BigNestedIntArray()
          Constructs BigNEstedIntArray
 
Method Summary
 boolean addData(int id, int data)
          adds Data to id
 int compare(int i, int j)
           
 boolean contains(int id, org.apache.lucene.util.BitVector values)
           
 boolean contains(int id, int value)
           
 int count(int id, int[] count)
           
 void countNoReturn(int id, int[] count)
           
 void countNoReturnWithFilter(int id, int[] count, org.apache.lucene.util.BitVector filter)
           
 int findValue(int value, int id, int maxID)
           
 int findValues(org.apache.lucene.util.BitVector values, int id, int maxID)
           
 int getData(int id, int[] buf)
          gets an int data at [id]
 int getData(int id, int idx, int defaultValue)
          gets an int data at [id][idx]
 int getMaxItems()
          get maximum number of items per doc.
 int getNumItems(int id)
          returns the number data items for id
 Object[] getRawData(int id, TermValueList valarray)
          translates the int value using the val list
 float getScores(int id, int[] freqs, float[] boosts, FacetTermScoringFunction function)
           
 String[] getTranslatedData(int id, TermValueList valarray)
          translates the int value using the val list
 void load(int size, BigNestedIntArray.Loader loader)
          loads data using the loader
 void setMaxItems(int maxItems)
          set maximum number of items per doc.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ITEMS

public static final int MAX_ITEMS
See Also:
Constant Field Values
Constructor Detail

BigNestedIntArray

public BigNestedIntArray()
Constructs BigNEstedIntArray

Throws:
Exception
Method Detail

setMaxItems

public void setMaxItems(int maxItems)
set maximum number of items per doc.

Parameters:
maxItems -

getMaxItems

public int getMaxItems()
get maximum number of items per doc.

Returns:
maxItems

load

public final void load(int size,
                       BigNestedIntArray.Loader loader)
                throws Exception
loads data using the loader

Parameters:
size -
loader -
Throws:
Exception

size

public int size()

getData

public final int getData(int id,
                         int idx,
                         int defaultValue)
gets an int data at [id][idx]

Parameters:
id -
idx -
defaultValue -
Returns:

getData

public final int getData(int id,
                         int[] buf)
gets an int data at [id]

Parameters:
id -
buf -
defaultValue -
Returns:
length

getTranslatedData

public final String[] getTranslatedData(int id,
                                        TermValueList valarray)
translates the int value using the val list

Type Parameters:
T -
Parameters:
array -
id -
valarray -
Returns:

getRawData

public final Object[] getRawData(int id,
                                 TermValueList valarray)
translates the int value using the val list

Type Parameters:
T -
Parameters:
array -
id -
valarray -
Returns:

getScores

public final float getScores(int id,
                             int[] freqs,
                             float[] boosts,
                             FacetTermScoringFunction function)

compare

public final int compare(int i,
                         int j)

contains

public final boolean contains(int id,
                              int value)

contains

public final boolean contains(int id,
                              org.apache.lucene.util.BitVector values)

findValue

public final int findValue(int value,
                           int id,
                           int maxID)

findValues

public final int findValues(org.apache.lucene.util.BitVector values,
                            int id,
                            int maxID)

count

public final int count(int id,
                       int[] count)

countNoReturn

public final void countNoReturn(int id,
                                int[] count)

countNoReturnWithFilter

public final void countNoReturnWithFilter(int id,
                                          int[] count,
                                          org.apache.lucene.util.BitVector filter)

getNumItems

public final int getNumItems(int id)
returns the number data items for id

Parameters:
id -
Returns:

addData

public final boolean addData(int id,
                             int data)
adds Data to id



Copyright © 2011. All Rights Reserved.