fdda.model.impl
Class Property

java.lang.Object
  |
  +--fdda.model.impl.Property
All Implemented Interfaces:
Cloneable, Property

public class Property
extends Object
implements Property

The implementation of the Property interface. Facets are held in a HashMap, Values are held in an ArrayList.

Author:
Jörg Rüdenauer

Field Summary
 
Fields inherited from interface fdda.model.Property
DEFAULT_VALUE, FIXED_WHILE_RUNNING, GRAPHIC_RELEVANT, LINE_COUNT_LINK, MAX_COUNT_VALUES, MAX_VALUE, MIN_COUNT_VALUES, MIN_VALUE, MULTI_VALUED
 
Constructor Summary
Property(String name, String type)
          Constructor.
Property(String name, String type, String displayedName, String description)
          Constructor with description.
 
Method Summary
 void addValue(Object value)
          Adds a new value at the end of the value list.
 void addValueAt(int nr, Object value)
          Adds a new value at the specified nr.
 Object clone()
          'Clones' the property, making a 'deep' copy - i.e., also makes copies of the values and the facets.
 void deleteValue(int nr)
          Removes a value from the list.
 Iterator facets()
          Returns an Iterator over the names of the facets of the property.
 int getCountOfValues()
          Returns the number of values.
 String getDescription()
          Returns the description of the property
 String getDisplayedName()
          Returns the displayed name of the property.
 Object getFacet(String name)
          Returns the value of the facet with the specified name.
 String getName()
          Returns the name of the property.
 String getType()
          Returns the type of the property (e.g.
 Object getValue()
          Returns the value of the property, or the first value in case of a multi-valued property.
 Object getValue(int nr)
          Returns a specific value of the property.
 boolean isModifiable()
          Returns whether the property shall be modifiable by the user
 boolean isVisible()
          Returns whether the property is visible to the user.
 void setFacet(String name, Object value)
          Sets the facet of the specified name to the specified value.
 void setModifiable(boolean modifiable)
          Specifies whether the property shall be modifiable by the user
 void setPropertyHolder(PropertyHolder holder)
          Sets the PropertyHolder that holds the property.
 void setValueAt(int nr, Object value)
          Changes the specified value to the new value.
 void setVisible(boolean visible)
          Specifies whether the property shall be visible to the user.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Property

public Property(String name,
                String type)
Constructor.

Parameters:
name - the name of the property
type - the type of the property

Property

public Property(String name,
                String type,
                String displayedName,
                String description)
Constructor with description.

Parameters:
name - the name of the property
type - the type of the property
displayedName - the displayed name
description - the description of the property
Method Detail

setPropertyHolder

public void setPropertyHolder(PropertyHolder holder)
Description copied from interface: Property
Sets the PropertyHolder that holds the property. Is only called by the PropertyHolder itself.

Specified by:
setPropertyHolder in interface Property
Parameters:
holder - the PropertyHolder

clone

public Object clone()
'Clones' the property, making a 'deep' copy - i.e., also makes copies of the values and the facets. Note that fdda.model.Property extends Cloneable.

Overrides:
clone in class Object

getName

public String getName()
Description copied from interface: Property
Returns the name of the property. This name must be unique within a PropertyHolder.

Specified by:
getName in interface Property
Returns:
the name of the property

getDisplayedName

public String getDisplayedName()
Description copied from interface: Property
Returns the displayed name of the property.

Specified by:
getDisplayedName in interface Property
Returns:
the displayed name

getType

public String getType()
Description copied from interface: Property
Returns the type of the property (e.g. Integer).

Specified by:
getType in interface Property
Returns:
the type of the property

getDescription

public String getDescription()
Description copied from interface: Property
Returns the description of the property

Specified by:
getDescription in interface Property
Returns:
the description

addValueAt

public void addValueAt(int nr,
                       Object value)
Description copied from interface: Property
Adds a new value at the specified nr. Not existent intermediate values are set to null.

Specified by:
addValueAt in interface Property
Parameters:
nr - the nr of the new value
value - the new value

addValue

public void addValue(Object value)
Description copied from interface: Property
Adds a new value at the end of the value list.

Specified by:
addValue in interface Property
Parameters:
value - the new value

setFacet

public void setFacet(String name,
                     Object value)
Description copied from interface: Property
Sets the facet of the specified name to the specified value.

Specified by:
setFacet in interface Property
Parameters:
name - the name of the facet
value - the new value of the facet

facets

public Iterator facets()
Description copied from interface: Property
Returns an Iterator over the names of the facets of the property.

Specified by:
facets in interface Property
Returns:
an Iterator over the facet names

getFacet

public Object getFacet(String name)
Description copied from interface: Property
Returns the value of the facet with the specified name. If there is no facet of that name, null is returned.

Specified by:
getFacet in interface Property
Parameters:
name - the name of the facet
Returns:
the value of the facet

getValue

public Object getValue()
Description copied from interface: Property
Returns the value of the property, or the first value in case of a multi-valued property. If no values exist, null is returned.

Specified by:
getValue in interface Property
Returns:
the value of the property

getValue

public Object getValue(int nr)
Description copied from interface: Property
Returns a specific value of the property. If no such value exists, null is returned (especially, if the given number is not 0 and the property is not multi-valued).

Specified by:
getValue in interface Property
Parameters:
nr - the number of the value
Returns:
the specified value of the property

deleteValue

public void deleteValue(int nr)
Description copied from interface: Property
Removes a value from the list. If the value number doesn't exit, nothing happens.

Specified by:
deleteValue in interface Property
Parameters:
nr - the number of the value which shall be deleted

setValueAt

public void setValueAt(int nr,
                       Object value)
Description copied from interface: Property
Changes the specified value to the new value. If the property hasn't a value of that number, addProperty is called.

Specified by:
setValueAt in interface Property
Parameters:
nr - the nr of the value
value - the new value

getCountOfValues

public int getCountOfValues()
Description copied from interface: Property
Returns the number of values.

Specified by:
getCountOfValues in interface Property
Returns:
the number of values of the properties

setVisible

public void setVisible(boolean visible)
Description copied from interface: Property
Specifies whether the property shall be visible to the user.

Specified by:
setVisible in interface Property
Parameters:
visible - whether the property shall be visible

setModifiable

public void setModifiable(boolean modifiable)
Description copied from interface: Property
Specifies whether the property shall be modifiable by the user

Specified by:
setModifiable in interface Property
Parameters:
modifiable - whether the property shall be modifiable

isModifiable

public boolean isModifiable()
Description copied from interface: Property
Returns whether the property shall be modifiable by the user

Specified by:
isModifiable in interface Property
Returns:
whether the property shall be modifiable

isVisible

public boolean isVisible()
Description copied from interface: Property
Returns whether the property is visible to the user.

Specified by:
isVisible in interface Property
Returns:
whether the property is visible


API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.