com.borland.jbuilder.paths
Class PathSet

java.lang.Object
  |
  +--com.borland.jbuilder.paths.PathSet
Direct Known Subclasses:
JDKPathSet, ProjectPathSet

public class PathSet
extends java.lang.Object

A PathSet represents a collection of Java paths and is typically used to define a library for use by a JBuilder project. In addition to the definition of class, source, and documentation paths, a library may also list a number of additional libraries that it needs path entries from to function correctly.

Each path has a total of three accessor methods, combining the typical getter and setter with a "full" getter that incorporates all of the path entries from other libraries required by this library.

Two specialized subclasses of PathSet, JDKPathSet and ProjectPathSet, provide additional characteristics for defining JDKs and projects, respectively.


Field Summary
static PathSet[] EMPTY_ARRAY
           
 
Constructor Summary
PathSet(java.lang.String name)
          Creates a new library PathSet.
 
Method Summary
protected  void addUniquePath(java.util.List list, Url url)
          Adds a path to a list of paths if and only if it is not already a member of the list.
protected  void addUniquePaths(java.util.List list, Url[] urls)
          Adds several paths to a list, skipping paths that are already members of the list.
protected  void buildFullPaths(java.util.List priorPathSets, java.util.List classPathList, java.util.List sourcePathList, java.util.List docPathList)
          Adds missing elements from the local path set to the full path list, then invokes buildFullPaths(List, List, List) on each required path set in turn.
 Url[] getClassPath()
          Returns the PathSet's current set of class path entries.
 Url[] getDocPath()
          Returns the PathSet's current set of documentation path entries.
 Url[] getFullClassPath()
          Retreives the combined class path of this path set and all required path sets.
 Url[] getFullDocPath()
          Retreives the combined doc path of this path set and all required path sets.
 Url[] getFullSourcePath()
          Retreives the combined source path of this path set and all required path sets.
 long getLastModified()
          Reports the time that the last change was made directly to this PathSet.
 java.lang.String getName()
          Returns the current name for a PathSet.
 PathSet[] getRequired()
           
 Url[] getSourcePath()
          Returns the PathSet's current set of source path entries.
 void setClassPath(Url[] classPath)
          Changes the PathSet's current set of class path entries.
 void setDocPath(Url[] docPath)
          Changes the PathSet's current set of documentation path entries.
 void setName(java.lang.String name)
          Changes this PathSet's name.
 void setRequired(PathSet[] required)
          Loops in the "required" hierarchy are bad news.
 void setSourcePath(Url[] sourcePath)
          Changes the PathSet's current set of source path entries.
protected  void updateLastModified()
          Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final PathSet[] EMPTY_ARRAY
Constructor Detail

PathSet

public PathSet(java.lang.String name)
Creates a new library PathSet.
Parameters:
name - The initial name for the PathSet. This value may not be null.
Method Detail

getName

public java.lang.String getName()
Returns the current name for a PathSet.
Returns:
The pathset's current name.

setName

public void setName(java.lang.String name)
Changes this PathSet's name.
Parameters:
name - A new name for the PathSet. This value may not be null.

updateLastModified

protected void updateLastModified()

Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache.

Any method that modifies the state of the PathSet should invoke this method as a side-effect.


getLastModified

public long getLastModified()
Reports the time that the last change was made directly to this PathSet. Note that the "full paths" of a PathSet may be changed indirectly by changes to other path sets. To find out when the full path may have been impacted use the static method PathSetManager.getLastModified().
Returns:
A millisecond timestamp.

getClassPath

public Url[] getClassPath()
Returns the PathSet's current set of class path entries.
Returns:
An array of class path entries.

getSourcePath

public Url[] getSourcePath()
Returns the PathSet's current set of source path entries.
Returns:
An array of source path entries.

getDocPath

public Url[] getDocPath()
Returns the PathSet's current set of documentation path entries.
Returns:
An array of documentation path entries.

setClassPath

public void setClassPath(Url[] classPath)
Changes the PathSet's current set of class path entries.
Parameters:
classPath - An array of class path entries.

setSourcePath

public void setSourcePath(Url[] sourcePath)
Changes the PathSet's current set of source path entries.
Parameters:
sourcePath - An array of source path entries.

setDocPath

public void setDocPath(Url[] docPath)
Changes the PathSet's current set of documentation path entries.
Parameters:
docPath - An array of documentation path entries.

getRequired

public PathSet[] getRequired()

setRequired

public void setRequired(PathSet[] required)
Loops in the "required" hierarchy are bad news.

buildFullPaths

protected void buildFullPaths(java.util.List priorPathSets,
                              java.util.List classPathList,
                              java.util.List sourcePathList,
                              java.util.List docPathList)
Adds missing elements from the local path set to the full path list, then invokes buildFullPaths(List, List, List) on each required path set in turn.

addUniquePath

protected void addUniquePath(java.util.List list,
                             Url url)
Adds a path to a list of paths if and only if it is not already a member of the list.

addUniquePaths

protected void addUniquePaths(java.util.List list,
                              Url[] urls)
Adds several paths to a list, skipping paths that are already members of the list.

getFullClassPath

public Url[] getFullClassPath()
Retreives the combined class path of this path set and all required path sets.

getFullSourcePath

public Url[] getFullSourcePath()
Retreives the combined source path of this path set and all required path sets.

getFullDocPath

public Url[] getFullDocPath()
Retreives the combined doc path of this path set and all required path sets.