Main Page   Packages   Class Hierarchy   Compound List   File List   Compound Members  

NodeQueue Class Reference

List of all members.

Public Methods

 NodeQueue ()
boolean isEmpty ()
void put (Object packet)
Object get ()
Object peek ()

Private Attributes

Stack storage_buffer = new Stack()

Detailed Description

NodeQueue class implements simple packet storage buffer.

Definition at line 311 of file Node.java.


Constructor & Destructor Documentation

NodeQueue::NodeQueue ( ) [inline]
 

Default constructor.

Definition at line 320 of file Node.java.

00321     {
00322     }


Member Function Documentation

Object NodeQueue::get ( ) [inline]
 

Gets next element (packet) and removes it from the buffer. Generates exception if buffer is empty.

Returns:
Returns buffer element (packet).

Definition at line 350 of file Node.java.

Referenced by Node::transmitAll().

00351     {
00352         Object packet;
00353 
00354         packet = storage_buffer.pop();
00355         return packet;
00356     }

boolean NodeQueue::isEmpty ( ) [inline]
 

Test for empty buffer. Returns true if empty.

Returns:
Buffer status.

Definition at line 329 of file Node.java.

Referenced by Node::transmitAll().

00330     {
00331         return storage_buffer.isEmpty();
00332     }

Object NodeQueue::peek ( ) [inline]
 

Peeks at the first element.

Returns:
Returns first element.

Definition at line 363 of file Node.java.

00364     {
00365         return storage_buffer.peek();
00366     }

void NodeQueue::put ( Object packet ) [inline]
 

Puts one packet in the buffer.

Parameters:
packet   New element.

Definition at line 339 of file Node.java.

Referenced by Node::receive().

00340     {
00341         storage_buffer.push(packet);
00342     }


Member Data Documentation

Stack NodeQueue::storage_buffer = new Stack() [private]
 

Packet storage.

Definition at line 315 of file Node.java.


The documentation for this class was generated from the following file:
Generated at Thu Jun 28 03:04:23 2001 for Cyclops Network Simulator by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001