Tabnine Logo
Arrays.parallelSort
Code IndexAdd Tabnine to your IDE (free)

How to use
parallelSort
method
in
java.util.Arrays

Best Java code snippets using java.util.Arrays.parallelSort (Showing top 20 results out of 315)

origin: jtablesaw/tablesaw

@Override
public void sortAscending() {
  Arrays.parallelSort(data.elements());
}
origin: jtablesaw/tablesaw

@Override
public void sortAscending() {
  Arrays.parallelSort(data.elements());
}
origin: jtablesaw/tablesaw

@Override
public void sortAscending() {
  int[] sorted = data.toIntArray();
  Arrays.parallelSort(sorted);
  this.data = new IntArrayList(sorted);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public Vector sort() {
  if (isArrayBased())
    Arrays.parallelSort(sto.data());
  else
    throw new UnsupportedOperationException();
  return this;
}
origin: apache/kylin

public void init(KylinConfig config, String project) {
  this.project = project;
  this.config = config;
  if (name != null)
    name = name.toUpperCase(Locale.ROOT);
  if (getDatabase() != null)
    setDatabase(getDatabase().toUpperCase(Locale.ROOT));
  if (columns != null) {
    Arrays.parallelSort(columns, new Comparator<ColumnDesc>() {
      @Override
      public int compare(ColumnDesc col1, ColumnDesc col2) {
        Integer id1 = Integer.parseInt(col1.getId());
        Integer id2 = Integer.parseInt(col2.getId());
        return id1.compareTo(id2);
      }
    });
    for (ColumnDesc col : columns) {
      col.init(this);
    }
  }
}
origin: apache/ignite

FullPageId[] objects = cpPagesList.toArray(new FullPageId[cpPagesList.size()]);
Arrays.parallelSort(objects, new Comparator<FullPageId>() {
  @Override public int compare(FullPageId o1, FullPageId o2) {
    int cmp = Long.compare(o1.groupId(), o2.groupId());
origin: apache/kylin

@Test
public void testRandom() {
  Random rand = new Random();
  int n = 1000;
  double[] nums = new double[n];
  for (int i = 0; i < n; i++) {
    nums[i] = rand.nextDouble() * 1000000;
  }
  Arrays.parallelSort(nums);
  buf.clear();
  dds.serialize(nums, buf);
  buf.flip();
  double[] r = dds.deserialize(buf);
  assertArrayEquals(nums, r);
  System.out.println("doubles size of " + (n * 8) + " bytes serialized to " + buf.limit() + " bytes");
}
origin: apache/kylin

@Test
public void testRandom2() {
  Random rand = new Random();
  int n = 1000;
  double[] nums = new double[n];
  for (int i = 0; i < n; i++) {
    nums[i] = rand.nextInt();
  }
  
  Arrays.parallelSort(nums);
  buf.clear();
  dds.serialize(nums, buf);
  buf.flip();
  double[] r = dds.deserialize(buf);
  assertArrayEquals(nums, r);
  System.out.println("doubles size of " + (n * 8) + " bytes serialized to " + buf.limit() + " bytes");
}
origin: apache/kylin

private void testSpanningAndGetParent(CuboidScheduler scheduler, CubeDesc cube, long[] cuboidIds, long[] expectChildren) {
  Set<Long> totalSpanning = Sets.newHashSet();
  for (long cuboidId : cuboidIds) {
    List<Long> spannings = scheduler.getSpanningCuboid(cuboidId);
    totalSpanning.addAll(spannings);
    System.out.println("Spanning result for " + cuboidId + "(" + Long.toBinaryString(cuboidId) + "): " + toString(spannings));
    for (long child : spannings) {
      assertTrue(scheduler.isValid(child));
    }
  }
  long[] spanningsArray = Longs.toArray(totalSpanning);
  Arrays.parallelSort(spanningsArray);
  Arrays.parallelSort(expectChildren);
  assertArrayEquals(expectChildren, spanningsArray);
}
origin: apache/kylin

Arrays.parallelSort(timeRanges);
origin: biezhi/learn-java8

  public static void main(String[] args) {
    long[] arrayOfLong = new long[20000];

    Arrays.parallelSetAll(arrayOfLong,
        index -> ThreadLocalRandom.current().nextInt(1000000));
    Arrays.stream(arrayOfLong).limit(10).forEach(
        i -> System.out.print(i + " "));
    System.out.println();

    Arrays.parallelSort(arrayOfLong);
    Arrays.stream(arrayOfLong).limit(10).forEach(
        i -> System.out.print(i + " "));
    System.out.println();
  }
}
origin: torakiki/pdfsam

  @Override
  public <T> SelectionAndFocus move(Integer[] selected, ObservableList<T> items, int focused) {
    if (isSubselection(selected, items)) {
      MultipleSelectionAndFocus newSelection = new MultipleSelectionAndFocus(focused);
      Arrays.parallelSort(selected, Collections.reverseOrder(Integer::compare));
      if (isNotLast(selected, items)) {
        Arrays.stream(selected).forEach(i -> {
          Collections.swap(items, i, i + 1);
          newSelection.moveDown(i);
        });
        return newSelection;
      }
    }
    return SelectionAndFocus.NULL;
  }
},
origin: torakiki/pdfsam

  @Override
  public <T> SelectionAndFocus move(Integer[] selected, ObservableList<T> items, int focused) {
    if (isSubselection(selected, items)) {
      MultipleSelectionAndFocus newSelection = new MultipleSelectionAndFocus(focused);
      Arrays.parallelSort(selected);
      if (isNotFirst(selected)) {
        Arrays.stream(selected).forEach(i -> {
          Collections.swap(items, i, i - 1);
          newSelection.moveUp(i);
        });
        return newSelection;
      }
    }
    return SelectionAndFocus.NULL;
  }
},
origin: optimatika/ojAlgo

@Override
public final void sortAscending() {
  Arrays.parallelSort(data);
}
origin: stackoverflow.com

 public static void main(String[] args) {
  String[] strings = { "x", "a", "c", "b", "y" };
  Arrays.parallelSort(strings);
  System.out.println(Arrays.toString(strings));   // [a, b, c, x, y]
}
origin: blueconic/browscap-java

static Rule[] getOrderedRules(final Rule[] rules) {
  final Comparator<Rule> c = Comparator.comparing(Rule::getSize).reversed().thenComparing(Rule::getPattern);
  final Rule[] result = Arrays.copyOf(rules, rules.length);
  parallelSort(result, c);
  return result;
}
origin: BruceEckel/OnJava8-Examples

 @Benchmark
 public void parallelSort() {
  Arrays.parallelSort(la);
 }
}
origin: optimatika/ojAlgo

