nenok
Class Utilities

java.lang.Object
  extended by nenok.Utilities

public class Utilities
extends Object

Utility class that provides a collection of static methods which extend the java reflection framework.

Version:
1.2
Author:
Marc Pouly

Constructor Summary
Utilities()
           
 
Method Summary
static List<Method> getGraphicalRepresentators(Valuation val)
          This static method returns a list of all graphical representation functions defined in the argument's class.
static List<Method> getStringRepresentators(Valuation val)
          This static method returns a list of all string representation functions defined in the argument's class.
static boolean isInterfaceOf(Class _interface, Class _class)
          Helper method to determine if a given class implements a given interface.
static boolean isSuperclassOf(Class _super, Class _class)
          Helper method to determine if a given class is superclass of another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

isInterfaceOf

public static boolean isInterfaceOf(Class _interface,
                                    Class _class)
Helper method to determine if a given class implements a given interface.

Parameters:
_interface - Is this interface implemented by the given class.
_class - Does this class implement the given interface.
Returns:
true, if the given class implements the given interface.

isSuperclassOf

public static boolean isSuperclassOf(Class _super,
                                     Class _class)
Helper method to determine if a given class is superclass of another. Convention: Every class is superclass of itself.

Parameters:
_super - Is this class ascendent of the second argument.
_class - Is this class descendent of the former argument.
Returns:
true, if the first argument is a superclass of the second.

getStringRepresentators

public static List<Method> getStringRepresentators(Valuation val)
This static method returns a list of all string representation functions defined in the argument's class. A string representation method's name starts with "display", returns a string and has an empty no parameter list.

Parameters:
val - The valuation class instance to be searched.
Returns:
All string representation methods contained in the argument's class.

getGraphicalRepresentators

public static List<Method> getGraphicalRepresentators(Valuation val)
This static method returns a list of all graphical representation functions defined in the argument's class. A graphical representation method's name starts with "display", returns a SWT composite and has the parent composite as only parameter.

Parameters:
val - The valuation class instance to be searched.
Returns:
All graphical representation methods contained in the argument's class.