Package edu.wpi.grip.core.sockets
Class InputSocketImpl<T>
- java.lang.Object
-
- edu.wpi.grip.core.sockets.SocketImpl<T>
-
- edu.wpi.grip.core.sockets.InputSocketImpl<T>
-
- Type Parameters:
T
- The type of the value that this socket stores
- All Implemented Interfaces:
InputSocket<T>
,Socket<T>
- Direct Known Subclasses:
CudaSocket
public class InputSocketImpl<T> extends SocketImpl<T> implements InputSocket<T>
Concrete implementation of theInputSocket
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InputSocketImpl.FactoryImpl
Needed to get around Guice's inability to inject a generic typed factory.-
Nested classes/interfaces inherited from interface edu.wpi.grip.core.sockets.InputSocket
InputSocket.Decorator<T>, InputSocket.Factory
-
Nested classes/interfaces inherited from interface edu.wpi.grip.core.sockets.Socket
Socket.Direction
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dirtied()
Checks if the socket has been dirtied and rests it to false.void
onValueChanged()
Should be only called by parent classes.void
removeConnection(Connection connection)
Reset the socket to its default value when it's no longer connected to anything.-
Methods inherited from class edu.wpi.grip.core.sockets.SocketImpl
addConnection, flagChanged, getConnections, getDirection, getSocketHint, getSource, getStep, getValue, setSource, setStep, setValueOptional, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.wpi.grip.core.sockets.Socket
addConnection, flagChanged, getConnections, getDirection, getSocketHint, getSource, getStep, getValue, setSource, setStep, setValue, setValueOptional, simpleString
-
-
-
-
Method Detail
-
removeConnection
public void removeConnection(Connection connection)
Reset the socket to its default value when it's no longer connected to anything. This prevents removed connections from continuing to have an effect on steps because they still hold references to the values they were connected to.- Specified by:
removeConnection
in interfaceSocket<T>
- Overrides:
removeConnection
in classSocketImpl<T>
- Parameters:
connection
- The connection to remove from this socket.
-
dirtied
public boolean dirtied()
Description copied from interface:InputSocket
Checks if the socket has been dirtied and rests it to false.- Specified by:
dirtied
in interfaceInputSocket<T>
- Returns:
- True if the socket has been dirtied.
-
onValueChanged
public void onValueChanged()
Description copied from interface:InputSocket
Should be only called by parent classes.- Specified by:
onValueChanged
in interfaceInputSocket<T>
- Specified by:
onValueChanged
in interfaceSocket<T>
-
-