Class JArrays.DoubleArrayExchanger

java.lang.Object
net.algart.arrays.JArrays.DoubleArrayExchanger
All Implemented Interfaces:
ArrayExchanger, ArrayExchanger32
Enclosing class:
JArrays

public static class JArrays.DoubleArrayExchanger extends Object implements ArrayExchanger32
Simple implementation of ArrayExchanger, exchanging elements of double[] array.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DoubleArrayExchanger(double[] array)
    Creates new exchanger, exchanging elements of the passed array.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    swap(int first, int second)
    Exchanges the elements array[(int)first] and array[(int)second], where array is the argument of the constructor.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.algart.arrays.ArrayExchanger32

    swap
  • Constructor Details

    • DoubleArrayExchanger

      public DoubleArrayExchanger(double[] array)
      Creates new exchanger, exchanging elements of the passed array.
      Parameters:
      array - some Java array.
      Throws:
      NullPointerException - if the argument is null.
  • Method Details

    • swap

      public void swap(int first, int second)
      Exchanges the elements array[(int)first] and array[(int)second], where array is the argument of the constructor.
      Specified by:
      swap in interface ArrayExchanger32
      Parameters:
      first - index of the first exchanged element.
      second - index of the second exchanged element.