程序包 weka.core

类 ClassDiscovery

java.lang.Object
weka.core.ClassDiscovery
所有已实现的接口:
RevisionHandler

public class ClassDiscovery extends Object implements RevisionHandler
This class is used for discovering classes that implement a certain interface or a derived from a certain class.
版本:
$Revision: 5377 $
作者:
FracPete (fracpete at waikato dot ac dot nz)
另请参阅:
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static class 
    compares two strings.
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    static final boolean
    whether to output some debug information.
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static void
    clears the cache for class/classnames relation.
    static Vector
    find(Class cls, String pkgname)
    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.
    static Vector
    find(Class cls, String[] pkgnames)
    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.
    static Vector
    find(String classname, String pkgname)
    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.
    static Vector
    find(String classname, String[] pkgnames)
    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.
    static Vector
    Lists all packages it can find in the classpath.
    Returns the revision string.
    static boolean
    hasInterface(Class intf, Class cls)
    Checks whether the given class implements the given interface.
    static boolean
    Checks whether the given class implements the given interface.
    static boolean
    isSubclass(Class superclass, Class otherclass)
    Checks whether the "otherclass" is a subclass of the given "superclass".
    static boolean
    isSubclass(String superclass, String otherclass)
    Checks whether the "otherclass" is a subclass of the given "superclass".
    static void
    main(String[] args)
    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.

    从类继承的方法 java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • VERBOSE

      public static final boolean VERBOSE
      whether to output some debug information.
      另请参阅:
  • 构造器详细资料

    • ClassDiscovery

      public ClassDiscovery()
  • 方法详细资料

    • isSubclass

      public static boolean isSubclass(String superclass, String otherclass)
      Checks whether the "otherclass" is a subclass of the given "superclass".
      参数:
      superclass - the superclass to check against
      otherclass - this class is checked whether it is a subclass of the the superclass
      返回:
      TRUE if "otherclass" is a true subclass
    • isSubclass

      public static boolean isSubclass(Class superclass, Class otherclass)
      Checks whether the "otherclass" is a subclass of the given "superclass".
      参数:
      superclass - the superclass to check against
      otherclass - this class is checked whether it is a subclass of the the superclass
      返回:
      TRUE if "otherclass" is a true subclass
    • hasInterface

      public static boolean hasInterface(String intf, String cls)
      Checks whether the given class implements the given interface.
      参数:
      intf - the interface to look for in the given class
      cls - the class to check for the interface
      返回:
      TRUE if the class contains the interface
    • hasInterface

      public static boolean hasInterface(Class intf, Class cls)
      Checks whether the given class implements the given interface.
      参数:
      intf - the interface to look for in the given class
      cls - the class to check for the interface
      返回:
      TRUE if the class contains the interface
    • find

      public static Vector find(String classname, String[] pkgnames)
      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.
      参数:
      classname - the class/interface to look for
      pkgnames - the packages to search in
      返回:
      a list with all the found classnames
    • find

      public static Vector find(String classname, String pkgname)
      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.
      参数:
      classname - the class/interface to look for
      pkgname - the package to search in
      返回:
      a list with all the found classnames
    • find

      public static Vector find(Class cls, String[] pkgnames)
      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.
      参数:
      cls - the class/interface to look for
      pkgnames - the packages to search in
      返回:
      a list with all the found classnames
    • find

      public static Vector find(Class cls, String pkgname)
      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.
      参数:
      cls - the class/interface to look for
      pkgname - the package to search in
      返回:
      a list with all the found classnames
    • findPackages

      public static Vector findPackages()
      Lists all packages it can find in the classpath.
      返回:
      a list with all the found packages
    • clearCache

      public static void clearCache()
      clears the cache for class/classnames relation.
    • getRevision

      public String getRevision()
      Returns the revision string.
      指定者:
      getRevision 在接口中 RevisionHandler
      返回:
      the revision
    • main

      public static void main(String[] args)
      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.
      参数:
      args - the commandline arguments