org.simbrain.network
Class NetworkUtils

java.lang.Object
  extended by org.simbrain.network.NetworkUtils

public class NetworkUtils
extends Object

Utils provides static utility methods for the Network class.


Constructor Summary
NetworkUtils()
           
 
Method Summary
static JPanel createRow(String text, String toolTip, JComponent theComponent)
          Helper method for creating formatted rows in dialog boxes, which consist of a label, a component, and some tool-tip for the label.
static boolean isConsistent(List toCheck, Class theClass, String methodName)
          Checks to see if all the objects in a list return the same value for a method which the user provides by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkUtils

public NetworkUtils()
Method Detail

isConsistent

public static boolean isConsistent(List toCheck,
                                   Class theClass,
                                   String methodName)
Checks to see if all the objects in a list return the same value for a method which the user provides by name. The method can have no arguments (typically a getter method).

Parameters:
toCheck - the list of objects to check for consistency
methodName - the method to be invoked (uses reflection)
Returns:
true if the list of objects returns the same value for methodName, false otherwise

createRow

public static JPanel createRow(String text,
                               String toolTip,
                               JComponent theComponent)
Helper method for creating formatted rows in dialog boxes, which consist of a label, a component, and some tool-tip for the label.

Parameters:
text - the text to be displayed to the left of the commponent as a JLabel
toolTip - a tooltip / help to be displayed for the label
theComponent - the component to be displayed to the right of the label
Returns:
a JPanel containing the formatted label and component