net.sourceforge.chaperon.model.symbol
Interface SymbolCollection

All Known Implementing Classes:
SymbolList, SymbolSet

public interface SymbolCollection

This class represents a abstract collection of symbols.

Version:
CVS $Id: SymbolCollection.java,v 1.4 2003/12/09 19:55:53 benedikta Exp $
Author:
Stephan Michels

Method Summary
 boolean addSymbol(Symbol symbol)
           
 boolean addSymbol(SymbolCollection collection)
           
 void clear()
          Removes all symbols from this collection.
 boolean contains(java.lang.String name)
          If the collection contains a symbol, given by the name of the symbol.
 boolean contains(Symbol symbol)
          If the collection contains the symbol.
 boolean equals(java.lang.Object o)
          Compares to another collection of symbols.
 Symbol getSymbol(int index)
          Return a symbol giving by an index.
 Symbol getSymbol(java.lang.String name)
          Returns a symbol from this collection given by the name of the symbol.
 int getSymbolCount()
          Returns the count of symbols in the collection.
 int indexOf(java.lang.String name)
          Return the index of a symbol, given by the name of the Symbol.
 int indexOf(Symbol symbol)
          Return the index of a symbol.
 boolean isEmpty()
          If this collection is empty.
 void removeSymbol(int index)
          Removes a symbol by an index from this collection
 void removeSymbol(Symbol symbol)
          Removes a symbol from this collection.
 void setSymbol(int index, Symbol symbol)
          Replace a symbol by an index.
 java.lang.String toString()
          Return a string representation of the collection.
 

Method Detail

addSymbol

boolean addSymbol(Symbol symbol)

addSymbol

boolean addSymbol(SymbolCollection collection)

removeSymbol

void removeSymbol(int index)
Removes a symbol by an index from this collection

Parameters:
index - Index of the symbol.

removeSymbol

void removeSymbol(Symbol symbol)
Removes a symbol from this collection.

Parameters:
symbol - Symbol, which should be removed.

setSymbol

void setSymbol(int index,
               Symbol symbol)
Replace a symbol by an index.

Parameters:
index - The index, at which the symbol be inserted.
symbol - Symbol.

getSymbol

Symbol getSymbol(int index)
Return a symbol giving by an index.

Parameters:
index - Index of the symbol.
Returns:
Symbol.

getSymbol

Symbol getSymbol(java.lang.String name)
Returns a symbol from this collection given by the name of the symbol.

Parameters:
name - Name of the symbol.
Returns:
Symbol.

getSymbolCount

int getSymbolCount()
Returns the count of symbols in the collection.

Returns:
Count of symbols.

isEmpty

boolean isEmpty()
If this collection is empty.

Returns:
True, if the collection is empty.

indexOf

int indexOf(Symbol symbol)
Return the index of a symbol.

Parameters:
symbol - Symbol.
Returns:
Index of this symbol.

indexOf

int indexOf(java.lang.String name)
Return the index of a symbol, given by the name of the Symbol.

Parameters:
name - Name of symbol.
Returns:
Index of this symbol.

contains

boolean contains(Symbol symbol)
If the collection contains the symbol.

Parameters:
symbol - Symbol.
Returns:
True, if the collection contains the symbol.

contains

boolean contains(java.lang.String name)
If the collection contains a symbol, given by the name of the symbol.

Parameters:
name - Name of the symbol.
Returns:
True, if the collection contains the symbol.

clear

void clear()
Removes all symbols from this collection.


equals

boolean equals(java.lang.Object o)
Compares to another collection of symbols.

Overrides:
equals in class java.lang.Object
Parameters:
o - Another object.
Returns:
True, if both collections contains the same symbols.

toString

java.lang.String toString()
Return a string representation of the collection.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the collection.


Copyright ? 2003 Chaperon project. All Rights Reserved.