ZenScript main repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImmutableLiveObject.java 547B

12345678910111213141516171819202122
  1. package live;
  2. import listeners.DummyListenerHandle;
  3. import listeners.ListenerHandle;
  4. import zsynthetic.FunctionTTToVoid;
  5. public final class ImmutableLiveObject<T> implements LiveObject<T> {
  6. public final T value;
  7. public ImmutableLiveObject(T value) {
  8. this.value = value;
  9. }
  10. @Override
  11. public ListenerHandle<FunctionTTToVoid<T>> addListener(FunctionTTToVoid<T> listener) {
  12. return new DummyListenerHandle<FunctionTTToVoid<T>>(listener);
  13. }
  14. public T getValue() {
  15. return value;
  16. }
  17. }