|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--org.omegahat.Environment.Utils.OrderedTable
|
+--org.omegahat.Environment.Tools.ClassList.ObjectList
Table containing information read from a file or directory which
| Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
| Field Summary | |
protected boolean |
archive
Flag indicating whether this file which contains the list's contents is an archive (zip or jar) file rather than a regular directory. |
protected java.io.FilenameFilter |
class_filter
|
protected long |
compute_time
The time the list was dynamically constructed so that we can determine whether the source has been modified since that time and hence may have changes. |
protected DirectoryFilter |
dir_filter
|
protected boolean |
doneSearch
A flag indicating that the lookup has been done. |
protected java.io.File |
file
The name of the file (directory, etc.) which contains the contents of the list. |
static java.lang.String |
fileSeparator
|
protected static boolean |
issuedWarning
|
protected boolean |
recursive
Controls whether sub-directory entries are added ( false) to this list
or grouped in their own sub-list and this added as a single entry. |
static boolean |
verbose
|
| Fields inherited from class org.omegahat.Environment.Utils.OrderedTable |
listeners, name, orderedElements, orderedKeys, state |
| Fields inherited from interface org.omegahat.Environment.Databases.Database |
ALL, ASSIGN, ATTACH, DETACH, NULL_ENTRY, READ, READ_WRITE, REMOVE |
| Fields inherited from interface org.omegahat.Environment.Databases.Activable |
ACTIVE, INACTIVE |
| Constructor Summary | |
ObjectList()
Default constructor allowing derived classes to avoid calling super(..). |
|
ObjectList(java.io.File f)
Constructor which reads the contents of the list from the specified "file", be it a directory or archive file. |
|
| Method Summary | |
java.lang.Object |
add(java.util.zip.ZipEntry entry)
|
java.lang.Object |
add(java.util.zip.ZipEntry entry,
boolean check)
|
void |
addElement(java.lang.Object el)
|
boolean |
archive(boolean val)
Specify whether the source of the list's contents is a zip or jar file or not. |
boolean |
checkIsArchive(java.lang.String f)
Determines whether the file identified by the supplied name is an archive (zip or jar) file or not. |
long |
computeTime()
Return the time when the contents of the list were computed, causing it to be defined as "now". |
protected long |
computeTime(boolean val)
Control whether we compute the time, specifying when the contents of the list were computed. |
DirectoryFilter |
directoryFilter()
|
DirectoryFilter |
directoryFilter(DirectoryFilter f)
|
boolean |
doneSearch()
Accessor for determining whether the contents have been computed. |
protected boolean |
doneSearch(boolean val)
Set the status of whether the elements have been computed. |
java.util.Vector |
entries()
Get a Vector of the entries
in this list. |
java.io.File |
file()
Accessor to the file field. |
java.io.File |
file(java.io.File f)
Stores the file which is the source of the tables entries determining whether it is an archive or not. |
java.io.File |
file(java.io.File f,
boolean update)
Sets the target directory/file in which the objects of interest are located, but optionally arranges to assume the entries are up-to-date and that there is no need to recompute them unless the file is changed, etc. |
static java.lang.String |
fileSeparator()
Static method returning the separator for the different nodes in a directory/file specification, particular to the different operating system being used. |
java.lang.Object |
find(java.lang.String name)
|
java.lang.String |
getDirectory(java.lang.String str)
|
boolean |
isArchive()
Determine whether the source of the list's content is a zip/jar file or not. |
boolean |
issuedWarning()
|
boolean |
issuedWarning(boolean v)
|
protected int |
lookup()
Compute the elements of the list by interrogating the source "file" and processing it recursively. |
int |
lookupArchive(java.io.File file)
Compute the contents of the list by reading the elements of the archive file. |
protected int |
lookupDirectory()
Simple toplevel method for starting the recursive lookup of directories specifying the top-level source directory. |
protected int |
lookupDirectory(java.io.File dir)
Lookup the .class files in the given directory identified by the argument, filtering it through the file name filter , filtering adding each one to the list. |
boolean |
matchesClassName(java.lang.String name,
java.lang.String source)
|
ObjectList |
newSubList()
|
protected ObjectList |
processDirectoryClasses(java.lang.String[] els,
java.lang.String prefix,
java.io.File dir)
|
protected int |
processSubDirectories(java.lang.String[] els,
java.io.File dir)
|
boolean |
recursive()
|
boolean |
recursive(boolean v)
|
boolean |
refresh()
Mark the list as needing to be recomputed, leaving the rebuilding until the contents are queried in another call. |
boolean |
refresh(boolean now)
Mark the list as needing to be recomputed, and optionally perform the rebuilding of the contents now or leave it until they are used. |
boolean |
sourceIsNewer()
Determine whether the source of the contents of this list has been changed since the contents were computed from it. |
java.lang.String |
toClassName(java.lang.String str)
|
void |
warn(java.lang.String msg)
|
void |
warnDirectory(java.io.File f)
Internal computation done when a warning is about a container in the lookup that is neither a directory or archive class. |
| Methods inherited from class org.omegahat.Environment.Utils.OrderedTable |
add, add, addListListener, assign, assignSubset, attach, clear, copy, copy, detach, elementAt, exists, get, getName, getState, keys, listeners, listeners, notifyListeners, objects, ordered, orderedKeys, put, put, put, remove, remove, removeElement, removeElement, removeElementAt, removeElementAt, removeListListener, setElementAt, setName, setState, subset, subset, subset |
| Methods inherited from class java.util.Hashtable |
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, rehash, size, toString, values |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.omegahat.Environment.Databases.Database |
size |
| Field Detail |
protected java.io.FilenameFilter class_filter
protected DirectoryFilter dir_filter
protected java.io.File file
protected long compute_time
protected boolean recursive
false) to this list
or grouped in their own sub-list and this added as a single entry.
The benefit of the latter approach is that we can operate on the sublist
as a single element, changing the order of lookup and using it in its own right.protected boolean archive
protected boolean doneSearch
entries() is called.public static java.lang.String fileSeparator
protected static boolean issuedWarning
public static boolean verbose
| Constructor Detail |
public ObjectList(java.io.File f)
public ObjectList()
| Method Detail |
public java.util.Vector entries()
Vector of the entries
in this list. This is a reference to the contents, and not
a copy. If the contents have not been computed when this is called,
it is done at this point.public boolean isArchive()
public boolean archive(boolean val)
public long computeTime()
computeTime(boolean)protected long computeTime(boolean val)
val - indicates whether to compute the current
time and store it as the time the contents were
computed.public boolean sourceIsNewer()
protected int lookup()
| -1 | degenerate source file object |
|---|---|
| -3 | source is neither an archive or directory |
lookupDirectory(java.io.File)protected int lookupDirectory()
protected int lookupDirectory(java.io.File dir)
protected int processSubDirectories(java.lang.String[] els,
java.io.File dir)
protected ObjectList processDirectoryClasses(java.lang.String[] els,
java.lang.String prefix,
java.io.File dir)
public DirectoryFilter directoryFilter()
public DirectoryFilter directoryFilter(DirectoryFilter f)
public java.lang.Object find(java.lang.String name)
public java.lang.String toClassName(java.lang.String str)
public static java.lang.String fileSeparator()
public boolean matchesClassName(java.lang.String name,
java.lang.String source)
public boolean refresh()
public boolean refresh(boolean now)
now - flag indicating whether we should recompute the table
immediately or leave it to be done when it is next queried.
public ObjectList newSubList()
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
public java.io.File file()
file field.public java.io.File file(java.io.File f)
public boolean checkIsArchive(java.lang.String f)
public java.io.File file(java.io.File f,
boolean update)
doneSearch
flag and compute the current time.file - the name of the directory or file in which to look for the
objects of interest.update - if true, the entries are assumed to be up-to-date.public boolean doneSearch()
protected boolean doneSearch(boolean val)
public boolean issuedWarning()
public boolean issuedWarning(boolean v)
public boolean recursive()
public boolean recursive(boolean v)
public void warn(java.lang.String msg)
public void warnDirectory(java.io.File f)
JAVA_HOME
directory tree as JDK2 seems to add jre/classes
which does not exit
to the sun.boot.pathpublic void addElement(java.lang.Object el)
public int lookupArchive(java.io.File file)
public java.lang.Object add(java.util.zip.ZipEntry entry)
public java.lang.Object add(java.util.zip.ZipEntry entry,
boolean check)
public java.lang.String getDirectory(java.lang.String str)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||