public class ExtensionWord<I> extends Word<I>
Constructor and Description |
---|
ExtensionWord(Word<I> word,
I letter) |
Modifier and Type | Method and Description |
---|---|
protected Word<I> |
_subWord(int fromIndex,
int toIndex)
Internal subword operation implementation.
|
I |
getSymbol(int index)
Return symbol that is at the specified position
|
boolean |
isPrefixOf(Word<?> other)
Checks if this word is a prefix of another word.
|
Iterator<I> |
iterator() |
int |
length()
Retrieves the length of this word.
|
Word<I> |
prepend(I symbol)
Prepends a symbol to this word and returns the result as a new word.
|
void |
writeToArray(int offset,
Object[] array,
int tgtOffset,
int length)
Writes the contents of this container to an array.
|
_concat, append, asList, canonicalComparator, canonicalNext, concat, epsilon, equals, firstSymbol, flatten, fromArray, fromLetter, fromList, fromString, fromSymbols, fromWords, hashCode, isEmpty, isSuffixOf, lastSymbol, longestCommonPrefix, longestCommonSuffix, prefix, prefixes, print, size, subWord, subWord, suffix, suffixes, transform, trimmed, upcast
toString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public I getSymbol(int index)
Word
public int length()
Word
protected Word<I> _subWord(int fromIndex, int toIndex)
Word
Word.subWord(int, int)
,
no range checks need to be performed. As this method is flagged as protected,
implementations may rely on the specified indices being valid.public void writeToArray(int offset, Object[] array, int tgtOffset, int length)
ArrayWritable
System.arraycopy(this.toArray(), offset, array, tgtOfs, num);
writeToArray
in interface ArrayWritable<I>
writeToArray
in class Word<I>
offset
- how many elements of this container to skip.array
- the array in which to store the elements.tgtOffset
- the starting offset in the target array.length
- the maximum number of elements to copy.public Word<I> prepend(I symbol)
Word
public boolean isPrefixOf(Word<?> other)
Word
isPrefixOf
in class Word<I>
other
- the other wordCopyright © 2015. All rights reserved.