plugins.adufour.vars.lang
Class VarFloatArrayNative

java.lang.Object
  extended by plugins.adufour.vars.lang.Var<A>
      extended by plugins.adufour.vars.lang.VarGenericArray<float[]>
          extended by plugins.adufour.vars.lang.VarFloatArrayNative
All Implemented Interfaces:
icy.file.xml.XMLPersistent, ArrayType, VarListener<float[]>

public class VarFloatArrayNative
extends VarGenericArray<float[]>

Class defining a variable with a native array of type float[]. This class should be preferred to VarFloatArray for optimized performances on large arrays

Author:
Alexandre Dufour

Field Summary
 
Fields inherited from class plugins.adufour.vars.lang.Var
listeners, NO_VALUE, type, XML_KEY_ID
 
Constructor Summary
VarFloatArrayNative(java.lang.String name, float[] defaultValue)
           
 
Method Summary
 VarEditor<float[]> createVarEditor()
          Creates a new VarEditor object that allows the user to graphically adjust the value of this variable.
 float[] getValue(boolean forbidNull)
           
 java.lang.Object parseComponent(java.lang.String s)
          Parse a string representing an element of the underlying array.
 
Methods inherited from class plugins.adufour.vars.lang.VarGenericArray
getDimensions, getInnerType, getSeparator, getValue, isAssignableFrom, parse, size, size
 
Methods inherited from class plugins.adufour.vars.lang.Var
addListener, createVarViewer, fireVariableChanged, fireVariableChanged, getDefaultEditorModel, getDefaultValue, getIterableReferrers, getName, getReference, getReferencingPolicy, getReferrers, getType, getTypeAsString, getValueAsString, getValueAsString, isEnabled, isOptional, isReferenced, loadFromXML, prettyPrint, referenceChanged, removeListener, removeListeners, saveToXML, setDefaultEditorModel, setEnabled, setOptional, setReference, setReferencingPolicy, setValue, toString, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VarFloatArrayNative

public VarFloatArrayNative(java.lang.String name,
                           float[] defaultValue)
Method Detail

createVarEditor

public VarEditor<float[]> createVarEditor()
Description copied from class: Var
Creates a new VarEditor object that allows the user to graphically adjust the value of this variable. By default this editor is an empty label for generic types, but this method can be overridden to provide a custom editor.

Overrides:
createVarEditor in class Var<float[]>
Returns:
the variable editor embarking the graphical component

parseComponent

public java.lang.Object parseComponent(java.lang.String s)
Description copied from class: VarGenericArray
Parse a string representing an element of the underlying array. Note that this method throws an UnsupportedOperationException by default, therefore the implementation must be provided by overriding classes

Specified by:
parseComponent in interface ArrayType
Overrides:
parseComponent in class VarGenericArray<float[]>
Parameters:
s - the string to parse
Returns:
a primitive type representing the given string

getValue

public float[] getValue(boolean forbidNull)
Overrides:
getValue in class Var<float[]>
Parameters:
forbidNull - true to throw an exception if the underlying value is null
Returns:
the value stored in this variable, or the value in the referenced variable if the reference is not null. Note that this method will throw a VarException if the forbidNull argument is true
See Also:
Var.getReference()