Class FloatingPointReceptacle


  • public final class FloatingPointReceptacle
    extends java.lang.Object
    An array (double[] or float[]) builder/converter. The arrays are built by prepending/appending segments of anything that can be converted to either double[] or float[] arrays. The total/aggregated arrays are extracted by calling supplyTo(double[]) or supplyTo(float[]). This also serves as a type converter from any number type to double or float.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Deque<java.lang.Object> myContents  
      private int mySize  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(double... part)  
      void append​(float... part)  
      void append​(int count, double value)  
      void append​(int count, float value)  
      void append​(java.util.List<? extends java.lang.Comparable<?>> part)  
      void append​(Access1D<?> part)  
      void append​(FloatingPointReceptacle part)  
      void clear()  
      private int copy​(double[] source, double[] destination, int offset)  
      private int copy​(double[] source, float[] destination, int offset)  
      private int copy​(float[] source, double[] destination, int offset)  
      private int copy​(float[] source, float[] destination, int offset)  
      private int copy​(java.util.List<? extends java.lang.Comparable<?>> source, double[] destination, int offset)  
      private int copy​(java.util.List<? extends java.lang.Comparable<?>> source, float[] destination, int offset)  
      private int copy​(Access1D<?> source, double[] destination, int offset)  
      private int copy​(Access1D<?> source, float[] destination, int offset)  
      static FloatingPointReceptacle of​(double... values)  
      static FloatingPointReceptacle of​(float... values)  
      static FloatingPointReceptacle of​(int count, double value)  
      static FloatingPointReceptacle of​(int count, float value)  
      static FloatingPointReceptacle of​(java.util.List<? extends java.lang.Comparable<?>> values)  
      static FloatingPointReceptacle of​(Access1D<?> values)  
      void prepend​(double... part)  
      void prepend​(float... part)  
      void prepend​(int count, double value)  
      void prepend​(int count, float value)  
      void prepend​(java.util.List<? extends java.lang.Comparable<?>> part)  
      void prepend​(Access1D<?> part)  
      void prepend​(FloatingPointReceptacle part)  
      int size()  
      void supplyTo​(double[] destination)  
      private int supplyTo​(double[] destination, int offset)  
      void supplyTo​(float[] destination)  
      private int supplyTo​(float[] destination, int offset)  
      double[] toDoubles()
      Will create a new array with each call.
      float[] toFloats()
      Will create a new array with each call.
      • Methods inherited from class java.lang.Object

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

      • myContents

        private final java.util.Deque<java.lang.Object> myContents
      • mySize

        private int mySize
    • Constructor Detail

      • FloatingPointReceptacle

        public FloatingPointReceptacle()
    • Method Detail

      • append

        public void append​(Access1D<?> part)
      • append

        public void append​(double... part)
      • append

        public void append​(float... part)
      • append

        public void append​(int count,
                           double value)
      • append

        public void append​(int count,
                           float value)
      • append

        public void append​(java.util.List<? extends java.lang.Comparable<?>> part)
      • clear

        public void clear()
      • prepend

        public void prepend​(Access1D<?> part)
      • prepend

        public void prepend​(double... part)
      • prepend

        public void prepend​(float... part)
      • prepend

        public void prepend​(int count,
                            double value)
      • prepend

        public void prepend​(int count,
                            float value)
      • prepend

        public void prepend​(java.util.List<? extends java.lang.Comparable<?>> part)
      • size

        public int size()
      • supplyTo

        public void supplyTo​(double[] destination)
      • supplyTo

        public void supplyTo​(float[] destination)
      • toDoubles

        public double[] toDoubles()
        Will create a new array with each call. It would be much more efficient if possible to reuse array and instead call supplyTo(double[]).
      • toFloats

        public float[] toFloats()
        Will create a new array with each call. It would be much more efficient if possible to reuse array and instead call supplyTo(float[]).
      • copy

        private int copy​(Access1D<?> source,
                         double[] destination,
                         int offset)
      • copy

        private int copy​(Access1D<?> source,
                         float[] destination,
                         int offset)
      • copy

        private int copy​(double[] source,
                         double[] destination,
                         int offset)
      • copy

        private int copy​(double[] source,
                         float[] destination,
                         int offset)
      • copy

        private int copy​(float[] source,
                         double[] destination,
                         int offset)
      • copy

        private int copy​(float[] source,
                         float[] destination,
                         int offset)
      • copy

        private int copy​(java.util.List<? extends java.lang.Comparable<?>> source,
                         double[] destination,
                         int offset)
      • copy

        private int copy​(java.util.List<? extends java.lang.Comparable<?>> source,
                         float[] destination,
                         int offset)
      • supplyTo

        private int supplyTo​(double[] destination,
                             int offset)
      • supplyTo

        private int supplyTo​(float[] destination,
                             int offset)