Codota Logo
IntBigArrays.length
Code IndexAdd Codota to your IDE (free)

How to use
length
method
in
it.unimi.dsi.fastutil.ints.IntBigArrays

Best Java code snippets using it.unimi.dsi.fastutil.ints.IntBigArrays.length (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: it.unimi.dsi/fastutil

@Override
public void clear() {
  size = 0;
  assert size <= IntBigArrays.length(a);
}
@Override
origin: it.unimi.dsi/fastutil

/**
 * Wraps a given big array into a big-array list of given size.
 *
 * @param a
 *            a big array to wrap.
 * @param length
 *            the length of the resulting big-array list.
 * @return a new big-array list of the given size, wrapping the given big array.
 */
public static IntBigArrayBigList wrap(final int a[][], final long length) {
  if (length > IntBigArrays.length(a))
    throw new IllegalArgumentException("The specified length (" + length + ") is greater than the array size ("
        + IntBigArrays.length(a) + ")");
  final IntBigArrayBigList l = new IntBigArrayBigList(a, false);
  l.size = length;
  return l;
}
/**
origin: it.unimi.dsi/fastutil

/** Loads elements from a file given by a {@link File} object, storing them in a given array.
  *
  * @param file a file.
  * @param array a big array which will be filled with data from the specified file.
  * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short).
  */
public static long loadInts(final File file, final int[][] array) throws IOException {
  return loadInts(file, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array));
}
/** Loads elements from a file given by a filename, storing them in a given array.
origin: it.unimi.dsi/fastutil

/** Stores a big array to a file given by a {@link File} object.
  *
  * @param array a big array whose elements will be written to {@code filename}.
  * @param file a file.
  */
public static void storeInts(final int array[][], final File file) throws IOException {
  storeInts(array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array), file);
}
/** Stores a big array to a file given by a pathname.
origin: it.unimi.dsi/fastutil

/**
 * {@inheritDoc}
 *
 * <p>
 * This implementation delegates to the analogous method for big-array
 * fragments.
 */
@Override
public void addElements(final long index, final int a[][]) {
  addElements(index, a, 0, IntBigArrays.length(a));
}
/**
origin: it.unimi.dsi/fastutil

/** Loads elements from a file given by a filename, storing them in a given array.
  *
  * @param filename a filename.
  * @param array a big array which will be filled with data from the specified file.
  * @return the number of elements actually read from the given file (it might be less than the array length if the file is too short).
  */
public static long loadInts(final CharSequence filename, final int[][] array) throws IOException {
  return loadInts(filename, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array));
}
/** Stores a big-array fragment to a given print stream.
origin: it.unimi.dsi/fastutil

/**
 * Wraps a given big array into a big-array big list.
 *
 * @param a
 *            a big array to wrap.
 * @return a new big-array big list wrapping the given array.
 */
public static IntBigArrayBigList wrap(final int a[][]) {
  return wrap(a, IntBigArrays.length(a));
}
/**
origin: it.unimi.dsi/fastutil

/** Stores a big array to a file given by a pathname.
  *
  * @param array a big array whose elements will be written to {@code filename}.
  * @param filename a filename.
  */
public static void storeInts(final int array[][], final CharSequence filename) throws IOException {
  storeInts(array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array), filename);
}
/** A wrapper that exhibits the content of a reader as a type-specific iterator. */
origin: it.unimi.dsi/fastutil

/** Loads elements from a given buffered reader, storing them in a given array.
  *
  * @param reader a buffered reader.
  * @param array a big array which will be filled with data from {@code reader}.
  * @return the number of elements actually read from {@code reader} (it might be less than the array length if {@code reader} ends).
  */
public static long loadInts(final BufferedReader reader, final int[][] array) throws IOException {
  return loadInts(reader, array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array));
}
/** Loads elements from a file given by a {@link File} object, storing them in a given big-array fragment.
origin: it.unimi.dsi/fastutil

/** Stores a big array to a given print stream.
  *
  * @param array a big array whose elements will be written to {@code stream}.
  * @param stream a print stream.
  */
public static void storeInts(final int array[][], final PrintStream stream) {
  storeInts(array, 0, it.unimi.dsi.fastutil.ints.IntBigArrays.length(array), stream);
}
/** Stores a big-array fragment to a file given by a {@link File} object.
origin: it.unimi.dsi/fastutil

/**
 * Ensures that this big-array big list can contain the given number of entries
 * without resizing.
 *
 * @param capacity
 *            the new minimum capacity for this big-array big list.
 */
public void ensureCapacity(final long capacity) {
  if (capacity <= a.length || a == IntBigArrays.DEFAULT_EMPTY_BIG_ARRAY)
    return;
  a = IntBigArrays.forceCapacity(a, capacity, size);
  assert size <= IntBigArrays.length(a);
}
/**
origin: it.unimi.dsi/fastutil

/**
 * Sorts the specified big array according to the natural ascending order using
 * quicksort.
 *
 * <p>
 * The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M.
 * Douglas McIlroy, &ldquo;Engineering a Sort Function&rdquo;, <i>Software:
 * Practice and Experience</i>, 23(11), pages 1249&minus;1265, 1993.
 *
 * @param x
 *            the big array to be sorted.
 */
