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

How to use
parseUnsignedInt
method
in
java.lang.Integer

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

origin: KronicDeth/intellij-elixir

@NotNull
private static Optional<Integer> releaseToMajor(@NotNull Release release) {
  Optional<Integer> major;
  try {
    major = Optional.of(Integer.parseUnsignedInt(release.major));
  } catch (NumberFormatException numberFormatException) {
    major = Optional.empty();
  }
  return major;
}
origin: wildfly/wildfly

  @Override
  public Object getKeyMapping(String value) {
    int index = Integer.parseUnsignedInt(value.substring(0, this.padding), HEX_RADIX);
    KeyFormat<Object> keyFormat = this.keyFormats.get(index);
    return keyFormat.parse(value.substring(this.padding));
  }
}
origin: KronicDeth/intellij-elixir

  @NotNull
  private static Optional<Integer> releaseToMinor(@NotNull Release release) {
    Optional<Integer> minor;
    @Nullable String releaseMinor = release.minor;

    if (releaseMinor != null) {
      try {
        minor = Optional.of(Integer.parseUnsignedInt(release.minor));
      } catch (NumberFormatException numberFormatException) {
        minor = Optional.empty();
      }
    } else {
      minor = Optional.empty();
    }

    return minor;
  }
}
origin: apache/pulsar

private static String validateHostName(String serviceName,
                    String[] serviceInfos,
                    String hostname) {
  String[] parts = hostname.split(":");
  if (parts.length >= 3) {
    throw new IllegalArgumentException("Invalid hostname : " + hostname);
  } else if (parts.length == 2) {
    try {
      Integer.parseUnsignedInt(parts[1]);
    } catch (NumberFormatException nfe) {
      throw new IllegalArgumentException("Invalid hostname : " + hostname);
    }
    return hostname;
  } else if (parts.length == 1) {
    return hostname + ":" + getServicePort(serviceName, serviceInfos);
  } else {
    return hostname;
  }
}
origin: vavr-io/vavr

/**
 * Parses this {@code CharSeq} as a unsigned decimal int by calling {@link Integer#parseUnsignedInt(String)}.
 * <p>
 * We write
 *
 * <pre><code>
 * int value = charSeq.parseUnsignedInt();
 * </code></pre>
 *
 * instead of
 *
 * <pre><code>
 * int value = Integer.parseUnsignedInt(charSeq.mkString());
 * </code></pre>
 *
 * @return the unsigned int value represented by this {@code CharSeq} in decimal
 * @throws NumberFormatException If this {@code CharSeq} does not contain a parsable unsigned int.
 */
@GwtIncompatible
public int parseUnsignedInt() {
  return Integer.parseUnsignedInt(back);
}
origin: vavr-io/vavr

/**
 * Parses this {@code CharSeq} as a unsigned int in the specified radix
 * by calling {@link Integer#parseUnsignedInt(String, int)}.
 * <p>
 * We write
 *
 * <pre><code>
 * int value = charSeq.parseUnsignedInt(radix);
 * </code></pre>
 *
 * instead of
 *
 * <pre><code>
 * int value = Integer.parseUnsignedInt(charSeq.mkString(), radix);
 * </code></pre>
 *
 * @param radix the radix to be used in interpreting this {@code CharSeq}
 * @return the unsigned int value represented by this {@code CharSeq} in the specified radix
 * @throws NumberFormatException If this {@code CharSeq} does not contain a parsable unsigned int.
 */
@GwtIncompatible
public int parseUnsignedInt(int radix) {
  return Integer.parseUnsignedInt(back, radix);
}
origin: checkstyle/checkstyle

result = Integer.parseUnsignedInt(txt, radix);
origin: oracle/opengrok

  lineno = Integer.parseUnsignedInt(lnum);
} catch (NumberFormatException e) {
  lineno = 0;
origin: apache/hive

final int targetNumShardsPerGranularity = Integer.parseUnsignedInt(
  tableProperties.getProperty(Constants.DRUID_TARGET_SHARDS_PER_GRANULARITY, "0"));
final int maxPartitionSize = targetNumShardsPerGranularity > 0 ? -1 : HiveConf
origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Converts a positive value into an {@code int}.
 *
 * @param value
 *            to convert
 * @return the value, or -1 if it wasn't a positive integral value
 */
public static int positive(String value) {
  if (value != null) {
    try {
      return Integer.parseUnsignedInt(value);
    } catch (NumberFormatException e) {
      // Ignore
    }
  }
  return -1;
}
origin: stackoverflow.com

 int uint = Integer.parseUnsignedInt("4294967295");
System.out.println(Integer.toUnsignedString(uint));
origin: DV8FromTheWorld/JDA

  /**
   * Retrieves the JDA instance represented by the provided shard ID
   * or {@code null} if none of the connected shards match the provided id.
   *
   * @param  id
   *         The ID of the shard
   *
   * @throws java.lang.NumberFormatException
   *         If the provided String is {@code null} or
   *         cannot be resolved to an unsigned int id
   *
   * @return Possibly-null entity for the specified shard ID
   */
  default JDA getElementById(String id)
  {
    return getElementById(Integer.parseUnsignedInt(id));
  }
}
origin: stackoverflow.com

 long l = Integer.toUnsignedLong(uint);
