Arch4J 1.1

org.arch4j.domain
Class IntegerDomain

java.lang.Object
  |
  +--org.arch4j.domain.Domain
        |
        +--org.arch4j.domain.IntegerDomain
All Implemented Interfaces:
Serializable

public abstract class IntegerDomain
extends Domain

Represents an Integer value. Implementing classes will override the getMaxValue and potentially the getMinValue methods. Bounds checking is automatically enforced.

Version:
1.0
Author:
David Colwell
See Also:
Serialized Form

Constructor Summary
IntegerDomain()
          Default constructor.
IntegerDomain(Object aValue)
          Constructor which sets the domain's value to the specified argument.
 
Method Summary
protected  int getMaxValue()
          Defines the maximum string length used in validation.
protected  int getMinValue()
          Defines the minimun integer value used in validation.
protected  String getValueClass()
          The base class Domain will verify that any specified values are of this type or a subclass of this type.
protected  void validate(Object aValue)
          Validates that aValue fits within the bounds defined by getMinValue and getMaxValue.
 
Methods inherited from class org.arch4j.domain.Domain
getValue, setValue, toString, validateType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntegerDomain

public IntegerDomain()
Default constructor. Ultimately, the base class, Domain, will set the domain's value to null.


IntegerDomain

public IntegerDomain(Object aValue)
              throws DomainValidationException
Constructor which sets the domain's value to the specified argument.

Method Detail

getMinValue

protected int getMinValue()
Defines the minimun integer value used in validation. Unless overridden, it will return 0.

Returns:
the minimum integer value.

getMaxValue

protected int getMaxValue()
Defines the maximum string length used in validation. Unless overridden, it will return Integer.MAX_VALUE.

Returns:
the maximum string length.

validate

protected void validate(Object aValue)
                 throws DomainValidationException
Validates that aValue fits within the bounds defined by getMinValue and getMaxValue.

Specified by:
validate in class Domain
Throws:
DomainValidationException - if the bounds check validation fail.

getValueClass

protected String getValueClass()
The base class Domain will verify that any specified values are of this type or a subclass of this type.

Specified by:
getValueClass in class Domain
Returns:
the String representation of the Class type used by this domain value container.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.