ch.sahits.codegen
Enum ActionQueue

java.lang.Object
  extended by java.lang.Enum<ActionQueue>
      extended by ch.sahits.codegen.ActionQueue
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ActionQueue>, java.lang.Iterable<QueuedActionElement>, java.util.Collection<QueuedActionElement>, java.util.List<QueuedActionElement>, java.util.Queue<QueuedActionElement>

public enum ActionQueue
extends java.lang.Enum<ActionQueue>
implements java.util.Queue<QueuedActionElement>, java.util.List<QueuedActionElement>

This is a Singleton Queue of QueuedActionElement

Since:
1.2.0
Author:
Andi Hotz, Sahits GmbH

Enum Constant Summary
INSTANCE
          Singleton instance of the queue
 
Method Summary
 void add(int index, QueuedActionElement element)
           
 boolean add(QueuedActionElement e)
           
 boolean addAll(java.util.Collection<? extends QueuedActionElement> c)
           
 boolean addAll(int index, java.util.Collection<? extends QueuedActionElement> c)
           
 void addFirst(QueuedActionElement e)
           
 void addLast(QueuedActionElement e)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 java.util.Iterator<QueuedActionElement> descendingIterator()
           
 QueuedActionElement element()
           
 QueuedActionElement get(int index)
           
 QueuedActionElement getFirst()
           
 QueuedActionElement getLast()
           
 java.util.List<QueuedActionElement> getQueuedElements(java.lang.String className)
          Retrieve a list of elements that can be processed by the specified class
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 boolean isQueueProcessed()
          Check whether the queue is processed.
 java.util.Iterator<QueuedActionElement> iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator<QueuedActionElement> listIterator()
           
 java.util.ListIterator<QueuedActionElement> listIterator(int index)
           
 boolean offer(QueuedActionElement e)
           
 boolean offerFirst(QueuedActionElement e)
           
 boolean offerLast(QueuedActionElement e)
           
 QueuedActionElement peek()
           
 QueuedActionElement peekFirst()
           
 QueuedActionElement peekLast()
           
 QueuedActionElement poll()
           
 QueuedActionElement pollFirst()
           
 QueuedActionElement pollLast()
           
 QueuedActionElement pop()
           
 void push(QueuedActionElement e)
           
 QueuedActionElement remove()
           
 QueuedActionElement remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 QueuedActionElement removeFirst()
           
 boolean removeFirstOccurrence(java.lang.Object o)
           
 QueuedActionElement removeLast()
           
 boolean removeLastOccurrence(java.lang.Object o)
           
 boolean retainAll(java.util.Collection<?> c)
           
 QueuedActionElement set(int index, QueuedActionElement element)
           
 int size()
           
 java.util.List<QueuedActionElement> subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 java.lang.String toString()
           
