java.text.SimpleDateFormat.parseNumber()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中java.text.SimpleDateFormat.parseNumber()方法的一些代码示例,展示了SimpleDateFormat.parseNumber()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimpleDateFormat.parseNumber()方法的具体详情如下:
包路径:java.text.SimpleDateFormat
类名称:SimpleDateFormat
方法名:parseNumber

SimpleDateFormat.parseNumber介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: robovm/robovm

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: robovm/robovm

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

代码示例来源:origin: ibinti/bugvm

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: MobiVM/robovm

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: com.gluonhq/robovm-rt

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: com.bugvm/bugvm-rt

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: FlexoVM/flexovm

private int parseNumber(int max, String string, int offset, int field, int skew) {
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(max, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
  }
  calendar.set(field, result.intValue() + skew);
  return position.getIndex();
}

代码示例来源:origin: MobiVM/robovm

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: ibinti/bugvm

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: com.gluonhq/robovm-rt

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: com.bugvm/bugvm-rt

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: FlexoVM/flexovm

private int parseMonth(String string, int offset, int count, int absolute, boolean standAlone) {
 if (count <= 2) {
  return parseNumber(absolute, string, offset, Calendar.MONTH, -1);
 }
 LocaleData ld = formatData.localeData;
 int index = parseText(string, offset,
            standAlone ? ld.longStandAloneMonthNames : formatData.months,
            Calendar.MONTH);
 if (index < 0) {
  index = parseText(string, offset,
           standAlone ? ld.shortStandAloneMonthNames : formatData.shortMonths,
           Calendar.MONTH);
 }
 return index;
}

代码示例来源:origin: com.bugvm/bugvm-rt

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

代码示例来源:origin: MobiVM/robovm

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

代码示例来源:origin: ibinti/bugvm

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

代码示例来源:origin: FlexoVM/flexovm

} else {
    ParsePosition position = new ParsePosition(offset);
    Number result = parseNumber(absolute, string, position);
    if (result == null) {
      return -position.getErrorIndex() - 1;
case HOUR_OF_DAY1_FIELD: // 'k'
  ParsePosition position = new ParsePosition(offset);
  Number result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
case HOUR1_FIELD: // 'h'
  position = new ParsePosition(offset);
  result = parseNumber(absolute, string, position);
  if (result == null) {
    return -position.getErrorIndex() - 1;
return parseNumber(absolute, string, offset, field, 0);

相关文章

SimpleDateFormat类方法