congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BitVector.checkIndex
Code IndexAdd Tabnine to your IDE (free)

How to use
checkIndex
method
in
com.artemis.utils.BitVector

Best Java code snippets using com.artemis.utils.BitVector.checkIndex (Showing top 6 results out of 315)

origin: junkdog/artemis-odb

public void clear(int bitIndex) {
  checkIndex(bitIndex);
  clear(array, bitIndex);
}
origin: junkdog/artemis-odb

public boolean get(int bitIndex) {
  checkIndex(bitIndex);
  return get(array, bitIndex);
}
origin: junkdog/artemis-odb

public void set(int bitIndex) {
  checkIndex(bitIndex);
  set(array, bitIndex);
}
origin: junkdog/artemis-odb

public void flip(int bitIndex) {
  checkIndex(bitIndex);
  flip(array, bitIndex);
}
origin: junkdog/artemis-odb

public int nextClearBit(int fromIndex) {
  checkIndex(fromIndex);
  int index = wordIndex(fromIndex);
  // special case for first index
  int fromBit = fromIndex - (bitIndex(index));
  int word = getWord(array, index);
  for (int i = fromBit; i < 32; i++) {
    if ((word & (1 << i)) == 0) {
      return (bitIndex(index)) + i;
    }
  }
  // loop through the rest
  while (true) {
    index++;
    word = getWord(array, index);
    if (word != 0xffffffff) {
      return (bitIndex(index)) + Integer.numberOfTrailingZeros(~word);
    }
  }
}
origin: junkdog/artemis-odb

public int nextSetBit(int fromIndex) {
  checkIndex(fromIndex);
  int index = wordIndex(fromIndex);
  // check the current word
  int word = getWord(array, index);
  if (word != 0) {
    for (int i = bitOffset(fromIndex); i < 32; i++) {
      if ((word & (1 << i)) != 0) {
        return (bitIndex(index)) + i;
      }
    }
  }
  index++;
  // find the next set word
  trimToSize(array);
  index = nextSetWord(array, index);
  if (index == -1) {
    return -1;
  }
  // return the next set bit
  return (bitIndex(index))
      + Integer.numberOfTrailingZeros(array.get(index));
};
com.artemis.utilsBitVectorcheckIndex

Popular methods of BitVector

  • get
  • clear
  • nextSetBit
    Returns the index of the first bit that is set to true that occurs on or after the specified startin
  • set
  • <init>
    Creates a bit set based off another bit vector.
  • cardinality
  • equals
  • intersects
    Returns true if the specified BitVector has any bits set to true that are also set to true in this B
  • isEmpty
  • length
    Returns the "logical size" of this bitset: the index of the highest set bit in the bitset plus one.
  • or
    Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a
  • toIntBag
    Decodes the set bits as integers. The destination IntBag is reset before the bits are transposed.
  • or,
  • toIntBag,
  • unsafeGet,
  • andNot,
  • bitIndex,
  • bitOffset,
  • checkCapacity,
  • checkRange,
  • clone

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • CodeWhisperer alternatives
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