net.infonode.properties.types
Class FloatProperty

java.lang.Object
  extended by net.infonode.properties.util.AbstractProperty
      extended by net.infonode.properties.util.ValueHandlerProperty
          extended by net.infonode.properties.types.FloatProperty
All Implemented Interfaces:
Property

public class FloatProperty
extends ValueHandlerProperty

A float property.

Version:
$Revision: 1.5 $
Author:
$Author: jesper $

Field Summary
private  float maxValue
           
private  float minValue
           
private  float preferredDelta
           
private  int preferredDigitCount
           
 
Constructor Summary
FloatProperty(PropertyGroup group, java.lang.String name, java.lang.String description, PropertyValueHandler valueHandler)
          Constructor.
FloatProperty(PropertyGroup group, java.lang.String name, java.lang.String description, PropertyValueHandler valueHandler, float minValue, float maxValue)
          Constructor.
FloatProperty(PropertyGroup group, java.lang.String name, java.lang.String description, PropertyValueHandler valueHandler, float minValue, float maxValue, int preferredDigitCount, float preferredDelta)
          Constructor.
 
Method Summary
 boolean canBeAssiged(java.lang.Object value)
          Returns true if the value can be assigned to this property.
 float get(java.lang.Object valueContainer)
          Returns the float value of this property in a value container.
 float getMaxValue()
          Returns the largest value that this property can have.
 float getMinValue()
          Returns the smallest value that this property can have.
 float getPreferredDelta()
          Returns the preferred amount to increase and decrease a property value by.
 int getPreferredDigitCount()
          Returns the preferred number of digits to allocate space for in an editor for a property value.
 void set(java.lang.Object valueContainer, float value)
          Sets the float value of this property in a value container.
 
Methods inherited from class net.infonode.properties.util.ValueHandlerProperty
getValue, removeValue, setValue, valueIsRemovable, valueIsSet
 
Methods inherited from class net.infonode.properties.util.AbstractProperty
getDescription, getGroup, getName, getType, isMutable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

minValue

private float minValue

maxValue

private float maxValue

preferredDigitCount

private int preferredDigitCount

preferredDelta

private float preferredDelta
Constructor Detail

FloatProperty

public FloatProperty(PropertyGroup group,
                     java.lang.String name,
                     java.lang.String description,
                     PropertyValueHandler valueHandler)
Constructor. Creates an unbounded float property.

Parameters:
group - the property group
name - the property name
description - the property description
valueHandler - handles values for this property

FloatProperty

public FloatProperty(PropertyGroup group,
                     java.lang.String name,
                     java.lang.String description,
                     PropertyValueHandler valueHandler,
                     float minValue,
                     float maxValue)
Constructor.

Parameters:
group - the property group
name - the property name
description - the property description
valueHandler - handles values for this property
minValue - the smallest value that this property can have
maxValue - the largest value that this property can have

FloatProperty

public FloatProperty(PropertyGroup group,
                     java.lang.String name,
                     java.lang.String description,
                     PropertyValueHandler valueHandler,
                     float minValue,
                     float maxValue,
                     int preferredDigitCount,
                     float preferredDelta)
Constructor.

Parameters:
group - the property group
name - the property name
description - the property description
valueHandler - handles values for this property
minValue - the smallest value that this property can have
maxValue - the largest value that this property can have
preferredDigitCount - the preferred number of digits to allocate space for in an editor for a property value
preferredDelta - the preferred amount to increase and decrease a property value by
Method Detail

getPreferredDelta

public float getPreferredDelta()
Returns the preferred amount to increase and decrease a property value by.

Returns:
the preferred amount to increase and decrease a property value by

getMinValue

public float getMinValue()
Returns the smallest value that this property can have.

Returns:
the smallest value that this property can have

getMaxValue

public float getMaxValue()
Returns the largest value that this property can have.

Returns:
the largest value that this property can have

getPreferredDigitCount

public int getPreferredDigitCount()
Returns the preferred number of digits to allocate space for in an editor for a property value.

Returns:
the preferred number of digits to allocate space for in an editor for a property value

get

public float get(java.lang.Object valueContainer)
Returns the float value of this property in a value container.

Parameters:
valueContainer - the value container
Returns:
the float value of this property

set

public void set(java.lang.Object valueContainer,
                float value)
Sets the float value of this property in a value container.

Parameters:
valueContainer - the value container
value - the float value

canBeAssiged

public boolean canBeAssiged(java.lang.Object value)
Description copied from interface: Property
Returns true if the value can be assigned to this property.

Specified by:
canBeAssiged in interface Property
Overrides:
canBeAssiged in class AbstractProperty
Parameters:
value - the value to assign
Returns:
true if the value can be assigned to this property