org.zmpp.vm
Interface Dictionary

All Known Implementing Classes:
DefaultDictionary

public interface Dictionary

This is the interface definition for a dictionary.

Version:
1.0
Author:
Wei-ju Wu

Method Summary
 int getEntryAddress(int entryNum)
          Returns the entry address at the specified position.
 int getEntryLength()
          Returns the length of a dictionary entry.
 int getNumberOfEntries()
          Returns the number of dictionary entries.
 int getNumberOfSeparators()
          Returns the number of separators.
 byte getSeparator(int i)
          Returns the separator at position i as a ZSCII character.
 int lookup(String token)
          Looks up a string in the dictionary.
 

Method Detail

getNumberOfSeparators

int getNumberOfSeparators()
Returns the number of separators.

Returns:
the number of separators

getSeparator

byte getSeparator(int i)
Returns the separator at position i as a ZSCII character.

Parameters:
i - the separator number, zero-based
Returns:
the separator

getEntryLength

int getEntryLength()
Returns the length of a dictionary entry.

Returns:
the entry length

getNumberOfEntries

int getNumberOfEntries()
Returns the number of dictionary entries.

Returns:
the number of entries

getEntryAddress

int getEntryAddress(int entryNum)
Returns the entry address at the specified position.

Parameters:
entryNum - entry number between (0 - getNumberOfEntries() - 1)
Returns:
the entry address

lookup

int lookup(String token)
Looks up a string in the dictionary. The word will be truncated to the maximum word length and looked up. The result is the address of the entry or 0 if it is not found.

Parameters:
token - a token
Returns:
the address of the token or 0


Copyright © 2005 . All Rights Reserved.