Class VCell<A>

java.lang.Object
org.opencastproject.util.data.Cell<A>
org.opencastproject.util.data.VCell<A>
Type Parameters:
A - the value type

public final class VCell<A> extends Cell<A>
Value cell, a mutable data container. Cells provide a pattern that reverses the listener pattern. Instead of propagating changes of a value to registered listeners via callbacks, the dependent object just holds a reference to a cell and pulls the value when needed. Cells must not contain null!
  • Constructor Details

    • VCell

      public VCell(A a, boolean stable)
  • Method Details

    • cell

      public static <A> VCell<A> cell(A a)
      Constructor function.
    • ocell

      public static <A> VCell<Optional<A>> ocell()
      Create a cell containing none.
    • get

      public A get()
      Get the cell's value.
      Specified by:
      get in class Cell<A>
    • change

      protected Tuple<A,Object> change()
      Specified by:
      change in class Cell<A>
    • set

      public void set(A a)
      Set the cell's value.
    • lift

      public <B> Cell<B> lift(Function<A,B> f)