Package weka.core
Class InheritanceUtils
- java.lang.Object
-
- weka.core.InheritanceUtils
-
public class InheritanceUtils extends Object
Helper class for inheritance related operations.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description InheritanceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasInterface(Class<?> intf, Class<?> cls)Checks whether the given class implements the given interface.static booleanhasInterface(String intf, String cls)Checks whether the given class implements the given interface.static booleanisSubclass(Class<?> superclass, Class<?> otherclass)Checks whether the "otherclass" is a subclass of the given "superclass".static booleanisSubclass(String superclass, String otherclass)Checks whether the "otherclass" is a subclass of the given "superclass".
-
-
-
Method Detail
-
isSubclass
public static boolean isSubclass(String superclass, String otherclass)
Checks whether the "otherclass" is a subclass of the given "superclass".- Parameters:
superclass- the superclass to check againstotherclass- 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(Class<?> superclass, Class<?> otherclass)
Checks whether the "otherclass" is a subclass of the given "superclass".- Parameters:
superclass- the superclass to check againstotherclass- 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(String intf, String cls)
Checks whether the given class implements the given interface.- Parameters:
intf- the interface to look for in the given classcls- the class to check for the interface- Returns:
- TRUE if the class contains the interface
-
-