@Test public void toListNumber5() { float[] array = new float[]{1,2,3}; assertThat(ListNumbers.toListNumber(array), equalTo((ListNumber) new ArrayFloat(array))); }
public static ListNumber toListNumber(Object primitiveArray) { if (primitiveArray instanceof byte[]) { return new ArrayByte((byte[]) primitiveArray); } else if (primitiveArray instanceof short[]) { return new ArrayShort((short[]) primitiveArray); } else if (primitiveArray instanceof int[]) { return new ArrayInt((int[]) primitiveArray); } else if (primitiveArray instanceof long[]) { return new ArrayLong((long[]) primitiveArray); } else if (primitiveArray instanceof float[]) { return new ArrayFloat((float[]) primitiveArray); } else if (primitiveArray instanceof double[]) { return new ArrayDouble((double[]) primitiveArray); } else { throw new IllegalArgumentException(primitiveArray + " is not a an array of primitive numbers"); } }
ListNumbers { public static ListNumber toListNumber(Object primitiveArray) { if (primitiveArray instanceof byte[]) { return new ArrayByte((byte[]) primitiveArray); } else if (primitiveArray instanceof short[]) { return new ArrayShort((short[]) primitiveArray); } else if (primitiveArray instanceof int[]) { return new ArrayInt((int[]) primitiveArray); } else if (primitiveArray instanceof long[]) { return new ArrayLong((long[]) primitiveArray); } else if (primitiveArray instanceof float[]) { return new ArrayFloat((float[]) primitiveArray); } else if (primitiveArray instanceof double[]) { return new ArrayDouble((double[]) primitiveArray); } else { throw new IllegalArgumentException(primitiveArray + " is not a an array of primitive numbers"); } } }
ListNumbers { public static ListNumber toListNumber(Object primitiveArray) { if (primitiveArray instanceof byte[]) { return new ArrayByte((byte[]) primitiveArray); } else if (primitiveArray instanceof short[]) { return new ArrayShort((short[]) primitiveArray); } else if (primitiveArray instanceof int[]) { return new ArrayInt((int[]) primitiveArray); } else if (primitiveArray instanceof long[]) { return new ArrayLong((long[]) primitiveArray); } else if (primitiveArray instanceof float[]) { return new ArrayFloat((float[]) primitiveArray); } else if (primitiveArray instanceof double[]) { return new ArrayDouble((double[]) primitiveArray); } else { throw new IllegalArgumentException(primitiveArray + " is not a an array of primitive numbers"); } }  }
ListNumbers { public static ListNumber toListNumber(Object primitiveArray) { if (primitiveArray instanceof byte[]) { return new ArrayByte((byte[]) primitiveArray); } else if (primitiveArray instanceof short[]) { return new ArrayShort((short[]) primitiveArray); } else if (primitiveArray instanceof int[]) { return new ArrayInt((int[]) primitiveArray); } else if (primitiveArray instanceof long[]) { return new ArrayLong((long[]) primitiveArray); } else if (primitiveArray instanceof float[]) { return new ArrayFloat((float[]) primitiveArray); } else if (primitiveArray instanceof double[]) { return new ArrayDouble((double[]) primitiveArray); } else { throw new IllegalArgumentException(primitiveArray + " is not a an array of primitive numbers"); } }  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 ListNumber toListNumber(Object primitiveArray) { if (primitiveArray instanceof byte[]) { return new ArrayByte((byte[]) primitiveArray); } else if (primitiveArray instanceof short[]) { return new ArrayShort((short[]) primitiveArray); } else if (primitiveArray instanceof int[]) { return new ArrayInt((int[]) primitiveArray); } else if (primitiveArray instanceof long[]) { return new ArrayLong((long[]) primitiveArray); } else if (primitiveArray instanceof float[]) { return new ArrayFloat((float[]) primitiveArray); } else if (primitiveArray instanceof double[]) { return new ArrayDouble((double[]) primitiveArray); } else { throw new IllegalArgumentException(primitiveArray + " is not a an array of primitive numbers"); } }  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);  }