de.cau.cs.kieler.kvid.datadistributor
Class Property

java.lang.Object
  extended by de.cau.cs.kieler.kvid.datadistributor.Property

public class Property
extends Object

Class for storing KViD Properties, it's corresponding values and the currently selected value.

Rating red

Constructor Summary
Property(String thename, String thedefaultvalue)
          Constructor for a Property with free text input.
Property(String thename, String[] thevalues)
          Constructor for a Property with a fix set of options.
Property(String theName, String[] theValues, List<String> theAssociatedParts)
          Constructor for a Property with a fixed set of options and EditParts to which it refer.
Property(String theName, String theDefaultValue, List<String> theAssociatedParts)
          Constructor for a Property with free text input and EditParts to which it refer .
 
Method Summary
 String getCurrentValue()
          Getter for the Property's current value.
 int getCurrentValueNumber()
          Gets the value of the currently selected option.
 String getName()
          Getter for the Property's name.
 String[] getValueNames()
          Getter for all possible options.
 boolean isFreeText()
          Method to check whether this is a free text Property.
 boolean refersTo(String thePart)
          Method to check whether this option is associated with a certain EditPart.
 void setCurrentValue(int optionNumber)
          Sets the current option by it's number.
 void setCurrentValue(String optionName)
          Sets the current option by it's name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

public Property(String thename,
                String[] thevalues)
Constructor for a Property with a fix set of options.

Parameters:
thename - The Property's desired name (must be unique)
thevalues - String array containing all possible options

Property

public Property(String thename,
                String thedefaultvalue)
Constructor for a Property with free text input.

Parameters:
thename - The Property's desired name (must be unique)
thedefaultvalue - The initial value of the Property

Property

public Property(String theName,
                String[] theValues,
                List<String> theAssociatedParts)
Constructor for a Property with a fixed set of options and EditParts to which it refer.

Parameters:
theName - The Property's desired name (must be unique)
theValues - String array containing all possible options
theAssociatedParts - EditParts to which this option refers

Property

public Property(String theName,
                String theDefaultValue,
                List<String> theAssociatedParts)
Constructor for a Property with free text input and EditParts to which it refer .

Parameters:
theName - The Property's desired name (must be unique)
theDefaultValue - The initial value of the Property
theAssociatedParts - EditParts to which this option refers
Method Detail

getName

public String getName()
Getter for the Property's name.

Returns:
The Property's name

getCurrentValue

public String getCurrentValue()
Getter for the Property's current value.

Returns:
The Property's current value

isFreeText

public boolean isFreeText()
Method to check whether this is a free text Property.

Returns:
Is this a free text Property?

getCurrentValueNumber

public int getCurrentValueNumber()
Gets the value of the currently selected option.

Returns:
The number of the currently selected option, 0 if this is a free text Property

getValueNames

public String[] getValueNames()
Getter for all possible options.

Returns:
All possible options represented by a string array.

setCurrentValue

public void setCurrentValue(int optionNumber)
Sets the current option by it's number. Doesn't work for free text Properties.

Parameters:
optionNumber - The number of the option to set to

setCurrentValue

public void setCurrentValue(String optionName)
Sets the current option by it's name. Use this also for free text options.

Parameters:
optionName - The name of the option that should become the new current option

refersTo

public boolean refersTo(String thePart)
Method to check whether this option is associated with a certain EditPart. Enter null to find general options.

Parameters:
thePart - The URI of the object to which the option might refer
Returns:
true if it refers, false else

toString

public String toString()
Overrides:
toString in class Object