Joda System API

org.joda.property.impl.type
Class AbstractDoubleProperty

java.lang.Object
  |
  +--org.joda.property.impl.AbstractModelElement
        |
        +--org.joda.property.impl.AbstractProperty
              |
              +--org.joda.property.impl.type.AbstractNumericProperty
                    |
                    +--org.joda.property.impl.type.AbstractDoubleProperty
All Implemented Interfaces:
java.lang.Comparable, DataProperty, InitializableProperty, ModelElement, NumericProperty, Property, Property.Internal, java.io.Serializable
Direct Known Subclasses:
DefaultDoublePrimitiveProperty, DefaultDoubleProperty

public abstract class AbstractDoubleProperty
extends AbstractNumericProperty

Abstract implementation of a Double property.

Data is stored in the associated PropertyData object as a Double object. This is immutable so can be directly returned.

Author:
Stephen Colebourne
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Field Summary
 
Fields inherited from interface org.joda.property.type.NumericProperty
DEFAULT_TYPE
 
Constructor Summary
AbstractDoubleProperty()
          Constructor
 
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(java.lang.Object object)
           
protected  java.lang.Double convertObjectToDouble(java.lang.Object object)
          Convert an Object to a typecast Double, throwing an exception if unable to convert.
 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
 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 set(java.lang.Object propertyValue)
          Set the property's value as an object.
 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.
 
Methods inherited from class org.joda.property.impl.type.AbstractNumericProperty
compareTo, compareTo, doubleValue, equals, equals, floatValue, getInternal, intValue, isGreaterThan, isGreaterThan, isGreaterThan, isLessThan, isLessThan, isLessThan, longValue, setInternal, toFloat, toInteger, toLong, toNumber, toObject
 
Methods inherited from class org.joda.property.impl.AbstractProperty
addPropertyChangeListener, bean, checkArgumentNotNull, checkModifiable, checkValueNotNull, checkValueNotNull, cloneDeep, convertObject, createClonedProperty, data, equals, equalsValue, firePropertyChange, firePropertyChange, getContentName, getContentType, getPropertyName, getThis, hashCode, initBeanCreated, initPropertyCreated, isModifiable, isNull, isReadOnly, populateClonedProperty, removePropertyChangeListener, setModifiable, setReadOnly, toDataString, toString
 
Methods inherited from class org.joda.property.impl.AbstractModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
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, setModifiable, setReadOnly, toString
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 

Constructor Detail

AbstractDoubleProperty

public AbstractDoubleProperty()
Constructor

Method Detail

toDouble

public java.lang.Double toDouble()
Description copied from interface: NumericProperty
Get the property's value as a Double.

Specified by:
toDouble in interface NumericProperty
Overrides:
toDouble in class AbstractNumericProperty
See Also:
NumericProperty#toDouble()

toBigDecimal

public java.math.BigDecimal toBigDecimal()
Description copied from interface: NumericProperty
Get the property's value as a BigDecimal.

Returns:
the property value as a BigDecimal
See Also:
NumericProperty#toBigDecimal()

compareTo

public int compareTo(java.lang.Object object)
See Also:
Comparable.compareTo(Object)

convertObjectToDouble

protected java.lang.Double convertObjectToDouble(java.lang.Object object)
Convert an Object to a typecast Double, throwing an exception if unable to convert.

Parameters:
object -
Returns:
Double derived from the object

set

public void set(java.lang.Object propertyValue)
Description copied from interface: Property
Set the property's value as an object. The object type should be appropriate for the type of property. If necessary, the object will be cloned before it is stored internally. Implementations will recognise as many types of object passed in as possible. Null should always be accepted, primitive types will be reset back to zero/false.

If a String is passed in, it can be parsed in various ways. If the results of toDataString() are passed in, it must reconstitute the original value.

Specified by:
set in interface Property
Specified by:
set in class AbstractProperty
Parameters:
propertyValue - an Object to set the property's value to
See Also:
Property#set(Object)

set

public void set(long propertyValue)
Description copied from interface: NumericProperty
Set the property's value.

Parameters:
propertyValue - a value to set the property's value to
See Also:
NumericProperty#set(long)

set

public void set(double propertyValue)
Description copied from interface: NumericProperty
Set the property's value.

Parameters:
propertyValue - a value to set the property's value to
See Also:
NumericProperty#set(double)

add

public void add(long amount)
Description copied from interface: NumericProperty
Add to the property's value

Parameters:
amount - an amount to add to the property's value
See Also:
NumericProperty#add(long)

add

public void add(double amount)
Description copied from interface: NumericProperty
Add to the property's value

Parameters:
amount - an amount to add to the property's value
See Also:
NumericProperty#add(double)

add

public void add(java.lang.Object amount)
Description copied from interface: NumericProperty
Add to the property's value

Parameters:
amount - an amount to add to the property's value
See Also:
NumericProperty#add(Object)

subtract

public void subtract(long amount)
Description copied from interface: NumericProperty
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value
See Also:
NumericProperty#subtract(long)

subtract

public void subtract(double amount)
Description copied from interface: NumericProperty
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value
See Also:
NumericProperty#subtract(double)

subtract

public void subtract(java.lang.Object amount)
Description copied from interface: NumericProperty
Subtract from the property's value

Parameters:
amount - an amount to subtract from the property's value
See Also:
NumericProperty#subtract(Object)

multiplyBy

public void multiplyBy(long amount)
Description copied from interface: NumericProperty
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by
See Also:
NumericProperty#multiplyBy(long)

multiplyBy

public void multiplyBy(double amount)
Description copied from interface: NumericProperty
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by
See Also:
NumericProperty#multiplyBy(double)

multiplyBy

public void multiplyBy(java.lang.Object amount)
Description copied from interface: NumericProperty
Multiply the property's value by the specified argument

Parameters:
amount - an amount to multiply the property's value by
See Also:
NumericProperty#multiplyBy(Object)

divideBy

public void divideBy(long amount)
Description copied from interface: NumericProperty
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by
See Also:
NumericProperty#divideBy(long)

divideBy

public void divideBy(double amount)
Description copied from interface: NumericProperty
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by
See Also:
NumericProperty#divideBy(double)

divideBy

public void divideBy(java.lang.Object amount)
Description copied from interface: NumericProperty
Divide the property's value by the specified argument

Parameters:
amount - an amount to divide the property's value by
See Also:
NumericProperty#divideBy(Object)

negate

public void negate()
Description copied from interface: NumericProperty
Negate the current value of the property.

See Also:
NumericProperty#negate()

Joda System API

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