pl.edu.agh.cast.data.model.property
Class MetaProperty

java.lang.Object
  extended by pl.edu.agh.cast.data.model.property.MetaProperty
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MetaPermanentProperty, MetaTransientProperty

public class MetaProperty
extends Object
implements Serializable

Meta property is a class for describing IElements' and IDataSets' Property'ies.

Meta property introduces name by which property is identifiable in MetaPropertyManager and type - one of that defined by PropertyType. writable flag indicates if property can be modified after it's creation and at last matchable flag says if the property is taken into account during comparison of objects using IPropertyContainer#match(IPropertyContainer) method. More details about this method you find in it's javadoc.

The name of the property has to follow the following rules:

Author:
AGH CAST Team
See Also:
Serialized Form

Constructor Summary
MetaProperty(String name, PropertyType type, boolean writable, boolean matchable)
          Creates new meta property.
MetaProperty(String name, String displayName, PropertyType type, boolean writable, boolean matchable)
          Creates new meta property.
 
Method Summary
 boolean equals(Object obj)
          Returns true if given object is of type MetaProperty and has equal name, type, writable and matchable flags.
 String getDisplayName()
          Returns the property display name (ex.
 String getName()
          Returns the property name (always in UPPER CASE).
 PropertyType getType()
          Returns the property type.
 int hashCode()
          
 boolean isMatchable()
          Checks if property is matchable.
 boolean isWritable()
          Checks if the property is writable (may be modified).
 void setDisplayName(String displayName)
          Sets the property display name.
 void setWritable(boolean writable)
          Sets the writable flag.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaProperty

public MetaProperty(String name,
                    PropertyType type,
                    boolean writable,
                    boolean matchable)
Creates new meta property.

Parameters:
name - the name of the property
type - the type of property value
writable - whether the value may be set/changed
matchable - the matchable flag

MetaProperty

public MetaProperty(String name,
                    String displayName,
                    PropertyType type,
                    boolean writable,
                    boolean matchable)
Creates new meta property.

Parameters:
name - the name of the property
displayName - the display name of the property
type - the type of property value
writable - whether the value may be set/changed
matchable - the matchable flag
Method Detail

isWritable

public final boolean isWritable()
Checks if the property is writable (may be modified).

Returns:
the writable flag

setWritable

public void setWritable(boolean writable)
Sets the writable flag.

Parameters:
writable - the writable flag to set

getName

public final String getName()
Returns the property name (always in UPPER CASE).

Returns:
the property name

getDisplayName

public final String getDisplayName()
Returns the property display name (ex. localized).

Returns:
the property display name

setDisplayName

public final void setDisplayName(String displayName)
Sets the property display name.

Parameters:
displayName - the property display name

getType

public final PropertyType getType()
Returns the property type.

Returns:
the property type

isMatchable

public boolean isMatchable()
Checks if property is matchable.

Returns:
the matchable flag

equals

public boolean equals(Object obj)
Returns true if given object is of type MetaProperty and has equal name, type, writable and matchable flags.

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.