Class TypeUtils.ConstantSampler<T>

  • All Implemented Interfaces:
    Sampler<T>, Typed<T>
    Enclosing class:
    TypeUtils

    private static class TypeUtils.ConstantSampler<T>
    extends java.lang.Object
    implements Sampler<T>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private T t  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConstantSampler​(T t)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Sampler<T> copy()  
      T get()
      Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
      T getType()
      Get an instance of T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • t

        private final T t
    • Constructor Detail

      • ConstantSampler

        public ConstantSampler​(T t)
    • Method Detail

      • get

        public T get()
        Description copied from interface: Sampler
        Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
        Specified by:
        get in interface Sampler<T>
      • getType

        public T getType()
        Description copied from interface: Typed
        Get an instance of T.

        It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

        Specified by:
        getType in interface Sampler<T>
        Specified by:
        getType in interface Typed<T>
        Returns:
        an instance of T
      • copy

        public Sampler<T> copy()
        Specified by:
        copy in interface Sampler<T>
        Returns:
        - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)