Package com.thegongoliers.input.switches
Interface Switch
-
- All Known Subinterfaces:
ResettableSwitch
- All Known Implementing Classes:
CollisionSensor
,CurrentSpikeSensor
,CurrentTripSensor
,HighCurrentSensor
,HighVoltageSensor
,LimitSwitch
,LowCurrentSensor
,LowVoltageSensor
,VoltageSpikeSensor
,VoltageTripSensor
public interface Switch
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Switch
and(Switch s1, Switch s2)
Combine two switches using the and operatorstatic Switch
invert(Switch s1)
Invert the output of the switchboolean
isTriggered()
Determines if the switch is triggeredstatic Switch
or(Switch s1, Switch s2)
Combine two switches using the or operatorstatic Switch
xor(Switch s1, Switch s2)
Combine two switches using the xor operator
-
-
-
Method Detail
-
isTriggered
boolean isTriggered()
Determines if the switch is triggered- Returns:
- true if the switch is triggered, false otherwise
-
invert
static Switch invert(Switch s1)
Invert the output of the switch- Returns:
- The inverted switch
-
and
static Switch and(Switch s1, Switch s2)
Combine two switches using the and operator- Parameters:
s1
- The first switchs2
- The second switch- Returns:
- The combined switch consisting of s1 and s2 in an and gate.
-
or
static Switch or(Switch s1, Switch s2)
Combine two switches using the or operator- Parameters:
s1
- The first switchs2
- The second switch- Returns:
- The combined switch consisting of s1 and s2 in an or gate.
-
-