fipaos.parser.acl.bitefficient
Class DecoderCodetable

java.lang.Object
  |
  +--fipaos.parser.acl.bitefficient.DecoderCodetable

public class DecoderCodetable
extends java.lang.Object

Implementation of decoder codetable for fipa-bitefficient-std messages

Author:
Heikki Helin, Mikko Laukkanen

Constructor Summary
DecoderCodetable(int sz)
          Initialize the codetable with given size.
 
Method Summary
 int insert(java.lang.String s)
          Insert a new String to codetable.
 java.lang.String lookup(int code)
          Returns the String to which the specified code is mapped in this codetable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoderCodetable

public DecoderCodetable(int sz)
Initialize the codetable with given size.
Parameters:
sz - Size of the codetable in bits. According to FIPA specs, this shall be a number between 8 and 16.
Method Detail

lookup

public java.lang.String lookup(int code)
Returns the String to which the specified code is mapped in this codetable. The entry in the codetable is moved to the end of LRU list.
Parameters:
code - The code to lookup
Returns:
The String to which the code is mapped in this codetable; null if the code is not mapped to any String in this hashtable.

insert

public int insert(java.lang.String s)
Insert a new String to codetable. If the code table is full, (size>>3) entries are removed from the end of LRU list.
Parameters:
s - String to insert