|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.zcu.fav.kiv.jsim.JSimLink
public class JSimLink
The JSimLink class is an equivalent of Simula's and C-Sim's LINK. It is supposed to encapsulate user data inserted into a queue (JSimHead). You can use the JSimLink class in two different ways:
Field Summary | |
---|---|
private java.lang.Object |
data
The wrapped data. |
protected java.lang.String |
dataType
The class name of the wrapped data. |
private double |
enterTime
The simulation time that this link entered its current queue. |
private static java.util.logging.Logger |
logger
Common logger for all instances of this class. |
private JSimHead |
myQueue
The queue that this link is currently inserted in. |
private JSimLink |
next
Reference to the next link in the queue. |
private JSimLink |
previous
Reference to the previous link in the queue. |
Constructor Summary | |
---|---|
JSimLink()
Creates a new JSimLink object (a queue item) containing no data. |
|
JSimLink(java.lang.Object object)
Creates a new JSimLink object (a queue item) containing user data. |
Method Summary | |
---|---|
void |
follow(JSimLink otherLink)
Inserts the link into a queue after another link. |
java.lang.Object |
getData()
Returns data wrapped by this link. |
java.lang.String |
getDataType()
Returns the type of data wrapped by this link. |
double |
getEnterTime()
Returns the simulation time when this link was inserted into its current queue. |
JSimLink |
getNext()
Returns the next link in the queue. |
JSimLink |
getPrevious()
Returns the previous link in the queue. |
JSimHead |
getQueue()
Returns the queue that this link is currently inserted in. |
void |
into(JSimHead queue)
Inserts the item into a queue. |
void |
out()
Removes the link from its queue. |
void |
precede(JSimLink otherLink)
Inserts the item into a queue before another item. |
protected void |
setNext(JSimLink nextLink)
Sets the next item in the queue. |
protected void |
setPrevious(JSimLink previousLink)
Sets the previous link in the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger logger
private JSimHead myQueue
private final java.lang.Object data
protected final java.lang.String dataType
private double enterTime
private JSimLink next
private JSimLink previous
Constructor Detail |
---|
public JSimLink(java.lang.Object object)
object
- The data that the queue item will contain.public JSimLink()
Method Detail |
---|
public final void into(JSimHead queue) throws JSimSecurityException
queue
- The queue the item is to be inserted to.
JSimSecurityException
- This exception is thrown out when the item is already inserted in a queue.public final void follow(JSimLink otherLink) throws JSimSecurityException
otherLink
- The link that will be followed by this link.
JSimSecurityException
- This exception is thrown out if the link is already inserted in a queue or the other link is null or not inserted in
any queue.public final void precede(JSimLink otherLink) throws JSimSecurityException
otherLink
- The link that will be preceded by this item.
JSimSecurityException
- This exception is thrown out if the link is already inserted in a queue or the other link is null or not inserted in
any queue.public final void out() throws JSimSecurityException
JSimSecurityException
- This exception is thrown out if the link is not inserted in a queue.public final JSimHead getQueue()
public final double getEnterTime()
public java.lang.Object getData()
public java.lang.String getDataType()
public final JSimLink getNext() throws JSimSecurityException
JSimSecurityException
- This exception is thrown out if the link is not inserted in a queue.public final JSimLink getPrevious() throws JSimSecurityException
JSimSecurityException
- This exception is thrown out if the link is not inserted in a queue.protected final void setNext(JSimLink nextLink)
nextLink
- The link that will follow this one.protected final void setPrevious(JSimLink previousLink)
previousLink
- The link that will precede this one.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |