Package edu.wpi.grip.core.sockets
Interface SocketHint<T>
-
- All Known Implementing Classes:
LinkedSocketHint
,SocketHint.BasicSocketHint
,SocketHint.IdentiferOverridingSocketHintDecorator
,SocketHint.SocketHintDecorator
public interface SocketHint<T>
ASocketHint
is a descriptor that gives some information about one of the inputs or outputs of an Operation.SocketHint
s don't store actual values, and are merely used by steps and parts of the user interface to learn how to talk toAlgorithm
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SocketHint.BasicSocketHint<T>
A concrete implementation of the SocketHint class that provides the functionality of a raw SocketHint.static class
SocketHint.Builder<T>
static class
SocketHint.IdentiferOverridingSocketHintDecorator<T>
A SocketHintDecorator that easily redecorates theSocketHint.IdentiferOverridingSocketHintDecorator.getIdentifier()
method.static class
SocketHint.SocketHintDecorator<T>
static class
SocketHint.View
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<T>
createInitialValue()
Constructs the initial value if an initial value provider was supplied.java.util.Optional<T[]>
getDomain()
A hint at the range of values that this socket can hold.java.lang.String
getIdentifier()
The name for this socket.java.lang.Class<T>
getType()
java.lang.String
getTypeLabel()
A user-presentable string to represent the type of this socket.SocketHint.View
getView()
The type of view that this hint reccomends being displayed with.boolean
isCompatibleWith(SocketHint other)
Determines if this is able to contain the type of value that the other socket hint contains.
-
-
-
Method Detail
-
getIdentifier
java.lang.String getIdentifier()
The name for this socket.
-
getType
java.lang.Class<T> getType()
-
isCompatibleWith
boolean isCompatibleWith(SocketHint other)
Determines if this is able to contain the type of value that the other socket hint contains.- Parameters:
other
- The other socket hint to check if this hint's type can contain it- Returns:
- True the two can be connected together
-
getView
SocketHint.View getView()
The type of view that this hint reccomends being displayed with.
-
getDomain
java.util.Optional<T[]> getDomain()
A hint at the range of values that this socket can hold. For numeric types, this can consist of two elements that correspond.
-
getTypeLabel
java.lang.String getTypeLabel()
A user-presentable string to represent the type of this socket. This may be empty.
-
createInitialValue
java.util.Optional<T> createInitialValue()
Constructs the initial value if an initial value provider was supplied.- Returns:
- Optionally, the initial value for the socket
-
-