Package edu.wpi.grip.core.sockets
Interface SocketHint<T>
-
- All Known Implementing Classes:
LinkedSocketHint,SocketHint.BasicSocketHint,SocketHint.IdentiferOverridingSocketHintDecorator,SocketHint.SocketHintDecorator
public interface SocketHint<T>ASocketHintis a descriptor that gives some information about one of the inputs or outputs of an Operation.SocketHints don't store actual values, and are merely used by steps and parts of the user interface to learn how to talk toAlgorithms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSocketHint.BasicSocketHint<T>A concrete implementation of the SocketHint class that provides the functionality of a raw SocketHint.static classSocketHint.Builder<T>static classSocketHint.IdentiferOverridingSocketHintDecorator<T>A SocketHintDecorator that easily redecorates theSocketHint.IdentiferOverridingSocketHintDecorator.getIdentifier()method.static classSocketHint.SocketHintDecorator<T>static classSocketHint.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.StringgetIdentifier()The name for this socket.java.lang.Class<T>getType()java.lang.StringgetTypeLabel()A user-presentable string to represent the type of this socket.SocketHint.ViewgetView()The type of view that this hint reccomends being displayed with.booleanisCompatibleWith(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
-
-