Package weka.core
Class ClassDiscovery
java.lang.Object
weka.core.ClassDiscovery
- All Implemented Interfaces:
RevisionHandler
This class is used for discovering classes that implement a certain interface
or a derived from a certain class.
- Version:
- $Revision: 14293 $
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
whether to output some debug information. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clears the cache for class/classnames queries.static void
Calls clearCache() and resets the cache of classes on the classpath (i.e.Checks the given package for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.Checks the given packages for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.Find all classes that have the supplied matchText String in their suffix.Checks the given package for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.Checks the given packages for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.Lists all packages it can find in the classpath.Returns the revision string.static void
Possible calls: weka.core.ClassDiscovery <packages>
Prints all the packages in the current classpath weka.core.ClassDiscovery <classname> <packagename(s)>
Prints the classes it found.
-
Field Details
-
VERBOSE
public static final boolean VERBOSEwhether to output some debug information.- See Also:
-
-
Constructor Details
-
ClassDiscovery
public ClassDiscovery()
-
-
Method Details
-
find
Checks the given packages for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.- Parameters:
classname
- the class/interface to look forpkgnames
- the packages to search in- Returns:
- a list with all the found classnames
-
find
Checks the given package for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.- Parameters:
classname
- the class/interface to look forpkgname
- the package to search in- Returns:
- a list with all the found classnames
-
find
Checks the given packages for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.- Parameters:
cls
- the class/interface to look forpkgnames
- the packages to search in- Returns:
- a list with all the found classnames
-
find
Find all classes that have the supplied matchText String in their suffix.- Parameters:
matchText
- the text to match- Returns:
- an array list of matching fully qualified class names.
-
find
Checks the given package for classes that inherited from the given class, in case it's a class, or implement this class, in case it's an interface.- Parameters:
cls
- the class/interface to look forpkgname
- the package to search in- Returns:
- a list with all the found classnames
-
findPackages
Lists all packages it can find in the classpath.- Returns:
- a list with all the found packages
-
clearCache
public static void clearCache()clears the cache for class/classnames queries. -
clearClassCache
public static void clearClassCache()Calls clearCache() and resets the cache of classes on the classpath (i.e. forces a rescan of the classpath). -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-
main
Possible calls:-
weka.core.ClassDiscovery <packages>
Prints all the packages in the current classpath -
weka.core.ClassDiscovery <classname> <packagename(s)>
Prints the classes it found.
- Parameters:
args
- the commandline arguments
-
weka.core.ClassDiscovery <packages>
-