|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Linkable.Utility.CreationDatabase
Field Summary | |
private static java.util.Hashtable |
creations
|
private static boolean |
DEBUG
|
private static java.util.Hashtable |
fileIndex
|
private static boolean |
isLoaded
|
private static java.lang.String |
ME
|
Constructor Summary | |
CreationDatabase()
|
Method Summary | |
static void |
dump()
dump - Print out current contents of the Creation database |
static void |
dump(java.lang.String fname)
dump - Write current contents of the Creation database to file Unlike fileIndex, this will save the data even if the Surrogates don't get saved. |
private static java.lang.String |
dumpAuthors(Author[] authors)
|
private static boolean |
existsSurrogate(java.lang.String doi)
|
static Creation |
fetchCreation(java.lang.String urn)
looks up the Creation for the specified index and returns it |
static java.lang.String |
getDOI(java.lang.String docURN)
getDOI |
private static boolean |
mergable(java.lang.String urnIncomplete,
java.lang.String urnComplete,
int authorLength)
|
static java.lang.String |
mergeCreation(java.lang.String urn,
int authorLength)
mergeCreation - check if the urn can be merged with any others in current CreationDatabase |
static void |
reload()
reload - initialize the hash table from storage (partially) |
static void |
save()
save - write the fileIndex hashtable to file As a side effect, this routine will make sure there actually is a Surrogate in storage before storing a record that involves it. |
static void |
save(java.lang.String urn,
java.lang.String doi)
save - add a new element to the fileIndex hashtable, if it isn't there already. |
static void |
stashCreation(Creation c)
Adds specified creation to the hashtable. |
static void |
update(java.lang.String _newUrn,
java.lang.String _oldUrn)
update - update the creationDatabase after merge urn happens including both creations and fileIndex hashtables |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String ME
private static final boolean DEBUG
private static boolean isLoaded
private static java.util.Hashtable creations
private static java.util.Hashtable fileIndex
Constructor Detail |
public CreationDatabase()
Method Detail |
public static Creation fetchCreation(java.lang.String urn)
-
- the indexpublic static void stashCreation(Creation c)
The
- Creation object to be added to the tablepublic static void dump()
public static void dump(java.lang.String fname)
public static void save(java.lang.String urn, java.lang.String doi)
-
- the URN of the creation being saved-
- the DOI of the Surrogate of which this Creation is part
Note that we save only the last-encountered creation instance.
Hopefully it is the most correct one.
Assert that this routine is called only if a Surrogate really IS
written to storage.public static void save()
public static void reload()
-
- String which is the filename in storage of where the
creation database has been stored
format for the record in file is
(urn, Surrogate DOI, ordinal)
The ordinal is 0 for the Surrogate itself, 1... for a reference
in that Surrogate. Load into fileIndex hashtable.
Thus in principle information does not need to be stored in
both places: the Surrogate object and the database.public static java.lang.String mergeCreation(java.lang.String urn, int authorLength)
-
- urn: the urn need to be merged
authorLength: in order to find out the substring of urn in the case
of missing author, missing date and missing titlepublic static void update(java.lang.String _newUrn, java.lang.String _oldUrn)
-
- _newUrn: the urn after merge
_oldUrn: the old urn that's still in CreationDatabaseprivate static java.lang.String dumpAuthors(Author[] authors)
private static boolean existsSurrogate(java.lang.String doi)
public static java.lang.String getDOI(java.lang.String docURN)
docURN
- - the URN of the creationprivate static boolean mergable(java.lang.String urnIncomplete, java.lang.String urnComplete, int authorLength)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |