Tabnine Logo
Integer.lowestOneBit
Code IndexAdd Tabnine to your IDE (free)

How to use
lowestOneBit
method
in
java.lang.Integer

Best Java code snippets using java.lang.Integer.lowestOneBit (Showing top 20 results out of 540)

origin: google/guava

int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar));
try {
 this.charsPerChunk = 8 / gcd;
origin: wildfly/wildfly

/**
 * Get the canonical action string representation for the given action set, appending it to the given string builder.
 *
 * @param type the action {@code enum} type class
 * @param set the action set
 * @param b the string builder
 * @param <E> the action type
 */
public static <E extends Enum<E>> void getCanonicalActionString(Class<E> type, int set, StringBuilder b) {
  if (set == 0) return;
  @SuppressWarnings("unchecked")
  final E[] constants = (E[]) storedInfo.get(type).constants;
  int bit = Integer.lowestOneBit(set);
  E e = constants[Integer.numberOfTrailingZeros(bit)];
  b.append(e.toString());
  set &= ~bit;
  while (set != 0) {
    bit = Integer.lowestOneBit(set);
    e = constants[Integer.numberOfTrailingZeros(bit)];
    b.append(',').append(e.toString());
    set &= ~bit;
  }
}
origin: google/j2objc

int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar));
try {
 this.charsPerChunk = 8 / gcd;
origin: wildfly/wildfly

/**
 * Get the actions string.  The actions string will be a canonical version of the one passed in at construction.
 *
 * @return the actions string (not {@code null})
 */
public String getActions() {
  final String actionString = this.actionString;
  if (actionString != null) {
    return actionString;
  }
  int actionBits = this.actionBits;
  if (actionBits == ACTION_ALL) {
    return this.actionString = "*";
  }
  int m = Integer.lowestOneBit(actionBits);
  if (m != 0) {
    StringBuilder b = new StringBuilder();
    b.append(getAction(m));
    actionBits &= ~m;
    while (actionBits != 0) {
      m = Integer.lowestOneBit(actionBits);
      b.append(',').append(getAction(m));
      actionBits &= ~m;
    }
    return this.actionString = b.toString();
  } else {
    return this.actionString = "";
  }
}
origin: wildfly/wildfly

public Permission nextElement() {
  final int bits = this.bits;
  if (bits == 0) throw new NoSuchElementException();
  if (Integer.bitCount(bits) == getNameEnumeration().size()) {
    this.bits = 0;
    return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*");
  }
  int bit = Integer.lowestOneBit(bits);
  this.bits = bits & ~bit;
  return permissionFor(Integer.numberOfTrailingZeros(bit));
}
origin: wildfly/wildfly

int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar));
try {
 this.charsPerChunk = 8 / gcd;
origin: prestodb/presto

int gcd = Math.min(8, Integer.lowestOneBit(bitsPerChar));
try {
 this.charsPerChunk = 8 / gcd;
origin: wildfly/wildfly

  Object readResolve() {
    final AbstractPermissionCollection collection = new WildFlySecurityManagerPermission("*").newPermissionCollection();
    final StringMapping<WildFlySecurityManagerPermission> mapping = WildFlySecurityManagerPermission.mapping;
    int bits = p1;
    int test;
    while (bits != 0) {
      collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits))));
      bits &= ~test;
    }
    if (isReadOnly()) {
      collection.setReadOnly();
    }
    return collection;
  }
}
origin: wildfly/wildfly

  Object readResolve() {
    final AbstractPermissionCollection collection = new ElytronPermission("*").newPermissionCollection();
    final StringMapping<ElytronPermission> mapping = ElytronPermission.mapping;
    int bits = p1;
    int test;
    while (bits != 0) {
      collection.add(mapping.getItemById(Integer.numberOfTrailingZeros(test = Integer.lowestOneBit(bits))));
      bits &= ~test;
    }
    if (isReadOnly()) {
      collection.setReadOnly();
    }
    return collection;
  }
}
origin: org.eclipse.jgit/org.eclipse.jgit

int allocFlag() {
  if (freeFlags == 0)
    throw new IllegalArgumentException(MessageFormat.format(
        JGitText.get().flagsAlreadyCreated,
        Integer.valueOf(32 - RESERVED_FLAGS)));
  final int m = Integer.lowestOneBit(freeFlags);
  freeFlags &= ~m;
  return m;
}
origin: org.eclipse.jgit/org.eclipse.jgit

private void compress(byte[] block, int p) {
  initBlock(block, p);
  int ubcDvMask = detectCollision ? UbcCheck.check(w) : 0;
  compress();
  while (ubcDvMask != 0) {
    int b = numberOfTrailingZeros(lowestOneBit(ubcDvMask));
    UbcCheck.DvInfo dv = UbcCheck.DV[b];
    for (int i = 0; i < 80; i++) {
      w2[i] = w[i] ^ dv.dm[i];
    }
    recompress(dv.testt);
    if (eq(hTmp, h)) {
      foundCollision = true;
      break;
    }
    ubcDvMask &= ~(1 << b);
  }
}
origin: com.g2forge.alexandria/ax-java

