public interface Alphabet extends Comparable<Alphabet>
Defines a collection of Symbol
s that can be used together.
The description length of symbols in an alphabet depends on whether the alphabet is finite and complete,
or whether it is potentially infinite and still possible to add new symbols to it. The actual state
of the alphabet in this respect can be queried using the
method isFixated()
. When an alphabet is created, it starts out
as potentially infinite and isFixated
returns false
. When all symbols are added to the
alphabet, it can be marked as finite and complete by calling fixate()
.
To ensure that the properties of Symbol
s (in particular the description length property) never change
however, calling the method isFixated()
on the same alphabet should always return the same value.
So it is best to add all symbols first, and then mark the alphabet as fixated, before calling
isFixated
or querying the description length of any of its symbols.
Modifier and Type | Interface and Description |
---|---|
static interface |
Alphabet.Iterable
Represents a
NearIterable that returns alphabet items. |
Modifier and Type | Method and Description |
---|---|
Long |
findLargestSymbolOrdinal()
Returns the largest ordinal of all symbols in this alphabet.
|
void |
fixate()
Marks this alphabet as finite and complete.
|
long |
getFixatedDescriptionLength()
Returns the uniform description length for all symbols in this alphabet.
|
String |
getURI()
Returns the identifying URI of this alphabet.
|
Symbol |
internalize(String symbol)
Adds a symbol to the alphabet.
|
boolean |
isFixated()
Returns a flag that indicates whether this alphabet should be treated as finite and complete.
|
compareTo
String getURI()
Root.createInteractionContext(String, String, String, String)
void fixate()
boolean isFixated()
fixate()
if
this object had already committed to a potentially infinite state.true
if the alphabet should be treated as finite and complete; false
otherwiseSymbol internalize(String symbol)
symbol
- The string denotation of the symbolLong findLargestSymbolOrdinal()
long getFixatedDescriptionLength()
IllegalStateException
- If this alphabet is not fixatedCopyright © 2013. All Rights Reserved.