|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.vt.marian.Document.SgmlDocument
SgmlDocument
class description: this class represents an NLM SGML document in the system.
designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu)
implementator(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu), Robert France
finished time:
known bugs:
JDK version: 1.1.5
side effects:
Field Summary | |
static int |
EXTRACT_ERROR
|
static int |
INVALID_TAG_NAME
|
static int |
NULL_DOCUMENT_STRING
|
static int |
NULL_FIELD_NAME
|
static int |
NULL_SGML_STRING
|
static int |
NULL_STREAM
|
static int |
OK
those are the return values of methods of this class |
Constructor Summary | |
SgmlDocument(java.io.BufferedReader br,
edu.vt.marian.common.Debug debug)
create an SgmlDocument object from the specified stream. |
|
SgmlDocument(java.lang.String documentString,
edu.vt.marian.common.Debug debug)
create an SgmlDocument object from a document string. |
Method Summary | |
edu.vt.marian.common.DigInfObj |
copy()
An attempt to get around declaring public clone() methods. |
boolean |
equals(SgmlDocument d)
tell whether this object and the parameter object represent the same document. |
java.lang.String |
getDocumentString()
return the sgml string of the document this object represents. |
java.lang.String |
getFieldData(java.lang.String field_name)
return the data of this document corresponding to the specified field |
java.lang.String |
getFieldDataByIndex(int index)
return the data of the specified field. |
java.lang.String |
getFieldNameByIndex(int index)
return the name of the specified field. |
java.lang.String |
getFieldSeparator(java.lang.String fieldName)
tell the separator between different text strings in the specified field. |
int |
getNumberFields()
return the number of fields in this document |
boolean |
isValid()
tell whether the object is valid (not whether it has been extracted yet). |
java.util.Vector |
presentAttributes(int markupType)
return a Vector of metadata attributes for this document. |
java.lang.String |
presentFull(int markupType)
return the full description of this document. |
java.lang.String |
presentShort(int markupType)
return the short description of this document in one line. |
int |
setDocumentString(java.lang.String documentString)
set the sgml string of the document this object represents. |
int |
toStream(java.io.PrintWriter pw)
print the contents of this object to the specified stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int OK
public static final int NULL_STREAM
public static final int NULL_DOCUMENT_STRING
public static final int NULL_SGML_STRING
public static final int EXTRACT_ERROR
public static final int INVALID_TAG_NAME
public static final int NULL_FIELD_NAME
Constructor Detail |
public SgmlDocument(java.io.BufferedReader br, edu.vt.marian.common.Debug debug)
br
- the stream from which to read out this documentdebug
- used for debuggingpublic SgmlDocument(java.lang.String documentString, edu.vt.marian.common.Debug debug)
docString
- a string encoding this document in SGMLdebug
- used for debuggingMethod Detail |
public boolean isValid()
public boolean equals(SgmlDocument d)
NOTE: At this point we are using String compare on the raw strings to determine equality. This obviously leaves something to be desired.
d
- the document used to compare with this objectpublic int toStream(java.io.PrintWriter pw)
pw
- the stream to which to write this objectNULL_STREAM -- the parameter stream is null
public java.lang.String getDocumentString()
public int setDocumentString(java.lang.String documentString)
documentString
- this will become the new raw string for
this document objectNULL_DOCUMENT_STRING -- the parameter is null
public int getNumberFields()
public java.lang.String getFieldNameByIndex(int index)
public java.lang.String getFieldDataByIndex(int index)
public java.lang.String getFieldData(java.lang.String field_name)
null -- extraction problem
public java.lang.String getFieldSeparator(java.lang.String fieldName)
fieldName
- name of field to searchpublic edu.vt.marian.common.DigInfObj copy()
public java.lang.String presentShort(int markupType)
markupType
- how to mark up the string returned (e.g., HTML or ASCII).public java.util.Vector presentAttributes(int markupType)
markupType
- how to mark up the string returned (e.g., HTML or ASCII).public java.lang.String presentFull(int markupType)
markupType
- how to mark up the string returned (e.g., HTML or ASCII).
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |