de.dfki.mycbr.core.model
Class BooleanDesc

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.model.AttributeDesc
          extended by de.dfki.mycbr.core.model.SimpleAttDesc
              extended by de.dfki.mycbr.core.model.SymbolDesc
                  extended by de.dfki.mycbr.core.model.BooleanDesc
All Implemented Interfaces:
IExplainable, TaxonomyNode, java.util.Observer

public class BooleanDesc
extends SymbolDesc

Description for boolean attributes. This description does not define restrictions for its values, since there is only one attribute for true and one attribute representing false. BooleanDesc extends SymbolDesc in order to use the table function defined for symbol attributes for boolean similarity computations.

Author:
myCBR Team

Constructor Summary
BooleanDesc(Concept owner, java.lang.String name)
          Initializes this with the given name.
 
Method Summary
 SymbolFct addBooleanFct(java.lang.String name, boolean active)
          Creates a new SymbolFct for the given description.
 SymbolAttribute addSymbol(java.lang.String value)
          Does nothing because you cannot add other values than true and false to a boolean description
 boolean canOverride(AttributeDesc desc)
          Checks whether this attribute description can override the given attribute description
 Attribute getAttribute(java.lang.Object value)
          Returns SymbolAttribute object representing the specified value.
 SymbolAttribute getBooleanAttribute(java.lang.Boolean value)
          Returns BooleanAttribute object representing the specified value.
 java.lang.Integer getIndexOf(SimpleAttribute att)
           
 boolean isAllowedValue(java.lang.String v)
          Tells you whether the specified string is an allowed value for this or not.
 void removeSymbol(java.lang.String value)
          Does nothing because you cannot delete a boolean value
 boolean renameValue(java.lang.String oldValue, java.lang.String newValue)
          Does nothing because you cannot rename a boolean value.
 
Methods inherited from class de.dfki.mycbr.core.model.SymbolDesc
addOrderedSymbolFct, addSymbolFct, addTaxonomyFct, fits, fitsSingle, getAllowedValues, getAttribute, getNodes, getSymbolAttributes
 
Methods inherited from class de.dfki.mycbr.core.model.SimpleAttDesc
addFct, deleteAllFcts, deleteSimFct, getFct, getSimFcts, renameFct
 
Methods inherited from class de.dfki.mycbr.core.model.AttributeDesc
delete, getExpType, getName, getOwner, isMultiple, setMultiple, setName, setOwner, toString, update
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanDesc

public BooleanDesc(Concept owner,
                   java.lang.String name)
            throws java.lang.Exception
Initializes this with the given name. The name should be unique within the attributes of the c description containing this description. Creates a new range for this description.

Throws:
java.lang.Exception
Method Detail

getBooleanAttribute

public SymbolAttribute getBooleanAttribute(java.lang.Boolean value)
Returns BooleanAttribute object representing the specified value.

Parameters:
value - the boolean representing the value that should be returned
Returns:
value representing the specified boolean.

addBooleanFct

public SymbolFct addBooleanFct(java.lang.String name,
                               boolean active)
Creates a new SymbolFct for the given description.

Parameters:
name - the name of the description for which a new function should be created
Returns:
the new SymbolFct for description desc

canOverride

public boolean canOverride(AttributeDesc desc)
Description copied from class: AttributeDesc
Checks whether this attribute description can override the given attribute description

Overrides:
canOverride in class SymbolDesc
Parameters:
desc - the description which should be overridden by this
Returns:
true, if this can override the given function, false otherwise.

isAllowedValue

public boolean isAllowedValue(java.lang.String v)
Description copied from class: SymbolDesc
Tells you whether the specified string is an allowed value for this or not.

Overrides:
isAllowedValue in class SymbolDesc
Parameters:
v - the string which should be checked for allowance
Returns:
true, if value is an allowed value, false otherwise

getAttribute

public Attribute getAttribute(java.lang.Object value)
Returns SymbolAttribute object representing the specified value.

Overrides:
getAttribute in class AttributeDesc
Parameters:
value - the string representing the value that should be returned
Returns:
value representing the specified string, null if there is none.

getIndexOf

public final java.lang.Integer getIndexOf(SimpleAttribute att)
Overrides:
getIndexOf in class SymbolDesc
Parameters:
att - the attribute whose index should be returned
Returns:
the index of the given attribute, null if it does not belong to this

removeSymbol

public void removeSymbol(java.lang.String value)
Does nothing because you cannot delete a boolean value

Overrides:
removeSymbol in class SymbolDesc
Parameters:
value - the value of the symbol attribute to be removed

renameValue

public final boolean renameValue(java.lang.String oldValue,
                                 java.lang.String newValue)
Does nothing because you cannot rename a boolean value.

Overrides:
renameValue in class SymbolDesc
Parameters:
oldValue - the old value
newValue - the new value

addSymbol

public final SymbolAttribute addSymbol(java.lang.String value)
Does nothing because you cannot add other values than true and false to a boolean description

Overrides:
addSymbol in class SymbolDesc
Parameters:
value - the value to be added to this description
Returns:
null