@Test public void sortedView3() { ArrayDouble values = new ArrayDouble(-1.7178013239620846, 0.5200744839822301, 0.638091980352644, 0.093683130487196, -1.2967630810250952, 0.7040257444802407, -0.4166241363846508, 2.9610862677876244, 0.03636268292097817, -0.35530274977371445); SortedListView sortedView = ListNumbers.sortedView(values); assertThat(sortedView, equalTo((ListNumber) new ArrayDouble(-1.7178013239620846, -1.2967630810250952, -0.4166241363846508, -0.35530274977371445, 0.03636268292097817, 0.093683130487196, 0.5200744839822301, 0.638091980352644, 0.7040257444802407, 2.9610862677876244))); }
public static SortedListView sortedView(ListNumber values) { SortedListView view = new SortedListView(values); if (values.size() <= 1) { return view; } double value = values.getDouble(0); for (int i = 1; i < values.size(); i++) { double newValue = values.getDouble(i); if (value > newValue) { SortedListView.quicksort(view); return view; } value = newValue; } return view; }
ListNumbers { public static SortedListView sortedView(ListNumber values) { SortedListView view = new SortedListView(values); if (values.size() <= 1) { return view; } double value = values.getDouble(0); for (int i = 1; i < values.size(); i++) { double newValue = values.getDouble(i); if (value > newValue) { SortedListView.quicksort(view); return view; } value = newValue; } return view; } }
ListNumbers { public static SortedListView sortedView(ListNumber values) { SortedListView view = new SortedListView(values); if (values.size() <= 1) { return view; } double value = values.getDouble(0); for (int i = 1; i < values.size(); i++) { double newValue = values.getDouble(i); if (value > newValue) { SortedListView.quicksort(view); return view; } value = newValue; } return view; }  }
ListNumbers { public static SortedListView sortedView(ListNumber values) { SortedListView view = new SortedListView(values); if (values.size() <= 1) { return view; } double value = values.getDouble(0); for (int i = 1; i < values.size(); i++) { double newValue = values.getDouble(i); if (value > newValue) { SortedListView.quicksort(view); return view; } value = newValue; } return view; }  static SortedListView sortedView(ListNumber values); static SortedListView sortedView(ListNumber values, ListInt indexes); static int binarySearchValueOrLower(ListNumber values, double value); static int binarySearchValueOrHigher(ListNumber values, double value); static ListNumber linearListFromRange(final double minValue, final double maxValue, final int size); static ListNumber linearList(final double initialValue, final double increment, final int size); static boolean isLinear(ListNumber listNumber); static ListNumber toListNumber(Object primitiveArray); static ListNumber listView(ListNumber list, ListInt indexes); }
ListNumbers { public static SortedListView sortedView(ListNumber values) { SortedListView view = new SortedListView(values); if (values.size() <= 1) { return view; } double value = values.getDouble(0); for (int i = 1; i < values.size(); i++) { double newValue = values.getDouble(i); if (value > newValue) { SortedListView.quicksort(view); return view; } value = newValue; } return view; }  static SortedListView sortedView(ListNumber values); static SortedListView sortedView(ListNumber values, ListInt indexes); static int binarySearchValueOrLower(ListNumber values, double value); static int binarySearchValueOrHigher(ListNumber values, double value); static ListNumber linearListFromRange(final double minValue, final double maxValue, final int size); static ListNumber linearList(final double initialValue, final double increment, final int size); static boolean isLinear(ListNumber listNumber); static ListNumber toListNumber(Object primitiveArray); static ListNumber listView(ListNumber list, ListInt indexes);  }