... | ... | @@ -3,8 +3,7 @@ |
|
|
**Tethering** is a feature which allows **Tetherable** objects to be dynamically tied together, based on their relative proximity. If you're not yet familiar with this feature, we'd like to invite you to have a look at the respective [Authoring Section](authoring/features/Tethering) providing more insight into the [Tethering](authoring/features/Tethering) feature.
|
|
|
|
|
|
## Tetherable
|
|
|
|
|
|
|
|
|
The **Tetherable** interface defines all methods required for objects wishing to implement the tethering feature. The interface is quiet comprehensive as it defines a great number of methods to be implemented.
|
|
|
|
|
|
```java
|
|
|
public interface Tetherable {
|
... | ... | @@ -30,6 +29,16 @@ public interface Tetherable { |
|
|
}
|
|
|
```
|
|
|
|
|
|
Lets have a closer look at the individual methods.
|
|
|
|
|
|
* The **isProviderFor()** method checks whether this **tetherable** object is a *provider* for the specified **Tether**. As a reminder, **Tethers** are besides a visual representation of the link between two tetherable objects, also a directional communication channel, requiring both a data *provider* and a data *receiver*.
|
|
|
* The **isReceieverFor()** method checks whether this **tetherable** object is a *receiver* for the specified **Tether**.
|
|
|
* The **isPotentialTether()** method checks this **tetherable** object is ready to accept tethering request.
|
|
|
* Tethering is not something that happens on an *ad hoc* basis. In order for **tetherable** objects to establish links between themselves, they first of all need to be aware of each other. The **addPotentialTether()** method allows registering a **tetherable** object as a potential tethering *partner*. The **removePotentialTether()** does the opposite.
|
|
|
* The **getTetheringDistance()** method returns the tethering distance defined for this particular tetherable object.
|
|
|
* When adding a **tetherable** object as a potential partner with the **addPotentialTether()** method, we also had to specify which **Tether** instance to use for this particular candidate. The **getTetherFor()** method will return for a given **tetherable** candidate the corresponding **Tether** object, provided the candidate is known to this **tetherable** instance.
|
|
|
|
|
|
|
|
|
<div align="center">
|
|
|
<figure>
|
|
|
<img src="uploads/5e4b3836ff50f6c40cffde46d2577765/TetheringSequence.png">
|
... | ... | |