de.dante.extex.font.type.tfm
Class TFMIndexMultimap

java.lang.Object
  extended byde.dante.extex.font.type.tfm.TFMIndexMultimap
All Implemented Interfaces:
java.io.Serializable

public class TFMIndexMultimap
extends java.lang.Object
implements java.io.Serializable

TFMIndexMultimap can store and retrieve int values associated to particular int key. There can be more values associated to the same key. TFtoPL[63]

Version:
$Revision: 1.3 $
Author:
Michael Niedermair
See Also:
Serialized Form

Nested Class Summary
 class TFMIndexMultimap.Enum
          Class Enum provides the sequence of all values associated to particular key.
 
Constructor Summary
TFMIndexMultimap()
          Create a new object
 
Method Summary
 void add(int key, int val)
          Adds a new (key, value) pair.
 TFMKeyInt at(int i)
          (key, value) pair at given position.
 TFMIndexMultimap.Enum forKey(int key)
          Gives the sequence of all keys associated to the given key.
 void insert(TFMKeyInt p, int i)
          Insert a (key, value) pair at the given position.
 int search(int key)
          Gives the position where a (key, value) pair with given key is stored or where it should be stored if there is no such pair.
 int size()
          The number of (key, value) pairs kept.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TFMIndexMultimap

public TFMIndexMultimap()
Create a new object

Method Detail

size

public int size()
The number of (key, value) pairs kept.

Returns:
Returns the number of stored pairs.

at

public TFMKeyInt at(int i)
(key, value) pair at given position.

Parameters:
i - the position of pair to be examined.
Returns:
Return the pair at given position.

insert

public void insert(TFMKeyInt p,
                   int i)
Insert a (key, value) pair at the given position.

Parameters:
p - the pair to be inserted.
i - the position to be inserted to.

search

public int search(int key)
Gives the position where a (key, value) pair with given key is stored or where it should be stored if there is no such pair.

Parameters:
key - the key searched for.
Returns:
Return the position.

add

public void add(int key,
                int val)
Adds a new (key, value) pair.

Parameters:
key - the key of the new pair.
val - the value of the new pair.

forKey

public TFMIndexMultimap.Enum forKey(int key)
Gives the sequence of all keys associated to the given key.

Parameters:
key - the given key.
Returns:
Return the object representing the sequence of associated values.