Package libsidutils.stringsearch
Klasse CharIntMap
java.lang.Object
libsidutils.stringsearch.CharIntMap
- Alle implementierten Schnittstellen:
Externalizable,Serializable,Cloneable
The CharIntMap is a collection to save
The CharIntMap is initialized by specifying the extent between the lowest and the highest occuring character and the lowest occuring character. Only an array of size
There's usually no need to construct a CharIntMap yourself, it is done automatically for you in the pre-processing methods.
char to int
mappings in. The CharIntMap is destined to provide fast access to skip tables
while being both Unicode-safe and more RAM-effective than a naive
int array. The CharIntMap is initialized by specifying the extent between the lowest and the highest occuring character and the lowest occuring character. Only an array of size
highest - lowest + 1 is constructed. There's usually no need to construct a CharIntMap yourself, it is done automatically for you in the pre-processing methods.
- Version:
- 1.2
- Autor:
- Johann Burkard
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate int[]private intprivate char(Package privat) static final long -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungConstructor for CharIntMap.CharIntMap(int extent, char lowest) Constructor for CharIntMap.CharIntMap(int extent, char lowest, int defaultValue) Constructor for CharIntMap. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungclone()Returns a deep clone of this CharIntMap.booleanReturns if this Object is equal to another Object.intget(char c) Returns the stored value for the givenchar.intReturns the extent of the actualchararray.charReturns the highest char that mappings can be saved for.charReturns the lowest char that mappings can be saved for.inthashCode()Returns the hashCode of this Object.voidvoidset(char c, int val) Sets the stored value for the givenchar.toString()Returns a String representation of this Object.void
-
Felddetails
-
serialVersionUID
static final long serialVersionUID- Siehe auch:
-
array
private int[] array -
lowest
private char lowest -
defaultValue
private int defaultValue
-
-
Konstruktordetails
-
CharIntMap
public CharIntMap()Constructor for CharIntMap. Required for Serialization. -
CharIntMap
public CharIntMap(int extent, char lowest) Constructor for CharIntMap.- Parameter:
extent- the extent of the textlowest- the lowest occuring character
-
CharIntMap
public CharIntMap(int extent, char lowest, int defaultValue) Constructor for CharIntMap.- Parameter:
extent- the extent of the textlowest- the lowest occuring characterdefaultValue- a default value to initialize the underlyingintarray with
-
-
Methodendetails
-
clone
Returns a deep clone of this CharIntMap. -
get
public int get(char c) Returns the stored value for the givenchar.- Parameter:
c- thechar- Gibt zurück:
- the stored value
-
set
public void set(char c, int val) Sets the stored value for the givenchar.- Parameter:
c- thecharval- the new value
-
getExtent
public int getExtent()Returns the extent of the actualchararray.- Gibt zurück:
- the extent
-
getLowest
public char getLowest()Returns the lowest char that mappings can be saved for.- Gibt zurück:
- a
char
-
getHighest
public char getHighest()Returns the highest char that mappings can be saved for.- Gibt zurück:
- char
-
equals
Returns if this Object is equal to another Object. -
hashCode
public int hashCode()Returns the hashCode of this Object. -
toString
Returns a String representation of this Object. -
writeExternal
- Angegeben von:
writeExternalin SchnittstelleExternalizable- Löst aus:
IOException- Siehe auch:
-
readExternal
- Angegeben von:
readExternalin SchnittstelleExternalizable- Löst aus:
IOExceptionClassNotFoundException- Siehe auch:
-