cz.zcu.fav.kiv.jsim.hla
Class JSimHLARemoteHead

java.lang.Object
  extended bycz.zcu.fav.kiv.jsim.hla.JSimHLARemoteHead
All Implemented Interfaces:
JSimHLAHead

public class JSimHLARemoteHead
extends java.lang.Object
implements JSimHLAHead

JSimHLARemoteHead represents HLA remote object for JSimHead. Instance of JSimHead with the same name must exist in another federate. All methods of this class have the same function as methods defined in JSimHead.

Author:
Stanislav Kozina
See Also:
JSimHead

Field Summary
private  java.lang.String myName
          The name of the remote queue.
private  JSimHLASimulation myParent
          The simulation in which the queue is placed.
 
Constructor Summary
JSimHLARemoteHead(java.lang.String name, JSimHLASimulation parent)
          Creates a new HLA remote head.
 
Method Summary
 long cardinal()
          Returns the number of links in the queue.
 boolean empty()
          Tests whether the queue is empty.
 JSimLink first()
          Returns the first link in the queue.
 double getLw()
          Returns the mean length of the queue.
 java.lang.String getName()
          Returns the queue's name.
 double getTw()
          Returns the mean waiting time spent in the queue by all links already removed from the queue.
 double getTwForAllLinks()
          Returns the mean waiting time spent in the queue by all links ever inserted to the queue.
 JSimLink last()
          Returns the last link in the queue.
 void linkIntoRemoteHead(JSimLink link)
          Inserts link into HLA remote queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

private final java.lang.String myName
The name of the remote queue.


myParent

private JSimHLASimulation myParent
The simulation in which the queue is placed.

Constructor Detail

JSimHLARemoteHead

public JSimHLARemoteHead(java.lang.String name,
                         JSimHLASimulation parent)
                  throws JSimInvalidParametersException
Creates a new HLA remote head. Instance of JSimHead with the same name must exist in another federate.

Parameters:
name - Name of the remote head.
parent - Parent simulation.
Throws:
JSimInvalidParametersException - This exception is thrown out if no parent was specified.
Method Detail

getName

public java.lang.String getName()
Returns the queue's name.

Returns:
The queue's name.

empty

public boolean empty()
Tests whether the queue is empty.

Specified by:
empty in interface JSimHLAHead
Returns:
True if the queue is empty, false otherwise.

cardinal

public long cardinal()
Returns the number of links in the queue.

Specified by:
cardinal in interface JSimHLAHead
Returns:
The number of links in the queue.

first

public JSimLink first()
Returns the first link in the queue.

Specified by:
first in interface JSimHLAHead
Returns:
The first link in the queue if the queue is not empty, null otherwise.

last

public JSimLink last()
Returns the last link in the queue.

Specified by:
last in interface JSimHLAHead
Returns:
The last link in the queue if the queue is not empty, null otherwise.

getLw

public double getLw()
Returns the mean length of the queue.

Specified by:
getLw in interface JSimHLAHead
Returns:
The mean length of the queue or NaN.

getTw

public double getTw()
Returns the mean waiting time spent in the queue by all links already removed from the queue.

Specified by:
getTw in interface JSimHLAHead
Returns:
The mean waiting time spent in the queue by all links already removed from the queue or NaN.

getTwForAllLinks

public double getTwForAllLinks()
Returns the mean waiting time spent in the queue by all links ever inserted to the queue.

Specified by:
getTwForAllLinks in interface JSimHLAHead
Returns:
The mean waiting time spent in the queue by all links ever inserted to the queue or NaN.

linkIntoRemoteHead

public void linkIntoRemoteHead(JSimLink link)
                        throws JSimSecurityException
Inserts link into HLA remote queue. You should never call this method. Please use JSimLink.into(JSimHLARemoteHead queue), which can be used the same way as JSimLink.into(JSimHead queue).

Parameters:
link - Link to be inserted into HLA remote queue.
Throws:
JSimSecurityException