Package mgui.interfaces.math
Interface VariableObject
- All Known Implementing Classes:
BoolPolygon2DInt
,Box3DInt
,Circle2DInt
,CorticalHemisphereSet3DInt
,CorticalSurfaceSet3DInt
,Ellipse2DInt
,Graph2DInt
,Graph3DInt
,Image2DInt
,Image3DInt
,InterfaceShape
,IntPolygon2DInt
,Line2DInt
,LPolygon2DInt
,LPolygon3DInt
,Mesh2DInt
,Mesh3DInt
,MorphSections3DInt
,Plane3DInt
,Point2DInt
,PointSet2DInt
,PointSet3DInt
,Polygon2DInt
,Polygon3DInt
,PolygonSet3DInt
,RadialRep2DInt
,Rect2DInt
,Rect3DInt
,SectionSet2DInt
,SectionSet3DInt
,Shape2DInt
,Shape2DSelectionSet
,Shape3DInt
,ShapeSet2DInt
,ShapeSet3DInt
,TensorVolume3DInt
,TestTextureInt
,Text2DInt
,Text2DIntMouseCoords
,Vector2DInt
,Vector3DInt
,VectorSet3DInt
,Volume2DInt
,Volume3DInt
,Volume4DInt
,VolumeSet3DInt
,X3DScene3DInt
public interface VariableObject
Interface allowing an object to represent a set of variables of a particular class type.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Method Summary
Modifier and Type Method Description int[]
getDimensions()
Returns the dimensions of this object as an array of integersjava.lang.String
getName()
java.util.ArrayList<java.lang.String>
getVariables()
Returns a list of variables for this object, which can be inserted into a mathematical expression.java.lang.Class<?>
getVariableType()
Specifies the class type of the object returned bygetVariableValues()
.double
getVariableValue(java.lang.String variable, int[] element)
Returns the value of a variable in this object, at the specified element location.java.lang.Object
getVariableValues(java.lang.String variable)
Returns an object containing the set of values forvariable
.boolean
setVariableValues(java.lang.String variable, java.lang.Object values)
Sets the variable's values with thevalues
object, which must be a type acceptable to the variable object.boolean
supportsVariableType(java.lang.Class<?> type)
Specifies whether this variable object supports the given class type when setting variables.
-
Method Details
-
getVariables
java.util.ArrayList<java.lang.String> getVariables()Returns a list of variables for this object, which can be inserted into a mathematical expression.- Returns:
- The list of variables contained in this object
-
getDimensions
int[] getDimensions()Returns the dimensions of this object as an array of integers- Returns:
- the dimensions of this object
-
getVariableValue
double getVariableValue(java.lang.String variable, int[] element)Returns the value of a variable in this object, at the specified element location. Ifelement
is not of the correct length for the variable object (i.e., as determined by the length ofgetDimensions()
), a value ofDouble.NaN
is returned.- Parameters:
variable
- Name of the variableelement
- The element at which to retrieve a value- Returns:
- The value at
element
, as adouble
-
getVariableValues
java.lang.Object getVariableValues(java.lang.String variable)Returns an object containing the set of values forvariable
. The returned class type is specified bygetVariableType()
.- Parameters:
variable
-- Returns:
- The values corresponding to
variable
-
getName
java.lang.String getName() -
setVariableValues
boolean setVariableValues(java.lang.String variable, java.lang.Object values)Sets the variable's values with thevalues
object, which must be a type acceptable to the variable object. If not, a value offalse
is returned.- Parameters:
variable
- The variable to updatevalues
- AnObject
containing the new data
-
getVariableType
java.lang.Class<?> getVariableType()Specifies the class type of the object returned bygetVariableValues()
.- Returns:
- The class type
-
supportsVariableType
boolean supportsVariableType(java.lang.Class<?> type)Specifies whether this variable object supports the given class type when setting variables. TODO: solve erasure issue which prevents type-checking of genericArrayList
s. See {@link http://bugs.sun.com/view_bug.do?bug_id=5098163}- Parameters:
type
-- Returns:
true
, if this class type is supported
-