package edu.vt.marian.search; import java.util.*; import java.io.*; import edu.vt.marian.common.*; /** * Class Manager for "opaque" (unsearchable, incomparable) strings. This is the manager used for classes of raw document objects and the like: classes where the underlying representation is as strings, but none of the String functionality really makes sense. Instance identity is decided externally to the class, so when an object is added it is added with an instance ID attached. The class manager enforces uniqueness of instance IDs, but not of strings. Similarly, the manager can retrieve on instance IDs, but not on strings. * * @author Robert France * @see ClassManager * @see NodeClassManager * @see ControlledStringClassManager */ public class UncontrolledStringClassManager implements NodeClassManager { /** Create (or find in the local cache) a set of matches to description. @param description An abstract description of a set of nodes in this class, including their "context": significant links with other parts of the collection network. @return A WtdObjSet of instances of this class, weighted by how well they match the description. */ public WtdObjSet match(InfoDesc description) { return( null ); } /** * Is this the ID of an instance currently in this class? */ public boolean isInClass(FullID id) { return( false ); } /** * Map this ID to the String form of class instance. @param id The FullID of an instance of this class. @return The String form of that instance, or
'null' if id does not pick out any current class instance. */ public String idToString(FullID id) { return( null ); } /** Return the Java Object that implements the instance of this class picked out by id. @param id The FullID for an object of this class. @return the (Java form of the) real object, or 'null' if id does not describe an instance currently in this class. */ public Object idToObject(FullID id) { return( idToString(id) ); } /** Do idToObject() for a bunch of FullIDs. @param ids A Vector of FullIDs for objects of this class. @return A Vector of real (Java) objects, in one-to-one correspondence with their FullIDs in ids. NOTE: Should a FullID in ids not pick out a valid instance of this class, the corresponding element of the return vector is set to 'null'. */ public Vector idsToObjects(Vector ids) { return( null ); } /** Add a new String and a new FullID for it to this class (See note). @param id An unused FullID of this class. @param str A (presumably) previously unseen String of this class. @return OK -- id has not already been used, and it and str have been added;
ClassManager.ALREADY_EXISTS -- id is already used;
NO_CAN_DO -- something else went wrong.

NOTE: Uncontrolled strings are not comparable, so this cannot check whether str has already been added. It is up to the caller to ensure that strings are not added multiple times with different ids. */ public int add(FullID id, String str) { return( ReturnCodes.NOT_YET_IMPLEMENTED ); } /** Forget about the object referred to by id. @return OK -- There was such a string in the class, and now there isn't;
ClassManager.NO_SUCH_OBJECT -- There never was such an instance.
NO_CAN_DO -- The object was there, but could not be deleted. */ public int delete(FullID id) { return( ReturnCodes.NOT_YET_IMPLEMENTED ); } /** * Return the number of class instances currently in the factory. */ public long classSize() { return( ReturnCodes.NOT_YET_IMPLEMENTED ); } }