psimjava
Class Squeue

java.lang.Object
  extended by psimjava.Squeue

public class Squeue
extends java.lang.Object

PsimJ Java package for Object Oriented simulation

Object-oriented simulation package, process interaction approach.

(C) J. M. Garrido. June 2000, 2003, 2004, 2007 Simple queue (FIFO) class for PsimJ.

Objects of this class are simple (FIFO) queues.


Constructor Summary
Squeue(java.lang.String a_name)
          Constructor for simple queue for initialicing queues with specified name.
Squeue(java.lang.String a_name, int max_objects)
          Constructor for initialicing objects of simple queues with a specified name and capacity (number of objects).
 
Method Summary
 void back(java.lang.Object p)
          Insert the specified object to the head of the queue.
 boolean empty()
          Check if queue is empty.
 boolean full()
          Check if the queue is full.
 java.lang.String get_name()
           
 void into(java.lang.Object p)
          Insert specified object to the tail of the queue.
 java.lang.Object last()
          Remove the last object enqueued (the one at the tail of queue).
 int length()
          Get current number of objects in queue (queue size)
 java.lang.Object out()
          Dequeue an object or process from the head of queue.
 void remov(java.lang.Object pr)
          Find and remove specified object or process from queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Squeue

public Squeue(java.lang.String a_name,
              int max_objects)
Constructor for initialicing objects of simple queues with a specified name and capacity (number of objects).

Parameters:
a_name - Title for the simple queue.
max_objects - Maximum number of objects (capacity of the queue).

Squeue

public Squeue(java.lang.String a_name)
Constructor for simple queue for initialicing queues with specified name. The default capacity is 1000 objects.

Parameters:
a_name - Title for the simple queue.
Method Detail

get_name

public java.lang.String get_name()

length

public int length()
Get current number of objects in queue (queue size)


full

public boolean full()
Check if the queue is full.


empty

public boolean empty()
Check if queue is empty.


into

public void into(java.lang.Object p)
Insert specified object to the tail of the queue.

Parameters:
p - Object (or process) to enqueue.

back

public void back(java.lang.Object p)
Insert the specified object to the head of the queue.

Parameters:
p - Object (or process) to insert into the queue.

out

public java.lang.Object out()
Dequeue an object or process from the head of queue.


last

public java.lang.Object last()
Remove the last object enqueued (the one at the tail of queue).


remov

public void remov(java.lang.Object pr)
Find and remove specified object or process from queue.