oscript.util
Class SymbolMap

java.lang.Object
  extended byoscript.util.SymbolMap

public class SymbolMap
extends java.lang.Object

This utility class provides a more Hashtable-like interface to SymbolTable, which normally maps a symbol to a table index.

Threading note: this class is not synchronized, but is designed to save to read from multiple threads, while write from a single thread context (at a time).

Version:
0.0
Author:
Rob Clark (rob@ti.com)
See Also:
SymbolTable

Constructor Summary
SymbolMap()
          Class Constructor
SymbolMap(SymbolTable table)
          Class Constructor
 
Method Summary
 java.lang.Object get(int id)
          Get a mapping
 java.util.Iterator keys()
          Return an iterator of keys into the table.
 java.lang.Object put(int id, java.lang.Object val)
          Put a new mapping in the table
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolMap

public SymbolMap()
Class Constructor


SymbolMap

public SymbolMap(SymbolTable table)
Class Constructor

Parameters:
table - the underlying table data structure
Method Detail

get

public final java.lang.Object get(int id)
Get a mapping


put

public final java.lang.Object put(int id,
                                  java.lang.Object val)
Put a new mapping in the table


keys

public java.util.Iterator keys()
Return an iterator of keys into the table. Each key is boxed in an Integer.