Codota Logo
Numbers.toInt
Code IndexAdd Codota to your IDE (free)

How to use
toInt
method
in
org.beangle.commons.lang.Numbers

Best Java code snippets using org.beangle.commons.lang.Numbers.toInt (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: org.beangle.struts2/beangle-struts2-view

public void setRefresh(String refresh) {
 int refreshNum = Numbers.toInt(refresh);
 if (refreshNum > 0) this.refresh = String.valueOf(refreshNum);
}
origin: org.openurp.base/openurp-base-api4j

public int toMinutes() {
 String time = String.valueOf(value);
 if (value >= 6000) throw new RuntimeException("Invalid time " + time);
 while (time.length() < 4)
  time = "0" + time;
 return toInt(time.substring(0, 2)) * 60 + toInt(time.substring(2, 4));
}
origin: org.openurp.base/openurp-base-api4j

private static short convert(String time) {
 int index = time.indexOf(':');
 Assert.isTrue(index == 2 && time.length() == 5, "illegal time,it should with 00:00 format");
 Assert.isTrue((toInt(time.substring(0, index)) < 60 && toInt(time.substring(index + 1, index + 3)) < 60),
   "illegal time " + time + ",it should within 60:60.");
 return (short) toInt(time.substring(0, index) + time.substring(index + 1, index + 3));
}
origin: org.openurp.base/openurp-base-api4j

public static HourMinute newHourMinute(String time) {
 int index = time.indexOf(':');
 Assert.isTrue(index == 2 && time.length() == 5, "illegal time,it should with 00:00 format");
 Assert.isTrue((toInt(time.substring(0, index)) < 60 && toInt(time.substring(index + 1, index + 3)) < 60),
   "illegal time " + time + ",it should within 60:60.");
 return new HourMinute((short) toInt(time.substring(0, index) + time.substring(index + 1, index + 3)));
}
origin: org.openurp.base/openurp-base-api4j

private static int valuesOf(String terms) {
 if (terms.equals("*") || terms.equals("")) return 0;
 int result = 0;
 for (String t : Strings.split(terms, ",")) {
  result |= (1 << Numbers.toInt(t));
 }
 return result;
}
origin: org.openurp.edu.course/openurp-edu-course-api4j

public static GenderRatio of(String value) {
 if (value == null) throw new RuntimeException("value cannot be null");
 if (-1 == value.indexOf(':')) throw new RuntimeException("value should contain ':'");
 else {
  String[] pair = Strings.split(value, ':');
  if (!(Numbers.isNumber(pair[0])
    && Numbers.isNumber(pair[1]))) { throw new RuntimeException("bad format of ratio :" + value); }
  int res = (Numbers.toInt(pair[0]) << 8) + Numbers.toInt(pair[1]);
  return new GenderRatio((short) res);
 }
}
origin: org.openurp.edu.program/openurp-edu-program-api4j

public int getIndex() {
 String index = Strings.substringAfterLast(indexno, ".");
 if (Strings.isEmpty(index)) index = indexno;
 int idx = Numbers.toInt(index);
 if (idx <= 0) idx = 1;
 return idx;
}
origin: org.openurp.base/openurp-base-api4j

Integer[] nums = NumberSequence.buildInteger(Numbers.toInt(startWeek), Numbers.toInt(endWeek),
  pattern);
numbers.addAll(Arrays.asList(nums));
numbers.add(Numbers.toInt(weekPair));
org.beangle.commons.langNumberstoInt

Popular methods of Numbers

  • isDigits
  • isNumber

Popular in Java

  • Updating database using SQL prepared statement
  • getSystemService (Context)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
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