org.mmbase.datatypes
Class NumberDataType<E extends Number & Comparable<E>>
java.lang.Object
org.mmbase.core.AbstractDescriptor
org.mmbase.datatypes.BasicDataType<E>
org.mmbase.datatypes.ComparableDataType<E>
org.mmbase.datatypes.NumberDataType<E>
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<DataType<E>>, Descriptor, DataType<E>, PublicCloneable<AbstractDescriptor>
- Direct Known Subclasses:
- DecimalDataType, DoubleDataType, FloatDataType, IntegerDataType, LongDataType
public abstract class NumberDataType<E extends Number & Comparable<E>>
- extends ComparableDataType<E>
A DataType representing some kind of numeric value, like a floating point number or an integer number.
- Since:
- MMBase-1.8
- Version:
- $Id: NumberDataType.java 40244 2009-12-14 15:28:46Z michiel $
- Author:
- Pierre van Rooden
- See Also:
- Serialized Form
| Methods inherited from class org.mmbase.datatypes.ComparableDataType |
clone, cloneRestrictions, compare, first, getComparator, getDefaultValue, getEnforceStrength, getMaxRestriction, getMinRestriction, inheritRestrictions, isMaxInclusive, isMinInclusive, setMax, setMin, toStringBuilder, toXml, validateCastValue |
| Methods inherited from class org.mmbase.datatypes.BasicDataType |
addErrorDescription, addRestriction, addRestriction, addStyleClass, cast, castAndValidate, castForSearch, castOrException, castToPresent, checkType, clone, compareTo, edit, equals, finish, finish, getBaseType, getBaseTypeIdentifier, getCloud, getCloud, getCommitProcessor, getDefaultProcessor, getDefaultValue, getDeleteProcessor, getElement, getElement, getEnforceString, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getProcessorWithoutDefault, getRequiredRestriction, getRestrictions, getStyleClasses, getTypeAsClass, getUniqueRestriction, hashCode, inherit, inheritProperties, isCorrectType, isFinished, isRequired, isUnique, preCast, preCast, preCast, rewrite, setCommitProcessor, setDefaultProcessor, setDefaultValue, setDeleteProcessor, setProcessor, setProcessor, setRequired, setUnique, setXml, toString, toXml, validate, validate, validateCastValueOrNull, validateRequired, xmlValue |
| Methods inherited from class org.mmbase.core.AbstractDescriptor |
getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName |
| Methods inherited from interface org.mmbase.bridge.Descriptor |
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName |
allowSpecialNumbers
boolean allowSpecialNumbers
NumberDataType
public NumberDataType(String name,
Class<E> classType)
- Constructor for Number field.
setAllowSpecialNumbers
public void setAllowSpecialNumbers(boolean sn)
- Since:
- MMBase-1.9.2
toNumber
protected Number toNumber(String s)
throws CastException
- Throws:
CastException- Since:
- MMBase-1.9.2
castString
protected Number castString(Object preCast,
Cloud cloud)
throws CastException
- Throws:
CastException
castToValidate
protected Object castToValidate(Object value,
Node node,
Field field)
throws CastException
- Description copied from class:
BasicDataType
- Before validating the value, the value will be 'cast', on default this will be to the
'correct' type, but it can be a more generic type sometimes. E.g. for numbers this wil simply
cast to Number.
- Overrides:
castToValidate in class BasicDataType<E extends Number & Comparable<E>>
- Throws:
CastException- Since:
- MMBase-1.9
cast
protected E cast(Object value,
Cloud cloud,
Node node,
Field field)
throws CastException
- Description copied from class:
BasicDataType
- Utility to avoid repetitive calling of getCloud
- Overrides:
cast in class BasicDataType<E extends Number & Comparable<E>>
- Throws:
CastException
MMBase 2.0-SNAPSHOT - null