All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kilim.http.IntList Maven / Gradle / Ivy

Go to download

Coroutines, continuations, fibers, actors and message passing for the JVM

There is a newer version: 2.0.2-jdk7
Show newest version
/* Copyright (c) 2006, Sriram Srinivasan
 *
 * You may distribute this software under the terms of the license 
 * specified in the file "License"
 */

package kilim.http;

public class IntList {
  public int[] array;
  public int   numElements;
  public IntList(int initialSize) {
    array = new int[initialSize];
  }
  public IntList() {this(10);}
  
  public void add(int element) {
    if (numElements == array.length) {
      array = (int[]) Utils.growArray(array, array.length * 3 / 2 );
    }
    array[numElements++] = element;
  }
  
  public int get(int index) {
    return array[index];
  }
 }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy