|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.progeeks.meta.ClassPropertyType
org.progeeks.meta.type.RangedNumberType
public class RangedNumberType
ClassPropertyType subclass that represents a number with a minimum and maximum range. Normally, this is not the way one would do things. The "meta-jb way" would be to give your properties type subclasses that are specific to your application. They're mostly just tagging place-holders anyway. However, it seemed like a large swath of types could be taken care of with bound numbers without _requiring_ the app to subclass. The app is still encouraged to do so (by subclassing this type), but at least now we can build in nice default behavior for ranged numbers.
Constructor Summary | |
---|---|
RangedNumberType(java.lang.Class baseType,
java.lang.Number minimum,
java.lang.Number maximum)
Creates a bound number type for the specified number class and range. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.Number |
getMaximumValue()
Returns the maximum for the number range. |
java.lang.Number |
getMinimumValue()
Returns the minimum for the number range. |
int |
hashCode()
|
boolean |
isInstance(java.lang.Object obj)
Returns true if the specified object is an instance of this type and fits within the specified range inclusively. |
Methods inherited from class org.progeeks.meta.ClassPropertyType |
---|
convertPrimitive, createRawSuperTypeIterator, getBaseClass, getSuperTypes, isAssignableFrom, toString, wrapRawSuperType |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RangedNumberType(java.lang.Class baseType, java.lang.Number minimum, java.lang.Number maximum)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class ClassPropertyType
public int hashCode()
hashCode
in class ClassPropertyType
public boolean isInstance(java.lang.Object obj)
isInstance
in interface PropertyType
isInstance
in class ClassPropertyType
public java.lang.Number getMinimumValue()
public java.lang.Number getMaximumValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |