Class SimpleReference<T>

java.lang.Object
dev.getelements.elements.rt.util.SimpleReference<T>
Type Parameters:
T -
All Implemented Interfaces:
Comparable<SimpleReference<T>>

public class SimpleReference<T> extends Object implements Comparable<SimpleReference<T>>
A simple reference type intended to be used in lambda functions.
  • Constructor Details

    • SimpleReference

      public SimpleReference()
    • SimpleReference

      public SimpleReference(T value)
  • Method Details

    • get

      public T get()
      Gets the value.
      Returns:
      the value.
    • set

      public T set(T t)
      Sets the value.
      Parameters:
      t - the value
      Returns:
      the value that was just set
    • compareTo

      public int compareTo(SimpleReference<T> o)
      If the type T is of the Comparable<T> then, this will perform the comparison. Otherwise, this will result in a ClassCastException.
      Specified by:
      compareTo in interface Comparable<T>
      Parameters:
      o - the object to be compared.
      Returns:
      the comparison value