ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

javafe.filespace
Class SlowQuery

java.lang.Object
  extended byjavafe.filespace.Query
      extended byjavafe.filespace.SlowQuery

public class SlowQuery
extends Query

This module implements the Query "interface" by using the Java filespace classes (ClassPath, PathComponent, etc.) provided by the javafe.filespace package.


Field Summary
private  Tree javaFileSpace
          The Java file space that corresponds to our classpath.
 
Constructor Summary
SlowQuery()
          Create an query engine that may be queried about packages and classes in the current Java classpath (cf.
SlowQuery(java.lang.String classpath)
          Create an query engine that may be queried about packages and classes in the classpath classpath.
 
Method Summary
 boolean accessable(java.lang.String[] P)
          Return true iff the package P in the Java filespace is "accessible".
 GenericFile findFile(java.lang.String[] P, java.lang.String filename)
           
 GenericFile findFile(java.lang.String[] P, java.lang.String typename, java.lang.String extension)
          Attempt to locate the file typename+"."
 GenericFile findFile(java.lang.String[] P, java.lang.String typename, java.lang.String[] extensions)
          Locates a file with given package, typename, and one of the given extensions; the first directory on the search path containing a candidate file is used - within that directory, extensions near the beginning of the extensions Vector take precedence.
 java.util.Enumeration findFiles(java.lang.String[] P)
          Returns an Enumeration containing GenericFile objects representing all the files in the given package P.
private  Tree getPackage(java.lang.String[] P)
           
static void main(java.lang.String[] args)
          A simple test driver
 
Methods inherited from class javafe.filespace.Query
exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaFileSpace

private Tree javaFileSpace
The Java file space that corresponds to our classpath.

Constructor Detail

SlowQuery

public SlowQuery(java.lang.String classpath)
          throws java.io.IOException
Create an query engine that may be queried about packages and classes in the classpath classpath.


SlowQuery

public SlowQuery()
          throws java.io.IOException
Create an query engine that may be queried about packages and classes in the current Java classpath (cf. ClassPath) at the time the engine was created. (I.e., later changes to the current classpath have no effect on the query engine.)

Method Detail

accessable

public boolean accessable(java.lang.String[] P)
Return true iff the package P in the Java filespace is "accessible".

Warning: the definition of accessible is host system dependent and may in fact be defined as always true.

Overrides:
accessable in class Query

findFile

public GenericFile findFile(java.lang.String[] P,
                            java.lang.String typename,
                            java.lang.String extension)
Attempt to locate the file typename+"."+extension in the package P in the Java filespace.

If such a file is found, then a (non-null) GenericFile representing it is returned. Otherwise, null is returned.

Specified by:
findFile in class Query

findFile

public GenericFile findFile(java.lang.String[] P,
                            java.lang.String filename)
Specified by:
findFile in class Query

findFile

public GenericFile findFile(java.lang.String[] P,
                            java.lang.String typename,
                            java.lang.String[] extensions)
Description copied from class: Query
Locates a file with given package, typename, and one of the given extensions; the first directory on the search path containing a candidate file is used - within that directory, extensions near the beginning of the extensions Vector take precedence.

Specified by:
findFile in class Query

findFiles

public java.util.Enumeration findFiles(java.lang.String[] P)
Description copied from class: Query
Returns an Enumeration containing GenericFile objects representing all the files in the given package P.

Specified by:
findFiles in class Query

getPackage

private Tree getPackage(java.lang.String[] P)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
A simple test driver

Throws:
java.io.IOException

ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage