JanosVM v1.0 API

edu.utah.janosvm.resources
Class ClassPathSpec

java.lang.Object
  |
  +--edu.utah.janosvm.resources.ResourceSpec
        |
        +--edu.utah.janosvm.resources.ClassPathSpec
All Implemented Interfaces:
java.lang.Cloneable

public final class ClassPathSpec
extends ResourceSpec
implements java.lang.Cloneable

Specification for the class path resource. Used to specify the classpath for a new team. The given classpath is used to load new classes in the team, but is not used for shared classes (those specified via the NameSpaceSpec).

A ClassPathSpec is comprised of Strings, one for each element. Only globally valid class path elements (see ClassPathResource) can be used (otherwise an ResourceException will be thrown by the team constructor). A null or empty ClassPathSpec is valid (it implies the new team cannot load any classes and can only use imported classes).

If not specified, the default class path for a new Team is the full class path of the JVM.

Author:
Tim Stack, Utah Janos Team
See Also:
ClassPathResource, Team.create()

Fields inherited from class edu.utah.janosvm.resources.ResourceSpec
found
 
Constructor Summary
ClassPathSpec(java.lang.String[] entries)
          Construct a class path specification with the given paths.
 
Method Summary
 java.lang.Object clone()
           
static ClassPathSpec current()
          Get the ClassPathSpec associated with the current team.
 boolean equals(java.lang.Object obj)
          Compare the given object with this ClassPathSpec for equality.
protected  void finalize()
           
 java.lang.String getPath(int index)
          Get a specific component of this classpath.
 int getPathCount()
          Get the number of components in this classpath.
 java.lang.String[] getPaths()
          Return a new String array of the components of the classpath.
private  void nativeConstructor(java.lang.String[] entries)
          Constructs the native part of the class.
private  void nativeFinalizer()
          Finalizes the native part of the class.
 java.lang.String toString()
           
 
Methods inherited from class edu.utah.janosvm.resources.ResourceSpec
find, nativeFind
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Constructor Detail

ClassPathSpec

public ClassPathSpec(java.lang.String[] entries)
Construct a class path specification with the given paths. Entries must be valid ones defined via ClassPathResource.
Parameters:
entries - An array of strings specifying each part of the classpath or null if the ClassPath is empty. Any null elements are ignored.
Method Detail

nativeConstructor

private void nativeConstructor(java.lang.String[] entries)
Constructs the native part of the class.

nativeFinalizer

private void nativeFinalizer()
Finalizes the native part of the class.

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

getPathCount

public int getPathCount()
Get the number of components in this classpath.
Returns:
The number of paths in the spec.

getPath

public java.lang.String getPath(int index)
Get a specific component of this classpath.
Parameters:
index - The index of the class path to get.
Returns:
The class path at the given index.

getPaths

public java.lang.String[] getPaths()
Return a new String array of the components of the classpath.
Returns:
An array of Strings, one for each component of the classpath.

equals

public boolean equals(java.lang.Object obj)
Compare the given object with this ClassPathSpec for equality. Returns true if the given object is a ClassPathSpec that contains the same number of equivalent components, in the same order as this.
Overrides:
equals in class java.lang.Object

toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

current

public static ClassPathSpec current()
Get the ClassPathSpec associated with the current team.
Returns:
The ClassPathSpec associated with the current team.

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003