|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<Symbol>
jbil.sequence.Alphabet
public class Alphabet
Class representing an alphabet of symbols.
Constructor Summary | |
---|---|
Alphabet()
Creates an empty alphabet. |
|
Alphabet(int initialCapacity)
Creates an empty alphabet with a given initial capacity. |
|
Alphabet(java.util.List<? extends Symbol> symbols)
Creates an alphabet from a list of symbols. |
Method Summary | |
---|---|
void |
add(int index,
Symbol symbol)
Adds a symbol to the alphabet at a given position. |
boolean |
contains(java.lang.Object o)
|
Symbol |
get(int index)
Return a symbol at a given position in the alphabet. |
int |
indexOf(java.lang.Object o)
Gets the position of a given symbol object in the alphabet. |
Alphabet |
intersection(Alphabet other)
Computes the intersection between this alphabet and a given alphabet. |
boolean |
isLocked()
|
void |
lock()
Lock the alphabet, i.e., forbid any further modification. |
Symbol |
remove(int index)
Removes the symbol at a given position. |
Symbol |
set(int index,
Symbol symbol)
Replaces the symbol at a given position. |
int |
size()
|
Methods inherited from class java.util.AbstractList |
---|
add, addAll, clear, equals, hashCode, iterator, lastIndexOf, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public Alphabet()
public Alphabet(int initialCapacity)
initialCapacity
- public Alphabet(java.util.List<? extends Symbol> symbols)
symbols
- The source list of symbols.Method Detail |
---|
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<Symbol>
contains
in interface java.util.List<Symbol>
contains
in class java.util.AbstractCollection<Symbol>
public Symbol get(int index)
get
in interface java.util.List<Symbol>
get
in class java.util.AbstractList<Symbol>
index
- The position of the symbol.public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<Symbol>
indexOf
in class java.util.AbstractList<Symbol>
o
- The symbol object.
public int size()
size
in interface java.util.Collection<Symbol>
size
in interface java.util.List<Symbol>
size
in class java.util.AbstractCollection<Symbol>
public void add(int index, Symbol symbol)
add
in interface java.util.List<Symbol>
add
in class java.util.AbstractList<Symbol>
index
- The position at which the symbol should be added.symbol
- The symbol to be added.public Symbol set(int index, Symbol symbol)
set
in interface java.util.List<Symbol>
set
in class java.util.AbstractList<Symbol>
index
- The position to be replaced.symbol
- The new symbol.public Symbol remove(int index)
remove
in interface java.util.List<Symbol>
remove
in class java.util.AbstractList<Symbol>
index
- The position to be removed.public Alphabet intersection(Alphabet other)
other
- The other alphabet.
public void lock()
public boolean isLocked()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |