Package repast.simphony.scenario.data
Class Classpath
- java.lang.Object
-
- repast.simphony.scenario.data.Classpath
-
public class Classpath extends Object
Encapsulates a classpath.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description Classpath()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addEntry(String entry)
Adds the specified entry to the classpath.boolean
addEntry(ClassPathEntry entry)
Adds the specified entry to the classpath.Iterable<File>
classPaths()
Gets an iterable over all the possible paths on which classes may be found.Iterable<ClassPathEntry>
entries()
Gets an iterable over all the classpath entries.List<Class<?>>
getClasses()
Gets the classes in the currently added entries.
-
-
-
Method Detail
-
addEntry
public boolean addEntry(String entry)
Adds the specified entry to the classpath. If the entry is a directory and it contains any .class files or its children of the directory contain any .class path the directory itself will be added. If the directory contains any jar files those will be added as well.If the entry ends with .jar that jar file will be added.
- Parameters:
entry
- the entry to add- Returns:
- true if classes or jars were found and the entry was added, otherwise false.
-
addEntry
public boolean addEntry(ClassPathEntry entry)
Adds the specified entry to the classpath. If the entry is a directory and it contains any .class files or its children of the directory contain any .class path the directory itself will be added. If the directory contains any jar files those will be added as well.If the entry ends with .jar that jar file will be added.
- Parameters:
entry
- the entry to add- Returns:
- true if classes or jars were found and the entry was added, otherwise false.
-
getClasses
public List<Class<?>> getClasses() throws IOException, ClassNotFoundException
Gets the classes in the currently added entries.- Returns:
- the classes in the currently added entries.
- Throws:
ClassNotFoundException
IOException
-
entries
public Iterable<ClassPathEntry> entries()
Gets an iterable over all the classpath entries.- Returns:
- an iterable over all the classpath entries.
-
classPaths
public Iterable<File> classPaths()
Gets an iterable over all the possible paths on which classes may be found. These include top level directories and jar files.- Returns:
- an iterable over all the possible paths on which classes may be found. These include top level directories and jar files.
-
-