Examples of AtomicIntegerArray


Examples of java.util.concurrent.atomic.AtomicIntegerArray

        }

        JSONArray array = new JSONArray();
        parser.parseArray(array);

        AtomicIntegerArray atomicArray = new AtomicIntegerArray(array.size());
        for (int i = 0; i < array.size(); ++i) {
            atomicArray.set(i, array.getInteger(i));
        }

        return (T) atomicArray;
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

        evictionLock = new ReentrantLock();
        evictionDeque = new LinkedDeque<Node>();
        drainStatus = new AtomicReference<DrainStatus>(DrainStatus.IDLE);

        buffers = (Queue<Task>[]) new Queue[NUMBER_OF_BUFFERS];
        bufferLengths = new AtomicIntegerArray(NUMBER_OF_BUFFERS);
        for (int i = 0; i < NUMBER_OF_BUFFERS; i++) {
            buffers[i] = new ConcurrentLinkedQueue<Task>();
        }

        // The notification queue and listener
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

    evictionLock = new ReentrantLock();
    evictionDeque = new LinkedDeque<Node>();
    drainStatus = new AtomicReference<DrainStatus>(DrainStatus.IDLE);

    buffers = (Queue<Task>[]) new Queue[NUMBER_OF_BUFFERS];
    bufferLengths = new AtomicIntegerArray(NUMBER_OF_BUFFERS);
    for (int i = 0; i < NUMBER_OF_BUFFERS; i++) {
      buffers[i] = new ConcurrentLinkedQueue<Task>();
    }

    // The notification queue and listener
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

        private final AtomicIntegerArray list;
        private final AtomicInteger index = new AtomicInteger();

        public PercentileBucketData(int dataLength) {
            this.length = dataLength;
            this.list = new AtomicIntegerArray(dataLength);
        }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

    Preconditions.checkNotNull(receiver);
    Preconditions.checkNotNull(parentAccounter);

    this.parentAccounter = parentAccounter;
    this.incoming = receiver.getProvidingEndpoints();
    this.remainders = new AtomicIntegerArray(incoming.size());
    this.oppositeMajorFragmentId = receiver.getOppositeMajorFragmentId();
    this.buffers = new RawBatchBuffer[minInputsRequired];
    this.context = context;
    try {
      String bufferClassName = context.getConfig().getString(ExecConstants.INCOMING_BUFFER_IMPL);
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

    this.operator = operator;
    this.context = context;
    this.outGoingBatchCount = operator.getDestinations().size();
    this.popConfig = operator;
    this.statusHandler = new StatusHandler(sendCount, context);
    this.remainingReceivers = new AtomicIntegerArray(outGoingBatchCount);
    this.remaingReceiverCount = new AtomicInteger(outGoingBatchCount);
  }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

   @SuppressWarnings("unchecked")
   public PriorityThreadPoolExecutor(int... poolSize) {
      AuAssert.check(poolSize.length == Priority.values().length);
      this.poolSize = poolSize;
      queueCount = poolSize.length;
      activeTaskCount = new AtomicIntegerArray(queueCount);

      PriorityBlockingQueue<?> workQueue = new PriorityBlockingQueue<PriorityFutureTask<?>>(poolSize.length);

      int totalPoolSize = 0;
      for (int size : poolSize) {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

    }
    System.out.println("PASSED");
  }

  static int test(boolean test_only) {
    AtomicIntegerArray a1 = new AtomicIntegerArray(ARRLEN);
    AtomicIntegerArray a2 = new AtomicIntegerArray(ARRLEN);
    // Initialize
    for (int i=0; i<ARRLEN; i++) {
      a1.lazySet(i, -1);
      a2.lazySet(i, -1);
    }
    System.out.println("Warmup");
    for (int i=0; i<ITERS; i++) {
      test_ci(a1);
      test_vi(a2, 123, -1);
      test_cp(a1, a2);
      test_2ci(a1, a2);
      test_2vi(a1, a2, 123, 103);
      test_ci_neg(a1, 123);
      test_vi_neg(a2, 123, 103);
      test_cp_neg(a1, a2);
      test_2ci_neg(a1, a2);
      test_2vi_neg(a1, a2, 123, 103);
      test_ci_oppos(a1, 123);
      test_vi_oppos(a2, 123, 103);
      test_cp_oppos(a1, a2);
      test_2ci_oppos(a1, a2);
      test_2vi_oppos(a1, a2, 123, 103);
      test_ci_off(a1, 123);
      test_vi_off(a2, 123, 103);
      test_cp_off(a1, a2);
      test_2ci_off(a1, a2);
      test_2vi_off(a1, a2, 123, 103);
      test_ci_inv(a1, OFFSET, 123);
      test_vi_inv(a2, 123, OFFSET, 103);
      test_cp_inv(a1, a2, OFFSET);
      test_2ci_inv(a1, a2, OFFSET);
      test_2vi_inv(a1, a2, 123, 103, OFFSET);
      test_ci_scl(a1, 123);
      test_vi_scl(a2, 123, 103);
      test_cp_scl(a1, a2);
      test_2ci_scl(a1, a2);
      test_2vi_scl(a1, a2, 123, 103);
      test_cp_alndst(a1, a2);
      test_cp_alnsrc(a1, a2);
      test_2ci_aln(a1, a2);
      test_2vi_aln(a1, a2, 123, 103);
      test_cp_unalndst(a1, a2);
      test_cp_unalnsrc(a1, a2);
      test_2ci_unaln(a1, a2);
      test_2vi_unaln(a1, a2, 123, 103);
    }
    // Initialize
    for (int i=0; i<ARRLEN; i++) {
      a1.lazySet(i, -1);
      a2.lazySet(i, -1);
    }
    // Test and verify results
    System.out.println("Verification");
    int errn = 0;
    {
      test_ci(a1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_ci: a1", i, a1.get(i), -123);
      }
      test_vi(a2, 123, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_vi: a2", i, a2.get(i), 123);
      }
      test_cp(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_cp: a1", i, a1.get(i), 123);
      }
      test_2ci(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2ci: a1", i, a1.get(i), -123);
        errn += verify("test_2ci: a2", i, a2.get(i), -103);
      }
      test_2vi(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2vi: a1", i, a1.get(i), 123);
        errn += verify("test_2vi: a2", i, a2.get(i), 103);
      }
      // Reset for negative stride
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_neg(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_ci_neg: a1", i, a1.get(i), -123);
      }
      test_vi_neg(a2, 123, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_vi_neg: a2", i, a2.get(i), 123);
      }
      test_cp_neg(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_cp_neg: a1", i, a1.get(i), 123);
      }
      test_2ci_neg(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2ci_neg: a1", i, a1.get(i), -123);
        errn += verify("test_2ci_neg: a2", i, a2.get(i), -103);
      }
      test_2vi_neg(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2vi_neg: a1", i, a1.get(i), 123);
        errn += verify("test_2vi_neg: a2", i, a2.get(i), 103);
      }
      // Reset for opposite stride
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_oppos(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_ci_oppos: a1", i, a1.get(i), -123);
      }
      test_vi_oppos(a2, 123, -1);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_vi_oppos: a2", i, a2.get(i), 123);
      }
      test_cp_oppos(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_cp_oppos: a1", i, a1.get(i), 123);
      }
      test_2ci_oppos(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2ci_oppos: a1", i, a1.get(i), -123);
        errn += verify("test_2ci_oppos: a2", i, a2.get(i), -103);
      }
      test_2vi_oppos(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN; i++) {
        errn += verify("test_2vi_oppos: a1", i, a1.get(i), 123);
        errn += verify("test_2vi_oppos: a2", i, a2.get(i), 103);
      }
      // Reset for indexing with offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_off(a1, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_ci_off: a1", i, a1.get(i), -123);
      }
      test_vi_off(a2, 123, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_vi_off: a2", i, a2.get(i), 123);
      }
      test_cp_off(a1, a2);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_cp_off: a1", i, a1.get(i), 123);
      }
      test_2ci_off(a1, a2);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_2ci_off: a1", i, a1.get(i), -123);
        errn += verify("test_2ci_off: a2", i, a2.get(i), -103);
      }
      test_2vi_off(a1, a2, 123, 103);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_2vi_off: a1", i, a1.get(i), 123);
        errn += verify("test_2vi_off: a2", i, a2.get(i), 103);
      }
      for (int i=0; i<OFFSET; i++) {
        errn += verify("test_2vi_off: a1", i, a1.get(i), -1);
        errn += verify("test_2vi_off: a2", i, a2.get(i), -1);
      }
      // Reset for indexing with invariant offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_inv(a1, OFFSET, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_ci_inv: a1", i, a1.get(i), -123);
      }
      test_vi_inv(a2, 123, OFFSET, -1);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_vi_inv: a2", i, a2.get(i), 123);
      }
      test_cp_inv(a1, a2, OFFSET);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_cp_inv: a1", i, a1.get(i), 123);
      }
      test_2ci_inv(a1, a2, OFFSET);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_2ci_inv: a1", i, a1.get(i), -123);
        errn += verify("test_2ci_inv: a2", i, a2.get(i), -103);
      }
      test_2vi_inv(a1, a2, 123, 103, OFFSET);
      for (int i=OFFSET; i<ARRLEN; i++) {
        errn += verify("test_2vi_inv: a1", i, a1.get(i), 123);
        errn += verify("test_2vi_inv: a2", i, a2.get(i), 103);
      }
      for (int i=0; i<OFFSET; i++) {
        errn += verify("test_2vi_inv: a1", i, a1.get(i), -1);
        errn += verify("test_2vi_inv: a2", i, a2.get(i), -1);
      }
      // Reset for indexing with scale
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_ci_scl(a1, -1);
      for (int i=0; i<ARRLEN; i++) {
        int val = (i%SCALE != 0) ? -1 : -123;
        errn += verify("test_ci_scl: a1", i, a1.get(i), val);
      }
      test_vi_scl(a2, 123, -1);
      for (int i=0; i<ARRLEN; i++) {
        int val = (i%SCALE != 0) ? -1 : 123;
        errn += verify("test_vi_scl: a2", i, a2.get(i), val);
      }
      test_cp_scl(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        int val = (i%SCALE != 0) ? -1 : 123;
        errn += verify("test_cp_scl: a1", i, a1.get(i), val);
      }
      test_2ci_scl(a1, a2);
      for (int i=0; i<ARRLEN; i++) {
        if (i%SCALE != 0) {
          errn += verify("test_2ci_scl: a1", i, a1.get(i), -1);
        } else if (i*SCALE < ARRLEN) {
          errn += verify("test_2ci_scl: a1", i*SCALE, a1.get(i*SCALE), -123);
        }
        if (i%SCALE != 0) {
          errn += verify("test_2ci_scl: a2", i, a2.get(i), -1);
        } else if (i*SCALE < ARRLEN) {
          errn += verify("test_2ci_scl: a2", i*SCALE, a2.get(i*SCALE), -103);
        }
      }
      test_2vi_scl(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN; i++) {
        if (i%SCALE != 0) {
          errn += verify("test_2vi_scl: a1", i, a1.get(i), -1);
        } else if (i*SCALE < ARRLEN) {
          errn += verify("test_2vi_scl: a1", i*SCALE, a1.get(i*SCALE), 123);
        }
        if (i%SCALE != 0) {
          errn += verify("test_2vi_scl: a2", i, a2.get(i), -1);
        } else if (i*SCALE < ARRLEN) {
          errn += verify("test_2vi_scl: a2", i*SCALE, a2.get(i*SCALE), 103);
        }
      }
      // Reset for 2 arrays with relative aligned offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_vi(a2, 123, -1);
      test_cp_alndst(a1, a2);
      for (int i=0; i<ALIGN_OFF; i++) {
        errn += verify("test_cp_alndst: a1", i, a1.get(i), -1);
      }
      for (int i=ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_cp_alndst: a1", i, a1.get(i), 123);
      }
      for (int i=0; i<ALIGN_OFF; i++) {
        a1.lazySet(i, 123);
      }
      test_vi(a2, -123, 123);
      test_cp_alnsrc(a1, a2);
      for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
        errn += verify("test_cp_alnsrc: a1", i, a1.get(i), -123);
      }
      for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_cp_alnsrc: a1", i, a1.get(i), 123);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_2ci_aln(a1, a2);
      for (int i=0; i<ALIGN_OFF; i++) {
        errn += verify("test_2ci_aln: a1", i, a1.get(i), -1);
      }
      for (int i=ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_aln: a1", i, a1.get(i), -123);
      }
      for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
        errn += verify("test_2ci_aln: a2", i, a2.get(i), -103);
      }
      for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_aln: a2", i, a2.get(i), -1);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_2vi_aln(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
        errn += verify("test_2vi_aln: a1", i, a1.get(i), 123);
      }
      for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_aln: a1", i, a1.get(i), -1);
      }
      for (int i=0; i<ALIGN_OFF; i++) {
        errn += verify("test_2vi_aln: a2", i, a2.get(i), -1);
      }
      for (int i=ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_aln: a2", i, a2.get(i), 103);
      }

      // Reset for 2 arrays with relative unaligned offset
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_vi(a2, 123, -1);
      test_cp_unalndst(a1, a2);
      for (int i=0; i<UNALIGN_OFF; i++) {
        errn += verify("test_cp_unalndst: a1", i, a1.get(i), -1);
      }
      for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_cp_unalndst: a1", i, a1.get(i), 123);
      }
      test_vi(a2, -123, 123);
      test_cp_unalnsrc(a1, a2);
      for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
        errn += verify("test_cp_unalnsrc: a1", i, a1.get(i), -123);
      }
      for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_cp_unalnsrc: a1", i, a1.get(i), 123);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_2ci_unaln(a1, a2);
      for (int i=0; i<UNALIGN_OFF; i++) {
        errn += verify("test_2ci_unaln: a1", i, a1.get(i), -1);
      }
      for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_unaln: a1", i, a1.get(i), -123);
      }
      for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
        errn += verify("test_2ci_unaln: a2", i, a2.get(i), -103);
      }
      for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_unaln: a2", i, a2.get(i), -1);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
        a2.lazySet(i, -1);
      }
      test_2vi_unaln(a1, a2, 123, 103);
      for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
        errn += verify("test_2vi_unaln: a1", i, a1.get(i), 123);
      }
      for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_unaln: a1", i, a1.get(i), -1);
      }
      for (int i=0; i<UNALIGN_OFF; i++) {
        errn += verify("test_2vi_unaln: a2", i, a2.get(i), -1);
      }
      for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_unaln: a2", i, a2.get(i), 103);
      }

      // Reset for aligned overlap initialization
      for (int i=0; i<ALIGN_OFF; i++) {
        a1.lazySet(i, i);
      }
      for (int i=ALIGN_OFF; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_cp_alndst(a1, a1);
      for (int i=0; i<ARRLEN; i++) {
        int v = i%ALIGN_OFF;
        errn += verify("test_cp_alndst_overlap: a1", i, a1.get(i), v);
      }
      for (int i=0; i<ALIGN_OFF; i++) {
        a1.lazySet((i+ALIGN_OFF), -1);
      }
      test_cp_alnsrc(a1, a1);
      for (int i=0; i<ALIGN_OFF; i++) {
        errn += verify("test_cp_alnsrc_overlap: a1", i, a1.get(i), -1);
      }
      for (int i=ALIGN_OFF; i<ARRLEN; i++) {
        int v = i%ALIGN_OFF;
        errn += verify("test_cp_alnsrc_overlap: a1", i, a1.get(i), v);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_2ci_aln(a1, a1);
      for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
        errn += verify("test_2ci_aln_overlap: a1", i, a1.get(i), -103);
      }
      for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_aln_overlap: a1", i, a1.get(i), -123);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_2vi_aln(a1, a1, 123, 103);
      for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
        errn += verify("test_2vi_aln_overlap: a1", i, a1.get(i), 123);
      }
      for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_aln_overlap: a1", i, a1.get(i), 103);
      }

      // Reset for unaligned overlap initialization
      for (int i=0; i<UNALIGN_OFF; i++) {
        a1.lazySet(i, i);
      }
      for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_cp_unalndst(a1, a1);
      for (int i=0; i<ARRLEN; i++) {
        int v = i%UNALIGN_OFF;
        errn += verify("test_cp_unalndst_overlap: a1", i, a1.get(i), v);
      }
      for (int i=0; i<UNALIGN_OFF; i++) {
        a1.lazySet((i+UNALIGN_OFF), -1);
      }
      test_cp_unalnsrc(a1, a1);
      for (int i=0; i<UNALIGN_OFF; i++) {
        errn += verify("test_cp_unalnsrc_overlap: a1", i, a1.get(i), -1);
      }
      for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
        int v = i%UNALIGN_OFF;
        errn += verify("test_cp_unalnsrc_overlap: a1", i, a1.get(i), v);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_2ci_unaln(a1, a1);
      for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
        errn += verify("test_2ci_unaln_overlap: a1", i, a1.get(i), -103);
      }
      for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2ci_unaln_overlap: a1", i, a1.get(i), -123);
      }
      for (int i=0; i<ARRLEN; i++) {
        a1.lazySet(i, -1);
      }
      test_2vi_unaln(a1, a1, 123, 103);
      for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
        errn += verify("test_2vi_unaln_overlap: a1", i, a1.get(i), 123);
      }
      for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
        errn += verify("test_2vi_unaln_overlap: a1", i, a1.get(i), 103);
      }

    }

    if (errn > 0 || test_only)
      return errn;

    // Initialize
    for (int i=0; i<ARRLEN; i++) {
      a1.lazySet(i, -1);
      a2.lazySet(i, -1);
    }
    System.out.println("Time");
    long start, end;
    start = System.currentTimeMillis();
    for (int i=0; i<ITERS; i++) {
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

        }

        JSONArray array = new JSONArray();
        parser.parseArray(array);

        AtomicIntegerArray atomicArray = new AtomicIntegerArray(array.size());
        for (int i = 0; i < array.size(); ++i) {
            atomicArray.set(i, array.getInteger(i));
        }

        return (T) atomicArray;
    }
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicIntegerArray

       
        if (type == AtomicIntegerArray.class) {
            JSONArray array = new JSONArray();
            parser.parseArray(array);

            AtomicIntegerArray atomicArray = new AtomicIntegerArray(array.size());
            for (int i = 0; i < array.size(); ++i) {
                atomicArray.set(i, array.getInteger(i));
            }

            return (T) atomicArray;
        }
       
        if (type == AtomicLongArray.class) {
            JSONArray array = new JSONArray();
            parser.parseArray(array);

            AtomicLongArray atomicArray = new AtomicLongArray(array.size());
            for (int i = 0; i < array.size(); ++i) {
                atomicArray.set(i, array.getLong(i));
            }

            return (T) atomicArray;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.