com.highdeal.udr.hci
Class RangeConstraint

java.lang.Object
  extended by com.highdeal.udr.hci.ConstraintObject
      extended by com.highdeal.udr.hci.RangeConstraint

public class RangeConstraint
extends ConstraintObject

The RangeConstraint implements the constraint defined by a range min and a range max. Integer, long, big decimal, big integer and date entities can be constrained by a range constraint.

The standard way to create a RangeConstraint instance is to use the method ConstraintObject.createConstraintFromString(String) with a string representation of a range constraint.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.highdeal.udr.hci.ConstraintObject
ConstraintObject.MetaChar
 
Field Summary
static int TYPE_EXCLUSIVE
          the exclusive type for range constraint.
static int TYPE_INCLUSIVE
          the inclusive type for range constraint.
 
Fields inherited from class com.highdeal.udr.hci.ConstraintObject
compatibilityTable, NO_SUBTYPE, separator, separatorChar, STRING_TYPE_BIG_INTEGER, STRING_TYPE_BOOLEAN, STRING_TYPE_DATE, STRING_TYPE_DECIMAL, STRING_TYPE_ENUMERATED_LIST, STRING_TYPE_FORMAT, STRING_TYPE_INTEGER, STRING_TYPE_LONG, STRING_TYPE_RANGE, STRING_TYPE_STRING, TYPE_BIG_INTEGER, TYPE_BOOLEAN, TYPE_DATE, TYPE_DECIMAL, TYPE_ENUMERATED_LIST, TYPE_FORMAT, TYPE_INTEGER, TYPE_LONG, TYPE_RANGE, TYPE_STRING
 
Constructor Summary
RangeConstraint()
          Builds a range constraint.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int getConstraintType()
          Returns the constraint type of this constraint.
 java.lang.String getInitializationString()
          Returns the initialization string.
 java.lang.Object getRangeMax()
          Returns the range max of range constraint.
 int getRangeMaxType()
          Returns the range max type of range constraint.
 java.lang.Object getRangeMin()
          Returns the range min of range constraint.
 int getRangeMinType()
          Returns the range min type of range constraint.
 int hashCode()
           
 boolean isBigIntegerConstraint()
          Returns big integer status of the range constraint.
 boolean isBooleanConstraint()
          Returns boolean status of the range constraint.
 boolean isDateConstraint()
          Returns date status of the range constraint.
 boolean isDecimalConstraint()
          Returns decimal status of the range constraint.
 boolean isDurationConstraint()
          Returns duration status of the range constraint.
 boolean isIntegerConstraint()
          Returns integer status of the range constraint.
 boolean isLongConstraint()
          Returns long status of the range constraint.
 boolean isStringConstraint()
          Returns string status of the range constraint.
 boolean isValidValue(java.lang.Object value)
          Tests if the value checks the range constraint.
 void setInitializationString(java.lang.String initializationString)
          Sets the initialization string.
 void setRangeMax(java.lang.Object rangeMax)
          Sets the range max of range constraint.
 void setRangeMaxType(int rangeMaxType)
          Sets the range max type of range constraint.
 void setRangeMin(java.lang.Object rangeMin)
          Sets the range min of range constraint.
 void setRangeMinType(int rangeMinType)
          Sets the range min type of range constraint.
 java.lang.String toString()
          Returns string representationthat represents the range constraint.
 
Methods inherited from class com.highdeal.udr.hci.ConstraintObject
createConstraintFromString, escapeMetaChar, getAllowedConstraintTypes, getConstraintSubType, parseConstraintSubType, unescapeMetaChar, unescapeSeparatorChar
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_INCLUSIVE

public static final int TYPE_INCLUSIVE
the inclusive type for range constraint.

See Also:
Constant Field Values

TYPE_EXCLUSIVE

public static final int TYPE_EXCLUSIVE
the exclusive type for range constraint.

See Also:
Constant Field Values
Constructor Detail

RangeConstraint

