jaron.components
Class TwoWaySwitch

java.lang.Object
  extended by jaron.components.Signal
      extended by jaron.components.TwoWaySwitch
All Implemented Interfaces:
SignalListener, java.util.EventListener

public class TwoWaySwitch
extends Signal

The TwoWaySwitch class implements a switch with an input and two output signals (channels).

Since:
1.0
Version:
1.2
Author:
jarontec gmail com

Constructor Summary
TwoWaySwitch()
          Creates a TwoWaySwitch object.
 
Method Summary
 Signal getInput()
          Returns the input signal.
 Signal getOutput1()
          Returns the first output signal Output1.
 Signal getOutput2()
          Returns the second output signal Output2.
 void toggleSwitch()
          Toggles the switch's output form Output1 to Output2 and vice versa.
 
Methods inherited from class jaron.components.Signal
addSignalListener, getBandwidth, getHigh, getLow, getValue, removeSignalListener, setBandwidth, setHigh, setLow, setValue, signalChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoWaySwitch

public TwoWaySwitch()
Creates a TwoWaySwitch object. By default the switch's output signal is Output1.

Method Detail

getInput

public Signal getInput()
Returns the input signal.

Returns:
the switch's input signal

getOutput1

public Signal getOutput1()
Returns the first output signal Output1.

Returns:
the switch's first output signal

getOutput2

public Signal getOutput2()
Returns the second output signal Output2.

Returns:
the switch's second output signal

toggleSwitch

public void toggleSwitch()
Toggles the switch's output form Output1 to Output2 and vice versa.