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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
113,400 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/CronMapper.java | CronMapper.returnOnZeroExpression | @VisibleForTesting
static Function<CronField, CronField> returnOnZeroExpression(final CronFieldName name) {
return field -> {
final FieldConstraints constraints = FieldConstraintsBuilder.instance().forField(name).createConstraintsInstance();
return new CronField(name, new On(new Inte... | java | @VisibleForTesting
static Function<CronField, CronField> returnOnZeroExpression(final CronFieldName name) {
return field -> {
final FieldConstraints constraints = FieldConstraintsBuilder.instance().forField(name).createConstraintsInstance();
return new CronField(name, new On(new Inte... | [
"@",
"VisibleForTesting",
"static",
"Function",
"<",
"CronField",
",",
"CronField",
">",
"returnOnZeroExpression",
"(",
"final",
"CronFieldName",
"name",
")",
"{",
"return",
"field",
"->",
"{",
"final",
"FieldConstraints",
"constraints",
"=",
"FieldConstraintsBuilder"... | Creates a Function that returns a On instance with zero value.
@param name - Cron field name
@return new CronField -> CronField instance, never null | [
"Creates",
"a",
"Function",
"that",
"returns",
"a",
"On",
"instance",
"with",
"zero",
"value",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/CronMapper.java#L226-L232 |
113,401 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/CronMapper.java | CronMapper.returnAlwaysExpression | @VisibleForTesting
static Function<CronField, CronField> returnAlwaysExpression(final CronFieldName name) {
return field -> new CronField(name, always(), FieldConstraintsBuilder.instance().forField(name).createConstraintsInstance());
} | java | @VisibleForTesting
static Function<CronField, CronField> returnAlwaysExpression(final CronFieldName name) {
return field -> new CronField(name, always(), FieldConstraintsBuilder.instance().forField(name).createConstraintsInstance());
} | [
"@",
"VisibleForTesting",
"static",
"Function",
"<",
"CronField",
",",
"CronField",
">",
"returnAlwaysExpression",
"(",
"final",
"CronFieldName",
"name",
")",
"{",
"return",
"field",
"->",
"new",
"CronField",
"(",
"name",
",",
"always",
"(",
")",
",",
"FieldCo... | Creates a Function that returns an Always instance.
@param name - Cron field name
@return new CronField -> CronField instance, never null | [
"Creates",
"a",
"Function",
"that",
"returns",
"an",
"Always",
"instance",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/CronMapper.java#L240-L243 |
113,402 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java | DescriptionStrategyFactory.daysOfWeekInstance | public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression, final FieldDefinition definition) {
final Function<Integer, String> nominal = integer -> {
final int diff = definition instanceof DayOfWeekFieldDefinition
? DayOfW... | java | public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression, final FieldDefinition definition) {
final Function<Integer, String> nominal = integer -> {
final int diff = definition instanceof DayOfWeekFieldDefinition
? DayOfW... | [
"public",
"static",
"DescriptionStrategy",
"daysOfWeekInstance",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"FieldExpression",
"expression",
",",
"final",
"FieldDefinition",
"definition",
")",
"{",
"final",
"Function",
"<",
"Integer",
",",
"String",
">",
... | Creates description strategy for days of week.
@param bundle - locale
@param expression - CronFieldExpression
@return - DescriptionStrategy instance, never null | [
"Creates",
"description",
"strategy",
"for",
"days",
"of",
"week",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L39-L65 |
113,403 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java | DescriptionStrategyFactory.daysOfMonthInstance | public static DescriptionStrategy daysOfMonthInstance(final ResourceBundle bundle, final FieldExpression expression) {
final NominalDescriptionStrategy dom = new NominalDescriptionStrategy(bundle, null, expression);
dom.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) ... | java | public static DescriptionStrategy daysOfMonthInstance(final ResourceBundle bundle, final FieldExpression expression) {
final NominalDescriptionStrategy dom = new NominalDescriptionStrategy(bundle, null, expression);
dom.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) ... | [
"public",
"static",
"DescriptionStrategy",
"daysOfMonthInstance",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"FieldExpression",
"expression",
")",
"{",
"final",
"NominalDescriptionStrategy",
"dom",
"=",
"new",
"NominalDescriptionStrategy",
"(",
"bundle",
",",... | Creates description strategy for days of month.
@param bundle - locale
@param expression - CronFieldExpression
@return - DescriptionStrategy instance, never null | [
"Creates",
"description",
"strategy",
"for",
"days",
"of",
"month",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L74-L95 |
113,404 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java | DescriptionStrategyFactory.monthsInstance | public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(bundle, integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression);
} | java | public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(bundle, integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression);
} | [
"public",
"static",
"DescriptionStrategy",
"monthsInstance",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"FieldExpression",
"expression",
")",
"{",
"return",
"new",
"NominalDescriptionStrategy",
"(",
"bundle",
",",
"integer",
"->",
"Month",
".",
"of",
"(... | Creates description strategy for months.
@param bundle - locale
@param expression - CronFieldExpression
@return - DescriptionStrategy instance, never null | [
"Creates",
"description",
"strategy",
"for",
"months",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L104-L106 |
113,405 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java | DescriptionStrategyFactory.plainInstance | public static DescriptionStrategy plainInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(bundle, null, expression);
} | java | public static DescriptionStrategy plainInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(bundle, null, expression);
} | [
"public",
"static",
"DescriptionStrategy",
"plainInstance",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"FieldExpression",
"expression",
")",
"{",
"return",
"new",
"NominalDescriptionStrategy",
"(",
"bundle",
",",
"null",
",",
"expression",
")",
";",
"}"... | Creates nominal description strategy.
@param bundle - locale
@param expression - CronFieldExpression
@return - DescriptionStrategy instance, never null | [
"Creates",
"nominal",
"description",
"strategy",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/DescriptionStrategyFactory.java#L115-L117 |
113,406 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java | SecondsDescriptor.describe | protected String describe(final FieldExpression fieldExpression, final boolean and) {
Preconditions.checkNotNull(fieldExpression, "CronFieldExpression should not be null!");
if (fieldExpression instanceof Always) {
return describe(fieldExpression, and);
}
if (fieldExpression ... | java | protected String describe(final FieldExpression fieldExpression, final boolean and) {
Preconditions.checkNotNull(fieldExpression, "CronFieldExpression should not be null!");
if (fieldExpression instanceof Always) {
return describe(fieldExpression, and);
}
if (fieldExpression ... | [
"protected",
"String",
"describe",
"(",
"final",
"FieldExpression",
"fieldExpression",
",",
"final",
"boolean",
"and",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"fieldExpression",
",",
"\"CronFieldExpression should not be null!\"",
")",
";",
"if",
"(",
"fie... | Given a CronFieldExpression, provide a String with a human readable description.
Will identify CronFieldExpression subclasses and delegate.
@param fieldExpression - CronFieldExpression instance - not null
@param and - boolean expression that indicates if description should fit an "and" context
@return huma... | [
"Given",
"a",
"CronFieldExpression",
"provide",
"a",
"String",
"with",
"a",
"human",
"readable",
"description",
".",
"Will",
"identify",
"CronFieldExpression",
"subclasses",
"and",
"delegate",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java#L50-L68 |
113,407 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java | SecondsDescriptor.describe | protected String describe(final And and) {
final List<FieldExpression> expressions = new ArrayList<>();
final List<FieldExpression> onExpressions = new ArrayList<>();
for (final FieldExpression fieldExpression : and.getExpressions()) {
if (fieldExpression instanceof On) {
... | java | protected String describe(final And and) {
final List<FieldExpression> expressions = new ArrayList<>();
final List<FieldExpression> onExpressions = new ArrayList<>();
for (final FieldExpression fieldExpression : and.getExpressions()) {
if (fieldExpression instanceof On) {
... | [
"protected",
"String",
"describe",
"(",
"final",
"And",
"and",
")",
"{",
"final",
"List",
"<",
"FieldExpression",
">",
"expressions",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"List",
"<",
"FieldExpression",
">",
"onExpressions",
"=",
"new",
"... | Provide a human readable description for And instance.
@param and - And
@return human readable description - String | [
"Provide",
"a",
"human",
"readable",
"description",
"for",
"And",
"instance",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java#L86-L106 |
113,408 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java | SecondsDescriptor.describe | protected String describe(final On on, final boolean and) {
if (and) {
return nominalValue(on.getTime());
}
return String.format("%s %s ", bundle.getString("at"), nominalValue(on.getTime())) + "%s";
} | java | protected String describe(final On on, final boolean and) {
if (and) {
return nominalValue(on.getTime());
}
return String.format("%s %s ", bundle.getString("at"), nominalValue(on.getTime())) + "%s";
} | [
"protected",
"String",
"describe",
"(",
"final",
"On",
"on",
",",
"final",
"boolean",
"and",
")",
"{",
"if",
"(",
"and",
")",
"{",
"return",
"nominalValue",
"(",
"on",
".",
"getTime",
"(",
")",
")",
";",
"}",
"return",
"String",
".",
"format",
"(",
... | Provide a human readable description for On instance.
@param on - On
@return human readable description - String | [
"Provide",
"a",
"human",
"readable",
"description",
"for",
"On",
"instance",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/refactor/SecondsDescriptor.java#L136-L141 |
113,409 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/field/expression/visitor/ValidationFieldExpressionVisitor.java | ValidationFieldExpressionVisitor.isInRange | @VisibleForTesting
protected void isInRange(final FieldValue<?> fieldValue) {
if (fieldValue instanceof IntegerFieldValue) {
final int value = ((IntegerFieldValue) fieldValue).getValue();
if (!constraints.isInRange(value)) {
throw new IllegalArgumentException(String.f... | java | @VisibleForTesting
protected void isInRange(final FieldValue<?> fieldValue) {
if (fieldValue instanceof IntegerFieldValue) {
final int value = ((IntegerFieldValue) fieldValue).getValue();
if (!constraints.isInRange(value)) {
throw new IllegalArgumentException(String.f... | [
"@",
"VisibleForTesting",
"protected",
"void",
"isInRange",
"(",
"final",
"FieldValue",
"<",
"?",
">",
"fieldValue",
")",
"{",
"if",
"(",
"fieldValue",
"instanceof",
"IntegerFieldValue",
")",
"{",
"final",
"int",
"value",
"=",
"(",
"(",
"IntegerFieldValue",
")... | Check if given number is greater or equal to start range and minor or equal to end range.
@param fieldValue - to be validated
@throws IllegalArgumentException - if not in range | [
"Check",
"if",
"given",
"number",
"is",
"greater",
"or",
"equal",
"to",
"start",
"range",
"and",
"minor",
"or",
"equal",
"to",
"end",
"range",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/field/expression/visitor/ValidationFieldExpressionVisitor.java#L151-L159 |
113,410 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describe | public String describe(final Cron cron) {
Preconditions.checkNotNull(cron, "Cron must not be null");
final Map<CronFieldName, CronField> expressions = cron.retrieveFieldsAsMap();
final Map<CronFieldName, FieldDefinition> fieldDefinitions = cron.getCronDefinition().retrieveFieldDefinitionsAsMap()... | java | public String describe(final Cron cron) {
Preconditions.checkNotNull(cron, "Cron must not be null");
final Map<CronFieldName, CronField> expressions = cron.retrieveFieldsAsMap();
final Map<CronFieldName, FieldDefinition> fieldDefinitions = cron.getCronDefinition().retrieveFieldDefinitionsAsMap()... | [
"public",
"String",
"describe",
"(",
"final",
"Cron",
"cron",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"cron",
",",
"\"Cron must not be null\"",
")",
";",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"expressions",
"=",
"cron",
".",... | Provide a description of given CronFieldParseResult list.
@param cron - Cron instance, never null
if null, will throw NullPointerException
@return description - String | [
"Provide",
"a",
"description",
"of",
"given",
"CronFieldParseResult",
"list",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L58-L71 |
113,411 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describeHHmmss | public String describeHHmmss(final Map<CronFieldName, CronField> fields) {
return DescriptionStrategyFactory.hhMMssInstance(
resourceBundle,
fields.containsKey(CronFieldName.HOUR) ? fields.get(CronFieldName.HOUR).getExpression() : null,
fields.containsKey(CronFiel... | java | public String describeHHmmss(final Map<CronFieldName, CronField> fields) {
return DescriptionStrategyFactory.hhMMssInstance(
resourceBundle,
fields.containsKey(CronFieldName.HOUR) ? fields.get(CronFieldName.HOUR).getExpression() : null,
fields.containsKey(CronFiel... | [
"public",
"String",
"describeHHmmss",
"(",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"fields",
")",
"{",
"return",
"DescriptionStrategyFactory",
".",
"hhMMssInstance",
"(",
"resourceBundle",
",",
"fields",
".",
"containsKey",
"(",
"CronFieldName",... | Provide description for hours, minutes and seconds.
@param fields - fields to describe;
@return description - String | [
"Provide",
"description",
"for",
"hours",
"minutes",
"and",
"seconds",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L79-L86 |
113,412 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describeDayOfMonth | public String describeDayOfMonth(final Map<CronFieldName, CronField> fields) {
final String description = DescriptionStrategyFactory.daysOfMonthInstance(
resourceBundle,
fields.containsKey(CronFieldName.DAY_OF_MONTH) ? fields.get(CronFieldName.DAY_OF_MONTH).getExpression() : null... | java | public String describeDayOfMonth(final Map<CronFieldName, CronField> fields) {
final String description = DescriptionStrategyFactory.daysOfMonthInstance(
resourceBundle,
fields.containsKey(CronFieldName.DAY_OF_MONTH) ? fields.get(CronFieldName.DAY_OF_MONTH).getExpression() : null... | [
"public",
"String",
"describeDayOfMonth",
"(",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"fields",
")",
"{",
"final",
"String",
"description",
"=",
"DescriptionStrategyFactory",
".",
"daysOfMonthInstance",
"(",
"resourceBundle",
",",
"fields",
"."... | Provide description for day of month.
@param fields - fields to describe;
@return description - String | [
"Provide",
"description",
"for",
"day",
"of",
"month",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L94-L100 |
113,413 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describeMonth | public String describeMonth(final Map<CronFieldName, CronField> fields) {
final String description = DescriptionStrategyFactory.monthsInstance(
resourceBundle,
fields.containsKey(CronFieldName.MONTH) ? fields.get(CronFieldName.MONTH).getExpression() : null
).describe();
... | java | public String describeMonth(final Map<CronFieldName, CronField> fields) {
final String description = DescriptionStrategyFactory.monthsInstance(
resourceBundle,
fields.containsKey(CronFieldName.MONTH) ? fields.get(CronFieldName.MONTH).getExpression() : null
).describe();
... | [
"public",
"String",
"describeMonth",
"(",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"fields",
")",
"{",
"final",
"String",
"description",
"=",
"DescriptionStrategyFactory",
".",
"monthsInstance",
"(",
"resourceBundle",
",",
"fields",
".",
"conta... | Provide description for month.
@param fields - fields to describe;
@return description - String | [
"Provide",
"description",
"for",
"month",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L108-L115 |
113,414 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describeDayOfWeek | public String describeDayOfWeek(final Map<CronFieldName, CronField> fields, final Map<CronFieldName, FieldDefinition> definitions) {
final String description = DescriptionStrategyFactory.daysOfWeekInstance(
resourceBundle,
fields.containsKey(CronFieldName.DAY_OF_WEEK) ? fields.g... | java | public String describeDayOfWeek(final Map<CronFieldName, CronField> fields, final Map<CronFieldName, FieldDefinition> definitions) {
final String description = DescriptionStrategyFactory.daysOfWeekInstance(
resourceBundle,
fields.containsKey(CronFieldName.DAY_OF_WEEK) ? fields.g... | [
"public",
"String",
"describeDayOfWeek",
"(",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"fields",
",",
"final",
"Map",
"<",
"CronFieldName",
",",
"FieldDefinition",
">",
"definitions",
")",
"{",
"final",
"String",
"description",
"=",
"Descript... | Provide description for day of week.
@param fields - fields to describe;
@return description - String | [
"Provide",
"description",
"for",
"day",
"of",
"week",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L129-L137 |
113,415 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/CronDescriptor.java | CronDescriptor.describeYear | public String describeYear(final Map<CronFieldName, CronField> fields) {
final String description =
DescriptionStrategyFactory.plainInstance(
resourceBundle,
fields.containsKey(CronFieldName.YEAR) ? fields.get(CronFieldName.YEAR).getExpression() : ... | java | public String describeYear(final Map<CronFieldName, CronField> fields) {
final String description =
DescriptionStrategyFactory.plainInstance(
resourceBundle,
fields.containsKey(CronFieldName.YEAR) ? fields.get(CronFieldName.YEAR).getExpression() : ... | [
"public",
"String",
"describeYear",
"(",
"final",
"Map",
"<",
"CronFieldName",
",",
"CronField",
">",
"fields",
")",
"{",
"final",
"String",
"description",
"=",
"DescriptionStrategyFactory",
".",
"plainInstance",
"(",
"resourceBundle",
",",
"fields",
".",
"contain... | Provide description for a year.
@param fields - fields to describe;
@return description - String | [
"Provide",
"description",
"for",
"a",
"year",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/CronDescriptor.java#L151-L158 |
113,416 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java | OnDayOfWeekValueGenerator.generateNoneValues | private int generateNoneValues(final On on, final int year, final int month, final int reference) {
// the day of week the first of the month is on
final int dowForFirstDoM = LocalDate.of(year, month, 1).getDayOfWeek().getValue();// 1-7
// the day of week we need, normalize to jdk8time
f... | java | private int generateNoneValues(final On on, final int year, final int month, final int reference) {
// the day of week the first of the month is on
final int dowForFirstDoM = LocalDate.of(year, month, 1).getDayOfWeek().getValue();// 1-7
// the day of week we need, normalize to jdk8time
f... | [
"private",
"int",
"generateNoneValues",
"(",
"final",
"On",
"on",
",",
"final",
"int",
"year",
",",
"final",
"int",
"month",
",",
"final",
"int",
"reference",
")",
"{",
"// the day of week the first of the month is on",
"final",
"int",
"dowForFirstDoM",
"=",
"Loca... | Generate valid days of the month for the days of week expression. This method requires that you
pass it a -1 for the reference value when starting to generate a sequence of day values. That allows
it to handle the special case of which day of the month is the initial matching value.
@param on The expression obj... | [
"Generate",
"valid",
"days",
"of",
"the",
"month",
"for",
"the",
"days",
"of",
"week",
"expression",
".",
"This",
"method",
"requires",
"that",
"you",
"pass",
"it",
"a",
"-",
"1",
"for",
"the",
"reference",
"value",
"when",
"starting",
"to",
"generate",
... | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/generator/OnDayOfWeekValueGenerator.java#L136-L161 |
113,417 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronConstraintsFactory.java | CronConstraintsFactory.ensureEitherDayOfYearOrMonth | public static CronConstraint ensureEitherDayOfYearOrMonth() {
return new CronConstraint("Both, a day-of-year AND a day-of-month or day-of-week, are not supported.") {
private static final long serialVersionUID = 520379111876897579L;
@Override
public boolean validate(Cron cro... | java | public static CronConstraint ensureEitherDayOfYearOrMonth() {
return new CronConstraint("Both, a day-of-year AND a day-of-month or day-of-week, are not supported.") {
private static final long serialVersionUID = 520379111876897579L;
@Override
public boolean validate(Cron cro... | [
"public",
"static",
"CronConstraint",
"ensureEitherDayOfYearOrMonth",
"(",
")",
"{",
"return",
"new",
"CronConstraint",
"(",
"\"Both, a day-of-year AND a day-of-month or day-of-week, are not supported.\"",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",... | Creates CronConstraint to ensure that either day-of-year or month is assigned a specific value.
@return newly created CronConstraint instance, never {@code null}; | [
"Creates",
"CronConstraint",
"to",
"ensure",
"that",
"either",
"day",
"-",
"of",
"-",
"year",
"or",
"month",
"is",
"assigned",
"a",
"specific",
"value",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronConstraintsFactory.java#L30-L45 |
113,418 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/SingleCron.java | SingleCron.validate | public Cron validate() {
for (final Map.Entry<CronFieldName, CronField> field : retrieveFieldsAsMap().entrySet()) {
final CronFieldName fieldName = field.getKey();
field.getValue().getExpression().accept(
new ValidationFieldExpressionVisitor(getCronDefinition().getFie... | java | public Cron validate() {
for (final Map.Entry<CronFieldName, CronField> field : retrieveFieldsAsMap().entrySet()) {
final CronFieldName fieldName = field.getKey();
field.getValue().getExpression().accept(
new ValidationFieldExpressionVisitor(getCronDefinition().getFie... | [
"public",
"Cron",
"validate",
"(",
")",
"{",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"CronFieldName",
",",
"CronField",
">",
"field",
":",
"retrieveFieldsAsMap",
"(",
")",
".",
"entrySet",
"(",
")",
")",
"{",
"final",
"CronFieldName",
"fieldName",
... | Validates this Cron instance by validating its cron expression.
@return this Cron instance
@throws IllegalArgumentException if the cron expression is invalid | [
"Validates",
"this",
"Cron",
"instance",
"by",
"validating",
"its",
"cron",
"expression",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/SingleCron.java#L80-L93 |
113,419 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/SingleCron.java | SingleCron.equivalent | public boolean equivalent(final CronMapper cronMapper, final Cron cron) {
return asString().equals(cronMapper.map(cron).asString());
} | java | public boolean equivalent(final CronMapper cronMapper, final Cron cron) {
return asString().equals(cronMapper.map(cron).asString());
} | [
"public",
"boolean",
"equivalent",
"(",
"final",
"CronMapper",
"cronMapper",
",",
"final",
"Cron",
"cron",
")",
"{",
"return",
"asString",
"(",
")",
".",
"equals",
"(",
"cronMapper",
".",
"map",
"(",
"cron",
")",
".",
"asString",
"(",
")",
")",
";",
"}... | Provides means to compare if two cron expressions are equivalent.
@param cronMapper - maps 'cron' parameter to this instance definition;
@param cron - any cron instance, never null
@return boolean - true if equivalent; false otherwise. | [
"Provides",
"means",
"to",
"compare",
"if",
"two",
"cron",
"expressions",
"are",
"equivalent",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/SingleCron.java#L102-L104 |
113,420 | jmrozanec/cron-utils | src/main/java/com/cronutils/descriptor/TimeDescriptionStrategy.java | TimeDescriptionStrategy.ensureInstance | private FieldExpression ensureInstance(final FieldExpression expression, final FieldExpression defaultExpression) {
Preconditions.checkNotNull(defaultExpression, "Default expression must not be null");
if (expression != null) {
return expression;
} else {
return defaultEx... | java | private FieldExpression ensureInstance(final FieldExpression expression, final FieldExpression defaultExpression) {
Preconditions.checkNotNull(defaultExpression, "Default expression must not be null");
if (expression != null) {
return expression;
} else {
return defaultEx... | [
"private",
"FieldExpression",
"ensureInstance",
"(",
"final",
"FieldExpression",
"expression",
",",
"final",
"FieldExpression",
"defaultExpression",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"defaultExpression",
",",
"\"Default expression must not be null\"",
")",
... | Give an expression instance, will return it if is not null. Otherwise will return the defaultExpression;
@param expression - CronFieldExpression instance; may be null
@param defaultExpression - CronFieldExpression, never null;
@return the given expression or the given defaultExpression in case the given express... | [
"Give",
"an",
"expression",
"instance",
"will",
"return",
"it",
"if",
"is",
"not",
"null",
".",
"Otherwise",
"will",
"return",
"the",
"defaultExpression",
";"
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/descriptor/TimeDescriptionStrategy.java#L73-L80 |
113,421 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.register | public void register(final FieldDefinition definition) {
//ensure that we can't register a mandatory definition if there are already optional ones
boolean hasOptionalField = false;
for (final FieldDefinition fieldDefinition : fields.values()) {
if (fieldDefinition.isOptional()) {
... | java | public void register(final FieldDefinition definition) {
//ensure that we can't register a mandatory definition if there are already optional ones
boolean hasOptionalField = false;
for (final FieldDefinition fieldDefinition : fields.values()) {
if (fieldDefinition.isOptional()) {
... | [
"public",
"void",
"register",
"(",
"final",
"FieldDefinition",
"definition",
")",
"{",
"//ensure that we can't register a mandatory definition if there are already optional ones",
"boolean",
"hasOptionalField",
"=",
"false",
";",
"for",
"(",
"final",
"FieldDefinition",
"fieldDe... | Registers a certain FieldDefinition.
@param definition - FieldDefinition instance, never null | [
"Registers",
"a",
"certain",
"FieldDefinition",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L161-L174 |
113,422 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.instance | public CronDefinition instance() {
final Set<CronConstraint> validations = new HashSet<>();
validations.addAll(cronConstraints);
final List<FieldDefinition> values = new ArrayList<>(fields.values());
values.sort(FieldDefinition.createFieldDefinitionComparator());
return new CronD... | java | public CronDefinition instance() {
final Set<CronConstraint> validations = new HashSet<>();
validations.addAll(cronConstraints);
final List<FieldDefinition> values = new ArrayList<>(fields.values());
values.sort(FieldDefinition.createFieldDefinitionComparator());
return new CronD... | [
"public",
"CronDefinition",
"instance",
"(",
")",
"{",
"final",
"Set",
"<",
"CronConstraint",
">",
"validations",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"validations",
".",
"addAll",
"(",
"cronConstraints",
")",
";",
"final",
"List",
"<",
"FieldDefiniti... | Creates a new CronDefinition instance with provided field definitions.
@return returns CronDefinition instance, never null | [
"Creates",
"a",
"new",
"CronDefinition",
"instance",
"with",
"provided",
"field",
"definitions",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L181-L187 |
113,423 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.cron4j | private static CronDefinition cron4j() {
return CronDefinitionBuilder.defineCron()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().supportsL().and()
.withMonth().and()
.withDayOfWeek().withValidRange(0, 6).withMondayDoWVal... | java | private static CronDefinition cron4j() {
return CronDefinitionBuilder.defineCron()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().supportsL().and()
.withMonth().and()
.withDayOfWeek().withValidRange(0, 6).withMondayDoWVal... | [
"private",
"static",
"CronDefinition",
"cron4j",
"(",
")",
"{",
"return",
"CronDefinitionBuilder",
".",
"defineCron",
"(",
")",
".",
"withMinutes",
"(",
")",
".",
"and",
"(",
")",
".",
"withHours",
"(",
")",
".",
"and",
"(",
")",
".",
"withDayOfMonth",
"... | Creates CronDefinition instance matching cron4j specification.
@return CronDefinition instance, never null; | [
"Creates",
"CronDefinition",
"instance",
"matching",
"cron4j",
"specification",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L194-L204 |
113,424 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.quartz | private static CronDefinition quartz() {
return CronDefinitionBuilder.defineCron()
.withSeconds().and()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().withValidRange(1, 32).supportsL().supportsW().supportsLW().supportsQuestionMark().and(... | java | private static CronDefinition quartz() {
return CronDefinitionBuilder.defineCron()
.withSeconds().and()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().withValidRange(1, 32).supportsL().supportsW().supportsLW().supportsQuestionMark().and(... | [
"private",
"static",
"CronDefinition",
"quartz",
"(",
")",
"{",
"return",
"CronDefinitionBuilder",
".",
"defineCron",
"(",
")",
".",
"withSeconds",
"(",
")",
".",
"and",
"(",
")",
".",
"withMinutes",
"(",
")",
".",
"and",
"(",
")",
".",
"withHours",
"(",... | Creates CronDefinition instance matching Quartz specification.
<p>The cron expression is expected to be a string comprised of 6 or 7
fields separated by white space. Fields can contain any of the allowed
values, along with various combinations of the allowed special characters
for that field. The fields are as follows... | [
"Creates",
"CronDefinition",
"instance",
"matching",
"Quartz",
"specification",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L271-L282 |
113,425 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.spring | private static CronDefinition spring() {
return CronDefinitionBuilder.defineCron()
.withSeconds().and()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().supportsQuestionMark().and()
.withMonth().and()
.withD... | java | private static CronDefinition spring() {
return CronDefinitionBuilder.defineCron()
.withSeconds().and()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().supportsQuestionMark().and()
.withMonth().and()
.withD... | [
"private",
"static",
"CronDefinition",
"spring",
"(",
")",
"{",
"return",
"CronDefinitionBuilder",
".",
"defineCron",
"(",
")",
".",
"withSeconds",
"(",
")",
".",
"and",
"(",
")",
".",
"withMinutes",
"(",
")",
".",
"and",
"(",
")",
".",
"withHours",
"(",... | Creates CronDefinition instance matching Spring specification.
<p>The cron expression is expected to be a string comprised of 6
fields separated by white space. Fields can contain any of the allowed
values, along with various combinations of the allowed special characters
for that field. The fields are as follows:
<t... | [
"Creates",
"CronDefinition",
"instance",
"matching",
"Spring",
"specification",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L343-L352 |
113,426 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.unixCrontab | private static CronDefinition unixCrontab() {
return CronDefinitionBuilder.defineCron()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().and()
.withMonth().and()
.withDayOfWeek().withValidRange(0, 7).withMondayDoWValue(1).w... | java | private static CronDefinition unixCrontab() {
return CronDefinitionBuilder.defineCron()
.withMinutes().and()
.withHours().and()
.withDayOfMonth().and()
.withMonth().and()
.withDayOfWeek().withValidRange(0, 7).withMondayDoWValue(1).w... | [
"private",
"static",
"CronDefinition",
"unixCrontab",
"(",
")",
"{",
"return",
"CronDefinitionBuilder",
".",
"defineCron",
"(",
")",
".",
"withMinutes",
"(",
")",
".",
"and",
"(",
")",
".",
"withHours",
"(",
")",
".",
"and",
"(",
")",
".",
"withDayOfMonth"... | Creates CronDefinition instance matching unix crontab specification.
@return CronDefinition instance, never null; | [
"Creates",
"CronDefinition",
"instance",
"matching",
"unix",
"crontab",
"specification",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L359-L368 |
113,427 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java | CronDefinitionBuilder.instanceDefinitionFor | public static CronDefinition instanceDefinitionFor(final CronType cronType) {
switch (cronType) {
case CRON4J:
return cron4j();
case QUARTZ:
return quartz();
case UNIX:
return unixCrontab();
case SPRING:
... | java | public static CronDefinition instanceDefinitionFor(final CronType cronType) {
switch (cronType) {
case CRON4J:
return cron4j();
case QUARTZ:
return quartz();
case UNIX:
return unixCrontab();
case SPRING:
... | [
"public",
"static",
"CronDefinition",
"instanceDefinitionFor",
"(",
"final",
"CronType",
"cronType",
")",
"{",
"switch",
"(",
"cronType",
")",
"{",
"case",
"CRON4J",
":",
"return",
"cron4j",
"(",
")",
";",
"case",
"QUARTZ",
":",
"return",
"quartz",
"(",
")",... | Creates CronDefinition instance matching cronType specification.
@param cronType - some cron type. If null, a RuntimeException will be raised.
@return CronDefinition instance if definition is found; a RuntimeException otherwise. | [
"Creates",
"CronDefinition",
"instance",
"matching",
"cronType",
"specification",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/definition/CronDefinitionBuilder.java#L376-L389 |
113,428 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/WeekDay.java | WeekDay.mapTo | public int mapTo(final int dayOfWeek, final WeekDay targetWeekDayDefinition) {
if (firstDayZero && targetWeekDayDefinition.isFirstDayZero()) {
return bothSameStartOfRange(0, 6, this, targetWeekDayDefinition).apply(dayOfWeek);
}
if (!firstDayZero && !targetWeekDayDefinition.isFirstDay... | java | public int mapTo(final int dayOfWeek, final WeekDay targetWeekDayDefinition) {
if (firstDayZero && targetWeekDayDefinition.isFirstDayZero()) {
return bothSameStartOfRange(0, 6, this, targetWeekDayDefinition).apply(dayOfWeek);
}
if (!firstDayZero && !targetWeekDayDefinition.isFirstDay... | [
"public",
"int",
"mapTo",
"(",
"final",
"int",
"dayOfWeek",
",",
"final",
"WeekDay",
"targetWeekDayDefinition",
")",
"{",
"if",
"(",
"firstDayZero",
"&&",
"targetWeekDayDefinition",
".",
"isFirstDayZero",
"(",
")",
")",
"{",
"return",
"bothSameStartOfRange",
"(",
... | Maps given WeekDay to representation hold by this instance.
@param targetWeekDayDefinition - referred weekDay
@param dayOfWeek - day of week to be mapped.
Value corresponds to this instance mapping.
@return - int result | [
"Maps",
"given",
"WeekDay",
"to",
"representation",
"hold",
"by",
"this",
"instance",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/WeekDay.java#L51-L66 |
113,429 | jmrozanec/cron-utils | src/main/java/com/cronutils/mapper/ConstantsMapper.java | ConstantsMapper.weekDayMapping | public static int weekDayMapping(final WeekDay source, final WeekDay target, final int weekday) {
return source.mapTo(weekday, target);
} | java | public static int weekDayMapping(final WeekDay source, final WeekDay target, final int weekday) {
return source.mapTo(weekday, target);
} | [
"public",
"static",
"int",
"weekDayMapping",
"(",
"final",
"WeekDay",
"source",
",",
"final",
"WeekDay",
"target",
",",
"final",
"int",
"weekday",
")",
"{",
"return",
"source",
".",
"mapTo",
"(",
"weekday",
",",
"target",
")",
";",
"}"
] | Performs weekday mapping between two weekday definitions.
@param source - source
@param target - target weekday definition
@param weekday - value in source range.
@return int - mapped value | [
"Performs",
"weekday",
"mapping",
"between",
"two",
"weekday",
"definitions",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/mapper/ConstantsMapper.java#L31-L33 |
113,430 | jmrozanec/cron-utils | src/main/java/com/cronutils/parser/CronParserField.java | CronParserField.parse | public CronField parse(final String expression) {
return new CronField(field, parser.parse(expression), constraints);
} | java | public CronField parse(final String expression) {
return new CronField(field, parser.parse(expression), constraints);
} | [
"public",
"CronField",
"parse",
"(",
"final",
"String",
"expression",
")",
"{",
"return",
"new",
"CronField",
"(",
"field",
",",
"parser",
".",
"parse",
"(",
"expression",
")",
",",
"constraints",
")",
";",
"}"
] | Parses a String cron expression.
@param expression - cron expression
@return parse result as CronFieldParseResult instance - never null. May throw a RuntimeException if cron expression is bad. | [
"Parses",
"a",
"String",
"cron",
"expression",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/parser/CronParserField.java#L81-L83 |
113,431 | jmrozanec/cron-utils | src/main/java/com/cronutils/parser/CronParser.java | CronParser.buildPossibleExpressions | private void buildPossibleExpressions(final CronDefinition cronDefinition) {
final List<CronParserField> sortedExpression = cronDefinition.getFieldDefinitions().stream()
.map(this::toCronParserField)
.sorted(CronParserField.createFieldTypeComparator())
.collect(Co... | java | private void buildPossibleExpressions(final CronDefinition cronDefinition) {
final List<CronParserField> sortedExpression = cronDefinition.getFieldDefinitions().stream()
.map(this::toCronParserField)
.sorted(CronParserField.createFieldTypeComparator())
.collect(Co... | [
"private",
"void",
"buildPossibleExpressions",
"(",
"final",
"CronDefinition",
"cronDefinition",
")",
"{",
"final",
"List",
"<",
"CronParserField",
">",
"sortedExpression",
"=",
"cronDefinition",
".",
"getFieldDefinitions",
"(",
")",
".",
"stream",
"(",
")",
".",
... | Build possible cron expressions from definitions. One is built for sure. A second one may be build if last field is optional.
@param cronDefinition - cron definition instance | [
"Build",
"possible",
"cron",
"expressions",
"from",
"definitions",
".",
"One",
"is",
"built",
"for",
"sure",
".",
"A",
"second",
"one",
"may",
"be",
"build",
"if",
"last",
"field",
"is",
"optional",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/parser/CronParser.java#L55-L72 |
113,432 | jmrozanec/cron-utils | src/main/java/com/cronutils/parser/FieldParser.java | FieldParser.parse | public FieldExpression parse(final String expression) {
if (!StringUtils.containsAny(expression, SPECIAL_CHARS_MINUS_STAR)) {
if (expression.contains(QUESTION_MARK_STRING) && !fieldConstraints.getSpecialChars().contains(QUESTION_MARK)) {
throw new IllegalArgumentException("Invalid ex... | java | public FieldExpression parse(final String expression) {
if (!StringUtils.containsAny(expression, SPECIAL_CHARS_MINUS_STAR)) {
if (expression.contains(QUESTION_MARK_STRING) && !fieldConstraints.getSpecialChars().contains(QUESTION_MARK)) {
throw new IllegalArgumentException("Invalid ex... | [
"public",
"FieldExpression",
"parse",
"(",
"final",
"String",
"expression",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"containsAny",
"(",
"expression",
",",
"SPECIAL_CHARS_MINUS_STAR",
")",
")",
"{",
"if",
"(",
"expression",
".",
"contains",
"(",
"QUESTION... | Parse given expression for a single cron field.
@param expression - String
@return CronFieldExpression object that with interpretation of given String parameter | [
"Parse",
"given",
"expression",
"for",
"a",
"single",
"cron",
"field",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/parser/FieldParser.java#L73-L94 |
113,433 | jmrozanec/cron-utils | src/main/java/com/cronutils/parser/FieldParser.java | FieldParser.stringToInt | @VisibleForTesting
protected int stringToInt(final String exp) {
final Integer value = fieldConstraints.getStringMappingValue(exp);
if (value != null) {
return value;
} else {
try {
return Integer.parseInt(exp);
} catch (final NumberFormatE... | java | @VisibleForTesting
protected int stringToInt(final String exp) {
final Integer value = fieldConstraints.getStringMappingValue(exp);
if (value != null) {
return value;
} else {
try {
return Integer.parseInt(exp);
} catch (final NumberFormatE... | [
"@",
"VisibleForTesting",
"protected",
"int",
"stringToInt",
"(",
"final",
"String",
"exp",
")",
"{",
"final",
"Integer",
"value",
"=",
"fieldConstraints",
".",
"getStringMappingValue",
"(",
"exp",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"retur... | Maps string expression to integer. If no mapping is found, will try to parse String as Integer
@param exp - expression to be mapped
@return integer value for string expression | [
"Maps",
"string",
"expression",
"to",
"integer",
".",
"If",
"no",
"mapping",
"is",
"found",
"will",
"try",
"to",
"parse",
"String",
"as",
"Integer"
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/parser/FieldParser.java#L259-L272 |
113,434 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.nextExecution | public Optional<ZonedDateTime> nextExecution(final ZonedDateTime date) {
Preconditions.checkNotNull(date);
try {
ZonedDateTime nextMatch = nextClosestMatch(date);
if (nextMatch.equals(date)) {
nextMatch = nextClosestMatch(date.plusSeconds(1));
}
... | java | public Optional<ZonedDateTime> nextExecution(final ZonedDateTime date) {
Preconditions.checkNotNull(date);
try {
ZonedDateTime nextMatch = nextClosestMatch(date);
if (nextMatch.equals(date)) {
nextMatch = nextClosestMatch(date.plusSeconds(1));
}
... | [
"public",
"Optional",
"<",
"ZonedDateTime",
">",
"nextExecution",
"(",
"final",
"ZonedDateTime",
"date",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"date",
")",
";",
"try",
"{",
"ZonedDateTime",
"nextMatch",
"=",
"nextClosestMatch",
"(",
"date",
")",
... | Provide nearest date for next execution.
@param date - ZonedDateTime instance. If null, a NullPointerException will be raised.
@return Optional ZonedDateTime instance, never null. Contains next execution time or empty. | [
"Provide",
"nearest",
"date",
"for",
"next",
"execution",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L101-L112 |
113,435 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.nextClosestMatch | private ZonedDateTime nextClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
ExecutionTimeResult result = new ExecutionTimeResult(date, false);
for (int i = 0; i < MAX_ITERATIONS; i++) {
result = potentialNextClosestMatch(result.getTime());
if (result.isMatch())... | java | private ZonedDateTime nextClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
ExecutionTimeResult result = new ExecutionTimeResult(date, false);
for (int i = 0; i < MAX_ITERATIONS; i++) {
result = potentialNextClosestMatch(result.getTime());
if (result.isMatch())... | [
"private",
"ZonedDateTime",
"nextClosestMatch",
"(",
"final",
"ZonedDateTime",
"date",
")",
"throws",
"NoSuchValueException",
"{",
"ExecutionTimeResult",
"result",
"=",
"new",
"ExecutionTimeResult",
"(",
"date",
",",
"false",
")",
";",
"for",
"(",
"int",
"i",
"=",... | If date is not match, will return next closest match.
If date is match, will return this date.
@param date - reference ZonedDateTime instance - never null;
@return ZonedDateTime instance, never null. Value obeys logic specified above.
@throws NoSuchValueException if there is no potential next year | [
"If",
"date",
"is",
"not",
"match",
"will",
"return",
"next",
"closest",
"match",
".",
"If",
"date",
"is",
"match",
"will",
"return",
"this",
"date",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L122-L135 |
113,436 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.previousClosestMatch | private ZonedDateTime previousClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
ExecutionTimeResult result = new ExecutionTimeResult(date, false);
for (int i = 0; i < MAX_ITERATIONS; i++) {
result = potentialPreviousClosestMatch(result.getTime());
if (result.i... | java | private ZonedDateTime previousClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
ExecutionTimeResult result = new ExecutionTimeResult(date, false);
for (int i = 0; i < MAX_ITERATIONS; i++) {
result = potentialPreviousClosestMatch(result.getTime());
if (result.i... | [
"private",
"ZonedDateTime",
"previousClosestMatch",
"(",
"final",
"ZonedDateTime",
"date",
")",
"throws",
"NoSuchValueException",
"{",
"ExecutionTimeResult",
"result",
"=",
"new",
"ExecutionTimeResult",
"(",
"date",
",",
"false",
")",
";",
"for",
"(",
"int",
"i",
... | If date is not match, will return previous closest match.
If date is match, will return this date.
@param date - reference ZonedDateTime instance - never null;
@return ZonedDateTime instance, never null. Value obeys logic specified above.
@throws NoSuchValueException if there is not previous year | [
"If",
"date",
"is",
"not",
"match",
"will",
"return",
"previous",
"closest",
"match",
".",
"If",
"date",
"is",
"match",
"will",
"return",
"this",
"date",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L288-L298 |
113,437 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.lastExecution | public Optional<ZonedDateTime> lastExecution(final ZonedDateTime date) {
Preconditions.checkNotNull(date);
try {
ZonedDateTime previousMatch = previousClosestMatch(date);
if (previousMatch.equals(date)) {
previousMatch = previousClosestMatch(date.minusSeconds(1));... | java | public Optional<ZonedDateTime> lastExecution(final ZonedDateTime date) {
Preconditions.checkNotNull(date);
try {
ZonedDateTime previousMatch = previousClosestMatch(date);
if (previousMatch.equals(date)) {
previousMatch = previousClosestMatch(date.minusSeconds(1));... | [
"public",
"Optional",
"<",
"ZonedDateTime",
">",
"lastExecution",
"(",
"final",
"ZonedDateTime",
"date",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"date",
")",
";",
"try",
"{",
"ZonedDateTime",
"previousMatch",
"=",
"previousClosestMatch",
"(",
"date",
... | Provide nearest date for last execution.
@param date - ZonedDateTime instance. If null, a NullPointerException will be raised.
@return Optional ZonedDateTime instance, never null. Last execution time or empty. | [
"Provide",
"nearest",
"date",
"for",
"last",
"execution",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L550-L561 |
113,438 | jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.isMatch | public boolean isMatch(ZonedDateTime date) {
// Issue #200: Truncating the date to the least granular precision supported by different cron systems.
// For Quartz, it's seconds while for Unix & Cron4J it's minutes.
final boolean isSecondGranularity = cronDefinition.containsFieldDefinition(SECOND... | java | public boolean isMatch(ZonedDateTime date) {
// Issue #200: Truncating the date to the least granular precision supported by different cron systems.
// For Quartz, it's seconds while for Unix & Cron4J it's minutes.
final boolean isSecondGranularity = cronDefinition.containsFieldDefinition(SECOND... | [
"public",
"boolean",
"isMatch",
"(",
"ZonedDateTime",
"date",
")",
"{",
"// Issue #200: Truncating the date to the least granular precision supported by different cron systems.",
"// For Quartz, it's seconds while for Unix & Cron4J it's minutes.",
"final",
"boolean",
"isSecondGranularity",
... | Provide feedback if a given date matches the cron expression.
@param date - ZonedDateTime instance. If null, a NullPointerException will be raised.
@return true if date matches cron expression requirements, false otherwise. | [
"Provide",
"feedback",
"if",
"a",
"given",
"date",
"matches",
"the",
"cron",
"expression",
"."
] | adac5ec8fd9160b082f9762a6eedea0715731170 | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L579-L610 |
113,439 | allegro/embedded-elasticsearch | core/src/main/java/pl/allegro/tech/embeddedelasticsearch/EmbeddedElastic.java | EmbeddedElastic.start | public synchronized EmbeddedElastic start() throws IOException, InterruptedException {
if (!started) {
started = true;
installElastic();
startElastic();
createRestClient();
createTemplates();
createIndices();
}
return this;
... | java | public synchronized EmbeddedElastic start() throws IOException, InterruptedException {
if (!started) {
started = true;
installElastic();
startElastic();
createRestClient();
createTemplates();
createIndices();
}
return this;
... | [
"public",
"synchronized",
"EmbeddedElastic",
"start",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"!",
"started",
")",
"{",
"started",
"=",
"true",
";",
"installElastic",
"(",
")",
";",
"startElastic",
"(",
")",
";",
"crea... | Downloads Elasticsearch with specified plugins, setups them and starts | [
"Downloads",
"Elasticsearch",
"with",
"specified",
"plugins",
"setups",
"them",
"and",
"starts"
] | 1e305ba23552b17bb75a534f577334aaf9a29ec4 | https://github.com/allegro/embedded-elasticsearch/blob/1e305ba23552b17bb75a534f577334aaf9a29ec4/core/src/main/java/pl/allegro/tech/embeddedelasticsearch/EmbeddedElastic.java#L59-L69 |
113,440 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.naturalOrder | @NotNull
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>> ComparatorCompat<T> naturalOrder() {
return (ComparatorCompat<T>) NATURAL_ORDER;
} | java | @NotNull
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>> ComparatorCompat<T> naturalOrder() {
return (ComparatorCompat<T>) NATURAL_ORDER;
} | [
"@",
"NotNull",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"ComparatorCompat",
"<",
"T",
">",
"naturalOrder",
"(",
")",
"{",
"return",
"(",
"ComparatorCompat",
... | Returns a comparator with natural order.
@param <T> the type of the objects compared by the comparator
@return a comparator | [
"Returns",
"a",
"comparator",
"with",
"natural",
"order",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L39-L43 |
113,441 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.reverseOrder | @NotNull
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>> ComparatorCompat<T> reverseOrder() {
return (ComparatorCompat<T>) REVERSE_ORDER;
} | java | @NotNull
@SuppressWarnings("unchecked")
public static <T extends Comparable<? super T>> ComparatorCompat<T> reverseOrder() {
return (ComparatorCompat<T>) REVERSE_ORDER;
} | [
"@",
"NotNull",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"?",
"super",
"T",
">",
">",
"ComparatorCompat",
"<",
"T",
">",
"reverseOrder",
"(",
")",
"{",
"return",
"(",
"ComparatorCompat",
... | Returns a comparator with reverse order.
@param <T> the type of the objects compared by the comparator
@return a comparator
@see Collections#reverseOrder() | [
"Returns",
"a",
"comparator",
"with",
"reverse",
"order",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L52-L56 |
113,442 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.comparing | @NotNull
public static <T, U> ComparatorCompat<T> comparing(
@NotNull final Function<? super T, ? extends U> keyExtractor,
@NotNull final Comparator<? super U> keyComparator) {
Objects.requireNonNull(keyExtractor);
Objects.requireNonNull(keyComparator);
return new Com... | java | @NotNull
public static <T, U> ComparatorCompat<T> comparing(
@NotNull final Function<? super T, ? extends U> keyExtractor,
@NotNull final Comparator<? super U> keyComparator) {
Objects.requireNonNull(keyExtractor);
Objects.requireNonNull(keyComparator);
return new Com... | [
"@",
"NotNull",
"public",
"static",
"<",
"T",
",",
"U",
">",
"ComparatorCompat",
"<",
"T",
">",
"comparing",
"(",
"@",
"NotNull",
"final",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"keyExtractor",
",",
"@",
"NotNull",
"final",
... | Returns a comparator that uses a function that extracts a sort key
to be compared with the specified comparator.
@param <T> the type of the objects compared by the comparator
@param <U> the type of the sort key
@param keyExtractor the function that extracts the sort key
@param keyComparator the comparator used to co... | [
"Returns",
"a",
"comparator",
"that",
"uses",
"a",
"function",
"that",
"extracts",
"a",
"sort",
"key",
"to",
"be",
"compared",
"with",
"the",
"specified",
"comparator",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L111-L126 |
113,443 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/ComparatorCompat.java | ComparatorCompat.thenComparing | @NotNull
public ComparatorCompat<T> thenComparing(@NotNull final Comparator<? super T> other) {
return new ComparatorCompat<T>(thenComparing(comparator, other));
} | java | @NotNull
public ComparatorCompat<T> thenComparing(@NotNull final Comparator<? super T> other) {
return new ComparatorCompat<T>(thenComparing(comparator, other));
} | [
"@",
"NotNull",
"public",
"ComparatorCompat",
"<",
"T",
">",
"thenComparing",
"(",
"@",
"NotNull",
"final",
"Comparator",
"<",
"?",
"super",
"T",
">",
"other",
")",
"{",
"return",
"new",
"ComparatorCompat",
"<",
"T",
">",
"(",
"thenComparing",
"(",
"compar... | Adds the given comparator to the chain.
@param other the other comparator to be used when chained
comparator compares two objects that are equal
@return the new {@code ComparatorCompat} instance | [
"Adds",
"the",
"given",
"comparator",
"to",
"the",
"chain",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/ComparatorCompat.java#L333-L336 |
113,444 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.average | @NotNull
public OptionalDouble average() {
long count = 0;
double sum = 0d;
while (iterator.hasNext()) {
sum += iterator.nextDouble();
count++;
}
if (count == 0) return OptionalDouble.empty();
return OptionalDouble.of(sum / (double) count);
... | java | @NotNull
public OptionalDouble average() {
long count = 0;
double sum = 0d;
while (iterator.hasNext()) {
sum += iterator.nextDouble();
count++;
}
if (count == 0) return OptionalDouble.empty();
return OptionalDouble.of(sum / (double) count);
... | [
"@",
"NotNull",
"public",
"OptionalDouble",
"average",
"(",
")",
"{",
"long",
"count",
"=",
"0",
";",
"double",
"sum",
"=",
"0d",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"sum",
"+=",
"iterator",
".",
"nextDouble",
"(",
")",... | Returns the average of elements in this stream.
<p>This is a terminal operation.
@return the average of elements in this stream | [
"Returns",
"the",
"average",
"of",
"elements",
"in",
"this",
"stream",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L1016-L1026 |
113,445 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/DoubleStream.java | DoubleStream.close | @Override
public void close() {
if (params != null && params.closeHandler != null) {
params.closeHandler.run();
params.closeHandler = null;
}
} | java | @Override
public void close() {
if (params != null && params.closeHandler != null) {
params.closeHandler.run();
params.closeHandler = null;
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"params",
"!=",
"null",
"&&",
"params",
".",
"closeHandler",
"!=",
"null",
")",
"{",
"params",
".",
"closeHandler",
".",
"run",
"(",
")",
";",
"params",
".",
"closeHandler",
"=",
"... | Causes close handler to be invoked if it exists.
Since most of the stream providers are lists or arrays,
it is not necessary to close the stream.
@since 1.1.8 | [
"Causes",
"close",
"handler",
"to",
"be",
"invoked",
"if",
"it",
"exists",
".",
"Since",
"most",
"of",
"the",
"stream",
"providers",
"are",
"lists",
"or",
"arrays",
"it",
"is",
"not",
"necessary",
"to",
"close",
"the",
"stream",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/DoubleStream.java#L1252-L1258 |
113,446 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.of | @NotNull
public static IntStream of(@NotNull final int... values) {
Objects.requireNonNull(values);
if (values.length == 0) {
return IntStream.empty();
}
return new IntStream(new IntArray(values));
} | java | @NotNull
public static IntStream of(@NotNull final int... values) {
Objects.requireNonNull(values);
if (values.length == 0) {
return IntStream.empty();
}
return new IntStream(new IntArray(values));
} | [
"@",
"NotNull",
"public",
"static",
"IntStream",
"of",
"(",
"@",
"NotNull",
"final",
"int",
"...",
"values",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"values",
")",
";",
"if",
"(",
"values",
".",
"length",
"==",
"0",
")",
"{",
"return",
"IntStr... | Returns stream whose elements are the specified values.
@param values the elements of the new stream
@return the new stream
@throws NullPointerException if {@code values} is null | [
"Returns",
"stream",
"whose",
"elements",
"are",
"the",
"specified",
"values",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L67-L74 |
113,447 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.concat | @NotNull
public static IntStream concat(
@NotNull final IntStream a,
@NotNull final IntStream b) {
Objects.requireNonNull(a);
Objects.requireNonNull(b);
IntStream result = new IntStream(new IntConcat(a.iterator, b.iterator));
return result.onClose(Compose.clos... | java | @NotNull
public static IntStream concat(
@NotNull final IntStream a,
@NotNull final IntStream b) {
Objects.requireNonNull(a);
Objects.requireNonNull(b);
IntStream result = new IntStream(new IntConcat(a.iterator, b.iterator));
return result.onClose(Compose.clos... | [
"@",
"NotNull",
"public",
"static",
"IntStream",
"concat",
"(",
"@",
"NotNull",
"final",
"IntStream",
"a",
",",
"@",
"NotNull",
"final",
"IntStream",
"b",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"a",
")",
";",
"Objects",
".",
"requireNonNull",
"("... | Creates a lazily concatenated stream whose elements are all the
elements of the first stream followed by all the elements of the
second stream.
<p>Example:
<pre>
stream a: [1, 2, 3, 4]
stream b: [5, 6]
result: [1, 2, 3, 4, 5, 6]
</pre>
@param a the first stream
@param b the second stream
@return the concatenation o... | [
"Creates",
"a",
"lazily",
"concatenated",
"stream",
"whose",
"elements",
"are",
"all",
"the",
"elements",
"of",
"the",
"first",
"stream",
"followed",
"by",
"all",
"the",
"elements",
"of",
"the",
"second",
"stream",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L234-L242 |
113,448 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.custom | @Nullable
public <R> R custom(@NotNull final Function<IntStream, R> function) {
Objects.requireNonNull(function);
return function.apply(this);
} | java | @Nullable
public <R> R custom(@NotNull final Function<IntStream, R> function) {
Objects.requireNonNull(function);
return function.apply(this);
} | [
"@",
"Nullable",
"public",
"<",
"R",
">",
"R",
"custom",
"(",
"@",
"NotNull",
"final",
"Function",
"<",
"IntStream",
",",
"R",
">",
"function",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"function",
")",
";",
"return",
"function",
".",
"apply",
"... | Applies custom operator on stream.
Transforming function can return {@code IntStream} for intermediate operations,
or any value for terminal operation.
<p>Operator examples:
<pre><code>
// Intermediate operator
public class Zip<T> implements Function<IntStream, IntStream> {
@Override
public IntStream ... | [
"Applies",
"custom",
"operator",
"on",
"stream",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L331-L335 |
113,449 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.filterNot | @NotNull
public IntStream filterNot(@NotNull final IntPredicate predicate) {
return filter(IntPredicate.Util.negate(predicate));
} | java | @NotNull
public IntStream filterNot(@NotNull final IntPredicate predicate) {
return filter(IntPredicate.Util.negate(predicate));
} | [
"@",
"NotNull",
"public",
"IntStream",
"filterNot",
"(",
"@",
"NotNull",
"final",
"IntPredicate",
"predicate",
")",
"{",
"return",
"filter",
"(",
"IntPredicate",
".",
"Util",
".",
"negate",
"(",
"predicate",
")",
")",
";",
"}"
] | Returns a stream consisting of the elements of this stream that don't
match the given predicate.
<p> This is an intermediate operation.
@param predicate non-interfering, stateless predicate to apply to each
element to determine if it should not be included
@return the new stream | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"elements",
"of",
"this",
"stream",
"that",
"don",
"t",
"match",
"the",
"given",
"predicate",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L438-L441 |
113,450 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.peek | @NotNull
public IntStream peek(@NotNull final IntConsumer action) {
return new IntStream(params, new IntPeek(iterator, action));
} | java | @NotNull
public IntStream peek(@NotNull final IntConsumer action) {
return new IntStream(params, new IntPeek(iterator, action));
} | [
"@",
"NotNull",
"public",
"IntStream",
"peek",
"(",
"@",
"NotNull",
"final",
"IntConsumer",
"action",
")",
"{",
"return",
"new",
"IntStream",
"(",
"params",
",",
"new",
"IntPeek",
"(",
"iterator",
",",
"action",
")",
")",
";",
"}"
] | Returns a stream consisting of the elements of this stream, additionally
performing the provided action on each element as elements are consumed
from the resulting stream. Handy method for debugging purposes.
<p>This is an intermediate operation.
@param action the action to be performed on each element
@return the ne... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"elements",
"of",
"this",
"stream",
"additionally",
"performing",
"the",
"provided",
"action",
"on",
"each",
"element",
"as",
"elements",
"are",
"consumed",
"from",
"the",
"resulting",
"stream",
".",
"Handy",
... | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L680-L683 |
113,451 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.zip | @NotNull
public static <F, S, R> Stream<R> zip(
@NotNull final Iterator<? extends F> iterator1,
@NotNull final Iterator<? extends S> iterator2,
@NotNull final BiFunction<? super F, ? super S, ? extends R> combiner) {
Objects.requireNonNull(iterator1);
Objects.requ... | java | @NotNull
public static <F, S, R> Stream<R> zip(
@NotNull final Iterator<? extends F> iterator1,
@NotNull final Iterator<? extends S> iterator2,
@NotNull final BiFunction<? super F, ? super S, ? extends R> combiner) {
Objects.requireNonNull(iterator1);
Objects.requ... | [
"@",
"NotNull",
"public",
"static",
"<",
"F",
",",
"S",
",",
"R",
">",
"Stream",
"<",
"R",
">",
"zip",
"(",
"@",
"NotNull",
"final",
"Iterator",
"<",
"?",
"extends",
"F",
">",
"iterator1",
",",
"@",
"NotNull",
"final",
"Iterator",
"<",
"?",
"extend... | Combines two iterators to a stream by applying specified combiner function to each element at same position.
<p>Example:
<pre>
combiner: (a, b) -> a + b
stream 1: [1, 2, 3, 4]
stream 2: [5, 6, 7, 8]
result: [6, 8, 10, 12]
</pre>
@param <F> the type of first iterator elements
@param <S> the type of second iterato... | [
"Combines",
"two",
"iterators",
"to",
"a",
"stream",
"by",
"applying",
"specified",
"combiner",
"function",
"to",
"each",
"element",
"at",
"same",
"position",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L398-L406 |
113,452 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.dropWhile | @NotNull
public Stream<T> dropWhile(@NotNull final Predicate<? super T> predicate) {
return new Stream<T>(params, new ObjDropWhile<T>(iterator, predicate));
} | java | @NotNull
public Stream<T> dropWhile(@NotNull final Predicate<? super T> predicate) {
return new Stream<T>(params, new ObjDropWhile<T>(iterator, predicate));
} | [
"@",
"NotNull",
"public",
"Stream",
"<",
"T",
">",
"dropWhile",
"(",
"@",
"NotNull",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"return",
"new",
"Stream",
"<",
"T",
">",
"(",
"params",
",",
"new",
"ObjDropWhile",
"<",
"... | Drops elements while the predicate is true, then returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (a) -> a < 3
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [3, 4, 1, 2, 3, 4]
</pre>
@param predicate the predicate used to drop elements
@return the new stream | [
"Drops",
"elements",
"while",
"the",
"predicate",
"is",
"true",
"then",
"returns",
"the",
"rest",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1453-L1456 |
113,453 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.forEach | public void forEach(@NotNull final Consumer<? super T> action) {
while (iterator.hasNext()) {
action.accept(iterator.next());
}
} | java | public void forEach(@NotNull final Consumer<? super T> action) {
while (iterator.hasNext()) {
action.accept(iterator.next());
}
} | [
"public",
"void",
"forEach",
"(",
"@",
"NotNull",
"final",
"Consumer",
"<",
"?",
"super",
"T",
">",
"action",
")",
"{",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"action",
".",
"accept",
"(",
"iterator",
".",
"next",
"(",
")",
"... | Performs the given action on each element.
<p>This is a terminal operation.
@param action the action to be performed on each element | [
"Performs",
"the",
"given",
"action",
"on",
"each",
"element",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1577-L1581 |
113,454 | aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.toArray | @NotNull
public Object[] toArray() {
return toArray(new IntFunction<Object[]>() {
@NotNull
@Override
public Object[] apply(int value) {
return new Object[value];
}
});
} | java | @NotNull
public Object[] toArray() {
return toArray(new IntFunction<Object[]>() {
@NotNull
@Override
public Object[] apply(int value) {
return new Object[value];
}
});
} | [
"@",
"NotNull",
"public",
"Object",
"[",
"]",
"toArray",
"(",
")",
"{",
"return",
"toArray",
"(",
"new",
"IntFunction",
"<",
"Object",
"[",
"]",
">",
"(",
")",
"{",
"@",
"NotNull",
"@",
"Override",
"public",
"Object",
"[",
"]",
"apply",
"(",
"int",
... | Collects elements to an array.
<p>This is a terminal operation.
@return the result of collect elements
@see #toArray(com.annimon.stream.function.IntFunction) | [
"Collects",
"elements",
"to",
"an",
"array",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1742-L1752 |
113,455 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getHijrahDateInfo | private static int[] getHijrahDateInfo(long gregorianDays) {
int era, year, month, date, dayOfWeek, dayOfYear;
int cycleNumber, yearInCycle, dayOfCycle;
long epochDay = gregorianDays - HIJRAH_JAN_1_1_GREGORIAN_DAY;
if (epochDay >= 0) {
cycleNumber = getCycleNumber(epochDay... | java | private static int[] getHijrahDateInfo(long gregorianDays) {
int era, year, month, date, dayOfWeek, dayOfYear;
int cycleNumber, yearInCycle, dayOfCycle;
long epochDay = gregorianDays - HIJRAH_JAN_1_1_GREGORIAN_DAY;
if (epochDay >= 0) {
cycleNumber = getCycleNumber(epochDay... | [
"private",
"static",
"int",
"[",
"]",
"getHijrahDateInfo",
"(",
"long",
"gregorianDays",
")",
"{",
"int",
"era",
",",
"year",
",",
"month",
",",
"date",
",",
"dayOfWeek",
",",
"dayOfYear",
";",
"int",
"cycleNumber",
",",
"yearInCycle",
",",
"dayOfCycle",
"... | Returns the int array containing the following field from the julian day.
int[0] = ERA
int[1] = YEAR
int[2] = MONTH
int[3] = DATE
int[4] = DAY_OF_YEAR
int[5] = DAY_OF_WEEK
@param julianDay a julian day. | [
"Returns",
"the",
"int",
"array",
"containing",
"the",
"following",
"field",
"from",
"the",
"julian",
"day",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L793-L841 |
113,456 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getGregorianEpochDay | private static long getGregorianEpochDay(int prolepticYear, int monthOfYear, int dayOfMonth) {
long day = yearToGregorianEpochDay(prolepticYear);
day += getMonthDays(monthOfYear - 1, prolepticYear);
day += dayOfMonth;
return day;
} | java | private static long getGregorianEpochDay(int prolepticYear, int monthOfYear, int dayOfMonth) {
long day = yearToGregorianEpochDay(prolepticYear);
day += getMonthDays(monthOfYear - 1, prolepticYear);
day += dayOfMonth;
return day;
} | [
"private",
"static",
"long",
"getGregorianEpochDay",
"(",
"int",
"prolepticYear",
",",
"int",
"monthOfYear",
",",
"int",
"dayOfMonth",
")",
"{",
"long",
"day",
"=",
"yearToGregorianEpochDay",
"(",
"prolepticYear",
")",
";",
"day",
"+=",
"getMonthDays",
"(",
"mon... | Return Gregorian epoch day from Hijrah year, month, and day.
@param prolepticYear the year to represent, caller calculated
@param monthOfYear the month-of-year to represent, caller calculated
@param dayOfMonth the day-of-month to represent, caller calculated
@return a julian day | [
"Return",
"Gregorian",
"epoch",
"day",
"from",
"Hijrah",
"year",
"month",
"and",
"day",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L851-L856 |
113,457 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.yearToGregorianEpochDay | private static long yearToGregorianEpochDay(int prolepticYear) {
int cycleNumber = (prolepticYear - 1) / 30; // 0-based.
int yearInCycle = (prolepticYear - 1) % 30; // 0-based.
int dayInCycle = getAdjustedCycle(cycleNumber)[Math.abs(yearInCycle)]
.intValue();
if (yearI... | java | private static long yearToGregorianEpochDay(int prolepticYear) {
int cycleNumber = (prolepticYear - 1) / 30; // 0-based.
int yearInCycle = (prolepticYear - 1) % 30; // 0-based.
int dayInCycle = getAdjustedCycle(cycleNumber)[Math.abs(yearInCycle)]
.intValue();
if (yearI... | [
"private",
"static",
"long",
"yearToGregorianEpochDay",
"(",
"int",
"prolepticYear",
")",
"{",
"int",
"cycleNumber",
"=",
"(",
"prolepticYear",
"-",
"1",
")",
"/",
"30",
";",
"// 0-based.",
"int",
"yearInCycle",
"=",
"(",
"prolepticYear",
"-",
"1",
")",
"%",... | Returns the Gregorian epoch day from the proleptic year
@param prolepticYear the proleptic year
@return the Epoch day | [
"Returns",
"the",
"Gregorian",
"epoch",
"day",
"from",
"the",
"proleptic",
"year"
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L863-L888 |
113,458 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getCycleNumber | private static int getCycleNumber(long epochDay) {
Long[] days = ADJUSTED_CYCLES;
int cycleNumber;
try {
for (int i = 0; i < days.length; i++) {
if (epochDay < days[i].longValue()) {
return i - 1;
}
}
cycleNu... | java | private static int getCycleNumber(long epochDay) {
Long[] days = ADJUSTED_CYCLES;
int cycleNumber;
try {
for (int i = 0; i < days.length; i++) {
if (epochDay < days[i].longValue()) {
return i - 1;
}
}
cycleNu... | [
"private",
"static",
"int",
"getCycleNumber",
"(",
"long",
"epochDay",
")",
"{",
"Long",
"[",
"]",
"days",
"=",
"ADJUSTED_CYCLES",
";",
"int",
"cycleNumber",
";",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"days",
".",
"length",
";"... | Returns the 30 year cycle number from the epoch day.
@param epochDay an epoch day
@return a cycle number | [
"Returns",
"the",
"30",
"year",
"cycle",
"number",
"from",
"the",
"epoch",
"day",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L896-L910 |
113,459 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfCycle | private static int getDayOfCycle(long epochDay, int cycleNumber) {
Long day;
try {
day = ADJUSTED_CYCLES[cycleNumber];
} catch (ArrayIndexOutOfBoundsException e) {
day = null;
}
if (day == null) {
day = Long.valueOf(cycleNumber * 10631);
... | java | private static int getDayOfCycle(long epochDay, int cycleNumber) {
Long day;
try {
day = ADJUSTED_CYCLES[cycleNumber];
} catch (ArrayIndexOutOfBoundsException e) {
day = null;
}
if (day == null) {
day = Long.valueOf(cycleNumber * 10631);
... | [
"private",
"static",
"int",
"getDayOfCycle",
"(",
"long",
"epochDay",
",",
"int",
"cycleNumber",
")",
"{",
"Long",
"day",
";",
"try",
"{",
"day",
"=",
"ADJUSTED_CYCLES",
"[",
"cycleNumber",
"]",
";",
"}",
"catch",
"(",
"ArrayIndexOutOfBoundsException",
"e",
... | Returns day of cycle from the epoch day and cycle number.
@param epochDay an epoch day
@param cycleNumber a cycle number
@return a day of cycle | [
"Returns",
"day",
"of",
"cycle",
"from",
"the",
"epoch",
"day",
"and",
"cycle",
"number",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L919-L931 |
113,460 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getYearInCycle | private static int getYearInCycle(int cycleNumber, long dayOfCycle) {
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (dayOfCycle == 0) {
return 0;
}
if (dayOfCycle > 0) {
for (int i = 0; i < cycles.length; i++) {
if (dayOfCycle < cycles[i].i... | java | private static int getYearInCycle(int cycleNumber, long dayOfCycle) {
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (dayOfCycle == 0) {
return 0;
}
if (dayOfCycle > 0) {
for (int i = 0; i < cycles.length; i++) {
if (dayOfCycle < cycles[i].i... | [
"private",
"static",
"int",
"getYearInCycle",
"(",
"int",
"cycleNumber",
",",
"long",
"dayOfCycle",
")",
"{",
"Integer",
"[",
"]",
"cycles",
"=",
"getAdjustedCycle",
"(",
"cycleNumber",
")",
";",
"if",
"(",
"dayOfCycle",
"==",
"0",
")",
"{",
"return",
"0",... | Returns the year in cycle from the cycle number and day of cycle.
@param cycleNumber a cycle number
@param dayOfCycle day of cycle
@return a year in cycle | [
"Returns",
"the",
"year",
"in",
"cycle",
"from",
"the",
"cycle",
"number",
"and",
"day",
"of",
"cycle",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L940-L962 |
113,461 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getAdjustedCycle | private static Integer[] getAdjustedCycle(int cycleNumber) {
Integer[] cycles;
try {
cycles = ADJUSTED_CYCLE_YEARS.get(Integer.valueOf(cycleNumber));
} catch (ArrayIndexOutOfBoundsException e) {
cycles = null;
}
if (cycles == null) {
cycles = D... | java | private static Integer[] getAdjustedCycle(int cycleNumber) {
Integer[] cycles;
try {
cycles = ADJUSTED_CYCLE_YEARS.get(Integer.valueOf(cycleNumber));
} catch (ArrayIndexOutOfBoundsException e) {
cycles = null;
}
if (cycles == null) {
cycles = D... | [
"private",
"static",
"Integer",
"[",
"]",
"getAdjustedCycle",
"(",
"int",
"cycleNumber",
")",
"{",
"Integer",
"[",
"]",
"cycles",
";",
"try",
"{",
"cycles",
"=",
"ADJUSTED_CYCLE_YEARS",
".",
"get",
"(",
"Integer",
".",
"valueOf",
"(",
"cycleNumber",
")",
"... | Returns adjusted 30 year cycle startind day as Integer array from the
cycle number specified.
@param cycleNumber a cycle number
@return an Integer array | [
"Returns",
"adjusted",
"30",
"year",
"cycle",
"startind",
"day",
"as",
"Integer",
"array",
"from",
"the",
"cycle",
"number",
"specified",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L971-L982 |
113,462 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getAdjustedMonthDays | private static Integer[] getAdjustedMonthDays(int year) {
Integer[] newMonths;
try {
newMonths = ADJUSTED_MONTH_DAYS.get(Integer.valueOf(year));
} catch (ArrayIndexOutOfBoundsException e) {
newMonths = null;
}
if (newMonths == null) {
if (isLea... | java | private static Integer[] getAdjustedMonthDays(int year) {
Integer[] newMonths;
try {
newMonths = ADJUSTED_MONTH_DAYS.get(Integer.valueOf(year));
} catch (ArrayIndexOutOfBoundsException e) {
newMonths = null;
}
if (newMonths == null) {
if (isLea... | [
"private",
"static",
"Integer",
"[",
"]",
"getAdjustedMonthDays",
"(",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
";",
"try",
"{",
"newMonths",
"=",
"ADJUSTED_MONTH_DAYS",
".",
"get",
"(",
"Integer",
".",
"valueOf",
"(",
"year",
")",
")",
... | Returns adjusted month days as Integer array form the year specified.
@param year a year
@return an Integer array | [
"Returns",
"adjusted",
"month",
"days",
"as",
"Integer",
"array",
"form",
"the",
"year",
"specified",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L990-L1005 |
113,463 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getAdjustedMonthLength | private static Integer[] getAdjustedMonthLength(int year) {
Integer[] newMonths;
try {
newMonths = ADJUSTED_MONTH_LENGTHS.get(Integer.valueOf(year));
} catch (ArrayIndexOutOfBoundsException e) {
newMonths = null;
}
if (newMonths == null) {
if (... | java | private static Integer[] getAdjustedMonthLength(int year) {
Integer[] newMonths;
try {
newMonths = ADJUSTED_MONTH_LENGTHS.get(Integer.valueOf(year));
} catch (ArrayIndexOutOfBoundsException e) {
newMonths = null;
}
if (newMonths == null) {
if (... | [
"private",
"static",
"Integer",
"[",
"]",
"getAdjustedMonthLength",
"(",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
";",
"try",
"{",
"newMonths",
"=",
"ADJUSTED_MONTH_LENGTHS",
".",
"get",
"(",
"Integer",
".",
"valueOf",
"(",
"year",
")",
"... | Returns adjusted month length as Integer array form the year specified.
@param year a year
@return an Integer array | [
"Returns",
"adjusted",
"month",
"length",
"as",
"Integer",
"array",
"form",
"the",
"year",
"specified",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1013-L1028 |
113,464 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfYear | private static int getDayOfYear(int cycleNumber, int dayOfCycle, int yearInCycle) {
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (dayOfCycle > 0) {
return dayOfCycle - cycles[yearInCycle].intValue();
} else {
return cycles[yearInCycle].intValue() + dayOfCycle;
... | java | private static int getDayOfYear(int cycleNumber, int dayOfCycle, int yearInCycle) {
Integer[] cycles = getAdjustedCycle(cycleNumber);
if (dayOfCycle > 0) {
return dayOfCycle - cycles[yearInCycle].intValue();
} else {
return cycles[yearInCycle].intValue() + dayOfCycle;
... | [
"private",
"static",
"int",
"getDayOfYear",
"(",
"int",
"cycleNumber",
",",
"int",
"dayOfCycle",
",",
"int",
"yearInCycle",
")",
"{",
"Integer",
"[",
"]",
"cycles",
"=",
"getAdjustedCycle",
"(",
"cycleNumber",
")",
";",
"if",
"(",
"dayOfCycle",
">",
"0",
"... | Returns day-of-year.
@param cycleNumber a cycle number
@param dayOfCycle day of cycle
@param yearInCycle year in cycle
@return day-of-year | [
"Returns",
"day",
"-",
"of",
"-",
"year",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1038-L1046 |
113,465 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthOfYear | private static int getMonthOfYear(int dayOfYear, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
for (int i = 0; i < newMonths.length; i++) {
if (dayOfYear < newMonths[i].intValue()) {
return i - 1;
}
... | java | private static int getMonthOfYear(int dayOfYear, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
for (int i = 0; i < newMonths.length; i++) {
if (dayOfYear < newMonths[i].intValue()) {
return i - 1;
}
... | [
"private",
"static",
"int",
"getMonthOfYear",
"(",
"int",
"dayOfYear",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthDays",
"(",
"year",
")",
";",
"if",
"(",
"dayOfYear",
">=",
"0",
")",
"{",
"for",
"(",
"int",
"... | Returns month-of-year. 0-based.
@param dayOfYear day-of-year
@param year a year
@return month-of-year | [
"Returns",
"month",
"-",
"of",
"-",
"year",
".",
"0",
"-",
"based",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1055-L1076 |
113,466 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getDayOfMonth | private static int getDayOfMonth(int dayOfYear, int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
if (month > 0) {
return dayOfYear - newMonths[month].intValue();
} else {
return dayOfYear;
... | java | private static int getDayOfMonth(int dayOfYear, int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
if (dayOfYear >= 0) {
if (month > 0) {
return dayOfYear - newMonths[month].intValue();
} else {
return dayOfYear;
... | [
"private",
"static",
"int",
"getDayOfMonth",
"(",
"int",
"dayOfYear",
",",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthDays",
"(",
"year",
")",
";",
"if",
"(",
"dayOfYear",
">=",
"0",
")",
"{",
... | Returns day-of-month.
@param dayOfYear day of year
@param month month
@param year year
@return day-of-month | [
"Returns",
"day",
"-",
"of",
"-",
"month",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1086-L1105 |
113,467 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthDays | private static int getMonthDays(int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
return newMonths[month].intValue();
} | java | private static int getMonthDays(int month, int year) {
Integer[] newMonths = getAdjustedMonthDays(year);
return newMonths[month].intValue();
} | [
"private",
"static",
"int",
"getMonthDays",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthDays",
"(",
"year",
")",
";",
"return",
"newMonths",
"[",
"month",
"]",
".",
"intValue",
"(",
")",
";",... | Returns month days from the beginning of year.
@param month month (0-based)
@parma year year
@return month days from the beginning of year | [
"Returns",
"month",
"days",
"from",
"the",
"beginning",
"of",
"year",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1124-L1127 |
113,468 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getMonthLength | static int getMonthLength(int month, int year) {
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | java | static int getMonthLength(int month, int year) {
Integer[] newMonths = getAdjustedMonthLength(year);
return newMonths[month].intValue();
} | [
"static",
"int",
"getMonthLength",
"(",
"int",
"month",
",",
"int",
"year",
")",
"{",
"Integer",
"[",
"]",
"newMonths",
"=",
"getAdjustedMonthLength",
"(",
"year",
")",
";",
"return",
"newMonths",
"[",
"month",
"]",
".",
"intValue",
"(",
")",
";",
"}"
] | Returns month length.
@param month month (0-based)
@param year year
@return month length | [
"Returns",
"month",
"length",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1136-L1139 |
113,469 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.getYearLength | static int getYearLength(int year) {
int cycleNumber = (year - 1) / 30;
Integer[] cycleYears;
try {
cycleYears = ADJUSTED_CYCLE_YEARS.get(cycleNumber);
} catch (ArrayIndexOutOfBoundsException e) {
cycleYears = null;
}
if (cycleYears != null) {
... | java | static int getYearLength(int year) {
int cycleNumber = (year - 1) / 30;
Integer[] cycleYears;
try {
cycleYears = ADJUSTED_CYCLE_YEARS.get(cycleNumber);
} catch (ArrayIndexOutOfBoundsException e) {
cycleYears = null;
}
if (cycleYears != null) {
... | [
"static",
"int",
"getYearLength",
"(",
"int",
"year",
")",
"{",
"int",
"cycleNumber",
"=",
"(",
"year",
"-",
"1",
")",
"/",
"30",
";",
"Integer",
"[",
"]",
"cycleYears",
";",
"try",
"{",
"cycleYears",
"=",
"ADJUSTED_CYCLE_YEARS",
".",
"get",
"(",
"cycl... | Returns year length.
@param year year
@return year length | [
"Returns",
"year",
"length",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1152-L1173 |
113,470 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/HijrahDate.java | HijrahDate.readDeviationConfig | private static void readDeviationConfig() throws IOException, ParseException {
InputStream is = getConfigFileInputStream();
if (is != null) {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(is));
String line = "";
... | java | private static void readDeviationConfig() throws IOException, ParseException {
InputStream is = getConfigFileInputStream();
if (is != null) {
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(is));
String line = "";
... | [
"private",
"static",
"void",
"readDeviationConfig",
"(",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"InputStream",
"is",
"=",
"getConfigFileInputStream",
"(",
")",
";",
"if",
"(",
"is",
"!=",
"null",
")",
"{",
"BufferedReader",
"br",
"=",
"null"... | Read hijrah_deviation.cfg file. The config file contains the deviation data with
following format.
StartYear/StartMonth(0-based)-EndYear/EndMonth(0-based):Deviation day (1,
2, -1, or -2)
Line separator or ";" is used for the separator of each deviation data.
Here is the example.
1429/0-1429/1:1
1429/2-1429/7:1;1429... | [
"Read",
"hijrah_deviation",
".",
"cfg",
"file",
".",
"The",
"config",
"file",
"contains",
"the",
"deviation",
"data",
"with",
"following",
"format",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/HijrahDate.java#L1529-L1548 |
113,471 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesProvider.java | TzdbZoneRulesProvider.load | private boolean load(ClassLoader classLoader) {
boolean updated = false;
URL url = null;
try {
Enumeration<URL> en = classLoader.getResources("org/threeten/bp/TZDB.dat");
while (en.hasMoreElements()) {
url = en.nextElement();
updated |= loa... | java | private boolean load(ClassLoader classLoader) {
boolean updated = false;
URL url = null;
try {
Enumeration<URL> en = classLoader.getResources("org/threeten/bp/TZDB.dat");
while (en.hasMoreElements()) {
url = en.nextElement();
updated |= loa... | [
"private",
"boolean",
"load",
"(",
"ClassLoader",
"classLoader",
")",
"{",
"boolean",
"updated",
"=",
"false",
";",
"URL",
"url",
"=",
"null",
";",
"try",
"{",
"Enumeration",
"<",
"URL",
">",
"en",
"=",
"classLoader",
".",
"getResources",
"(",
"\"org/three... | Loads the rules.
@param classLoader the class loader to use, not null
@return true if updated
@throws ZoneRulesException if unable to load | [
"Loads",
"the",
"rules",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesProvider.java#L165-L178 |
113,472 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesProvider.java | TzdbZoneRulesProvider.load | private boolean load(URL url) throws ClassNotFoundException, IOException, ZoneRulesException {
boolean updated = false;
if (loadedUrls.add(url.toExternalForm())) {
InputStream in = null;
try {
in = url.openStream();
updated |= load(in);
... | java | private boolean load(URL url) throws ClassNotFoundException, IOException, ZoneRulesException {
boolean updated = false;
if (loadedUrls.add(url.toExternalForm())) {
InputStream in = null;
try {
in = url.openStream();
updated |= load(in);
... | [
"private",
"boolean",
"load",
"(",
"URL",
"url",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
",",
"ZoneRulesException",
"{",
"boolean",
"updated",
"=",
"false",
";",
"if",
"(",
"loadedUrls",
".",
"add",
"(",
"url",
".",
"toExternalForm",
"(",
... | Loads the rules from a URL, often in a jar file.
@param url the jar file to load, not null
@return true if updated
@throws ClassNotFoundException if a classpath error occurs
@throws IOException if an IO error occurs
@throws ZoneRulesException if the data is already loaded for the version | [
"Loads",
"the",
"rules",
"from",
"a",
"URL",
"often",
"in",
"a",
"jar",
"file",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesProvider.java#L189-L203 |
113,473 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/ZoneRulesInitializer.java | ZoneRulesInitializer.initialize | static void initialize() {
if (INITIALIZED.getAndSet(true)) {
throw new IllegalStateException("Already initialized");
}
// Set the default initializer if none has been provided yet.
INITIALIZER.compareAndSet(null, new ServiceLoaderZoneRulesInitializer());
INITIALIZER.... | java | static void initialize() {
if (INITIALIZED.getAndSet(true)) {
throw new IllegalStateException("Already initialized");
}
// Set the default initializer if none has been provided yet.
INITIALIZER.compareAndSet(null, new ServiceLoaderZoneRulesInitializer());
INITIALIZER.... | [
"static",
"void",
"initialize",
"(",
")",
"{",
"if",
"(",
"INITIALIZED",
".",
"getAndSet",
"(",
"true",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Already initialized\"",
")",
";",
"}",
"// Set the default initializer if none has been provided yet... | initialize the providers | [
"initialize",
"the",
"providers"
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneRulesInitializer.java#L83-L90 |
113,474 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.outputHelp | private static void outputHelp() {
System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>");
System.out.println("where options include:");
System.out.println(" -srcdir <directory> Where to find source directories (required)");
System.out.println(" -dstdi... | java | private static void outputHelp() {
System.out.println("Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>");
System.out.println("where options include:");
System.out.println(" -srcdir <directory> Where to find source directories (required)");
System.out.println(" -dstdi... | [
"private",
"static",
"void",
"outputHelp",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Usage: TzdbZoneRulesCompiler <options> <tzdb source filenames>\"",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"where options include:\"",
")",
";",
"S... | Output usage text for the command line. | [
"Output",
"usage",
"text",
"for",
"the",
"command",
"line",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L209-L224 |
113,475 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.outputFilesDat | private static void outputFilesDat(File dstDir, Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules, SortedMap<LocalDate, Byte> leapSeconds) {
File tzdbFile = new File(dstDir, "TZDB.dat");
tzdbFile.delete();
try {
Fil... | java | private static void outputFilesDat(File dstDir, Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules, SortedMap<LocalDate, Byte> leapSeconds) {
File tzdbFile = new File(dstDir, "TZDB.dat");
tzdbFile.delete();
try {
Fil... | [
"private",
"static",
"void",
"outputFilesDat",
"(",
"File",
"dstDir",
",",
"Map",
"<",
"String",
",",
"SortedMap",
"<",
"String",
",",
"ZoneRules",
">",
">",
"allBuiltZones",
",",
"Set",
"<",
"String",
">",
"allRegionIds",
",",
"Set",
"<",
"ZoneRules",
">"... | Outputs the DAT files. | [
"Outputs",
"the",
"DAT",
"files",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L312-L331 |
113,476 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.outputTzdbEntry | private static void outputTzdbEntry(
JarOutputStream jos, Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules) {
// this format is not publicly specified
try {
jos.putNextEntry(new ZipEntry("org/threeten/bp/TZDB.d... | java | private static void outputTzdbEntry(
JarOutputStream jos, Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules) {
// this format is not publicly specified
try {
jos.putNextEntry(new ZipEntry("org/threeten/bp/TZDB.d... | [
"private",
"static",
"void",
"outputTzdbEntry",
"(",
"JarOutputStream",
"jos",
",",
"Map",
"<",
"String",
",",
"SortedMap",
"<",
"String",
",",
"ZoneRules",
">",
">",
"allBuiltZones",
",",
"Set",
"<",
"String",
">",
"allRegionIds",
",",
"Set",
"<",
"ZoneRule... | Outputs the timezone entry in the JAR file. | [
"Outputs",
"the",
"timezone",
"entry",
"in",
"the",
"JAR",
"file",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L371-L384 |
113,477 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.outputTzdbDat | private static void outputTzdbDat(OutputStream jos,
Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules) throws IOException {
DataOutputStream out = new DataOutputStream(jos);
// file version
out.writeByte(1);
... | java | private static void outputTzdbDat(OutputStream jos,
Map<String, SortedMap<String, ZoneRules>> allBuiltZones,
Set<String> allRegionIds, Set<ZoneRules> allRules) throws IOException {
DataOutputStream out = new DataOutputStream(jos);
// file version
out.writeByte(1);
... | [
"private",
"static",
"void",
"outputTzdbDat",
"(",
"OutputStream",
"jos",
",",
"Map",
"<",
"String",
",",
"SortedMap",
"<",
"String",
",",
"ZoneRules",
">",
">",
"allBuiltZones",
",",
"Set",
"<",
"String",
">",
"allRegionIds",
",",
"Set",
"<",
"ZoneRules",
... | Outputs the timezone DAT file. | [
"Outputs",
"the",
"timezone",
"DAT",
"file",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L389-L434 |
113,478 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.parseLeapSecondsFile | private void parseLeapSecondsFile() throws Exception {
printVerbose("Parsing leap second file: " + leapSecondsFile);
int lineNumber = 1;
String line = null;
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(leapSecondsFile));
for ( ; ... | java | private void parseLeapSecondsFile() throws Exception {
printVerbose("Parsing leap second file: " + leapSecondsFile);
int lineNumber = 1;
String line = null;
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(leapSecondsFile));
for ( ; ... | [
"private",
"void",
"parseLeapSecondsFile",
"(",
")",
"throws",
"Exception",
"{",
"printVerbose",
"(",
"\"Parsing leap second file: \"",
"+",
"leapSecondsFile",
")",
";",
"int",
"lineNumber",
"=",
"1",
";",
"String",
"line",
"=",
"null",
";",
"BufferedReader",
"in"... | Parses the leap seconds file.
@throws Exception if an error occurs | [
"Parses",
"the",
"leap",
"seconds",
"file",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L542-L572 |
113,479 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.parseFile | private void parseFile(File file) throws Exception {
int lineNumber = 1;
String line = null;
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(file));
List<TZDBZone> openZone = null;
for ( ; (line = in.readLine()) != null; lineNumb... | java | private void parseFile(File file) throws Exception {
int lineNumber = 1;
String line = null;
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(file));
List<TZDBZone> openZone = null;
for ( ; (line = in.readLine()) != null; lineNumb... | [
"private",
"void",
"parseFile",
"(",
"File",
"file",
")",
"throws",
"Exception",
"{",
"int",
"lineNumber",
"=",
"1",
";",
"String",
"line",
"=",
"null",
";",
"BufferedReader",
"in",
"=",
"null",
";",
"try",
"{",
"in",
"=",
"new",
"BufferedReader",
"(",
... | Parses a source file.
@param file the file being read, not null
@throws Exception if an error occurs | [
"Parses",
"a",
"source",
"file",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L635-L700 |
113,480 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.parseZoneLine | private boolean parseZoneLine(StringTokenizer st, List<TZDBZone> zoneList) {
TZDBZone zone = new TZDBZone();
zoneList.add(zone);
zone.standardOffset = parseOffset(st.nextToken());
String savingsRule = parseOptional(st.nextToken());
if (savingsRule == null) {
zone.fixe... | java | private boolean parseZoneLine(StringTokenizer st, List<TZDBZone> zoneList) {
TZDBZone zone = new TZDBZone();
zoneList.add(zone);
zone.standardOffset = parseOffset(st.nextToken());
String savingsRule = parseOptional(st.nextToken());
if (savingsRule == null) {
zone.fixe... | [
"private",
"boolean",
"parseZoneLine",
"(",
"StringTokenizer",
"st",
",",
"List",
"<",
"TZDBZone",
">",
"zoneList",
")",
"{",
"TZDBZone",
"zone",
"=",
"new",
"TZDBZone",
"(",
")",
";",
"zoneList",
".",
"add",
"(",
"zone",
")",
";",
"zone",
".",
"standard... | Parses a Zone line.
@param st the tokenizer, not null
@return true if the zone is complete | [
"Parses",
"a",
"Zone",
"line",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L731-L758 |
113,481 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.buildZoneRules | private void buildZoneRules() throws Exception {
// build zones
for (String zoneId : zones.keySet()) {
printVerbose("Building zone " + zoneId);
zoneId = deduplicate(zoneId);
List<TZDBZone> tzdbZones = zones.get(zoneId);
ZoneRulesBuilder bld = new ZoneRules... | java | private void buildZoneRules() throws Exception {
// build zones
for (String zoneId : zones.keySet()) {
printVerbose("Building zone " + zoneId);
zoneId = deduplicate(zoneId);
List<TZDBZone> tzdbZones = zones.get(zoneId);
ZoneRulesBuilder bld = new ZoneRules... | [
"private",
"void",
"buildZoneRules",
"(",
")",
"throws",
"Exception",
"{",
"// build zones",
"for",
"(",
"String",
"zoneId",
":",
"zones",
".",
"keySet",
"(",
")",
")",
"{",
"printVerbose",
"(",
"\"Building zone \"",
"+",
"zoneId",
")",
";",
"zoneId",
"=",
... | Build the rules, zones and links into real zones.
@throws Exception if an error occurs | [
"Build",
"the",
"rules",
"zones",
"and",
"links",
"into",
"real",
"zones",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L900-L937 |
113,482 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java | TzdbZoneRulesCompiler.deduplicate | @SuppressWarnings("unchecked")
<T> T deduplicate(T object) {
if (deduplicateMap.containsKey(object) == false) {
deduplicateMap.put(object, object);
}
return (T) deduplicateMap.get(object);
} | java | @SuppressWarnings("unchecked")
<T> T deduplicate(T object) {
if (deduplicateMap.containsKey(object) == false) {
deduplicateMap.put(object, object);
}
return (T) deduplicateMap.get(object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"T",
">",
"T",
"deduplicate",
"(",
"T",
"object",
")",
"{",
"if",
"(",
"deduplicateMap",
".",
"containsKey",
"(",
"object",
")",
"==",
"false",
")",
"{",
"deduplicateMap",
".",
"put",
"(",
"object"... | Deduplicates an object instance.
@param <T> the generic type
@param object the object to deduplicate
@return the deduplicated object | [
"Deduplicates",
"an",
"object",
"instance",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/TzdbZoneRulesCompiler.java#L947-L953 |
113,483 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/ChronoZonedDateTimeImpl.java | ChronoZonedDateTimeImpl.ofBest | static <R extends ChronoLocalDate> ChronoZonedDateTime<R> ofBest(
ChronoLocalDateTimeImpl<R> localDateTime, ZoneId zone, ZoneOffset preferredOffset) {
Jdk8Methods.requireNonNull(localDateTime, "localDateTime");
Jdk8Methods.requireNonNull(zone, "zone");
if (zone instanceof ZoneOffset)... | java | static <R extends ChronoLocalDate> ChronoZonedDateTime<R> ofBest(
ChronoLocalDateTimeImpl<R> localDateTime, ZoneId zone, ZoneOffset preferredOffset) {
Jdk8Methods.requireNonNull(localDateTime, "localDateTime");
Jdk8Methods.requireNonNull(zone, "zone");
if (zone instanceof ZoneOffset)... | [
"static",
"<",
"R",
"extends",
"ChronoLocalDate",
">",
"ChronoZonedDateTime",
"<",
"R",
">",
"ofBest",
"(",
"ChronoLocalDateTimeImpl",
"<",
"R",
">",
"localDateTime",
",",
"ZoneId",
"zone",
",",
"ZoneOffset",
"preferredOffset",
")",
"{",
"Jdk8Methods",
".",
"req... | Obtains an instance from a local date-time using the preferred offset if possible.
@param localDateTime the local date-time, not null
@param zone the zone identifier, not null
@param preferredOffset the zone offset, null if no preference
@return the zoned date-time, not null | [
"Obtains",
"an",
"instance",
"from",
"a",
"local",
"date",
"-",
"time",
"using",
"the",
"preferred",
"offset",
"if",
"possible",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/ChronoZonedDateTimeImpl.java#L104-L130 |
113,484 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/ChronoZonedDateTimeImpl.java | ChronoZonedDateTimeImpl.ofInstant | static <R extends ChronoLocalDate> ChronoZonedDateTimeImpl<R> ofInstant(Chronology chrono, Instant instant, ZoneId zone) {
ZoneRules rules = zone.getRules();
ZoneOffset offset = rules.getOffset(instant);
Jdk8Methods.requireNonNull(offset, "offset"); // protect against bad ZoneRules
Loca... | java | static <R extends ChronoLocalDate> ChronoZonedDateTimeImpl<R> ofInstant(Chronology chrono, Instant instant, ZoneId zone) {
ZoneRules rules = zone.getRules();
ZoneOffset offset = rules.getOffset(instant);
Jdk8Methods.requireNonNull(offset, "offset"); // protect against bad ZoneRules
Loca... | [
"static",
"<",
"R",
"extends",
"ChronoLocalDate",
">",
"ChronoZonedDateTimeImpl",
"<",
"R",
">",
"ofInstant",
"(",
"Chronology",
"chrono",
",",
"Instant",
"instant",
",",
"ZoneId",
"zone",
")",
"{",
"ZoneRules",
"rules",
"=",
"zone",
".",
"getRules",
"(",
")... | Obtains an instance from an instant using the specified time-zone.
@param chrono the chronology, not null
@param instant the instant, not null
@param zone the zone identifier, not null
@return the zoned date-time, not null | [
"Obtains",
"an",
"instance",
"from",
"an",
"instant",
"using",
"the",
"specified",
"time",
"-",
"zone",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/ChronoZonedDateTimeImpl.java#L140-L148 |
113,485 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/Chronology.java | Chronology.date | public ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) {
return date(prolepticYear(era, yearOfEra), month, dayOfMonth);
} | java | public ChronoLocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) {
return date(prolepticYear(era, yearOfEra), month, dayOfMonth);
} | [
"public",
"ChronoLocalDate",
"date",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"month",
",",
"int",
"dayOfMonth",
")",
"{",
"return",
"date",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"month",
",",
"dayOfMonth",
")",
";"... | Obtains a local date in this chronology from the era, year-of-era,
month-of-year and day-of-month fields.
@param era the era of the correct type for the chronology, not null
@param yearOfEra the chronology year-of-era
@param month the chronology month-of-year
@param dayOfMonth the chronology day-of-month
@return t... | [
"Obtains",
"a",
"local",
"date",
"in",
"this",
"chronology",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"month",
"-",
"of",
"-",
"year",
"and",
"day",
"-",
"of",
"-",
"month",
"fields",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/Chronology.java#L441-L443 |
113,486 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/Chronology.java | Chronology.dateYearDay | public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | java | public ChronoLocalDate dateYearDay(Era era, int yearOfEra, int dayOfYear) {
return dateYearDay(prolepticYear(era, yearOfEra), dayOfYear);
} | [
"public",
"ChronoLocalDate",
"dateYearDay",
"(",
"Era",
"era",
",",
"int",
"yearOfEra",
",",
"int",
"dayOfYear",
")",
"{",
"return",
"dateYearDay",
"(",
"prolepticYear",
"(",
"era",
",",
"yearOfEra",
")",
",",
"dayOfYear",
")",
";",
"}"
] | Obtains a local date in this chronology from the era, year-of-era and
day-of-year fields.
@param era the era of the correct type for the chronology, not null
@param yearOfEra the chronology year-of-era
@param dayOfYear the chronology day-of-year
@return the local date in this chronology, not null
@throws DateTimeEx... | [
"Obtains",
"a",
"local",
"date",
"in",
"this",
"chronology",
"from",
"the",
"era",
"year",
"-",
"of",
"-",
"era",
"and",
"day",
"-",
"of",
"-",
"year",
"fields",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/Chronology.java#L468-L470 |
113,487 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/Chronology.java | Chronology.updateResolveMap | void updateResolveMap(Map<TemporalField, Long> fieldValues, ChronoField field, long value) {
Long current = fieldValues.get(field);
if (current != null && current.longValue() != value) {
throw new DateTimeException("Invalid state, field: " + field + " " + current + " conflicts with " + field... | java | void updateResolveMap(Map<TemporalField, Long> fieldValues, ChronoField field, long value) {
Long current = fieldValues.get(field);
if (current != null && current.longValue() != value) {
throw new DateTimeException("Invalid state, field: " + field + " " + current + " conflicts with " + field... | [
"void",
"updateResolveMap",
"(",
"Map",
"<",
"TemporalField",
",",
"Long",
">",
"fieldValues",
",",
"ChronoField",
"field",
",",
"long",
"value",
")",
"{",
"Long",
"current",
"=",
"fieldValues",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"current",
"... | Updates the map of field-values during resolution.
@param field the field to update, not null
@param value the value to update, not null
@throws DateTimeException if a conflict occurs | [
"Updates",
"the",
"map",
"of",
"field",
"-",
"values",
"during",
"resolution",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/Chronology.java#L802-L808 |
113,488 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendValue | private DateTimeFormatterBuilder appendValue(NumberPrinterParser pp) {
if (active.valueParserIndex >= 0 &&
active.printerParsers.get(active.valueParserIndex) instanceof NumberPrinterParser) {
final int activeValueParser = active.valueParserIndex;
// adjacent parsing mode... | java | private DateTimeFormatterBuilder appendValue(NumberPrinterParser pp) {
if (active.valueParserIndex >= 0 &&
active.printerParsers.get(active.valueParserIndex) instanceof NumberPrinterParser) {
final int activeValueParser = active.valueParserIndex;
// adjacent parsing mode... | [
"private",
"DateTimeFormatterBuilder",
"appendValue",
"(",
"NumberPrinterParser",
"pp",
")",
"{",
"if",
"(",
"active",
".",
"valueParserIndex",
">=",
"0",
"&&",
"active",
".",
"printerParsers",
".",
"get",
"(",
"active",
".",
"valueParserIndex",
")",
"instanceof",... | Appends a fixed width printer-parser.
@param width the width
@param pp the printer-parser, not null
@return this, for chaining, not null | [
"Appends",
"a",
"fixed",
"width",
"printer",
"-",
"parser",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/format/DateTimeFormatterBuilder.java#L577-L604 |
113,489 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/ZoneRulesProvider.java | ZoneRulesProvider.registerProvider0 | private static void registerProvider0(ZoneRulesProvider provider) {
for (String zoneId : provider.provideZoneIds()) {
Jdk8Methods.requireNonNull(zoneId, "zoneId");
ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider);
if (old != null) {
throw new ZoneRu... | java | private static void registerProvider0(ZoneRulesProvider provider) {
for (String zoneId : provider.provideZoneIds()) {
Jdk8Methods.requireNonNull(zoneId, "zoneId");
ZoneRulesProvider old = ZONES.putIfAbsent(zoneId, provider);
if (old != null) {
throw new ZoneRu... | [
"private",
"static",
"void",
"registerProvider0",
"(",
"ZoneRulesProvider",
"provider",
")",
"{",
"for",
"(",
"String",
"zoneId",
":",
"provider",
".",
"provideZoneIds",
"(",
")",
")",
"{",
"Jdk8Methods",
".",
"requireNonNull",
"(",
"zoneId",
",",
"\"zoneId\"",
... | Registers the provider.
@param provider the provider to register, not null
@throws ZoneRulesException if unable to complete the registration | [
"Registers",
"the",
"provider",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneRulesProvider.java#L200-L210 |
113,490 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseDate.java | JapaneseDate.readObject | private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.era = JapaneseEra.from(isoDate);
int yearOffset = this.era.startDate().getYear() - 1;
this.yearOfEra = isoDate.getYear() - yearOffset;
} | java | private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.era = JapaneseEra.from(isoDate);
int yearOffset = this.era.startDate().getYear() - 1;
this.yearOfEra = isoDate.getYear() - yearOffset;
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"stream",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"stream",
".",
"defaultReadObject",
"(",
")",
";",
"this",
".",
"era",
"=",
"JapaneseEra",
".",
"from",
"(",
"isoDate",
")",
... | Reconstitutes this object from a stream.
@param stream object input stream | [
"Reconstitutes",
"this",
"object",
"from",
"a",
"stream",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseDate.java#L314-L319 |
113,491 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDate.java | LocalDate.resolvePreviousValid | private static LocalDate resolvePreviousValid(int year, int month, int day) {
switch (month) {
case 2:
day = Math.min(day, IsoChronology.INSTANCE.isLeapYear(year) ? 29 : 28);
break;
case 4:
case 6:
case 9:
case 11:
... | java | private static LocalDate resolvePreviousValid(int year, int month, int day) {
switch (month) {
case 2:
day = Math.min(day, IsoChronology.INSTANCE.isLeapYear(year) ? 29 : 28);
break;
case 4:
case 6:
case 9:
case 11:
... | [
"private",
"static",
"LocalDate",
"resolvePreviousValid",
"(",
"int",
"year",
",",
"int",
"month",
",",
"int",
"day",
")",
"{",
"switch",
"(",
"month",
")",
"{",
"case",
"2",
":",
"day",
"=",
"Math",
".",
"min",
"(",
"day",
",",
"IsoChronology",
".",
... | Resolves the date, resolving days past the end of month.
@param year the year to represent, validated from MIN_YEAR to MAX_YEAR
@param month the month-of-year to represent, validated from 1 to 12
@param day the day-of-month to represent, validated from 1 to 31
@return the resolved date, not null | [
"Resolves",
"the",
"date",
"resolving",
"days",
"past",
"the",
"end",
"of",
"month",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/LocalDate.java#L399-L412 |
113,492 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/chrono/JapaneseEra.java | JapaneseEra.endDate | LocalDate endDate() {
int ordinal = ordinal(eraValue);
JapaneseEra[] eras = values();
if (ordinal >= eras.length - 1) {
return LocalDate.MAX;
}
return eras[ordinal + 1].startDate().minusDays(1);
} | java | LocalDate endDate() {
int ordinal = ordinal(eraValue);
JapaneseEra[] eras = values();
if (ordinal >= eras.length - 1) {
return LocalDate.MAX;
}
return eras[ordinal + 1].startDate().minusDays(1);
} | [
"LocalDate",
"endDate",
"(",
")",
"{",
"int",
"ordinal",
"=",
"ordinal",
"(",
"eraValue",
")",
";",
"JapaneseEra",
"[",
"]",
"eras",
"=",
"values",
"(",
")",
";",
"if",
"(",
"ordinal",
">=",
"eras",
".",
"length",
"-",
"1",
")",
"{",
"return",
"Loc... | Returns the end date of the era.
@return the end date | [
"Returns",
"the",
"end",
"date",
"of",
"the",
"era",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/chrono/JapaneseEra.java#L291-L298 |
113,493 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.requireNonNull | public static <T> T requireNonNull(T value, String parameterName) {
if (value == null) {
throw new NullPointerException(parameterName + " must not be null");
}
return value;
} | java | public static <T> T requireNonNull(T value, String parameterName) {
if (value == null) {
throw new NullPointerException(parameterName + " must not be null");
}
return value;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"requireNonNull",
"(",
"T",
"value",
",",
"String",
"parameterName",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"parameterName",
"+",
"\" must not be null\"",
")"... | Ensures that the argument is non-null.
@param <T> the value type
@param value the value to check
@param parameterName the name of the parameter
@return the checked non-null value
@throws NullPointerException if the value is null | [
"Ensures",
"that",
"the",
"argument",
"is",
"non",
"-",
"null",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L77-L82 |
113,494 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeAdd | public static int safeAdd(int a, int b) {
int sum = a + b;
// check for a change of sign in the result when the inputs have the same sign
if ((a ^ sum) < 0 && (a ^ b) >= 0) {
throw new ArithmeticException("Addition overflows an int: " + a + " + " + b);
}
return sum;
... | java | public static int safeAdd(int a, int b) {
int sum = a + b;
// check for a change of sign in the result when the inputs have the same sign
if ((a ^ sum) < 0 && (a ^ b) >= 0) {
throw new ArithmeticException("Addition overflows an int: " + a + " + " + b);
}
return sum;
... | [
"public",
"static",
"int",
"safeAdd",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"int",
"sum",
"=",
"a",
"+",
"b",
";",
"// check for a change of sign in the result when the inputs have the same sign",
"if",
"(",
"(",
"a",
"^",
"sum",
")",
"<",
"0",
"&&",
... | Safely adds two int values.
@param a the first value
@param b the second value
@return the result
@throws ArithmeticException if the result overflows an int | [
"Safely",
"adds",
"two",
"int",
"values",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L145-L152 |
113,495 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeSubtract | public static int safeSubtract(int a, int b) {
int result = a - b;
// check for a change of sign in the result when the inputs have the different signs
if ((a ^ result) < 0 && (a ^ b) < 0) {
throw new ArithmeticException("Subtraction overflows an int: " + a + " - " + b);
}
... | java | public static int safeSubtract(int a, int b) {
int result = a - b;
// check for a change of sign in the result when the inputs have the different signs
if ((a ^ result) < 0 && (a ^ b) < 0) {
throw new ArithmeticException("Subtraction overflows an int: " + a + " - " + b);
}
... | [
"public",
"static",
"int",
"safeSubtract",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"int",
"result",
"=",
"a",
"-",
"b",
";",
"// check for a change of sign in the result when the inputs have the different signs",
"if",
"(",
"(",
"a",
"^",
"result",
")",
"<",... | Safely subtracts one int from another.
@param a the first value
@param b the second value to subtract from the first
@return the result
@throws ArithmeticException if the result overflows an int | [
"Safely",
"subtracts",
"one",
"int",
"from",
"another",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L180-L187 |
113,496 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeMultiply | public static int safeMultiply(int a, int b) {
long total = (long) a * (long) b;
if (total < Integer.MIN_VALUE || total > Integer.MAX_VALUE) {
throw new ArithmeticException("Multiplication overflows an int: " + a + " * " + b);
}
return (int) total;
} | java | public static int safeMultiply(int a, int b) {
long total = (long) a * (long) b;
if (total < Integer.MIN_VALUE || total > Integer.MAX_VALUE) {
throw new ArithmeticException("Multiplication overflows an int: " + a + " * " + b);
}
return (int) total;
} | [
"public",
"static",
"int",
"safeMultiply",
"(",
"int",
"a",
",",
"int",
"b",
")",
"{",
"long",
"total",
"=",
"(",
"long",
")",
"a",
"*",
"(",
"long",
")",
"b",
";",
"if",
"(",
"total",
"<",
"Integer",
".",
"MIN_VALUE",
"||",
"total",
">",
"Intege... | Safely multiply one int by another.
@param a the first value
@param b the second value
@return the result
@throws ArithmeticException if the result overflows an int | [
"Safely",
"multiply",
"one",
"int",
"by",
"another",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L215-L221 |
113,497 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeMultiply | public static long safeMultiply(long a, int b) {
switch (b) {
case -1:
if (a == Long.MIN_VALUE) {
throw new ArithmeticException("Multiplication overflows a long: " + a + " * " + b);
}
return -a;
case 0:
r... | java | public static long safeMultiply(long a, int b) {
switch (b) {
case -1:
if (a == Long.MIN_VALUE) {
throw new ArithmeticException("Multiplication overflows a long: " + a + " * " + b);
}
return -a;
case 0:
r... | [
"public",
"static",
"long",
"safeMultiply",
"(",
"long",
"a",
",",
"int",
"b",
")",
"{",
"switch",
"(",
"b",
")",
"{",
"case",
"-",
"1",
":",
"if",
"(",
"a",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"M... | Safely multiply a long by an int.
@param a the first value
@param b the second value
@return the new total
@throws ArithmeticException if the result overflows a long | [
"Safely",
"multiply",
"a",
"long",
"by",
"an",
"int",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L231-L248 |
113,498 | ThreeTen/threetenbp | src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java | Jdk8Methods.safeToInt | public static int safeToInt(long value) {
if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) {
throw new ArithmeticException("Calculation overflows an int: " + value);
}
return (int) value;
} | java | public static int safeToInt(long value) {
if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) {
throw new ArithmeticException("Calculation overflows an int: " + value);
}
return (int) value;
} | [
"public",
"static",
"int",
"safeToInt",
"(",
"long",
"value",
")",
"{",
"if",
"(",
"value",
">",
"Integer",
".",
"MAX_VALUE",
"||",
"value",
"<",
"Integer",
".",
"MIN_VALUE",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
"\"Calculation overflows an int... | Safely convert a long to an int.
@param value the value to convert
@return the int value
@throws ArithmeticException if the result overflows an int | [
"Safely",
"convert",
"a",
"long",
"to",
"an",
"int",
"."
] | 5f05b649f89f205aabd96b2f83c36796ec616fe6 | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/jdk8/Jdk8Methods.java#L283-L288 |
113,499 | arangodb/arangodb-java-driver | src/main/java/com/arangodb/model/AqlQueryOptions.java | AqlQueryOptions.shardIds | public AqlQueryOptions shardIds(final String... shardIds) {
getOptions().getShardIds().addAll(Arrays.asList(shardIds));
return this;
} | java | public AqlQueryOptions shardIds(final String... shardIds) {
getOptions().getShardIds().addAll(Arrays.asList(shardIds));
return this;
} | [
"public",
"AqlQueryOptions",
"shardIds",
"(",
"final",
"String",
"...",
"shardIds",
")",
"{",
"getOptions",
"(",
")",
".",
"getShardIds",
"(",
")",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"shardIds",
")",
")",
";",
"return",
"this",
";",
"}"
] | Restrict query to shards by given ids. This is an internal option. Use at your own risk.
@param shardIds
@return options | [
"Restrict",
"query",
"to",
"shards",
"by",
"given",
"ids",
".",
"This",
"is",
"an",
"internal",
"option",
".",
"Use",
"at",
"your",
"own",
"risk",
"."
] | 17035b222d1c489b9c248c7148359b9c117a4479 | https://github.com/arangodb/arangodb-java-driver/blob/17035b222d1c489b9c248c7148359b9c117a4479/src/main/java/com/arangodb/model/AqlQueryOptions.java#L391-L394 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.