- All Known Implementing Classes:
Codons
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface for selecting a
Cfg.Symbol
by its index within a
rule. It is an abstraction of the codon values used for selecting
the alternatives from a rule during the sentence generation.- Since:
- 7.1
- Version:
- 7.1
-
Method Summary
Modifier and TypeMethodDescriptionint
Selects an index with the given upperbound
, exclusively.static SymbolIndex
of
(RandomGenerator random) Create a new symbol-index object from the given random generator.
-
Method Details
-
next
Selects an index with the given upperbound
, exclusively.- Parameters:
rule
- the rule which requested the indexbound
- the upper bound of the symbol index, exclusively- Returns:
- the next symbol index
- Throws:
IllegalArgumentException
- if the givenbound
is smaller than one
-
of
Create a new symbol-index object from the given random generator. This can be used for generating random sentences of derivation-trees.- Parameters:
random
- the random generator used for generating the sentences- Returns:
- a new symbol-index object from the given random generator
- Throws:
NullPointerException
- if the givenrandom
generator isnull
-