|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvanetsim.scenario.events.Event
vanetsim.scenario.events.StartBlocking
public final class StartBlocking
This class represents an event which starts blocking on a street.
Constructor Summary | |
---|---|
StartBlocking(int time,
int x,
int y,
int direction,
int lanes)
Constructor. |
Method Summary | |
---|---|
int |
compareTo(Event other)
Compare to another event. |
void |
destroy()
Destroys itself. |
void |
execute()
Execute the task. |
int |
getAffectedDirection()
Gets the affected direction. |
int |
getAffectedLanes()
Gets the amount of lanes (per direction) affected by this event. |
java.util.ArrayList<BlockingObject> |
getBlockingObjects()
Gets the blocking objects. |
StopBlocking |
getStopBlockingEvent()
Gets the event which ends this blocking. |
Street |
getStreet()
Gets the street where blocking is done. |
java.lang.String |
getText()
Returns a descriptive text for display in the GUI. |
int |
getX()
Gets the x coordinate. |
int |
getY()
Gets the y coordinate. |
void |
setStopBlockingEvent(StopBlocking event)
Sets the event which ends this blocking. |
Methods inherited from class vanetsim.scenario.events.Event |
---|
getTextColor, getTime |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StartBlocking(int time, int x, int y, int direction, int lanes) throws java.text.ParseException
time
- the time in milliseconds when this event gets activex
- the x coordinate of this eventy
- the y coordinate of this eventdirection
- The affected street direction. 0
for both directions,
1
for startNode to endNode, 1
for endNode to startNodelanes
- The amount of affected lanes (should be at least 1). Will be used for both directions.
Use Integer.MAX_VALUE
to use all lanes.
java.text.ParseException
- an exception indicating that creation wasn't successfulMethod Detail |
---|
public java.lang.String getText()
getText
in class Event
Event.getText()
public int compareTo(Event other)
other
- the other event
-1
if other
is larger, 1
if it's smaller and 0 if both are equal.Comparable.compareTo(java.lang.Object)
public void execute()
execute
in class Event
Event.execute()
public void destroy()
destroy
in class Event
Event.destroy()
public int getX()
public int getY()
public StopBlocking getStopBlockingEvent()
null
if this event exists foreverpublic void setStopBlockingEvent(StopBlocking event)
event
- the event which ends blockingpublic Street getStreet()
public int getAffectedDirection()
0
to indicate that this event is for both directions,1
that it's only from
startNode to endNode, 1
that it's only from endNode to startNodepublic java.util.ArrayList<BlockingObject> getBlockingObjects()
public int getAffectedLanes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |