lexx.api
Class JavaPackages

java.lang.Object
  |
  +--lexx.api.JavaPackages
All Implemented Interfaces:
Packages

public final class JavaPackages
extends java.lang.Object
implements Packages

Reads in Class Files

This class reads class files from jar/direcotry and stores them in a trie

Copyright (c) 2002-2003

Since:
19/03/2003
Version:
1.0
Author:
Mohammed Imran

Constructor Summary
JavaPackages(java.lang.String projectPath, javax.swing.JLabel statusLabel, java.lang.String libPath)
           
 
Method Summary
 boolean close()
          Shuts down this class to save more memory, only required in Testing
 Trie getClassEnvironment()
          Stores all the available classes in the project.
 java.util.List getClassMap()
           
 java.util.List getClassNames(java.util.List imports)
           
 java.lang.String getClassPath()
           
static JavaPackages getDefaultPackage()
           
 Directory getDirectory(java.lang.String name)
          Using getClassMap()
 Trie getEveryPossibleClass()
          Stores all the available classes in the project.
static java.lang.Object getObject(java.lang.String name, java.util.List classList)
           
 javax.swing.JTree setupTree(EditorFrame editFrame)
          This method is used in testing allow you to see how the classes look like
 java.lang.String toString()
           
 void update(java.io.File f)
          This updates internal data structures
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavaPackages

public JavaPackages(java.lang.String projectPath,
                    javax.swing.JLabel statusLabel,
                    java.lang.String libPath)
Parameters:
projectPath - - directory which contains the source code and external libraries
statusLabel - - uses the label to log information regarding what this class is doing
libPath - - directory which contains any external libararies
Method Detail

close

public boolean close()
Shuts down this class to save more memory, only required in Testing

Returns:
- weither it was sucessessful in closing the files

getClassPath

public final java.lang.String getClassPath()
Returns:
a string containing the class path for the project

update

public final void update(java.io.File f)
This updates internal data structures

Specified by:
update in interface Packages
Parameters:
f - - the jar file/directory which has been changed/added

getClassMap

public final java.util.List getClassMap()
Specified by:
getClassMap in interface Packages
Returns:
a list of all the classes

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

setupTree

public final javax.swing.JTree setupTree(EditorFrame editFrame)
This method is used in testing allow you to see how the classes look like

Specified by:
setupTree in interface Packages

getObject

public static java.lang.Object getObject(java.lang.String name,
                                         java.util.List classList)

getEveryPossibleClass

public final Trie getEveryPossibleClass()
Stores all the available classes in the project. However it contains both the short and full name of the class, such as
java.awt.Frame :: java.awt.Frame
Frame :: java.awt.Frame

Specified by:
getEveryPossibleClass in interface Packages
Returns:
a trie data structure containing these classes

getClassEnvironment

public final Trie getClassEnvironment()
Stores all the available classes in the project. However this only stores the full name of the class, such as
java.awt.Frame :: java.awt.Frame, but not
Frame :: java.awt.Frame

Specified by:
getClassEnvironment in interface Packages
Returns:
a trie data structure containing these classes

getClassNames

public final java.util.List getClassNames(java.util.List imports)

getDirectory

public final Directory getDirectory(java.lang.String name)
Using getClassMap()

Specified by:
getDirectory in interface Packages
Parameters:
name - name of the package you wish to get
Returns:
all the classes found in that package

getDefaultPackage

public static JavaPackages getDefaultPackage()