public RangeConstraint()
Builds a range constraint.

Method Detail

getInitializationString

public java.lang.String getInitializationString()
Returns the initialization string.

Specified by:
getInitializationString in class ConstraintObject
Returns:
the initialization string.

setInitializationString

public void setInitializationString(java.lang.String initializationString)
Sets the initialization string.

Parameters:
initializationString - the initialization string.

getConstraintType

public int getConstraintType()
Returns the constraint type of this constraint.

Specified by:
getConstraintType in class ConstraintObject
Returns:
the constraint type.
See Also:
ConstraintObject.TYPE_RANGE

getRangeMin

public java.lang.Object getRangeMin()
Returns the range min of range constraint.

Returns:
the range min.

setRangeMin

public void setRangeMin(java.lang.Object rangeMin)
Sets the range min of range constraint.

Parameters:
rangeMin - the range Min.

getRangeMinType

public int getRangeMinType()
Returns the range min type of range constraint.

See Also:
TYPE_INCLUSIVE, TYPE_EXCLUSIVE

setRangeMinType

public void setRangeMinType(int rangeMinType)
Sets the range min type of range constraint.

A range min specifies a range type . The allowed types are :

Parameters:
rangeMinType - the range min type.

getRangeMax

public java.lang.Object getRangeMax()
Returns the range max of range constraint.

Returns:
the range max.

setRangeMax

public void setRangeMax(java.lang.Object rangeMax)
Sets the range max of range constraint.

Parameters:
rangeMax - the range Max.

getRangeMaxType

public int getRangeMaxType()
Returns the range max type of range constraint.

See Also:
TYPE_INCLUSIVE, TYPE_EXCLUSIVE

setRangeMaxType

public void setRangeMaxType(int rangeMaxType)
Sets the range max type of range constraint.

A range max specifies a range type . The allowed types are :

Parameters:
rangeMaxType - the range max type.

isValidValue

public boolean isValidValue(java.lang.Object value)
Tests if the value checks the range constraint.

Specified by:
isValidValue in class ConstraintObject
Returns:
true if the value checks the range constraint. false otherwise.

toString

public java.lang.String toString()
Returns string representationthat represents the range constraint.

Specified by:
toString in class ConstraintObject
Returns:
the string representation.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isIntegerConstraint

public boolean isIntegerConstraint()
Returns integer status of the range constraint.

Specified by:
isIntegerConstraint in class ConstraintObject
Returns:
true if the range limits are integers or null, false otherwise.

isLongConstraint

public boolean isLongConstraint()
Returns long status of the range constraint.

Specified by:
isLongConstraint in class ConstraintObject
Returns:
true if the range limits are longs or null, false otherwise.

isBigIntegerConstraint

public boolean isBigIntegerConstraint()
Returns big integer status of the range constraint.

Specified by:
isBigIntegerConstraint in class ConstraintObject
Returns:
true if the range limits are big integers or null, false otherwise.

isDecimalConstraint

public boolean isDecimalConstraint()
Returns decimal status of the range constraint.

Specified by:
isDecimalConstraint in class ConstraintObject
Returns:
true if the range limits are big decimals or null, false otherwise.

isDateConstraint

public boolean isDateConstraint()
Returns date status of the range constraint.

Specified by:
isDateConstraint in class ConstraintObject
Returns:
true if the range limits are dates or null, false otherwise.

isStringConstraint

public boolean isStringConstraint()
Returns string status of the range constraint.

Specified by:
isStringConstraint in class ConstraintObject
Returns:
false in any case.

isDurationConstraint

public boolean isDurationConstraint()
Returns duration status of the range constraint.

Returns:
true if the range limits are durations or null, false otherwise.

isBooleanConstraint

public boolean isBooleanConstraint()
Returns boolean status of the range constraint.

Specified by:
isBooleanConstraint in class ConstraintObject
Returns:
false in any case.

Document Published: October 2015 (SAP CC 4.0 SP10 and Later)