Package pulse.properties
Class NumericProperties
- java.lang.Object
-
- pulse.properties.NumericProperties
-
public class NumericProperties extends Object
Default operations with NumericProperties
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompare(NumericProperty a, NumericProperty b)Compares the numeric values of thisNumericPropertyandarg0static NumericPropertydef(NumericPropertyKeyword keyword)Searches for the defaultNumericPropertycorresponding tokeywordin the list of pre-defined properties loaded from the respective.xmlfile.static List<NumericProperty>defaultList()static NumericPropertyderive(NumericPropertyKeyword keyword, Number value)Searches for the defaultNumericPropertycorresponding tokeywordin the list of pre-defined properties loaded from the respective.xmlfile, and if found creates a new {static booleanisDiscrete(NumericPropertyKeyword key)static booleanisValueSensible(NumericProperty property, Number val)Checks whether thevalthat is going to be passed to theproperty(a) has the same type as theproperty.getValue()object; (b) is confined within the definition domain:minimum <= value <= maximum.static StringprintRangeAndNumber(NumericProperty p, Number value)
-
-
-
Method Detail
-
isValueSensible
public static boolean isValueSensible(NumericProperty property, Number val)
Checks whether thevalthat is going to be passed to theproperty(a) has the same type as theproperty.getValue()object; (b) is confined within the definition domain:minimum <= value <= maximum.- Parameters:
property- thepropertycontaining the definition domainval- a numeric value, the conformity of which to the definition domain needs to be checked- Returns:
trueifminimum <= val <= maximumand if bothvalandvalueare instances of the sameclass;falseotherwise
-
printRangeAndNumber
public static String printRangeAndNumber(NumericProperty p, Number value)
-
defaultList
public static List<NumericProperty> defaultList()
-
def
public static NumericProperty def(NumericPropertyKeyword keyword)
Searches for the defaultNumericPropertycorresponding tokeywordin the list of pre-defined properties loaded from the respective.xmlfile.- Parameters:
keyword- one of the constantNumericPropertyKeywords- Returns:
- a
NumericPropertyin the default list of properties - See Also:
NumericPropertyKeyword
-
compare
public static int compare(NumericProperty a, NumericProperty b)
Compares the numeric values of thisNumericPropertyandarg0- Parameters:
a- aNumericPropertyb- anotherNumericProperty- Returns:
trueif the values are equals
-
derive
public static NumericProperty derive(NumericPropertyKeyword keyword, Number value)
Searches for the defaultNumericPropertycorresponding tokeywordin the list of pre-defined properties loaded from the respective.xmlfile, and if found creates a new {- Parameters:
keyword- one of the constantNumericPropertyKeywordsvalue- the new value for the createdNumericProperty- Returns:
- a new
NumericPropertythat is built according to the default pattern specified by thekeyword, but with a differentvalue - See Also:
NumericPropertyKeyword
-
isDiscrete
public static boolean isDiscrete(NumericPropertyKeyword key)
-
-