public static void quickSort(final int[][] x) {
  quickSort(x, 0, IntBigArrays.length(x));
}
/**
origin: it.unimi.dsi/fastutil

public static String toString(final int[][] a) {
  if (a == null)
    return "null";
  final long last = length(a) - 1;
  if (last == -1)
    return "[]";
  final StringBuilder b = new StringBuilder();
  b.append('[');
  for (long i = 0;; i++) {
    b.append(String.valueOf(get(a, i)));
    if (i == last)
      return b.append(']').toString();
    b.append(", ");
  }
}
/**
origin: it.unimi.dsi/fastutil

/**
 * Sorts the specified big array according to the order induced by the specified
 * comparator using quicksort.
 *
 * <p>
 * The sorting algorithm is a tuned quicksort adapted from Jon L. Bentley and M.
 * Douglas McIlroy, &ldquo;Engineering a Sort Function&rdquo;, <i>Software:
 * Practice and Experience</i>, 23(11), pages 1249&minus;1265, 1993.
 *
 * @param x
 *            the big array to be sorted.
 * @param comp
 *            the comparator to determine the sorting order.
 *
 */
public static void quickSort(final int[][] x, final IntComparator comp) {
  quickSort(x, 0, IntBigArrays.length(x), comp);
}
/**
origin: it.unimi.dsi/fastutil

@Override
public int removeInt(final long index) {
  if (index >= size)
    throw new IndexOutOfBoundsException(
        "Index (" + index + ") is greater than or equal to list size (" + size + ")");
  final int old = IntBigArrays.get(a, index);
  size--;
  if (index != size)
    IntBigArrays.copy(a, index + 1, a, index, size - index);
  assert size <= IntBigArrays.length(a);
  return old;
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public boolean rem(final int k) {
  final long index = indexOf(k);
  if (index == -1)
    return false;
  removeInt(index);
  assert size <= IntBigArrays.length(a);
  return true;
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public void size(final long size) {
  if (size > IntBigArrays.length(a))
    a = IntBigArrays.forceCapacity(a, size, this.size);
  if (size > this.size)
    IntBigArrays.fill(a, this.size, size, (0));
  this.size = size;
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public boolean add(final int k) {
  grow(size + 1);
  IntBigArrays.set(a, size++, k);
  assert size <= IntBigArrays.length(a);
  return true;
}
@Override
origin: it.unimi.dsi/fastutil

  /**
   * Shuffles the specified big array using the specified pseudorandom number
   * generator.
   *
   * @param a
   *            the big array to be shuffled.
   * @param random
   *            a pseudorandom number generator.
   * @return {@code a}.
   */
  public static int[][] shuffle(final int[][] a, final Random random) {
    for (long i = length(a); i-- != 0;) {
      final long p = (random.nextLong() & 0x7FFFFFFFFFFFFFFFL) % (i + 1);
      final int t = get(a, i);
      set(a, i, get(a, p));
      set(a, p, t);
    }
    return a;
  }
}
origin: it.unimi.dsi/fastutil

@Override
public void add(final long index, final int k) {
  ensureIndex(index);
  grow(size + 1);
  if (index != size)
    IntBigArrays.copy(a, index, a, index + 1, size - index);
  IntBigArrays.set(a, index, k);
  size++;
  assert size <= IntBigArrays.length(a);
}
@Override
it.unimi.dsi.fastutil.intsIntBigArrayslength

Javadoc

Returns the length of the given big array.

Popular methods of IntBigArrays

  • get
    Returns the element of the given big array of specified index.
  • newBigArray
    Creates a new big array.
  • set
    Sets the element of the given big array of specified index.
  • binarySearch
    Searches a range of the specified big array for the specified value using the binary search algorith
  • copy
    Copies a big array from the specified source big array, beginning at the specified position, to the
  • copyFromBig
    Copies a big array from the specified source big array, beginning at the specified position, to the
  • copyToBig
    Copies an array from the specified source array, beginning at the specified position, to the specifi
  • ensureCapacity
    Ensures that a big array can contain the given number of entries, preserving just a part of the big
  • ensureOffsetLength
    Ensures that a range given by an offset and a length fits a big array. This method may be used whene
  • equals
    Returns true if the two big arrays are elementwise equal. This method uses a backward loop. It is si
  • fill
    Fills a portion of the given big array with the given value. If possible (i.e., from is 0) this meth
  • forceCapacity
    Forces a big array to contain the given number of entries, preserving just a part of the big array.W
  • fill,
  • forceCapacity,
  • grow,
  • med3,
  • quickSort,
  • radixSort,
  • selectionSort,
  • swap,
  • trim

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • BoxLayout (javax.swing)
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now