public static short lsbMask(short value, boolean bit) {
  final int mask = (1 << Short.SIZE) - 1;
  final int _value = value & mask;
  return (short) Integer.lowestOneBit(bit ? ~_value : _value);
}
origin: com.g2forge.alexandria/ax-java

public static byte lsbMask(byte value, boolean bit) {
  final int mask = (1 << Byte.SIZE) - 1;
  final int _value = value & mask;
  return (byte) Integer.lowestOneBit(bit ? ~_value : _value);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

protected BitMaskTextProp(int sizeOfDataBlock, int maskInHeader, String overallName, String... subPropNames) {
  super(sizeOfDataBlock,maskInHeader,overallName);
  this.subPropNames = subPropNames;
  subPropMasks = new int[subPropNames.length];
  subPropMatches = new boolean[subPropNames.length];
  
  int LSB = Integer.lowestOneBit(maskInHeader);
  
  // Initialise the masks list
  for(int i=0; i<subPropMasks.length; i++) {
    subPropMasks[i] = (LSB << i);
  }
}

origin: io.github.repir/RepIRTools

public static int numberCoverBits(int v) {
  int l = Integer.lowestOneBit(v);
  int h = Integer.highestOneBit(v);
  return Integer.numberOfTrailingZeros(h / l) + 1;
}
origin: org.wildfly.security/wildfly-security-manager

  public Permission nextElement() {
    final int bit = Integer.lowestOneBit(bits);
    if (bit == 0) throw new NoSuchElementException();
    bits &= ~bit;
    return WildFlySecurityManagerPermission.values[Integer.numberOfTrailingZeros(bit)].getPermission();
  }
};
origin: sonia.jgit/org.eclipse.jgit

int allocFlag() {
  if (freeFlags == 0)
    throw new IllegalArgumentException(MessageFormat.format(
        JGitText.get().flagsAlreadyCreated,
        Integer.valueOf(32 - RESERVED_FLAGS)));
  final int m = Integer.lowestOneBit(freeFlags);
  freeFlags &= ~m;
  return m;
}
origin: org.wildfly.security/wildfly-elytron

public Permission nextElement() {
  final int bits = this.bits;
  if (bits == 0) throw new NoSuchElementException();
  if (Integer.bitCount(bits) == getNameEnumeration().size()) {
    this.bits = 0;
    return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*");
  }
  int bit = Integer.lowestOneBit(bits);
  this.bits = bits & ~bit;
  return permissionFor(Integer.numberOfTrailingZeros(bit));
}
origin: org.wildfly.security/wildfly-elytron-permission

public Permission nextElement() {
  final int bits = this.bits;
  if (bits == 0) throw new NoSuchElementException();
  if (Integer.bitCount(bits) == getNameEnumeration().size()) {
    this.bits = 0;
    return ((AbstractNamedPermission<?>) getSourcePermission()).withName("*");
  }
  int bit = Integer.lowestOneBit(bits);
  this.bits = bits & ~bit;
  return permissionFor(Integer.numberOfTrailingZeros(bit));
}
origin: apache/maven-surefire

private static boolean isLeafUnspecified( JUnitCoreParameters params )
{
  int maskOfParallel = params.isParallelSuites() ? 4 : 0;
  maskOfParallel |= params.isParallelClasses() ? 2 : 0;
  maskOfParallel |= params.isParallelMethods() ? 1 : 0;
  int maskOfConcurrency = params.getThreadCountSuites() > 0 ? 4 : 0;
  maskOfConcurrency |= params.getThreadCountClasses() > 0 ? 2 : 0;
  maskOfConcurrency |= params.getThreadCountMethods() > 0 ? 1 : 0;
  maskOfConcurrency &= maskOfParallel;
  int leaf = Integer.lowestOneBit( maskOfParallel );
  return maskOfConcurrency == maskOfParallel - leaf;
}
java.langIntegerlowestOneBit

Javadoc

Determines the lowest (rightmost) bit of the specified integer that is 1 and returns the bit mask value for that bit. This is also referred to as the Least Significant 1 Bit. Returns zero if the specified integer is zero.

Popular methods of Integer

  • parseInt
    Parses the specified string as a signed integer value using the specified radix. The ASCII character
  • toString
    Converts the specified signed integer into a string representation based on the specified radix. The
  • valueOf
    Parses the specified string as a signed integer value using the specified radix.
  • intValue
    Gets the primitive value of this int.
  • <init>
    Constructs a new Integer from the specified string.
  • toHexString
    Returns a string representation of the integer argument as an unsigned integer in base 16.The unsign
  • equals
    Compares this instance with the specified object and indicates if they are equal. In order to be equ
  • compareTo
    Compares this Integer object to another object. If the object is an Integer, this function behaves l
  • hashCode
  • compare
    Compares two int values.
  • longValue
    Returns the value of this Integer as along.
  • decode
    Parses the specified string and returns a Integer instance if the string can be decoded into an inte
  • longValue,
  • decode,
  • numberOfLeadingZeros,
  • getInteger,
  • doubleValue,
  • toBinaryString,
  • byteValue,
  • bitCount,
  • shortValue,
  • highestOneBit

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Collectors (java.util.stream)
  • JFileChooser (javax.swing)
  • From CI to AI: The AI layer in your organization
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