|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISymbolSet
Symbol definition sets provide a means to define a group of related symbols with a particular name to reference that group.
Symbol definition sets are most useful for controlling definitions without the need to alter source code. For example, symbol definition sets can be used to remove debugging information to create a production build.
Clients must use MTJCore.getSymbolSetFactory()
to retrieve an
ISymbolSetFactory
instance and use the
ISymbolSetFactory.createSymbolSet(String)
to create an ISymbolSet
instance.
Field Summary |
---|
Fields inherited from interface org.eclipse.mtj.core.persistence.IPersistable |
---|
CLASS_PERSISTABLE_ATTRIBUTE, ID_PERSISTABLE_ATTRIBUTE, KEY_PERSISTABLE_ATTRIBUTE, PROPERTY_PERSISTABLE_ELEMENT, REFID_PERSISTABLE_ATTRIBUTE, VALUE_PERSISTABLE_ATTRIBUTE |
Method Summary | ||
---|---|---|
void |
add(Collection<ISymbol> symbols)
Add a collection of symbols to this symbolset. |
|
void |
add(ISymbol s)
Add one specific symbol to this symbolset. |
|
ISymbol |
add(String name)
Define a new symbol in the symbolset with the given name with the a default value ( true ). |
|
ISymbol |
add(String name,
String value)
Define a new symbol in the symbolset with the given name and value. |
|
ISymbol |
add(String identifier,
String value,
int type)
Define a new symbol in the symbolset with the given name, value and type. |
|
boolean |
contains(String symbolname)
Return a boolean indicating whether the SymbolSet contains a symbol with the given name. |
|
boolean |
equals(ISymbolSet definitions)
Return a boolean indicating whether the specified SymbolSet object is equal to this SymbolSet. |
|
String |
getName()
Return the name of this SymbolSet. |
|
Collection<ISymbol> |
getSymbols()
Returns a collection view of the values contained in this SymbolSet. |
|
String |
getSymbolSetString()
Returns a string representation of this SymbolSet. |
|
String |
getSymbolValue(String symbolname)
Return the (possibly null ) value of the symbol identified by
the given name. |
|
void |
remove(Collection<ISymbol> c)
Remove a collection of symbols from the SymbolSet. |
|
void |
remove(String symbolname)
Removes the mapping for the symbol, identified by the given name, from this SymbolSet if present. |
|
void |
setName(String name)
Set the name of this set of symbol definitions. |
|
void |
setSymbols(Map<String,String> symbols)
Set the map to be used as the base of the symbols available in the SymolSet. |
|
int |
size()
Returns the number of symbols on this SymbolSet. |
|
|
toArray(T[] a)
Returns an array containing all of the elements in this SymbolSet. |
Methods inherited from interface org.eclipse.mtj.core.persistence.IPersistable |
---|
loadUsing, storeUsing |
Method Detail |
---|
ISymbol add(String name)
true
).
name
- the symbol name. This is case-sensitive and must not be
null
or an empty String ""
.
ISymbol add(String name, String value)
name
- the symbol name. This is case-sensitive and must not be
null
or an empty String ""
.value
- the symbol value.
ISymbol add(String identifier, String value, int type)
name
- the symbol name. This is case-sensitive and must not be
null
or an empty String ""
.value
- the symbol value.type
- the symbol value. Possible types are #TYPE_ABILITY
and ISymbol.TYPE_RUNTIME
.
void add(Collection<ISymbol> symbols)
symbols
- the collection of symbols to be added.void add(ISymbol s)
s
- the symbol to be added.boolean equals(ISymbolSet definitions)
definitions
- the reference SymbolSet object with which to compare.
true
if this SymbolSet is the same as the the one
from the definitions argument; false
otherwise.Collection<ISymbol> getSymbols()
String getName()
String getSymbolValue(String symbolname)
null
) value of the symbol identified by
the given name.
symbolname
- the name of the symbol from which the value must be
retrieved.
boolean contains(String symbolname)
symbolname
- The symbol name whose presence in the SymbolSet is to
be tested.
void setSymbols(Map<String,String> symbols)
symbols
- the map to be used as the base of the symbols available in
the SymolSet.void setName(String name)
name
- the name to set.This is case-sensitive and must not be
null
or an empty String ""
.String getSymbolSetString()
void remove(String symbolname)
symbolname
- the name of the symbol whose mapping is to be removed
from the SymbolSet.void remove(Collection<ISymbol> c)
symbols
- a collection of symbols to be removed from the SymbolSet.int size()
<T> T[] toArray(T[] a)
a
- the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the
same runtime type is allocated for this purpose.
|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |