|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.nist.nlpir.irf.proxy.PersistentObjectManager
This class manages the two kinds of objects that may be written to
disk in a very short form: Proxies and Handles. Every kind of proxy
that must be stored in files, plus every kind of handle that has to
be stored in a file, must be registered with this class. This way,
the PersistentObjectManager
gives them a unique code
which ensures an instance of the class will be possible to recreate.
Before this class existed, codes had to be given by hand, forcing the
IRF user to modify the equivalent class in the framework. Now, an
application defining new types of proxies/handles just has to extend
this class and registers the extra classes by simply calling
addXClassName()
, X
being either Proxy or
Handle, with the class name as a parameter.
Field Summary | |
protected static java.util.Vector |
handleClassNameVector
Contains classes that just need a code, and do not necessarily comply to a given class or interface. |
protected static int |
handleClassNumber
Size of the two previous vectors, used several times. |
protected static java.util.Vector |
handleClassVector
Contains the Class objects, in order to call isInstance() and newInstance() . |
protected static java.util.Vector |
proxyClassNameVector
Contains the descendants of VirtualProxy class names. |
protected static int |
proxyClassNumber
Size of the two previous vectors, used several times. |
protected static java.util.Vector |
proxyClassVector
Contains the VirtualProxy children Class objects, in order to call isInstance() and newInstance() . |
private static java.lang.Class |
proxyCranfieldDocumentClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyDeDoubleClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyDeHtml_Class
Working instance of ProxyDE... |
private static java.lang.Class |
proxyDeIntegerClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyDePersonNameClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyDeStringClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyFbisDocumentClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyHciDocClass
Working instance of ProxyDE... |
private static java.lang.Class |
proxyIdxFeatWordInStringClass
|
private static java.lang.Class |
proxyIdxFeatWordInTextClass
|
private static java.lang.Class |
proxyIndexingFeatureClass
|
Constructor Summary | |
PersistentObjectManager()
|
Method Summary | |
static void |
addHandleClassName(java.lang.String handleClassName)
Registers a new handle class with this manager. |
static void |
addProxyClassName(java.lang.String proxyClassName)
Registers a new proxy class with this manager. |
static ProxyDataElem |
buildDE(BufferedRandomAccessFile braf)
Returns a Proxy Data Element of the type associated with the value in the byte[] passed |
static ProxyDocument |
buildDoc(BufferedRandomAccessFile braf)
Builds a proxy IR document from serialized data in the specified file |
static Handle |
buildHandle(BufferedRandomAccessFile braf)
|
static ProxyIndexingFeature |
buildIF(BufferedRandomAccessFile braf)
This method builds an IndexingFeature from the BufferedRandomAccessFile used. |
static VirtualProxy |
buildProxy(BufferedRandomAccessFile braf)
Builds the proxy found in the given file at its current file pointer. |
static void |
defaultInit()
|
static int |
getDE_Type(DataElem de)
Returns a code indicating the type of the data element passed |
static int |
getDocType(ProxyDocument ird)
Returns a code indicating the type of proxy IR document passed |
static int |
getHandleType(Handle handle)
Returns a unique code for every kind of Handle that may be encountered. |
static int |
getIF_Type(ProxyIndexingFeature IF)
This method is a perfect candidate for a general ObjectProvider class that would centralize them. |
private static int |
getProxyType(VirtualProxy theProxy)
Returns the assigned code to the class of this proxy. |
static void |
init()
This method assigns a code to every class, and reorganizes the name vectors so that indexes of names in them match the given code. |
protected static void |
personalizedInit(java.util.Vector proxyClassNames,
java.util.Vector handleClassNames)
This constructor allows to perfectly tune the classes managed, specifying all of them and not just using the default ones provided by the no argument constructor. |
static void |
present()
Presents the different codes assigned to the proxy/handle classes. |
static Handle |
reflectiveBuildHandle(BufferedRandomAccessFile braf)
Builds the handle which is supposed to be found in the given file at its current file pointer. |
private static int |
reflectiveGetHandleType(Handle theHandle)
Returns the code assigned to the class of the given handle. |
static void |
reflectiveWriteHandle(Handle theHandle,
BufferedRandomAccessFile braf)
Writes the given handle in the given file where the file pointer is currently. |
static void |
writeDE(ProxyDataElem theProxy,
BufferedRandomAccessFile braf)
Writes the given proxy in the given file. |
static void |
writeDoc(ProxyDocument theProxy,
BufferedRandomAccessFile braf)
Writes the given proxy in the given file. |
static void |
writeHandle(Handle handle,
BufferedRandomAccessFile braf)
|
static void |
writeIF(ProxyIndexingFeature theProxy,
BufferedRandomAccessFile braf)
Writes the given proxy in the given file. |
static void |
writeProxy(VirtualProxy theProxy,
BufferedRandomAccessFile braf)
Writes the given proxy in the given file. |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static java.util.Vector proxyClassNameVector
protected static java.util.Vector proxyClassVector
isInstance()
and newInstance()
.protected static int proxyClassNumber
protected static java.util.Vector handleClassNameVector
protected static java.util.Vector handleClassVector
isInstance()
and newInstance()
.protected static int handleClassNumber
private static java.lang.Class proxyDeHtml_Class
private static java.lang.Class proxyDeStringClass
private static java.lang.Class proxyDePersonNameClass
private static java.lang.Class proxyDeDoubleClass
private static java.lang.Class proxyDeIntegerClass
private static java.lang.Class proxyHciDocClass
private static java.lang.Class proxyFbisDocumentClass
private static java.lang.Class proxyCranfieldDocumentClass
private static java.lang.Class proxyIndexingFeatureClass
private static java.lang.Class proxyIdxFeatWordInStringClass
private static java.lang.Class proxyIdxFeatWordInTextClass
Constructor Detail |
public PersistentObjectManager()
Method Detail |
protected static void personalizedInit(java.util.Vector proxyClassNames, java.util.Vector handleClassNames)
public static void defaultInit()
public static void addProxyClassName(java.lang.String proxyClassName)
proxyClassName
- The complete name of the proxy class to registerpublic static void addHandleClassName(java.lang.String handleClassName)
handleClassName
- The complete name of the handle class to registerpublic static void init()
public static void writeProxy(VirtualProxy theProxy, BufferedRandomAccessFile braf) throws java.io.IOException
buildProxy()
called at the same offset in the file will
recreate this proxy.private static int getProxyType(VirtualProxy theProxy)
public static VirtualProxy buildProxy(BufferedRandomAccessFile braf) throws java.io.IOException
public static void reflectiveWriteHandle(Handle theHandle, BufferedRandomAccessFile braf) throws java.io.IOException
private static int reflectiveGetHandleType(Handle theHandle)
public static Handle reflectiveBuildHandle(BufferedRandomAccessFile braf) throws java.io.IOException
public static void present()
public static int getDE_Type(DataElem de)
public static int getDocType(ProxyDocument ird)
public static void writeDE(ProxyDataElem theProxy, BufferedRandomAccessFile braf) throws java.io.IOException
buildProxy()
called at the same offset in the file will
recreate this proxy.public static void writeDoc(ProxyDocument theProxy, BufferedRandomAccessFile braf) throws java.io.IOException
buildProxy()
called at the same offset in the file will
recreate this proxy.public static ProxyDataElem buildDE(BufferedRandomAccessFile braf) throws java.io.IOException
public static ProxyDocument buildDoc(BufferedRandomAccessFile braf) throws java.io.IOException
public static Handle buildHandle(BufferedRandomAccessFile braf) throws java.io.IOException
public static int getHandleType(Handle handle)
handle
- Handle for which a code is to be returnedpublic static void writeHandle(Handle handle, BufferedRandomAccessFile braf) throws java.io.IOException
public static ProxyIndexingFeature buildIF(BufferedRandomAccessFile braf) throws java.io.IOException
public static void writeIF(ProxyIndexingFeature theProxy, BufferedRandomAccessFile braf) throws java.io.IOException
buildProxy()
called at the same offset in the file will
recreate this proxy.public static int getIF_Type(ProxyIndexingFeature IF)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |