|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jscience.linguistics.search.CharIntMap
public class CharIntMap
The CharIntMap is a collection to save 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.
Constructor Summary | |
---|---|
CharIntMap()
Constructor for CharIntMap. |
|
CharIntMap(int extent,
char lowest)
Constructor for CharIntMap. |
|
CharIntMap(int extent,
char lowest,
int defaultValue)
Constructor for CharIntMap. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a deep clone of this CharIntMap. |
boolean |
equals(java.lang.Object obj)
Returns if this Object is equal to another Object. |
int |
get(char c)
Returns the stored value for the given char . |
int |
getExtent()
Returns the extent of the actual char array. |
char |
getHighest()
Returns the highest char that mappings can be saved for. |
char |
getLowest()
Returns the lowest char that mappings can be saved for. |
int |
hashCode()
Returns the hashCode of this Object. |
void |
readExternal(java.io.ObjectInput in)
|
void |
set(char c,
int val)
Sets the stored value for the given char . |
java.lang.String |
toString()
Returns a String representation of this Object. |
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CharIntMap()
public CharIntMap(int extent, char lowest)
extent
- the extent of the textlowest
- the lowest occuring characterpublic CharIntMap(int extent, char lowest, int defaultValue)
extent
- the extent of the textlowest
- the lowest occuring characterdefaultValue
- a default value to initialize the underlying
int
array withMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public int get(char c)
char
.
c
- the char
public void set(char c, int val)
char
.
c
- the char
val
- the new valuepublic int getExtent()
char
array.
public char getLowest()
char
public char getHighest()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other Object
Object.equals(Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
Externalizable.writeExternal(java.io.ObjectOutput)
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |