com.espertech.esper.collection
Class OneEventCollection

java.lang.Object
  extended by com.espertech.esper.collection.OneEventCollection

public class OneEventCollection
extends Object

Simple collection that exposes a limited add-and-get interface and that is optimized towards holding a single event, but can hold multiple events. If more then one event is added, the class allocates a linked list for additional events.


Constructor Summary
OneEventCollection()
           
 
Method Summary
 void add(EventBean event)
          Add an event to the collection.
 boolean isEmpty()
          Returns true if the collection is empty.
 EventBean[] toArray()
          Returns an array holding the collected events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneEventCollection

public OneEventCollection()
Method Detail

add

public void add(EventBean event)
Add an event to the collection.

Parameters:
event - is the event to add

isEmpty

public boolean isEmpty()
Returns true if the collection is empty.

Returns:
true if empty, false if not

toArray

public EventBean[] toArray()
Returns an array holding the collected events.

Returns:
event array

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com