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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getBaselineFinish | public Date getBaselineFinish()
{
Object result = getCachedValue(TaskField.BASELINE_FINISH);
if (result == null)
{
result = getCachedValue(TaskField.BASELINE_ESTIMATED_FINISH);
}
if (!(result instanceof Date))
{
result = null;
}
return (Date) result;... | java | public Date getBaselineFinish()
{
Object result = getCachedValue(TaskField.BASELINE_FINISH);
if (result == null)
{
result = getCachedValue(TaskField.BASELINE_ESTIMATED_FINISH);
}
if (!(result instanceof Date))
{
result = null;
}
return (Date) result;... | [
"public",
"Date",
"getBaselineFinish",
"(",
")",
"{",
"Object",
"result",
"=",
"getCachedValue",
"(",
"TaskField",
".",
"BASELINE_FINISH",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"getCachedValue",
"(",
"TaskField",
".",
"BASELIN... | The Baseline Finish field shows the planned completion date for a task
at the time you saved a baseline. Information in this field becomes
available when you set a baseline for a task.
@return Date | [
"The",
"Baseline",
"Finish",
"field",
"shows",
"the",
"planned",
"completion",
"date",
"for",
"a",
"task",
"at",
"the",
"time",
"you",
"saved",
"a",
"baseline",
".",
"Information",
"in",
"this",
"field",
"becomes",
"available",
"when",
"you",
"set",
"a",
"... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L1639-L1652 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getBaselineStart | public Date getBaselineStart()
{
Object result = getCachedValue(TaskField.BASELINE_START);
if (result == null)
{
result = getCachedValue(TaskField.BASELINE_ESTIMATED_START);
}
if (!(result instanceof Date))
{
result = null;
}
return (Date) result;
... | java | public Date getBaselineStart()
{
Object result = getCachedValue(TaskField.BASELINE_START);
if (result == null)
{
result = getCachedValue(TaskField.BASELINE_ESTIMATED_START);
}
if (!(result instanceof Date))
{
result = null;
}
return (Date) result;
... | [
"public",
"Date",
"getBaselineStart",
"(",
")",
"{",
"Object",
"result",
"=",
"getCachedValue",
"(",
"TaskField",
".",
"BASELINE_START",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"getCachedValue",
"(",
"TaskField",
".",
"BASELINE_... | The Baseline Start field shows the planned beginning date for a task at
the time you saved a baseline. Information in this field becomes available
when you set a baseline.
@return Date | [
"The",
"Baseline",
"Start",
"field",
"shows",
"the",
"planned",
"beginning",
"date",
"for",
"a",
"task",
"at",
"the",
"time",
"you",
"saved",
"a",
"baseline",
".",
"Information",
"in",
"this",
"field",
"becomes",
"available",
"when",
"you",
"set",
"a",
"ba... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L1691-L1704 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getCostVariance | public Number getCostVariance()
{
Number variance = (Number) getCachedValue(TaskField.COST_VARIANCE);
if (variance == null)
{
Number cost = getCost();
Number baselineCost = getBaselineCost();
if (cost != null && baselineCost != null)
{
variance = Numb... | java | public Number getCostVariance()
{
Number variance = (Number) getCachedValue(TaskField.COST_VARIANCE);
if (variance == null)
{
Number cost = getCost();
Number baselineCost = getBaselineCost();
if (cost != null && baselineCost != null)
{
variance = Numb... | [
"public",
"Number",
"getCostVariance",
"(",
")",
"{",
"Number",
"variance",
"=",
"(",
"Number",
")",
"getCachedValue",
"(",
"TaskField",
".",
"COST_VARIANCE",
")",
";",
"if",
"(",
"variance",
"==",
"null",
")",
"{",
"Number",
"cost",
"=",
"getCost",
"(",
... | The Cost Variance field shows the difference between the baseline cost
and total cost for a task. The total cost is the current estimate of costs
based on actual costs and remaining costs.
@return amount | [
"The",
"Cost",
"Variance",
"field",
"shows",
"the",
"difference",
"between",
"the",
"baseline",
"cost",
"and",
"total",
"cost",
"for",
"a",
"task",
".",
"The",
"total",
"cost",
"is",
"the",
"current",
"estimate",
"of",
"costs",
"based",
"on",
"actual",
"co... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L1841-L1855 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getCritical | public boolean getCritical()
{
Boolean critical = (Boolean) getCachedValue(TaskField.CRITICAL);
if (critical == null)
{
Duration totalSlack = getTotalSlack();
ProjectProperties props = getParentFile().getProjectProperties();
int criticalSlackLimit = NumberHelper.getInt(pr... | java | public boolean getCritical()
{
Boolean critical = (Boolean) getCachedValue(TaskField.CRITICAL);
if (critical == null)
{
Duration totalSlack = getTotalSlack();
ProjectProperties props = getParentFile().getProjectProperties();
int criticalSlackLimit = NumberHelper.getInt(pr... | [
"public",
"boolean",
"getCritical",
"(",
")",
"{",
"Boolean",
"critical",
"=",
"(",
"Boolean",
")",
"getCachedValue",
"(",
"TaskField",
".",
"CRITICAL",
")",
";",
"if",
"(",
"critical",
"==",
"null",
")",
"{",
"Duration",
"totalSlack",
"=",
"getTotalSlack",
... | The Critical field indicates whether a task has any room in the schedule
to slip, or if a task is on the critical path. The Critical field contains
Yes if the task is critical and No if the task is not critical.
@return boolean | [
"The",
"Critical",
"field",
"indicates",
"whether",
"a",
"task",
"has",
"any",
"room",
"in",
"the",
"schedule",
"to",
"slip",
"or",
"if",
"a",
"task",
"is",
"on",
"the",
"critical",
"path",
".",
"The",
"Critical",
"field",
"contains",
"Yes",
"if",
"the",... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L1875-L1891 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setOutlineCode | public void setOutlineCode(int index, String value)
{
set(selectField(TaskFieldLists.CUSTOM_OUTLINE_CODE, index), value);
} | java | public void setOutlineCode(int index, String value)
{
set(selectField(TaskFieldLists.CUSTOM_OUTLINE_CODE, index), value);
} | [
"public",
"void",
"setOutlineCode",
"(",
"int",
"index",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"CUSTOM_OUTLINE_CODE",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set an outline code value.
@param index outline code index (1-10)
@param value outline code value | [
"Set",
"an",
"outline",
"code",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L2617-L2620 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getTotalSlack | public Duration getTotalSlack()
{
Duration totalSlack = (Duration) getCachedValue(TaskField.TOTAL_SLACK);
if (totalSlack == null)
{
Duration duration = getDuration();
if (duration == null)
{
duration = Duration.getInstance(0, TimeUnit.DAYS);
}
... | java | public Duration getTotalSlack()
{
Duration totalSlack = (Duration) getCachedValue(TaskField.TOTAL_SLACK);
if (totalSlack == null)
{
Duration duration = getDuration();
if (duration == null)
{
duration = Duration.getInstance(0, TimeUnit.DAYS);
}
... | [
"public",
"Duration",
"getTotalSlack",
"(",
")",
"{",
"Duration",
"totalSlack",
"=",
"(",
"Duration",
")",
"getCachedValue",
"(",
"TaskField",
".",
"TOTAL_SLACK",
")",
";",
"if",
"(",
"totalSlack",
"==",
"null",
")",
"{",
"Duration",
"duration",
"=",
"getDur... | The Total Slack field contains the amount of time a task can be
delayed without delaying the project's finish date.
@return string representing duration | [
"The",
"Total",
"Slack",
"field",
"contains",
"the",
"amount",
"of",
"time",
"a",
"task",
"can",
"be",
"delayed",
"without",
"delaying",
"the",
"project",
"s",
"finish",
"date",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L2639-L2708 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setCalendar | public void setCalendar(ProjectCalendar calendar)
{
set(TaskField.CALENDAR, calendar);
setCalendarUniqueID(calendar == null ? null : calendar.getUniqueID());
} | java | public void setCalendar(ProjectCalendar calendar)
{
set(TaskField.CALENDAR, calendar);
setCalendarUniqueID(calendar == null ? null : calendar.getUniqueID());
} | [
"public",
"void",
"setCalendar",
"(",
"ProjectCalendar",
"calendar",
")",
"{",
"set",
"(",
"TaskField",
".",
"CALENDAR",
",",
"calendar",
")",
";",
"setCalendarUniqueID",
"(",
"calendar",
"==",
"null",
"?",
"null",
":",
"calendar",
".",
"getUniqueID",
"(",
"... | Sets the name of the base calendar associated with this task.
Note that this attribute appears in MPP9 and MSPDI files.
@param calendar calendar instance | [
"Sets",
"the",
"name",
"of",
"the",
"base",
"calendar",
"associated",
"with",
"this",
"task",
".",
"Note",
"that",
"this",
"attribute",
"appears",
"in",
"MPP9",
"and",
"MSPDI",
"files",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3634-L3638 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getStartSlack | public Duration getStartSlack()
{
Duration startSlack = (Duration) getCachedValue(TaskField.START_SLACK);
if (startSlack == null)
{
Duration duration = getDuration();
if (duration != null)
{
startSlack = DateHelper.getVariance(this, getEarlyStart(), getLateSta... | java | public Duration getStartSlack()
{
Duration startSlack = (Duration) getCachedValue(TaskField.START_SLACK);
if (startSlack == null)
{
Duration duration = getDuration();
if (duration != null)
{
startSlack = DateHelper.getVariance(this, getEarlyStart(), getLateSta... | [
"public",
"Duration",
"getStartSlack",
"(",
")",
"{",
"Duration",
"startSlack",
"=",
"(",
"Duration",
")",
"getCachedValue",
"(",
"TaskField",
".",
"START_SLACK",
")",
";",
"if",
"(",
"startSlack",
"==",
"null",
")",
"{",
"Duration",
"duration",
"=",
"getDur... | Retrieve the start slack.
@return start slack | [
"Retrieve",
"the",
"start",
"slack",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3691-L3704 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getFinishSlack | public Duration getFinishSlack()
{
Duration finishSlack = (Duration) getCachedValue(TaskField.FINISH_SLACK);
if (finishSlack == null)
{
Duration duration = getDuration();
if (duration != null)
{
finishSlack = DateHelper.getVariance(this, getEarlyFinish(), getL... | java | public Duration getFinishSlack()
{
Duration finishSlack = (Duration) getCachedValue(TaskField.FINISH_SLACK);
if (finishSlack == null)
{
Duration duration = getDuration();
if (duration != null)
{
finishSlack = DateHelper.getVariance(this, getEarlyFinish(), getL... | [
"public",
"Duration",
"getFinishSlack",
"(",
")",
"{",
"Duration",
"finishSlack",
"=",
"(",
"Duration",
")",
"getCachedValue",
"(",
"TaskField",
".",
"FINISH_SLACK",
")",
";",
"if",
"(",
"finishSlack",
"==",
"null",
")",
"{",
"Duration",
"duration",
"=",
"ge... | Retrieve the finish slack.
@return finish slack | [
"Retrieve",
"the",
"finish",
"slack",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3711-L3724 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getFieldByAlias | public Object getFieldByAlias(String alias)
{
return getCachedValue(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias));
} | java | public Object getFieldByAlias(String alias)
{
return getCachedValue(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias));
} | [
"public",
"Object",
"getFieldByAlias",
"(",
"String",
"alias",
")",
"{",
"return",
"getCachedValue",
"(",
"getParentFile",
"(",
")",
".",
"getCustomFields",
"(",
")",
".",
"getFieldByAlias",
"(",
"FieldTypeClass",
".",
"TASK",
",",
"alias",
")",
")",
";",
"}... | Retrieve the value of a field using its alias.
@param alias field alias
@return field value | [
"Retrieve",
"the",
"value",
"of",
"a",
"field",
"using",
"its",
"alias",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3732-L3735 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setFieldByAlias | public void setFieldByAlias(String alias, Object value)
{
set(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias), value);
} | java | public void setFieldByAlias(String alias, Object value)
{
set(getParentFile().getCustomFields().getFieldByAlias(FieldTypeClass.TASK, alias), value);
} | [
"public",
"void",
"setFieldByAlias",
"(",
"String",
"alias",
",",
"Object",
"value",
")",
"{",
"set",
"(",
"getParentFile",
"(",
")",
".",
"getCustomFields",
"(",
")",
".",
"getFieldByAlias",
"(",
"FieldTypeClass",
".",
"TASK",
",",
"alias",
")",
",",
"val... | Set the value of a field using its alias.
@param alias field alias
@param value field value | [
"Set",
"the",
"value",
"of",
"a",
"field",
"using",
"its",
"alias",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3743-L3746 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getEnterpriseFlag | public boolean getEnterpriseFlag(int index)
{
return (BooleanHelper.getBoolean((Boolean) getCachedValue(selectField(TaskFieldLists.ENTERPRISE_FLAG, index))));
} | java | public boolean getEnterpriseFlag(int index)
{
return (BooleanHelper.getBoolean((Boolean) getCachedValue(selectField(TaskFieldLists.ENTERPRISE_FLAG, index))));
} | [
"public",
"boolean",
"getEnterpriseFlag",
"(",
"int",
"index",
")",
"{",
"return",
"(",
"BooleanHelper",
".",
"getBoolean",
"(",
"(",
"Boolean",
")",
"getCachedValue",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"ENTERPRISE_FLAG",
",",
"index",
")",
")",
"... | Retrieve an enterprise field value.
@param index field index
@return field value | [
"Retrieve",
"an",
"enterprise",
"field",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L3892-L3895 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getBaselineDurationText | public String getBaselineDurationText(int baselineNumber)
{
Object result = getCachedValue(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber));
if (result == null)
{
result = getCachedValue(selectField(TaskFieldLists.BASELINE_ESTIMATED_DURATIONS, baselineNumber));
}
... | java | public String getBaselineDurationText(int baselineNumber)
{
Object result = getCachedValue(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber));
if (result == null)
{
result = getCachedValue(selectField(TaskFieldLists.BASELINE_ESTIMATED_DURATIONS, baselineNumber));
}
... | [
"public",
"String",
"getBaselineDurationText",
"(",
"int",
"baselineNumber",
")",
"{",
"Object",
"result",
"=",
"getCachedValue",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_DURATIONS",
",",
"baselineNumber",
")",
")",
";",
"if",
"(",
"result",
"==",... | Retrieves the baseline duration text value.
@param baselineNumber baseline number
@return baseline duration text value | [
"Retrieves",
"the",
"baseline",
"duration",
"text",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4067-L4080 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineDurationText | public void setBaselineDurationText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | java | public void setBaselineDurationText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_DURATIONS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineDurationText",
"(",
"int",
"baselineNumber",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_DURATIONS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Sets the baseline duration text value.
@param baselineNumber baseline number
@param value baseline duration text value | [
"Sets",
"the",
"baseline",
"duration",
"text",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4088-L4091 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineFinishText | public void setBaselineFinishText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value);
} | java | public void setBaselineFinishText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_FINISHES, baselineNumber), value);
} | [
"public",
"void",
"setBaselineFinishText",
"(",
"int",
"baselineNumber",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_FINISHES",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Sets the baseline finish text value.
@param baselineNumber baseline number
@param value baseline finish text value | [
"Sets",
"the",
"baseline",
"finish",
"text",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4141-L4144 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.setBaselineStartText | public void setBaselineStartText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_STARTS, baselineNumber), value);
} | java | public void setBaselineStartText(int baselineNumber, String value)
{
set(selectField(TaskFieldLists.BASELINE_STARTS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineStartText",
"(",
"int",
"baselineNumber",
",",
"String",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"TaskFieldLists",
".",
"BASELINE_STARTS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Sets the baseline start text value.
@param baselineNumber baseline number
@param value baseline start text value | [
"Sets",
"the",
"baseline",
"start",
"text",
"value",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4194-L4197 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getCompleteThrough | public Date getCompleteThrough()
{
Date value = (Date) getCachedValue(TaskField.COMPLETE_THROUGH);
if (value == null)
{
int percentComplete = NumberHelper.getInt(getPercentageComplete());
switch (percentComplete)
{
case 0:
{
break;
... | java | public Date getCompleteThrough()
{
Date value = (Date) getCachedValue(TaskField.COMPLETE_THROUGH);
if (value == null)
{
int percentComplete = NumberHelper.getInt(getPercentageComplete());
switch (percentComplete)
{
case 0:
{
break;
... | [
"public",
"Date",
"getCompleteThrough",
"(",
")",
"{",
"Date",
"value",
"=",
"(",
"Date",
")",
"getCachedValue",
"(",
"TaskField",
".",
"COMPLETE_THROUGH",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"int",
"percentComplete",
"=",
"NumberHelper",
... | Retrieve the "complete through" date.
@return complete through date | [
"Retrieve",
"the",
"complete",
"through",
"date",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4215-L4252 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getTaskMode | public TaskMode getTaskMode()
{
return BooleanHelper.getBoolean((Boolean) getCachedValue(TaskField.TASK_MODE)) ? TaskMode.MANUALLY_SCHEDULED : TaskMode.AUTO_SCHEDULED;
} | java | public TaskMode getTaskMode()
{
return BooleanHelper.getBoolean((Boolean) getCachedValue(TaskField.TASK_MODE)) ? TaskMode.MANUALLY_SCHEDULED : TaskMode.AUTO_SCHEDULED;
} | [
"public",
"TaskMode",
"getTaskMode",
"(",
")",
"{",
"return",
"BooleanHelper",
".",
"getBoolean",
"(",
"(",
"Boolean",
")",
"getCachedValue",
"(",
"TaskField",
".",
"TASK_MODE",
")",
")",
"?",
"TaskMode",
".",
"MANUALLY_SCHEDULED",
":",
"TaskMode",
".",
"AUTO_... | Retrieves the task mode.
@return task mode | [
"Retrieves",
"the",
"task",
"mode",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4300-L4303 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.getEffectiveCalendar | public ProjectCalendar getEffectiveCalendar()
{
ProjectCalendar result = getCalendar();
if (result == null)
{
result = getParentFile().getDefaultCalendar();
}
return result;
} | java | public ProjectCalendar getEffectiveCalendar()
{
ProjectCalendar result = getCalendar();
if (result == null)
{
result = getParentFile().getDefaultCalendar();
}
return result;
} | [
"public",
"ProjectCalendar",
"getEffectiveCalendar",
"(",
")",
"{",
"ProjectCalendar",
"result",
"=",
"getCalendar",
"(",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"getParentFile",
"(",
")",
".",
"getDefaultCalendar",
"(",
")",
";... | Retrieve the effective calendar for this task. If the task does not have
a specific calendar associated with it, fall back to using the default calendar
for the project.
@return ProjectCalendar instance | [
"Retrieve",
"the",
"effective",
"calendar",
"for",
"this",
"task",
".",
"If",
"the",
"task",
"does",
"not",
"have",
"a",
"specific",
"calendar",
"associated",
"with",
"it",
"fall",
"back",
"to",
"using",
"the",
"default",
"calendar",
"for",
"the",
"project",... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4569-L4577 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.removePredecessor | public boolean removePredecessor(Task targetTask, RelationType type, Duration lag)
{
boolean matchFound = false;
//
// Retrieve the list of predecessors
//
List<Relation> predecessorList = getPredecessors();
if (!predecessorList.isEmpty())
{
//
// Ensure t... | java | public boolean removePredecessor(Task targetTask, RelationType type, Duration lag)
{
boolean matchFound = false;
//
// Retrieve the list of predecessors
//
List<Relation> predecessorList = getPredecessors();
if (!predecessorList.isEmpty())
{
//
// Ensure t... | [
"public",
"boolean",
"removePredecessor",
"(",
"Task",
"targetTask",
",",
"RelationType",
"type",
",",
"Duration",
"lag",
")",
"{",
"boolean",
"matchFound",
"=",
"false",
";",
"//",
"// Retrieve the list of predecessors",
"//",
"List",
"<",
"Relation",
">",
"prede... | This method allows a predecessor relationship to be removed from this
task instance. It will only delete relationships that exactly match the
given targetTask, type and lag time.
@param targetTask the predecessor task
@param type relation type
@param lag relation lag
@return returns true if the relation is found and ... | [
"This",
"method",
"allows",
"a",
"predecessor",
"relationship",
"to",
"be",
"removed",
"from",
"this",
"task",
"instance",
".",
"It",
"will",
"only",
"delete",
"relationships",
"that",
"exactly",
"match",
"the",
"given",
"targetTask",
"type",
"and",
"lag",
"ti... | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4589-L4635 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.removeRelation | private boolean removeRelation(List<Relation> relationList, Task targetTask, RelationType type, Duration lag)
{
boolean matchFound = false;
for (Relation relation : relationList)
{
if (relation.getTargetTask() == targetTask)
{
if (relation.getType() == type && relation... | java | private boolean removeRelation(List<Relation> relationList, Task targetTask, RelationType type, Duration lag)
{
boolean matchFound = false;
for (Relation relation : relationList)
{
if (relation.getTargetTask() == targetTask)
{
if (relation.getType() == type && relation... | [
"private",
"boolean",
"removeRelation",
"(",
"List",
"<",
"Relation",
">",
"relationList",
",",
"Task",
"targetTask",
",",
"RelationType",
"type",
",",
"Duration",
"lag",
")",
"{",
"boolean",
"matchFound",
"=",
"false",
";",
"for",
"(",
"Relation",
"relation",... | Internal method used to locate an remove an item from a list Relations.
@param relationList list of Relation instances
@param targetTask target relationship task
@param type target relationship type
@param lag target relationship lag
@return true if a relationship was removed | [
"Internal",
"method",
"used",
"to",
"locate",
"an",
"remove",
"an",
"item",
"from",
"a",
"list",
"Relations",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L4646-L4661 | train |
joniles/mpxj | src/main/java/net/sf/mpxj/Task.java | Task.isRelated | private boolean isRelated(Task task, List<Relation> list)
{
boolean result = false;
for (Relation relation : list)
{
if (relation.getTargetTask().getUniqueID().intValue() == task.getUniqueID().intValue())
{
result = true;
break;
}
}
ret... | java | private boolean isRelated(Task task, List<Relation> list)
{
boolean result = false;
for (Relation relation : list)
{
if (relation.getTargetTask().getUniqueID().intValue() == task.getUniqueID().intValue())
{
result = true;
break;
}
}
ret... | [
"private",
"boolean",
"isRelated",
"(",
"Task",
"task",
",",
"List",
"<",
"Relation",
">",
"list",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"for",
"(",
"Relation",
"relation",
":",
"list",
")",
"{",
"if",
"(",
"relation",
".",
"getTargetTask",
... | Internal method used to test for the existence of a relationship
with a task.
@param task target task
@param list list of relationships
@return boolean flag | [
"Internal",
"method",
"used",
"to",
"test",
"for",
"the",
"existence",
"of",
"a",
"relationship",
"with",
"a",
"task",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Task.java#L5020-L5032 | train |
jensgerdes/sonar-pmd | sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/xml/PmdRuleSet.java | PmdRuleSet.writeTo | public void writeTo(Writer destination) {
Element eltRuleset = new Element("ruleset");
addAttribute(eltRuleset, "name", name);
addChild(eltRuleset, "description", description);
for (PmdRule pmdRule : rules) {
Element eltRule = new Element("rule");
addAttribute(elt... | java | public void writeTo(Writer destination) {
Element eltRuleset = new Element("ruleset");
addAttribute(eltRuleset, "name", name);
addChild(eltRuleset, "description", description);
for (PmdRule pmdRule : rules) {
Element eltRule = new Element("rule");
addAttribute(elt... | [
"public",
"void",
"writeTo",
"(",
"Writer",
"destination",
")",
"{",
"Element",
"eltRuleset",
"=",
"new",
"Element",
"(",
"\"ruleset\"",
")",
";",
"addAttribute",
"(",
"eltRuleset",
",",
"\"name\"",
",",
"name",
")",
";",
"addChild",
"(",
"eltRuleset",
",",
... | Serializes this RuleSet in an XML document.
@param destination The writer to which the XML document shall be written. | [
"Serializes",
"this",
"RuleSet",
"in",
"an",
"XML",
"document",
"."
] | 49b9272b2a71aa1b480972ec6cb4cc347bb50959 | https://github.com/jensgerdes/sonar-pmd/blob/49b9272b2a71aa1b480972ec6cb4cc347bb50959/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/xml/PmdRuleSet.java#L76-L102 | train |
jensgerdes/sonar-pmd | sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/xml/factory/XmlRuleSetFactory.java | XmlRuleSetFactory.create | @Override
public PmdRuleSet create() {
final SAXBuilder parser = new SAXBuilder();
final Document dom;
try {
dom = parser.build(source);
} catch (JDOMException | IOException e) {
if (messages != null) {
messages.addErrorText(INVALID_INPUT + " :... | java | @Override
public PmdRuleSet create() {
final SAXBuilder parser = new SAXBuilder();
final Document dom;
try {
dom = parser.build(source);
} catch (JDOMException | IOException e) {
if (messages != null) {
messages.addErrorText(INVALID_INPUT + " :... | [
"@",
"Override",
"public",
"PmdRuleSet",
"create",
"(",
")",
"{",
"final",
"SAXBuilder",
"parser",
"=",
"new",
"SAXBuilder",
"(",
")",
";",
"final",
"Document",
"dom",
";",
"try",
"{",
"dom",
"=",
"parser",
".",
"build",
"(",
"source",
")",
";",
"}",
... | Parses the given Reader for PmdRuleSets.
@return The extracted PmdRuleSet - empty in case of problems, never null. | [
"Parses",
"the",
"given",
"Reader",
"for",
"PmdRuleSets",
"."
] | 49b9272b2a71aa1b480972ec6cb4cc347bb50959 | https://github.com/jensgerdes/sonar-pmd/blob/49b9272b2a71aa1b480972ec6cb4cc347bb50959/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/xml/factory/XmlRuleSetFactory.java#L100-L137 | train |
jensgerdes/sonar-pmd | sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/TextRangeCalculator.java | TextRangeCalculator.calculateBeginLine | private static int calculateBeginLine(RuleViolation pmdViolation) {
int minLine = Math.min(pmdViolation.getBeginLine(), pmdViolation.getEndLine());
return minLine > 0 ? minLine : calculateEndLine(pmdViolation);
} | java | private static int calculateBeginLine(RuleViolation pmdViolation) {
int minLine = Math.min(pmdViolation.getBeginLine(), pmdViolation.getEndLine());
return minLine > 0 ? minLine : calculateEndLine(pmdViolation);
} | [
"private",
"static",
"int",
"calculateBeginLine",
"(",
"RuleViolation",
"pmdViolation",
")",
"{",
"int",
"minLine",
"=",
"Math",
".",
"min",
"(",
"pmdViolation",
".",
"getBeginLine",
"(",
")",
",",
"pmdViolation",
".",
"getEndLine",
"(",
")",
")",
";",
"retu... | Calculates the beginLine of a violation report.
@param pmdViolation The violation for which the beginLine should be calculated.
@return The beginLine is assumed to be the line with the smallest number. However, if the smallest number is
out-of-range (non-positive), it takes the other number. | [
"Calculates",
"the",
"beginLine",
"of",
"a",
"violation",
"report",
"."
] | 49b9272b2a71aa1b480972ec6cb4cc347bb50959 | https://github.com/jensgerdes/sonar-pmd/blob/49b9272b2a71aa1b480972ec6cb4cc347bb50959/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/TextRangeCalculator.java#L61-L64 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java | SearchViewFacade.findViewById | @Nullable public View findViewById(int id) {
if (searchView != null) {
return searchView.findViewById(id);
} else if (supportView != null) {
return supportView.findViewById(id);
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | java | @Nullable public View findViewById(int id) {
if (searchView != null) {
return searchView.findViewById(id);
} else if (supportView != null) {
return supportView.findViewById(id);
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | [
"@",
"Nullable",
"public",
"View",
"findViewById",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"searchView",
"!=",
"null",
")",
"{",
"return",
"searchView",
".",
"findViewById",
"(",
"id",
")",
";",
"}",
"else",
"if",
"(",
"supportView",
"!=",
"null",
")",
... | Look for a child view with the given id. If this view has the given
id, return this view.
@param id The id to search for.
@return The view that has the given id in the hierarchy or null | [
"Look",
"for",
"a",
"child",
"view",
"with",
"the",
"given",
"id",
".",
"If",
"this",
"view",
"has",
"the",
"given",
"id",
"return",
"this",
"view",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L88-L95 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java | SearchViewFacade.getContext | @NonNull public Context getContext() {
if (searchView != null) {
return searchView.getContext();
} else if (supportView != null) {
return supportView.getContext();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | java | @NonNull public Context getContext() {
if (searchView != null) {
return searchView.getContext();
} else if (supportView != null) {
return supportView.getContext();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | [
"@",
"NonNull",
"public",
"Context",
"getContext",
"(",
")",
"{",
"if",
"(",
"searchView",
"!=",
"null",
")",
"{",
"return",
"searchView",
".",
"getContext",
"(",
")",
";",
"}",
"else",
"if",
"(",
"supportView",
"!=",
"null",
")",
"{",
"return",
"suppo... | Returns the context the view is running in, through which it can
access the current theme, resources, etc.
@return The view's Context. | [
"Returns",
"the",
"context",
"the",
"view",
"is",
"running",
"in",
"through",
"which",
"it",
"can",
"access",
"the",
"current",
"theme",
"resources",
"etc",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L103-L110 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java | SearchViewFacade.getQuery | @NonNull public CharSequence getQuery() {
if (searchView != null) {
return searchView.getQuery();
} else if (supportView != null) {
return supportView.getQuery();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | java | @NonNull public CharSequence getQuery() {
if (searchView != null) {
return searchView.getQuery();
} else if (supportView != null) {
return supportView.getQuery();
}
throw new IllegalStateException(ERROR_NO_SEARCHVIEW);
} | [
"@",
"NonNull",
"public",
"CharSequence",
"getQuery",
"(",
")",
"{",
"if",
"(",
"searchView",
"!=",
"null",
")",
"{",
"return",
"searchView",
".",
"getQuery",
"(",
")",
";",
"}",
"else",
"if",
"(",
"supportView",
"!=",
"null",
")",
"{",
"return",
"supp... | Returns the query string currently in the text field.
@return the query string | [
"Returns",
"the",
"query",
"string",
"currently",
"in",
"the",
"text",
"field",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L117-L124 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java | SearchViewFacade.setOnQueryTextListener | public void setOnQueryTextListener(@NonNull final SearchView.OnQueryTextListener listener) {
if (searchView != null) {
searchView.setOnQueryTextListener(listener);
} else if (supportView != null) {
supportView.setOnQueryTextListener(new android.support.v7.widget.SearchView.OnQuer... | java | public void setOnQueryTextListener(@NonNull final SearchView.OnQueryTextListener listener) {
if (searchView != null) {
searchView.setOnQueryTextListener(listener);
} else if (supportView != null) {
supportView.setOnQueryTextListener(new android.support.v7.widget.SearchView.OnQuer... | [
"public",
"void",
"setOnQueryTextListener",
"(",
"@",
"NonNull",
"final",
"SearchView",
".",
"OnQueryTextListener",
"listener",
")",
"{",
"if",
"(",
"searchView",
"!=",
"null",
")",
"{",
"searchView",
".",
"setOnQueryTextListener",
"(",
"listener",
")",
";",
"}"... | Sets a listener for user actions within the SearchView.
@param listener the listener object that receives callbacks when the user performs
actions in the SearchView such as clicking on buttons or typing a query. | [
"Sets",
"a",
"listener",
"for",
"user",
"actions",
"within",
"the",
"SearchView",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L187-L203 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java | SearchViewFacade.setOnCloseListener | public void setOnCloseListener(@NonNull final android.support.v7.widget.SearchView.OnCloseListener listener) {
if (searchView != null) {
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override public boolean onClose() {
return listener.onClose()... | java | public void setOnCloseListener(@NonNull final android.support.v7.widget.SearchView.OnCloseListener listener) {
if (searchView != null) {
searchView.setOnCloseListener(new SearchView.OnCloseListener() {
@Override public boolean onClose() {
return listener.onClose()... | [
"public",
"void",
"setOnCloseListener",
"(",
"@",
"NonNull",
"final",
"android",
".",
"support",
".",
"v7",
".",
"widget",
".",
"SearchView",
".",
"OnCloseListener",
"listener",
")",
"{",
"if",
"(",
"searchView",
"!=",
"null",
")",
"{",
"searchView",
".",
... | Sets a listener to inform when the user closes the SearchView.
@param listener the listener to call when the user closes the SearchView. | [
"Sets",
"a",
"listener",
"to",
"inform",
"when",
"the",
"user",
"closes",
"the",
"SearchView",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/utils/SearchViewFacade.java#L253-L265 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.get | public static Searcher get(String variant) {
final Searcher searcher = instances.get(variant);
if (searcher == null) {
throw new IllegalStateException(Errors.SEARCHER_GET_BEFORE_CREATE);
}
return searcher;
} | java | public static Searcher get(String variant) {
final Searcher searcher = instances.get(variant);
if (searcher == null) {
throw new IllegalStateException(Errors.SEARCHER_GET_BEFORE_CREATE);
}
return searcher;
} | [
"public",
"static",
"Searcher",
"get",
"(",
"String",
"variant",
")",
"{",
"final",
"Searcher",
"searcher",
"=",
"instances",
".",
"get",
"(",
"variant",
")",
";",
"if",
"(",
"searcher",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",... | Gets the Searcher for a given variant.
@param variant an identifier to differentiate this Searcher from eventual others.
@return the corresponding Searcher instance.
@throws IllegalStateException if no searcher was {@link #create(Searchable) created} before for this {@code variant}. | [
"Gets",
"the",
"Searcher",
"for",
"a",
"given",
"variant",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L166-L172 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.reset | @NonNull
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher reset() {
lastResponsePage = 0;
lastRequestPage = 0;
lastResponseId = 0;
endReached = false;
clearFacetRefinements();
cancelPendingRequests();
numericRefinements.cl... | java | @NonNull
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher reset() {
lastResponsePage = 0;
lastRequestPage = 0;
lastResponseId = 0;
endReached = false;
clearFacetRefinements();
cancelPendingRequests();
numericRefinements.cl... | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"reset",
"(",
")",
"{",
"lastResponsePage",
"=",
"0",
";",
"lastRequestPage",
"=",
"0",
";",
"lastResponseId",
"=",
... | Resets the helper's state.
@return this {@link Searcher} for chaining. | [
"Resets",
"the",
"helper",
"s",
"state",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L463-L474 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.cancelPendingRequests | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher cancelPendingRequests() {
if (pendingRequests.size() != 0) {
for (int i = 0; i < pendingRequests.size(); i++) {
int reqId = pendingRequests.keyAt(i);
Request r = pendingRequests.val... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher cancelPendingRequests() {
if (pendingRequests.size() != 0) {
for (int i = 0; i < pendingRequests.size(); i++) {
int reqId = pendingRequests.keyAt(i);
Request r = pendingRequests.val... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"cancelPendingRequests",
"(",
")",
"{",
"if",
"(",
"pendingRequests",
".",
"size",
"(",
")",
"!=",
"0",
")",
"{",
"for",
"(",
"i... | Cancels all requests still waiting for a response.
@return this {@link Searcher} for chaining. | [
"Cancels",
"all",
"requests",
"still",
"waiting",
"for",
"a",
"response",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L491-L503 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.addBooleanFilter | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addBooleanFilter(String attribute, Boolean value) {
booleanFilterMap.put(attribute, value);
rebuildQueryFacetFilters();
return this;
} | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addBooleanFilter(String attribute, Boolean value) {
booleanFilterMap.put(attribute, value);
rebuildQueryFacetFilters();
return this;
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"addBooleanFilter",
"(",
"String",
"attribute",
",",
"Boolean",
"value",
")",
"{",
"booleanFilterMap",
".",
"put",
"(",
"attribute",
"... | Adds a boolean refinement for the next queries.
@param attribute the attribute to refine on.
@param value the value to refine with.
@return this {@link Searcher} for chaining. | [
"Adds",
"a",
"boolean",
"refinement",
"for",
"the",
"next",
"queries",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L768-L773 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.addFacet | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addFacet(String... attributes) {
for (String attribute : attributes) {
final Integer value = facetRequestCount.get(attribute);
facetRequestCount.put(attribute, value == null ? 1 : value + 1);
... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher addFacet(String... attributes) {
for (String attribute : attributes) {
final Integer value = facetRequestCount.get(attribute);
facetRequestCount.put(attribute, value == null ? 1 : value + 1);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"addFacet",
"(",
"String",
"...",
"attributes",
")",
"{",
"for",
"(",
"String",
"attribute",
":",
"attributes",
")",
"{",
"final",
... | Adds one or several attributes to facet on for the next queries.
@param attributes one or more attribute names.
@return this {@link Searcher} for chaining. | [
"Adds",
"one",
"or",
"several",
"attributes",
"to",
"facet",
"on",
"for",
"the",
"next",
"queries",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L809-L820 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.deleteFacet | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher deleteFacet(String... attributes) {
for (String attribute : attributes) {
facetRequestCount.put(attribute, 0);
facets.remove(attribute);
}
rebuildQueryFacets();
return this;
... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher deleteFacet(String... attributes) {
for (String attribute : attributes) {
facetRequestCount.put(attribute, 0);
facets.remove(attribute);
}
rebuildQueryFacets();
return this;
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"deleteFacet",
"(",
"String",
"...",
"attributes",
")",
"{",
"for",
"(",
"String",
"attribute",
":",
"attributes",
")",
"{",
"facetR... | Forces removal of one or several faceted attributes for the next queries.
@param attributes one or more attribute names.
@return this {@link Searcher} for chaining. | [
"Forces",
"removal",
"of",
"one",
"or",
"several",
"faceted",
"attributes",
"for",
"the",
"next",
"queries",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L852-L860 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/model/NumericRefinement.java | NumericRefinement.checkOperatorIsValid | public static void checkOperatorIsValid(int operatorCode) {
switch (operatorCode) {
case OPERATOR_LT:
case OPERATOR_LE:
case OPERATOR_EQ:
case OPERATOR_NE:
case OPERATOR_GE:
case OPERATOR_GT:
case OPERATOR_UNKNOWN:
... | java | public static void checkOperatorIsValid(int operatorCode) {
switch (operatorCode) {
case OPERATOR_LT:
case OPERATOR_LE:
case OPERATOR_EQ:
case OPERATOR_NE:
case OPERATOR_GE:
case OPERATOR_GT:
case OPERATOR_UNKNOWN:
... | [
"public",
"static",
"void",
"checkOperatorIsValid",
"(",
"int",
"operatorCode",
")",
"{",
"switch",
"(",
"operatorCode",
")",
"{",
"case",
"OPERATOR_LT",
":",
"case",
"OPERATOR_LE",
":",
"case",
"OPERATOR_EQ",
":",
"case",
"OPERATOR_NE",
":",
"case",
"OPERATOR_G... | Checks if the given operator code is a valid one.
@param operatorCode an operator code to evaluate
@throws IllegalStateException if operatorCode is not a known operator code. | [
"Checks",
"if",
"the",
"given",
"operator",
"code",
"is",
"a",
"valid",
"one",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/model/NumericRefinement.java#L81-L94 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java | JSONUtils.getStringFromJSONPath | public static String getStringFromJSONPath(JSONObject record, String path) {
final Object object = getObjectFromJSONPath(record, path);
return object == null ? null : object.toString();
} | java | public static String getStringFromJSONPath(JSONObject record, String path) {
final Object object = getObjectFromJSONPath(record, path);
return object == null ? null : object.toString();
} | [
"public",
"static",
"String",
"getStringFromJSONPath",
"(",
"JSONObject",
"record",
",",
"String",
"path",
")",
"{",
"final",
"Object",
"object",
"=",
"getObjectFromJSONPath",
"(",
"record",
",",
"path",
")",
";",
"return",
"object",
"==",
"null",
"?",
"null",... | Gets a string attribute from a json object given a path to traverse.
@param record a JSONObject to traverse.
@param path the json path to follow.
@return the attribute as a {@link String}, or null if it was not found. | [
"Gets",
"a",
"string",
"attribute",
"from",
"a",
"json",
"object",
"given",
"a",
"path",
"to",
"traverse",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java#L21-L24 | train |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java | JSONUtils.getMapFromJSONPath | public static HashMap<String, String> getMapFromJSONPath(JSONObject record, String path) {
return getObjectFromJSONPath(record, path);
} | java | public static HashMap<String, String> getMapFromJSONPath(JSONObject record, String path) {
return getObjectFromJSONPath(record, path);
} | [
"public",
"static",
"HashMap",
"<",
"String",
",",
"String",
">",
"getMapFromJSONPath",
"(",
"JSONObject",
"record",
",",
"String",
"path",
")",
"{",
"return",
"getObjectFromJSONPath",
"(",
"record",
",",
"path",
")",
";",
"}"
] | Gets a Map of attributes from a json object given a path to traverse.
@param record a JSONObject to traverse.
@param path the json path to follow.
@return the attributes as a {@link HashMap}, or null if it was not found. | [
"Gets",
"a",
"Map",
"of",
"attributes",
"from",
"a",
"json",
"object",
"given",
"a",
"path",
"to",
"traverse",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/utils/JSONUtils.java#L33-L35 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/views/Hits.java | Hits.enableKeyboardAutoHiding | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void enableKeyboardAutoHiding() {
keyboardListener = new OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (dx != 0 || dy != 0) {
... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void enableKeyboardAutoHiding() {
keyboardListener = new OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (dx != 0 || dy != 0) {
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"void",
"enableKeyboardAutoHiding",
"(",
")",
"{",
"keyboardListener",
"=",
"new",
"OnScrollListener",
"(",
")",
"{",
"@",
"Override",
"public",
"... | Starts closing the keyboard when the hits are scrolled. | [
"Starts",
"closing",
"the",
"keyboard",
"when",
"the",
"hits",
"are",
"scrolled",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/views/Hits.java#L210-L224 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java | InstantSearch.search | public void search(String query) {
final Query newQuery = searcher.getQuery().setQuery(query);
searcher.setQuery(newQuery).search();
} | java | public void search(String query) {
final Query newQuery = searcher.getQuery().setQuery(query);
searcher.setQuery(newQuery).search();
} | [
"public",
"void",
"search",
"(",
"String",
"query",
")",
"{",
"final",
"Query",
"newQuery",
"=",
"searcher",
".",
"getQuery",
"(",
")",
".",
"setQuery",
"(",
"query",
")",
";",
"searcher",
".",
"setQuery",
"(",
"newQuery",
")",
".",
"search",
"(",
")",... | Triggers a new search with the given text.
@param query the text to search for. | [
"Triggers",
"a",
"new",
"search",
"with",
"the",
"given",
"text",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java#L176-L179 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java | InstantSearch.registerFilters | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void registerFilters(List<AlgoliaFilter> filters) {
for (final AlgoliaFilter filter : filters) {
searcher.addFacet(filter.getAttribute());
}
} | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void registerFilters(List<AlgoliaFilter> filters) {
for (final AlgoliaFilter filter : filters) {
searcher.addFacet(filter.getAttribute());
}
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"void",
"registerFilters",
"(",
"List",
"<",
"AlgoliaFilter",
">",
"filters",
")",
"{",
"for",
"(",
"final",
"AlgoliaFilter",
"filter",
":",
"fi... | Registers your facet filters, adding them to this InstantSearch's widgets.
@param filters a List of facet filters. | [
"Registers",
"your",
"facet",
"filters",
"adding",
"them",
"to",
"this",
"InstantSearch",
"s",
"widgets",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java#L324-L329 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java | InstantSearch.registerWidget | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void registerWidget(View widget) {
prepareWidget(widget);
if (widget instanceof AlgoliaResultsListener) {
AlgoliaResultsListener listener = (AlgoliaResultsListener) widget;
if (!this.resultListeners.co... | java | @SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public void registerWidget(View widget) {
prepareWidget(widget);
if (widget instanceof AlgoliaResultsListener) {
AlgoliaResultsListener listener = (AlgoliaResultsListener) widget;
if (!this.resultListeners.co... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"void",
"registerWidget",
"(",
"View",
"widget",
")",
"{",
"prepareWidget",
"(",
"widget",
")",
";",
"if",
"(",
"widget",
"instanceof",
"Algolia... | Links the given widget to InstantSearch according to the interfaces it implements.
@param widget a widget implementing ({@link AlgoliaResultsListener} || {@link AlgoliaErrorListener} || {@link AlgoliaSearcherListener}). | [
"Links",
"the",
"given",
"widget",
"to",
"InstantSearch",
"according",
"to",
"the",
"interfaces",
"it",
"implements",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java#L365-L387 | train |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java | InstantSearch.processAllListeners | private List<String> processAllListeners(View rootView) {
List<String> refinementAttributes = new ArrayList<>();
// Register any AlgoliaResultsListener (unless it has a different variant than searcher)
final List<AlgoliaResultsListener> resultListeners = LayoutViews.findByClass((ViewGroup) root... | java | private List<String> processAllListeners(View rootView) {
List<String> refinementAttributes = new ArrayList<>();
// Register any AlgoliaResultsListener (unless it has a different variant than searcher)
final List<AlgoliaResultsListener> resultListeners = LayoutViews.findByClass((ViewGroup) root... | [
"private",
"List",
"<",
"String",
">",
"processAllListeners",
"(",
"View",
"rootView",
")",
"{",
"List",
"<",
"String",
">",
"refinementAttributes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Register any AlgoliaResultsListener (unless it has a different variant ... | Finds and sets up the Listeners in the given rootView.
@param rootView a View to traverse looking for listeners.
@return the list of refinement attributes found on listeners. | [
"Finds",
"and",
"sets",
"up",
"the",
"Listeners",
"in",
"the",
"given",
"rootView",
"."
] | 12092ec30140df9ffc2bf916339b433372034616 | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/helpers/InstantSearch.java#L395-L438 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/urswolfer/gerrit/client/rest/http/accounts/AccountsRestClient.java | AccountsRestClient.suggestAccounts | @Override
public SuggestAccountsRequest suggestAccounts() throws RestApiException {
return new SuggestAccountsRequest() {
@Override
public List<AccountInfo> get() throws RestApiException {
return AccountsRestClient.this.suggestAccounts(this);
}
};
... | java | @Override
public SuggestAccountsRequest suggestAccounts() throws RestApiException {
return new SuggestAccountsRequest() {
@Override
public List<AccountInfo> get() throws RestApiException {
return AccountsRestClient.this.suggestAccounts(this);
}
};
... | [
"@",
"Override",
"public",
"SuggestAccountsRequest",
"suggestAccounts",
"(",
")",
"throws",
"RestApiException",
"{",
"return",
"new",
"SuggestAccountsRequest",
"(",
")",
"{",
"@",
"Override",
"public",
"List",
"<",
"AccountInfo",
">",
"get",
"(",
")",
"throws",
... | Added in Gerrit 2.11. | [
"Added",
"in",
"Gerrit",
"2",
".",
"11",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/urswolfer/gerrit/client/rest/http/accounts/AccountsRestClient.java#L60-L68 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/google/gerrit/extensions/restapi/Url.java | Url.encode | public static String encode(String component) {
if (component != null) {
try {
return URLEncoder.encode(component, UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("JVM must support UTF-8", e);
}
}
return null;
} | java | public static String encode(String component) {
if (component != null) {
try {
return URLEncoder.encode(component, UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("JVM must support UTF-8", e);
}
}
return null;
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"component",
")",
"{",
"if",
"(",
"component",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"component",
",",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"ca... | Encode a path segment, escaping characters not valid for a URL.
<p>The following characters are not escaped:
<ul>
<li>{@code a..z, A..Z, 0..9}
<li>{@code . - * _}
</ul>
<p>' ' (space) is encoded as '+'.
<p>All other characters (including '/') are converted to the triplet "%xy" where "xy" is the
hex representation o... | [
"Encode",
"a",
"path",
"segment",
"escaping",
"characters",
"not",
"valid",
"for",
"a",
"URL",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/google/gerrit/extensions/restapi/Url.java#L43-L52 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/urswolfer/gerrit/client/rest/http/GerritRestClient.java | GerritRestClient.getXsrfFromHtmlBody | private Optional<String> getXsrfFromHtmlBody(HttpResponse loginResponse) throws IOException {
Optional<Cookie> gerritAccountCookie = findGerritAccountCookie();
if (gerritAccountCookie.isPresent()) {
Matcher matcher = GERRIT_AUTH_PATTERN.matcher(EntityUtils.toString(loginResponse.getEntity(),... | java | private Optional<String> getXsrfFromHtmlBody(HttpResponse loginResponse) throws IOException {
Optional<Cookie> gerritAccountCookie = findGerritAccountCookie();
if (gerritAccountCookie.isPresent()) {
Matcher matcher = GERRIT_AUTH_PATTERN.matcher(EntityUtils.toString(loginResponse.getEntity(),... | [
"private",
"Optional",
"<",
"String",
">",
"getXsrfFromHtmlBody",
"(",
"HttpResponse",
"loginResponse",
")",
"throws",
"IOException",
"{",
"Optional",
"<",
"Cookie",
">",
"gerritAccountCookie",
"=",
"findGerritAccountCookie",
"(",
")",
";",
"if",
"(",
"gerritAccount... | In Gerrit < 2.12 the XSRF token was included in the start page HTML. | [
"In",
"Gerrit",
"<",
"2",
".",
"12",
"the",
"XSRF",
"token",
"was",
"included",
"in",
"the",
"start",
"page",
"HTML",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/urswolfer/gerrit/client/rest/http/GerritRestClient.java#L361-L370 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/urswolfer/gerrit/client/rest/http/GerritRestClient.java | GerritRestClient.getCredentialsProvider | private BasicCredentialsProvider getCredentialsProvider() {
return new BasicCredentialsProvider() {
private Set<AuthScope> authAlreadyTried = Sets.newHashSet();
@Override
public Credentials getCredentials(AuthScope authscope) {
if (authAlreadyTried.contains(a... | java | private BasicCredentialsProvider getCredentialsProvider() {
return new BasicCredentialsProvider() {
private Set<AuthScope> authAlreadyTried = Sets.newHashSet();
@Override
public Credentials getCredentials(AuthScope authscope) {
if (authAlreadyTried.contains(a... | [
"private",
"BasicCredentialsProvider",
"getCredentialsProvider",
"(",
")",
"{",
"return",
"new",
"BasicCredentialsProvider",
"(",
")",
"{",
"private",
"Set",
"<",
"AuthScope",
">",
"authAlreadyTried",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"@",
"Override",... | With this impl, it only returns the same credentials once. Otherwise it's possible that a loop will occur.
When server returns status code 401, the HTTP client provides the same credentials forever.
Since we create a new HTTP client for every request, we can handle it this way. | [
"With",
"this",
"impl",
"it",
"only",
"returns",
"the",
"same",
"credentials",
"once",
".",
"Otherwise",
"it",
"s",
"possible",
"that",
"a",
"loop",
"will",
"occur",
".",
"When",
"server",
"returns",
"status",
"code",
"401",
"the",
"HTTP",
"client",
"provi... | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/urswolfer/gerrit/client/rest/http/GerritRestClient.java#L429-L442 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/google/gerrit/extensions/restapi/BinaryResult.java | BinaryResult.asString | public String asString() throws IOException {
long len = getContentLength();
ByteArrayOutputStream buf;
if (0 < len) {
buf = new ByteArrayOutputStream((int) len);
} else {
buf = new ByteArrayOutputStream();
}
writeTo(buf);
return decode(buf.toByteArray(), getCharacterEncoding());... | java | public String asString() throws IOException {
long len = getContentLength();
ByteArrayOutputStream buf;
if (0 < len) {
buf = new ByteArrayOutputStream((int) len);
} else {
buf = new ByteArrayOutputStream();
}
writeTo(buf);
return decode(buf.toByteArray(), getCharacterEncoding());... | [
"public",
"String",
"asString",
"(",
")",
"throws",
"IOException",
"{",
"long",
"len",
"=",
"getContentLength",
"(",
")",
";",
"ByteArrayOutputStream",
"buf",
";",
"if",
"(",
"0",
"<",
"len",
")",
"{",
"buf",
"=",
"new",
"ByteArrayOutputStream",
"(",
"(",
... | Return a copy of the result as a String.
<p>The default version of this method copies the result into a temporary byte array and then
tries to decode it using the configured encoding.
@return string version of the result.
@throws IOException if the data cannot be produced or could not be decoded to a String. | [
"Return",
"a",
"copy",
"of",
"the",
"result",
"as",
"a",
"String",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/google/gerrit/extensions/restapi/BinaryResult.java#L154-L164 | train |
uwolfer/gerrit-rest-java-client | src/main/java/com/urswolfer/gerrit/client/rest/http/PreemptiveAuthHttpRequestInterceptor.java | PreemptiveAuthHttpRequestInterceptor.isForGerritHost | private boolean isForGerritHost(HttpRequest request) {
if (!(request instanceof HttpRequestWrapper)) return false;
HttpRequest originalRequest = ((HttpRequestWrapper) request).getOriginal();
if (!(originalRequest instanceof HttpRequestBase)) return false;
URI uri = ((HttpRequestBase) ori... | java | private boolean isForGerritHost(HttpRequest request) {
if (!(request instanceof HttpRequestWrapper)) return false;
HttpRequest originalRequest = ((HttpRequestWrapper) request).getOriginal();
if (!(originalRequest instanceof HttpRequestBase)) return false;
URI uri = ((HttpRequestBase) ori... | [
"private",
"boolean",
"isForGerritHost",
"(",
"HttpRequest",
"request",
")",
"{",
"if",
"(",
"!",
"(",
"request",
"instanceof",
"HttpRequestWrapper",
")",
")",
"return",
"false",
";",
"HttpRequest",
"originalRequest",
"=",
"(",
"(",
"HttpRequestWrapper",
")",
"r... | Checks if request is intended for Gerrit host. | [
"Checks",
"if",
"request",
"is",
"intended",
"for",
"Gerrit",
"host",
"."
] | fa66cd76270cd12cff9e30e0d96826fe0253d209 | https://github.com/uwolfer/gerrit-rest-java-client/blob/fa66cd76270cd12cff9e30e0d96826fe0253d209/src/main/java/com/urswolfer/gerrit/client/rest/http/PreemptiveAuthHttpRequestInterceptor.java#L54-L64 | train |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java | FileUtils.getRelativePathName | public static String getRelativePathName(Path root, Path path) {
Path relative = root.relativize(path);
return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
} | java | public static String getRelativePathName(Path root, Path path) {
Path relative = root.relativize(path);
return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
} | [
"public",
"static",
"String",
"getRelativePathName",
"(",
"Path",
"root",
",",
"Path",
"path",
")",
"{",
"Path",
"relative",
"=",
"root",
".",
"relativize",
"(",
"path",
")",
";",
"return",
"Files",
".",
"isDirectory",
"(",
"path",
")",
"&&",
"!",
"relat... | Get the relative path of an application
@param root the root to relativize against
@param path the path to relativize
@return the relative path | [
"Get",
"the",
"relative",
"path",
"of",
"an",
"application"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/FileUtils.java#L108-L111 | train |
cloudfoundry/cf-java-client | cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/_DefaultConnectionContext.java | _DefaultConnectionContext.dispose | @PreDestroy
public final void dispose() {
getConnectionPool().ifPresent(PoolResources::dispose);
getThreadPool().dispose();
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
... | java | @PreDestroy
public final void dispose() {
getConnectionPool().ifPresent(PoolResources::dispose);
getThreadPool().dispose();
try {
ObjectName name = getByteBufAllocatorObjectName();
if (ManagementFactory.getPlatformMBeanServer().isRegistered(name)) {
... | [
"@",
"PreDestroy",
"public",
"final",
"void",
"dispose",
"(",
")",
"{",
"getConnectionPool",
"(",
")",
".",
"ifPresent",
"(",
"PoolResources",
"::",
"dispose",
")",
";",
"getThreadPool",
"(",
")",
".",
"dispose",
"(",
")",
";",
"try",
"{",
"ObjectName",
... | Disposes resources created to service this connection context | [
"Disposes",
"resources",
"created",
"to",
"service",
"this",
"connection",
"context"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/_DefaultConnectionContext.java#L70-L84 | train |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java | ResourceUtils.getEntity | public static <T, R extends Resource<T>> T getEntity(R resource) {
return resource.getEntity();
} | java | public static <T, R extends Resource<T>> T getEntity(R resource) {
return resource.getEntity();
} | [
"public",
"static",
"<",
"T",
",",
"R",
"extends",
"Resource",
"<",
"T",
">",
">",
"T",
"getEntity",
"(",
"R",
"resource",
")",
"{",
"return",
"resource",
".",
"getEntity",
"(",
")",
";",
"}"
] | Return the entity of a resource
@param resource the resource
@param <T> the type of the resource's entity
@param <R> the resource type
@return the resource's entity | [
"Return",
"the",
"entity",
"of",
"a",
"resource"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java#L39-L41 | train |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java | ResourceUtils.getResources | public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {
return Flux.fromIterable(response.getResources());
} | java | public static <R extends Resource<?>, U extends PaginatedResponse<R>> Flux<R> getResources(U response) {
return Flux.fromIterable(response.getResources());
} | [
"public",
"static",
"<",
"R",
"extends",
"Resource",
"<",
"?",
">",
",",
"U",
"extends",
"PaginatedResponse",
"<",
"R",
">",
">",
"Flux",
"<",
"R",
">",
"getResources",
"(",
"U",
"response",
")",
"{",
"return",
"Flux",
".",
"fromIterable",
"(",
"respon... | Return a stream of resources from a response
@param response the response
@param <R> the resource type
@param <U> the response type
@return a stream of resources from the response | [
"Return",
"a",
"stream",
"of",
"resources",
"from",
"a",
"response"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/ResourceUtils.java#L61-L63 | train |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/JobUtils.java | JobUtils.waitForCompletion | public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, String jobId) {
return requestJobV3(cloudFoundryClient, jobId)
.filter(job -> JobState.PROCESSING != job.getState())
.repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Du... | java | public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, String jobId) {
return requestJobV3(cloudFoundryClient, jobId)
.filter(job -> JobState.PROCESSING != job.getState())
.repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Du... | [
"public",
"static",
"Mono",
"<",
"Void",
">",
"waitForCompletion",
"(",
"CloudFoundryClient",
"cloudFoundryClient",
",",
"Duration",
"completionTimeout",
",",
"String",
"jobId",
")",
"{",
"return",
"requestJobV3",
"(",
"cloudFoundryClient",
",",
"jobId",
")",
".",
... | Waits for a job V3 to complete
@param cloudFoundryClient the client to use to request job status
@param completionTimeout the amount of time to wait for the job to complete.
@param jobId the id of the job
@return {@code onComplete} once job has completed | [
"Waits",
"for",
"a",
"job",
"V3",
"to",
"complete"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/JobUtils.java#L93-L99 | train |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/TimeUtils.java | TimeUtils.asTime | public static String asTime(long time) {
if (time > HOUR) {
return String.format("%.1f h", (time / HOUR));
} else if (time > MINUTE) {
return String.format("%.1f m", (time / MINUTE));
} else if (time > SECOND) {
return String.format("%.1f s", (time / SECOND));... | java | public static String asTime(long time) {
if (time > HOUR) {
return String.format("%.1f h", (time / HOUR));
} else if (time > MINUTE) {
return String.format("%.1f m", (time / MINUTE));
} else if (time > SECOND) {
return String.format("%.1f s", (time / SECOND));... | [
"public",
"static",
"String",
"asTime",
"(",
"long",
"time",
")",
"{",
"if",
"(",
"time",
">",
"HOUR",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%.1f h\"",
",",
"(",
"time",
"/",
"HOUR",
")",
")",
";",
"}",
"else",
"if",
"(",
"time",
"... | Renders a time period in human readable form
@param time the time in milliseconds
@return the time in human readable form | [
"Renders",
"a",
"time",
"period",
"in",
"human",
"readable",
"form"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/TimeUtils.java#L41-L51 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/View.java | View.buildMatcher | private ClassMatcher buildMatcher(String tagText) {
// check there are at least @match <type> and a parameter
String[] strings = StringUtil.tokenize(tagText);
if (strings.length < 2) {
System.err.println("Skipping uncomplete @match tag, type missing: " + tagText + " in view " + viewDoc);
return null;
}
... | java | private ClassMatcher buildMatcher(String tagText) {
// check there are at least @match <type> and a parameter
String[] strings = StringUtil.tokenize(tagText);
if (strings.length < 2) {
System.err.println("Skipping uncomplete @match tag, type missing: " + tagText + " in view " + viewDoc);
return null;
}
... | [
"private",
"ClassMatcher",
"buildMatcher",
"(",
"String",
"tagText",
")",
"{",
"// check there are at least @match <type> and a parameter",
"String",
"[",
"]",
"strings",
"=",
"StringUtil",
".",
"tokenize",
"(",
"tagText",
")",
";",
"if",
"(",
"strings",
".",
"lengt... | Factory method that builds the appropriate matcher for @match tags | [
"Factory",
"method",
"that",
"builds",
"the",
"appropriate",
"matcher",
"for"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/View.java#L85-L118 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ContextMatcher.java | ContextMatcher.addToGraph | private void addToGraph(ClassDoc cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString()))
return;
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
... | java | private void addToGraph(ClassDoc cd) {
// avoid adding twice the same class, but don't rely on cg.getClassInfo
// since there are other ways to add a classInfor than printing the class
if (visited.contains(cd.toString()))
return;
visited.add(cd.toString());
cg.printClass(cd, false);
cg.printRelations(cd);
... | [
"private",
"void",
"addToGraph",
"(",
"ClassDoc",
"cd",
")",
"{",
"// avoid adding twice the same class, but don't rely on cg.getClassInfo",
"// since there are other ways to add a classInfor than printing the class",
"if",
"(",
"visited",
".",
"contains",
"(",
"cd",
".",
"toStri... | Adds the specified class to the internal class graph along with its
relations and dependencies, eventually inferring them, according to the
Options specified for this matcher
@param cd | [
"Adds",
"the",
"specified",
"class",
"to",
"the",
"internal",
"class",
"graph",
"along",
"with",
"its",
"relations",
"and",
"dependencies",
"eventually",
"inferring",
"them",
"according",
"to",
"the",
"Options",
"specified",
"for",
"this",
"matcher"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ContextMatcher.java#L104-L117 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.optionLength | public static int optionLength(String option) {
int result = Standard.optionLength(option);
if (result != 0)
return result;
else
return UmlGraph.optionLength(option);
} | java | public static int optionLength(String option) {
int result = Standard.optionLength(option);
if (result != 0)
return result;
else
return UmlGraph.optionLength(option);
} | [
"public",
"static",
"int",
"optionLength",
"(",
"String",
"option",
")",
"{",
"int",
"result",
"=",
"Standard",
".",
"optionLength",
"(",
"option",
")",
";",
"if",
"(",
"result",
"!=",
"0",
")",
"return",
"result",
";",
"else",
"return",
"UmlGraph",
".",... | Option check, forwards options to the standard doclet, if that one refuses them,
they are sent to UmlGraph | [
"Option",
"check",
"forwards",
"options",
"to",
"the",
"standard",
"doclet",
"if",
"that",
"one",
"refuses",
"them",
"they",
"are",
"sent",
"to",
"UmlGraph"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L36-L42 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.start | public static boolean start(RootDoc root) {
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", running the standard doclet");
Standard.start(root);
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", altering javadocs");
try {
String outputFolder = findOutputPath(root.options());
... | java | public static boolean start(RootDoc root) {
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", running the standard doclet");
Standard.start(root);
root.printNotice("UmlGraphDoc version " + Version.VERSION + ", altering javadocs");
try {
String outputFolder = findOutputPath(root.options());
... | [
"public",
"static",
"boolean",
"start",
"(",
"RootDoc",
"root",
")",
"{",
"root",
".",
"printNotice",
"(",
"\"UmlGraphDoc version \"",
"+",
"Version",
".",
"VERSION",
"+",
"\", running the standard doclet\"",
")",
";",
"Standard",
".",
"start",
"(",
"root",
")",... | Standard doclet entry point
@param root
@return | [
"Standard",
"doclet",
"entry",
"point"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L49-L73 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.generateContextDiagrams | private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
Set<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {
public int compare(ClassDoc cd1, ClassDoc cd2) {
return cd1.name().compareTo(cd2.name());... | java | private static void generateContextDiagrams(RootDoc root, Options opt, String outputFolder)
throws IOException {
Set<ClassDoc> classDocs = new TreeSet<ClassDoc>(new Comparator<ClassDoc>() {
public int compare(ClassDoc cd1, ClassDoc cd2) {
return cd1.name().compareTo(cd2.name());... | [
"private",
"static",
"void",
"generateContextDiagrams",
"(",
"RootDoc",
"root",
",",
"Options",
"opt",
",",
"String",
"outputFolder",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"ClassDoc",
">",
"classDocs",
"=",
"new",
"TreeSet",
"<",
"ClassDoc",
">",
"(",... | Generates the context diagram for a single class | [
"Generates",
"the",
"context",
"diagram",
"for",
"a",
"single",
"class"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L106-L131 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.alterHtmlDocs | private static void alterHtmlDocs(Options opt, String outputFolder, String packageName, String className,
String htmlFileName, Pattern insertPointPattern, RootDoc root) throws IOException {
// setup files
File output = new File(outputFolder, packageName.replace(".", "/"));
File htmlFile = new File(output, htmlF... | java | private static void alterHtmlDocs(Options opt, String outputFolder, String packageName, String className,
String htmlFileName, Pattern insertPointPattern, RootDoc root) throws IOException {
// setup files
File output = new File(outputFolder, packageName.replace(".", "/"));
File htmlFile = new File(output, htmlF... | [
"private",
"static",
"void",
"alterHtmlDocs",
"(",
"Options",
"opt",
",",
"String",
"outputFolder",
",",
"String",
"packageName",
",",
"String",
"className",
",",
"String",
"htmlFileName",
",",
"Pattern",
"insertPointPattern",
",",
"RootDoc",
"root",
")",
"throws"... | Takes an HTML file, looks for the first instance of the specified insertion point, and
inserts the diagram image reference and a client side map in that point. | [
"Takes",
"an",
"HTML",
"file",
"looks",
"for",
"the",
"first",
"instance",
"of",
"the",
"specified",
"insertion",
"point",
"and",
"inserts",
"the",
"diagram",
"image",
"reference",
"and",
"a",
"client",
"side",
"map",
"in",
"that",
"point",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L199-L258 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/UmlGraphDoc.java | UmlGraphDoc.findOutputPath | private static String findOutputPath(String[][] options) {
for (int i = 0; i < options.length; i++) {
if (options[i][0].equals("-d"))
return options[i][1];
}
return ".";
} | java | private static String findOutputPath(String[][] options) {
for (int i = 0; i < options.length; i++) {
if (options[i][0].equals("-d"))
return options[i][1];
}
return ".";
} | [
"private",
"static",
"String",
"findOutputPath",
"(",
"String",
"[",
"]",
"[",
"]",
"options",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"options",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"options",
"[",
"i",
"]",
"... | Returns the output path specified on the javadoc options | [
"Returns",
"the",
"output",
"path",
"specified",
"on",
"the",
"javadoc",
"options"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/UmlGraphDoc.java#L263-L269 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.setAll | public void setAll() {
showAttributes = true;
showEnumerations = true;
showEnumConstants = true;
showOperations = true;
showConstructors = true;
showVisibility = true;
showType = true;
} | java | public void setAll() {
showAttributes = true;
showEnumerations = true;
showEnumConstants = true;
showOperations = true;
showConstructors = true;
showVisibility = true;
showType = true;
} | [
"public",
"void",
"setAll",
"(",
")",
"{",
"showAttributes",
"=",
"true",
";",
"showEnumerations",
"=",
"true",
";",
"showEnumConstants",
"=",
"true",
";",
"showOperations",
"=",
"true",
";",
"showConstructors",
"=",
"true",
";",
"showVisibility",
"=",
"true",... | Most complete output | [
"Most",
"complete",
"output"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L149-L157 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.optionLength | public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
... | java | public static int optionLength(String option) {
if(matchOption(option, "qualify", true) ||
matchOption(option, "qualifyGenerics", true) ||
matchOption(option, "hideGenerics", true) ||
matchOption(option, "horizontal", true) ||
matchOption(option, "all") ||
... | [
"public",
"static",
"int",
"optionLength",
"(",
"String",
"option",
")",
"{",
"if",
"(",
"matchOption",
"(",
"option",
",",
"\"qualify\"",
",",
"true",
")",
"||",
"matchOption",
"(",
"option",
",",
"\"qualifyGenerics\"",
",",
"true",
")",
"||",
"matchOption"... | Return the number of arguments associated with the specified option.
The return value includes the actual option.
Will return 0 if the option is not supported. | [
"Return",
"the",
"number",
"of",
"arguments",
"associated",
"with",
"the",
"specified",
"option",
".",
"The",
"return",
"value",
"includes",
"the",
"actual",
"option",
".",
"Will",
"return",
"0",
"if",
"the",
"option",
"is",
"not",
"supported",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L192-L257 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.addApiDocRoots | private void addApiDocRoots(String packageListUrl) {
BufferedReader br = null;
packageListUrl = fixApiDocRoot(packageListUrl);
try {
URL url = new URL(packageListUrl + "/package-list");
br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while((line = br.readLine()) != ... | java | private void addApiDocRoots(String packageListUrl) {
BufferedReader br = null;
packageListUrl = fixApiDocRoot(packageListUrl);
try {
URL url = new URL(packageListUrl + "/package-list");
br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while((line = br.readLine()) != ... | [
"private",
"void",
"addApiDocRoots",
"(",
"String",
"packageListUrl",
")",
"{",
"BufferedReader",
"br",
"=",
"null",
";",
"packageListUrl",
"=",
"fixApiDocRoot",
"(",
"packageListUrl",
")",
";",
"try",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"packageListUrl... | Adds api doc roots from a link. The folder reffered by the link should contain a package-list
file that will be parsed in order to add api doc roots to this configuration
@param packageListUrl | [
"Adds",
"api",
"doc",
"roots",
"from",
"a",
"link",
".",
"The",
"folder",
"reffered",
"by",
"the",
"link",
"should",
"contain",
"a",
"package",
"-",
"list",
"file",
"that",
"will",
"be",
"parsed",
"in",
"order",
"to",
"add",
"api",
"doc",
"roots",
"to"... | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L459-L481 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.fixApiDocRoot | private String fixApiDocRoot(String str) {
if (str == null)
return null;
String fixed = str.trim();
if (fixed.isEmpty())
return "";
if (File.separatorChar != '/')
fixed = fixed.replace(File.separatorChar, '/');
if (!fixed.endsWith("/"))
fixed = fixed + "/";
return fixed;
} | java | private String fixApiDocRoot(String str) {
if (str == null)
return null;
String fixed = str.trim();
if (fixed.isEmpty())
return "";
if (File.separatorChar != '/')
fixed = fixed.replace(File.separatorChar, '/');
if (!fixed.endsWith("/"))
fixed = fixed + "/";
return fixed;
} | [
"private",
"String",
"fixApiDocRoot",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"return",
"null",
";",
"String",
"fixed",
"=",
"str",
".",
"trim",
"(",
")",
";",
"if",
"(",
"fixed",
".",
"isEmpty",
"(",
")",
")",
"return"... | Trim and append a file separator to the string | [
"Trim",
"and",
"append",
"a",
"file",
"separator",
"to",
"the",
"string"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L564-L575 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/Options.java | Options.setOptions | public void setOptions(Doc p) {
if (p == null)
return;
for (Tag tag : p.tags("opt"))
setOption(StringUtil.tokenize(tag.text()));
}
/**
* Check if the supplied string matches an entity specified
* with the -hide parameter.
* @return true if the string matches.
*/
public bool... | java | public void setOptions(Doc p) {
if (p == null)
return;
for (Tag tag : p.tags("opt"))
setOption(StringUtil.tokenize(tag.text()));
}
/**
* Check if the supplied string matches an entity specified
* with the -hide parameter.
* @return true if the string matches.
*/
public bool... | [
"public",
"void",
"setOptions",
"(",
"Doc",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"return",
";",
"for",
"(",
"Tag",
"tag",
":",
"p",
".",
"tags",
"(",
"\"opt\"",
")",
")",
"setOption",
"(",
"StringUtil",
".",
"tokenize",
"(",
"tag",
"... | Set the options based on the tag elements of the ClassDoc parameter | [
"Set",
"the",
"options",
"based",
"on",
"the",
"tag",
"elements",
"of",
"the",
"ClassDoc",
"parameter"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/Options.java#L585-L659 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/RelationPattern.java | RelationPattern.addRelation | public void addRelation(RelationType relationType, RelationDirection direction) {
int idx = relationType.ordinal();
directions[idx] = directions[idx].sum(direction);
} | java | public void addRelation(RelationType relationType, RelationDirection direction) {
int idx = relationType.ordinal();
directions[idx] = directions[idx].sum(direction);
} | [
"public",
"void",
"addRelation",
"(",
"RelationType",
"relationType",
",",
"RelationDirection",
"direction",
")",
"{",
"int",
"idx",
"=",
"relationType",
".",
"ordinal",
"(",
")",
";",
"directions",
"[",
"idx",
"]",
"=",
"directions",
"[",
"idx",
"]",
".",
... | Adds, eventually merging, a direction for the specified relation type
@param relationType
@param direction | [
"Adds",
"eventually",
"merging",
"a",
"direction",
"for",
"the",
"specified",
"relation",
"type"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/RelationPattern.java#L30-L33 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.qualifiedName | private static String qualifiedName(Options opt, String r) {
if (opt.hideGenerics)
r = removeTemplate(r);
// Fast path - nothing to do:
if (opt.showQualified && (opt.showQualifiedGenerics || r.indexOf('<') < 0))
return r;
StringBuilder buf = new StringBuilder(r.length());
qualifiedNameInner(opt, r, buf, ... | java | private static String qualifiedName(Options opt, String r) {
if (opt.hideGenerics)
r = removeTemplate(r);
// Fast path - nothing to do:
if (opt.showQualified && (opt.showQualifiedGenerics || r.indexOf('<') < 0))
return r;
StringBuilder buf = new StringBuilder(r.length());
qualifiedNameInner(opt, r, buf, ... | [
"private",
"static",
"String",
"qualifiedName",
"(",
"Options",
"opt",
",",
"String",
"r",
")",
"{",
"if",
"(",
"opt",
".",
"hideGenerics",
")",
"r",
"=",
"removeTemplate",
"(",
"r",
")",
";",
"// Fast path - nothing to do:",
"if",
"(",
"opt",
".",
"showQu... | Return the class's name, possibly by stripping the leading path | [
"Return",
"the",
"class",
"s",
"name",
"possibly",
"by",
"stripping",
"the",
"leading",
"path"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L136-L145 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.visibility | private String visibility(Options opt, ProgramElementDoc e) {
return opt.showVisibility ? Visibility.get(e).symbol : " ";
} | java | private String visibility(Options opt, ProgramElementDoc e) {
return opt.showVisibility ? Visibility.get(e).symbol : " ";
} | [
"private",
"String",
"visibility",
"(",
"Options",
"opt",
",",
"ProgramElementDoc",
"e",
")",
"{",
"return",
"opt",
".",
"showVisibility",
"?",
"Visibility",
".",
"get",
"(",
"e",
")",
".",
"symbol",
":",
"\" \"",
";",
"}"
] | Print the visibility adornment of element e prefixed by
any stereotypes | [
"Print",
"the",
"visibility",
"adornment",
"of",
"element",
"e",
"prefixed",
"by",
"any",
"stereotypes"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L177-L179 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.parameter | private String parameter(Options opt, Parameter p[]) {
StringBuilder par = new StringBuilder(1000);
for (int i = 0; i < p.length; i++) {
par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
if (i + 1 < p.length)
par.append(", ");
}
return par.toString();
} | java | private String parameter(Options opt, Parameter p[]) {
StringBuilder par = new StringBuilder(1000);
for (int i = 0; i < p.length; i++) {
par.append(p[i].name() + typeAnnotation(opt, p[i].type()));
if (i + 1 < p.length)
par.append(", ");
}
return par.toString();
} | [
"private",
"String",
"parameter",
"(",
"Options",
"opt",
",",
"Parameter",
"p",
"[",
"]",
")",
"{",
"StringBuilder",
"par",
"=",
"new",
"StringBuilder",
"(",
"1000",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"p",
".",
"length",
";"... | Print the method parameter p | [
"Print",
"the",
"method",
"parameter",
"p"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L182-L190 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.type | private String type(Options opt, Type t, boolean generics) {
return ((generics ? opt.showQualifiedGenerics : opt.showQualified) ? //
t.qualifiedTypeName() : t.typeName()) //
+ (opt.hideGenerics ? "" : typeParameters(opt, t.asParameterizedType()));
} | java | private String type(Options opt, Type t, boolean generics) {
return ((generics ? opt.showQualifiedGenerics : opt.showQualified) ? //
t.qualifiedTypeName() : t.typeName()) //
+ (opt.hideGenerics ? "" : typeParameters(opt, t.asParameterizedType()));
} | [
"private",
"String",
"type",
"(",
"Options",
"opt",
",",
"Type",
"t",
",",
"boolean",
"generics",
")",
"{",
"return",
"(",
"(",
"generics",
"?",
"opt",
".",
"showQualifiedGenerics",
":",
"opt",
".",
"showQualified",
")",
"?",
"//",
"t",
".",
"qualifiedTy... | Print a a basic type t | [
"Print",
"a",
"a",
"basic",
"type",
"t"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L193-L197 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.typeParameters | private String typeParameters(Options opt, ParameterizedType t) {
if (t == null)
return "";
StringBuffer tp = new StringBuffer(1000).append("<");
Type args[] = t.typeArguments();
for (int i = 0; i < args.length; i++) {
tp.append(type(opt, args[i], true));
if (i != args.length - 1)
tp.append(", "... | java | private String typeParameters(Options opt, ParameterizedType t) {
if (t == null)
return "";
StringBuffer tp = new StringBuffer(1000).append("<");
Type args[] = t.typeArguments();
for (int i = 0; i < args.length; i++) {
tp.append(type(opt, args[i], true));
if (i != args.length - 1)
tp.append(", "... | [
"private",
"String",
"typeParameters",
"(",
"Options",
"opt",
",",
"ParameterizedType",
"t",
")",
"{",
"if",
"(",
"t",
"==",
"null",
")",
"return",
"\"\"",
";",
"StringBuffer",
"tp",
"=",
"new",
"StringBuffer",
"(",
"1000",
")",
".",
"append",
"(",
"\"&l... | Print the parameters of the parameterized type t | [
"Print",
"the",
"parameters",
"of",
"the",
"parameterized",
"type",
"t"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L200-L211 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.attributes | private void attributes(Options opt, FieldDoc fd[]) {
for (FieldDoc f : fd) {
if (hidden(f))
continue;
stereotype(opt, f, Align.LEFT);
String att = visibility(opt, f) + f.name();
if (opt.showType)
att += typeAnnotation(opt, f.type());
tableLine(Align.LEFT, att);
tagvalue(opt, f);
}
... | java | private void attributes(Options opt, FieldDoc fd[]) {
for (FieldDoc f : fd) {
if (hidden(f))
continue;
stereotype(opt, f, Align.LEFT);
String att = visibility(opt, f) + f.name();
if (opt.showType)
att += typeAnnotation(opt, f.type());
tableLine(Align.LEFT, att);
tagvalue(opt, f);
}
... | [
"private",
"void",
"attributes",
"(",
"Options",
"opt",
",",
"FieldDoc",
"fd",
"[",
"]",
")",
"{",
"for",
"(",
"FieldDoc",
"f",
":",
"fd",
")",
"{",
"if",
"(",
"hidden",
"(",
"f",
")",
")",
"continue",
";",
"stereotype",
"(",
"opt",
",",
"f",
","... | Print the class's attributes fd | [
"Print",
"the",
"class",
"s",
"attributes",
"fd"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L221-L232 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.operations | private boolean operations(Options opt, ConstructorDoc m[]) {
boolean printed = false;
for (ConstructorDoc cd : m) {
if (hidden(cd))
continue;
stereotype(opt, cd, Align.LEFT);
String cs = visibility(opt, cd) + cd.name() //
+ (opt.showType ? "(" + parameter(opt, cd.parameters()) + ")" : "()");
... | java | private boolean operations(Options opt, ConstructorDoc m[]) {
boolean printed = false;
for (ConstructorDoc cd : m) {
if (hidden(cd))
continue;
stereotype(opt, cd, Align.LEFT);
String cs = visibility(opt, cd) + cd.name() //
+ (opt.showType ? "(" + parameter(opt, cd.parameters()) + ")" : "()");
... | [
"private",
"boolean",
"operations",
"(",
"Options",
"opt",
",",
"ConstructorDoc",
"m",
"[",
"]",
")",
"{",
"boolean",
"printed",
"=",
"false",
";",
"for",
"(",
"ConstructorDoc",
"cd",
":",
"m",
")",
"{",
"if",
"(",
"hidden",
"(",
"cd",
")",
")",
"con... | Print the class's constructors m | [
"Print",
"the",
"class",
"s",
"constructors",
"m"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L241-L254 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.operations | private boolean operations(Options opt, MethodDoc m[]) {
boolean printed = false;
for (MethodDoc md : m) {
if (hidden(md))
continue;
// Filter-out static initializer method
if (md.name().equals("<clinit>") && md.isStatic() && md.isPackagePrivate())
continue;
stereotype(opt, md, Align.LEFT);
... | java | private boolean operations(Options opt, MethodDoc m[]) {
boolean printed = false;
for (MethodDoc md : m) {
if (hidden(md))
continue;
// Filter-out static initializer method
if (md.name().equals("<clinit>") && md.isStatic() && md.isPackagePrivate())
continue;
stereotype(opt, md, Align.LEFT);
... | [
"private",
"boolean",
"operations",
"(",
"Options",
"opt",
",",
"MethodDoc",
"m",
"[",
"]",
")",
"{",
"boolean",
"printed",
"=",
"false",
";",
"for",
"(",
"MethodDoc",
"md",
":",
"m",
")",
"{",
"if",
"(",
"hidden",
"(",
"md",
")",
")",
"continue",
... | Print the class's operations m | [
"Print",
"the",
"class",
"s",
"operations",
"m"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L257-L275 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.nodeProperties | private void nodeProperties(Options opt) {
Options def = opt.getGlobalOptions();
if (opt.nodeFontName != def.nodeFontName)
w.print(",fontname=\"" + opt.nodeFontName + "\"");
if (opt.nodeFontColor != def.nodeFontColor)
w.print(",fontcolor=\"" + opt.nodeFontColor + "\"");
if (opt.nodeFontSize != def.nodeFon... | java | private void nodeProperties(Options opt) {
Options def = opt.getGlobalOptions();
if (opt.nodeFontName != def.nodeFontName)
w.print(",fontname=\"" + opt.nodeFontName + "\"");
if (opt.nodeFontColor != def.nodeFontColor)
w.print(",fontcolor=\"" + opt.nodeFontColor + "\"");
if (opt.nodeFontSize != def.nodeFon... | [
"private",
"void",
"nodeProperties",
"(",
"Options",
"opt",
")",
"{",
"Options",
"def",
"=",
"opt",
".",
"getGlobalOptions",
"(",
")",
";",
"if",
"(",
"opt",
".",
"nodeFontName",
"!=",
"def",
".",
"nodeFontName",
")",
"w",
".",
"print",
"(",
"\",fontname... | Print the common class node's properties | [
"Print",
"the",
"common",
"class",
"node",
"s",
"properties"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L278-L288 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.tagvalue | private void tagvalue(Options opt, Doc c) {
Tag tags[] = c.tags("tagvalue");
if (tags.length == 0)
return;
for (Tag tag : tags) {
String t[] = tokenize(tag.text());
if (t.length != 2) {
System.err.println("@tagvalue expects two fields: " + tag.text());
continue;
}
tableLine(Align.RIGHT... | java | private void tagvalue(Options opt, Doc c) {
Tag tags[] = c.tags("tagvalue");
if (tags.length == 0)
return;
for (Tag tag : tags) {
String t[] = tokenize(tag.text());
if (t.length != 2) {
System.err.println("@tagvalue expects two fields: " + tag.text());
continue;
}
tableLine(Align.RIGHT... | [
"private",
"void",
"tagvalue",
"(",
"Options",
"opt",
",",
"Doc",
"c",
")",
"{",
"Tag",
"tags",
"[",
"]",
"=",
"c",
".",
"tags",
"(",
"\"tagvalue\"",
")",
";",
"if",
"(",
"tags",
".",
"length",
"==",
"0",
")",
"return",
";",
"for",
"(",
"Tag",
... | Return as a string the tagged values associated with c
@param opt the Options used to guess font names
@param c the Doc entry to look for @tagvalue
@param prevterm the termination string for the previous element
@param term the termination character for each tagged value | [
"Return",
"as",
"a",
"string",
"the",
"tagged",
"values",
"associated",
"with",
"c"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L297-L310 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.stereotype | private void stereotype(Options opt, Doc c, Align align) {
for (Tag tag : c.tags("stereotype")) {
String t[] = tokenize(tag.text());
if (t.length != 1) {
System.err.println("@stereotype expects one field: " + tag.text());
continue;
}
tableLine(align, guilWrap(opt, t[0]));
}
} | java | private void stereotype(Options opt, Doc c, Align align) {
for (Tag tag : c.tags("stereotype")) {
String t[] = tokenize(tag.text());
if (t.length != 1) {
System.err.println("@stereotype expects one field: " + tag.text());
continue;
}
tableLine(align, guilWrap(opt, t[0]));
}
} | [
"private",
"void",
"stereotype",
"(",
"Options",
"opt",
",",
"Doc",
"c",
",",
"Align",
"align",
")",
"{",
"for",
"(",
"Tag",
"tag",
":",
"c",
".",
"tags",
"(",
"\"stereotype\"",
")",
")",
"{",
"String",
"t",
"[",
"]",
"=",
"tokenize",
"(",
"tag",
... | Return as a string the stereotypes associated with c
terminated by the escape character term | [
"Return",
"as",
"a",
"string",
"the",
"stereotypes",
"associated",
"with",
"c",
"terminated",
"by",
"the",
"escape",
"character",
"term"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L316-L325 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.hidden | private boolean hidden(ProgramElementDoc c) {
if (c.tags("hidden").length > 0 || c.tags("view").length > 0)
return true;
Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass());
return opt.matchesHideExpression(c.toString()) //
|| (opt.hidePrivateInner && c insta... | java | private boolean hidden(ProgramElementDoc c) {
if (c.tags("hidden").length > 0 || c.tags("view").length > 0)
return true;
Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass());
return opt.matchesHideExpression(c.toString()) //
|| (opt.hidePrivateInner && c insta... | [
"private",
"boolean",
"hidden",
"(",
"ProgramElementDoc",
"c",
")",
"{",
"if",
"(",
"c",
".",
"tags",
"(",
"\"hidden\"",
")",
".",
"length",
">",
"0",
"||",
"c",
".",
"tags",
"(",
"\"view\"",
")",
".",
"length",
">",
"0",
")",
"return",
"true",
";"... | Return true if c has a @hidden tag associated with it | [
"Return",
"true",
"if",
"c",
"has",
"a"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L328-L334 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.hidden | private boolean hidden(String className) {
className = removeTemplate(className);
ClassInfo ci = classnames.get(className);
return ci != null ? ci.hidden : optionProvider.getOptionsFor(className).matchesHideExpression(className);
} | java | private boolean hidden(String className) {
className = removeTemplate(className);
ClassInfo ci = classnames.get(className);
return ci != null ? ci.hidden : optionProvider.getOptionsFor(className).matchesHideExpression(className);
} | [
"private",
"boolean",
"hidden",
"(",
"String",
"className",
")",
"{",
"className",
"=",
"removeTemplate",
"(",
"className",
")",
";",
"ClassInfo",
"ci",
"=",
"classnames",
".",
"get",
"(",
"className",
")",
";",
"return",
"ci",
"!=",
"null",
"?",
"ci",
"... | Return true if the class name is associated to an hidden class or matches a hide expression | [
"Return",
"true",
"if",
"the",
"class",
"name",
"is",
"associated",
"to",
"an",
"hidden",
"class",
"or",
"matches",
"a",
"hide",
"expression"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L356-L360 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.allRelation | private void allRelation(Options opt, RelationType rt, ClassDoc from) {
String tagname = rt.lower;
for (Tag tag : from.tags(tagname)) {
String t[] = tokenize(tag.text()); // l-src label l-dst target
t = t.length == 1 ? new String[] { "-", "-", "-", t[0] } : t; // Shorthand
if (t.length != 4) {
Sys... | java | private void allRelation(Options opt, RelationType rt, ClassDoc from) {
String tagname = rt.lower;
for (Tag tag : from.tags(tagname)) {
String t[] = tokenize(tag.text()); // l-src label l-dst target
t = t.length == 1 ? new String[] { "-", "-", "-", t[0] } : t; // Shorthand
if (t.length != 4) {
Sys... | [
"private",
"void",
"allRelation",
"(",
"Options",
"opt",
",",
"RelationType",
"rt",
",",
"ClassDoc",
"from",
")",
"{",
"String",
"tagname",
"=",
"rt",
".",
"lower",
";",
"for",
"(",
"Tag",
"tag",
":",
"from",
".",
"tags",
"(",
"tagname",
")",
")",
"{... | Print all relations for a given's class's tag
@param tagname the tag containing the given relation
@param from the source class
@param edgetype the dot edge specification | [
"Print",
"all",
"relations",
"for",
"a",
"given",
"s",
"class",
"s",
"tag"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L495-L515 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printRelations | public void printRelations(ClassDoc c) {
Options opt = optionProvider.getOptionsFor(c);
if (hidden(c) || c.name().equals("")) // avoid phantom classes, they may pop up when the source uses annotations
return;
// Print generalization (through the Java superclass)
Type s = c.superclassType();
ClassDoc sc = s !=... | java | public void printRelations(ClassDoc c) {
Options opt = optionProvider.getOptionsFor(c);
if (hidden(c) || c.name().equals("")) // avoid phantom classes, they may pop up when the source uses annotations
return;
// Print generalization (through the Java superclass)
Type s = c.superclassType();
ClassDoc sc = s !=... | [
"public",
"void",
"printRelations",
"(",
"ClassDoc",
"c",
")",
"{",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
";",
"if",
"(",
"hidden",
"(",
"c",
")",
"||",
"c",
".",
"name",
"(",
")",
".",
"equals",
"(",
"\"\"",
... | Print a class's relations | [
"Print",
"a",
"class",
"s",
"relations"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L573-L600 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printExtraClasses | public void printExtraClasses(RootDoc root) {
Set<String> names = new HashSet<String>(classnames.keySet());
for(String className: names) {
ClassInfo info = getClassInfo(className, true);
if (info.nodePrinted)
continue;
ClassDoc c = root.classNamed(className);
if(c != null) {
printClass(c, fal... | java | public void printExtraClasses(RootDoc root) {
Set<String> names = new HashSet<String>(classnames.keySet());
for(String className: names) {
ClassInfo info = getClassInfo(className, true);
if (info.nodePrinted)
continue;
ClassDoc c = root.classNamed(className);
if(c != null) {
printClass(c, fal... | [
"public",
"void",
"printExtraClasses",
"(",
"RootDoc",
"root",
")",
"{",
"Set",
"<",
"String",
">",
"names",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"classnames",
".",
"keySet",
"(",
")",
")",
";",
"for",
"(",
"String",
"className",
":",
"names... | Print classes that were parts of relationships, but not parsed by javadoc | [
"Print",
"classes",
"that",
"were",
"parts",
"of",
"relationships",
"but",
"not",
"parsed",
"by",
"javadoc"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L603-L639 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printInferredRelations | public void printInferredRelations(ClassDoc c) {
// check if the source is excluded from inference
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
for (FieldDoc field : c.fields(false)) {
if(hidden(field))
continue;
// skip statics
if(field.isStatic())
continue;
... | java | public void printInferredRelations(ClassDoc c) {
// check if the source is excluded from inference
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
for (FieldDoc field : c.fields(false)) {
if(hidden(field))
continue;
// skip statics
if(field.isStatic())
continue;
... | [
"public",
"void",
"printInferredRelations",
"(",
"ClassDoc",
"c",
")",
"{",
"// check if the source is excluded from inference",
"if",
"(",
"hidden",
"(",
"c",
")",
")",
"return",
";",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
... | Prints associations recovered from the fields of a class. An association is inferred only
if another relation between the two classes is not already in the graph.
@param classes | [
"Prints",
"associations",
"recovered",
"from",
"the",
"fields",
"of",
"a",
"class",
".",
"An",
"association",
"is",
"inferred",
"only",
"if",
"another",
"relation",
"between",
"the",
"two",
"classes",
"is",
"not",
"already",
"in",
"the",
"graph",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L646-L674 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.printInferredDependencies | public void printInferredDependencies(ClassDoc c) {
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
Set<Type> types = new HashSet<Type>();
// harvest method return and parameter types
for (MethodDoc method : filterByVisibility(c.methods(false), opt.inferDependencyVisibility)) {
typ... | java | public void printInferredDependencies(ClassDoc c) {
if (hidden(c))
return;
Options opt = optionProvider.getOptionsFor(c);
Set<Type> types = new HashSet<Type>();
// harvest method return and parameter types
for (MethodDoc method : filterByVisibility(c.methods(false), opt.inferDependencyVisibility)) {
typ... | [
"public",
"void",
"printInferredDependencies",
"(",
"ClassDoc",
"c",
")",
"{",
"if",
"(",
"hidden",
"(",
"c",
")",
")",
"return",
";",
"Options",
"opt",
"=",
"optionProvider",
".",
"getOptionsFor",
"(",
"c",
")",
";",
"Set",
"<",
"Type",
">",
"types",
... | Prints dependencies recovered from the methods of a class. A
dependency is inferred only if another relation between the two
classes is not already in the graph.
@param classes | [
"Prints",
"dependencies",
"recovered",
"from",
"the",
"methods",
"of",
"a",
"class",
".",
"A",
"dependency",
"is",
"inferred",
"only",
"if",
"another",
"relation",
"between",
"the",
"two",
"classes",
"is",
"not",
"already",
"in",
"the",
"graph",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L691-L751 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.filterByVisibility | private <T extends ProgramElementDoc> List<T> filterByVisibility(T[] docs, Visibility visibility) {
if (visibility == Visibility.PRIVATE)
return Arrays.asList(docs);
List<T> filtered = new ArrayList<T>();
for (T doc : docs) {
if (Visibility.get(doc).compareTo(visibility) > 0)
filtered.add(doc);
}
retu... | java | private <T extends ProgramElementDoc> List<T> filterByVisibility(T[] docs, Visibility visibility) {
if (visibility == Visibility.PRIVATE)
return Arrays.asList(docs);
List<T> filtered = new ArrayList<T>();
for (T doc : docs) {
if (Visibility.get(doc).compareTo(visibility) > 0)
filtered.add(doc);
}
retu... | [
"private",
"<",
"T",
"extends",
"ProgramElementDoc",
">",
"List",
"<",
"T",
">",
"filterByVisibility",
"(",
"T",
"[",
"]",
"docs",
",",
"Visibility",
"visibility",
")",
"{",
"if",
"(",
"visibility",
"==",
"Visibility",
".",
"PRIVATE",
")",
"return",
"Array... | Returns all program element docs that have a visibility greater or
equal than the specified level | [
"Returns",
"all",
"program",
"element",
"docs",
"that",
"have",
"a",
"visibility",
"greater",
"or",
"equal",
"than",
"the",
"specified",
"level"
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L757-L767 | train |
dspinellis/UMLGraph | src/main/java/org/umlgraph/doclet/ClassGraph.java | ClassGraph.firstInnerTableStart | private void firstInnerTableStart(Options opt) {
w.print(linePrefix + linePrefix + "<tr>" + opt.shape.extraColumn() +
"<td><table border=\"0\" cellspacing=\"0\" " +
"cellpadding=\"1\">" + linePostfix);
} | java | private void firstInnerTableStart(Options opt) {
w.print(linePrefix + linePrefix + "<tr>" + opt.shape.extraColumn() +
"<td><table border=\"0\" cellspacing=\"0\" " +
"cellpadding=\"1\">" + linePostfix);
} | [
"private",
"void",
"firstInnerTableStart",
"(",
"Options",
"opt",
")",
"{",
"w",
".",
"print",
"(",
"linePrefix",
"+",
"linePrefix",
"+",
"\"<tr>\"",
"+",
"opt",
".",
"shape",
".",
"extraColumn",
"(",
")",
"+",
"\"<td><table border=\\\"0\\\" cellspacing=\\\"0\\\" ... | Start the first inner table of a class. | [
"Start",
"the",
"first",
"inner",
"table",
"of",
"a",
"class",
"."
] | 09576db5ae0ea63bfe30ef9fce88a513f9a8d843 | https://github.com/dspinellis/UMLGraph/blob/09576db5ae0ea63bfe30ef9fce88a513f9a8d843/src/main/java/org/umlgraph/doclet/ClassGraph.java#L927-L931 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.extractThriftFile | private File extractThriftFile(String artifactId, String fileName, Set<File> thriftFiles) {
for (File thriftFile : thriftFiles) {
boolean fileFound = false;
if (fileName.equals(thriftFile.getName())) {
for (String pathComponent : thriftFile.getPath().split(File.separator)) {
if (pathCo... | java | private File extractThriftFile(String artifactId, String fileName, Set<File> thriftFiles) {
for (File thriftFile : thriftFiles) {
boolean fileFound = false;
if (fileName.equals(thriftFile.getName())) {
for (String pathComponent : thriftFile.getPath().split(File.separator)) {
if (pathCo... | [
"private",
"File",
"extractThriftFile",
"(",
"String",
"artifactId",
",",
"String",
"fileName",
",",
"Set",
"<",
"File",
">",
"thriftFiles",
")",
"{",
"for",
"(",
"File",
"thriftFile",
":",
"thriftFiles",
")",
"{",
"boolean",
"fileFound",
"=",
"false",
";",
... | Picks out a File from `thriftFiles` corresponding to a given artifact ID
and file name. Returns null if `artifactId` and `fileName` do not map to a
thrift file path.
@parameter artifactId The artifact ID of which to look up the path
@parameter fileName the name of the thrift file for which to extract a path
@parameter... | [
"Picks",
"out",
"a",
"File",
"from",
"thriftFiles",
"corresponding",
"to",
"a",
"given",
"artifact",
"ID",
"and",
"file",
"name",
".",
"Returns",
"null",
"if",
"artifactId",
"and",
"fileName",
"do",
"not",
"map",
"to",
"a",
"thrift",
"file",
"path",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L228-L244 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.execute | public void execute() throws MojoExecutionException, MojoFailureException {
try {
Set<File> thriftFiles = findThriftFiles();
final File outputDirectory = getOutputDirectory();
ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
Set<String> compileRoots = n... | java | public void execute() throws MojoExecutionException, MojoFailureException {
try {
Set<File> thriftFiles = findThriftFiles();
final File outputDirectory = getOutputDirectory();
ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
Set<String> compileRoots = n... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"try",
"{",
"Set",
"<",
"File",
">",
"thriftFiles",
"=",
"findThriftFiles",
"(",
")",
";",
"final",
"File",
"outputDirectory",
"=",
"getOutputDirectory",
... | Executes the mojo. | [
"Executes",
"the",
"mojo",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L249-L302 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.lastModified | private long lastModified(Set<File> files) {
long result = 0;
for (File file : files) {
if (file.lastModified() > result)
result = file.lastModified();
}
return result;
} | java | private long lastModified(Set<File> files) {
long result = 0;
for (File file : files) {
if (file.lastModified() > result)
result = file.lastModified();
}
return result;
} | [
"private",
"long",
"lastModified",
"(",
"Set",
"<",
"File",
">",
"files",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"File",
"file",
":",
"files",
")",
"{",
"if",
"(",
"file",
".",
"lastModified",
"(",
")",
">",
"result",
")",
"result",... | Get the last modified time for a set of files. | [
"Get",
"the",
"last",
"modified",
"time",
"for",
"a",
"set",
"of",
"files",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L339-L346 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.findThriftFiles | private Set<File> findThriftFiles() throws IOException, MojoExecutionException {
final File thriftSourceRoot = getThriftSourceRoot();
Set<File> thriftFiles = new HashSet<File>();
if (thriftSourceRoot != null && thriftSourceRoot.exists()) {
thriftFiles.addAll(findThriftFilesInDirectory(thriftSourceRoot... | java | private Set<File> findThriftFiles() throws IOException, MojoExecutionException {
final File thriftSourceRoot = getThriftSourceRoot();
Set<File> thriftFiles = new HashSet<File>();
if (thriftSourceRoot != null && thriftSourceRoot.exists()) {
thriftFiles.addAll(findThriftFilesInDirectory(thriftSourceRoot... | [
"private",
"Set",
"<",
"File",
">",
"findThriftFiles",
"(",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"final",
"File",
"thriftSourceRoot",
"=",
"getThriftSourceRoot",
"(",
")",
";",
"Set",
"<",
"File",
">",
"thriftFiles",
"=",
"new",
"H... | build a complete set of local files, files from referenced projects, and dependencies. | [
"build",
"a",
"complete",
"set",
"of",
"local",
"files",
"files",
"from",
"referenced",
"projects",
"and",
"dependencies",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L351-L365 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.findThriftDependencies | private Set<Artifact> findThriftDependencies() throws IOException, MojoExecutionException {
Set<Artifact> thriftDependencies = new HashSet<Artifact>();
Set<Artifact> deps = new HashSet<Artifact>();
deps.addAll(project.getArtifacts());
deps.addAll(project.getDependencyArtifacts());
Map<String, Arti... | java | private Set<Artifact> findThriftDependencies() throws IOException, MojoExecutionException {
Set<Artifact> thriftDependencies = new HashSet<Artifact>();
Set<Artifact> deps = new HashSet<Artifact>();
deps.addAll(project.getArtifacts());
deps.addAll(project.getDependencyArtifacts());
Map<String, Arti... | [
"private",
"Set",
"<",
"Artifact",
">",
"findThriftDependencies",
"(",
")",
"throws",
"IOException",
",",
"MojoExecutionException",
"{",
"Set",
"<",
"Artifact",
">",
"thriftDependencies",
"=",
"new",
"HashSet",
"<",
"Artifact",
">",
"(",
")",
";",
"Set",
"<",
... | Iterate through dependencies | [
"Iterate",
"through",
"dependencies"
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L370-L408 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.getRecursiveThriftFiles | protected List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory) throws IOException {
return getRecursiveThriftFiles(project, outputDirectory, new ArrayList<File>());
} | java | protected List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory) throws IOException {
return getRecursiveThriftFiles(project, outputDirectory, new ArrayList<File>());
} | [
"protected",
"List",
"<",
"File",
">",
"getRecursiveThriftFiles",
"(",
"MavenProject",
"project",
",",
"String",
"outputDirectory",
")",
"throws",
"IOException",
"{",
"return",
"getRecursiveThriftFiles",
"(",
"project",
",",
"outputDirectory",
",",
"new",
"ArrayList",... | Walk project references recursively, building up a list of thrift files they provide, starting
with an empty file list. | [
"Walk",
"project",
"references",
"recursively",
"building",
"up",
"a",
"list",
"of",
"thrift",
"files",
"they",
"provide",
"starting",
"with",
"an",
"empty",
"file",
"list",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L488-L490 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.getRecursiveThriftFiles | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent(), "target"), outputDirectory);
if (dir.exists()) {
URI baseDir = getFileURI(dir);
... | java | List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory, List<File> files) throws IOException {
HashFunction hashFun = Hashing.md5();
File dir = new File(new File(project.getFile().getParent(), "target"), outputDirectory);
if (dir.exists()) {
URI baseDir = getFileURI(dir);
... | [
"List",
"<",
"File",
">",
"getRecursiveThriftFiles",
"(",
"MavenProject",
"project",
",",
"String",
"outputDirectory",
",",
"List",
"<",
"File",
">",
"files",
")",
"throws",
"IOException",
"{",
"HashFunction",
"hashFun",
"=",
"Hashing",
".",
"md5",
"(",
")",
... | Walk project references recursively, adding thrift files to the provided list. | [
"Walk",
"project",
"references",
"recursively",
"adding",
"thrift",
"files",
"to",
"the",
"provided",
"list",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L495-L518 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java | AbstractMavenScroogeMojo.isDepOfIdlArtifact | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);... | java | private boolean isDepOfIdlArtifact(Artifact artifact, Map<String, Artifact> depsMap) {
List<String> depTrail = artifact.getDependencyTrail();
// depTrail can be null sometimes, which seems like a maven bug
if (depTrail != null) {
for (String name : depTrail) {
Artifact dep = depsMap.get(name);... | [
"private",
"boolean",
"isDepOfIdlArtifact",
"(",
"Artifact",
"artifact",
",",
"Map",
"<",
"String",
",",
"Artifact",
">",
"depsMap",
")",
"{",
"List",
"<",
"String",
">",
"depTrail",
"=",
"artifact",
".",
"getDependencyTrail",
"(",
")",
";",
"// depTrail can b... | Checks if the artifact is dependency of an dependent idl artifact
@returns true if the artifact was a dependency of idl artifact | [
"Checks",
"if",
"the",
"artifact",
"is",
"dependency",
"of",
"an",
"dependent",
"idl",
"artifact"
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/AbstractMavenScroogeMojo.java#L539-L551 | train |
twitter/scrooge | scrooge-maven-plugin/src/main/java/com/twitter/MavenScroogeCompilerUtil.java | MavenScroogeCompilerUtil.getIdlArtifact | public static Artifact getIdlArtifact(Artifact artifact, ArtifactFactory artifactFactory,
ArtifactResolver artifactResolver,
ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepos,
... | java | public static Artifact getIdlArtifact(Artifact artifact, ArtifactFactory artifactFactory,
ArtifactResolver artifactResolver,
ArtifactRepository localRepository,
List<ArtifactRepository> remoteRepos,
... | [
"public",
"static",
"Artifact",
"getIdlArtifact",
"(",
"Artifact",
"artifact",
",",
"ArtifactFactory",
"artifactFactory",
",",
"ArtifactResolver",
"artifactResolver",
",",
"ArtifactRepository",
"localRepository",
",",
"List",
"<",
"ArtifactRepository",
">",
"remoteRepos",
... | Resolves an idl jar for the artifact.
@return Returns idl artifact
@throws MojoExecutionException is idl jar is not present for the artifact. | [
"Resolves",
"an",
"idl",
"jar",
"for",
"the",
"artifact",
"."
] | 2aec9b19a610e12be9609cd97925d0b1284d48bc | https://github.com/twitter/scrooge/blob/2aec9b19a610e12be9609cd97925d0b1284d48bc/scrooge-maven-plugin/src/main/java/com/twitter/MavenScroogeCompilerUtil.java#L20-L42 | train |
lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<Z> Function0<Z> lift(Func0<Z> f) {
return bridge.lift(f);
} | java | public static<Z> Function0<Z> lift(Func0<Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"Z",
">",
"Function0",
"<",
"Z",
">",
"lift",
"(",
"Func0",
"<",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Func0 to a Scala Function0
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func0",
"to",
"a",
"Scala",
"Function0"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L37-L39 | train |
lift/framework | core/common/src/main/java/net/liftweb/common/Func.java | Func.lift | public static<A, Z> Function1<A, Z> lift(Func1<A, Z> f) {
return bridge.lift(f);
} | java | public static<A, Z> Function1<A, Z> lift(Func1<A, Z> f) {
return bridge.lift(f);
} | [
"public",
"static",
"<",
"A",
",",
"Z",
">",
"Function1",
"<",
"A",
",",
"Z",
">",
"lift",
"(",
"Func1",
"<",
"A",
",",
"Z",
">",
"f",
")",
"{",
"return",
"bridge",
".",
"lift",
"(",
"f",
")",
";",
"}"
] | Lift a Java Func1 to a Scala Function1
@param f the function to lift
@returns the Scala function | [
"Lift",
"a",
"Java",
"Func1",
"to",
"a",
"Scala",
"Function1"
] | 975aa115e0a8e2450dd4905a17ebd19830ae97b2 | https://github.com/lift/framework/blob/975aa115e0a8e2450dd4905a17ebd19830ae97b2/core/common/src/main/java/net/liftweb/common/Func.java#L48-L50 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.