ca.nengo.config.handlers
Class MatrixHandler
java.lang.Object
ca.nengo.config.handlers.BaseHandler
ca.nengo.config.handlers.MatrixHandlerBase
ca.nengo.config.handlers.MatrixHandler
- All Implemented Interfaces:
- ConfigurationHandler
public class MatrixHandler
- extends MatrixHandlerBase
ConfigurationHandler for float[][] values.
- Author:
- Bryan Tripp
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MatrixHandler
public MatrixHandler()
CreateMatrixEditor
public MatrixEditor CreateMatrixEditor(java.lang.Object o,
ConfigurationChangeListener configListener)
- Specified by:
CreateMatrixEditor
in class MatrixHandlerBase
getRenderer
public java.awt.Component getRenderer(java.lang.Object o)
- Specified by:
getRenderer
in interface ConfigurationHandler
- Overrides:
getRenderer
in class BaseHandler
- Parameters:
o
- An object for which canHandle(o.getClass()) == true
- Returns:
- null
- See Also:
ConfigurationHandler.getRenderer(java.lang.Object)
fromString
public java.lang.Object fromString(java.lang.String s)
- Specified by:
fromString
in interface ConfigurationHandler
- Overrides:
fromString
in class BaseHandler
- Parameters:
s
- A String representation of an object, eg from toString(o) or user
input
- Returns:
- myClass.getConstructor(new Class[]{String.class}).newInstance(new Object[]{s})
- See Also:
ConfigurationHandler.fromString(java.lang.String)
toString
public java.lang.String toString(java.lang.Object o)
- Specified by:
toString
in interface ConfigurationHandler
- Overrides:
toString
in class BaseHandler
- Parameters:
o
- An object for which canHandle(o.getClass()) == true
- Returns:
- o.toString()
- See Also:
ConfigurationHandler.toString(java.lang.Object)
fromString
public static float[][] fromString(java.lang.String s,
char colDelim,
java.lang.String rowDelim)
- Parameters:
s
- A String representation of a matrix, eg from
toString(float[][], char, String)colDelim
- The character used to delimit matrix columns in this stringrowDelim
- The string (can be >1 chars) used to delimit matrix rows in
this string
- Returns:
- The matrix represented by the string
toString
public static java.lang.String toString(float[][] matrix,
char colDelim,
java.lang.String rowDelim)
- Parameters:
matrix
- A matrixcolDelim
- A character to be used to delimit matrix columnsrowDelim
- A String to be used to delimit matrix rows
- Returns:
- A String representation of the given matrix using the given
delimiters
getDefaultValue
public java.lang.Object getDefaultValue(java.lang.Class<?> c)
- Parameters:
c
- A class for which canHandle(c) == true
- Returns:
- A default value of the given class
- See Also:
ConfigurationHandler.getDefaultValue(java.lang.Class)