public class Property<GaType> extends Observable
A property should be used in the following manner:
class Example
{
public final Property<int> property = new Property<int>(0, true);
}
Example example = new Example();
try
{
example.property.set(1);
}
catch (IllegalAccessException e)
{
System.out.println(e.getMessage());
}
| Constructor and Description |
|---|
Property(GaType value)
Default constructor which sets the property-value to the given value and
the editable-flag to true.
|
Property(GaType value,
boolean editable)
Default constructor which sets the property-value to the given value and
the editable-flag to given value.
|
| Modifier and Type | Method and Description |
|---|---|
GaType |
get()
Returns the value of the property.
|
boolean |
isEditable()
Returns true when the set-method of this property can be called and false
otherwise.
|
void |
set(GaType value)
Sets the given value as the new value for the property.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedpublic Property(GaType value)
value - The value for the property.public Property(GaType value, boolean editable)
value - The value for the property.editable - The editable-flag.public void set(GaType value) throws IllegalAccessException
value - The new value for the propertyIllegalAccessException - Thrown when the editable-flag has been set to false.public GaType get()
public boolean isEditable()
Copyright © 2015. All Rights Reserved.