public final class SubSource<T> extends AbstractDataSource<T>
activeProperty, connectedProperty, dataProperty, nameProperty
Constructor and Description |
---|
SubSource(DataType<T> type,
DataSource<U> source,
java.util.function.Function<? super T,? extends U> toBackingData,
java.util.function.Function<? super U,? extends T> extractData)
Creates a new sub source.
|
Modifier and Type | Method and Description |
---|---|
SourceType |
getType()
Gets the type of this source.
|
activeProperty, addClient, connect, connectedProperty, dataProperty, disconnect, getDataType, hasClients, isConnected, nameProperty, removeClient, setActive, setConnected, setName, toString
public SubSource(DataType<T> type, DataSource<U> source, java.util.function.Function<? super T,? extends U> toBackingData, java.util.function.Function<? super U,? extends T> extractData)
U
- the type of the backing datatype
- the type of data provided by this sourcesource
- the source that contains the backing data for this sub sourcetoBackingData
- a conversion function to use to convert the data of this source to data usable by the backing
sourceextractData
- a function to use to extract the relevant data from the backing sourcepublic SourceType getType()
DataSource