|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eigenbase.util.property.Property org.eigenbase.util.property.IntegerProperty
public class IntegerProperty
Definition and accessor for an integer property.
Field Summary | |
---|---|
private int |
maxValue
|
private int |
minValue
|
Fields inherited from class org.eigenbase.util.property.Property |
---|
properties |
Constructor Summary | |
---|---|
IntegerProperty(Properties properties,
String path)
Creates an Integer property which has no default value. |
|
IntegerProperty(Properties properties,
String path,
int defaultValue)
Creates an Integer property. |
|
IntegerProperty(Properties properties,
String path,
int minValue,
int maxValue)
Creates an Integer property with fixed minimum and maximum values. |
|
IntegerProperty(Properties properties,
String path,
int defaultValue,
int minValue,
int maxValue)
Creates an Integer property with a default value and fixed minimum and maximum values. |
Method Summary | |
---|---|
int |
get()
Retrieves the value of this integer property according to these rules. |
int |
get(int defaultValue)
Retrieves the value of this integer property. |
private int |
limit(int value)
Returns value limited to the range [minValue, maxValue]. |
private int |
noValue()
Returns 0 if that value is in the range [minValue, maxValue]. |
int |
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 |
Field Detail |
---|
private final int minValue
private final int maxValue
Constructor Detail |
---|
public IntegerProperty(Properties properties, String path, int defaultValue)
Integer.MIN_VALUE
and Integer.MAX_VALUE
.
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.public IntegerProperty(Properties properties, String path)
Integer.MIN_VALUE
and Integer.MAX_VALUE
.
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".public IntegerProperty(Properties properties, String path, int defaultValue, int minValue, int maxValue)
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.minValue
- the minimum value of this property (inclusive)maxValue
- the maximum value of this property (inclusive)
IllegalArgumentException
- if defaultValue
is not in
the range [minValue
, maxValue
].public IntegerProperty(Properties properties, String path, int minValue, int maxValue)
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".minValue
- the minimum value of this property (inclusive)maxValue
- the maximum value of this property (inclusive)Method Detail |
---|
public int get()
minValue
<= 0 <=
maxValue
, returns 0.minValue
.
public int get(int defaultValue)
public int set(int value)
private int limit(int value)
value
- the value to limit
private int noValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |