| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrac.ALRSRACFactory.LRSRAContainer<T>
protected class ALRSRACFactory.LRSRAContainer<T>
Implements a general-purpose restricted access container using an LRStruct. How? The next item to remove is always at the front of the list of contained objects. This is invariant! Insertion is, however, delegated to a strategy routine; and this strategy is provided to the container. This strategy varies to implement the desired kind of container, e.g., queue vs. stack. This inner class is protected so that classes derived from its factory can reuse it to create other kinds of restricted access container.
| Field Summary | |
|---|---|
| private  IAlgo<T,LRStruct<T>,T> | _insertStrategy | 
| private  LRStruct<T> | _lrs | 
| Constructor Summary | |
|---|---|
| ALRSRACFactory.LRSRAContainer(IAlgo<T,LRStruct<T>,T> strategy) | |
| Method Summary | ||
|---|---|---|
|  void | clear()Empty the container. | |
|  IList<T> | elements(IListFactory<T> fact)Return an immutable list of all elements in the container. | |
| 
 | execute(IRACVisitor<T,R,P> v,
               P... inp)Extensibility hook to accept a visitor algorithm. | |
|  T | get()Remove the next item from the container and return it. | |
|  boolean | isFull()Return TRUE if the container is full; otherwise, return FALSE. | |
|  T | peek()Return the next element in this IRAContainer withour removing it. | |
|  void | put(T input)Add an item to the container. | |
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
private IAlgo<T,LRStruct<T>,T> _insertStrategy
private LRStruct<T> _lrs
| Constructor Detail | 
|---|
public ALRSRACFactory.LRSRAContainer(IAlgo<T,LRStruct<T>,T> strategy)
| Method Detail | 
|---|
public void clear()
clear in interface IRAContainer<T>public boolean isFull()
isFull in interface IRAContainer<T>public IList<T> elements(IListFactory<T> fact)
elements in interface IRAContainer<T>fact - for manufacturing an IList.public T get()
get in interface IRAContainer<T>public void put(T input)
put in interface IRAContainer<T>input - the Object to be added to this IRAContainer.public T peek()
peek in interface IRAContainer<T>
public <R,P> R execute(IRACVisitor<T,R,P> v,
                       P... inp)
execute in interface IRAContainer<T>v - The visitor to executeinp - An arbitrary input parameter for the visitor
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||