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

How to use
setAll
method
in
java.util.Arrays

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

origin: apache/incubator-druid

 private AggregatorFactory[] getCombiningFactories(AggregatorFactory[] aggregatorFactories)
 {
  final AggregatorFactory[] combiningFactories = new AggregatorFactory[aggregatorFactories.length];
  Arrays.setAll(combiningFactories, i -> aggregatorFactories[i].getCombiningFactory());
  return combiningFactories;
 }
}
origin: prestodb/presto

public Page getPositions(int[] retainedPositions, int offset, int length)
{
  requireNonNull(retainedPositions, "retainedPositions is null");
  Block[] blocks = new Block[this.blocks.length];
  Arrays.setAll(blocks, i -> this.blocks[i].getPositions(retainedPositions, offset, length));
  return new Page(length, blocks);
}
origin: prestodb/presto

public Page getPositions(int[] retainedPositions, int offset, int length)
{
  requireNonNull(retainedPositions, "retainedPositions is null");
  Block[] blocks = new Block[this.blocks.length];
  Arrays.setAll(blocks, i -> this.blocks[i].getPositions(retainedPositions, offset, length));
  return new Page(length, blocks);
}
origin: AxonFramework/AxonFramework

private EventPublisher[] initializePublisherThreads(int publisherThreadCount,
                          Executor executor,
                          TransactionManager transactionManager,
                          RollbackConfiguration rollbackConfiguration) {
  EventPublisher[] publishers = new EventPublisher[publisherThreadCount];
  Arrays.setAll(publishers, t -> new EventPublisher(executor, transactionManager, rollbackConfiguration, t));
  return publishers;
}
origin: AxonFramework/AxonFramework

private CommandHandlerInvoker[] initializeInvokerThreads(int invokerThreadCount, Cache cache) {
  CommandHandlerInvoker[] invokers = new CommandHandlerInvoker[invokerThreadCount];
  Arrays.setAll(invokers, t -> new CommandHandlerInvoker(cache, t));
  return invokers;
}
origin: prestodb/presto

  public Iterator<Page> getSortedPages()
  {
    return new AbstractIterator<Page>()
    {
      private int currentPosition;
      private final PageBuilder pageBuilder = new PageBuilder(types);
      private final int[] outputChannels = new int[types.size()];

      {
        Arrays.setAll(outputChannels, IntUnaryOperator.identity());
      }

      @Override
      public Page computeNext()
      {
        currentPosition = buildPage(currentPosition, outputChannels, pageBuilder);
        if (pageBuilder.isEmpty()) {
          return endOfData();
        }
        Page page = pageBuilder.build();
        pageBuilder.reset();
        return page;
      }
    };
  }
}
origin: prestodb/presto

  private static Page somePage(List<Type> types)
  {
    int[] initialValues = new int[types.size()];
    Arrays.setAll(initialValues, i -> 100 * i);
    return createSequencePage(types, 7, initialValues);
  }
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlockWithFailure(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(-10, dictionarySize - 10);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> index % dictionarySize);
  return new DictionaryBlock(dictionary, ids);
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlockWithUnusedEntries(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(-10, dictionarySize);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> (index % dictionarySize) + 10);
  return new DictionaryBlock(dictionary, ids);
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlock(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(0, dictionarySize);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> index % dictionarySize);
  return new DictionaryBlock(dictionary, ids);
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlockWithFailure(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(-10, dictionarySize - 10);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> index % dictionarySize);
  return new DictionaryBlock(dictionary, ids);
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlock(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(0, dictionarySize);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> index % dictionarySize);
  return new DictionaryBlock(dictionary, ids);
}
origin: prestodb/presto

private static DictionaryBlock createDictionaryBlockWithUnusedEntries(int dictionarySize, int blockSize)
{
  Block dictionary = createLongSequenceBlock(-10, dictionarySize);
  int[] ids = new int[blockSize];
  Arrays.setAll(ids, index -> (index % dictionarySize) + 10);
  return new DictionaryBlock(dictionary, ids);
}
origin: ben-manes/caffeine

