Interface PropertyContainer
- All Known Implementing Classes:
AbstractPropertyContainer
,SinglePropertyContainer
public interface PropertyContainer
Provides an interface for getting and setting
Property
s and
listening for changes to them.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Method Summary
Modifier and TypeMethodDescription<T> void
addPropertyListener
(Property<T> prop, PropertyListener<? super T> listener) Adds a listener for a specificProperty
.void
addPropertyListener
(PropertyListener<Object> listener) Adds a listener for all changes to this container.Returns theProperty
s known to this container.Returns a list ofPropertyListener
s listening to all changes to this container.<T> List
<PropertyListener<? super T>> getPropertyListeners
(Property<T> prop) Returns a list ofPropertyListener
s listening to a givenProperty
.<T> T
Gets the value of aProperty
.boolean
Checks whether there arePropertyListener
s for all changes to this container.<T> boolean
hasListeners
(Property<T> prop) Checks whether there arePropertyListener
s for a givenProperty
.<T> void
removePropertyListener
(Property<T> prop, PropertyListener<? super T> listener) Removes a listener for a specificProperty
.void
removePropertyListener
(PropertyListener<Object> listener) Removes a listener for all changes to this container.<T> void
Sets the value of aProperty
.
-
Method Details
-
getProperties
-
setValue
-
getValue
-
addPropertyListener
Adds a listener for all changes to this container.- Parameters:
listener
- the listener to add
-
removePropertyListener
Removes a listener for all changes to this container.- Parameters:
listener
- the listener to remove
-
hasListeners
boolean hasListeners()Checks whether there arePropertyListener
s for all changes to this container.- Returns:
true
if there are listeners
-
getPropertyListeners
List<PropertyListener<Object>> getPropertyListeners()Returns a list ofPropertyListener
s listening to all changes to this container.- Returns:
- a list of listeners
-
addPropertyListener
-
removePropertyListener
-
getPropertyListeners
Returns a list ofPropertyListener
s listening to a givenProperty
.- Parameters:
prop
- theProperty
listened on- Returns:
- a list of listeners
-
hasListeners
Checks whether there arePropertyListener
s for a givenProperty
.- Returns:
true
if there are listeners for the given property
-