fipaos.parser.acl.bitefficient
Class EncoderCodetable

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

public class EncoderCodetable
extends java.lang.Object

Implementation of codetable for fipa-bitefficient-std.

Author:
Heikki Helin, Mikko Laukkanen

Constructor Summary
EncoderCodetable(int sz)
          Initialize the code table with given size.
 
Method Summary
 int insert(java.lang.String s)
          Inserts a string to codetable.
 int lookup(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncoderCodetable

public EncoderCodetable(int sz)
Initialize the code table 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(java.lang.String s)
Inserts a string to codetable. If the string is already in code table, its code is returned, and the string is moved to the end of LRU list.
Parameters:
s - String to insert
Returns:
Code number for string.

lookup

public int lookup(java.lang.String s)
Parameters:
s - The string to lookup
Returns:
The code number for the string if found, -1 otherwise