T
- the type of data this source providespublic abstract class AbstractDataSource<T> extends java.lang.Object implements DataSource<T>
nameProperty()
,
activeProperty()
, and dataProperty()
for subclasses.Type | Property and Description |
---|---|
javafx.beans.property.BooleanProperty |
active
Checks if this data source is active, i.e.
|
javafx.beans.property.BooleanProperty |
connected |
javafx.beans.property.Property<T> |
data |
javafx.beans.property.StringProperty |
name |
Modifier and Type | Field and Description |
---|---|
protected javafx.beans.property.BooleanProperty |
active |
protected javafx.beans.property.BooleanProperty |
connected |
protected javafx.beans.property.Property<T> |
data |
protected DataType<T> |
dataType |
protected javafx.beans.property.StringProperty |
name |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataSource(DataType<T> dataType) |
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.BooleanProperty |
activeProperty()
Checks if this data source is active, i.e.
|
void |
addClient(Sourced client)
Adds a client to this source.
|
void |
connect()
Connects this source to the underlying data stream.
|
javafx.beans.property.BooleanProperty |
connectedProperty() |
javafx.beans.property.Property<T> |
dataProperty() |
void |
disconnect()
Disconnects this source from the underlying data stream.
|
DataType<T> |
getDataType()
Gets the type of data that this source is providing.
|
boolean |
hasClients()
Checks if any clients are connected to this source.
|
boolean |
isConnected()
Gets the value of the property connected.
|
javafx.beans.property.StringProperty |
nameProperty() |
void |
removeClient(Sourced client)
Removes a client from this source.
|
protected void |
setActive(boolean active)
Sets the value of the property active.
|
void |
setConnected(boolean connected)
Sets the value of the property connected.
|
protected void |
setName(java.lang.String name)
Sets the value of the property name.
|
java.lang.String |
toString() |
public javafx.beans.property.StringProperty nameProperty
nameProperty
in interface DataSource<T>
setName(String)
public javafx.beans.property.BooleanProperty activeProperty
activeProperty
in interface DataSource<T>
setActive(boolean)
public javafx.beans.property.Property<T> dataProperty
dataProperty
in interface DataSource<T>
public javafx.beans.property.BooleanProperty connectedProperty
connectedProperty
in interface DataSource<T>
isConnected()
,
setConnected(boolean)
protected final javafx.beans.property.StringProperty name
protected final javafx.beans.property.BooleanProperty active
protected final javafx.beans.property.Property<T> data
protected final javafx.beans.property.BooleanProperty connected
public javafx.beans.property.StringProperty nameProperty()
nameProperty
in interface DataSource<T>
setName(String)
public javafx.beans.property.BooleanProperty activeProperty()
DataSource
activeProperty
in interface DataSource<T>
setActive(boolean)
public javafx.beans.property.Property<T> dataProperty()
dataProperty
in interface DataSource<T>
protected void setName(java.lang.String name)
protected void setActive(boolean active)
public DataType<T> getDataType()
DataSource
getDataType
in interface DataSource<T>
public void connect()
DataSource
connect
in interface DataSource<T>
public void disconnect()
DataSource
DataSource.connect()
.disconnect
in interface DataSource<T>
public javafx.beans.property.BooleanProperty connectedProperty()
connectedProperty
in interface DataSource<T>
isConnected()
,
setConnected(boolean)
public void setConnected(boolean connected)
public boolean isConnected()
isConnected
in interface DataSource<T>
public java.lang.String toString()
toString
in class java.lang.Object
public void addClient(Sourced client)
DataSource
addClient
in interface DataSource<T>
client
- the client to addpublic void removeClient(Sourced client)
DataSource
closed
.removeClient
in interface DataSource<T>
client
- the client to removepublic boolean hasClients()
DataSource
hasClients
in interface DataSource<T>