tauZaman
v0.1

tauzaman.property
Class PropertyStackService

java.lang.Object
  |
  +--tauzaman.property.PropertyStackService

public class PropertyStackService
extends java.lang.Object

PropertyStackService class implements data structures to store properties and provides service to PropertyManager.

See Also:
PropertyManager
Status:
design complete, implementation complete

Field Summary
private  java.util.Stack[] propertyStackList
          Property Stack List
private  java.util.Hashtable propertyStackMap
          Property Stack Hash table, provides efficient indexing of stacks
 
Constructor Summary
PropertyStackService()
          Constructs a PropertyStackService object, which provides stack operations for Property.
 
Method Summary
private  java.util.Stack getStack(java.lang.String propertyName)
          Returns the index of Property given its key, that is to say its name.
 void initStackMap()
          Initialize the hash table.
 Property peek(java.lang.String propertyName)
          Gets and returns the top element (Property) of the stack (without removing it).
 java.util.Enumeration peekAll(java.lang.String propertyName)
          Returns all elements of a given stack
 void pop()
          Pops all active Propertyies from their stacks, except default ones, which are the last elements in stacks.Does not deactivates default Property.
 void pop(java.lang.String propertyName)
          Pops the corresponding active Property from its stack.
 void popToLast()
          Pop all elements from their stack until the last elements, which are the default properties.
 void popToLast(java.lang.String propertyName)
          Pops all elements from given property stack until the last elements, which are the default properties.
 void push(Property property)
          Pushes a Property to its stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyStackList

private java.util.Stack[] propertyStackList
Property Stack List


propertyStackMap

private java.util.Hashtable propertyStackMap
Property Stack Hash table, provides efficient indexing of stacks

Constructor Detail

PropertyStackService

public PropertyStackService()
Constructs a PropertyStackService object, which provides stack operations for Property.

Method Detail

initStackMap

public void initStackMap()
Initialize the hash table. This might also be done by PropertyManager, by providing a string[] of property names, however, there are this many properties after all. Each key is the name of the property and correspinding value is the corresponding index in the property StackList


getStack

private java.util.Stack getStack(java.lang.String propertyName)
Returns the index of Property given its key, that is to say its name.

Parameters:
propertyName - name of a Property
Returns:
stack, which corresponds to first parameter, propertyName, in stack list

push

public void push(Property property)
Pushes a Property to its stack.

Parameters:
property - a Property

pop

public void pop(java.lang.String propertyName)
Pops the corresponding active Property from its stack. Does not deactivates default Property.

Parameters:
propertyName - name of a Property

pop

public void pop()
Pops all active Propertyies from their stacks, except default ones, which are the last elements in stacks.Does not deactivates default Property.


popToLast

public void popToLast(java.lang.String propertyName)
Pops all elements from given property stack until the last elements, which are the default properties.

Parameters:
propertyName - name of a Property

popToLast

public void popToLast()
Pop all elements from their stack until the last elements, which are the default properties.


peek

public Property peek(java.lang.String propertyName)
Gets and returns the top element (Property) of the stack (without removing it). If there is no Property, it returns null.

Parameters:
propertyName - name of a Property
Returns:
a Property

peekAll

public java.util.Enumeration peekAll(java.lang.String propertyName)
Returns all elements of a given stack

Parameters:
propertyName - name of a Property
Returns:
an Enumeration containing all Elements of a stack

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project