static ActionQueue valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ActionQueue[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Enum Constant Detail

INSTANCE

public static final ActionQueue INSTANCE
Singleton instance of the queue

Method Detail

values

public static ActionQueue[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ActionQueue c : ActionQueue.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ActionQueue valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getQueuedElements

public java.util.List<QueuedActionElement> getQueuedElements(java.lang.String className)
Retrieve a list of elements that can be processed by the specified class

Parameters:
className - name of the class that does the processing
Returns:
list of elements

isQueueProcessed

public boolean isQueueProcessed()
Check whether the queue is processed. The queue is processed if it is empty or every element of the queue is processed

Returns:
true if all elements are processed

add

public void add(int index,
                QueuedActionElement element)
Specified by:
add in interface java.util.List<QueuedActionElement>
Parameters:
index -
element -
See Also:
LinkedList.add(int, java.lang.Object)

add

public boolean add(QueuedActionElement e)
Specified by:
add in interface java.util.Collection<QueuedActionElement>
Specified by:
add in interface java.util.List<QueuedActionElement>
Specified by:
add in interface java.util.Queue<QueuedActionElement>
Parameters:
e - Element to add
Returns:
true if the element could be added
See Also:
LinkedList.add(java.lang.Object)

addAll

public boolean addAll(java.util.Collection<? extends QueuedActionElement> c)
Specified by:
addAll in interface java.util.Collection<QueuedActionElement>
Specified by:
addAll in interface java.util.List<QueuedActionElement>
Parameters:
c - Collection to Add
Returns:
true if the collection could be added
See Also:
LinkedList.addAll(java.util.Collection)

addAll

public boolean addAll(int index,
                      java.util.Collection<? extends QueuedActionElement> c)
Specified by:
addAll in interface java.util.List<QueuedActionElement>
Parameters:
index - where to insert the collection
c - Collection to Add
Returns:
true if the collection could be added
See Also:
LinkedList.addAll(int, java.util.Collection)

addFirst

public void addFirst(QueuedActionElement e)
Parameters:
e -
See Also:
LinkedList.addFirst(java.lang.Object)

addLast

public void addLast(QueuedActionElement e)
Parameters:
e -
See Also:
LinkedList.addLast(java.lang.Object)

clear

public void clear()
Specified by:
clear in interface java.util.Collection<QueuedActionElement>
Specified by:
clear in interface java.util.List<QueuedActionElement>
See Also:
LinkedList.clear()

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<QueuedActionElement>
Specified by:
contains in interface java.util.List<QueuedActionElement>
Parameters:
o - element whose presence in this list is to be tested
Returns:
true if this list contains the specified element
See Also:
LinkedList.contains(java.lang.Object)

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<QueuedActionElement>
Specified by:
containsAll in interface java.util.List<QueuedActionElement>
Parameters:
c - collection to be checked for containment in this collection
Returns:
true if this collection contains all of the elements in the specified collection
See Also:
AbstractCollection.containsAll(java.util.Collection)

descendingIterator

public java.util.Iterator<QueuedActionElement> descendingIterator()
Returns:
an iterator over the elements in this deque in reverse sequence
See Also:
LinkedList.descendingIterator()

element

public QueuedActionElement element()
Specified by:
element in interface java.util.Queue<QueuedActionElement>
Returns:
the head of this list
See Also:
LinkedList.element()

get

public QueuedActionElement get(int index)
Specified by:
get in interface java.util.List<QueuedActionElement>
Parameters:
index - index of the element to return
Returns:
the element at the specified position in this list
See Also:
LinkedList.get(int)

getFirst

public QueuedActionElement getFirst()
Returns:
the first element in this list
See Also:
LinkedList.getFirst()

getLast

public QueuedActionElement getLast()
Returns:
the last element in this list
See Also:
LinkedList.getLast()

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List<QueuedActionElement>
Parameters:
o - element to search for
Returns:
the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element
See Also:
LinkedList.indexOf(java.lang.Object)

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<QueuedActionElement>
Specified by:
isEmpty in interface java.util.List<QueuedActionElement>
Returns:
true if this collection contains no elements
See Also:
AbstractCollection.isEmpty()

iterator

public java.util.Iterator<QueuedActionElement> iterator()
Specified by:
iterator in interface java.lang.Iterable<QueuedActionElement>
Specified by:
iterator in interface java.util.Collection<QueuedActionElement>
Specified by:
iterator in interface java.util.List<QueuedActionElement>
Returns:
an iterator over the elements in this list (in proper sequence)
See Also:
AbstractSequentialList.iterator()

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List<QueuedActionElement>
Parameters:
o - element to search for
Returns:
the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element
See Also:
LinkedList.lastIndexOf(java.lang.Object)

listIterator

public java.util.ListIterator<QueuedActionElement> listIterator()
Specified by:
listIterator in interface java.util.List<QueuedActionElement>
Returns:
a list iterator over the elements in this list (in proper sequence)
See Also:
AbstractList.listIterator()

listIterator

public java.util.ListIterator<QueuedActionElement> listIterator(int index)
Specified by:
listIterator in interface java.util.List<QueuedActionElement>
Parameters:
index - index of the first element to be returned from the list-iterator (by a call to next)
Returns:
a ListIterator of the elements in this list (in proper sequence), starting at the specified position in the list
See Also:
LinkedList.listIterator(int)

offer

public boolean offer(QueuedActionElement e)
Specified by:
offer in interface java.util.Queue<QueuedActionElement>
Parameters:
e - the element to add
Returns:
true (as specified by Queue.offer(Object))
See Also:
LinkedList.offer(java.lang.Object)

offerFirst

public boolean offerFirst(QueuedActionElement e)
Parameters:
e - the element to insert
Returns:
true (as specified by Deque.offerFirst)
See Also:
LinkedList.offerFirst(java.lang.Object)

offerLast

public boolean offerLast(QueuedActionElement e)
Parameters:
e - the element to insert
Returns:
true (as specified by Deque.offerLast)
See Also:
LinkedList.offerLast(java.lang.Object)

peek

public QueuedActionElement peek()
Specified by:
peek in interface java.util.Queue<QueuedActionElement>
Returns:
the head of this list, or null if this list is empty
See Also:
LinkedList.peek()

peekFirst

public QueuedActionElement peekFirst()
Returns:
the first element of this list, or null if this list is empty
See Also:
LinkedList.peekFirst()

peekLast

public QueuedActionElement peekLast()
Returns:
the last element of this list, or null if this list is empty
See Also:
LinkedList.peekLast()

poll

public QueuedActionElement poll()
Specified by:
poll in interface java.util.Queue<QueuedActionElement>
Returns:
the head of this list, or null if this list is empty
See Also:
LinkedList.poll()

pollFirst

public QueuedActionElement pollFirst()
Returns:
the first element of this list, or null if this list is empty
See Also:
LinkedList.pollFirst()

pollLast

public QueuedActionElement pollLast()
Returns:
the last element of this list, or null if this list is empty
See Also:
LinkedList.pollLast()

pop

public QueuedActionElement pop()
Returns:
the element at the front of this list (which is the top of the stack represented by this list)
See Also:
LinkedList.pop()

push

public void push(QueuedActionElement e)
Parameters:
e - the element to push
See Also:
LinkedList.push(java.lang.Object)

remove

public QueuedActionElement remove()
Specified by:
remove in interface java.util.Queue<QueuedActionElement>
Returns:
the head of this list
See Also:
LinkedList.remove()

remove

public QueuedActionElement remove(int index)
Specified by:
remove in interface java.util.List<QueuedActionElement>
Parameters:
index - the index of the element to be removed
Returns:
the element previously at the specified position
See Also:
LinkedList.remove(int)

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<QueuedActionElement>
Specified by:
remove in interface java.util.List<QueuedActionElement>
Parameters:
o - element to be removed from this list, if present
Returns:
true if this list contained the specified element
See Also:
LinkedList.remove(java.lang.Object)

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<QueuedActionElement>
Specified by:
removeAll in interface java.util.List<QueuedActionElement>
Parameters:
c - collection containing elements to be removed from this collection
Returns:
true if this collection changed as a result of the call
See Also:
AbstractCollection.removeAll(java.util.Collection)

removeFirst

public QueuedActionElement removeFirst()
Returns:
the first element from this list
See Also:
LinkedList.removeFirst()

removeFirstOccurrence

public boolean removeFirstOccurrence(java.lang.Object o)
Parameters:
o - element to be removed from this list, if present
Returns:
true if the list contained the specified element
See Also:
LinkedList.removeFirstOccurrence(java.lang.Object)

removeLast

public QueuedActionElement removeLast()
Returns:
the last element from this list
See Also:
LinkedList.removeLast()

removeLastOccurrence

public boolean removeLastOccurrence(java.lang.Object o)
Parameters:
o - element to be removed from this list, if present
Returns:
true if the list contained the specified element
See Also:
LinkedList.removeLastOccurrence(java.lang.Object)

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<QueuedActionElement>
Specified by:
retainAll in interface java.util.List<QueuedActionElement>
Parameters:
c - collection containing elements to be retained in this collection
Returns:
true if this collection changed as a result of the call
See Also:
AbstractCollection.retainAll(java.util.Collection)

set

public QueuedActionElement set(int index,
                               QueuedActionElement element)
Specified by:
set in interface java.util.List<QueuedActionElement>
Parameters:
index - index of the element to replace
element - element to be stored at the specified position
Returns:
the element previously at the specified position
See Also:
LinkedList.set(int, java.lang.Object)

size

public int size()
Specified by:
size in interface java.util.Collection<QueuedActionElement>
Specified by:
size in interface java.util.List<QueuedActionElement>
Returns:
the number of elements in this list
See Also:
LinkedList.size()

subList

public java.util.List<QueuedActionElement> subList(int fromIndex,
                                                   int toIndex)
Specified by:
subList in interface java.util.List<QueuedActionElement>
Parameters:
fromIndex - low endpoint (inclusive) of the subList
toIndex - high endpoint (exclusive) of the subList
Returns:
a view of the specified range within this list
See Also:
AbstractList.subList(int, int)

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<QueuedActionElement>
Specified by:
toArray in interface java.util.List<QueuedActionElement>
Returns:
an array containing all of the elements in this list in proper sequence
See Also:
LinkedList.toArray()

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<QueuedActionElement>
Specified by:
toArray in interface java.util.List<QueuedActionElement>
Type Parameters:
T -
Parameters:
a - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the list
See Also:
java.util.LinkedList#toArray(T[])

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<ActionQueue>
Returns:
a string representation of this collection
See Also:
AbstractCollection.toString()