pl.edu.agh.cast.data.model.property
Class Property<T extends MetaProperty>

java.lang.Object
  extended by pl.edu.agh.cast.data.model.property.Property<T>
Type Parameters:
T - type of {@link MetaProperty) describing the property
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CustomProperty, PermanentProperty, TransientProperty

public abstract class Property<T extends MetaProperty>
extends Object
implements Serializable

Abstract property of IElement and IDataSet.

Author:
AGH CAST Team
See Also:
Serialized Form

Constructor Summary
protected Property(T metaProperty)
          Initializes property with MetaProperty which describes it.
 
Method Summary
 boolean equals(Object other)
          
 T getMetaProperty()
          Returns MetaProperty describing this property.
abstract  Object getValue()
          Returns property value.
 int hashCode()
          
protected  boolean isValidValue(Object value)
          Checks if a value can be assigned to this property.
abstract  void setValue(Object value)
          Sets property value.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

protected Property(T metaProperty)
Initializes property with MetaProperty which describes it.

Parameters:
metaProperty - meta-property describing this property
Method Detail

getValue

public abstract Object getValue()
Returns property value.

Returns:
the value of the property

setValue

public abstract void setValue(Object value)
Sets property value.

Parameters:
value - value to set
Throws:
PropertyException - if this property cannot be modified (check MetaProperty.isWritable()) or if the value type is invalid for this property

getMetaProperty

public T getMetaProperty()
Returns MetaProperty describing this property.

Returns:
meta-property describing this property

isValidValue

protected boolean isValidValue(Object value)
Checks if a value can be assigned to this property.

Parameters:
value - the value object to check
Returns:
true if the value can be assigned to this property

equals

public boolean equals(Object other)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.