
public abstract class CharIndex extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CharIndex.FullHash
An index based on a garden-variety hash map.
|
static class |
CharIndex.Masked
An index based on a simple mask: index(c) = (c & MASK).
|
static class |
CharIndex.Straight
An index based on the identity mapping: index(c) = c.
|
| Constructor and Description |
|---|
CharIndex() |
| Modifier and Type | Method and Description |
|---|---|
static CharIndex |
getInstance(CharSequence s)
Generates an index for a given alphabet, defined by a character sequence.
|
abstract int |
lookup(char c)
Returns the index (mapping result) for a given character.
|
abstract int[] |
map(CharSequence s,
int[] mapped)
Performs lookups on an entire sequence of characters.
|
abstract int |
nullElement()
Returns an index that is not used for any character in
the alphabet.
|
abstract int |
size()
Returns the maximum index result that can be returned by
the lookup function (including the nullElement result
if applicable).
|
public static CharIndex getInstance(CharSequence s)
s - the alphabet to be indexedpublic abstract int lookup(char c)
c - character for which an index is soughtpublic abstract int[] map(CharSequence s, int[] mapped)
s - character sequence to be indexedmapped - array for storing resultspublic abstract int nullElement()
public abstract int size()
Copyright © 2018. All rights reserved.