Copyright © Rasmus Sten and contributors, 1997-2004

nu.dll.lyskom
Class TextMapping

java.lang.Object
  |
  +--nu.dll.lyskom.TextMapping
All Implemented Interfaces:
java.util.Enumeration

public class TextMapping
extends java.lang.Object
implements java.util.Enumeration

This class handles storage of global text numbers for one conference.


Field Summary
static int DEBUG
           
 
Constructor Summary
TextMapping()
           
 
Method Summary
 void first()
          Move the "cursor" to the beginning of the list of pairs (similarly to java.sql.ResultSet.first() I thought that I needed this method, but on second thought, I didn't.
 int globalToLocal(int n)
           
 boolean hasMoreElements()
           
 int lastLocal()
           
 int localToGlobal(int n)
           
 java.lang.Object nextElement()
          Returns the next Global number
 boolean removePair(int localNo)
          Remove a local-global pair from this mapping
 int size()
          Return the number of local-global pairs in this mapping
 void update(int offset, nu.dll.lyskom.KomToken[] tk, boolean keepZeroes)
          Update the TextMapping with results from a localToGlobal call
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

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

TextMapping

public TextMapping()
Method Detail

localToGlobal

public int localToGlobal(int n)

globalToLocal

public int globalToLocal(int n)

first

public void first()
Move the "cursor" to the beginning of the list of pairs (similarly to java.sql.ResultSet.first() I thought that I needed this method, but on second thought, I didn't. Maybe it'll come in handy later.


hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Returns the next Global number

Specified by:
nextElement in interface java.util.Enumeration

lastLocal

public int lastLocal()

update

public void update(int offset,
                   nu.dll.lyskom.KomToken[] tk,
                   boolean keepZeroes)
Update the TextMapping with results from a localToGlobal call

Parameters:
offset - Not really sure when this could be anything else than 0 -- Rasmus?
tk - comes from RpcReply.getParameters()
keepZeroes - Keep the pairs where the global part is 0 -- that is, texts that can't be read (probably since they've been deleted)

removePair

public boolean removePair(int localNo)
Remove a local-global pair from this mapping

Returns:
true iff the localNo was present to begin with

size

public int size()
Return the number of local-global pairs in this mapping


Copyright © Rasmus Sten and contributors, 1997-2004