Joda System API

org.joda.property.type
Interface NumericProperty

All Superinterfaces:
java.lang.Comparable, DataProperty, ModelElement, Property, java.io.Serializable
All Known Subinterfaces:
DecimalProperty, DoublePrimitiveProperty, DoubleProperty, IntegerPrimitiveProperty, IntegerProperty, LongPrimitiveProperty, LongProperty
All Known Implementing Classes:
AbstractNumericProperty, DefaultDecimalProperty, DefaultDoublePrimitiveProperty, DefaultDoubleProperty, DefaultIntegerPrimitiveProperty, DefaultIntegerProperty, DefaultLongPrimitiveProperty, DefaultLongProperty

public interface NumericProperty
extends DataProperty, java.lang.Comparable

Interface for Numeric properties.

Author:
Stephen Colebourne

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Field Summary
static java.lang.Class DEFAULT_TYPE
           
 
Method Summary
 void add(double amount)
          Add to the property's value
 void add(long amount)
          Add to the property's value
 void add(java.lang.Object amount)
          Add to the property's value
 int compareTo(double anotherValue)
          Compare the property's value to the passed in value.
 int compareTo(long anotherValue)
          Compare the property's value to the passed in value.
 void divideBy(double amount)
          Divide the property's value by the specified argument
 void divideBy(long amount)
          Divide the property's value by the specified argument
 void divideBy(java.lang.Object amount)
          Divide the property's value by the specified argument
 double doubleValue()
          Get the property's value as a double.
 boolean equals(double anotherValue)
          Is the property's value equal to the passed in value.
 boolean equals(long anotherValue)
          Is the property's value equal to the passed in value.
 float floatValue()
          Get the property's value as a float.
 int intValue()
          Get the property's value as an int.
 boolean isGreaterThan(double anotherValue)
          Is the property's value greater than the passed in value.
 boolean isGreaterThan(long anotherValue)
          Is the property's value greater than the passed in value.
 boolean isGreaterThan(java.lang.Object anotherValue)
          Is the property's value greater than the passed in value.
 boolean isLessThan(double anotherValue)
          Is the property's value less than the passed in value.
 boolean isLessThan(long anotherValue)
          Is the property's value less than the passed in value.
 boolean isLessThan(java.lang.Object anotherValue)
          Is the property's value less than the passed in value.
 long longValue()
          Get the property's value as a long.
 void multiplyBy(double amount)
          Multiply the property's value by the specified argument
 void multiplyBy(long amount)
          Multiply the property's value by the specified argument
 void multiplyBy(java.lang.Object amount)
          Multiply the property's value by the specified argument
 void negate()
          Negate the current value of the property.
 void set(double propertyValue)
          Set the property's value.
 void set(long propertyValue)
          Set the property's value.
 void subtract(double amount)
          Subtract from the property's value
 void subtract(long amount)
          Subtract from the property's value
 void subtract(java.lang.Object amount)
          Subtract from the property's value
 java.math.BigDecimal toBigDecimal()
          Get the property's value as a BigDecimal.
 java.lang.Double toDouble()
          Get the property's value as a Double.
 java.lang.Float toFloat()
          Get the property's value as a Float.
 java.lang.Integer toInteger()
          Get the property's value as an Integer.
 java.lang.Long toLong()
          Get the property's value as a Long.
 java.lang.Number toNumber()
          Get the property's value as a Number.
 
Methods inherited from interface org.joda.property.type.DataProperty
toDataString
 
Methods inherited from interface org.joda.property.Property
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, getPropertyType, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, set, setModifiable, setReadOnly, toObject, toString
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

DEFAULT_TYPE

public static final java.lang.Class DEFAULT_TYPE
Method Detail

toNumber

public java.lang.Number toNumber()
Get the property's value as a Number.

Returns:
the property value as a Number

toInteger

public java.lang.Integer toInteger()
Get the property's value as an Integer.

Returns:
the property value as an Integer

toLong

public java.lang.Long toLong()
Get the property's value as a Long.

Returns:
the property value as a Long

toFloat

public java.lang.Float toFloat()
Get the property's value as a Float.

Returns:
the property value as a Float

toDouble

public java.lang.Double toDouble()
Get the property's value as a Double.

Returns:
the property value as a Double

toBigDecimal

public java.math.BigDecimal toBigDecimal()
Get the property's value as a BigDecimal.

Returns:
the property value as a BigDecimal

intValue

public int intValue()
Get the property's value as an int.

Returns:
the property value as an int

longValue

public long longValue()
Get the property's value as a long.

Returns:
the property value as a long

floatValue

public float floatValue()
Get the property's value as a float.

Returns:
the property value as a float

doubleValue

public double doubleValue()
Get the property's value as a double.

Returns:
the property value as a double

equals

public boolean equals(long anotherValue)
Is the property's value equal to the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property value is equal

equals

public boolean equals(double anotherValue)
Is the property's value equal to the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property value is equal

compareTo

public int compareTo(long anotherValue)
Compare the property's value to the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
zero if equal, -ve if property is less, +ve if property is greater

compareTo

public int compareTo(double anotherValue)
Compare the property's value to the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
zero if equal, -ve if property is less, +ve if property is greater

isLessThan

public boolean isLessThan(long anotherValue)
Is the property's value less than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is less

isLessThan

public boolean isLessThan(double anotherValue)
Is the property's value less than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is less

isLessThan

public boolean isLessThan(java.lang.Object anotherValue)
Is the property's value less than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is less

isGreaterThan

public boolean isGreaterThan(long anotherValue)
Is the property's value greater than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is greater

isGreaterThan

public boolean isGreaterThan(double anotherValue)
Is the property's value greater than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is greater

isGreaterThan

public boolean isGreaterThan(java.lang.Object anotherValue)
Is the property's value greater than the passed in value.

Parameters:
anotherValue - a value to compare the property to
Returns:
true if property is greater

set

public void set(long propertyValue)
Set the property's value.

Parameters:
propertyValue - a value to set the property's value to

set

public void set(double propertyValue)
Set the property's value.

Parameters:
propertyValue - a value to set the property's value to

add

public void add(long amount)
Add to the property's value

Parameters:
amount - an amount to add to the property's value

add

public void add(double amount)
Add to the property's value

Parameters:
amount - an amount to add to the property's value

add

public void add(java.lang.Object amount)
Add to the property's value

Parameters:
amount - an amount to add to the property's value

subtract

public void subtract(long amount)
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value

subtract

public void subtract(double amount)
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value

subtract

public void subtract(java.lang.Object amount)
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value

multiplyBy

public void multiplyBy(long amount)
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by

multiplyBy

public void multiplyBy(double amount)
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by

multiplyBy

public void multiplyBy(java.lang.Object amount)
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by

divideBy

public void divideBy(long amount)
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by

divideBy

public void divideBy(double amount)
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by

divideBy

public void divideBy(java.lang.Object amount)
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by

negate

public void negate()
Negate the current value of the property.


Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.