|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectclassifierLibrary.SymbolSet
Library classifierLibrary, Classe SymbolSet
Encapsulates a HashTable, representing a set of Symbols.
Copyright by Klaus Hufschlag 2004,2005,2006
This file is part of the Generic Classifier Library. The Generic Classifier Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The Generic Classifier Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the Generic Classifier Library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Constructor Summary | |
SymbolSet()
Constructor. |
|
SymbolSet(java.lang.String name)
Constructor. |
|
SymbolSet(java.lang.String name,
java.lang.String[] symbolNames)
|
Method Summary | |
void |
add(Symbol s)
Method for adding a Symbol to the set. |
void |
add(SymbolSet s)
Method for adding all Symbols of another SymbolSet to the set. |
void |
addMultiSymbols(java.lang.String[] names)
Adds Symbols following a list of names to the instance. |
java.util.Collection |
asCollection()
Returns a collection-view on the instance, giving access to further java standard methods. |
java.lang.Object |
clone()
|
boolean |
contains(java.lang.String name)
Checks, whether a Symbol given by its name is contained in the set. |
boolean |
contains(Symbol s)
Checks, whether a given Symbol is contained in the set. |
boolean |
contains(SymbolSet s)
Checks, whether a given SymbolSet is a subset of the set. |
void |
debug_out()
Method for debugging-purposes. |
Symbol |
getDefault()
Returns the default-Symbol of the instance. |
java.lang.String |
getName()
Method returns the name of the instance. |
int |
getSize()
Returns the number of Symbols contained. |
java.util.Iterator |
iterator()
Returns an iterator through alle elements contained. |
java.util.ArrayList |
powerSet()
Generates an ArrayList of SymbolSets, representing the power set of the instance (ie. the set of all possible subsets of the set represented by the instance). |
Symbol |
randomSymbol()
Returns a randomly selected Symbol contained in the instance. |
void |
remove()
Removes all Symbols from the instance. |
void |
remove(Symbol s)
Removes a Symbol from the set. |
void |
remove(SymbolSet s)
Removes a Set of Symbols from the instance. |
void |
setDefault(java.lang.String Name)
Method to define a Symbol as default-Symbol of the instance. |
void |
setDefault(Symbol s)
Method to define a Symbol as default-Symbol of the instance. |
void |
setName(java.lang.String name)
Method for Setting the name of the instance. |
Symbol |
symbolByName(java.lang.String Name)
Returns a Symbol given by its Name, if contained in the instance. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SymbolSet()
public SymbolSet(java.lang.String name)
name
- Name for the new SymbolSet.public SymbolSet(java.lang.String name, java.lang.String[] symbolNames)
Method Detail |
public java.lang.Object clone()
public void setName(java.lang.String name)
name
- Name to be set.public java.lang.String getName()
public void add(Symbol s)
s
- Symbol to be added.public void add(SymbolSet s)
s
- SymbolSet of Symbols to be added.public void addMultiSymbols(java.lang.String[] names)
names
- public boolean contains(Symbol s)
s
- Symbol to check
public boolean contains(java.lang.String name)
name
- Name of the Symbol to check
public boolean contains(SymbolSet s)
s
- SymbolSet to check for being a subset of the instance
public void remove(Symbol s)
s
- Symbol to removepublic void remove(SymbolSet s)
Removes a Set of Symbols from the instance.
s
- SymbolSet of elements to be removed.public void remove()
public Symbol symbolByName(java.lang.String Name)
Name
- Name of Symbol.
public Symbol randomSymbol()
public void debug_out()
public void setDefault(java.lang.String Name)
Name
- Name of the Symbol to be set as defaultpublic void setDefault(Symbol s)
s
- Symbol to be set as defaultpublic Symbol getDefault()
public int getSize()
public java.util.Collection asCollection()
public java.util.Iterator iterator()
public java.util.ArrayList powerSet()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |