org.mmbase.datatypes
Class LongDataType

java.lang.Object
  extended by org.mmbase.core.AbstractDescriptor
      extended by org.mmbase.datatypes.BasicDataType<E>
          extended by org.mmbase.datatypes.ComparableDataType<E>
              extended by org.mmbase.datatypes.NumberDataType<Long>
                  extended by org.mmbase.datatypes.LongDataType
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DataType<Long>>, Descriptor, DataType<Long>, SequentialDataType<Long>, PublicCloneable<AbstractDescriptor>
Direct Known Subclasses:
Duration.DataType

public class LongDataType
extends NumberDataType<Long>
implements SequentialDataType<Long>

DataType associated with Long, as NumberDataType, but provides getMin and getMax as long.

Since:
MMBase-1.8
Version:
$Id: LongDataType.java 41983 2010-04-20 15:27:34Z michiel $
Author:
Pierre van Rooden, Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.ComparableDataType
ComparableDataType.MaxRestriction, ComparableDataType.MinRestriction
 
Nested classes/interfaces inherited from class org.mmbase.datatypes.BasicDataType
BasicDataType.AbstractRestriction<D extends Serializable>, BasicDataType.DataTypeComparator<D>, BasicDataType.EnumerationRestriction, BasicDataType.RequiredRestriction, BasicDataType.RestrictedEnumerationIterator, BasicDataType.StaticAbstractRestriction<D extends Serializable>, BasicDataType.TypeRestriction, BasicDataType.UniqueRestriction
 
Nested classes/interfaces inherited from interface org.mmbase.datatypes.DataType
DataType.Restriction<D extends Serializable>
 
Field Summary
 
Fields inherited from class org.mmbase.datatypes.NumberDataType
allowSpecialNumbers
 
Fields inherited from class org.mmbase.datatypes.ComparableDataType
maxRestriction, minRestriction
 
Fields inherited from class org.mmbase.datatypes.BasicDataType
DATATYPE_BUNDLE, defaultValue, enumerationRestriction, origin, requiredRestriction, typeRestriction, uniqueRestriction
 
Fields inherited from class org.mmbase.core.AbstractDescriptor
description, guiName, key
 
Fields inherited from interface org.mmbase.datatypes.DataType
ENFORCE_ABSOLUTE, ENFORCE_ALWAYS, ENFORCE_NEVER, ENFORCE_ONCHANGE, ENFORCE_ONCREATE, ENFORCE_ONVALIDATE, PROCESS_GET, PROCESS_SET, VALID, XMLNS
 
Constructor Summary
LongDataType(String name, boolean primitive)
           
 
Method Summary
 Long decrease(Long pos)
          Given a certain value, returns the value with is 1 smaller.
 Long first()
          Returns a natural 'first' value.
 long getMax()
           
 long getMin()
           
 Long increase(Long pos)
          Given a certain value, returns the value with is 1 bigger.
 
Methods inherited from class org.mmbase.datatypes.NumberDataType
cast, castString, castToValidate, setAllowSpecialNumbers, toNumber
 
Methods inherited from class org.mmbase.datatypes.ComparableDataType
clone, cloneRestrictions, compare, 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 class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.datatypes.DataType
cast, castAndValidate, castForSearch, castOrException, checkType, clone, clone, finish, getBaseType, getBaseTypeIdentifier, getCommitProcessor, getDefaultValue, getDefaultValue, getDeleteProcessor, getEnforceStrength, getEnumerationFactory, getEnumerationRestriction, getEnumerationValue, getEnumerationValues, getHandler, getHandlers, getOrigin, getProcessor, getProcessor, getRequiredRestriction, getStyleClasses, getTypeAsClass, getUniqueRestriction, isFinished, isRequired, isUnique, preCast, rewrite, setCommitProcessor, setDefaultValue, setProcessor, setProcessor, setRequired, setUnique, toXml, toXml, validate, validate
 
Methods inherited from interface org.mmbase.bridge.Descriptor
getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

LongDataType

public LongDataType(String name,
                    boolean primitive)
Parameters:
primitive - indicate if a primitive type should be used
Method Detail

getMin

public long getMin()
Returns:
the minimum value as an long, or Long.MIN_VALUE if there is no minimum.

getMax

public long getMax()
Returns:
the maximum value as an long, or Long.MAX_VALUE if there is no maximum.

increase

public Long increase(Long pos)
Description copied from interface: SequentialDataType
Given a certain value, returns the value with is 1 bigger. It can return null if there is no such value (and the given value is the biggest one possible)

Specified by:
increase in interface SequentialDataType<Long>

decrease

public Long decrease(Long pos)
Description copied from interface: SequentialDataType
Given a certain value, returns the value with is 1 smaller. It can return null if there is no such value (and the given value is the smallest one possible)

Specified by:
decrease in interface SequentialDataType<Long>

first

public Long first()
Description copied from class: ComparableDataType
Returns a natural 'first' value. This may return some kind of 0

Specified by:
first in interface SequentialDataType<Long>
Specified by:
first in class ComparableDataType<Long>


MMBase 2.0-SNAPSHOT - null