Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.layer.vpf
Class RunQueue

    java.lang.Object
      java.lang.Thread
          com.bbn.openmap.layer.vpf.RunQueue

All Implemented Interfaces:
  java.lang.Runnable

public class RunQueue
extends java.lang.Thread

Implement a very basic thread scheduling mechanism. TerminatingRunnable objects get added to the queue. As the thread gets cpu time, it will sequentially dequeue and run the objects in the queue in a LIFO order. Duplicates are allowed in the queue. Run will get called exactly once for each enqueue call. Only one thread will run at a time. (The next object won't run until the previous one completes.)

See Also:
  `Runnable.run()`

Field Summary

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`RunQueue()` default constructor.
`RunQueue(boolean isDaemon, int priority, boolean autoStart)` construct a thread in the default ThreadGroup with a few options set
`RunQueue(java.lang.ThreadGroup tg)` construct this thread in a particular ThreadGroup
`RunQueue(java.lang.ThreadGroup tg, boolean isDaemon, int priority, boolean autoStart)` construct a thread in the default ThreadGroup with a few options set

Method Summary
`void` | `enqueue(TerminatingRunnable r)` Add an object to the queue of threads to run
`void` | `run()` start going.

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### RunQueue

    public RunQueue()

  default constructor. priority and daemon status inherited from the calling thread. This thread is NOT started

### RunQueue

    public RunQueue(java.lang.ThreadGroup tg)

  construct this thread in a particular ThreadGroup

Parameters:
  `tg` - the ThreadGroup to be in. `null` means the current ThreadGroup

### RunQueue

    public RunQueue(boolean isDaemon,
                    int priority,
                    boolean autoStart)

  construct a thread in the default ThreadGroup with a few options set

Parameters:
  `isDaemon` - `true` means be a daemon thread, `false` means don't.
  `priority` - the value to use when calling setPriority
  `autoStart` - `true` means call this.start()
See Also:
  `Thread.start()`

### RunQueue

    public RunQueue(java.lang.ThreadGroup tg,
                    boolean isDaemon,
                    int priority,
                    boolean autoStart)

  construct a thread in the default ThreadGroup with a few options set

Parameters:
  `tg` - the ThreadGroup to be in
  `isDaemon` - `true` means be a daemon thread, `false` means don't.
  `priority` - the value to use when calling setPriority
  `autoStart` - `true` means call this.start()
See Also:
  `Thread.start()`

Method Detail

### run

    public void run()

  start going. This function locks the queue, dequeues and item, unlocks the queue, and calls run on the object that was dequeued. if no object was on the queue, it waits on the queue. this function never exits.

### enqueue

    public void enqueue(TerminatingRunnable r)

  Add an object to the queue of threads to run

  Parameters:
    `r` - the object to add

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details