net.nexttext.property
Class NumberProperty

java.lang.Object
  extended by net.nexttext.property.Property
      extended by net.nexttext.property.NumberProperty
All Implemented Interfaces:
java.lang.Cloneable

public class NumberProperty
extends Property

A number property of a TextObject or Behaviour.

This class handles both integer and floating point type numbers. It seemed easier to do this in one class, rather than having a class for each Java primitive numerical type. Internally, the values are stored as doubles, and cast as appropriate.


Constructor Summary
NumberProperty(float value)
           
NumberProperty(long value)
           
 
Method Summary
 void add(float value)
           
 void add(long value)
           
 float get()
           
 long getLong()
           
 float getOriginal()
           
 long getOriginalLong()
           
 void reset()
          Reset this property to its original value.
 void set(float value)
           
 void set(long value)
           
 java.lang.String toString()
           
 
Methods inherited from class net.nexttext.property.Property
addChangeListener, clone, getName, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberProperty

public NumberProperty(float value)

NumberProperty

public NumberProperty(long value)
Method Detail

getOriginal

public float getOriginal()

get

public float get()

set

public void set(float value)

add

public void add(float value)

reset

public void reset()
Description copied from class: Property
Reset this property to its original value.

Specified by:
reset in class Property

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getOriginalLong

public long getOriginalLong()

getLong

public long getLong()

set

public void set(long value)

add

public void add(long value)