org.eigenbase.util.property
Class IntegerProperty

java.lang.Object
  extended by org.eigenbase.util.property.Property
      extended by org.eigenbase.util.property.IntegerProperty

public class IntegerProperty
extends Property

Definition and accessor for an integer property.

Since:
May 4, 2004
Version:
$Id: //open/dt/dev/farrago/src/org/eigenbase/util/property/IntegerProperty.java#7 $
Author:
jhyde

Field Summary
 
Fields inherited from class org.eigenbase.util.property.Property
properties
 
Constructor Summary
IntegerProperty(java.util.Properties properties, java.lang.String path)
          Creates an Integer property which has no default value.
IntegerProperty(java.util.Properties properties, java.lang.String path, int defaultValue)
          Creates an Integer property.
 
Method Summary
 int get()
          Retrieves the value of this integer property.
 int get(int defaultValue)
          Retrieves the value of this integer property.
 void set(int value)
          Sets the value of this integer property.
 
Methods inherited from class org.eigenbase.util.property.Property
addTrigger, booleanValue, getDefaultValue, getInternal, getPath, getString, isSet, onChange, removeTrigger, setString, stringValue, toBoolean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerProperty

public IntegerProperty(java.util.Properties properties,
                       java.lang.String path,
                       int defaultValue)
Creates an Integer property.

Parameters:
properties - Properties object which holds values for this property.
path - Name by which this property is serialized to a properties file, for example "com.acme.trace.Verbosity".
defaultValue - Default value.

IntegerProperty

public IntegerProperty(java.util.Properties properties,
                       java.lang.String path)
Creates an Integer property which has no default value.

Parameters:
properties - Properties object which holds values for this property.
path - Name by which this property is serialized to a properties file, for example "com.acme.trace.Verbosity".
Method Detail

get

public int get()
Retrieves the value of this integer property. If the property has no value, returns the default value. If there is no default value, returns 0.


get

public int get(int defaultValue)
Retrieves the value of this integer property. If the property has no value, returns the default value. If there is no default value, returns the given default value.


set

public void set(int value)
Sets the value of this integer property.