- public class OneSizeHandlesByOid
- extends HandlesByOid
This particular implementation of HandlesByOid assumes all handles
take the same space when they are written to disk. This size currently
is 17, but if it was to change, this class can easily be extended just
redefining this value (not forgetting that 1 must be added to the size
to take care of the code written on one byte before every handle.
- $Revision: 1.4 $
- This software was produced by NIST, an agency of the U.S. government,
and by statute is not subject to copyright in the United States.
Recipients of this software assume all responsibilities associated
with its operation, modification and maintenance.
- See Also:
- Serialized Form
|Fields inherited from class gov.nist.nlpir.irf.proxy.HandlesByOid
|Methods inherited from class java.lang.Object
protected static int handlesByOidDataEntrySize
- Assumed constant entry size for serialized Handle.
It is just protected so that one may inherit this class and
just redefine it if he had longer/shorter handles.
protected final void writeHandleForOid(Oid oid,
- Directly writes the handle at the correct offset in the data file.
The offset is easily computed with a multiplication of the
handlesByOidDataEntrySize variable by the OID given in parameter.
- writeHandleForOid in class HandlesByOid
protected Handle readHandleForOid(Oid oid)
- Reads the Handle back from the data file. The offset at which it
is written is calculated by multiplying the OID by the size of a
"serialized" handle, as this size is unique.
- readHandleForOid in class HandlesByOid
public long getHandlesByOidSize()
- Gets the size of the table
- the number of keys (Oids) in the table
- getHandlesByOidSize in class HandlesByOid