Package weka.core

Class InheritanceUtils


  • public class InheritanceUtils
    extends java.lang.Object
    Helper class for inheritance related operations.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasInterface​(java.lang.Class<?> intf, java.lang.Class<?> cls)
      Checks whether the given class implements the given interface.
      static boolean hasInterface​(java.lang.String intf, java.lang.String cls)
      Checks whether the given class implements the given interface.
      static boolean isSubclass​(java.lang.Class<?> superclass, java.lang.Class<?> otherclass)
      Checks whether the "otherclass" is a subclass of the given "superclass".
      static boolean isSubclass​(java.lang.String superclass, java.lang.String otherclass)
      Checks whether the "otherclass" is a subclass of the given "superclass".
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InheritanceUtils

        public InheritanceUtils()
    • Method Detail

      • isSubclass

        public static boolean isSubclass​(java.lang.String superclass,
                                         java.lang.String otherclass)
        Checks whether the "otherclass" is a subclass of the given "superclass".
        Parameters:
        superclass - the superclass to check against
        otherclass - this class is checked whether it is a subclass of the the superclass
        Returns:
        TRUE if "otherclass" is a true subclass
      • isSubclass

        public static boolean isSubclass​(java.lang.Class<?> superclass,
                                         java.lang.Class<?> otherclass)
        Checks whether the "otherclass" is a subclass of the given "superclass".
        Parameters:
        superclass - the superclass to check against
        otherclass - this class is checked whether it is a subclass of the the superclass
        Returns:
        TRUE if "otherclass" is a true subclass
      • hasInterface

        public static boolean hasInterface​(java.lang.String intf,
                                           java.lang.String cls)
        Checks whether the given class implements the given interface.
        Parameters:
        intf - the interface to look for in the given class
        cls - the class to check for the interface
        Returns:
        TRUE if the class contains the interface
      • hasInterface

        public static boolean hasInterface​(java.lang.Class<?> intf,
                                           java.lang.Class<?> cls)
        Checks whether the given class implements the given interface.
        Parameters:
        intf - the interface to look for in the given class
        cls - the class to check for the interface
        Returns:
        TRUE if the class contains the interface