fipaos.parser.acl.bitefficient
Class DecoderCodetable


public class DecoderCodetable

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
 intinsert(String s)
          Insert a new String to codetable.
 Stringlookup(int code)
          Returns the String to which the specified code is mapped in this codetable.

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

insert

public int insert(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

lookup

public 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.

Association Links

to Class fipaos.parser.acl.bitefficient.DecoderCodetable.Entry

dict Actual codetable