Klasse CharIntMap

java.lang.Object
libsidutils.stringsearch.CharIntMap
Alle implementierten Schnittstellen:
Externalizable, Serializable, Cloneable

class CharIntMap extends Object implements Externalizable, Cloneable
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.
Version:
1.2
Autor:
Johann Burkard
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    private int[]
     
    private int
     
    private char
     
    private static final long
     
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    Constructor for CharIntMap.
    CharIntMap(int extent, char lowest)
    Constructor for CharIntMap.
    CharIntMap(int extent, char lowest, int defaultValue)
    Constructor for CharIntMap.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    Returns a deep clone of this CharIntMap.
    boolean
    Returns if this Object is equal to another Object.
    int
    get(char c)
    Returns the stored value for the given char.
    int
    Returns the extent of the actual char array.
    char
    Returns the highest char that mappings can be saved for.
    char
    Returns the lowest char that mappings can be saved for.
    int
    Returns the hashCode of this Object.
    void
     
    void
    set(char c, int val)
    Sets the stored value for the given char.
    Returns a String representation of this Object.
    void
     

    Von Klasse geerbte Methoden java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Felddetails

    • serialVersionUID

      private 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 text
      lowest - the lowest occuring character
    • CharIntMap

      public CharIntMap(int extent, char lowest, int defaultValue)
      Constructor for CharIntMap.
      Parameter:
      extent - the extent of the text
      lowest - the lowest occuring character
      defaultValue - a default value to initialize the underlying int array with
  • Methodendetails

    • clone

      public Object clone()
      Returns a deep clone of this CharIntMap.
      Setzt außer Kraft:
      clone in Klasse Object
      Gibt zurück:
      an CharIntMap containing the same mappings
    • get

      public int get(char c)
      Returns the stored value for the given char.
      Parameter:
      c - the char
      Gibt zurück:
      the stored value
    • set

      public void set(char c, int val)
      Sets the stored value for the given char.
      Parameter:
      c - the char
      val - the new value
    • getExtent

      public int getExtent()
      Returns the extent of the actual char array.
      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

      public boolean equals(Object obj)
      Returns if this Object is equal to another Object.
      Setzt außer Kraft:
      equals in Klasse Object
      Parameter:
      obj - the other Object
      Gibt zurück:
      if this Object is equal
      Siehe auch:
    • hashCode

      public int hashCode()
      Returns the hashCode of this Object.
      Setzt außer Kraft:
      hashCode in Klasse Object
      Gibt zurück:
      the hashCode
      Siehe auch:
    • toString

      public String toString()
      Returns a String representation of this Object.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a String
      Siehe auch:
    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Angegeben von:
      writeExternal in Schnittstelle Externalizable
      Löst aus:
      IOException
      Siehe auch:
    • readExternal

      public void readExternal(ObjectInput in) throws IOException
      Angegeben von:
      readExternal in Schnittstelle Externalizable
      Löst aus:
      IOException
      Siehe auch: