|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.Vector | +--org.isam.exehda.services.ctxm.ContextEventQueue
Implements a 'smart' queue (First-In First-Out) for storing context events. By smart we mean the policy of insertion of new events in the queue may be tunned according to the context semantics demand. For example, curretly events would either be appended or cause the oler events to be droped. In future, more advanced policies should also be implemented.
Nested Class Summary | |
static interface |
ContextEventQueue.QueuingPolicy
|
Field Summary |
Fields inherited from class java.util.Vector |
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
ContextEventQueue()
Creates a new ContextEventQueue instance with default APPEND
policy. |
|
ContextEventQueue(int policy)
Creates a new ContextEventQueue instance with the given event
insertion policy. |
Method Summary | |
boolean |
isEmpty()
Returns whether this queue is empty (size()==0) or not. |
ContextEvent |
pop()
Consumes the event in the queue's head, returning that element. |
void |
push(ContextEvent ev)
Appends a new event to the tail of the queue. |
int |
size()
Returns the number os events still in the queue. |
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, subList, toArray, toArray, toString, trimToSize |
Methods inherited from class java.util.AbstractList |
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
iterator, listIterator, listIterator |
Constructor Detail |
public ContextEventQueue()
ContextEventQueue
instance with default APPEND
policy.
public ContextEventQueue(int policy)
ContextEventQueue
instance with the given event
insertion policy.
policy
- an int
valueMethod Detail |
public void push(ContextEvent ev)
ev
- a ContextEvent
valuepublic ContextEvent pop()
public boolean isEmpty()
isEmpty
in interface java.util.List
isEmpty
in class java.util.Vector
public int size()
size
in interface java.util.List
size
in class java.util.Vector
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |