|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sdedit.diagram.Lifeline
public final class Lifeline
For each object or actor that appears in a diagram and that has not yet been destroyed, there is at least one Lifeline object. It is active (see isActive()) if the corresponding object or actor can currently send a message. For objects, being active is implied by having received a message to which no answer has yet been sent. When an object that has already received a message to which it has not yet answered, receives another message, a new Lifeline object is created and associated to the original (or "root") Lifeline object.
| Constructor Summary | |
|---|---|
Lifeline(String name,
String type,
String label,
boolean alive,
boolean anonymous,
boolean role,
boolean activeObject,
boolean process,
boolean hasThread,
boolean autodestroy,
boolean external,
Diagram diagram)
Creates a new root Lifeline object that corresponds to an object and is ready to receive messages. |
|
| Method Summary | |
|---|---|
Lifeline |
addActivity(Lifeline caller,
int thread)
|
void |
addView(ExtensibleDrawable view)
|
void |
destroy()
|
void |
dispose()
Disposes this lifeline, which means that it is taken from the stack of the main lifeline it belongs to. |
void |
finish()
This method is called when a message was read and the control flow returns to an object that has been called before the object corresponding to this lifeline was called. |
LinkedList<Lifeline> |
getAllLifelines()
Returns a list containing this lifeline and all of its sub lifelines. |
List<ExtensibleDrawable> |
getAllViews()
|
int |
getCallLevel()
|
Cross |
getCross()
|
Diagram |
getDiagram()
|
Direction |
getDirection()
Returns Direction.CENTER, if this is a lifeline, Direction.LEFT, if this is a dependent lifeline that has been activated by a message from an object with a lower position, otherwise Direction.RIGHT |
Drawable |
getHead()
|
Lifeline |
getLastInThread(int thread)
|
Lifeline |
getLeftmost()
|
Lifeline |
getLeftNeighbour()
If this is a root or sub lifeline that belongs to the object which is displayed leftmost, this method returns null, otherwise it returns (with respect to the current state of activities) the rightmost lifeline belonging to the object that is displayed to the left of the object to which this lifeline belongs. |
String |
getMnemonic()
|
String |
getName()
|
int |
getPosition()
Returns this lifeline's object's position in the object section where it is declared. |
Lifeline |
getRightmost()
|
Lifeline |
getRightNeighbour()
If this is a root or sub lifeline that belongs to the object which is displayed rightmost, this method returns null, otherwise it returns (with respect to the current state of activities) the leftmost lifeline belonging to the object that is displayed to the right of the object to which this lifeline belongs. |
Lifeline |
getRoot()
Returns the main or root lifeline that represents the first activity of the object to which this lifeline belongs. |
int |
getSideLevel()
Returns 0, if this is a root lifeline; if it is a sub lifeline, returns the number of sub lifelines that have the same direction like this one. |
int |
getThread()
|
String |
getType()
|
int |
getUniqueThread()
If all activities that correspond to this lifeline, its root and its root's descendants belong to the same unique thread, the number of this thread is returned, otherwise -1 |
ExtensibleDrawable |
getView()
|
void |
giveBirth()
Call this method when an object is created via a 'new' message. |
boolean |
hasThread()
|
boolean |
isActive()
|
boolean |
isActiveObject()
|
boolean |
isAlive()
Returns a flag denoting whether the object is visible and ready to receive a message (true) or still waiting for a 'new' message. |
boolean |
isAlwaysActive()
|
boolean |
isExternal()
|
boolean |
isWaiting()
|
void |
setActive(boolean active)
|
void |
setMnemonic(String mnemnonic)
|
void |
setRectangleBottom(int bottom)
|
void |
setThread(int thread)
|
void |
terminate()
|
void |
toggleWaitingStatus()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Lifeline(String name,
String type,
String label,
boolean alive,
boolean anonymous,
boolean role,
boolean activeObject,
boolean process,
boolean hasThread,
boolean autodestroy,
boolean external,
Diagram diagram)
name - the name of the objecttype - the type of the objectlabel - the label of the lifeline, if it is the empty string, the
label depends on the name and typealive - flag denoting whether the object is visible from the start (true)
or it will come into existence by receiving a new messageanonymous - flag denoting whether the name of the instance will be shown
on the diagramrole - flag denoting whether the object is a role rather, so its
place could be taken by another object of another class, with
a similar behaviour; the visible effect of this is that the
name of the instance and the class will not be underlinedactiveObject - flag denoting if the object is active, i. e. all messages sent
to the object spawn a new threaddiagram - the diagram to which the lifeline belongs| Method Detail |
|---|
public void addView(ExtensibleDrawable view)
public List<ExtensibleDrawable> getAllViews()
public int getCallLevel()
public boolean isActiveObject()
public boolean hasThread()
public void setThread(int thread)
public int getThread()
public void setMnemonic(String mnemnonic)
public String getMnemonic()
public boolean isWaiting()
public int getUniqueThread()
public Lifeline getLeftmost()
public Lifeline getRightmost()
public Lifeline getRoot()
public boolean isAlwaysActive()
public LinkedList<Lifeline> getAllLifelines()
public Lifeline getLastInThread(int thread)
public Lifeline getRightNeighbour()
public Lifeline getLeftNeighbour()
public boolean isAlive()
public void giveBirth()
public Direction getDirection()
public int getPosition()
public int getSideLevel()
public boolean isActive()
public String getName()
public String getType()
public Lifeline addActivity(Lifeline caller,
int thread)
public void finish()
public void terminate()
public void dispose()
IllegalStateException - if this is a main lifeline or if this lifeline is still
activepublic void toggleWaitingStatus()
public void setActive(boolean active)
public void setRectangleBottom(int bottom)
public String toString()
toString in class Objectpublic Diagram getDiagram()
public ExtensibleDrawable getView()
public Drawable getHead()
public boolean isExternal()
public void destroy()
public Cross getCross()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||