Class QueueCollection

java.lang.Object
All Implemented Interfaces:
Composable, Playable, java.lang.Runnable

public class QueueCollection
extends ParallelCollection
A QueueCollection launches each of its Composable children in sequence. As each child is played, it is removed from the queue. The number of children removed from the queue is the value specified using setRepeats(). More children can be added to the queue while it is running. The last Composable in the queue will be played repeatedly when the queue becomes empty. To make the QueueCollection stop when the queue becomes empty, call add(null) after the last child is added.
  • Constructor Details

    • QueueCollection

      public QueueCollection()
      Simple constructor. Builds a QueueCollection with no children, and initializes its Behavior to UniformRandomBehavior (although it defaults to queue behavior). Use add(Composable) to add children.
    • QueueCollection

      public QueueCollection​(Composable child1)
      Conveniant constructor which automatically adds one Composable child to the queue hierarchy.
    • QueueCollection

      public QueueCollection​(Composable child1, Composable child2)
      Conveniant constructor which automatically adds two Composable children to the queue hierarchy.
    • QueueCollection

      public QueueCollection​(Composable child1, Composable child2, Composable child3)
      Conveniant constructor which automatically adds three Composable children to the queue hierarchy.
    • QueueCollection

      public QueueCollection​(Composable child1, Composable child2, Composable child3, Composable child4)
      Conveniant constructor which automatically adds four Composable children to the queue hierarchy.
  • Method Details

    • internalRepeat

      public double internalRepeat​(double playTime) throws java.lang.InterruptedException
      Play next child in sequence.
      Specified by:
      internalRepeat in interface Composable
      Overrides:
      internalRepeat in class ParallelCollection
      Returns:
      time of completion
      Throws:
      java.lang.InterruptedException - if the thread running this Composable is interrupted.
    • main

      public static void main​(java.lang.String[] args)