id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
22,300 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeSubtract | public static long safeSubtract(long val1, long val2) {
long diff = val1 - val2;
// If there is a sign change, but the two values have different signs...
if ((val1 ^ diff) < 0 && (val1 ^ val2) < 0) {
throw new ArithmeticException
("The calculation caused an overflow: ... | java | public static long safeSubtract(long val1, long val2) {
long diff = val1 - val2;
// If there is a sign change, but the two values have different signs...
if ((val1 ^ diff) < 0 && (val1 ^ val2) < 0) {
throw new ArithmeticException
("The calculation caused an overflow: ... | [
"public",
"static",
"long",
"safeSubtract",
"(",
"long",
"val1",
",",
"long",
"val2",
")",
"{",
"long",
"diff",
"=",
"val1",
"-",
"val2",
";",
"// If there is a sign change, but the two values have different signs...",
"if",
"(",
"(",
"val1",
"^",
"diff",
")",
"... | Subtracts two values throwing an exception if overflow occurs.
@param val1 the first value, to be taken away from
@param val2 the second value, the amount to take away
@return the new total
@throws ArithmeticException if the value is too big or too small | [
"Subtracts",
"two",
"values",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L102-L110 |
22,301 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeDivide | public static long safeDivide(long dividend, long divisor) {
if (dividend == Long.MIN_VALUE && divisor == -1L) {
throw new ArithmeticException("Multiplication overflows a long: " + dividend + " / " + divisor);
}
return dividend / divisor;
} | java | public static long safeDivide(long dividend, long divisor) {
if (dividend == Long.MIN_VALUE && divisor == -1L) {
throw new ArithmeticException("Multiplication overflows a long: " + dividend + " / " + divisor);
}
return dividend / divisor;
} | [
"public",
"static",
"long",
"safeDivide",
"(",
"long",
"dividend",
",",
"long",
"divisor",
")",
"{",
"if",
"(",
"dividend",
"==",
"Long",
".",
"MIN_VALUE",
"&&",
"divisor",
"==",
"-",
"1L",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"Multiplic... | Divides the dividend by the divisor throwing an exception if
overflow occurs or the divisor is zero.
@param dividend the dividend
@param divisor the divisor
@return the new total
@throws ArithmeticException if the operation overflows or the divisor is zero | [
"Divides",
"the",
"dividend",
"by",
"the",
"divisor",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"or",
"the",
"divisor",
"is",
"zero",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L191-L196 |
22,302 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeDivide | public static long safeDivide(long dividend, long divisor, RoundingMode roundingMode) {
if (dividend == Long.MIN_VALUE && divisor == -1L) {
throw new ArithmeticException("Multiplication overflows a long: " + dividend + " / " + divisor);
}
BigDecimal dividendBigDecimal = new BigDecim... | java | public static long safeDivide(long dividend, long divisor, RoundingMode roundingMode) {
if (dividend == Long.MIN_VALUE && divisor == -1L) {
throw new ArithmeticException("Multiplication overflows a long: " + dividend + " / " + divisor);
}
BigDecimal dividendBigDecimal = new BigDecim... | [
"public",
"static",
"long",
"safeDivide",
"(",
"long",
"dividend",
",",
"long",
"divisor",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"if",
"(",
"dividend",
"==",
"Long",
".",
"MIN_VALUE",
"&&",
"divisor",
"==",
"-",
"1L",
")",
"{",
"throw",
"new",
"... | Divides the dividend by divisor. Rounding of result occurs
as per the roundingMode.
@param dividend the dividend
@param divisor the divisor
@param roundingMode the desired rounding mode
@return the division result as per the specified rounding mode
@throws ArithmeticException if the operation overflows or the divis... | [
"Divides",
"the",
"dividend",
"by",
"divisor",
".",
"Rounding",
"of",
"result",
"occurs",
"as",
"per",
"the",
"roundingMode",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L208-L216 |
22,303 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.safeMultiplyToInt | public static int safeMultiplyToInt(long val1, long val2) {
long val = FieldUtils.safeMultiply(val1, val2);
return FieldUtils.safeToInt(val);
} | java | public static int safeMultiplyToInt(long val1, long val2) {
long val = FieldUtils.safeMultiply(val1, val2);
return FieldUtils.safeToInt(val);
} | [
"public",
"static",
"int",
"safeMultiplyToInt",
"(",
"long",
"val1",
",",
"long",
"val2",
")",
"{",
"long",
"val",
"=",
"FieldUtils",
".",
"safeMultiply",
"(",
"val1",
",",
"val2",
")",
";",
"return",
"FieldUtils",
".",
"safeToInt",
"(",
"val",
")",
";",... | Multiply two values to return an int throwing an exception if overflow occurs.
@param val1 the first value
@param val2 the second value
@return the new total
@throws ArithmeticException if the value is too big or too small | [
"Multiply",
"two",
"values",
"to",
"return",
"an",
"int",
"throwing",
"an",
"exception",
"if",
"overflow",
"occurs",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L240-L243 |
22,304 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.getWrappedValue | public static int getWrappedValue(int currentValue, int wrapValue,
int minValue, int maxValue) {
return getWrappedValue(currentValue + wrapValue, minValue, maxValue);
} | java | public static int getWrappedValue(int currentValue, int wrapValue,
int minValue, int maxValue) {
return getWrappedValue(currentValue + wrapValue, minValue, maxValue);
} | [
"public",
"static",
"int",
"getWrappedValue",
"(",
"int",
"currentValue",
",",
"int",
"wrapValue",
",",
"int",
"minValue",
",",
"int",
"maxValue",
")",
"{",
"return",
"getWrappedValue",
"(",
"currentValue",
"+",
"wrapValue",
",",
"minValue",
",",
"maxValue",
"... | Utility method used by addWrapField implementations to ensure the new
value lies within the field's legal value range.
@param currentValue the current value of the data, which may lie outside
the wrapped value range
@param wrapValue the value to add to current value before
wrapping. This may be negative.
@param minV... | [
"Utility",
"method",
"used",
"by",
"addWrapField",
"implementations",
"to",
"ensure",
"the",
"new",
"value",
"lies",
"within",
"the",
"field",
"s",
"legal",
"value",
"range",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L313-L316 |
22,305 | JodaOrg/joda-time | src/main/java/org/joda/time/field/FieldUtils.java | FieldUtils.getWrappedValue | public static int getWrappedValue(int value, int minValue, int maxValue) {
if (minValue >= maxValue) {
throw new IllegalArgumentException("MIN > MAX");
}
int wrapRange = maxValue - minValue + 1;
value -= minValue;
if (value >= 0) {
return (value % wrapRa... | java | public static int getWrappedValue(int value, int minValue, int maxValue) {
if (minValue >= maxValue) {
throw new IllegalArgumentException("MIN > MAX");
}
int wrapRange = maxValue - minValue + 1;
value -= minValue;
if (value >= 0) {
return (value % wrapRa... | [
"public",
"static",
"int",
"getWrappedValue",
"(",
"int",
"value",
",",
"int",
"minValue",
",",
"int",
"maxValue",
")",
"{",
"if",
"(",
"minValue",
">=",
"maxValue",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"MIN > MAX\"",
")",
";",
"}",
... | Utility method that ensures the given value lies within the field's
legal value range.
@param value the value to fit into the wrapped value range
@param minValue the wrap range minimum value.
@param maxValue the wrap range maximum value. This must be
greater than minValue (checked by the method).
@return the wrapped... | [
"Utility",
"method",
"that",
"ensures",
"the",
"given",
"value",
"lies",
"within",
"the",
"field",
"s",
"legal",
"value",
"range",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/FieldUtils.java#L330-L348 |
22,306 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.isNumericToken | private static boolean isNumericToken(String token) {
int tokenLen = token.length();
if (tokenLen > 0) {
char c = token.charAt(0);
switch (c) {
case 'c': // century (number)
case 'C': // century of era (number)
case 'x': // weekyear (number)
... | java | private static boolean isNumericToken(String token) {
int tokenLen = token.length();
if (tokenLen > 0) {
char c = token.charAt(0);
switch (c) {
case 'c': // century (number)
case 'C': // century of era (number)
case 'x': // weekyear (number)
... | [
"private",
"static",
"boolean",
"isNumericToken",
"(",
"String",
"token",
")",
"{",
"int",
"tokenLen",
"=",
"token",
".",
"length",
"(",
")",
";",
"if",
"(",
"tokenLen",
">",
"0",
")",
"{",
"char",
"c",
"=",
"token",
".",
"charAt",
"(",
"0",
")",
"... | Returns true if token should be parsed as a numeric field.
@param token the token to parse
@return true if numeric field | [
"Returns",
"true",
"if",
"token",
"should",
"be",
"parsed",
"as",
"a",
"numeric",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L638-L670 |
22,307 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.createFormatterForPattern | private static DateTimeFormatter createFormatterForPattern(String pattern) {
if (pattern == null || pattern.length() == 0) {
throw new IllegalArgumentException("Invalid pattern specification");
}
DateTimeFormatter formatter = cPatternCache.get(pattern);
if (formatter == null)... | java | private static DateTimeFormatter createFormatterForPattern(String pattern) {
if (pattern == null || pattern.length() == 0) {
throw new IllegalArgumentException("Invalid pattern specification");
}
DateTimeFormatter formatter = cPatternCache.get(pattern);
if (formatter == null)... | [
"private",
"static",
"DateTimeFormatter",
"createFormatterForPattern",
"(",
"String",
"pattern",
")",
"{",
"if",
"(",
"pattern",
"==",
"null",
"||",
"pattern",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"In... | Select a format from a custom pattern.
@param pattern pattern specification
@throws IllegalArgumentException if the pattern is invalid
@see #appendPatternTo | [
"Select",
"a",
"format",
"from",
"a",
"custom",
"pattern",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L680-L699 |
22,308 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.createFormatterForStyle | private static DateTimeFormatter createFormatterForStyle(String style) {
if (style == null || style.length() != 2) {
throw new IllegalArgumentException("Invalid style specification: " + style);
}
int dateStyle = selectStyle(style.charAt(0));
int timeStyle = selectStyle(style.... | java | private static DateTimeFormatter createFormatterForStyle(String style) {
if (style == null || style.length() != 2) {
throw new IllegalArgumentException("Invalid style specification: " + style);
}
int dateStyle = selectStyle(style.charAt(0));
int timeStyle = selectStyle(style.... | [
"private",
"static",
"DateTimeFormatter",
"createFormatterForStyle",
"(",
"String",
"style",
")",
"{",
"if",
"(",
"style",
"==",
"null",
"||",
"style",
".",
"length",
"(",
")",
"!=",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid st... | Select a format from a two character style pattern. The first character
is the date style, and the second character is the time style. Specify a
character of 'S' for short style, 'M' for medium, 'L' for long, and 'F'
for full. A date or time may be omitted by specifying a style character '-'.
@param style two charact... | [
"Select",
"a",
"format",
"from",
"a",
"two",
"character",
"style",
"pattern",
".",
"The",
"first",
"character",
"is",
"the",
"date",
"style",
"and",
"the",
"second",
"character",
"is",
"the",
"time",
"style",
".",
"Specify",
"a",
"character",
"of",
"S",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L710-L720 |
22,309 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.createFormatterForStyleIndex | private static DateTimeFormatter createFormatterForStyleIndex(int dateStyle, int timeStyle) {
int index = ((dateStyle << 2) + dateStyle) + timeStyle; // (dateStyle * 5 + timeStyle);
// Should never happen but do a double check...
if (index >= cStyleCache.length()) {
return createDat... | java | private static DateTimeFormatter createFormatterForStyleIndex(int dateStyle, int timeStyle) {
int index = ((dateStyle << 2) + dateStyle) + timeStyle; // (dateStyle * 5 + timeStyle);
// Should never happen but do a double check...
if (index >= cStyleCache.length()) {
return createDat... | [
"private",
"static",
"DateTimeFormatter",
"createFormatterForStyleIndex",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
")",
"{",
"int",
"index",
"=",
"(",
"(",
"dateStyle",
"<<",
"2",
")",
"+",
"dateStyle",
")",
"+",
"timeStyle",
";",
"// (dateStyle * 5 + t... | Gets the formatter for the specified style.
@param dateStyle the date style
@param timeStyle the time style
@return the formatter | [
"Gets",
"the",
"formatter",
"for",
"the",
"specified",
"style",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L729-L743 |
22,310 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.createDateTimeFormatter | private static DateTimeFormatter createDateTimeFormatter(int dateStyle, int timeStyle){
int type = DATETIME;
if (dateStyle == NONE) {
type = TIME;
} else if (timeStyle == NONE) {
type = DATE;
}
StyleFormatter llf = new StyleFormatter(dateStyle, timeStyle, ... | java | private static DateTimeFormatter createDateTimeFormatter(int dateStyle, int timeStyle){
int type = DATETIME;
if (dateStyle == NONE) {
type = TIME;
} else if (timeStyle == NONE) {
type = DATE;
}
StyleFormatter llf = new StyleFormatter(dateStyle, timeStyle, ... | [
"private",
"static",
"DateTimeFormatter",
"createDateTimeFormatter",
"(",
"int",
"dateStyle",
",",
"int",
"timeStyle",
")",
"{",
"int",
"type",
"=",
"DATETIME",
";",
"if",
"(",
"dateStyle",
"==",
"NONE",
")",
"{",
"type",
"=",
"TIME",
";",
"}",
"else",
"if... | Creates a formatter for the specified style.
@param dateStyle the date style
@param timeStyle the time style
@return the formatter | [
"Creates",
"a",
"formatter",
"for",
"the",
"specified",
"style",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L752-L761 |
22,311 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormat.java | DateTimeFormat.selectStyle | private static int selectStyle(char ch) {
switch (ch) {
case 'S':
return SHORT;
case 'M':
return MEDIUM;
case 'L':
return LONG;
case 'F':
return FULL;
case '-':
return NONE;
default:
throw new... | java | private static int selectStyle(char ch) {
switch (ch) {
case 'S':
return SHORT;
case 'M':
return MEDIUM;
case 'L':
return LONG;
case 'F':
return FULL;
case '-':
return NONE;
default:
throw new... | [
"private",
"static",
"int",
"selectStyle",
"(",
"char",
"ch",
")",
"{",
"switch",
"(",
"ch",
")",
"{",
"case",
"'",
"'",
":",
"return",
"SHORT",
";",
"case",
"'",
"'",
":",
"return",
"MEDIUM",
";",
"case",
"'",
"'",
":",
"return",
"LONG",
";",
"c... | Gets the JDK style code from the Joda code.
@param ch the Joda style code
@return the JDK style code | [
"Gets",
"the",
"JDK",
"style",
"code",
"from",
"the",
"Joda",
"code",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormat.java#L769-L784 |
22,312 | JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.setPeriod | public void setPeriod(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
super.setPeriod(years, months, weeks, days, hours, minutes, seconds, millis);
} | java | public void setPeriod(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
super.setPeriod(years, months, weeks, days, hours, minutes, seconds, millis);
} | [
"public",
"void",
"setPeriod",
"(",
"int",
"years",
",",
"int",
"months",
",",
"int",
"weeks",
",",
"int",
"days",
",",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
",",
"int",
"millis",
")",
"{",
"super",
".",
"setPeriod",
"(",
"yea... | Sets all the fields in one go.
@param years amount of years in this period, which must be zero if unsupported
@param months amount of months in this period, which must be zero if unsupported
@param weeks amount of weeks in this period, which must be zero if unsupported
@param days amount of days in this period, wh... | [
"Sets",
"all",
"the",
"fields",
"in",
"one",
"go",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L484-L487 |
22,313 | JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.setPeriod | public void setPeriod(ReadableInterval interval) {
if (interval == null) {
setPeriod(0L);
} else {
Chronology chrono = DateTimeUtils.getChronology(interval.getChronology());
setPeriod(interval.getStartMillis(), interval.getEndMillis(), chrono);
}
} | java | public void setPeriod(ReadableInterval interval) {
if (interval == null) {
setPeriod(0L);
} else {
Chronology chrono = DateTimeUtils.getChronology(interval.getChronology());
setPeriod(interval.getStartMillis(), interval.getEndMillis(), chrono);
}
} | [
"public",
"void",
"setPeriod",
"(",
"ReadableInterval",
"interval",
")",
"{",
"if",
"(",
"interval",
"==",
"null",
")",
"{",
"setPeriod",
"(",
"0L",
")",
";",
"}",
"else",
"{",
"Chronology",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"inter... | Sets all the fields in one go from an interval using the ISO chronology
and dividing the fields using the period type.
@param interval the interval to set, null means zero length
@throws ArithmeticException if the set exceeds the capacity of the period | [
"Sets",
"all",
"the",
"fields",
"in",
"one",
"go",
"from",
"an",
"interval",
"using",
"the",
"ISO",
"chronology",
"and",
"dividing",
"the",
"fields",
"using",
"the",
"period",
"type",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L496-L503 |
22,314 | JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.setPeriod | public void setPeriod(long startInstant, long endInstant, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
setValues(chrono.get(this, startInstant, endInstant));
} | java | public void setPeriod(long startInstant, long endInstant, Chronology chrono) {
chrono = DateTimeUtils.getChronology(chrono);
setValues(chrono.get(this, startInstant, endInstant));
} | [
"public",
"void",
"setPeriod",
"(",
"long",
"startInstant",
",",
"long",
"endInstant",
",",
"Chronology",
"chrono",
")",
"{",
"chrono",
"=",
"DateTimeUtils",
".",
"getChronology",
"(",
"chrono",
")",
";",
"setValues",
"(",
"chrono",
".",
"get",
"(",
"this",
... | Sets all the fields in one go from a millisecond interval.
@param startInstant interval start, in milliseconds
@param endInstant interval end, in milliseconds
@param chrono the chronology to use, null means ISO chronology
@throws ArithmeticException if the set exceeds the capacity of the period | [
"Sets",
"all",
"the",
"fields",
"in",
"one",
"go",
"from",
"a",
"millisecond",
"interval",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L546-L549 |
22,315 | JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.add | public void add(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
setPeriod(
FieldUtils.safeAdd(getYears(), years),
FieldUtils.safeAdd(getMonths(), months),
FieldUtils.safeAdd(getWeeks(), weeks),
... | java | public void add(int years, int months, int weeks, int days,
int hours, int minutes, int seconds, int millis) {
setPeriod(
FieldUtils.safeAdd(getYears(), years),
FieldUtils.safeAdd(getMonths(), months),
FieldUtils.safeAdd(getWeeks(), weeks),
... | [
"public",
"void",
"add",
"(",
"int",
"years",
",",
"int",
"months",
",",
"int",
"weeks",
",",
"int",
"days",
",",
"int",
"hours",
",",
"int",
"minutes",
",",
"int",
"seconds",
",",
"int",
"millis",
")",
"{",
"setPeriod",
"(",
"FieldUtils",
".",
"safe... | Adds to each field of this period.
@param years amount of years to add to this period, which must be zero if unsupported
@param months amount of months to add to this period, which must be zero if unsupported
@param weeks amount of weeks to add to this period, which must be zero if unsupported
@param days amount o... | [
"Adds",
"to",
"each",
"field",
"of",
"this",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L655-L667 |
22,316 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadablePartialConverter.java | ReadablePartialConverter.getChronology | public Chronology getChronology(Object object, DateTimeZone zone) {
return getChronology(object, (Chronology) null).withZone(zone);
} | java | public Chronology getChronology(Object object, DateTimeZone zone) {
return getChronology(object, (Chronology) null).withZone(zone);
} | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"DateTimeZone",
"zone",
")",
"{",
"return",
"getChronology",
"(",
"object",
",",
"(",
"Chronology",
")",
"null",
")",
".",
"withZone",
"(",
"zone",
")",
";",
"}"
] | Gets the chronology, which is taken from the ReadablePartial.
@param object the ReadablePartial to convert, must not be null
@param zone the specified zone to use, null means default zone
@return the chronology, never null | [
"Gets",
"the",
"chronology",
"which",
"is",
"taken",
"from",
"the",
"ReadablePartial",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadablePartialConverter.java#L52-L54 |
22,317 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadablePartialConverter.java | ReadablePartialConverter.getPartialValues | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono) {
ReadablePartial input = (ReadablePartial) object;
int size = fieldSource.size();
int[] values = new int[size];
for (int i = 0; i < size; i++) {
values[i] = input.get(fieldSource.get... | java | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono) {
ReadablePartial input = (ReadablePartial) object;
int size = fieldSource.size();
int[] values = new int[size];
for (int i = 0; i < size; i++) {
values[i] = input.get(fieldSource.get... | [
"public",
"int",
"[",
"]",
"getPartialValues",
"(",
"ReadablePartial",
"fieldSource",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"ReadablePartial",
"input",
"=",
"(",
"ReadablePartial",
")",
"object",
";",
"int",
"size",
"=",
"fieldSource",
... | Extracts the values of the partial from an object of this converter's type.
The chrono parameter is a hint to the converter, should it require a
chronology to aid in conversion.
@param fieldSource a partial that provides access to the fields.
This partial may be incomplete and only getFieldType(int) should be used
@p... | [
"Extracts",
"the",
"values",
"of",
"the",
"partial",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
".",
"The",
"chrono",
"parameter",
"is",
"a",
"hint",
"to",
"the",
"converter",
"should",
"it",
"require",
"a",
"chronology",
"to",
"aid",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadablePartialConverter.java#L86-L95 |
22,318 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BuddhistChronology.java | BuddhistChronology.getInstance | public static BuddhistChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
BuddhistChronology chrono = cCache.get(zone);
if (chrono == null) {
// First create without a lower limit.
chrono = new BuddhistCh... | java | public static BuddhistChronology getInstance(DateTimeZone zone) {
if (zone == null) {
zone = DateTimeZone.getDefault();
}
BuddhistChronology chrono = cCache.get(zone);
if (chrono == null) {
// First create without a lower limit.
chrono = new BuddhistCh... | [
"public",
"static",
"BuddhistChronology",
"getInstance",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"==",
"null",
")",
"{",
"zone",
"=",
"DateTimeZone",
".",
"getDefault",
"(",
")",
";",
"}",
"BuddhistChronology",
"chrono",
"=",
"cCache",
".",... | Standard instance of a Buddhist Chronology, that matches
Sun's BuddhistCalendar class. This means that it follows the
GregorianJulian calendar rules with a cutover date.
@param zone the time zone to use, null is default | [
"Standard",
"instance",
"of",
"a",
"Buddhist",
"Chronology",
"that",
"matches",
"Sun",
"s",
"BuddhistCalendar",
"class",
".",
"This",
"means",
"that",
"it",
"follows",
"the",
"GregorianJulian",
"calendar",
"rules",
"with",
"a",
"cutover",
"date",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BuddhistChronology.java#L104-L121 |
22,319 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getWeeksInYear | int getWeeksInYear(int year) {
long firstWeekMillis1 = getFirstWeekOfYearMillis(year);
long firstWeekMillis2 = getFirstWeekOfYearMillis(year + 1);
return (int) ((firstWeekMillis2 - firstWeekMillis1) / DateTimeConstants.MILLIS_PER_WEEK);
} | java | int getWeeksInYear(int year) {
long firstWeekMillis1 = getFirstWeekOfYearMillis(year);
long firstWeekMillis2 = getFirstWeekOfYearMillis(year + 1);
return (int) ((firstWeekMillis2 - firstWeekMillis1) / DateTimeConstants.MILLIS_PER_WEEK);
} | [
"int",
"getWeeksInYear",
"(",
"int",
"year",
")",
"{",
"long",
"firstWeekMillis1",
"=",
"getFirstWeekOfYearMillis",
"(",
"year",
")",
";",
"long",
"firstWeekMillis2",
"=",
"getFirstWeekOfYearMillis",
"(",
"year",
"+",
"1",
")",
";",
"return",
"(",
"int",
")",
... | Get the number of weeks in the year.
@param year the year to use
@return number of weeks in the year | [
"Get",
"the",
"number",
"of",
"weeks",
"in",
"the",
"year",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L353-L357 |
22,320 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getFirstWeekOfYearMillis | long getFirstWeekOfYearMillis(int year) {
long jan1millis = getYearMillis(year);
int jan1dayOfWeek = getDayOfWeek(jan1millis);
if (jan1dayOfWeek > (8 - iMinDaysInFirstWeek)) {
// First week is end of previous year because it doesn't have enough days.
return jan1m... | java | long getFirstWeekOfYearMillis(int year) {
long jan1millis = getYearMillis(year);
int jan1dayOfWeek = getDayOfWeek(jan1millis);
if (jan1dayOfWeek > (8 - iMinDaysInFirstWeek)) {
// First week is end of previous year because it doesn't have enough days.
return jan1m... | [
"long",
"getFirstWeekOfYearMillis",
"(",
"int",
"year",
")",
"{",
"long",
"jan1millis",
"=",
"getYearMillis",
"(",
"year",
")",
";",
"int",
"jan1dayOfWeek",
"=",
"getDayOfWeek",
"(",
"jan1millis",
")",
";",
"if",
"(",
"jan1dayOfWeek",
">",
"(",
"8",
"-",
"... | Get the millis for the first week of a year.
@param year the year to use
@return millis | [
"Get",
"the",
"millis",
"for",
"the",
"first",
"week",
"of",
"a",
"year",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L365-L378 |
22,321 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getYearMonthMillis | long getYearMonthMillis(int year, int month) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis;
} | java | long getYearMonthMillis(int year, int month) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis;
} | [
"long",
"getYearMonthMillis",
"(",
"int",
"year",
",",
"int",
"month",
")",
"{",
"long",
"millis",
"=",
"getYearMillis",
"(",
"year",
")",
";",
"millis",
"+=",
"getTotalMillisByYearMonth",
"(",
"year",
",",
"month",
")",
";",
"return",
"millis",
";",
"}"
] | Get the milliseconds for the start of a month.
@param year The year to use.
@param month The month to use
@return millis from 1970-01-01T00:00:00Z | [
"Get",
"the",
"milliseconds",
"for",
"the",
"start",
"of",
"a",
"month",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L397-L401 |
22,322 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getYearMonthDayMillis | long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis + (dayOfMonth - 1) * (long)DateTimeConstants.MILLIS_PER_DAY;
} | java | long getYearMonthDayMillis(int year, int month, int dayOfMonth) {
long millis = getYearMillis(year);
millis += getTotalMillisByYearMonth(year, month);
return millis + (dayOfMonth - 1) * (long)DateTimeConstants.MILLIS_PER_DAY;
} | [
"long",
"getYearMonthDayMillis",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"dayOfMonth",
")",
"{",
"long",
"millis",
"=",
"getYearMillis",
"(",
"year",
")",
";",
"millis",
"+=",
"getTotalMillisByYearMonth",
"(",
"year",
",",
"month",
")",
";",
"... | Get the milliseconds for a particular date.
@param year The year to use.
@param month The month to use
@param dayOfMonth The day of the month to use
@return millis from 1970-01-01T00:00:00Z | [
"Get",
"the",
"milliseconds",
"for",
"a",
"particular",
"date",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L411-L415 |
22,323 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getDaysInMonthMax | int getDaysInMonthMax(long instant) {
int thisYear = getYear(instant);
int thisMonth = getMonthOfYear(instant, thisYear);
return getDaysInYearMonth(thisYear, thisMonth);
} | java | int getDaysInMonthMax(long instant) {
int thisYear = getYear(instant);
int thisMonth = getMonthOfYear(instant, thisYear);
return getDaysInYearMonth(thisYear, thisMonth);
} | [
"int",
"getDaysInMonthMax",
"(",
"long",
"instant",
")",
"{",
"int",
"thisYear",
"=",
"getYear",
"(",
"instant",
")",
";",
"int",
"thisMonth",
"=",
"getMonthOfYear",
"(",
"instant",
",",
"thisYear",
")",
";",
"return",
"getDaysInYearMonth",
"(",
"thisYear",
... | Gets the maximum number of days in the month specified by the instant.
@param instant millis from 1970-01-01T00:00:00Z
@return the maximum number of days in the month | [
"Gets",
"the",
"maximum",
"number",
"of",
"days",
"in",
"the",
"month",
"specified",
"by",
"the",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L601-L605 |
22,324 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getDateMidnightMillis | long getDateMidnightMillis(int year, int monthOfYear, int dayOfMonth) {
FieldUtils.verifyValueBounds(DateTimeFieldType.year(), year, getMinYear() - 1, getMaxYear() + 1);
FieldUtils.verifyValueBounds(DateTimeFieldType.monthOfYear(), monthOfYear, 1, getMaxMonth(year));
FieldUtils.verifyValueBounds... | java | long getDateMidnightMillis(int year, int monthOfYear, int dayOfMonth) {
FieldUtils.verifyValueBounds(DateTimeFieldType.year(), year, getMinYear() - 1, getMaxYear() + 1);
FieldUtils.verifyValueBounds(DateTimeFieldType.monthOfYear(), monthOfYear, 1, getMaxMonth(year));
FieldUtils.verifyValueBounds... | [
"long",
"getDateMidnightMillis",
"(",
"int",
"year",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"DateTimeFieldType",
".",
"year",
"(",
")",
",",
"year",
",",
"getMinYear",
"(",
")",
"-",
"1",
... | Gets the milliseconds for a date at midnight.
@param year the year
@param monthOfYear the month
@param dayOfMonth the day
@return the milliseconds | [
"Gets",
"the",
"milliseconds",
"for",
"a",
"date",
"at",
"midnight",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L629-L641 |
22,325 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicChronology.java | BasicChronology.getYearInfo | private YearInfo getYearInfo(int year) {
YearInfo info = iYearInfoCache[year & CACHE_MASK];
if (info == null || info.iYear != year) {
info = new YearInfo(year, calculateFirstDayOfYearMillis(year));
iYearInfoCache[year & CACHE_MASK] = info;
}
return info;
} | java | private YearInfo getYearInfo(int year) {
YearInfo info = iYearInfoCache[year & CACHE_MASK];
if (info == null || info.iYear != year) {
info = new YearInfo(year, calculateFirstDayOfYearMillis(year));
iYearInfoCache[year & CACHE_MASK] = info;
}
return info;
} | [
"private",
"YearInfo",
"getYearInfo",
"(",
"int",
"year",
")",
"{",
"YearInfo",
"info",
"=",
"iYearInfoCache",
"[",
"year",
"&",
"CACHE_MASK",
"]",
";",
"if",
"(",
"info",
"==",
"null",
"||",
"info",
".",
"iYear",
"!=",
"year",
")",
"{",
"info",
"=",
... | Although accessed by multiple threads, this method doesn't need to be synchronized. | [
"Although",
"accessed",
"by",
"multiple",
"threads",
"this",
"method",
"doesn",
"t",
"need",
"to",
"be",
"synchronized",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicChronology.java#L781-L788 |
22,326 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/CachedDateTimeZone.java | CachedDateTimeZone.forZone | public static CachedDateTimeZone forZone(DateTimeZone zone) {
if (zone instanceof CachedDateTimeZone) {
return (CachedDateTimeZone)zone;
}
return new CachedDateTimeZone(zone);
} | java | public static CachedDateTimeZone forZone(DateTimeZone zone) {
if (zone instanceof CachedDateTimeZone) {
return (CachedDateTimeZone)zone;
}
return new CachedDateTimeZone(zone);
} | [
"public",
"static",
"CachedDateTimeZone",
"forZone",
"(",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"zone",
"instanceof",
"CachedDateTimeZone",
")",
"{",
"return",
"(",
"CachedDateTimeZone",
")",
"zone",
";",
"}",
"return",
"new",
"CachedDateTimeZone",
"(",
"... | Returns a new CachedDateTimeZone unless given zone is already cached. | [
"Returns",
"a",
"new",
"CachedDateTimeZone",
"unless",
"given",
"zone",
"is",
"already",
"cached",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/CachedDateTimeZone.java#L67-L72 |
22,327 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/FixedDateTimeZone.java | FixedDateTimeZone.toTimeZone | public java.util.TimeZone toTimeZone() {
String id = getID();
if (id.length() == 6 && (id.startsWith("+") || id.startsWith("-"))) {
// standard format offset [+-]hh:mm
// our ID is without any prefix, so we need to add the GMT back
return java.util.TimeZone.getTimeZon... | java | public java.util.TimeZone toTimeZone() {
String id = getID();
if (id.length() == 6 && (id.startsWith("+") || id.startsWith("-"))) {
// standard format offset [+-]hh:mm
// our ID is without any prefix, so we need to add the GMT back
return java.util.TimeZone.getTimeZon... | [
"public",
"java",
".",
"util",
".",
"TimeZone",
"toTimeZone",
"(",
")",
"{",
"String",
"id",
"=",
"getID",
"(",
")",
";",
"if",
"(",
"id",
".",
"length",
"(",
")",
"==",
"6",
"&&",
"(",
"id",
".",
"startsWith",
"(",
"\"+\"",
")",
"||",
"id",
".... | Override to return the correct timezone instance.
@since 1.5 | [
"Override",
"to",
"return",
"the",
"correct",
"timezone",
"instance",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/FixedDateTimeZone.java#L76-L85 |
22,328 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.forOffsetMillis | public static DateTimeZone forOffsetMillis(int millisOffset) {
if (millisOffset < -MAX_MILLIS || millisOffset > MAX_MILLIS) {
throw new IllegalArgumentException("Millis out of range: " + millisOffset);
}
String id = printOffset(millisOffset);
return fixedOffsetZone(id, millis... | java | public static DateTimeZone forOffsetMillis(int millisOffset) {
if (millisOffset < -MAX_MILLIS || millisOffset > MAX_MILLIS) {
throw new IllegalArgumentException("Millis out of range: " + millisOffset);
}
String id = printOffset(millisOffset);
return fixedOffsetZone(id, millis... | [
"public",
"static",
"DateTimeZone",
"forOffsetMillis",
"(",
"int",
"millisOffset",
")",
"{",
"if",
"(",
"millisOffset",
"<",
"-",
"MAX_MILLIS",
"||",
"millisOffset",
">",
"MAX_MILLIS",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Millis out of range... | Gets a time zone instance for the specified offset to UTC in milliseconds.
@param millisOffset the offset in millis from UTC, from -23:59:59.999 to +23:59:59.999
@return the DateTimeZone object for the offset | [
"Gets",
"a",
"time",
"zone",
"instance",
"for",
"the",
"specified",
"offset",
"to",
"UTC",
"in",
"milliseconds",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L316-L322 |
22,329 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.fixedOffsetZone | private static DateTimeZone fixedOffsetZone(String id, int offset) {
if (offset == 0) {
return DateTimeZone.UTC;
}
return new FixedDateTimeZone(id, null, offset, offset);
} | java | private static DateTimeZone fixedOffsetZone(String id, int offset) {
if (offset == 0) {
return DateTimeZone.UTC;
}
return new FixedDateTimeZone(id, null, offset, offset);
} | [
"private",
"static",
"DateTimeZone",
"fixedOffsetZone",
"(",
"String",
"id",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"offset",
"==",
"0",
")",
"{",
"return",
"DateTimeZone",
".",
"UTC",
";",
"}",
"return",
"new",
"FixedDateTimeZone",
"(",
"id",
",",
"... | Gets the zone using a fixed offset amount.
@param id the zone id
@param offset the offset in millis
@return the zone | [
"Gets",
"the",
"zone",
"using",
"a",
"fixed",
"offset",
"amount",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L408-L413 |
22,330 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.validateProvider | private static Provider validateProvider(Provider provider) {
Set<String> ids = provider.getAvailableIDs();
if (ids == null || ids.size() == 0) {
throw new IllegalArgumentException("The provider doesn't have any available ids");
}
if (!ids.contains("UTC")) {
throw... | java | private static Provider validateProvider(Provider provider) {
Set<String> ids = provider.getAvailableIDs();
if (ids == null || ids.size() == 0) {
throw new IllegalArgumentException("The provider doesn't have any available ids");
}
if (!ids.contains("UTC")) {
throw... | [
"private",
"static",
"Provider",
"validateProvider",
"(",
"Provider",
"provider",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"provider",
".",
"getAvailableIDs",
"(",
")",
";",
"if",
"(",
"ids",
"==",
"null",
"||",
"ids",
".",
"size",
"(",
")",
"=... | Sets the zone provider factory without performing the security check.
@param provider provider to use, or null for default
@return the provider
@throws IllegalArgumentException if the provider is invalid | [
"Sets",
"the",
"zone",
"provider",
"factory",
"without",
"performing",
"the",
"security",
"check",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L474-L486 |
22,331 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.getOffset | public final int getOffset(ReadableInstant instant) {
if (instant == null) {
return getOffset(DateTimeUtils.currentTimeMillis());
}
return getOffset(instant.getMillis());
} | java | public final int getOffset(ReadableInstant instant) {
if (instant == null) {
return getOffset(DateTimeUtils.currentTimeMillis());
}
return getOffset(instant.getMillis());
} | [
"public",
"final",
"int",
"getOffset",
"(",
"ReadableInstant",
"instant",
")",
"{",
"if",
"(",
"instant",
"==",
"null",
")",
"{",
"return",
"getOffset",
"(",
"DateTimeUtils",
".",
"currentTimeMillis",
"(",
")",
")",
";",
"}",
"return",
"getOffset",
"(",
"i... | Gets the millisecond offset to add to UTC to get local time.
@param instant instant to get the offset for, null means now
@return the millisecond offset to add to UTC to get local time | [
"Gets",
"the",
"millisecond",
"offset",
"to",
"add",
"to",
"UTC",
"to",
"get",
"local",
"time",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L837-L842 |
22,332 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.getOffsetFromLocal | public int getOffsetFromLocal(long instantLocal) {
// get the offset at instantLocal (first estimate)
final int offsetLocal = getOffset(instantLocal);
// adjust instantLocal using the estimate and recalc the offset
final long instantAdjusted = instantLocal - offsetLocal;
final in... | java | public int getOffsetFromLocal(long instantLocal) {
// get the offset at instantLocal (first estimate)
final int offsetLocal = getOffset(instantLocal);
// adjust instantLocal using the estimate and recalc the offset
final long instantAdjusted = instantLocal - offsetLocal;
final in... | [
"public",
"int",
"getOffsetFromLocal",
"(",
"long",
"instantLocal",
")",
"{",
"// get the offset at instantLocal (first estimate)",
"final",
"int",
"offsetLocal",
"=",
"getOffset",
"(",
"instantLocal",
")",
";",
"// adjust instantLocal using the estimate and recalc the offset",
... | Gets the millisecond offset to subtract from local time to get UTC time.
This offset can be used to undo adding the offset obtained by getOffset.
<pre>
millisLocal == millisUTC + getOffset(millisUTC)
millisUTC == millisLocal - getOffsetFromLocal(millisLocal)
</pre>
NOTE: After calculating millisLocal, some error ... | [
"Gets",
"the",
"millisecond",
"offset",
"to",
"subtract",
"from",
"local",
"time",
"to",
"get",
"UTC",
"time",
".",
"This",
"offset",
"can",
"be",
"used",
"to",
"undo",
"adding",
"the",
"offset",
"obtained",
"by",
"getOffset",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L908-L945 |
22,333 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.convertUTCToLocal | public long convertUTCToLocal(long instantUTC) {
int offset = getOffset(instantUTC);
long instantLocal = instantUTC + offset;
// If there is a sign change, but the two values have the same sign...
if ((instantUTC ^ instantLocal) < 0 && (instantUTC ^ offset) >= 0) {
throw new ... | java | public long convertUTCToLocal(long instantUTC) {
int offset = getOffset(instantUTC);
long instantLocal = instantUTC + offset;
// If there is a sign change, but the two values have the same sign...
if ((instantUTC ^ instantLocal) < 0 && (instantUTC ^ offset) >= 0) {
throw new ... | [
"public",
"long",
"convertUTCToLocal",
"(",
"long",
"instantUTC",
")",
"{",
"int",
"offset",
"=",
"getOffset",
"(",
"instantUTC",
")",
";",
"long",
"instantLocal",
"=",
"instantUTC",
"+",
"offset",
";",
"// If there is a sign change, but the two values have the same sig... | Converts a standard UTC instant to a local instant with the same
local time. This conversion is used before performing a calculation
so that the calculation can be done using a simple local zone.
@param instantUTC the UTC instant to convert to local
@return the local instant with the same local time
@throws Arithmeti... | [
"Converts",
"a",
"standard",
"UTC",
"instant",
"to",
"a",
"local",
"instant",
"with",
"the",
"same",
"local",
"time",
".",
"This",
"conversion",
"is",
"used",
"before",
"performing",
"a",
"calculation",
"so",
"that",
"the",
"calculation",
"can",
"be",
"done"... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L957-L965 |
22,334 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.convertLocalToUTC | public long convertLocalToUTC(long instantLocal, boolean strict) {
// get the offset at instantLocal (first estimate)
int offsetLocal = getOffset(instantLocal);
// adjust instantLocal using the estimate and recalc the offset
int offset = getOffset(instantLocal - offsetLocal);
// ... | java | public long convertLocalToUTC(long instantLocal, boolean strict) {
// get the offset at instantLocal (first estimate)
int offsetLocal = getOffset(instantLocal);
// adjust instantLocal using the estimate and recalc the offset
int offset = getOffset(instantLocal - offsetLocal);
// ... | [
"public",
"long",
"convertLocalToUTC",
"(",
"long",
"instantLocal",
",",
"boolean",
"strict",
")",
"{",
"// get the offset at instantLocal (first estimate)",
"int",
"offsetLocal",
"=",
"getOffset",
"(",
"instantLocal",
")",
";",
"// adjust instantLocal using the estimate and ... | Converts a local instant to a standard UTC instant with the same
local time. This conversion is used after performing a calculation
where the calculation was done using a simple local zone.
@param instantLocal the local instant to convert to UTC
@param strict whether the conversion should reject non-existent local t... | [
"Converts",
"a",
"local",
"instant",
"to",
"a",
"standard",
"UTC",
"instant",
"with",
"the",
"same",
"local",
"time",
".",
"This",
"conversion",
"is",
"used",
"after",
"performing",
"a",
"calculation",
"where",
"the",
"calculation",
"was",
"done",
"using",
"... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L1006-L1047 |
22,335 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeZone.java | DateTimeZone.adjustOffset | public long adjustOffset(long instant, boolean earlierOrLater) {
// a bit messy, but will work in all non-pathological cases
// evaluate 3 hours before and after to work out if anything is happening
long instantBefore = instant - 3 * DateTimeConstants.MILLIS_PER_HOUR;
long insta... | java | public long adjustOffset(long instant, boolean earlierOrLater) {
// a bit messy, but will work in all non-pathological cases
// evaluate 3 hours before and after to work out if anything is happening
long instantBefore = instant - 3 * DateTimeConstants.MILLIS_PER_HOUR;
long insta... | [
"public",
"long",
"adjustOffset",
"(",
"long",
"instant",
",",
"boolean",
"earlierOrLater",
")",
"{",
"// a bit messy, but will work in all non-pathological cases",
"// evaluate 3 hours before and after to work out if anything is happening",
"long",
"instantBefore",
"=",
"instant",
... | Adjusts the offset to be the earlier or later one during an overlap.
@param instant the instant to adjust
@param earlierOrLater false for earlier, true for later
@return the adjusted instant millis | [
"Adjusts",
"the",
"offset",
"to",
"be",
"the",
"earlier",
"or",
"later",
"one",
"during",
"an",
"overlap",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeZone.java#L1195-L1225 |
22,336 | JodaOrg/joda-time | src/main/java/org/joda/time/DateTimeComparator.java | DateTimeComparator.compare | public int compare(Object lhsObj, Object rhsObj) {
InstantConverter conv = ConverterManager.getInstance().getInstantConverter(lhsObj);
Chronology lhsChrono = conv.getChronology(lhsObj, (Chronology) null);
long lhsMillis = conv.getInstantMillis(lhsObj, lhsChrono);
// handle null=... | java | public int compare(Object lhsObj, Object rhsObj) {
InstantConverter conv = ConverterManager.getInstance().getInstantConverter(lhsObj);
Chronology lhsChrono = conv.getChronology(lhsObj, (Chronology) null);
long lhsMillis = conv.getInstantMillis(lhsObj, lhsChrono);
// handle null=... | [
"public",
"int",
"compare",
"(",
"Object",
"lhsObj",
",",
"Object",
"rhsObj",
")",
"{",
"InstantConverter",
"conv",
"=",
"ConverterManager",
".",
"getInstance",
"(",
")",
".",
"getInstantConverter",
"(",
"lhsObj",
")",
";",
"Chronology",
"lhsChrono",
"=",
"con... | Compare two objects against only the range of date time fields as
specified in the constructor.
@param lhsObj the first object,
logically on the left of a < comparison, null means now
@param rhsObj the second object,
logically on the right of a < comparison, null means now
@return zero if order does not matter... | [
"Compare",
"two",
"objects",
"against",
"only",
"the",
"range",
"of",
"date",
"time",
"fields",
"as",
"specified",
"in",
"the",
"constructor",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/DateTimeComparator.java#L191-L223 |
22,337 | JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.toDateMidnight | public DateMidnight toDateMidnight(DateTimeZone zone) {
Chronology chrono = getChronology().withZone(zone);
return new DateMidnight(getYear(), getMonthOfYear(), getDayOfMonth(), chrono);
} | java | public DateMidnight toDateMidnight(DateTimeZone zone) {
Chronology chrono = getChronology().withZone(zone);
return new DateMidnight(getYear(), getMonthOfYear(), getDayOfMonth(), chrono);
} | [
"public",
"DateMidnight",
"toDateMidnight",
"(",
"DateTimeZone",
"zone",
")",
"{",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
".",
"withZone",
"(",
"zone",
")",
";",
"return",
"new",
"DateMidnight",
"(",
"getYear",
"(",
")",
",",
"getMonthOfYear",... | Converts this object to a DateMidnight.
@param zone the zone to get the DateMidnight in, null means default
@return the DateMidnight instance | [
"Converts",
"this",
"object",
"to",
"a",
"DateMidnight",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L734-L737 |
22,338 | JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.toInterval | public Interval toInterval(DateTimeZone zone) {
zone = DateTimeUtils.getZone(zone);
return toDateMidnight(zone).toInterval();
} | java | public Interval toInterval(DateTimeZone zone) {
zone = DateTimeUtils.getZone(zone);
return toDateMidnight(zone).toInterval();
} | [
"public",
"Interval",
"toInterval",
"(",
"DateTimeZone",
"zone",
")",
"{",
"zone",
"=",
"DateTimeUtils",
".",
"getZone",
"(",
"zone",
")",
";",
"return",
"toDateMidnight",
"(",
"zone",
")",
".",
"toInterval",
"(",
")",
";",
"}"
] | Converts this object to an Interval representing the whole day.
@param zone the zone to get the Interval in, null means default
@return a interval over the day | [
"Converts",
"this",
"object",
"to",
"an",
"Interval",
"representing",
"the",
"whole",
"day",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L796-L799 |
22,339 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractPartial.java | AbstractPartial.indexOf | public int indexOf(DateTimeFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (getFieldType(i) == type) {
return i;
}
}
return -1;
} | java | public int indexOf(DateTimeFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (getFieldType(i) == type) {
return i;
}
}
return -1;
} | [
"public",
"int",
"indexOf",
"(",
"DateTimeFieldType",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"getFieldType",
"(",
"i",
")",
"==",
"ty... | Gets the index of the specified field, or -1 if the field is unsupported.
@param type the type to check, may be null which returns -1
@return the index of the field, -1 if unsupported | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"field",
"or",
"-",
"1",
"if",
"the",
"field",
"is",
"unsupported",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractPartial.java#L169-L176 |
22,340 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractPartial.java | AbstractPartial.indexOfSupported | protected int indexOfSupported(DateTimeFieldType type) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException("Field '" + type + "' is not supported");
}
return index;
} | java | protected int indexOfSupported(DateTimeFieldType type) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException("Field '" + type + "' is not supported");
}
return index;
} | [
"protected",
"int",
"indexOfSupported",
"(",
"DateTimeFieldType",
"type",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"type",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field '\"",
"+",
"t... | Gets the index of the specified field, throwing an exception if the
field is unsupported.
@param type the type to check, not null
@return the index of the field
@throws IllegalArgumentException if the field is null or not supported | [
"Gets",
"the",
"index",
"of",
"the",
"specified",
"field",
"throwing",
"an",
"exception",
"if",
"the",
"field",
"is",
"unsupported",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractPartial.java#L186-L192 |
22,341 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractPartial.java | AbstractPartial.indexOf | protected int indexOf(DurationFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (getFieldType(i).getDurationType() == type) {
return i;
}
}
return -1;
} | java | protected int indexOf(DurationFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (getFieldType(i).getDurationType() == type) {
return i;
}
}
return -1;
} | [
"protected",
"int",
"indexOf",
"(",
"DurationFieldType",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"getFieldType",
"(",
"i",
")",
".",
"... | Gets the index of the first fields to have the specified duration,
or -1 if the field is unsupported.
@param type the type to check, may be null which returns -1
@return the index of the field, -1 if unsupported | [
"Gets",
"the",
"index",
"of",
"the",
"first",
"fields",
"to",
"have",
"the",
"specified",
"duration",
"or",
"-",
"1",
"if",
"the",
"field",
"is",
"unsupported",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractPartial.java#L201-L208 |
22,342 | JodaOrg/joda-time | src/main/java/org/joda/time/base/AbstractPartial.java | AbstractPartial.indexOfSupported | protected int indexOfSupported(DurationFieldType type) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException("Field '" + type + "' is not supported");
}
return index;
} | java | protected int indexOfSupported(DurationFieldType type) {
int index = indexOf(type);
if (index == -1) {
throw new IllegalArgumentException("Field '" + type + "' is not supported");
}
return index;
} | [
"protected",
"int",
"indexOfSupported",
"(",
"DurationFieldType",
"type",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"type",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field '\"",
"+",
"t... | Gets the index of the first fields to have the specified duration,
throwing an exception if the field is unsupported.
@param type the type to check, not null
@return the index of the field
@throws IllegalArgumentException if the field is null or not supported | [
"Gets",
"the",
"index",
"of",
"the",
"first",
"fields",
"to",
"have",
"the",
"specified",
"duration",
"throwing",
"an",
"exception",
"if",
"the",
"field",
"is",
"unsupported",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/base/AbstractPartial.java#L218-L224 |
22,343 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getChronology | public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
} else if (object instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) object;
... | java | public Chronology getChronology(Object object, DateTimeZone zone) {
if (object.getClass().getName().endsWith(".BuddhistCalendar")) {
return BuddhistChronology.getInstance(zone);
} else if (object instanceof GregorianCalendar) {
GregorianCalendar gc = (GregorianCalendar) object;
... | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"DateTimeZone",
"zone",
")",
"{",
"if",
"(",
"object",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"\".BuddhistCalendar\"",
")",
")",
"{",
"return",
"Budd... | Gets the chronology, which is the GJChronology if a GregorianCalendar is used,
BuddhistChronology if a BuddhistCalendar is used or ISOChronology otherwise.
The time zone specified is used in preference to that on the calendar.
@param object the Calendar to convert, must not be null
@param zone the specified zone to ... | [
"Gets",
"the",
"chronology",
"which",
"is",
"the",
"GJChronology",
"if",
"a",
"GregorianCalendar",
"is",
"used",
"BuddhistChronology",
"if",
"a",
"BuddhistCalendar",
"is",
"used",
"or",
"ISOChronology",
"otherwise",
".",
"The",
"time",
"zone",
"specified",
"is",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L93-L109 |
22,344 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/CalendarConverter.java | CalendarConverter.getInstantMillis | public long getInstantMillis(Object object, Chronology chrono) {
Calendar calendar = (Calendar) object;
return calendar.getTime().getTime();
} | java | public long getInstantMillis(Object object, Chronology chrono) {
Calendar calendar = (Calendar) object;
return calendar.getTime().getTime();
} | [
"public",
"long",
"getInstantMillis",
"(",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"Calendar",
"calendar",
"=",
"(",
"Calendar",
")",
"object",
";",
"return",
"calendar",
".",
"getTime",
"(",
")",
".",
"getTime",
"(",
")",
";",
"}"
] | Gets the millis, which is the Calendar millis value.
@param object the Calendar to convert, must not be null
@param chrono the chronology result from getChronology, non-null
@return the millisecond value
@throws NullPointerException if the object is null
@throws ClassCastException if the object is an invalid type | [
"Gets",
"the",
"millis",
"which",
"is",
"the",
"Calendar",
"millis",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/CalendarConverter.java#L120-L123 |
22,345 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendDecimal | public DateTimeFormatterBuilder appendDecimal(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | java | public DateTimeFormatterBuilder appendDecimal(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | [
"public",
"DateTimeFormatterBuilder",
"appendDecimal",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type m... | Instructs the printer to emit a field value as a decimal number, and the
parser to expect an unsigned decimal number.
@param fieldType type of field to append
@param minDigits minimum number of digits to <i>print</i>
@param maxDigits maximum number of digits to <i>parse</i>, or the estimated
maximum number of digit... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"a",
"decimal",
"number",
"and",
"the",
"parser",
"to",
"expect",
"an",
"unsigned",
"decimal",
"number",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L433-L449 |
22,346 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendSignedDecimal | public DateTimeFormatterBuilder appendSignedDecimal(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | java | public DateTimeFormatterBuilder appendSignedDecimal(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | [
"public",
"DateTimeFormatterBuilder",
"appendSignedDecimal",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field ... | Instructs the printer to emit a field value as a decimal number, and the
parser to expect a signed decimal number.
@param fieldType type of field to append
@param minDigits minimum number of digits to <i>print</i>
@param maxDigits maximum number of digits to <i>parse</i>, or the estimated
maximum number of digits t... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"a",
"decimal",
"number",
"and",
"the",
"parser",
"to",
"expect",
"a",
"signed",
"decimal",
"number",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L485-L501 |
22,347 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendText | public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, false));
} | java | public DateTimeFormatterBuilder appendText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, false));
} | [
"public",
"DateTimeFormatterBuilder",
"appendText",
"(",
"DateTimeFieldType",
"fieldType",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",
";",
"}",
"return",
"append0",... | Instructs the printer to emit a field value as text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"text",
"and",
"the",
"parser",
"to",
"expect",
"text",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L534-L539 |
22,348 | JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendShortText | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, true));
} | java | public DateTimeFormatterBuilder appendShortText(DateTimeFieldType fieldType) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
return append0(new TextField(fieldType, true));
} | [
"public",
"DateTimeFormatterBuilder",
"appendShortText",
"(",
"DateTimeFieldType",
"fieldType",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type must not be null\"",
")",
";",
"}",
"return",
"appe... | Instructs the printer to emit a field value as short text, and the
parser to expect text.
@param fieldType type of field to append
@return this DateTimeFormatterBuilder, for chaining
@throws IllegalArgumentException if field type is null | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"field",
"value",
"as",
"short",
"text",
"and",
"the",
"parser",
"to",
"expect",
"text",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L549-L554 |
22,349 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BaseChronology.java | BaseChronology.get | public int[] get(ReadablePartial partial, long instant) {
int size = partial.size();
int[] values = new int[size];
for (int i = 0; i < size; i++) {
values[i] = partial.getFieldType(i).getField(this).get(instant);
}
return values;
} | java | public int[] get(ReadablePartial partial, long instant) {
int size = partial.size();
int[] values = new int[size];
for (int i = 0; i < size; i++) {
values[i] = partial.getFieldType(i).getField(this).get(instant);
}
return values;
} | [
"public",
"int",
"[",
"]",
"get",
"(",
"ReadablePartial",
"partial",
",",
"long",
"instant",
")",
"{",
"int",
"size",
"=",
"partial",
".",
"size",
"(",
")",
";",
"int",
"[",
"]",
"values",
"=",
"new",
"int",
"[",
"size",
"]",
";",
"for",
"(",
"in... | Gets the values of a partial from an instant.
@param partial the partial instant to use
@param instant the instant to query
@return the values of the partial extracted from the instant | [
"Gets",
"the",
"values",
"of",
"a",
"partial",
"from",
"an",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BaseChronology.java#L222-L229 |
22,350 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BaseChronology.java | BaseChronology.set | public long set(ReadablePartial partial, long instant) {
for (int i = 0, isize = partial.size(); i < isize; i++) {
instant = partial.getFieldType(i).getField(this).set(instant, partial.getValue(i));
}
return instant;
} | java | public long set(ReadablePartial partial, long instant) {
for (int i = 0, isize = partial.size(); i < isize; i++) {
instant = partial.getFieldType(i).getField(this).set(instant, partial.getValue(i));
}
return instant;
} | [
"public",
"long",
"set",
"(",
"ReadablePartial",
"partial",
",",
"long",
"instant",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"partial",
".",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"++",
")",
"{",
"instant",
"=",... | Sets the partial into the instant.
@param partial the partial instant to use
@param instant the instant to update
@return the updated instant | [
"Sets",
"the",
"partial",
"into",
"the",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BaseChronology.java#L238-L243 |
22,351 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BaseChronology.java | BaseChronology.add | public long add(ReadablePeriod period, long instant, int scalar) {
if (scalar != 0 && period != null) {
for (int i = 0, isize = period.size(); i < isize; i++) {
long value = period.getValue(i); // use long to allow for multiplication (fits OK)
if (value != 0) {
... | java | public long add(ReadablePeriod period, long instant, int scalar) {
if (scalar != 0 && period != null) {
for (int i = 0, isize = period.size(); i < isize; i++) {
long value = period.getValue(i); // use long to allow for multiplication (fits OK)
if (value != 0) {
... | [
"public",
"long",
"add",
"(",
"ReadablePeriod",
"period",
",",
"long",
"instant",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"scalar",
"!=",
"0",
"&&",
"period",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"period",... | Adds the period to the instant, specifying the number of times to add.
@param period the period to add, null means add nothing
@param instant the instant to add to
@param scalar the number of times to add
@return the updated instant | [
"Adds",
"the",
"period",
"to",
"the",
"instant",
"specifying",
"the",
"number",
"of",
"times",
"to",
"add",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BaseChronology.java#L302-L312 |
22,352 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BaseChronology.java | BaseChronology.add | public long add(long instant, long duration, int scalar) {
if (duration == 0 || scalar == 0) {
return instant;
}
long add = FieldUtils.safeMultiply(duration, scalar);
return FieldUtils.safeAdd(instant, add);
} | java | public long add(long instant, long duration, int scalar) {
if (duration == 0 || scalar == 0) {
return instant;
}
long add = FieldUtils.safeMultiply(duration, scalar);
return FieldUtils.safeAdd(instant, add);
} | [
"public",
"long",
"add",
"(",
"long",
"instant",
",",
"long",
"duration",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"duration",
"==",
"0",
"||",
"scalar",
"==",
"0",
")",
"{",
"return",
"instant",
";",
"}",
"long",
"add",
"=",
"FieldUtils",
".",
"... | Adds the duration to the instant, specifying the number of times to add.
@param instant the instant to add to
@param duration the duration to add
@param scalar the number of times to add
@return the updated instant | [
"Adds",
"the",
"duration",
"to",
"the",
"instant",
"specifying",
"the",
"number",
"of",
"times",
"to",
"add",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BaseChronology.java#L323-L329 |
22,353 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java | BasicWeekyearDateTimeField.add | public long add(long instant, int years) {
if (years == 0) {
return instant;
}
return set(instant, get(instant) + years);
} | java | public long add(long instant, int years) {
if (years == 0) {
return instant;
}
return set(instant, get(instant) + years);
} | [
"public",
"long",
"add",
"(",
"long",
"instant",
",",
"int",
"years",
")",
"{",
"if",
"(",
"years",
"==",
"0",
")",
"{",
"return",
"instant",
";",
"}",
"return",
"set",
"(",
"instant",
",",
"get",
"(",
"instant",
")",
"+",
"years",
")",
";",
"}"
... | Add the specified years to the specified time instant.
@see org.joda.time.DateTimeField#add
@param instant the time instant in millis to update.
@param years the years to add (can be negative).
@return the updated time instant. | [
"Add",
"the",
"specified",
"years",
"to",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java#L72-L77 |
22,354 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java | BasicWeekyearDateTimeField.set | public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, Math.abs(year),
iChronology.getMinYear(), iChronology.getMaxYear());
//
// Do nothing if no real change is requested.
//
int thisWeekyear = get( instant );
if... | java | public long set(long instant, int year) {
FieldUtils.verifyValueBounds(this, Math.abs(year),
iChronology.getMinYear(), iChronology.getMaxYear());
//
// Do nothing if no real change is requested.
//
int thisWeekyear = get( instant );
if... | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"year",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"Math",
".",
"abs",
"(",
"year",
")",
",",
"iChronology",
".",
"getMinYear",
"(",
")",
",",
"iChronology",
".",
"ge... | Set the Year of a week based year component of the specified time instant.
@see org.joda.time.DateTimeField#set
@param instant the time instant in millis to update.
@param year the year (-9999,9999) to set the date to.
@return the updated DateTime.
@throws IllegalArgumentException if year is invalid. | [
"Set",
"the",
"Year",
"of",
"a",
"week",
"based",
"year",
"component",
"of",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicWeekyearDateTimeField.java#L128-L206 |
22,355 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadableIntervalConverter.java | ReadableIntervalConverter.setInto | public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) {
ReadableInterval interval = (ReadableInterval) object;
chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval));
long start = interval.getStartMillis();
long end = interva... | java | public void setInto(ReadWritablePeriod writablePeriod, Object object, Chronology chrono) {
ReadableInterval interval = (ReadableInterval) object;
chrono = (chrono != null ? chrono : DateTimeUtils.getIntervalChronology(interval));
long start = interval.getStartMillis();
long end = interva... | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"writablePeriod",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"ReadableInterval",
"interval",
"=",
"(",
"ReadableInterval",
")",
"object",
";",
"chrono",
"=",
"(",
"chrono",
"!=",
"null"... | Sets the values of the mutable duration from the specified interval.
@param writablePeriod the period to modify
@param object the interval to set from
@param chrono the chronology to use | [
"Sets",
"the",
"values",
"of",
"the",
"mutable",
"duration",
"from",
"the",
"specified",
"interval",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadableIntervalConverter.java#L63-L72 |
22,356 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/StringConverter.java | StringConverter.getInstantMillis | public long getInstantMillis(Object object, Chronology chrono) {
String str = (String) object;
DateTimeFormatter p = ISODateTimeFormat.dateTimeParser();
return p.withChronology(chrono).parseMillis(str);
} | java | public long getInstantMillis(Object object, Chronology chrono) {
String str = (String) object;
DateTimeFormatter p = ISODateTimeFormat.dateTimeParser();
return p.withChronology(chrono).parseMillis(str);
} | [
"public",
"long",
"getInstantMillis",
"(",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"String",
"str",
"=",
"(",
"String",
")",
"object",
";",
"DateTimeFormatter",
"p",
"=",
"ISODateTimeFormat",
".",
"dateTimeParser",
"(",
")",
";",
"return",
... | Gets the millis, which is the ISO parsed string value.
@param object the String to convert, must not be null
@param chrono the chronology to use, non-null result of getChronology
@return the millisecond value
@throws IllegalArgumentException if the value if invalid | [
"Gets",
"the",
"millis",
"which",
"is",
"the",
"ISO",
"parsed",
"string",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/StringConverter.java#L62-L66 |
22,357 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/StringConverter.java | StringConverter.getPartialValues | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser) {
if (parser.getZone() != null) {
chrono = chrono.withZone(parser.getZone());
}
long millis = parser.withChronology(chrono).parseMillis((String) object);
ret... | java | public int[] getPartialValues(ReadablePartial fieldSource, Object object, Chronology chrono, DateTimeFormatter parser) {
if (parser.getZone() != null) {
chrono = chrono.withZone(parser.getZone());
}
long millis = parser.withChronology(chrono).parseMillis((String) object);
ret... | [
"public",
"int",
"[",
"]",
"getPartialValues",
"(",
"ReadablePartial",
"fieldSource",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
",",
"DateTimeFormatter",
"parser",
")",
"{",
"if",
"(",
"parser",
".",
"getZone",
"(",
")",
"!=",
"null",
")",
"{",
... | Extracts the values of the partial from an object of this converter's type.
This method checks if the parser has a zone, and uses it if present.
This is most useful for parsing local times with UTC.
@param fieldSource a partial that provides access to the fields.
This partial may be incomplete and only getFieldType(i... | [
"Extracts",
"the",
"values",
"of",
"the",
"partial",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
".",
"This",
"method",
"checks",
"if",
"the",
"parser",
"has",
"a",
"zone",
"and",
"uses",
"it",
"if",
"present",
".",
"This",
"is",
"m... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/StringConverter.java#L83-L89 |
22,358 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/StringConverter.java | StringConverter.setInto | public void setInto(ReadWritableInterval writableInterval, Object object, Chronology chrono) {
String str = (String) object;
int separator = str.indexOf('/');
if (separator < 0) {
throw new IllegalArgumentException("Format requires a '/' separator: " + str);
}
Strin... | java | public void setInto(ReadWritableInterval writableInterval, Object object, Chronology chrono) {
String str = (String) object;
int separator = str.indexOf('/');
if (separator < 0) {
throw new IllegalArgumentException("Format requires a '/' separator: " + str);
}
Strin... | [
"public",
"void",
"setInto",
"(",
"ReadWritableInterval",
"writableInterval",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"String",
"str",
"=",
"(",
"String",
")",
"object",
";",
"int",
"separator",
"=",
"str",
".",
"indexOf",
"(",
"'",
... | Sets the value of the mutable interval from the string.
@param writableInterval the interval to set
@param object the String to convert, must not be null
@param chrono the chronology to use, may be null | [
"Sets",
"the",
"value",
"of",
"the",
"mutable",
"interval",
"from",
"the",
"string",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/StringConverter.java#L183-L238 |
22,359 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.years | public static PeriodType years() {
PeriodType type = cYears;
if (type == null) {
type = new PeriodType(
"Years",
new DurationFieldType[] { DurationFieldType.years() },
new int[] { 0, -1, -1, -1, -1, -1, -1, -1, }
);
cYea... | java | public static PeriodType years() {
PeriodType type = cYears;
if (type == null) {
type = new PeriodType(
"Years",
new DurationFieldType[] { DurationFieldType.years() },
new int[] { 0, -1, -1, -1, -1, -1, -1, -1, }
);
cYea... | [
"public",
"static",
"PeriodType",
"years",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cYears",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Years\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"DurationFi... | Gets a type that defines just the years field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"years",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L353-L364 |
22,360 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.months | public static PeriodType months() {
PeriodType type = cMonths;
if (type == null) {
type = new PeriodType(
"Months",
new DurationFieldType[] { DurationFieldType.months() },
new int[] { -1, 0, -1, -1, -1, -1, -1, -1, }
);
... | java | public static PeriodType months() {
PeriodType type = cMonths;
if (type == null) {
type = new PeriodType(
"Months",
new DurationFieldType[] { DurationFieldType.months() },
new int[] { -1, 0, -1, -1, -1, -1, -1, -1, }
);
... | [
"public",
"static",
"PeriodType",
"months",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cMonths",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Months\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"Duratio... | Gets a type that defines just the months field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"months",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L371-L382 |
22,361 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.weeks | public static PeriodType weeks() {
PeriodType type = cWeeks;
if (type == null) {
type = new PeriodType(
"Weeks",
new DurationFieldType[] { DurationFieldType.weeks() },
new int[] { -1, -1, 0, -1, -1, -1, -1, -1, }
);
cWee... | java | public static PeriodType weeks() {
PeriodType type = cWeeks;
if (type == null) {
type = new PeriodType(
"Weeks",
new DurationFieldType[] { DurationFieldType.weeks() },
new int[] { -1, -1, 0, -1, -1, -1, -1, -1, }
);
cWee... | [
"public",
"static",
"PeriodType",
"weeks",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cWeeks",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Weeks\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"DurationFi... | Gets a type that defines just the weeks field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"weeks",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L389-L400 |
22,362 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.days | public static PeriodType days() {
PeriodType type = cDays;
if (type == null) {
type = new PeriodType(
"Days",
new DurationFieldType[] { DurationFieldType.days() },
new int[] { -1, -1, -1, 0, -1, -1, -1, -1, }
);
cDays = ... | java | public static PeriodType days() {
PeriodType type = cDays;
if (type == null) {
type = new PeriodType(
"Days",
new DurationFieldType[] { DurationFieldType.days() },
new int[] { -1, -1, -1, 0, -1, -1, -1, -1, }
);
cDays = ... | [
"public",
"static",
"PeriodType",
"days",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cDays",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Days\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"DurationField... | Gets a type that defines just the days field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"days",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L407-L418 |
22,363 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.hours | public static PeriodType hours() {
PeriodType type = cHours;
if (type == null) {
type = new PeriodType(
"Hours",
new DurationFieldType[] { DurationFieldType.hours() },
new int[] { -1, -1, -1, -1, 0, -1, -1, -1, }
);
cHou... | java | public static PeriodType hours() {
PeriodType type = cHours;
if (type == null) {
type = new PeriodType(
"Hours",
new DurationFieldType[] { DurationFieldType.hours() },
new int[] { -1, -1, -1, -1, 0, -1, -1, -1, }
);
cHou... | [
"public",
"static",
"PeriodType",
"hours",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cHours",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Hours\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"DurationFi... | Gets a type that defines just the hours field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"hours",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L425-L436 |
22,364 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.minutes | public static PeriodType minutes() {
PeriodType type = cMinutes;
if (type == null) {
type = new PeriodType(
"Minutes",
new DurationFieldType[] { DurationFieldType.minutes() },
new int[] { -1, -1, -1, -1, -1, 0, -1, -1, }
);
... | java | public static PeriodType minutes() {
PeriodType type = cMinutes;
if (type == null) {
type = new PeriodType(
"Minutes",
new DurationFieldType[] { DurationFieldType.minutes() },
new int[] { -1, -1, -1, -1, -1, 0, -1, -1, }
);
... | [
"public",
"static",
"PeriodType",
"minutes",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cMinutes",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Minutes\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"Dura... | Gets a type that defines just the minutes field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"minutes",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L443-L454 |
22,365 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.seconds | public static PeriodType seconds() {
PeriodType type = cSeconds;
if (type == null) {
type = new PeriodType(
"Seconds",
new DurationFieldType[] { DurationFieldType.seconds() },
new int[] { -1, -1, -1, -1, -1, -1, 0, -1, }
);
... | java | public static PeriodType seconds() {
PeriodType type = cSeconds;
if (type == null) {
type = new PeriodType(
"Seconds",
new DurationFieldType[] { DurationFieldType.seconds() },
new int[] { -1, -1, -1, -1, -1, -1, 0, -1, }
);
... | [
"public",
"static",
"PeriodType",
"seconds",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cSeconds",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Seconds\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"Dura... | Gets a type that defines just the seconds field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"seconds",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L461-L472 |
22,366 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.millis | public static PeriodType millis() {
PeriodType type = cMillis;
if (type == null) {
type = new PeriodType(
"Millis",
new DurationFieldType[] { DurationFieldType.millis() },
new int[] { -1, -1, -1, -1, -1, -1, -1, 0, }
);
... | java | public static PeriodType millis() {
PeriodType type = cMillis;
if (type == null) {
type = new PeriodType(
"Millis",
new DurationFieldType[] { DurationFieldType.millis() },
new int[] { -1, -1, -1, -1, -1, -1, -1, 0, }
);
... | [
"public",
"static",
"PeriodType",
"millis",
"(",
")",
"{",
"PeriodType",
"type",
"=",
"cMillis",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"type",
"=",
"new",
"PeriodType",
"(",
"\"Millis\"",
",",
"new",
"DurationFieldType",
"[",
"]",
"{",
"Duratio... | Gets a type that defines just the millis field.
@return the period type | [
"Gets",
"a",
"type",
"that",
"defines",
"just",
"the",
"millis",
"field",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L479-L490 |
22,367 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.indexOf | public int indexOf(DurationFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (iTypes[i] == type) {
return i;
}
}
return -1;
} | java | public int indexOf(DurationFieldType type) {
for (int i = 0, isize = size(); i < isize; i++) {
if (iTypes[i] == type) {
return i;
}
}
return -1;
} | [
"public",
"int",
"indexOf",
"(",
"DurationFieldType",
"type",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"isize",
"=",
"size",
"(",
")",
";",
"i",
"<",
"isize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"iTypes",
"[",
"i",
"]",
"==",
"type",
... | Gets the index of the field in this period.
@param type the type to check, may be null which returns -1
@return the index of -1 if not supported | [
"Gets",
"the",
"index",
"of",
"the",
"field",
"in",
"this",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L647-L654 |
22,368 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.getIndexedField | int getIndexedField(ReadablePeriod period, int index) {
int realIndex = iIndices[index];
return (realIndex == -1 ? 0 : period.getValue(realIndex));
} | java | int getIndexedField(ReadablePeriod period, int index) {
int realIndex = iIndices[index];
return (realIndex == -1 ? 0 : period.getValue(realIndex));
} | [
"int",
"getIndexedField",
"(",
"ReadablePeriod",
"period",
",",
"int",
"index",
")",
"{",
"int",
"realIndex",
"=",
"iIndices",
"[",
"index",
"]",
";",
"return",
"(",
"realIndex",
"==",
"-",
"1",
"?",
"0",
":",
"period",
".",
"getValue",
"(",
"realIndex",... | Gets the indexed field part of the period.
@param period the period to query
@param index the index to use
@return the value of the field, zero if unsupported | [
"Gets",
"the",
"indexed",
"field",
"part",
"of",
"the",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L673-L676 |
22,369 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.setIndexedField | boolean setIndexedField(ReadablePeriod period, int index, int[] values, int newValue) {
int realIndex = iIndices[index];
if (realIndex == -1) {
throw new UnsupportedOperationException("Field is not supported");
}
values[realIndex] = newValue;
return true;
} | java | boolean setIndexedField(ReadablePeriod period, int index, int[] values, int newValue) {
int realIndex = iIndices[index];
if (realIndex == -1) {
throw new UnsupportedOperationException("Field is not supported");
}
values[realIndex] = newValue;
return true;
} | [
"boolean",
"setIndexedField",
"(",
"ReadablePeriod",
"period",
",",
"int",
"index",
",",
"int",
"[",
"]",
"values",
",",
"int",
"newValue",
")",
"{",
"int",
"realIndex",
"=",
"iIndices",
"[",
"index",
"]",
";",
"if",
"(",
"realIndex",
"==",
"-",
"1",
"... | Sets the indexed field part of the period.
@param period the period to query
@param index the index to use
@param values the array to populate
@param newValue the value to set
@throws UnsupportedOperationException if not supported | [
"Sets",
"the",
"indexed",
"field",
"part",
"of",
"the",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L687-L694 |
22,370 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.addIndexedField | boolean addIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return false;
}
int realIndex = iIndices[index];
if (realIndex == -1) {
throw new UnsupportedOperationException("Field is not supported");
}
... | java | boolean addIndexedField(ReadablePeriod period, int index, int[] values, int valueToAdd) {
if (valueToAdd == 0) {
return false;
}
int realIndex = iIndices[index];
if (realIndex == -1) {
throw new UnsupportedOperationException("Field is not supported");
}
... | [
"boolean",
"addIndexedField",
"(",
"ReadablePeriod",
"period",
",",
"int",
"index",
",",
"int",
"[",
"]",
"values",
",",
"int",
"valueToAdd",
")",
"{",
"if",
"(",
"valueToAdd",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"int",
"realIndex",
"=",
... | Adds to the indexed field part of the period.
@param period the period to query
@param index the index to use
@param values the array to populate
@param valueToAdd the value to add
@return true if the array is updated
@throws UnsupportedOperationException if not supported | [
"Adds",
"to",
"the",
"indexed",
"field",
"part",
"of",
"the",
"period",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L706-L716 |
22,371 | JodaOrg/joda-time | src/main/java/org/joda/time/PeriodType.java | PeriodType.withFieldRemoved | private PeriodType withFieldRemoved(int indicesIndex, String name) {
int fieldIndex = iIndices[indicesIndex];
if (fieldIndex == -1) {
return this;
}
DurationFieldType[] types = new DurationFieldType[size() - 1];
for (int i = 0; i < iTypes.length; i++) {
... | java | private PeriodType withFieldRemoved(int indicesIndex, String name) {
int fieldIndex = iIndices[indicesIndex];
if (fieldIndex == -1) {
return this;
}
DurationFieldType[] types = new DurationFieldType[size() - 1];
for (int i = 0; i < iTypes.length; i++) {
... | [
"private",
"PeriodType",
"withFieldRemoved",
"(",
"int",
"indicesIndex",
",",
"String",
"name",
")",
"{",
"int",
"fieldIndex",
"=",
"iIndices",
"[",
"indicesIndex",
"]",
";",
"if",
"(",
"fieldIndex",
"==",
"-",
"1",
")",
"{",
"return",
"this",
";",
"}",
... | Removes the field specified by indices index.
@param indicesIndex the index to remove
@param name the name addition
@return the new type | [
"Removes",
"the",
"field",
"specified",
"by",
"indices",
"index",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/PeriodType.java#L798-L824 |
22,372 | JodaOrg/joda-time | src/example/org/joda/example/time/DateTimeBrowser.java | DateTimeBrowser.main | public static void main(String[] args) {
/*
* Developers Notes:
*
* -No corresponding Junit test class currently
* provided. Test by eyeball of the output.
*
* -Add a menu with Help(About)
* --> TBD.
*
* -Figure out some sane way ... | java | public static void main(String[] args) {
/*
* Developers Notes:
*
* -No corresponding Junit test class currently
* provided. Test by eyeball of the output.
*
* -Add a menu with Help(About)
* --> TBD.
*
* -Figure out some sane way ... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"/*\n * Developers Notes:\n *\n * -No corresponding Junit test class currently\n * provided. Test by eyeball of the output.\n *\n * -Add a menu with Help(About)\n ... | This is the main swing application method. It sets up and displays the
initial GUI, and controls execution thereafter. Everything else in
this class is 'private', please read the code. | [
"This",
"is",
"the",
"main",
"swing",
"application",
"method",
".",
"It",
"sets",
"up",
"and",
"displays",
"the",
"initial",
"GUI",
"and",
"controls",
"execution",
"thereafter",
".",
"Everything",
"else",
"in",
"this",
"class",
"is",
"private",
"please",
"re... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/example/org/joda/example/time/DateTimeBrowser.java#L105-L140 |
22,373 | JodaOrg/joda-time | src/main/java/org/joda/time/field/UnsupportedDurationField.java | UnsupportedDurationField.getInstance | public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
UnsupportedDurationField field;
if (cCache == null) {
cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
field = null;
} else {
field = cCache.get(type... | java | public static synchronized UnsupportedDurationField getInstance(DurationFieldType type) {
UnsupportedDurationField field;
if (cCache == null) {
cCache = new HashMap<DurationFieldType, UnsupportedDurationField>(7);
field = null;
} else {
field = cCache.get(type... | [
"public",
"static",
"synchronized",
"UnsupportedDurationField",
"getInstance",
"(",
"DurationFieldType",
"type",
")",
"{",
"UnsupportedDurationField",
"field",
";",
"if",
"(",
"cCache",
"==",
"null",
")",
"{",
"cCache",
"=",
"new",
"HashMap",
"<",
"DurationFieldType... | Gets an instance of UnsupportedDurationField for a specific named field.
The returned instance is cached.
@param type the type to obtain
@return the instance | [
"Gets",
"an",
"instance",
"of",
"UnsupportedDurationField",
"for",
"a",
"specific",
"named",
"field",
".",
"The",
"returned",
"instance",
"is",
"cached",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/UnsupportedDurationField.java#L47-L60 |
22,374 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/ZoneInfoProvider.java | ZoneInfoProvider.loadZoneData | private DateTimeZone loadZoneData(String id) {
InputStream in = null;
try {
in = openResource(id);
DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
return tz;
} catch (IOException ex... | java | private DateTimeZone loadZoneData(String id) {
InputStream in = null;
try {
in = openResource(id);
DateTimeZone tz = DateTimeZoneBuilder.readFrom(in, id);
iZoneInfoMap.put(id, new SoftReference<DateTimeZone>(tz));
return tz;
} catch (IOException ex... | [
"private",
"DateTimeZone",
"loadZoneData",
"(",
"String",
"id",
")",
"{",
"InputStream",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"openResource",
"(",
"id",
")",
";",
"DateTimeZone",
"tz",
"=",
"DateTimeZoneBuilder",
".",
"readFrom",
"(",
"in",
",",
... | Loads the time zone data for one id.
@param id the id to load
@return the zone | [
"Loads",
"the",
"time",
"zone",
"data",
"for",
"one",
"id",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoProvider.java#L237-L256 |
22,375 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/ZoneInfoProvider.java | ZoneInfoProvider.loadZoneInfoMap | private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
Map<String, Object> map = new ConcurrentHashMap<String, Object>();
DataInputStream din = new DataInputStream(in);
try {
readZoneInfoMap(din, map);
} finally {
try {
... | java | private static Map<String, Object> loadZoneInfoMap(InputStream in) throws IOException {
Map<String, Object> map = new ConcurrentHashMap<String, Object>();
DataInputStream din = new DataInputStream(in);
try {
readZoneInfoMap(din, map);
} finally {
try {
... | [
"private",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"loadZoneInfoMap",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"ConcurrentHashMap",
"<",
"String",
",",
"Object",
"... | Loads the zone info map.
@param in the input stream
@return the map | [
"Loads",
"the",
"zone",
"info",
"map",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoProvider.java#L265-L278 |
22,376 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/ZoneInfoProvider.java | ZoneInfoProvider.readZoneInfoMap | private static void readZoneInfoMap(DataInputStream din, Map<String, Object> zimap) throws IOException {
// Read the string pool.
int size = din.readUnsignedShort();
String[] pool = new String[size];
for (int i=0; i<size; i++) {
pool[i] = din.readUTF().intern();
}
... | java | private static void readZoneInfoMap(DataInputStream din, Map<String, Object> zimap) throws IOException {
// Read the string pool.
int size = din.readUnsignedShort();
String[] pool = new String[size];
for (int i=0; i<size; i++) {
pool[i] = din.readUTF().intern();
}
... | [
"private",
"static",
"void",
"readZoneInfoMap",
"(",
"DataInputStream",
"din",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"zimap",
")",
"throws",
"IOException",
"{",
"// Read the string pool.",
"int",
"size",
"=",
"din",
".",
"readUnsignedShort",
"(",
")",
... | Reads the zone info map from file.
@param din the input stream
@param zimap gets filled with string id to string id mappings | [
"Reads",
"the",
"zone",
"info",
"map",
"from",
"file",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/ZoneInfoProvider.java#L286-L303 |
22,377 | JodaOrg/joda-time | src/main/java/org/joda/time/field/RemainderDateTimeField.java | RemainderDateTimeField.addWrapField | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, 0, iDivisor - 1));
} | java | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, 0, iDivisor - 1));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"amount",
",",
"0",
",",
"iDivisor",
"-",
"1",
"... | Add the specified amount to the specified time instant, wrapping around
within the remainder range if necessary. The amount added may be
negative.
@param instant the time instant in millis to update.
@param amount the amount to add (can be negative).
@return the updated time instant. | [
"Add",
"the",
"specified",
"amount",
"to",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"the",
"remainder",
"range",
"if",
"necessary",
".",
"The",
"amount",
"added",
"may",
"be",
"negative",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/RemainderDateTimeField.java#L153-L155 |
22,378 | JodaOrg/joda-time | src/main/java/org/joda/time/field/RemainderDateTimeField.java | RemainderDateTimeField.set | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, 0, iDivisor - 1);
int divided = getDivided(getWrappedField().get(instant));
return getWrappedField().set(instant, divided * iDivisor + value);
} | java | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, 0, iDivisor - 1);
int divided = getDivided(getWrappedField().get(instant));
return getWrappedField().set(instant, divided * iDivisor + value);
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"value",
",",
"0",
",",
"iDivisor",
"-",
"1",
")",
";",
"int",
"divided",
"=",
"getDivided",
"(",
"getWrappedField",... | Set the specified amount of remainder units to the specified time instant.
@param instant the time instant in millis to update.
@param value value of remainder units to set.
@return the updated time instant.
@throws IllegalArgumentException if value is too large or too small. | [
"Set",
"the",
"specified",
"amount",
"of",
"remainder",
"units",
"to",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/RemainderDateTimeField.java#L165-L169 |
22,379 | JodaOrg/joda-time | src/main/java/org/joda/time/Period.java | Period.multipliedBy | public Period multipliedBy(int scalar) {
if (this == ZERO || scalar == 1) {
return this;
}
int[] values = getValues(); // cloned
for (int i = 0; i < values.length; i++) {
values[i] = FieldUtils.safeMultiply(values[i], scalar);
}
return new Period(... | java | public Period multipliedBy(int scalar) {
if (this == ZERO || scalar == 1) {
return this;
}
int[] values = getValues(); // cloned
for (int i = 0; i < values.length; i++) {
values[i] = FieldUtils.safeMultiply(values[i], scalar);
}
return new Period(... | [
"public",
"Period",
"multipliedBy",
"(",
"int",
"scalar",
")",
"{",
"if",
"(",
"this",
"==",
"ZERO",
"||",
"scalar",
"==",
"1",
")",
"{",
"return",
"this",
";",
"}",
"int",
"[",
"]",
"values",
"=",
"getValues",
"(",
")",
";",
"// cloned",
"for",
"(... | Returns a new instance with each element in this period multiplied
by the specified scalar.
@param scalar the scalar to multiply by, not null
@return a {@code Period} based on this period with the amounts multiplied by the scalar, never null
@throws ArithmeticException if the capacity of any field is exceeded
@since ... | [
"Returns",
"a",
"new",
"instance",
"with",
"each",
"element",
"in",
"this",
"period",
"multiplied",
"by",
"the",
"specified",
"scalar",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Period.java#L1353-L1362 |
22,380 | JodaOrg/joda-time | src/main/java/org/joda/time/field/DividedDateTimeField.java | DividedDateTimeField.get | public int get(long instant) {
int value = getWrappedField().get(instant);
if (value >= 0) {
return value / iDivisor;
} else {
return ((value + 1) / iDivisor) - 1;
}
} | java | public int get(long instant) {
int value = getWrappedField().get(instant);
if (value >= 0) {
return value / iDivisor;
} else {
return ((value + 1) / iDivisor) - 1;
}
} | [
"public",
"int",
"get",
"(",
"long",
"instant",
")",
"{",
"int",
"value",
"=",
"getWrappedField",
"(",
")",
".",
"get",
"(",
"instant",
")",
";",
"if",
"(",
"value",
">=",
"0",
")",
"{",
"return",
"value",
"/",
"iDivisor",
";",
"}",
"else",
"{",
... | Get the amount of scaled units from the specified time instant.
@param instant the time instant in millis to query.
@return the amount of scaled units extracted from the input. | [
"Get",
"the",
"amount",
"of",
"scaled",
"units",
"from",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/DividedDateTimeField.java#L140-L147 |
22,381 | JodaOrg/joda-time | src/main/java/org/joda/time/field/DividedDateTimeField.java | DividedDateTimeField.addWrapField | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
} | java | public long addWrapField(long instant, int amount) {
return set(instant, FieldUtils.getWrappedValue(get(instant), amount, iMin, iMax));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"amount",
",",
"iMin",
",",
"iMax",
")",
")",
";... | Add to the scaled component of the specified time instant,
wrapping around within that component if necessary.
@param instant the time instant in millis to update.
@param amount the amount of scaled units to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"scaled",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/DividedDateTimeField.java#L181-L183 |
22,382 | JodaOrg/joda-time | src/main/java/org/joda/time/field/DividedDateTimeField.java | DividedDateTimeField.set | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
int remainder = getRemainder(getWrappedField().get(instant));
return getWrappedField().set(instant, value * iDivisor + remainder);
} | java | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
int remainder = getRemainder(getWrappedField().get(instant));
return getWrappedField().set(instant, value * iDivisor + remainder);
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"value",
",",
"iMin",
",",
"iMax",
")",
";",
"int",
"remainder",
"=",
"getRemainder",
"(",
"getWrappedField",
"(",
"... | Set the specified amount of scaled units to the specified time instant.
@param instant the time instant in millis to update.
@param value value of scaled units to set.
@return the updated time instant.
@throws IllegalArgumentException if value is too large or too small. | [
"Set",
"the",
"specified",
"amount",
"of",
"scaled",
"units",
"to",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/DividedDateTimeField.java#L201-L205 |
22,383 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadableInstantConverter.java | ReadableInstantConverter.getChronology | public Chronology getChronology(Object object, DateTimeZone zone) {
Chronology chrono = ((ReadableInstant) object).getChronology();
if (chrono == null) {
return ISOChronology.getInstance(zone);
}
DateTimeZone chronoZone = chrono.getZone();
if (chronoZone != zone) {
... | java | public Chronology getChronology(Object object, DateTimeZone zone) {
Chronology chrono = ((ReadableInstant) object).getChronology();
if (chrono == null) {
return ISOChronology.getInstance(zone);
}
DateTimeZone chronoZone = chrono.getZone();
if (chronoZone != zone) {
... | [
"public",
"Chronology",
"getChronology",
"(",
"Object",
"object",
",",
"DateTimeZone",
"zone",
")",
"{",
"Chronology",
"chrono",
"=",
"(",
"(",
"ReadableInstant",
")",
"object",
")",
".",
"getChronology",
"(",
")",
";",
"if",
"(",
"chrono",
"==",
"null",
"... | Gets the chronology, which is taken from the ReadableInstant.
If the chronology on the instant is null, the ISOChronology in the
specified time zone is used.
If the chronology on the instant is not in the specified zone, it is
adapted.
@param object the ReadableInstant to convert, must not be null
@param zone the sp... | [
"Gets",
"the",
"chronology",
"which",
"is",
"taken",
"from",
"the",
"ReadableInstant",
".",
"If",
"the",
"chronology",
"on",
"the",
"instant",
"is",
"null",
"the",
"ISOChronology",
"in",
"the",
"specified",
"time",
"zone",
"is",
"used",
".",
"If",
"the",
"... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadableInstantConverter.java#L57-L70 |
22,384 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadablePeriodConverter.java | ReadablePeriodConverter.setInto | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((ReadablePeriod) object);
} | java | public void setInto(ReadWritablePeriod duration, Object object, Chronology chrono) {
duration.setPeriod((ReadablePeriod) object);
} | [
"public",
"void",
"setInto",
"(",
"ReadWritablePeriod",
"duration",
",",
"Object",
"object",
",",
"Chronology",
"chrono",
")",
"{",
"duration",
".",
"setPeriod",
"(",
"(",
"ReadablePeriod",
")",
"object",
")",
";",
"}"
] | Extracts duration values from an object of this converter's type, and
sets them into the given ReadWritablePeriod.
@param duration duration to get modified
@param object the object to convert, must not be null
@param chrono the chronology to use
@throws NullPointerException if the duration or object is null
@throws ... | [
"Extracts",
"duration",
"values",
"from",
"an",
"object",
"of",
"this",
"converter",
"s",
"type",
"and",
"sets",
"them",
"into",
"the",
"given",
"ReadWritablePeriod",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java#L57-L59 |
22,385 | JodaOrg/joda-time | src/main/java/org/joda/time/convert/ReadablePeriodConverter.java | ReadablePeriodConverter.getPeriodType | public PeriodType getPeriodType(Object object) {
ReadablePeriod period = (ReadablePeriod) object;
return period.getPeriodType();
} | java | public PeriodType getPeriodType(Object object) {
ReadablePeriod period = (ReadablePeriod) object;
return period.getPeriodType();
} | [
"public",
"PeriodType",
"getPeriodType",
"(",
"Object",
"object",
")",
"{",
"ReadablePeriod",
"period",
"=",
"(",
"ReadablePeriod",
")",
"object",
";",
"return",
"period",
".",
"getPeriodType",
"(",
")",
";",
"}"
] | Selects a suitable period type for the given object.
@param object the object to examine, must not be null
@return the period type from the readable duration
@throws NullPointerException if the object is null
@throws ClassCastException if the object is an invalid type | [
"Selects",
"a",
"suitable",
"period",
"type",
"for",
"the",
"given",
"object",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/convert/ReadablePeriodConverter.java#L69-L72 |
22,386 | JodaOrg/joda-time | src/main/java/org/joda/time/field/OffsetDateTimeField.java | OffsetDateTimeField.add | public long add(long instant, int amount) {
instant = super.add(instant, amount);
FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax);
return instant;
} | java | public long add(long instant, int amount) {
instant = super.add(instant, amount);
FieldUtils.verifyValueBounds(this, get(instant), iMin, iMax);
return instant;
} | [
"public",
"long",
"add",
"(",
"long",
"instant",
",",
"int",
"amount",
")",
"{",
"instant",
"=",
"super",
".",
"add",
"(",
"instant",
",",
"amount",
")",
";",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"get",
"(",
"instant",
")",
",",
... | Add the specified amount of offset units to the specified time
instant. The amount added may be negative.
@param instant the time instant in millis to update.
@param amount the amount of units to add (can be negative).
@return the updated time instant. | [
"Add",
"the",
"specified",
"amount",
"of",
"offset",
"units",
"to",
"the",
"specified",
"time",
"instant",
".",
"The",
"amount",
"added",
"may",
"be",
"negative",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/OffsetDateTimeField.java#L112-L116 |
22,387 | JodaOrg/joda-time | src/main/java/org/joda/time/field/OffsetDateTimeField.java | OffsetDateTimeField.set | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
return super.set(instant, value - iOffset);
} | java | public long set(long instant, int value) {
FieldUtils.verifyValueBounds(this, value, iMin, iMax);
return super.set(instant, value - iOffset);
} | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"FieldUtils",
".",
"verifyValueBounds",
"(",
"this",
",",
"value",
",",
"iMin",
",",
"iMax",
")",
";",
"return",
"super",
".",
"set",
"(",
"instant",
",",
"value",
"-",
"... | Set the specified amount of offset units to the specified time instant.
@param instant the time instant in millis to update.
@param value value of units to set.
@return the updated time instant.
@throws IllegalArgumentException if value is too large or too small. | [
"Set",
"the",
"specified",
"amount",
"of",
"offset",
"units",
"to",
"the",
"specified",
"time",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/OffsetDateTimeField.java#L152-L155 |
22,388 | JodaOrg/joda-time | src/main/java/org/joda/time/field/UnsupportedDateTimeField.java | UnsupportedDateTimeField.getInstance | public static synchronized UnsupportedDateTimeField getInstance(
DateTimeFieldType type, DurationField durationField) {
UnsupportedDateTimeField field;
if (cCache == null) {
cCache = new HashMap<DateTimeFieldType, UnsupportedDateTimeField>(7);
field = null;
}... | java | public static synchronized UnsupportedDateTimeField getInstance(
DateTimeFieldType type, DurationField durationField) {
UnsupportedDateTimeField field;
if (cCache == null) {
cCache = new HashMap<DateTimeFieldType, UnsupportedDateTimeField>(7);
field = null;
}... | [
"public",
"static",
"synchronized",
"UnsupportedDateTimeField",
"getInstance",
"(",
"DateTimeFieldType",
"type",
",",
"DurationField",
"durationField",
")",
"{",
"UnsupportedDateTimeField",
"field",
";",
"if",
"(",
"cCache",
"==",
"null",
")",
"{",
"cCache",
"=",
"n... | Gets an instance of UnsupportedDateTimeField for a specific named field.
Names should be of standard format, such as 'monthOfYear' or 'hourOfDay'.
The returned instance is cached.
@param type the type to obtain
@return the instance
@throws IllegalArgumentException if durationField is null | [
"Gets",
"an",
"instance",
"of",
"UnsupportedDateTimeField",
"for",
"a",
"specific",
"named",
"field",
".",
"Names",
"should",
"be",
"of",
"standard",
"format",
"such",
"as",
"monthOfYear",
"or",
"hourOfDay",
".",
"The",
"returned",
"instance",
"is",
"cached",
... | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java#L51-L69 |
22,389 | JodaOrg/joda-time | src/main/java/org/joda/time/field/UnsupportedDateTimeField.java | UnsupportedDateTimeField.set | public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
throw unsupported();
} | java | public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
throw unsupported();
} | [
"public",
"int",
"[",
"]",
"set",
"(",
"ReadablePartial",
"instant",
",",
"int",
"fieldIndex",
",",
"int",
"[",
"]",
"values",
",",
"String",
"text",
",",
"Locale",
"locale",
")",
"{",
"throw",
"unsupported",
"(",
")",
";",
"}"
] | Always throws UnsupportedOperationException
@throws UnsupportedOperationException | [
"Always",
"throws",
"UnsupportedOperationException"
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/UnsupportedDateTimeField.java#L332-L334 |
22,390 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withChronology | public Interval withChronology(Chronology chronology) {
if (getChronology() == chronology) {
return this;
}
return new Interval(getStartMillis(), getEndMillis(), chronology);
} | java | public Interval withChronology(Chronology chronology) {
if (getChronology() == chronology) {
return this;
}
return new Interval(getStartMillis(), getEndMillis(), chronology);
} | [
"public",
"Interval",
"withChronology",
"(",
"Chronology",
"chronology",
")",
"{",
"if",
"(",
"getChronology",
"(",
")",
"==",
"chronology",
")",
"{",
"return",
"this",
";",
"}",
"return",
"new",
"Interval",
"(",
"getStartMillis",
"(",
")",
",",
"getEndMilli... | Creates a new interval with the same start and end, but a different chronology.
@param chronology the chronology to use, null means ISO default
@return an interval with a different chronology | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"same",
"start",
"and",
"end",
"but",
"a",
"different",
"chronology",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L431-L436 |
22,391 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withStart | public Interval withStart(ReadableInstant start) {
long startMillis = DateTimeUtils.getInstantMillis(start);
return withStartMillis(startMillis);
} | java | public Interval withStart(ReadableInstant start) {
long startMillis = DateTimeUtils.getInstantMillis(start);
return withStartMillis(startMillis);
} | [
"public",
"Interval",
"withStart",
"(",
"ReadableInstant",
"start",
")",
"{",
"long",
"startMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"start",
")",
";",
"return",
"withStartMillis",
"(",
"startMillis",
")",
";",
"}"
] | Creates a new interval with the specified start instant.
@param start the start instant for the new interval, null means now
@return an interval with the end from this interval and the specified start
@throws IllegalArgumentException if the resulting interval has end before start | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"start",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L459-L462 |
22,392 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withEnd | public Interval withEnd(ReadableInstant end) {
long endMillis = DateTimeUtils.getInstantMillis(end);
return withEndMillis(endMillis);
} | java | public Interval withEnd(ReadableInstant end) {
long endMillis = DateTimeUtils.getInstantMillis(end);
return withEndMillis(endMillis);
} | [
"public",
"Interval",
"withEnd",
"(",
"ReadableInstant",
"end",
")",
"{",
"long",
"endMillis",
"=",
"DateTimeUtils",
".",
"getInstantMillis",
"(",
"end",
")",
";",
"return",
"withEndMillis",
"(",
"endMillis",
")",
";",
"}"
] | Creates a new interval with the specified end instant.
@param end the end instant for the new interval, null means now
@return an interval with the start from this interval and the specified end
@throws IllegalArgumentException if the resulting interval has end before start | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"end",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L485-L488 |
22,393 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withDurationAfterStart | public Interval withDurationAfterStart(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
if (durationMillis == toDurationMillis()) {
return this;
}
Chronology chrono = getChronology();
long startMillis = getStartMillis();
... | java | public Interval withDurationAfterStart(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
if (durationMillis == toDurationMillis()) {
return this;
}
Chronology chrono = getChronology();
long startMillis = getStartMillis();
... | [
"public",
"Interval",
"withDurationAfterStart",
"(",
"ReadableDuration",
"duration",
")",
"{",
"long",
"durationMillis",
"=",
"DateTimeUtils",
".",
"getDurationMillis",
"(",
"duration",
")",
";",
"if",
"(",
"durationMillis",
"==",
"toDurationMillis",
"(",
")",
")",
... | Creates a new interval with the specified duration after the start instant.
@param duration the duration to add to the start to get the new end instant, null means zero
@return an interval with the start from this interval and a calculated end
@throws IllegalArgumentException if the duration is negative | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"duration",
"after",
"the",
"start",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L498-L507 |
22,394 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withDurationBeforeEnd | public Interval withDurationBeforeEnd(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
if (durationMillis == toDurationMillis()) {
return this;
}
Chronology chrono = getChronology();
long endMillis = getEndMillis();
... | java | public Interval withDurationBeforeEnd(ReadableDuration duration) {
long durationMillis = DateTimeUtils.getDurationMillis(duration);
if (durationMillis == toDurationMillis()) {
return this;
}
Chronology chrono = getChronology();
long endMillis = getEndMillis();
... | [
"public",
"Interval",
"withDurationBeforeEnd",
"(",
"ReadableDuration",
"duration",
")",
"{",
"long",
"durationMillis",
"=",
"DateTimeUtils",
".",
"getDurationMillis",
"(",
"duration",
")",
";",
"if",
"(",
"durationMillis",
"==",
"toDurationMillis",
"(",
")",
")",
... | Creates a new interval with the specified duration before the end instant.
@param duration the duration to subtract from the end to get the new start instant, null means zero
@return an interval with the end from this interval and a calculated start
@throws IllegalArgumentException if the duration is negative | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"duration",
"before",
"the",
"end",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L516-L525 |
22,395 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withPeriodAfterStart | public Interval withPeriodAfterStart(ReadablePeriod period) {
if (period == null) {
return withDurationAfterStart(null);
}
Chronology chrono = getChronology();
long startMillis = getStartMillis();
long endMillis = chrono.add(period, startMillis, 1);
return new... | java | public Interval withPeriodAfterStart(ReadablePeriod period) {
if (period == null) {
return withDurationAfterStart(null);
}
Chronology chrono = getChronology();
long startMillis = getStartMillis();
long endMillis = chrono.add(period, startMillis, 1);
return new... | [
"public",
"Interval",
"withPeriodAfterStart",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"return",
"withDurationAfterStart",
"(",
"null",
")",
";",
"}",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
";",
... | Creates a new interval with the specified period after the start instant.
@param period the period to add to the start to get the new end instant, null means zero
@return an interval with the start from this interval and a calculated end
@throws IllegalArgumentException if the period is negative | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"period",
"after",
"the",
"start",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L535-L543 |
22,396 | JodaOrg/joda-time | src/main/java/org/joda/time/Interval.java | Interval.withPeriodBeforeEnd | public Interval withPeriodBeforeEnd(ReadablePeriod period) {
if (period == null) {
return withDurationBeforeEnd(null);
}
Chronology chrono = getChronology();
long endMillis = getEndMillis();
long startMillis = chrono.add(period, endMillis, -1);
return new Inte... | java | public Interval withPeriodBeforeEnd(ReadablePeriod period) {
if (period == null) {
return withDurationBeforeEnd(null);
}
Chronology chrono = getChronology();
long endMillis = getEndMillis();
long startMillis = chrono.add(period, endMillis, -1);
return new Inte... | [
"public",
"Interval",
"withPeriodBeforeEnd",
"(",
"ReadablePeriod",
"period",
")",
"{",
"if",
"(",
"period",
"==",
"null",
")",
"{",
"return",
"withDurationBeforeEnd",
"(",
"null",
")",
";",
"}",
"Chronology",
"chrono",
"=",
"getChronology",
"(",
")",
";",
"... | Creates a new interval with the specified period before the end instant.
@param period the period to subtract from the end to get the new start instant, null means zero
@return an interval with the end from this interval and a calculated start
@throws IllegalArgumentException if the period is negative | [
"Creates",
"a",
"new",
"interval",
"with",
"the",
"specified",
"period",
"before",
"the",
"end",
"instant",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Interval.java#L552-L560 |
22,397 | JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java | BasicMonthOfYearDateTimeField.addWrapField | public long addWrapField(long instant, int months) {
return set(instant, FieldUtils.getWrappedValue(get(instant), months, MIN, iMax));
} | java | public long addWrapField(long instant, int months) {
return set(instant, FieldUtils.getWrappedValue(get(instant), months, MIN, iMax));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"months",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"months",
",",
"MIN",
",",
"iMax",
")",
")",
";"... | Add to the Month component of the specified time instant
wrapping around within that component if necessary.
@see org.joda.time.DateTimeField#addWrapField
@param instant the time instant in millis to update.
@param months the months to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"Month",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java#L248-L250 |
22,398 | JodaOrg/joda-time | src/main/java/org/joda/time/field/LenientDateTimeField.java | LenientDateTimeField.set | public long set(long instant, int value) {
// lenient needs to handle time zone chronologies
// so we do the calculation using local milliseconds
long localInstant = iBase.getZone().convertUTCToLocal(instant);
long difference = FieldUtils.safeSubtract(value, get(instant));
localI... | java | public long set(long instant, int value) {
// lenient needs to handle time zone chronologies
// so we do the calculation using local milliseconds
long localInstant = iBase.getZone().convertUTCToLocal(instant);
long difference = FieldUtils.safeSubtract(value, get(instant));
localI... | [
"public",
"long",
"set",
"(",
"long",
"instant",
",",
"int",
"value",
")",
"{",
"// lenient needs to handle time zone chronologies",
"// so we do the calculation using local milliseconds",
"long",
"localInstant",
"=",
"iBase",
".",
"getZone",
"(",
")",
".",
"convertUTCToL... | Set values which may be out of bounds by adding the difference between
the new value and the current value. | [
"Set",
"values",
"which",
"may",
"be",
"out",
"of",
"bounds",
"by",
"adding",
"the",
"difference",
"between",
"the",
"new",
"value",
"and",
"the",
"current",
"value",
"."
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/field/LenientDateTimeField.java#L69-L76 |
22,399 | JodaOrg/joda-time | src/main/java/org/joda/time/tz/DefaultNameProvider.java | DefaultNameProvider.getShortName | public String getShortName(Locale locale, String id, String nameKey, boolean standardTime) {
String[] nameSet = getNameSet(locale, id, nameKey, standardTime);
return nameSet == null ? null : nameSet[0];
} | java | public String getShortName(Locale locale, String id, String nameKey, boolean standardTime) {
String[] nameSet = getNameSet(locale, id, nameKey, standardTime);
return nameSet == null ? null : nameSet[0];
} | [
"public",
"String",
"getShortName",
"(",
"Locale",
"locale",
",",
"String",
"id",
",",
"String",
"nameKey",
",",
"boolean",
"standardTime",
")",
"{",
"String",
"[",
"]",
"nameSet",
"=",
"getNameSet",
"(",
"locale",
",",
"id",
",",
"nameKey",
",",
"standard... | handles changes to the nameKey better | [
"handles",
"changes",
"to",
"the",
"nameKey",
"better"
] | bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42 | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/tz/DefaultNameProvider.java#L105-L108 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.