System.out.println(l); // will print 4294967295

int x = Integer.parseUnsignedInt("4294967295");
int y = 5;
int cmp1 = Integer.compareUnsigned(x,y); // interprets x as 4294967295 (x>y) 
int cmp2 = Integer.compare(x,y); // interprets x as -1 (x<y)
origin: org.eclipse.jgit/org.eclipse.jgit

  @Override
  public Integer get() {
    String rawValue = SystemReader.getInstance()
        .getProperty(MAX_REDIRECT_SYSTEM_PROPERTY);
    Integer value = Integer.valueOf(DEFAULT_MAX_REDIRECTS);
    if (rawValue != null) {
      try {
        value = Integer.valueOf(Integer.parseUnsignedInt(rawValue));
      } catch (NumberFormatException e) {
        LOG.warn(MessageFormat.format(
            JGitText.get().invalidSystemProperty,
            MAX_REDIRECT_SYSTEM_PROPERTY, rawValue, value));
      }
    }
    return value;
  }
}).get().intValue();
origin: apache/accumulo

 @Override
 public AppenderSkeleton apply(MonitorLocation loc) {
  int defaultPort = Integer.parseUnsignedInt(Property.MONITOR_LOG4J_PORT.getDefaultValue());
  HostAndPort remote = HostAndPort.fromString(loc.getLocation());
  SocketAppender socketAppender = new SocketAppender();
  socketAppender.setApplication(System.getProperty("accumulo.application", "unknown"));
  socketAppender.setRemoteHost(remote.getHost());
  socketAppender.setPort(remote.getPortOrDefault(defaultPort));
  return socketAppender;
 }
}
origin: stackoverflow.com

 try {
  String guessText = JOptionPane.showInputDialog("Enter your next guess");
  int guess = Integer.parseUnsignedInt(guessText);
} catch (NumberFormatException ex) {
  ...
}
origin: Netflix/iceberg

 private static int getPoolSize(String systemProperty, int defaultSize) {
  String value = System.getProperty(systemProperty);
  if (value != null) {
   try {
    return Integer.parseUnsignedInt(value);
   } catch (NumberFormatException e) {
    // will return the default
   }
  }
  return defaultSize;
 }
}
origin: stackoverflow.com

 public static void main(String[] args) {
  SubnetTree tree = new SubnetTree();
  tree.add(Integer.parseUnsignedInt("01100110000000000000000000000000", 2), 8);
  System.out.println("true: " + tree.isInRange(Integer.parseUnsignedInt("01100110000000000000100010000101", 2)));
  System.out.println("false: " + tree.isInRange(Integer.parseUnsignedInt("01101110000000000000100010000101", 2)));

  tree.add(Integer.parseUnsignedInt("01001110000000000000000000000000", 2), 6);
  System.out.println("true: " + tree.isInRange(Integer.parseUnsignedInt("01100110000000000000100010000101", 2)));
  System.out.println("false: " + tree.isInRange(Integer.parseUnsignedInt("01101110000000000000100010000101", 2)));
  System.out.println("true: " + tree.isInRange(Integer.parseUnsignedInt("01001110100000000000000000000000", 2)));
  System.out.println("true: " + tree.isInRange(Integer.parseUnsignedInt("01001100100000000000000000111111", 2)));
}
origin: io.digdag/digdag-cli

private static Id tryParseScheduleId(String s)
{
  try {
    return Id.of(Integer.toString(Integer.parseUnsignedInt(s)));
  }
  catch (NumberFormatException ignore) {
    return null;
  }
}
origin: org.opencypher/grammar

private static Function<String, Integer> parseInt( Repetition repetition )
{
  return in -> {
    int result = parseUnsignedInt( in );
    return (result < repetition.minTimes() || (repetition.limited() && result > repetition.maxTimes()))
        ? null : result;
  };
}
java.langIntegerparseUnsignedInt

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

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • Notification (javax.management)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
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