@Override
public void sortDescending() {
  Primitive64Array.negate(data, 0, data.length, 1, data);
  Arrays.parallelSort(data);
  Primitive64Array.negate(data, 0, data.length, 1, data);
}
origin: optimatika/ojAlgo

@Override
public void sortDescending() {
  Primitive32Array.negate(data, 0, data.length, 1, data);
  Arrays.parallelSort(data);
  Primitive32Array.negate(data, 0, data.length, 1, data);
}
origin: org.ojalgo/ojalgo

@Override
public void sortDescending() {
  Primitive32Array.negate(data, 0, data.length, 1, data);
  Arrays.parallelSort(data);
  Primitive32Array.negate(data, 0, data.length, 1, data);
}
java.utilArraysparallelSort

Popular methods of Arrays

  • asList
  • toString
    Returns a string representation of the contents of the specified array. The string representation co
  • equals
    Returns true if the two specified arrays of booleans areequal to one another. Two arrays are conside
  • sort
    Sorts the specified range of the array into ascending order. The range to be sorted extends from the
  • copyOf
    Copies the specified array, truncating or padding with false (if necessary) so the copy has the spec
  • fill
    Assigns the specified boolean value to each element of the specified array of booleans.
  • stream
  • hashCode
    Returns a hash code based on the contents of the specified array. For any two boolean arrays a and
  • copyOfRange
    Copies the specified range of the specified array into a new array. The initial index of the range (
  • binarySearch
    Searches the specified array of shorts for the specified value using the binary search algorithm. Th
  • deepEquals
    Returns true if the two specified arrays are deeply equal to one another. Unlike the #equals(Object[
  • deepToString
  • deepEquals,
  • deepToString,
  • deepHashCode,
  • setAll,
  • parallelSetAll,
  • spliterator,
  • checkBinarySearchBounds,
  • checkOffsetAndCount,
  • checkStartAndEnd

Popular in Java

  • Reading from database using SQL prepared statement
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JButton (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now