ch.sahits.codegen
Class QueuedActionElement

java.lang.Object
  extended by ch.sahits.codegen.QueuedActionElement

public final class QueuedActionElement
extends java.lang.Object

This class represents an element object of the ActionQueue. Each element has its Runnable action to be processed and a designated class that that initiates the processing. An Element has two states:

Since:
1.2.0
Author:
Andi Hotz, Sahits GmbH

Constructor Summary
QueuedActionElement(java.lang.String prozessingClass, java.lang.Runnable action)
          Constructor initializing the elements
 
Method Summary
 java.lang.String getProzessingClass()
          Retrieve the name of the processing class
 boolean is2Bprocessed()
          Check if the element is to be processed.
 void process()
          Execute the run method of the Runnable action if the action is allowed to be processed and is not already processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueuedActionElement

public QueuedActionElement(java.lang.String prozessingClass,
                           java.lang.Runnable action)
Constructor initializing the elements

Parameters:
prozessingClass - class on which the element to be processed
action - to be run
Method Detail

is2Bprocessed

public boolean is2Bprocessed()
Check if the element is to be processed. The element is to be processed if the first class on the call stack is the class designated by prozessingClass

Returns:
true if the first class on the call stack that is not this class is equals to prozessingClass

process

public void process()
Execute the run method of the Runnable action if the action is allowed to be processed and is not already processed.

See Also:
is2Bprocessed()

getProzessingClass

public java.lang.String getProzessingClass()
Retrieve the name of the processing class

Returns:
the prozessingClass