plp.expressions2.memory
Class StackHandler

java.lang.Object
  extended by plp.expressions2.memory.StackHandler

public class StackHandler
extends java.lang.Object

Author:
bldb, efas, jcbr, srmq This class performs some utility operations over a Stack

Method Summary
static java.lang.Object getFromId(java.util.Stack stack, Id id)
          Looks for the object whose Id is 'id' on the mappings that exist on the specified Stack.
static void mapIdObject(java.util.Stack stack, Id id, java.lang.Object object)
          Adds a mapping on the specified Stack
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFromId

public static java.lang.Object getFromId(java.util.Stack stack,
                                         Id id)
                                  throws IdentificadorNaoDeclaradoException
Looks for the object whose Id is 'id' on the mappings that exist on the specified Stack.

Parameters:
stack, - the Stack which contains the mappings (Id->Object)
id, - the Id of the desired object.
Returns:
an Object indexed by the Id
Throws:
IdentificadorNaoDeclaradoException - if there is not any object indexed by 'id'

mapIdObject

public static void mapIdObject(java.util.Stack stack,
                               Id id,
                               java.lang.Object object)
                        throws IdentificadorJaDeclaradoException
Adds a mapping on the specified Stack

Parameters:
stack, - the Stack which contains the mappings
id, - the Id that will index the new object
object, - the content that will be indexed
Throws:
VariavelJaDeclaradaException, - if 'id' is already used in an existing mapping
IdentificadorJaDeclaradoException