java.lang.Object
de.grogra.xl.impl.queues.QueueCollection
A
QueueCollection
represents a set of
Queue
s in the context of a
Graph
.
For the base implementation of the XL interfaces, it is obtained
at run-time by the invocation of
Graph.getQueues()
.
Queues are added to this collection by invocation of
getQueue(QueueDescriptor)
.
- Author:
- Ole Kniemeyer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
Clears all queues of this collection.getGraph()
getModel()
<Q extends Queue>
QgetQueue
(QueueDescriptor<Q> descr) Registers and returns a queue for the given descriptor.void
boolean
process
(int[] segments) Processes the queues of this collection by invokingQueue.process(int[])
for every queue.void
resetToSegment
(int n) int
-
Constructor Details
-
QueueCollection
-
-
Method Details
-
getGraph
- Returns:
- the
Graph
of this queue collection
-
getModel
- Returns:
- the
RuntimeModel
of the graph of this queue collection
-
clear
public void clear()Clears all queues of this collection. -
process
Processes the queues of this collection by invokingQueue.process(int[])
for every queue. All queues which have been registered bygetQueue(QueueDescriptor)
are processed. The order of processing is defined by theQueueDescriptor
s of the queues: Ifq
andr
are two queues having descriptorsQ
andR
, thenq.process(segments)
may be invoked beforer.process(segments)
only if Q is not contained inR.queuesToProcessAfter()
and R is not contained inQ.queuesToProcessBefore()
. After all queues have been processed, this method clears the queues.- Returns:
true
iff at least one invocation of theprocess
method on a queue has returnedtrue
.- Throws:
RuntimeModelException
- if the processing of a queue throws such an exception, or if there is a circularity in the processing order
-
getQueues
-
getQueue
Registers and returns a queue for the given descriptor. If this method has been invoked before with the same descriptor, the previously returned queue is returned again. Otherwise, a new queue is created by the invocation ofQueueDescriptor.createQueue(QueueCollection)
ondescr
, registered with this queue collection, and returned.- Parameters:
descr
- the descriptor of the queue- Returns:
- a queue corresponding to the descriptor
-
addQueue
-
startNewSegment
public int startNewSegment() -
resetToSegment
public void resetToSegment(int n)
-