Package edu.wpi.grip.core.sockets
Class LinkedSocketHint
- java.lang.Object
-
- edu.wpi.grip.core.sockets.SocketHint.SocketHintDecorator
-
- edu.wpi.grip.core.sockets.LinkedSocketHint
-
- All Implemented Interfaces:
SocketHint
public final class LinkedSocketHint extends SocketHint.SocketHintDecorator
ASocketHintthat's type is linked between many other sockets and who's type is defined by whateverInputSocketwas connected to it first.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.wpi.grip.core.sockets.SocketHint
SocketHint.BasicSocketHint<T>, SocketHint.Builder<T>, SocketHint.IdentiferOverridingSocketHintDecorator<T>, SocketHint.SocketHintDecorator<T>, SocketHint.View
-
-
Constructor Summary
Constructors Constructor Description LinkedSocketHint(InputSocket.Factory inputSocketFactory, OutputSocket.Factory outputSocketFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ClassgetType()java.lang.StringgetTypeLabel()A user-presentable string to represent the type of this socket.booleanisCompatibleWith(SocketHint other)Determines if this is able to contain the type of value that the other socket hint contains.InputSocket<?>linkedInputSocket(java.lang.String hintIdentifier)Creates anInputSocketthat is linked to this SocketHint.OutputSocketlinkedOutputSocket(java.lang.String hintIdentifier)Creates an input socket that is linked to this Socket This output socket will automatically be disconnected when there is no longer an input socket to guarantee the type of this SocketHint.-
Methods inherited from class edu.wpi.grip.core.sockets.SocketHint.SocketHintDecorator
createInitialValue, getDecorated, getDomain, getIdentifier, getView
-
-
-
-
Constructor Detail
-
LinkedSocketHint
public LinkedSocketHint(InputSocket.Factory inputSocketFactory, OutputSocket.Factory outputSocketFactory)
- Parameters:
inputSocketFactory- The factory forInputSocket.outputSocketFactory- The factory forOutputSocket.
-
-
Method Detail
-
linkedInputSocket
public InputSocket<?> linkedInputSocket(java.lang.String hintIdentifier)
Creates anInputSocketthat is linked to this SocketHint.- Parameters:
hintIdentifier- The identifier for this socket's SocketHint- Returns:
- A socket hint that's socket type is determined by this SocketHint
-
linkedOutputSocket
public OutputSocket linkedOutputSocket(java.lang.String hintIdentifier)
Creates an input socket that is linked to this Socket This output socket will automatically be disconnected when there is no longer an input socket to guarantee the type of this SocketHint.- Parameters:
hintIdentifier- The identifier for this socket's SocketHint- Returns:
- An OutputSocket that's type is dynamically linked to this SocketHint
-
getTypeLabel
public java.lang.String getTypeLabel()
Description copied from interface:SocketHintA user-presentable string to represent the type of this socket. This may be empty.- Specified by:
getTypeLabelin interfaceSocketHint- Overrides:
getTypeLabelin classSocketHint.SocketHintDecorator
-
getType
public java.lang.Class getType()
- Specified by:
getTypein interfaceSocketHint- Overrides:
getTypein classSocketHint.SocketHintDecorator
-
isCompatibleWith
public boolean isCompatibleWith(SocketHint other)
Description copied from interface:SocketHintDetermines if this is able to contain the type of value that the other socket hint contains.- Specified by:
isCompatibleWithin interfaceSocketHint- Overrides:
isCompatibleWithin classSocketHint.SocketHintDecorator- Parameters:
other- The other socket hint to check if this hint's type can contain it- Returns:
- True the two can be connected together
-
-