Package net.infonode.properties.types
Class NumberProperty
java.lang.Object
net.infonode.properties.util.AbstractProperty
net.infonode.properties.util.ValueHandlerProperty
net.infonode.properties.types.NumberProperty
- All Implemented Interfaces:
Property
- Direct Known Subclasses:
IntegerProperty
Base class for number properties.
-
Constructor Summary
ConstructorsConstructorDescriptionNumberProperty
(PropertyGroup group, String name, Class cl, String description, long minValue, long maxValue, int preferredDigitCount, PropertyValueHandler valueHandler) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canBeAssiged
(Object value) Returns true if the value can be assigned to this property.long
getLongValue
(Object valueContainer) Returns the long value of this property in a value container.long
Returns the largest value that this property can have.long
Returns the smallest value that this property can have.int
Returns the preferred number of digits to allocate space for in an editor for a property valueMethods 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
-
Constructor Details
-
NumberProperty
public NumberProperty(PropertyGroup group, String name, Class cl, String description, long minValue, long maxValue, int preferredDigitCount, PropertyValueHandler valueHandler) Constructor.- Parameters:
group
- the property groupname
- the property namecl
- the property typedescription
- the property descriptionminValue
- the smallest value that this property can havemaxValue
- the largest value that this property can havepreferredDigitCount
- the preferred number of digits to allocate space for in an editor for a property valuevalueHandler
- handles values for this property
-
-
Method Details
-
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
-
getMinValue
public long getMinValue()Returns the smallest value that this property can have.- Returns:
- the smallest value that this property can have
-
getMaxValue
public long getMaxValue()Returns the largest value that this property can have.- Returns:
- the largest value that this property can have
-
getLongValue
Returns the long value of this property in a value container.- Parameters:
valueContainer
- the value container- Returns:
- the long value of this property
-
canBeAssiged
Description copied from interface:Property
Returns true if the value can be assigned to this property.- Specified by:
canBeAssiged
in interfaceProperty
- Overrides:
canBeAssiged
in classAbstractProperty
- Parameters:
value
- the value to assign- Returns:
- true if the value can be assigned to this property
-