|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Signal>
com.azalient.apo.enums.Signal
public enum Signal
A Signal describes the state of each Turn. A group can also be assigned a Signal, and all Turns having that Group as their Direct Group will have that Signal.
| Enum Constant Summary | |
|---|---|
Barred
Fixed-signal: barred turn (for example no right turn here, at any time) |
|
Free
Fixed-signal: free-flow = traffic making this turn does not need to slow down or check for conflicting traffic |
|
GiveWay
Fixed-signal: a "Give Way" sign |
|
Green
Variable-signal: green = traffic making this turn does not need to slow down or check for conflicting traffic |
|
GreenStop
Variable-signal: green, but stop for other traffic. |
|
GreenYield
Variable-signal: green, yield to opposing traffic = give way to other traffic streams. |
|
Off
Variable-signal: where a turning arrow can go off, this state is used to represent that. |
|
Red
Variable-signal: stop, do not proceed under any circumstances. |
|
Stop
Fixed-signal: a "Stop" sign |
|
Yellow
Variable-signal: yellow = prepare to stop, proceed only if safe (or, for most people, go faster now) |
|
YellowFlashing
Variable-signal: flashing yellow = give way to other traffic streams |
|
Yield
Fixed-signal: yield to other traffic - normally used when turning across an opposing traffic stream, yield to that stream |
|
| Field Summary | |
|---|---|
static int |
COLOUR_GREEN
SP38 colour value for GREEN state (SP38/TRAFF states reversed, documented as 1) |
static int |
COLOUR_OFF
SP38 colour value for OFF state |
static int |
COLOUR_RED
SP38 colour value for RED state (SP38/TRAFF states reversed, documented as 1) |
static int |
COLOUR_RED_YELLOW
SP38 colour value for RED+YELLOW state |
static int |
COLOUR_YELLOW
SP38 colour value for YELLOW state |
static int |
FLASHING_MASK
SP38 colour mask for FLASHING (can be OR'd with other colours) |
static Signal[] |
GroupStates
An array of all possible states for groups |
static Signal[] |
OffStates
An array of all possible states for the "filter" state of a turn - if its primary group goes to off, what state should it be if its filter group is green? |
static Signal[] |
Signalised
An array of all possible states for variable signalised turns |
static Signal[] |
Unsignalised
An array of all possible states for fixed unsignalised turns |
static Signal[] |
ZERO
|
| Method Summary | |
|---|---|
String |
abbreviation()
Returns an abbreviation code for this Signal |
SignalColour |
colour()
Return the equivalent colour value for the SP38 interface |
String |
description()
Return a text description of the signal |
boolean |
hasPriorityOver(Signal that)
Returns true if traffic controlled by 'this' Signal has priority over traffic controlled by 'that' signal, or false if equal or lower priority |
Icon |
icon()
Return an icon that represents this signal state |
Image |
image()
Return an image that represents this signal state |
int |
integerPriorityOver(Signal that)
Returns +1 if traffic controlled by 'this' Signal has priority over traffic controlled by 'that' signal, -1 if lower priority and 0 if equal priority |
static Signal |
intSP38colour(int colour)
Convert from SP38 colour integer to Signal |
static String |
intSP38colourStr(int colour)
Convert from SP38 colour integer to Signal description |
static Signal |
parseString(String s)
Given a string, return the matching signal state, or null, if no match |
static Signal |
parseString(String s,
Signal fallback)
Given a string, return the matching signal state, or the fallback state, if no match |
String |
qpName()
Used for import/export to Q-Paramics format |
String |
toString()
|
String |
toStringTranslated()
|
static Signal |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static Signal[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
boolean |
variable()
A variable signal is a traffic light signal |
boolean |
yield()
This is true for signals that can cause blocking on an intersection, and those that use the yoeldAdvance field in a Stream |
| Methods inherited from class java.lang.Enum |
|---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final Signal Free
public static final Signal Yield
public static final Signal GiveWay
public static final Signal Stop
public static final Signal Barred
public static final Signal Green
public static final Signal Yellow
public static final Signal YellowFlashing
public static final Signal GreenYield
public static final Signal GreenStop
public static final Signal Red
public static final Signal Off
| Field Detail |
|---|
public static Signal[] Unsignalised
public static Signal[] Signalised
public static Signal[] GroupStates
public static Signal[] OffStates
public static final Signal[] ZERO
public static final int COLOUR_OFF
public static final int COLOUR_RED
public static final int COLOUR_YELLOW
public static final int COLOUR_GREEN
public static final int COLOUR_RED_YELLOW
public static final int FLASHING_MASK
| Method Detail |
|---|
public static Signal[] values()
for (Signal c : Signal.values()) System.out.println(c);
public static Signal valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic String description()
public String toString()
toString in class Enum<Signal>public String toStringTranslated()
toStringTranslated in interface ITranslatablepublic String qpName()
public SignalColour colour()
public boolean variable()
public Icon icon()
public Image image()
public static Signal parseString(String s)
public static Signal parseString(String s,
Signal fallback)
public static String intSP38colourStr(int colour)
public static Signal intSP38colour(int colour)
public boolean hasPriorityOver(Signal that)
public int integerPriorityOver(Signal that)
public boolean yield()
public String abbreviation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||