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
ASocketHint
that's type is linked between many other sockets and who's type is defined by whateverInputSocket
was 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.Class
getType()
java.lang.String
getTypeLabel()
A user-presentable string to represent the type of this socket.boolean
isCompatibleWith(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 anInputSocket
that is linked to this SocketHint.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.-
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 anInputSocket
that 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:SocketHint
A user-presentable string to represent the type of this socket. This may be empty.- Specified by:
getTypeLabel
in interfaceSocketHint
- Overrides:
getTypeLabel
in classSocketHint.SocketHintDecorator
-
getType
public java.lang.Class getType()
- Specified by:
getType
in interfaceSocketHint
- Overrides:
getType
in classSocketHint.SocketHintDecorator
-
isCompatibleWith
public boolean isCompatibleWith(SocketHint other)
Description copied from interface:SocketHint
Determines if this is able to contain the type of value that the other socket hint contains.- Specified by:
isCompatibleWith
in interfaceSocketHint
- Overrides:
isCompatibleWith
in 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
-
-