Spring for Apache Hadoop

org.springframework.yarn.listener
Class OrderedComposite<S>

java.lang.Object
  extended by org.springframework.yarn.listener.OrderedComposite<S>
Type Parameters:
S - the type of the item

public class OrderedComposite<S>
extends java.lang.Object

Composite item which can be used in other components which may want to allow automatic and annotation based ordering. Good use case is a list of listeners where user may want to place some of them to be processed before the others.

Author:
Janne Valkealahti

Constructor Summary
OrderedComposite()
           
 
Method Summary
 void add(S item)
          Register additional item.
 java.util.Iterator<S> iterator()
          Public getter for the list of items.
 java.util.Iterator<S> reverse()
          Public getter for the list of items in reverse.
 void setItems(java.util.List<? extends S> items)
          Public setter for the listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderedComposite

public OrderedComposite()
Method Detail

setItems

public void setItems(java.util.List<? extends S> items)
Public setter for the listeners.

Parameters:
items -

add

public void add(S item)
Register additional item.

Parameters:
item -

iterator

public java.util.Iterator<S> iterator()
Public getter for the list of items. The Ordered items come first, followed by any unordered ones.

Returns:
an iterator over the list of items

reverse

public java.util.Iterator<S> reverse()
Public getter for the list of items in reverse. The Ordered items come last, after any unordered ones.

Returns:
an iterator over the list of items

Spring for Apache Hadoop