net.java.sen.compiler
クラス VirtualTupleList

java.lang.Object
  上位を拡張 net.java.sen.compiler.VirtualTupleList

public class VirtualTupleList
extends java.lang.Object

A file-mapped list of StringCTokenTuples. Slightly slower than a simple in-memory sort, but capable of storing and sorting very long lists without using large quantities of heap memory.
The index of entry positions in the list's file is stored in memory, leading to a usage of one Integer's worth of memory for each entry.

Usage:

- Call add(java.lang.String, net.java.sen.dictionary.CToken) one or more times

- Call sort() once. Once the list has been sorted, it is no longer valid to add new entries

- Call get(int) to retrieve entries from the sorted list


コンストラクタの概要
VirtualTupleList()
           
 
メソッドの概要
 void add(java.lang.String string, CToken ctoken)
          Adds a StringCTokenTuple to the list.
 StringCTokenTuple get(int index)
          Retrieves an entry from the list.
 int size()
          Returns the number of entries in the list
 void sort()
          Sorts the list
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

VirtualTupleList

public VirtualTupleList()
                 throws java.io.IOException
例外:
java.io.IOException
メソッドの詳細

add

public void add(java.lang.String string,
                CToken ctoken)
         throws java.io.IOException
Adds a StringCTokenTuple to the list. Passed in as the Tuple's constituent parts to avoid creating an object that we immediately serialise and throw away

パラメータ:
string - The string
ctoken - The CToken
例外:
java.io.IOException

get

public StringCTokenTuple get(int index)
Retrieves an entry from the list. Only valid after the list has been sorted

パラメータ:
index - The index of the entry to retrieve
戻り値:
The list entry

sort

public void sort()
          throws java.io.IOException
Sorts the list

例外:
java.io.IOException

size

public int size()
Returns the number of entries in the list

戻り値:
The number of entries in the list


Copyright ? 2008. All Rights Reserved.