public MultiQueuePolicy(Config config) {
 MultiQueueSettings settings = new MultiQueueSettings(config);
 policyStats = new PolicyStats("linked.MultiQueue");
 threshold = new long[settings.numberOfQueues()];
 headQ = new Node[settings.numberOfQueues()];
 out = new Long2ObjectLinkedOpenHashMap<>();
 data = new Long2ObjectOpenHashMap<>();
 maximumSize = settings.maximumSize();
 lifetime = settings.lifetime();
 Arrays.setAll(headQ, Node::sentinel);
 Arrays.setAll(threshold, i -> 1L << i);
 maxOut = (int) (maximumSize * settings.percentOut());
}
origin: ben-manes/caffeine

public S4WindowTinyLfuPolicy(double percentMain, S4WindowTinyLfuSettings settings) {
 String name = String.format("sketch.S4WindowTinyLfu (%.0f%%)", 100 * (1.0d - percentMain));
 this.policyStats = new PolicyStats(name);
 this.admittor = new TinyLfu(settings.config(), policyStats);
 this.maximumSize = settings.maximumSize();
 this.maxMain = (int) (maximumSize * percentMain);
 this.maxEden = maximumSize - maxMain;
 this.data = new Long2ObjectOpenHashMap<>();
 this.headEden = Node.sentinel(-1);
 this.levels = settings.levels();
 this.sizeMainQ = new int[levels];
 this.headMainQ = new Node[levels];
 Arrays.setAll(headMainQ, Node::sentinel);
}
origin: apache/incubator-druid

@Override
public double[] compute(final Map<String, Object> combinedAggregators)
{
 final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators);
 final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()];
 Arrays.setAll(stats, i -> new SummaryStatistics());
 final ArrayOfDoublesSketchIterator it = sketch.iterator();
 while (it.next()) {
  final double[] values = it.getValues();
  for (int i = 0; i < values.length; i++) {
   stats[i].addValue(values[i]);
  }
 }
 final double[] means = new double[sketch.getNumValues()];
 Arrays.setAll(means, i -> stats[i].getMean());
 return means;
}
origin: apache/incubator-druid

@Override
public double[] compute(final Map<String, Object> combinedAggregators)
{
 final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators);
 final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()];
 Arrays.setAll(stats, i -> new SummaryStatistics());
 final ArrayOfDoublesSketchIterator it = sketch.iterator();
 while (it.next()) {
  final double[] values = it.getValues();
  for (int i = 0; i < values.length; i++) {
   stats[i].addValue(values[i]);
  }
 }
 final double[] variances = new double[sketch.getNumValues()];
 Arrays.setAll(variances, i -> stats[i].getVariance());
 return variances;
}
origin: apache/incubator-druid

private static SummaryStatistics[] getStats(final ArrayOfDoublesSketch sketch)
{
 final SummaryStatistics[] stats = new SummaryStatistics[sketch.getNumValues()];
 Arrays.setAll(stats, i -> new SummaryStatistics());
 final ArrayOfDoublesSketchIterator it = sketch.iterator();
 while (it.next()) {
  final double[] values = it.getValues();
  for (int i = 0; i < values.length; i++) {
   stats[i].addValue(values[i]);
  }
 }
 return stats;
}
origin: ben-manes/caffeine

public S4LruPolicy(Admission admission, Config config) {
 this.policyStats = new PolicyStats(admission.format("linked.S4Lru"));
 this.admittor = admission.from(config, policyStats);
 S4LruSettings settings = new S4LruSettings(config);
 this.data = new Long2ObjectOpenHashMap<>();
 this.maximumSize = settings.maximumSize();
 this.levels = settings.levels();
 this.headQ = new Node[levels];
 this.sizeQ = new int[levels];
 Arrays.setAll(headQ, Node::sentinel);
}
origin: apache/ignite

/** {@inheritDoc} */
@Override public Vector map(IgniteDoubleFunction<Double> fun) {
  if (sto.isArrayBased()) {
    double[] data = sto.data();
    Arrays.setAll(data, (idx) -> fun.apply(data[idx]));
  }
  else {
    int len = size();
    for (int i = 0; i < len; i++)
      storageSet(i, fun.apply(storageGet(i)));
  }
  return this;
}
java.utilArrayssetAll

Popular methods of Arrays

  • asList
    Returns a List of the objects in the specified array. The size of the List cannot be modified, i.e.
  • 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,
  • parallelSort,
  • parallelSetAll,
  • spliterator,
  • checkBinarySearchBounds,
  • checkOffsetAndCount,
  • checkStartAndEnd

Popular in Java

  • Creating JSON documents from java classes using gson
  • 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