E
- coupling attribute value typepublic final class Coupling<E>
extends java.lang.Object
Producer
and a Consumer
, where the
producer passes a value of type E to the consumer:
Producer --> E --> Consumer
Producers and Consumers are types of Attribute
. They are usually
not created directly but are created from a PotentialAttribute
.
When creating couplings, a lot of the work is in creating these
PotentialAttributes. Most users of the API will create Potential Attributes
using the AttributeManager
.
Attribute
,
PotentialAttribute
,
AttributeManager
Constructor and Description |
---|
Coupling(Consumer<E> Consumer)
Create a coupling between a specified consuming attribute, without yet
specifying the corresponding producing attribute.
|
Coupling(PotentialProducer producer,
PotentialConsumer consumer)
Create a new coupling by actualizing a potential producer and a potential
consumer.
|
Coupling(Producer<E> Producer)
Create a coupling between a specified producing attribute, without yet
specifying the corresponding consuming attribute.
|
Coupling(Producer<E> Producer,
Consumer<E> Consumer)
Create a new coupling between the specified producing attribute and
consuming attribute.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Consumer<E> |
getConsumer() |
java.lang.Class<?> |
getDataType()
Returns the datatype associated with this coupling.
|
java.lang.String |
getId()
Returns an id used for persistence.
|
Producer<E> |
getProducer() |
int |
hashCode() |
void |
setBuffer()
Set value of buffer.
|
java.lang.String |
toString()
Returns the string representation of this coupling.
|
void |
update()
Update this coupling.
|
public E buffer
public Coupling(Consumer<E> Consumer)
Consumer
- the attribute that consumes.public Coupling(Producer<E> Producer)
Producer
- the attribute that produces.public Coupling(Producer<E> Producer, Consumer<E> Consumer)
Producer
- producing attribute for this couplingConsumer
- consuming attribute for this couplingpublic Coupling(PotentialProducer producer, PotentialConsumer consumer)
producer
- producing attribute for this couplingconsumer
- consuming attribute for this couplingpublic void setBuffer()
public void update()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getId()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Class<?> getDataType()