edu.vt.marian.search
Class WtdObjSingleLink

java.lang.Object
  |
  +--edu.vt.marian.common.FullID
        |
        +--edu.vt.marian.common.WtdObj
              |
              +--edu.vt.marian.search.WtdObjSingleLink
Direct Known Subclasses:
WtdObjDoubleLink

public class WtdObjSingleLink
extends edu.vt.marian.common.WtdObj

This class augments weighted objects with a "pointer" to a FullID. This is to enable the creation of weighted object tables which are "threaded" like a singly-linked list. The purpose of such a table is to allow O(1) ("direct") access to any point in the logical list, but thereafter to "follow" the entries in the list from that point onwards.

See Also:
WtdObj, FullID, Debug

Field Summary
protected  edu.vt.marian.common.FullID next
          "Pointer" to the next "list" entry
 
Fields inherited from class edu.vt.marian.common.WtdObj
INVALID, weight
 
Fields inherited from class edu.vt.marian.common.FullID
BAD_PARAMS, classID, debug, instanceID, MAX_CLASS_ID, MAX_INSTANCE_ID, NULL_STREAM, OK
 
Constructor Summary
WtdObjSingleLink(edu.vt.marian.common.Debug debug)
          Create a singly-linked weighted object given only a debug object.
WtdObjSingleLink(edu.vt.marian.common.WtdObj w, edu.vt.marian.common.Debug debug)
          Create a singly-linked weighted object given a weighted object (and a debug object).
WtdObjSingleLink(edu.vt.marian.common.WtdObj w, edu.vt.marian.common.FullID fullID, edu.vt.marian.common.Debug debug)
          Create a singly-linked weighted object given a weighted object, a FullID pointing to the "next" list item, and a debug object.
 
Method Summary
 edu.vt.marian.common.FullID getNext()
          Return the FullID key of the next item pointed to in this ordering.
 void setNext(edu.vt.marian.common.FullID nextElt)
          Set the FullID key of the next item pointed to in this ordering.
 java.lang.String toString()
          Convert this WtdObjSingleLink to a string representation.
 
Methods inherited from class edu.vt.marian.common.WtdObj
accum, accum, compare, compare, getID, getWeight, isValid, readPacked, scale, scale, toStream, writePacked
 
Methods inherited from class edu.vt.marian.common.FullID
equals, getClassID, getInstanceID, hashCode, setClassID, setInstanceID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

next

protected edu.vt.marian.common.FullID next
"Pointer" to the next "list" entry
Constructor Detail

WtdObjSingleLink

public WtdObjSingleLink(edu.vt.marian.common.Debug debug)
Create a singly-linked weighted object given only a debug object. The resultant object will have its weighted object set to a newly-created WtdObj and its next "pointer" set to a newly-created---and invalid---FullID.
Parameters:
debug - debug object

WtdObjSingleLink

public WtdObjSingleLink(edu.vt.marian.common.WtdObj w,
                        edu.vt.marian.common.Debug debug)
Create a singly-linked weighted object given a weighted object (and a debug object). The resultant object will have its next "pointer" set to a newly-created---and invalid---FullID.
Parameters:
w - weighted object
debug - debug object

WtdObjSingleLink

public WtdObjSingleLink(edu.vt.marian.common.WtdObj w,
                        edu.vt.marian.common.FullID fullID,
                        edu.vt.marian.common.Debug debug)
Create a singly-linked weighted object given a weighted object, a FullID pointing to the "next" list item, and a debug object. The resultant object will have its next "pointer" set to a newly-created---and invalid---FullID.
Parameters:
w - weighted object
next - key of next element in this list
debug - debug object
Method Detail

getNext

public edu.vt.marian.common.FullID getNext()
Return the FullID key of the next item pointed to in this ordering.
Returns:
key of the next weighted object in this ordering

setNext

public void setNext(edu.vt.marian.common.FullID nextElt)
Set the FullID key of the next item pointed to in this ordering.
Parameters:
nextElt - the "key" of the next element "pointed" to by this one
Returns:
key of the next weighted object in this ordering

toString

public java.lang.String toString()
Convert this WtdObjSingleLink to a string representation. The printable form is "WtdObj(FullID)", where WtdObj is the string representation of the weighted object portion of this object, and FullID is the string representation of the FullID "next" pointer of this object.
Returns:
string containing printable representation of object data
Overrides:
toString in class edu.vt.marian.common.WtdObj
See Also:
WtdObj.toString(), FullID.toString()