Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.model.preprocessor
Class SymbolDefinitionSet

java.lang.Object
  extended by org.eclipse.mtj.core.model.preprocessor.SymbolDefinitionSet
All Implemented Interfaces:
IPersistable

public class SymbolDefinitionSet
extends Object
implements IPersistable

A set of symbol names to true/false definition status.


Constructor Summary
SymbolDefinitionSet()
          Construct a new symbol definition set without a name
SymbolDefinitionSet(String name)
          Construct a new symbol definition set with the specified name.
 
Method Summary
 void define(String identifier)
          Define the specified identifier.
 void define(String identifier, String value)
          Define the specified identifier to be the specified value.
 boolean equals(Object obj)
           
 boolean equals(SymbolDefinitionSet definitions)
          Return a boolean indicating whether the specified SymbolDefinitions object is equal to this object.
 Map<String,String> getDefinedSymbols()
          Return the symbols that are defined as true in the list of symbol definitions.
 String getName()
          Return the name of this set of symbol definitions.
 String getValue(String identifier)
          Return the (possibly null) value of the specified identifier.
 int hashCode()
           
 boolean isDefined(String identifier)
          Return a boolean indicating whether the specified identifier is defined.
 void loadUsing(IPersistenceProvider persistenceProvider)
          Load the state of this object using the specified persistence state information.
 void setDefinitions(Map<String,String> definitions)
          Set the definitions set to contain the specified definitions.
 void setName(String name)
          Set the name of this set of symbol definitions.
 void storeUsing(IPersistenceProvider persistenceProvider)
          Save the state of this object using the specified persistence state information.
 String toString()
           
 void undefine(String identifier)
          Undefine the specified identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymbolDefinitionSet

public SymbolDefinitionSet()
Construct a new symbol definition set without a name


SymbolDefinitionSet

public SymbolDefinitionSet(String name)
Construct a new symbol definition set with the specified name.

Parameters:
name -
Method Detail

define

public void define(String identifier)
Define the specified identifier.

Parameters:
identifier -

define

public void define(String identifier,
                   String value)
Define the specified identifier to be the specified value.

Parameters:
identifier -
value -

equals

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

equals

public boolean equals(SymbolDefinitionSet definitions)
Return a boolean indicating whether the specified SymbolDefinitions object is equal to this object.

Parameters:
definitions -
Returns:

getDefinedSymbols

public Map<String,String> getDefinedSymbols()
Return the symbols that are defined as true in the list of symbol definitions. The list of symbols returned by this method does not include symbols from parent symbol definition sets.

Returns:

getName

public String getName()
Return the name of this set of symbol definitions.

Returns:
the name

getValue

public String getValue(String identifier)
Return the (possibly null) value of the specified identifier.

Parameters:
identifier -
Returns:

hashCode

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

isDefined

public boolean isDefined(String identifier)
Return a boolean indicating whether the specified identifier is defined.

Parameters:
identifier -
Returns:

loadUsing

public void loadUsing(IPersistenceProvider persistenceProvider)
               throws PersistenceException
Description copied from interface: IPersistable
Load the state of this object using the specified persistence state information.

Specified by:
loadUsing in interface IPersistable
Throws:
PersistenceException
See Also:
IPersistable.loadUsing(org.eclipse.mtj.core.persistence.IPersistenceProvider)

setDefinitions

public void setDefinitions(Map<String,String> definitions)
Set the definitions set to contain the specified definitions.

Parameters:
definitions -

setName

public void setName(String name)
Set the name of this set of symbol definitions.

Parameters:
name - the name to set

storeUsing

public void storeUsing(IPersistenceProvider persistenceProvider)
                throws PersistenceException
Description copied from interface: IPersistable
Save the state of this object using the specified persistence state information.

Specified by:
storeUsing in interface IPersistable
Throws:
PersistenceException
See Also:
IPersistable.storeUsing(org.eclipse.mtj.core.persistence.IPersistenceProvider)

toString

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

undefine

public void undefine(String identifier)
Undefine the specified identifier.

Parameters:
identifier -

Mobile Tools for Java
Release 1.0