|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--edu.vt.marian.search.ControlledStringClassManager
Class Manager for searchable Strings. Controlled strings are those that can be recognized, compared, and searched, as opposed to the long uncontrolled strings that serve as underlayment for raw documents. Examples of controlled string classes are persons' names, subject descriptors, and English words. Since the criteria for identity is determined by the raw objects (in Java, it is just String.equals()) the class manager can enforce instance identity, and can and does generate its own instance IDs. Thus, when a client adds a string to the class, it is the class manager, not the client, that generates the instance ID. In fact, adding a string and generating an ID is not semantically separable from recognizing a string already in the class and returning its previously generated ID.
ClassManager,
NodeClassManager,
UncontrolledStringClassManager| Constructor Summary | |
ControlledStringClassManager()
|
|
| Method Summary | |
int |
add(edu.vt.marian.common.FullID id,
java.lang.String str)
Add a new String and a new FullID for it to this class (See note). |
edu.vt.marian.common.FullID |
add(java.lang.String str)
Add a new String to this class, and generate its new FullID. |
long |
classSize()
Return the number of class instances currently in the factory. |
int |
delete(edu.vt.marian.common.FullID id)
Forget about the object referred to by id. |
int |
delete(java.lang.String str)
Forget about a String currently among the class instances. |
java.util.Vector |
idsToObjects(java.util.Vector ids)
Do idToObject() for a bunch of FullIDs. |
java.lang.Object |
idToObject(edu.vt.marian.common.FullID id)
Return the Java Object that implements the instance of this class picked out by id. |
java.lang.String |
idToString(edu.vt.marian.common.FullID id)
Map this ID to the String form of class instance. |
boolean |
isInClass(edu.vt.marian.common.FullID id)
Is this the ID of an instance currently in this class? |
boolean |
isInClass(java.lang.String str)
Is this String an instance currently in this class? |
WtdObjSet |
match(edu.vt.marian.common.InfoDesc description)
Create (or find in the local cache) a set of matches to description. |
edu.vt.marian.common.FullID |
stringToID(java.lang.String str)
Map this String to a FullID of this class. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public ControlledStringClassManager()
| Method Detail |
public WtdObjSet match(edu.vt.marian.common.InfoDesc description)
public boolean isInClass(edu.vt.marian.common.FullID id)
public boolean isInClass(java.lang.String str)
public java.lang.String idToString(edu.vt.marian.common.FullID id)
id - The FullID of an instance of this class.public java.lang.Object idToObject(edu.vt.marian.common.FullID id)
id - The FullID for an object of this class.public java.util.Vector idsToObjects(java.util.Vector ids)
ids - A Vector of FullIDs for objects of this class.public edu.vt.marian.common.FullID stringToID(java.lang.String str)
str - The String form of an instance of this class.NOTE: This is a "find-or-add" operation. If str is already known as a member of this class, then an ID has already been assigned to it in an earlier invocation of this method of add(). The same ID will be returned this time. If str has not previsously been seen, it will be added to the known instances of the class. A previously unused instanceID will be generated for it and used to construct the FullID that is returned.
add(String)
public int add(edu.vt.marian.common.FullID id,
java.lang.String str)
id - An unused FullID of this class.str - A previously unseen String of this class.NOTE: This method should not be used under normal circumstances. Normally all FullIDs of a controlled string class are generated by the class manager. Overriding that responsibility and adding one created "on the outside" introduces inefficiencies and the potential for confusion. Insead, add(Sting str) and stringToID() are preferred.
public edu.vt.marian.common.FullID add(java.lang.String str)
str - The String form of an instance of this class.NOTE: This method is identical to stringToID() except that str is presumed to not already be a known instance of this class. If it is an instance already managed by this, add() will fail.
stringToID(java.lang.String)public int delete(edu.vt.marian.common.FullID id)
public int delete(java.lang.String str)
public long classSize()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||