|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.vt.marian.common.FullID | +--edu.vt.marian.common.WtdObj | +--edu.vt.marian.common.WtdEntireObj
A Weighted Object that actually includes the full object! Unlike the class WtdObj, which only includes a FullID, a WtdEntireObj also includes a Java Object which is the actual instance selected by the FullID.
We actually use WtEntireObjs in two ways. In what might be thought of as the paradigmatic use, the Object is a digital information object and implements some sub-interface of DigInfObj. At several levels of MARIAN, however, this is overkill, and we simply need to more the raw object around, in the form of an unanalyzed string or stream, without creating a DigInfObj instance from it.
Field Summary | |
protected boolean |
extracted
whether obj is a raw string, or has been "extracted" and converted into a real DigInfObj. |
static int |
NO_CAN_DO
|
protected java.lang.Object |
obj
either an object of class classID or a string from which such an object can be extracted. |
static int |
OK
return values of methods of this class |
static int |
UNKNOWN_CLASS
|
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 | |
WtdEntireObj(java.io.BufferedReader br,
Debug debug)
method description: this constructor will create a WtdEntireObj object from the specified stream |
|
WtdEntireObj(FullID id,
Weight w,
Document o,
Debug debug)
method description: this constructor will create a WtdEntireObj from the specified id, weight and document string uses the services of class(es): |
Method Summary | |
Document |
getDocument()
return the (extracted) Document object. |
java.lang.String |
getRawObj()
return the raw string of the document this object represents. |
int |
setDocument(Document o)
set the entire object to (a clone of) an extracted object. |
int |
setRawObj(java.lang.String objectAsString)
set this to a (non-extracted) String representation of the entire object. |
int |
toStream(java.io.PrintWriter pw)
print the contents of this object to the specified stream. |
Methods inherited from class edu.vt.marian.common.WtdObj |
accum,
accum,
compare,
compare,
getID,
getWeight,
isValid,
readPacked,
scale,
scale,
toString,
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 |
protected java.lang.Object obj
protected boolean extracted
public static final int OK
public static final int UNKNOWN_CLASS
public static final int NO_CAN_DO
Constructor Detail |
public WtdEntireObj(java.io.BufferedReader br, Debug debug)
br
- the stream to read out this documentdebug
- used for debuggingpublic WtdEntireObj(FullID id, Weight w, Document o, Debug debug)
uses the services of class(es):
id
- this will be the id of this documentw
- this will be the weight at which this document corresponds to a
queryo
- the Object that id stands for.debug
- used for debuggingMethod Detail |
public int toStream(java.io.PrintWriter pw)
pw
- the stream to write this objectpublic java.lang.String getRawObj()
public int setRawObj(java.lang.String objectAsString)
objectAsString
- a String from which the entire object can be
built.NOTE: What if this is of class String? Then you should use setEntireObj() instead of setRaw() to avoid confusion.
public int setDocument(Document o)
o
- the object corresponding to this.id.public Document getDocument()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |