id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
149,300 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.getOrderList | public List<Integer> getOrderList(String key) {
List<Integer> result = new ArrayList<Integer>();
String processedKey = processKey(key);
String orderKey = null;
for (int i = 0; i < this.order.size(); i++) {
orderKey = this.order.get(i);
if (orderKey != nu... | java | public List<Integer> getOrderList(String key) {
List<Integer> result = new ArrayList<Integer>();
String processedKey = processKey(key);
String orderKey = null;
for (int i = 0; i < this.order.size(); i++) {
orderKey = this.order.get(i);
if (orderKey != nu... | [
"public",
"List",
"<",
"Integer",
">",
"getOrderList",
"(",
"String",
"key",
")",
"{",
"List",
"<",
"Integer",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Integer",
">",
"(",
")",
";",
"String",
"processedKey",
"=",
"processKey",
"(",
"key",
")",
";"... | Returns list of positions of specified key
@param key Key
@return this instance of QueryParameters | [
"Returns",
"list",
"of",
"positions",
"of",
"specified",
"key"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L359-L373 |
149,301 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.isOutParameter | public boolean isOutParameter(String key) {
boolean isOut = false;
if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.OUT) {
isOut = true;
}
return isOut;
} | java | public boolean isOutParameter(String key) {
boolean isOut = false;
if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.OUT) {
isOut = true;
}
return isOut;
} | [
"public",
"boolean",
"isOutParameter",
"(",
"String",
"key",
")",
"{",
"boolean",
"isOut",
"=",
"false",
";",
"if",
"(",
"this",
".",
"getDirection",
"(",
"processKey",
"(",
"key",
")",
")",
"==",
"Direction",
".",
"INOUT",
"||",
"this",
".",
"getDirecti... | Checks is specified key is OUT parameter.
OUT and INOUT parameter would be considered as OUT parameter
@param key Key
@return true - if key is OUT parameter | [
"Checks",
"is",
"specified",
"key",
"is",
"OUT",
"parameter",
".",
"OUT",
"and",
"INOUT",
"parameter",
"would",
"be",
"considered",
"as",
"OUT",
"parameter"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L443-L451 |
149,302 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.isInParameter | public boolean isInParameter(String key) {
boolean isIn = false;
if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.IN) {
isIn = true;
}
return isIn;
} | java | public boolean isInParameter(String key) {
boolean isIn = false;
if (this.getDirection(processKey(key)) == Direction.INOUT || this.getDirection(processKey(key)) == Direction.IN) {
isIn = true;
}
return isIn;
} | [
"public",
"boolean",
"isInParameter",
"(",
"String",
"key",
")",
"{",
"boolean",
"isIn",
"=",
"false",
";",
"if",
"(",
"this",
".",
"getDirection",
"(",
"processKey",
"(",
"key",
")",
")",
"==",
"Direction",
".",
"INOUT",
"||",
"this",
".",
"getDirection... | Checks is specified key is IN parameter.
IN and INOUT parameter would be considered as IN parameter
@param key Key
@return true - if key is IN parameter | [
"Checks",
"is",
"specified",
"key",
"is",
"IN",
"parameter",
".",
"IN",
"and",
"INOUT",
"parameter",
"would",
"be",
"considered",
"as",
"IN",
"parameter"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L460-L468 |
149,303 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.getNameByPosition | public String getNameByPosition(Integer position) {
String name = null;
name = this.order.get(position);
return name;
} | java | public String getNameByPosition(Integer position) {
String name = null;
name = this.order.get(position);
return name;
} | [
"public",
"String",
"getNameByPosition",
"(",
"Integer",
"position",
")",
"{",
"String",
"name",
"=",
"null",
";",
"name",
"=",
"this",
".",
"order",
".",
"get",
"(",
"position",
")",
";",
"return",
"name",
";",
"}"
] | Returns Key by searching key assigned to that position
@param position Position which would be searched
@return Key | [
"Returns",
"Key",
"by",
"searching",
"key",
"assigned",
"to",
"that",
"position"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L476-L482 |
149,304 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.getValueByPosition | public Object getValueByPosition(Integer position) throws NoSuchFieldException {
String name = null;
Object value = null;
name = this.getNameByPosition(position);
if (name != null) {
value = this.getValue(name);
} else {
throw new NoSuchFieldExc... | java | public Object getValueByPosition(Integer position) throws NoSuchFieldException {
String name = null;
Object value = null;
name = this.getNameByPosition(position);
if (name != null) {
value = this.getValue(name);
} else {
throw new NoSuchFieldExc... | [
"public",
"Object",
"getValueByPosition",
"(",
"Integer",
"position",
")",
"throws",
"NoSuchFieldException",
"{",
"String",
"name",
"=",
"null",
";",
"Object",
"value",
"=",
"null",
";",
"name",
"=",
"this",
".",
"getNameByPosition",
"(",
"position",
")",
";",... | Returns value by searching key assigned to that position
@param position Position which would be searched
@return Value
@throws NoSuchFieldException | [
"Returns",
"value",
"by",
"searching",
"key",
"assigned",
"to",
"that",
"position"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L491-L504 |
149,305 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.remove | public void remove(String key) {
String processedKey = processKey(key);
String orderKey = null;
// removing key set for all positions
for (int i = 0; i < this.order.size(); i++) {
orderKey = this.order.get(i);
if (orderKey != null && orderKey.equals(proc... | java | public void remove(String key) {
String processedKey = processKey(key);
String orderKey = null;
// removing key set for all positions
for (int i = 0; i < this.order.size(); i++) {
orderKey = this.order.get(i);
if (orderKey != null && orderKey.equals(proc... | [
"public",
"void",
"remove",
"(",
"String",
"key",
")",
"{",
"String",
"processedKey",
"=",
"processKey",
"(",
"key",
")",
";",
"String",
"orderKey",
"=",
"null",
";",
"// removing key set for all positions\r",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<... | Removes specified key
@param key Key which would be removed | [
"Removes",
"specified",
"key"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L522-L538 |
149,306 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.getValuesArray | public Object[] getValuesArray() {
this.assertIncorrectOrder();
Object[] params = new Object[this.order.size()];
String parameterName = null;
for (int i = 0; i < this.order.size(); i++) {
parameterName = this.getNameByPosition(i);
params[i] = this.getV... | java | public Object[] getValuesArray() {
this.assertIncorrectOrder();
Object[] params = new Object[this.order.size()];
String parameterName = null;
for (int i = 0; i < this.order.size(); i++) {
parameterName = this.getNameByPosition(i);
params[i] = this.getV... | [
"public",
"Object",
"[",
"]",
"getValuesArray",
"(",
")",
"{",
"this",
".",
"assertIncorrectOrder",
"(",
")",
";",
"Object",
"[",
"]",
"params",
"=",
"new",
"Object",
"[",
"this",
".",
"order",
".",
"size",
"(",
")",
"]",
";",
"String",
"parameterName"... | Utility function.
Returns array of values
@return array of values | [
"Utility",
"function",
".",
"Returns",
"array",
"of",
"values"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L698-L711 |
149,307 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java | QueryParameters.processKey | private String processKey(String key) {
AssertUtils.assertNotNull(key, "Key cannot be null");
String result = null;
if (this.isCaseSensitive() == false) {
result = key.toLowerCase(Locale.ENGLISH);
} else {
result = key;
}
return resul... | java | private String processKey(String key) {
AssertUtils.assertNotNull(key, "Key cannot be null");
String result = null;
if (this.isCaseSensitive() == false) {
result = key.toLowerCase(Locale.ENGLISH);
} else {
result = key;
}
return resul... | [
"private",
"String",
"processKey",
"(",
"String",
"key",
")",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"key",
",",
"\"Key cannot be null\"",
")",
";",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"this",
".",
"isCaseSensitive",
"(",
")",
"==",
"f... | Utility function.
Processes key and converts it's case if required
@param key Key
@return Processed Key | [
"Utility",
"function",
".",
"Processes",
"key",
"and",
"converts",
"it",
"s",
"case",
"if",
"required"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/QueryParameters.java#L787-L799 |
149,308 | Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/query/FoxHttpRequestQuery.java | FoxHttpRequestQuery.parseObjectAsQueryMap | public void parseObjectAsQueryMap(List<String> params, Object o) throws FoxHttpRequestException {
try {
Class clazz = o.getClass();
HashMap<String, String> paramMap = new HashMap<>();
for (String param : params) {
Field field = clazz.getDeclaredField(param);
... | java | public void parseObjectAsQueryMap(List<String> params, Object o) throws FoxHttpRequestException {
try {
Class clazz = o.getClass();
HashMap<String, String> paramMap = new HashMap<>();
for (String param : params) {
Field field = clazz.getDeclaredField(param);
... | [
"public",
"void",
"parseObjectAsQueryMap",
"(",
"List",
"<",
"String",
">",
"params",
",",
"Object",
"o",
")",
"throws",
"FoxHttpRequestException",
"{",
"try",
"{",
"Class",
"clazz",
"=",
"o",
".",
"getClass",
"(",
")",
";",
"HashMap",
"<",
"String",
",",
... | Parse an object as query map
@param params list of attribute names which will be included
@param o object with the attributes
@throws FoxHttpRequestException can throw an exception if a field does not exist | [
"Parse",
"an",
"object",
"as",
"query",
"map"
] | d3f7d0df65e2e75861fc7db938090683f2cdf919 | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/query/FoxHttpRequestQuery.java#L78-L95 |
149,309 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/MapOutputHandler.java | MapOutputHandler.handle | public Map<String, Object> handle(List<QueryParameters> outputList) throws MjdbcException {
return this.outputProcessor.toMap(outputList);
} | java | public Map<String, Object> handle(List<QueryParameters> outputList) throws MjdbcException {
return this.outputProcessor.toMap(outputList);
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"handle",
"(",
"List",
"<",
"QueryParameters",
">",
"outputList",
")",
"throws",
"MjdbcException",
"{",
"return",
"this",
".",
"outputProcessor",
".",
"toMap",
"(",
"outputList",
")",
";",
"}"
] | Converts first row of query output into Map
@param outputList Query output
@return Map converted from first row of query output
@throws org.midao.jdbc.core.exception.MjdbcException | [
"Converts",
"first",
"row",
"of",
"query",
"output",
"into",
"Map"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/MapOutputHandler.java#L56-L58 |
149,310 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.onResize | public void onResize(int width, int height) {
// Center the line in the shell
int lineWidth = lineElement.getOffsetWidth();
lineLeftOffset = (width / 2) - (lineWidth / 2);
DOM.setStyleAttribute(lineElement, "left", lineLeftOffset + "px");
// Draw the other components
drawLabels();
drawTicks();
... | java | public void onResize(int width, int height) {
// Center the line in the shell
int lineWidth = lineElement.getOffsetWidth();
lineLeftOffset = (width / 2) - (lineWidth / 2);
DOM.setStyleAttribute(lineElement, "left", lineLeftOffset + "px");
// Draw the other components
drawLabels();
drawTicks();
... | [
"public",
"void",
"onResize",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"// Center the line in the shell\r",
"int",
"lineWidth",
"=",
"lineElement",
".",
"getOffsetWidth",
"(",
")",
";",
"lineLeftOffset",
"=",
"(",
"width",
"/",
"2",
")",
"-",
"("... | This method is called when the dimensions of the parent element change. Subclasses should override this method as
needed.
@param width
the new client width of the element
@param height
the new client height of the element | [
"This",
"method",
"is",
"called",
"when",
"the",
"dimensions",
"of",
"the",
"parent",
"element",
"change",
".",
"Subclasses",
"should",
"override",
"this",
"method",
"as",
"needed",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L520-L530 |
149,311 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.redraw | public void redraw() {
if (isAttached()) {
int width = getElement().getClientWidth();
int height = getElement().getClientHeight();
onResize(width, height);
}
} | java | public void redraw() {
if (isAttached()) {
int width = getElement().getClientWidth();
int height = getElement().getClientHeight();
onResize(width, height);
}
} | [
"public",
"void",
"redraw",
"(",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"int",
"width",
"=",
"getElement",
"(",
")",
".",
"getClientWidth",
"(",
")",
";",
"int",
"height",
"=",
"getElement",
"(",
")",
".",
"getClientHeight",
"(",
")",... | Redraw the progress bar when something changes the layout. | [
"Redraw",
"the",
"progress",
"bar",
"when",
"something",
"changes",
"the",
"layout",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L535-L541 |
149,312 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.setCurrentValue | public void setCurrentValue(double curValue, boolean fireEvent) {
// Confine the value to the range
this.curValue = Math.max(minValue, Math.min(maxValue, curValue));
double remainder = (this.curValue - minValue) % stepSize;
this.curValue -= remainder;
// Go to next step if more than halfway there
if... | java | public void setCurrentValue(double curValue, boolean fireEvent) {
// Confine the value to the range
this.curValue = Math.max(minValue, Math.min(maxValue, curValue));
double remainder = (this.curValue - minValue) % stepSize;
this.curValue -= remainder;
// Go to next step if more than halfway there
if... | [
"public",
"void",
"setCurrentValue",
"(",
"double",
"curValue",
",",
"boolean",
"fireEvent",
")",
"{",
"// Confine the value to the range\r",
"this",
".",
"curValue",
"=",
"Math",
".",
"max",
"(",
"minValue",
",",
"Math",
".",
"min",
"(",
"maxValue",
",",
"cur... | Set the current value and optionally fire the onValueChange event.
@param curValue
the current value
@param fireEvent
fire the onValue change event if true | [
"Set",
"the",
"current",
"value",
"and",
"optionally",
"fire",
"the",
"onValueChange",
"event",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L561-L579 |
149,313 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.setEnabled | public void setEnabled(boolean enabled) {
this.enabled = enabled;
if (enabled) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
} else {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " "
+ SLIDER_LINE_DISABLED);
}
redraw();
} | java | public void setEnabled(boolean enabled) {
this.enabled = enabled;
if (enabled) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
} else {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " "
+ SLIDER_LINE_DISABLED);
}
redraw();
} | [
"public",
"void",
"setEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"this",
".",
"enabled",
"=",
"enabled",
";",
"if",
"(",
"enabled",
")",
"{",
"DOM",
".",
"setElementProperty",
"(",
"lineElement",
",",
"\"className\"",
",",
"SLIDER_LINE",
")",
";",
"}",... | Sets whether this widget is enabled.
@param enabled
true to enable the widget, false to disable it | [
"Sets",
"whether",
"this",
"widget",
"is",
"enabled",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L587-L596 |
149,314 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.getKnobPercent | protected double getKnobPercent() {
// If we have no range
if (maxValue <= minValue) {
return 0;
}
// Calculate the relative progress
double percent = (curValue - minValue) / (maxValue - minValue);
return Math.max(0.0, Math.min(1.0, percent));
} | java | protected double getKnobPercent() {
// If we have no range
if (maxValue <= minValue) {
return 0;
}
// Calculate the relative progress
double percent = (curValue - minValue) / (maxValue - minValue);
return Math.max(0.0, Math.min(1.0, percent));
} | [
"protected",
"double",
"getKnobPercent",
"(",
")",
"{",
"// If we have no range\r",
"if",
"(",
"maxValue",
"<=",
"minValue",
")",
"{",
"return",
"0",
";",
"}",
"// Calculate the relative progress\r",
"double",
"percent",
"=",
"(",
"curValue",
"-",
"minValue",
")",... | Get the percentage of the knob's position relative to the size of the line. The return value will be between 0.0
and 1.0.
@return the current percent complete | [
"Get",
"the",
"percentage",
"of",
"the",
"knob",
"s",
"position",
"relative",
"to",
"the",
"size",
"of",
"the",
"line",
".",
"The",
"return",
"value",
"will",
"be",
"between",
"0",
".",
"0",
"and",
"1",
".",
"0",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L736-L745 |
149,315 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.drawKnob | private void drawKnob() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Move the knob to the correct position
Element knobElement = knobImage.getElement();
int lineWidth = lineElement.getOffsetWidth();
int knobWidth = knobElement.getOffsetWidth();
int knobLeftOffset = (int) (l... | java | private void drawKnob() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Move the knob to the correct position
Element knobElement = knobImage.getElement();
int lineWidth = lineElement.getOffsetWidth();
int knobWidth = knobElement.getOffsetWidth();
int knobLeftOffset = (int) (l... | [
"private",
"void",
"drawKnob",
"(",
")",
"{",
"// Abort if not attached\r",
"if",
"(",
"!",
"isAttached",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Move the knob to the correct position\r",
"Element",
"knobElement",
"=",
"knobImage",
".",
"getElement",
"(",
")",... | Draw the knob where it is supposed to be relative to the line. | [
"Draw",
"the",
"knob",
"where",
"it",
"is",
"supposed",
"to",
"be",
"relative",
"to",
"the",
"line",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L763-L776 |
149,316 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.drawLabels | private void drawLabels() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Draw the labels
int lineWidth = lineElement.getOffsetWidth();
if (numLabels > 0) {
// Create the labels or make them visible
for (int i = 0; i <= numLabels; i++) {
Element label = null;
if (i... | java | private void drawLabels() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Draw the labels
int lineWidth = lineElement.getOffsetWidth();
if (numLabels > 0) {
// Create the labels or make them visible
for (int i = 0; i <= numLabels; i++) {
Element label = null;
if (i... | [
"private",
"void",
"drawLabels",
"(",
")",
"{",
"// Abort if not attached\r",
"if",
"(",
"!",
"isAttached",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Draw the labels\r",
"int",
"lineWidth",
"=",
"lineElement",
".",
"getOffsetWidth",
"(",
")",
";",
"if",
"(... | Draw the labels along the line. NOT USED IN KEYSTONE | [
"Draw",
"the",
"labels",
"along",
"the",
"line",
".",
"NOT",
"USED",
"IN",
"KEYSTONE"
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L781-L836 |
149,317 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.drawTicks | private void drawTicks() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Draw the ticks
int lineWidth = lineElement.getOffsetWidth();
if (numTicks > 0) {
// Create the ticks or make them visible
for (int i = 0; i <= numTicks; i++) {
Element tick = null;
if (i < tic... | java | private void drawTicks() {
// Abort if not attached
if (!isAttached()) {
return;
}
// Draw the ticks
int lineWidth = lineElement.getOffsetWidth();
if (numTicks > 0) {
// Create the ticks or make them visible
for (int i = 0; i <= numTicks; i++) {
Element tick = null;
if (i < tic... | [
"private",
"void",
"drawTicks",
"(",
")",
"{",
"// Abort if not attached\r",
"if",
"(",
"!",
"isAttached",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Draw the ticks\r",
"int",
"lineWidth",
"=",
"lineElement",
".",
"getOffsetWidth",
"(",
")",
";",
"if",
"(",... | Draw the tick along the line. | [
"Draw",
"the",
"tick",
"along",
"the",
"line",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L841-L887 |
149,318 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.slideKnob | private void slideKnob(Event event) {
int x = DOM.eventGetClientX(event);
if (x > 0) {
int lineWidth = lineElement.getOffsetWidth();
int lineLeft = lineElement.getAbsoluteLeft();
double percent = (double) (x - lineLeft) / lineWidth * 1.0;
setCurrentValue(getTotalRange() * percent + minValue, true)... | java | private void slideKnob(Event event) {
int x = DOM.eventGetClientX(event);
if (x > 0) {
int lineWidth = lineElement.getOffsetWidth();
int lineLeft = lineElement.getAbsoluteLeft();
double percent = (double) (x - lineLeft) / lineWidth * 1.0;
setCurrentValue(getTotalRange() * percent + minValue, true)... | [
"private",
"void",
"slideKnob",
"(",
"Event",
"event",
")",
"{",
"int",
"x",
"=",
"DOM",
".",
"eventGetClientX",
"(",
"event",
")",
";",
"if",
"(",
"x",
">",
"0",
")",
"{",
"int",
"lineWidth",
"=",
"lineElement",
".",
"getOffsetWidth",
"(",
")",
";",... | Slide the knob to a new location.
@param event
the mouse event | [
"Slide",
"the",
"knob",
"to",
"a",
"new",
"location",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L910-L918 |
149,319 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.startSliding | private void startSliding(boolean highlight, boolean fireEvent) {
if (highlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " "
+ SLIDER_LINE_SLIDING);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB + " "
+ SLIDER_KNOB_SLIDING);
}
} | java | private void startSliding(boolean highlight, boolean fireEvent) {
if (highlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE + " "
+ SLIDER_LINE_SLIDING);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB + " "
+ SLIDER_KNOB_SLIDING);
}
} | [
"private",
"void",
"startSliding",
"(",
"boolean",
"highlight",
",",
"boolean",
"fireEvent",
")",
"{",
"if",
"(",
"highlight",
")",
"{",
"DOM",
".",
"setElementProperty",
"(",
"lineElement",
",",
"\"className\"",
",",
"SLIDER_LINE",
"+",
"\" \"",
"+",
"SLIDER_... | Start sliding the knob.
@param highlight
true to change the style
@param fireEvent
true to fire the event | [
"Start",
"sliding",
"the",
"knob",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L928-L935 |
149,320 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.stopSliding | private void stopSliding(boolean unhighlight, boolean fireEvent) {
if (unhighlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB);
}
} | java | private void stopSliding(boolean unhighlight, boolean fireEvent) {
if (unhighlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB);
}
} | [
"private",
"void",
"stopSliding",
"(",
"boolean",
"unhighlight",
",",
"boolean",
"fireEvent",
")",
"{",
"if",
"(",
"unhighlight",
")",
"{",
"DOM",
".",
"setElementProperty",
"(",
"lineElement",
",",
"\"className\"",
",",
"SLIDER_LINE",
")",
";",
"DOM",
".",
... | Stop sliding the knob.
@param unhighlight
true to change the style
@param fireEvent
true to fire the event | [
"Stop",
"sliding",
"the",
"knob",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L945-L951 |
149,321 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.toList | public static <T> List<T> toList(Iterator<T> iterator)
{
Objects.requireNonNull(iterator, "The iterator is null");
return Iterators.toCollection(iterator, new ArrayList<T>());
} | java | public static <T> List<T> toList(Iterator<T> iterator)
{
Objects.requireNonNull(iterator, "The iterator is null");
return Iterators.toCollection(iterator, new ArrayList<T>());
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"iterator",
",",
"\"The iterator is null\"",
")",
";",
"return",
"Iterators",
".",
"toCollectio... | Drains all elements from the given iterator into a list
@param <T> The element type
@param iterator The iterator
@return The list | [
"Drains",
"all",
"elements",
"from",
"the",
"given",
"iterator",
"into",
"a",
"list"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L54-L58 |
149,322 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.toSet | public static <T> Set<T> toSet(Iterator<T> iterator)
{
Objects.requireNonNull(iterator, "The iterator is null");
return Iterators.toCollection(iterator, new LinkedHashSet<T>());
} | java | public static <T> Set<T> toSet(Iterator<T> iterator)
{
Objects.requireNonNull(iterator, "The iterator is null");
return Iterators.toCollection(iterator, new LinkedHashSet<T>());
} | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"toSet",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"iterator",
",",
"\"The iterator is null\"",
")",
";",
"return",
"Iterators",
".",
"toCollection"... | Drains all elements from the given iterator into a set
@param <T> The element type
@param iterator The iterator
@return The set | [
"Drains",
"all",
"elements",
"from",
"the",
"given",
"iterator",
"into",
"a",
"set"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L67-L71 |
149,323 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.toCollection | public static <T, C extends Collection<? super T>> C toCollection(
Iterator<T> iterator, C collection)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(iterator, "The collection is null");
while (iterator.hasNext())
{
colle... | java | public static <T, C extends Collection<? super T>> C toCollection(
Iterator<T> iterator, C collection)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(iterator, "The collection is null");
while (iterator.hasNext())
{
colle... | [
"public",
"static",
"<",
"T",
",",
"C",
"extends",
"Collection",
"<",
"?",
"super",
"T",
">",
">",
"C",
"toCollection",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
",",
"C",
"collection",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"iterator",
","... | Drains all elements that are provided by the given iterator
into the given collection
@param <T> The element type
@param <C> The collection type
@param iterator The iterator
@param collection The target collection
@return The given collection | [
"Drains",
"all",
"elements",
"that",
"are",
"provided",
"by",
"the",
"given",
"iterator",
"into",
"the",
"given",
"collection"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L83-L93 |
149,324 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.weakeningIterator | public static <T> Iterator<T> weakeningIterator(
final Iterator<? extends T> delegate)
{
Objects.requireNonNull(delegate, "The delegate is null");
return new Iterator<T>()
{
@Override
public boolean hasNext()
{
return deleg... | java | public static <T> Iterator<T> weakeningIterator(
final Iterator<? extends T> delegate)
{
Objects.requireNonNull(delegate, "The delegate is null");
return new Iterator<T>()
{
@Override
public boolean hasNext()
{
return deleg... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"weakeningIterator",
"(",
"final",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"delegate",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"delegate",
",",
"\"The delegate is null\"",
")",
";",
... | Returns an iterator that removes the type bound
of another iterator
@param <T> The element type
@param delegate The delegate iterator
@return The new iterator | [
"Returns",
"an",
"iterator",
"that",
"removes",
"the",
"type",
"bound",
"of",
"another",
"iterator"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L103-L127 |
149,325 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterators | public static <T> Iterator<T> iteratorOverIterators(
Iterator<? extends T> iterator0, Iterator<? extends T> iterator1)
{
Objects.requireNonNull(iterator0, "The iterator0 is null");
Objects.requireNonNull(iterator1, "The iterator1 is null");
List<Iterator<? extends T>> iterators ... | java | public static <T> Iterator<T> iteratorOverIterators(
Iterator<? extends T> iterator0, Iterator<? extends T> iterator1)
{
Objects.requireNonNull(iterator0, "The iterator0 is null");
Objects.requireNonNull(iterator1, "The iterator1 is null");
List<Iterator<? extends T>> iterators ... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterators",
"(",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iterator0",
",",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iterator1",
")",
"{",
"Objects",
".",
"requireNonNull",
"... | Returns an iterator that combines the given iterators.
@param <T> The element type
@param iterator0 The first iterator
@param iterator1 The second iterator
@return The iterator | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"given",
"iterators",
"."
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L137-L147 |
149,326 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterators | public static <S extends Iterator<? extends T>, T> Iterator<T>
iteratorOverIterators(Iterator<S> iteratorsIterator)
{
Objects.requireNonNull(iteratorsIterator,
"The iteratorsIterator is null");
return new CombiningIterator<T>(iteratorsIterator);
} | java | public static <S extends Iterator<? extends T>, T> Iterator<T>
iteratorOverIterators(Iterator<S> iteratorsIterator)
{
Objects.requireNonNull(iteratorsIterator,
"The iteratorsIterator is null");
return new CombiningIterator<T>(iteratorsIterator);
} | [
"public",
"static",
"<",
"S",
"extends",
"Iterator",
"<",
"?",
"extends",
"T",
">",
",",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterators",
"(",
"Iterator",
"<",
"S",
">",
"iteratorsIterator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"... | Returns an iterator that combines the iterators
that are returned by the given iterator.
@param <S> The iterator type
@param <T> The element type
@param iteratorsIterator The iterator iterator. May not provide
<code>null</code> iterators.
@return The iterator | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"iterators",
"that",
"are",
"returned",
"by",
"the",
"given",
"iterator",
"."
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L159-L165 |
149,327 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterators | public static <S extends Iterator<? extends T>, T> Iterator<T>
iteratorOverIterators(Iterable<S> iteratorsIterable)
{
Objects.requireNonNull(iteratorsIterable,
"The iteratorsIterable is null");
return new CombiningIterator<T>(iteratorsIterable.iterator());
} | java | public static <S extends Iterator<? extends T>, T> Iterator<T>
iteratorOverIterators(Iterable<S> iteratorsIterable)
{
Objects.requireNonNull(iteratorsIterable,
"The iteratorsIterable is null");
return new CombiningIterator<T>(iteratorsIterable.iterator());
} | [
"public",
"static",
"<",
"S",
"extends",
"Iterator",
"<",
"?",
"extends",
"T",
">",
",",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterators",
"(",
"Iterable",
"<",
"S",
">",
"iteratorsIterable",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"... | Returns an iterator that combines the iterators that
are returned by the iterator that is returned by the
given iterable.
@param <S> The iterator type
@param <T> The element type
@param iteratorsIterable The iterable for the iterators. May not
provide <code>null</code> iterators.
@return The iterator | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"iterators",
"that",
"are",
"returned",
"by",
"the",
"iterator",
"that",
"is",
"returned",
"by",
"the",
"given",
"iterable",
"."
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L178-L184 |
149,328 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterables | public static <S extends Iterable<? extends T>, T> Iterator<T>
iteratorOverIterables(Iterator<S> iterablesIterator)
{
Objects.requireNonNull(iterablesIterator,
"The iterablesIterator is null");
TransformingIterator<S, Iterator<? extends T>> iteratorIterator =
... | java | public static <S extends Iterable<? extends T>, T> Iterator<T>
iteratorOverIterables(Iterator<S> iterablesIterator)
{
Objects.requireNonNull(iterablesIterator,
"The iterablesIterator is null");
TransformingIterator<S, Iterator<? extends T>> iteratorIterator =
... | [
"public",
"static",
"<",
"S",
"extends",
"Iterable",
"<",
"?",
"extends",
"T",
">",
",",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterables",
"(",
"Iterator",
"<",
"S",
">",
"iterablesIterator",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"... | Returns an iterator that combines the iterators that are
returned by the iterables that are provided by the
given iterator
@param <S> The iterable type
@param <T> The element type
@param iterablesIterator The iterator over the iterables.
May not provide <code>null</code> iterables
@return The iterator | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"iterators",
"that",
"are",
"returned",
"by",
"the",
"iterables",
"that",
"are",
"provided",
"by",
"the",
"given",
"iterator"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L197-L206 |
149,329 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterables | public static <S extends Iterable<? extends T>, T> Iterator<T>
iteratorOverIterables(Iterable<S> iterablesIterable)
{
Objects.requireNonNull(iterablesIterable,
"The iterablesIterable is null");
return iteratorOverIterables(iterablesIterable.iterator());
} | java | public static <S extends Iterable<? extends T>, T> Iterator<T>
iteratorOverIterables(Iterable<S> iterablesIterable)
{
Objects.requireNonNull(iterablesIterable,
"The iterablesIterable is null");
return iteratorOverIterables(iterablesIterable.iterator());
} | [
"public",
"static",
"<",
"S",
"extends",
"Iterable",
"<",
"?",
"extends",
"T",
">",
",",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterables",
"(",
"Iterable",
"<",
"S",
">",
"iterablesIterable",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"... | Returns an iterator that combines the iterators that are
returned by the iterables that are provided by the iterator
that is provided by the given iterable
@param <S> The iterable type
@param <T> The element type
@param iterablesIterable The iterable for the iterables. May not
provide <code>null</code> iterables.
@ret... | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"iterators",
"that",
"are",
"returned",
"by",
"the",
"iterables",
"that",
"are",
"provided",
"by",
"the",
"iterator",
"that",
"is",
"provided",
"by",
"the",
"given",
"iterable"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L219-L225 |
149,330 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.iteratorOverIterables | public static <T> Iterator<T> iteratorOverIterables(
Iterable<? extends T> iterable0, Iterable<? extends T> iterable1)
{
Objects.requireNonNull(iterable0, "The iterable0 is null");
Objects.requireNonNull(iterable1, "The iterable1 is null");
List<Iterable<? extends T>> iterables ... | java | public static <T> Iterator<T> iteratorOverIterables(
Iterable<? extends T> iterable0, Iterable<? extends T> iterable1)
{
Objects.requireNonNull(iterable0, "The iterable0 is null");
Objects.requireNonNull(iterable1, "The iterable1 is null");
List<Iterable<? extends T>> iterables ... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"iteratorOverIterables",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable0",
",",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable1",
")",
"{",
"Objects",
".",
"requireNonNull",
"... | Returns an iterator that combines the iterators that are
returned by the given iterables
@param <T> The element type
@param iterable0 The first iterable
@param iterable1 The second iterable
@return The iterator | [
"Returns",
"an",
"iterator",
"that",
"combines",
"the",
"iterators",
"that",
"are",
"returned",
"by",
"the",
"given",
"iterables"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L236-L246 |
149,331 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.transformingIterator | public static <S, T> Iterator<T> transformingIterator(
Iterator<? extends S> iterator,
Function<S, ? extends T> function)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(function, "The function is null");
return new TransformingIterat... | java | public static <S, T> Iterator<T> transformingIterator(
Iterator<? extends S> iterator,
Function<S, ? extends T> function)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(function, "The function is null");
return new TransformingIterat... | [
"public",
"static",
"<",
"S",
",",
"T",
">",
"Iterator",
"<",
"T",
">",
"transformingIterator",
"(",
"Iterator",
"<",
"?",
"extends",
"S",
">",
"iterator",
",",
"Function",
"<",
"S",
",",
"?",
"extends",
"T",
">",
"function",
")",
"{",
"Objects",
"."... | Creates an iterator that passes the values that are provided
by the given delegate iterator to the given function, and
returns the resulting values
@param <S> The element type
@param <T> The value type
@param iterator The delegate iterator
@param function The function
@return The iterator | [
"Creates",
"an",
"iterator",
"that",
"passes",
"the",
"values",
"that",
"are",
"provided",
"by",
"the",
"given",
"delegate",
"iterator",
"to",
"the",
"given",
"function",
"and",
"returns",
"the",
"resulting",
"values"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L259-L266 |
149,332 | javagl/Common | src/main/java/de/javagl/common/iteration/Iterators.java | Iterators.filteringIterator | public static <T> Iterator<T> filteringIterator(
Iterator<? extends T> iterator,
Predicate<? super T> predicate)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(predicate, "The predicate is null");
return new FilteringIterator<T>(iter... | java | public static <T> Iterator<T> filteringIterator(
Iterator<? extends T> iterator,
Predicate<? super T> predicate)
{
Objects.requireNonNull(iterator, "The iterator is null");
Objects.requireNonNull(predicate, "The predicate is null");
return new FilteringIterator<T>(iter... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"filteringIterator",
"(",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iterator",
",",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
... | Creates an iterator that only returns the elements from the
given iterator to which the given predicate applies.
@param <T> The element type
@param iterator The delegate iterator
@param predicate The predicate
@return The iterator | [
"Creates",
"an",
"iterator",
"that",
"only",
"returns",
"the",
"elements",
"from",
"the",
"given",
"iterator",
"to",
"which",
"the",
"given",
"predicate",
"applies",
"."
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/Iterators.java#L277-L284 |
149,333 | realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/StorageRef.java | StorageRef.getTables | public StorageRef getTables(OnTableSnapshot onTableSnapshot, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
Rest r = new Rest(context, RestType.LISTTABLES, pbb, null);
r.onError = onError;
r.onTableSnapshot = onTableSnapshot;
context.processRest(r);
return this;
} | java | public StorageRef getTables(OnTableSnapshot onTableSnapshot, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
Rest r = new Rest(context, RestType.LISTTABLES, pbb, null);
r.onError = onError;
r.onTableSnapshot = onTableSnapshot;
context.processRest(r);
return this;
} | [
"public",
"StorageRef",
"getTables",
"(",
"OnTableSnapshot",
"onTableSnapshot",
",",
"OnError",
"onError",
")",
"{",
"PostBodyBuilder",
"pbb",
"=",
"new",
"PostBodyBuilder",
"(",
"context",
")",
";",
"Rest",
"r",
"=",
"new",
"Rest",
"(",
"context",
",",
"RestT... | Retrieves a list of the names of all tables created by the user's subscription.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
storage.getTables(new OnTableSnapshot() {
@Override
public void run(TableSnapshot tableSnapshot) {
if(tableSnapshot != null) {
Log.d("StorageRef", "Table Name: ... | [
"Retrieves",
"a",
"list",
"of",
"the",
"names",
"of",
"all",
"tables",
"created",
"by",
"the",
"user",
"s",
"subscription",
"."
] | 05816a6b7a6dcc83f9e7400ac3048494dadca302 | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/StorageRef.java#L372-L379 |
149,334 | realtime-framework/RealtimeStorage-Android | library/src/main/java/co/realtime/storage/StorageRef.java | StorageRef.isAuthenticated | public StorageRef isAuthenticated(String authenticationToken, OnBooleanResponse onBooleanResponse, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
Rest r = new Rest(context, RestType.ISAUTHENTICATED, pbb, null);
r.onError = onError;
r.onBooleanResponse = onBooleanResponse;
r.rawBody = "{... | java | public StorageRef isAuthenticated(String authenticationToken, OnBooleanResponse onBooleanResponse, OnError onError){
PostBodyBuilder pbb = new PostBodyBuilder(context);
Rest r = new Rest(context, RestType.ISAUTHENTICATED, pbb, null);
r.onError = onError;
r.onBooleanResponse = onBooleanResponse;
r.rawBody = "{... | [
"public",
"StorageRef",
"isAuthenticated",
"(",
"String",
"authenticationToken",
",",
"OnBooleanResponse",
"onBooleanResponse",
",",
"OnError",
"onError",
")",
"{",
"PostBodyBuilder",
"pbb",
"=",
"new",
"PostBodyBuilder",
"(",
"context",
")",
";",
"Rest",
"r",
"=",
... | Checks if a specified authentication token is authenticated.
<pre>
StorageRef storage = new StorageRef("your_app_key", "your_token");
storage.isAuthenticated("authToken",new OnBooleanResponse() {
@Override
public void run(Boolean aBoolean) {
Log.d("StorageRef", "Is Authenticated? : " + aBoolean);
}
}, new OnErro... | [
"Checks",
"if",
"a",
"specified",
"authentication",
"token",
"is",
"authenticated",
"."
] | 05816a6b7a6dcc83f9e7400ac3048494dadca302 | https://github.com/realtime-framework/RealtimeStorage-Android/blob/05816a6b7a6dcc83f9e7400ac3048494dadca302/library/src/main/java/co/realtime/storage/StorageRef.java#L408-L416 |
149,335 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java | ProcessedInput.setSqlParameterValues | public void setSqlParameterValues(List<Object> sqlParameterValues) {
if (sqlParameterValues != null) {
this.sqlParameterValues = new ArrayList<Object>(sqlParameterValues);
} else {
this.sqlParameterValues = null;
}
} | java | public void setSqlParameterValues(List<Object> sqlParameterValues) {
if (sqlParameterValues != null) {
this.sqlParameterValues = new ArrayList<Object>(sqlParameterValues);
} else {
this.sqlParameterValues = null;
}
} | [
"public",
"void",
"setSqlParameterValues",
"(",
"List",
"<",
"Object",
">",
"sqlParameterValues",
")",
"{",
"if",
"(",
"sqlParameterValues",
"!=",
"null",
")",
"{",
"this",
".",
"sqlParameterValues",
"=",
"new",
"ArrayList",
"<",
"Object",
">",
"(",
"sqlParame... | Sets list of parameter values
@param sqlParameterValues list of parameter values | [
"Sets",
"list",
"of",
"parameter",
"values"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java#L230-L236 |
149,336 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java | ProcessedInput.getParameterName | public String getParameterName(Integer position) {
String name = null;
if (this.sqlParameterNames != null) {
name = this.sqlParameterNames.get(position);
}
return name;
} | java | public String getParameterName(Integer position) {
String name = null;
if (this.sqlParameterNames != null) {
name = this.sqlParameterNames.get(position);
}
return name;
} | [
"public",
"String",
"getParameterName",
"(",
"Integer",
"position",
")",
"{",
"String",
"name",
"=",
"null",
";",
"if",
"(",
"this",
".",
"sqlParameterNames",
"!=",
"null",
")",
"{",
"name",
"=",
"this",
".",
"sqlParameterNames",
".",
"get",
"(",
"position... | Returns parameter name by specifying it's position
@param position position of parameter
@return name of parameter, null if list of names is empty | [
"Returns",
"parameter",
"name",
"by",
"specifying",
"it",
"s",
"position"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java#L263-L271 |
149,337 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java | ProcessedInput.getAmountOfParameters | public Integer getAmountOfParameters() {
Integer size = 0;
if (this.sqlParameterNames != null) {
size = this.sqlParameterNames.size();
}
return size;
} | java | public Integer getAmountOfParameters() {
Integer size = 0;
if (this.sqlParameterNames != null) {
size = this.sqlParameterNames.size();
}
return size;
} | [
"public",
"Integer",
"getAmountOfParameters",
"(",
")",
"{",
"Integer",
"size",
"=",
"0",
";",
"if",
"(",
"this",
".",
"sqlParameterNames",
"!=",
"null",
")",
"{",
"size",
"=",
"this",
".",
"sqlParameterNames",
".",
"size",
"(",
")",
";",
"}",
"return",
... | Returns amount of parameters specified in this instance of ProcessedInput
@return amount of parameters | [
"Returns",
"amount",
"of",
"parameters",
"specified",
"in",
"this",
"instance",
"of",
"ProcessedInput"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java#L278-L285 |
149,338 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java | ProcessedInput.fillParameterValues | public void fillParameterValues(Map<String, Object> valuesMap) {
AssertUtils.assertNotNull(valuesMap, "Value map cannot be null");
if (this.sqlParameterNames != null) {
String parameterName = null;
this.sqlParameterValues = new ArrayList<Object>();
// using... | java | public void fillParameterValues(Map<String, Object> valuesMap) {
AssertUtils.assertNotNull(valuesMap, "Value map cannot be null");
if (this.sqlParameterNames != null) {
String parameterName = null;
this.sqlParameterValues = new ArrayList<Object>();
// using... | [
"public",
"void",
"fillParameterValues",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"valuesMap",
")",
"{",
"AssertUtils",
".",
"assertNotNull",
"(",
"valuesMap",
",",
"\"Value map cannot be null\"",
")",
";",
"if",
"(",
"this",
".",
"sqlParameterNames",
"!="... | Utility function.
Fills this ProcessedInput with values.
This function iterates over parameter names list and loads corresponding value from MAp
@param valuesMap Map of values which would be loaded | [
"Utility",
"function",
".",
"Fills",
"this",
"ProcessedInput",
"with",
"values",
".",
"This",
"function",
"iterates",
"over",
"parameter",
"names",
"list",
"and",
"loads",
"corresponding",
"value",
"from",
"MAp"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/model/ProcessedInput.java#L316-L336 |
149,339 | wb14123/bard | bard-util/bard-user/src/main/java/com/bardframework/bard/util/user/TokenStorage.java | TokenStorage.put | public static String put(String username, final int seconds) {
String key = UUID.randomUUID().toString();
cache.setex(key, seconds, username);
return key;
} | java | public static String put(String username, final int seconds) {
String key = UUID.randomUUID().toString();
cache.setex(key, seconds, username);
return key;
} | [
"public",
"static",
"String",
"put",
"(",
"String",
"username",
",",
"final",
"int",
"seconds",
")",
"{",
"String",
"key",
"=",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
";",
"cache",
".",
"setex",
"(",
"key",
",",
"seconds",
",... | Put username into the token storage with an expire time.
@param username The username.
@param seconds The expire time in second.
@return Then generated token. | [
"Put",
"username",
"into",
"the",
"token",
"storage",
"with",
"an",
"expire",
"time",
"."
] | 98618ae31fd80000c794661b4c130af1b1298d9b | https://github.com/wb14123/bard/blob/98618ae31fd80000c794661b4c130af1b1298d9b/bard-util/bard-user/src/main/java/com/bardframework/bard/util/user/TokenStorage.java#L21-L25 |
149,340 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/xml/XmlInputOutputHandler.java | XmlInputOutputHandler.primitiveAmount | private int primitiveAmount(Object... values) {
int result = 0;
for (int i = 0; i < values.length; i++) {
if (MappingUtils.isPrimitive(values[i]) == true) {
result++;
}
}
return result;
} | java | private int primitiveAmount(Object... values) {
int result = 0;
for (int i = 0; i < values.length; i++) {
if (MappingUtils.isPrimitive(values[i]) == true) {
result++;
}
}
return result;
} | [
"private",
"int",
"primitiveAmount",
"(",
"Object",
"...",
"values",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"values",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"MappingUtils",
".",
"is... | Iterates over values and returns amount of primitive values in it.
Used to check if values supplied via constructors aren't mixed, as only primitive or complex types are allows
@param values values which should be counted
@return amount of primitive values | [
"Iterates",
"over",
"values",
"and",
"returns",
"amount",
"of",
"primitive",
"values",
"in",
"it",
".",
"Used",
"to",
"check",
"if",
"values",
"supplied",
"via",
"constructors",
"aren",
"t",
"mixed",
"as",
"only",
"primitive",
"or",
"complex",
"types",
"are"... | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/xml/XmlInputOutputHandler.java#L243-L253 |
149,341 | Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/FoxHttpResponse.java | FoxHttpResponse.getStringBody | public String getStringBody(Charset charset) throws IOException {
BufferedReader rd = new BufferedReader(new InputStreamReader(getInputStreamBody(), charset));
String line;
StringBuilder response = new StringBuilder();
while ((line = rd.readLine()) != null) {
if (response.len... | java | public String getStringBody(Charset charset) throws IOException {
BufferedReader rd = new BufferedReader(new InputStreamReader(getInputStreamBody(), charset));
String line;
StringBuilder response = new StringBuilder();
while ((line = rd.readLine()) != null) {
if (response.len... | [
"public",
"String",
"getStringBody",
"(",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"rd",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"getInputStreamBody",
"(",
")",
",",
"charset",
")",
")",
";",
"String"... | Get the response body as string
@param charset charset for the byte to String conversion
@return body as string
@throws IOException if the stream is not accessible | [
"Get",
"the",
"response",
"body",
"as",
"string"
] | d3f7d0df65e2e75861fc7db938090683f2cdf919 | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/FoxHttpResponse.java#L86-L98 |
149,342 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/BeanMapOutputHandler.java | BeanMapOutputHandler.createRow | @Override
protected V createRow(QueryParameters params) throws MjdbcException {
return this.outputProcessor.toBean(params, type);
} | java | @Override
protected V createRow(QueryParameters params) throws MjdbcException {
return this.outputProcessor.toBean(params, type);
} | [
"@",
"Override",
"protected",
"V",
"createRow",
"(",
"QueryParameters",
"params",
")",
"throws",
"MjdbcException",
"{",
"return",
"this",
".",
"outputProcessor",
".",
"toBean",
"(",
"params",
",",
"type",
")",
";",
"}"
] | Converts query output into Map of Beans.
@param params query output row
@return Map of Beans converted from query output
@throws org.midao.jdbc.core.exception.MjdbcException | [
"Converts",
"query",
"output",
"into",
"Map",
"of",
"Beans",
"."
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/BeanMapOutputHandler.java#L110-L113 |
149,343 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java | BaseMetadataHandler.updateCache | public int updateCache(DatabaseMetaData metaData, String catalogName, String schemaName, String procedureName) throws SQLException {
String dbProductName = MetadataUtils.processDatabaseProductName(metaData.getDatabaseProductName());
ResultSet procedures = null;
ResultSet procedureParameters... | java | public int updateCache(DatabaseMetaData metaData, String catalogName, String schemaName, String procedureName) throws SQLException {
String dbProductName = MetadataUtils.processDatabaseProductName(metaData.getDatabaseProductName());
ResultSet procedures = null;
ResultSet procedureParameters... | [
"public",
"int",
"updateCache",
"(",
"DatabaseMetaData",
"metaData",
",",
"String",
"catalogName",
",",
"String",
"schemaName",
",",
"String",
"procedureName",
")",
"throws",
"SQLException",
"{",
"String",
"dbProductName",
"=",
"MetadataUtils",
".",
"processDatabasePr... | Function which is responsible for retrieving Stored Procedure parameters and storage it into cache.
This function doesn't perform cache read - only cache update.
@param metaData Database Metadata description class
@param catalogName Database Catalog
@param schemaName Database Schema
@param procedureName Proc... | [
"Function",
"which",
"is",
"responsible",
"for",
"retrieving",
"Stored",
"Procedure",
"parameters",
"and",
"storage",
"it",
"into",
"cache",
".",
"This",
"function",
"doesn",
"t",
"perform",
"cache",
"read",
"-",
"only",
"cache",
"update",
"."
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java#L91-L154 |
149,344 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java | BaseMetadataHandler.processCatalogName | private String processCatalogName(String dbProvideName, String userName, String catalogName) {
String result = null;
if (catalogName != null) {
result = catalogName.toUpperCase();
} else {
if ("Oracle".equals(dbProvideName) == true) {
// SPRING: Or... | java | private String processCatalogName(String dbProvideName, String userName, String catalogName) {
String result = null;
if (catalogName != null) {
result = catalogName.toUpperCase();
} else {
if ("Oracle".equals(dbProvideName) == true) {
// SPRING: Or... | [
"private",
"String",
"processCatalogName",
"(",
"String",
"dbProvideName",
",",
"String",
"userName",
",",
"String",
"catalogName",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"catalogName",
"!=",
"null",
")",
"{",
"result",
"=",
"catalogName",
... | Processes Catalog name so it would be compatible with database
@param dbProvideName short database name
@param userName user name
@param catalogName catalog name which would be processed
@return processed catalog name | [
"Processes",
"Catalog",
"name",
"so",
"it",
"would",
"be",
"compatible",
"with",
"database"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java#L229-L242 |
149,345 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java | BaseMetadataHandler.processSchemaName | private String processSchemaName(String dbProductName, String userName, String schemaName) {
String result = null;
if (schemaName != null) {
result = schemaName.toUpperCase();
} else {
if ("DB2".equals(dbProductName) == true || "Apache Derby".equals(dbProductName) ... | java | private String processSchemaName(String dbProductName, String userName, String schemaName) {
String result = null;
if (schemaName != null) {
result = schemaName.toUpperCase();
} else {
if ("DB2".equals(dbProductName) == true || "Apache Derby".equals(dbProductName) ... | [
"private",
"String",
"processSchemaName",
"(",
"String",
"dbProductName",
",",
"String",
"userName",
",",
"String",
"schemaName",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"schemaName",
"!=",
"null",
")",
"{",
"result",
"=",
"schemaName",
".... | Processes Schema name so it would be compatible with database
@param dbProductName short database name
@param userName user name
@param schemaName schema name which would be processed
@return processed schema name | [
"Processes",
"Schema",
"name",
"so",
"it",
"would",
"be",
"compatible",
"with",
"database"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java#L252-L269 |
149,346 | jiaqi/caff | src/main/java/org/cyclopsgroup/caff/ref/ValueReferenceScanner.java | ValueReferenceScanner.scanForAnnotation | public <H extends Annotation> void scanForAnnotation(
Class<H> expectedAnnotation, Listener<T, H> listener) {
BeanInfo beanInfo;
try {
beanInfo = Introspector.getBeanInfo(beanType);
} catch (IntrospectionException e) {
throw new RuntimeException("Can't get bean info of " + beanType);
}... | java | public <H extends Annotation> void scanForAnnotation(
Class<H> expectedAnnotation, Listener<T, H> listener) {
BeanInfo beanInfo;
try {
beanInfo = Introspector.getBeanInfo(beanType);
} catch (IntrospectionException e) {
throw new RuntimeException("Can't get bean info of " + beanType);
}... | [
"public",
"<",
"H",
"extends",
"Annotation",
">",
"void",
"scanForAnnotation",
"(",
"Class",
"<",
"H",
">",
"expectedAnnotation",
",",
"Listener",
"<",
"T",
",",
"H",
">",
"listener",
")",
"{",
"BeanInfo",
"beanInfo",
";",
"try",
"{",
"beanInfo",
"=",
"I... | Scan given class and look for possible references annotated by given annotation
@param <H> Only field or method annotated with this annotation is inspected
@param expectedAnnotation Only field or method annotated with this annotation is inspected
@param listener Listener to handle found references | [
"Scan",
"given",
"class",
"and",
"look",
"for",
"possible",
"references",
"annotated",
"by",
"given",
"annotation"
] | dba4b937a0afc844eb37ccf74dd04dd78f0c1314 | https://github.com/jiaqi/caff/blob/dba4b937a0afc844eb37ccf74dd04dd78f0c1314/src/main/java/org/cyclopsgroup/caff/ref/ValueReferenceScanner.java#L71-L100 |
149,347 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.cache | public T cache(T item) {
HashMap<String,Object> keys;
if( item == null ) {
throw new NullPointerException("Multi caches may not have null values.");
}
keys = getKeys(item);
synchronized( this ) {
item = getCurrent(item);
for( String key : cach... | java | public T cache(T item) {
HashMap<String,Object> keys;
if( item == null ) {
throw new NullPointerException("Multi caches may not have null values.");
}
keys = getKeys(item);
synchronized( this ) {
item = getCurrent(item);
for( String key : cach... | [
"public",
"T",
"cache",
"(",
"T",
"item",
")",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"keys",
";",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Multi caches may not have null values.\"",
")",
";",
"... | Places the specified item in the cache. It will not replace an existing
item in the cache. Instead, if an item already exists in the cache, it
will make sure that item is cached across all identifiers and then return
the cached item.
@param item the item to be cached
@return whatever item is in the cache after this ope... | [
"Places",
"the",
"specified",
"item",
"in",
"the",
"cache",
".",
"It",
"will",
"not",
"replace",
"an",
"existing",
"item",
"in",
"the",
"cache",
".",
"Instead",
"if",
"an",
"item",
"already",
"exists",
"in",
"the",
"cache",
"it",
"will",
"make",
"sure",
... | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L149-L165 |
149,348 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.find | public T find(Map<String,Object> vals) {
String key = order.get(0);
Object val = vals.get(key);
CacheLoader<T> loader;
if( val == null ) {
throw new CacheManagementException("No value specified for key: " + key);
}
loader = new MapLoader<T>(target);
... | java | public T find(Map<String,Object> vals) {
String key = order.get(0);
Object val = vals.get(key);
CacheLoader<T> loader;
if( val == null ) {
throw new CacheManagementException("No value specified for key: " + key);
}
loader = new MapLoader<T>(target);
... | [
"public",
"T",
"find",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"vals",
")",
"{",
"String",
"key",
"=",
"order",
".",
"get",
"(",
"0",
")",
";",
"Object",
"val",
"=",
"vals",
".",
"get",
"(",
"key",
")",
";",
"CacheLoader",
"<",
"T",
">",... | Finds the object in the cache matching the values in the specified value map.
If a matching argument is not in the cache, this method will instantiate an
instance of the object and assign the mapping values to that instantiated
object. In order for this to work, the keys in this mapping must have the same
names as the ... | [
"Finds",
"the",
"object",
"in",
"the",
"cache",
"matching",
"the",
"values",
"in",
"the",
"specified",
"value",
"map",
".",
"If",
"a",
"matching",
"argument",
"is",
"not",
"in",
"the",
"cache",
"this",
"method",
"will",
"instantiate",
"an",
"instance",
"of... | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L189-L199 |
149,349 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.find | public T find(String key, Object val, CacheLoader<T> loader, Object ... args) {
ConcurrentCache<Object,T> cache = caches.get(key);
T item;
if( val instanceof BigDecimal ) {
val = ((BigDecimal)val).longValue();
}
item = cache.get(val);
if( item == null && loa... | java | public T find(String key, Object val, CacheLoader<T> loader, Object ... args) {
ConcurrentCache<Object,T> cache = caches.get(key);
T item;
if( val instanceof BigDecimal ) {
val = ((BigDecimal)val).longValue();
}
item = cache.get(val);
if( item == null && loa... | [
"public",
"T",
"find",
"(",
"String",
"key",
",",
"Object",
"val",
",",
"CacheLoader",
"<",
"T",
">",
"loader",
",",
"Object",
"...",
"args",
")",
"{",
"ConcurrentCache",
"<",
"Object",
",",
"T",
">",
"cache",
"=",
"caches",
".",
"get",
"(",
"key",
... | Seeks the item from the cache that is identified by the specified key having
the specified value. If no match is found, the specified loader will be called
with the specified arguments in order to place an instantiated item into the cache.
@param key the name of the unique identifier attribute whose value you have
@par... | [
"Seeks",
"the",
"item",
"from",
"the",
"cache",
"that",
"is",
"identified",
"by",
"the",
"specified",
"key",
"having",
"the",
"specified",
"value",
".",
"If",
"no",
"match",
"is",
"found",
"the",
"specified",
"loader",
"will",
"be",
"called",
"with",
"the"... | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L256-L275 |
149,350 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.getCurrent | private T getCurrent(T item) {
for( String key: order ) {
ConcurrentCache<Object,T> cache = caches.get(key);
Object val = getValue(key, item);
T tmp;
if( val instanceof BigDecimal ) {
val = ((BigDecimal)val).longValue();
}
... | java | private T getCurrent(T item) {
for( String key: order ) {
ConcurrentCache<Object,T> cache = caches.get(key);
Object val = getValue(key, item);
T tmp;
if( val instanceof BigDecimal ) {
val = ((BigDecimal)val).longValue();
}
... | [
"private",
"T",
"getCurrent",
"(",
"T",
"item",
")",
"{",
"for",
"(",
"String",
"key",
":",
"order",
")",
"{",
"ConcurrentCache",
"<",
"Object",
",",
"T",
">",
"cache",
"=",
"caches",
".",
"get",
"(",
"key",
")",
";",
"Object",
"val",
"=",
"getValu... | Provides the current version of the specified item stored in the cache.
If no item matches the passed in item, then the passed in item is returned
but not cached. This better be called from a synchronized block!
@param item the item being sought
@return the currently cached object that is equivalent to the passed in ob... | [
"Provides",
"the",
"current",
"version",
"of",
"the",
"specified",
"item",
"stored",
"in",
"the",
"cache",
".",
"If",
"no",
"item",
"matches",
"the",
"passed",
"in",
"item",
"then",
"the",
"passed",
"in",
"item",
"is",
"returned",
"but",
"not",
"cached",
... | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L284-L306 |
149,351 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.getKeys | public HashMap<String,Object> getKeys(T item) {
HashMap<String,Object> keys = new HashMap<String,Object>();
for( String key: caches.keySet() ) {
keys.put(key, getValue(key, item));
}
return keys;
} | java | public HashMap<String,Object> getKeys(T item) {
HashMap<String,Object> keys = new HashMap<String,Object>();
for( String key: caches.keySet() ) {
keys.put(key, getValue(key, item));
}
return keys;
} | [
"public",
"HashMap",
"<",
"String",
",",
"Object",
">",
"getKeys",
"(",
"T",
"item",
")",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"keys",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"for",
"(",
"String",
"key... | Provides the values for all of the unique identifiers managed by the cache.
@param item the item whose key values are being sought
@return a mapping of key names to item values | [
"Provides",
"the",
"values",
"for",
"all",
"of",
"the",
"unique",
"identifiers",
"managed",
"by",
"the",
"cache",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L313-L320 |
149,352 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.getValue | private Object getValue(String key, T item) {
Class cls = item.getClass();
while( true ) {
try {
Field f = cls.getDeclaredField(key);
int m = f.getModifiers();
if( Modifier.isTransient(m) || Modifier.isStatic(m) ) {
return... | java | private Object getValue(String key, T item) {
Class cls = item.getClass();
while( true ) {
try {
Field f = cls.getDeclaredField(key);
int m = f.getModifiers();
if( Modifier.isTransient(m) || Modifier.isStatic(m) ) {
return... | [
"private",
"Object",
"getValue",
"(",
"String",
"key",
",",
"T",
"item",
")",
"{",
"Class",
"cls",
"=",
"item",
".",
"getClass",
"(",
")",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"cls",
".",
"getDeclaredField",
"(",
"key... | Provides the actual value for the specified unique ID key for the specified object.
@param key the name of the unique identifier
@param item the object who's unique identifier value is sought
@return the unique identifier for the object's attribute matching the key | [
"Provides",
"the",
"actual",
"value",
"for",
"the",
"specified",
"unique",
"ID",
"key",
"for",
"the",
"specified",
"object",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L332-L378 |
149,353 | greese/dasein-util | src/main/java/org/dasein/util/ConcurrentMultiCache.java | ConcurrentMultiCache.put | private void put(T item) {
HashMap<String,Object> keys;
if( item == null ) {
throw new NullPointerException("Multi caches may not have null values.");
}
keys = getKeys(item);
synchronized( this ) {
for( String key : caches.keySet() ) {
Con... | java | private void put(T item) {
HashMap<String,Object> keys;
if( item == null ) {
throw new NullPointerException("Multi caches may not have null values.");
}
keys = getKeys(item);
synchronized( this ) {
for( String key : caches.keySet() ) {
Con... | [
"private",
"void",
"put",
"(",
"T",
"item",
")",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"keys",
";",
"if",
"(",
"item",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Multi caches may not have null values.\"",
")",
";",
... | Places the specified item into the cache regardless of current cache state.
@param item the item being placed into the cache | [
"Places",
"the",
"specified",
"item",
"into",
"the",
"cache",
"regardless",
"of",
"current",
"cache",
"state",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/ConcurrentMultiCache.java#L384-L402 |
149,354 | greese/dasein-util | src/main/java/org/dasein/util/Cache.java | Cache.cache | public void cache(Object key, T val) {
cache.put(key, new SoftReference<T>(val));
} | java | public void cache(Object key, T val) {
cache.put(key, new SoftReference<T>(val));
} | [
"public",
"void",
"cache",
"(",
"Object",
"key",
",",
"T",
"val",
")",
"{",
"cache",
".",
"put",
"(",
"key",
",",
"new",
"SoftReference",
"<",
"T",
">",
"(",
"val",
")",
")",
";",
"}"
] | Caches the specified object identified by the specified key.
@param key a unique key for this object
@param val the object to be cached | [
"Caches",
"the",
"specified",
"object",
"identified",
"by",
"the",
"specified",
"key",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/Cache.java#L90-L92 |
149,355 | greese/dasein-util | src/main/java/org/dasein/util/Cache.java | Cache.containsAll | public boolean containsAll(Collection<?> coll) {
for( Object item : coll ) {
if( !contains(item) ) {
return false;
}
}
return true;
} | java | public boolean containsAll(Collection<?> coll) {
for( Object item : coll ) {
if( !contains(item) ) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"containsAll",
"(",
"Collection",
"<",
"?",
">",
"coll",
")",
"{",
"for",
"(",
"Object",
"item",
":",
"coll",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"item",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"return",
"true",... | Checks the passed in collection and determines if all elements
of that collection are contained within this cache. Care should
be taken in reading too much into a failure. If one of the elements
was once in this cache but has expired due to inactivity, this
method will return false.
@param coll the collection to test
@... | [
"Checks",
"the",
"passed",
"in",
"collection",
"and",
"determines",
"if",
"all",
"elements",
"of",
"that",
"collection",
"are",
"contained",
"within",
"this",
"cache",
".",
"Care",
"should",
"be",
"taken",
"in",
"reading",
"too",
"much",
"into",
"a",
"failur... | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/Cache.java#L134-L141 |
149,356 | greese/dasein-util | src/main/java/org/dasein/util/Cache.java | Cache.containsKey | public boolean containsKey(Object key) {
if( !cache.containsKey(key) ) {
return false;
}
else {
SoftReference<T> ref = cache.get(key);
T ob = ref.get();
if( ob == null ) {
release(key);
return false;
... | java | public boolean containsKey(Object key) {
if( !cache.containsKey(key) ) {
return false;
}
else {
SoftReference<T> ref = cache.get(key);
T ob = ref.get();
if( ob == null ) {
release(key);
return false;
... | [
"public",
"boolean",
"containsKey",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"!",
"cache",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"SoftReference",
"<",
"T",
">",
"ref",
"=",
"cache",
".",
"get",
"... | Checks if an object with the specified key is in the cache.
@param key the object's identifier
@return true if the object is in the cache | [
"Checks",
"if",
"an",
"object",
"with",
"the",
"specified",
"key",
"is",
"in",
"the",
"cache",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/Cache.java#L148-L168 |
149,357 | workplacesystems/queuj | src/main/java/com/workplacesystems/queuj/ProcessBuilder.java | ProcessBuilder.newProcess | public <K extends Serializable & Comparable> Process<K> newProcess()
{
final String queueOwner = partition == null ? null : partition.getQueueOwnerKey();
Callback<ProcessWrapper<K>> callback = new Callback<ProcessWrapper<K>>() {
@Override
protected void doAction() {
... | java | public <K extends Serializable & Comparable> Process<K> newProcess()
{
final String queueOwner = partition == null ? null : partition.getQueueOwnerKey();
Callback<ProcessWrapper<K>> callback = new Callback<ProcessWrapper<K>>() {
@Override
protected void doAction() {
... | [
"public",
"<",
"K",
"extends",
"Serializable",
"&",
"Comparable",
">",
"Process",
"<",
"K",
">",
"newProcess",
"(",
")",
"{",
"final",
"String",
"queueOwner",
"=",
"partition",
"==",
"null",
"?",
"null",
":",
"partition",
".",
"getQueueOwnerKey",
"(",
")",... | Creates the Process using the parameters that have been set. | [
"Creates",
"the",
"Process",
"using",
"the",
"parameters",
"that",
"have",
"been",
"set",
"."
] | 4293116b412b4a20ead99963b9b05a135812c501 | https://github.com/workplacesystems/queuj/blob/4293116b412b4a20ead99963b9b05a135812c501/src/main/java/com/workplacesystems/queuj/ProcessBuilder.java#L341-L378 |
149,358 | jiaqi/caff | src/main/java/org/cyclopsgroup/caff/format/FixLengthImpl.java | FixLengthImpl.print | char[] print(T bean) {
char[] output = new char[type.length()];
Arrays.fill(output, type.fill());
for (Slot slot : slots.values()) {
if (!slot.reference.isReadable()) {
continue;
}
Object value = slot.reference.readValue(bean);
CharSequence content = slot.converter.toCharacte... | java | char[] print(T bean) {
char[] output = new char[type.length()];
Arrays.fill(output, type.fill());
for (Slot slot : slots.values()) {
if (!slot.reference.isReadable()) {
continue;
}
Object value = slot.reference.readValue(bean);
CharSequence content = slot.converter.toCharacte... | [
"char",
"[",
"]",
"print",
"(",
"T",
"bean",
")",
"{",
"char",
"[",
"]",
"output",
"=",
"new",
"char",
"[",
"type",
".",
"length",
"(",
")",
"]",
";",
"Arrays",
".",
"fill",
"(",
"output",
",",
"type",
".",
"fill",
"(",
")",
")",
";",
"for",
... | Print bean into given char array FIXME It's not completely working yet
@param bean Bean to print
@return Char array of result | [
"Print",
"bean",
"into",
"given",
"char",
"array",
"FIXME",
"It",
"s",
"not",
"completely",
"working",
"yet"
] | dba4b937a0afc844eb37ccf74dd04dd78f0c1314 | https://github.com/jiaqi/caff/blob/dba4b937a0afc844eb37ccf74dd04dd78f0c1314/src/main/java/org/cyclopsgroup/caff/format/FixLengthImpl.java#L99-L114 |
149,359 | progolden/vraptor-boilerplate | vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/i18n/MessageBundle.java | MessageBundle.formatMessage | public String formatMessage(String key, Object[] args) {
try {
String raw = this.getMessage(key);
return MessageFormat.format(raw, args);
} catch (MissingResourceException ex) {
return "???!"+key+"!???";
}
} | java | public String formatMessage(String key, Object[] args) {
try {
String raw = this.getMessage(key);
return MessageFormat.format(raw, args);
} catch (MissingResourceException ex) {
return "???!"+key+"!???";
}
} | [
"public",
"String",
"formatMessage",
"(",
"String",
"key",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"String",
"raw",
"=",
"this",
".",
"getMessage",
"(",
"key",
")",
";",
"return",
"MessageFormat",
".",
"format",
"(",
"raw",
",",
"args",
... | Retorna uma mensagem formatada utilizando o MessageFormat.
@param key Chave da mesnagem.
@param args Parametros a serem inseridos na mensagem.
@return Mensagem formatada inserindo os argumentos no template estático obtivdo do arquivo de propriedades. | [
"Retorna",
"uma",
"mensagem",
"formatada",
"utilizando",
"o",
"MessageFormat",
"."
] | 3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07 | https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/i18n/MessageBundle.java#L80-L87 |
149,360 | Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java | RequestMultipartBody.addFilePart | public void addFilePart(String fieldName, File uploadFile) throws FileNotFoundException {
stream.put(fieldName, new NamedInputStream(uploadFile.getName(), new FileInputStream(uploadFile), "binary", URLConnection.guessContentTypeFromName(uploadFile.getName())));
} | java | public void addFilePart(String fieldName, File uploadFile) throws FileNotFoundException {
stream.put(fieldName, new NamedInputStream(uploadFile.getName(), new FileInputStream(uploadFile), "binary", URLConnection.guessContentTypeFromName(uploadFile.getName())));
} | [
"public",
"void",
"addFilePart",
"(",
"String",
"fieldName",
",",
"File",
"uploadFile",
")",
"throws",
"FileNotFoundException",
"{",
"stream",
".",
"put",
"(",
"fieldName",
",",
"new",
"NamedInputStream",
"(",
"uploadFile",
".",
"getName",
"(",
")",
",",
"new"... | Adds a file to the request
@param fieldName name attribute
@param uploadFile a File to be uploaded
@throws FileNotFoundException | [
"Adds",
"a",
"file",
"to",
"the",
"request"
] | d3f7d0df65e2e75861fc7db938090683f2cdf919 | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java#L141-L143 |
149,361 | Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java | RequestMultipartBody.addInputStreamPart | public void addInputStreamPart(String name, String inputStreamName, InputStream inputStream, String contentTransferEncoding, String contentType) {
stream.put(name, new NamedInputStream(inputStreamName, inputStream, contentTransferEncoding, contentType));
} | java | public void addInputStreamPart(String name, String inputStreamName, InputStream inputStream, String contentTransferEncoding, String contentType) {
stream.put(name, new NamedInputStream(inputStreamName, inputStream, contentTransferEncoding, contentType));
} | [
"public",
"void",
"addInputStreamPart",
"(",
"String",
"name",
",",
"String",
"inputStreamName",
",",
"InputStream",
"inputStream",
",",
"String",
"contentTransferEncoding",
",",
"String",
"contentType",
")",
"{",
"stream",
".",
"put",
"(",
"name",
",",
"new",
"... | Adds an inputstream to te request
@param name
@param inputStreamName
@param inputStream
@param contentTransferEncoding usually binary
@param contentType | [
"Adds",
"an",
"inputstream",
"to",
"te",
"request"
] | d3f7d0df65e2e75861fc7db938090683f2cdf919 | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/body/request/RequestMultipartBody.java#L154-L156 |
149,362 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.toHashMap | public static <T, K> HashMap<K, T> toHashMap(Collection<T> entities,
Function<T, K> keyMapper) {
return toMap(entities, keyMapper, HashMap<K, T>::new);
} | java | public static <T, K> HashMap<K, T> toHashMap(Collection<T> entities,
Function<T, K> keyMapper) {
return toMap(entities, keyMapper, HashMap<K, T>::new);
} | [
"public",
"static",
"<",
"T",
",",
"K",
">",
"HashMap",
"<",
"K",
",",
"T",
">",
"toHashMap",
"(",
"Collection",
"<",
"T",
">",
"entities",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keyMapper",
")",
"{",
"return",
"toMap",
"(",
"entities",
",",
... | Convert a collection to HashMap, The key is decided by keyMapper, value
is the object in collection
@param entities
@param keyMapper
@return | [
"Convert",
"a",
"collection",
"to",
"HashMap",
"The",
"key",
"is",
"decided",
"by",
"keyMapper",
"value",
"is",
"the",
"object",
"in",
"collection"
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L98-L101 |
149,363 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.toHashtable | public static <T, K> Hashtable<K, T> toHashtable(Collection<T> entities,
Function<T, K> keyMapper) {
return toMap(entities, keyMapper, Hashtable<K, T>::new);
} | java | public static <T, K> Hashtable<K, T> toHashtable(Collection<T> entities,
Function<T, K> keyMapper) {
return toMap(entities, keyMapper, Hashtable<K, T>::new);
} | [
"public",
"static",
"<",
"T",
",",
"K",
">",
"Hashtable",
"<",
"K",
",",
"T",
">",
"toHashtable",
"(",
"Collection",
"<",
"T",
">",
"entities",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keyMapper",
")",
"{",
"return",
"toMap",
"(",
"entities",
","... | Convert a collection to Hashtable. The key is decided by keyMapper, value
is the object in collection
@param entities
@param keyMapper
@return | [
"Convert",
"a",
"collection",
"to",
"Hashtable",
".",
"The",
"key",
"is",
"decided",
"by",
"keyMapper",
"value",
"is",
"the",
"object",
"in",
"collection"
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L126-L129 |
149,364 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.groupTwice | public static <T, K, V, P, C extends Collection<V>> HashMap<K, HashMap<P, C>> groupTwice(
Collection<T> entities, Function<T, K> keyMapper1,
Function<T, P> keyMapper2, Function<T, V> valueMapper,
Supplier<C> collectionFactory) {
if (entities == null)
return null;
return entities.stream().collect(
... | java | public static <T, K, V, P, C extends Collection<V>> HashMap<K, HashMap<P, C>> groupTwice(
Collection<T> entities, Function<T, K> keyMapper1,
Function<T, P> keyMapper2, Function<T, V> valueMapper,
Supplier<C> collectionFactory) {
if (entities == null)
return null;
return entities.stream().collect(
... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"V",
",",
"P",
",",
"C",
"extends",
"Collection",
"<",
"V",
">",
">",
"HashMap",
"<",
"K",
",",
"HashMap",
"<",
"P",
",",
"C",
">",
">",
"groupTwice",
"(",
"Collection",
"<",
"T",
">",
"entities",
",... | Grouping into 2 levels
@param entities
@param keyMapper1
@param keyMapper2
@param valueMapper
@param collectionFactory
@return | [
"Grouping",
"into",
"2",
"levels"
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L204-L215 |
149,365 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.matrix | public static <T, K, V, P> HashMap<K, HashMap<P, V>> matrix(
Collection<T> entities, Function<T, K> keyMapper1,
Function<T, P> keyMapper2, Function<T, V> valueMapper) {
if (entities == null)
return null;
return entities.stream().collect(
Collectors.groupingBy(keyMapper1, HashMap::new, Collectors
... | java | public static <T, K, V, P> HashMap<K, HashMap<P, V>> matrix(
Collection<T> entities, Function<T, K> keyMapper1,
Function<T, P> keyMapper2, Function<T, V> valueMapper) {
if (entities == null)
return null;
return entities.stream().collect(
Collectors.groupingBy(keyMapper1, HashMap::new, Collectors
... | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"V",
",",
"P",
">",
"HashMap",
"<",
"K",
",",
"HashMap",
"<",
"P",
",",
"V",
">",
">",
"matrix",
"(",
"Collection",
"<",
"T",
">",
"entities",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keyMapper1",
... | Similar to grouping into 2 levels except each unit is not a Collection
but a single object
@param entities
@param keyMapper1
@param keyMapper2
@param valueMapper
@return | [
"Similar",
"to",
"grouping",
"into",
"2",
"levels",
"except",
"each",
"unit",
"is",
"not",
"a",
"Collection",
"but",
"a",
"single",
"object"
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L227-L236 |
149,366 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.toArray | public static <T, K> K[] toArray(Collection<T> entities,
Function<T, K> keyMapper, K[] arr) {
if (entities == null)
return null;
return entities.stream().map(keyMapper).toArray(size -> arr);
} | java | public static <T, K> K[] toArray(Collection<T> entities,
Function<T, K> keyMapper, K[] arr) {
if (entities == null)
return null;
return entities.stream().map(keyMapper).toArray(size -> arr);
} | [
"public",
"static",
"<",
"T",
",",
"K",
">",
"K",
"[",
"]",
"toArray",
"(",
"Collection",
"<",
"T",
">",
"entities",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keyMapper",
",",
"K",
"[",
"]",
"arr",
")",
"{",
"if",
"(",
"entities",
"==",
"null"... | Extract attribute from objects in collection and store them in array and
return.
@param entities
@param keyMapper
@param arr
@return | [
"Extract",
"attribute",
"from",
"objects",
"in",
"collection",
"and",
"store",
"them",
"in",
"array",
"and",
"return",
"."
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L247-L252 |
149,367 | yangjm/winlet | utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java | CollectionUtils.moveUp | public static <T, K> boolean moveUp(List<T> list, K key,
Function<T, K> keyMapper, int n) {
if (list == null)
return false;
ArrayList<T> newList = new ArrayList<T>();
boolean changed = false;
for (int i = 0; i < list.size(); i++) {
T item = list.get(i);
if (i > 0 && key.equals(keyMapper.ap... | java | public static <T, K> boolean moveUp(List<T> list, K key,
Function<T, K> keyMapper, int n) {
if (list == null)
return false;
ArrayList<T> newList = new ArrayList<T>();
boolean changed = false;
for (int i = 0; i < list.size(); i++) {
T item = list.get(i);
if (i > 0 && key.equals(keyMapper.ap... | [
"public",
"static",
"<",
"T",
",",
"K",
">",
"boolean",
"moveUp",
"(",
"List",
"<",
"T",
">",
"list",
",",
"K",
"key",
",",
"Function",
"<",
"T",
",",
"K",
">",
"keyMapper",
",",
"int",
"n",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"re... | Move an object in List up
@param list
@param key
@param keyMapper
@return | [
"Move",
"an",
"object",
"in",
"List",
"up"
] | 2126236f56858e283fa6ad69fe9279ee30f47b67 | https://github.com/yangjm/winlet/blob/2126236f56858e283fa6ad69fe9279ee30f47b67/utils/src/main/java/com/aggrepoint/utils/CollectionUtils.java#L262-L287 |
149,368 | geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java | CreateIconChoicePopup.translateMarker | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTranslation(size * (amountOfMarkers % imagePerRow), size * (amountOfMarkers / imagePerRow));
}
return shape;
} | java | private ClickableMarkerShape translateMarker(ClickableMarkerShape shape, int amountOfMarkers) {
if (amountOfMarkers % imagePerRow != 0) {
int size = choiceListImageSize + 6;
shape.setTranslation(size * (amountOfMarkers % imagePerRow), size * (amountOfMarkers / imagePerRow));
}
return shape;
} | [
"private",
"ClickableMarkerShape",
"translateMarker",
"(",
"ClickableMarkerShape",
"shape",
",",
"int",
"amountOfMarkers",
")",
"{",
"if",
"(",
"amountOfMarkers",
"%",
"imagePerRow",
"!=",
"0",
")",
"{",
"int",
"size",
"=",
"choiceListImageSize",
"+",
"6",
";",
... | used for displaying marker SVG elements in a drawing area.
@param shape
@param amountOfMarkers
@return | [
"used",
"for",
"displaying",
"marker",
"SVG",
"elements",
"in",
"a",
"drawing",
"area",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/CreateIconChoicePopup.java#L351-L357 |
149,369 | jiaqi/caff | src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java | ByteUtils.writeLong | public static void writeLong(long value, byte[] dest, int offset)
throws IllegalArgumentException {
if (dest.length < offset + 8) {
throw new IllegalArgumentException(
"Destination byte array does not have enough space to write long from offset " + offset);
}
long t = value;
for (i... | java | public static void writeLong(long value, byte[] dest, int offset)
throws IllegalArgumentException {
if (dest.length < offset + 8) {
throw new IllegalArgumentException(
"Destination byte array does not have enough space to write long from offset " + offset);
}
long t = value;
for (i... | [
"public",
"static",
"void",
"writeLong",
"(",
"long",
"value",
",",
"byte",
"[",
"]",
"dest",
",",
"int",
"offset",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"dest",
".",
"length",
"<",
"offset",
"+",
"8",
")",
"{",
"throw",
"new",
"Il... | Write long value to given byte array
@param value Value to write, it can be any long value
@param dest Destination byte array value is written to
@param offset The starting point of where the value is written
@throws IllegalArgumentException When input byte array doesn't have enough space to write a
long | [
"Write",
"long",
"value",
"to",
"given",
"byte",
"array"
] | dba4b937a0afc844eb37ccf74dd04dd78f0c1314 | https://github.com/jiaqi/caff/blob/dba4b937a0afc844eb37ccf74dd04dd78f0c1314/src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java#L20-L31 |
149,370 | jiaqi/caff | src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java | ByteUtils.readLong | public static long readLong(byte[] src, int offset) throws IllegalArgumentException {
if (src.length < offset) {
throw new IllegalArgumentException("There's nothing to read in src from offset " + offset);
}
long r = 0;
for (int i = offset, j = 0; i < src.length && j < 64; i++, j += 8) {
r +... | java | public static long readLong(byte[] src, int offset) throws IllegalArgumentException {
if (src.length < offset) {
throw new IllegalArgumentException("There's nothing to read in src from offset " + offset);
}
long r = 0;
for (int i = offset, j = 0; i < src.length && j < 64; i++, j += 8) {
r +... | [
"public",
"static",
"long",
"readLong",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"offset",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"src",
".",
"length",
"<",
"offset",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"There's ... | Read long value from given source byte array
@param src Source byte array value is read from
@param offset The starting point where value is read from
@return The long value
@throws IllegalArgumentException When the length of input byte array conflicts offset | [
"Read",
"long",
"value",
"from",
"given",
"source",
"byte",
"array"
] | dba4b937a0afc844eb37ccf74dd04dd78f0c1314 | https://github.com/jiaqi/caff/blob/dba4b937a0afc844eb37ccf74dd04dd78f0c1314/src/main/java/org/cyclopsgroup/caff/util/ByteUtils.java#L41-L51 |
149,371 | progolden/vraptor-boilerplate | vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java | GeneralUtils.getGMTTimeString | public static String getGMTTimeString(long milliSeconds) {
SimpleDateFormat sdf = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH);
return sdf.format(new Date(milliSeconds));
} | java | public static String getGMTTimeString(long milliSeconds) {
SimpleDateFormat sdf = new SimpleDateFormat("E, d MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH);
return sdf.format(new Date(milliSeconds));
} | [
"public",
"static",
"String",
"getGMTTimeString",
"(",
"long",
"milliSeconds",
")",
"{",
"SimpleDateFormat",
"sdf",
"=",
"new",
"SimpleDateFormat",
"(",
"\"E, d MMM yyyy HH:mm:ss 'GMT'\"",
",",
"Locale",
".",
"ENGLISH",
")",
";",
"return",
"sdf",
".",
"format",
"(... | Retorna uma data em GMT.
@param milliSeconds
@return | [
"Retorna",
"uma",
"data",
"em",
"GMT",
"."
] | 3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07 | https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java#L70-L73 |
149,372 | progolden/vraptor-boilerplate | vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java | GeneralUtils.toTitleCase | public static String toTitleCase(String text) {
StringBuilder str = new StringBuilder();
String[] words = text.trim().split("\\s");
for (int i = 0; i < words.length; i++) {
if (words[i].length() > 0) {
if (i > 0) {
str.append(" ");
}
String lower = words[i].toLowerCase(Locale.getDefault());
... | java | public static String toTitleCase(String text) {
StringBuilder str = new StringBuilder();
String[] words = text.trim().split("\\s");
for (int i = 0; i < words.length; i++) {
if (words[i].length() > 0) {
if (i > 0) {
str.append(" ");
}
String lower = words[i].toLowerCase(Locale.getDefault());
... | [
"public",
"static",
"String",
"toTitleCase",
"(",
"String",
"text",
")",
"{",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"[",
"]",
"words",
"=",
"text",
".",
"trim",
"(",
")",
".",
"split",
"(",
"\"\\\\s\"",
")",
";",... | Converte string para title case.
@param text
Texto a ser convertido.
@return Texto equivalente em title case. | [
"Converte",
"string",
"para",
"title",
"case",
"."
] | 3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07 | https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-utils/src/main/java/br/com/caelum/vraptor/boilerplate/util/GeneralUtils.java#L180-L202 |
149,373 | uniform-java/uniform | src/main/java/net/uniform/impl/utils/UniformUtils.java | UniformUtils.firstValue | public static <T> T firstValue(List<T> list) {
if (list != null && !list.isEmpty()) {
return list.get(0);
}
return null;
} | java | public static <T> T firstValue(List<T> list) {
if (list != null && !list.isEmpty()) {
return list.get(0);
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"firstValue",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"list",
"!=",
"null",
"&&",
"!",
"list",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"list",
".",
"get",
"(",
"0",
")",
";",
"}",... | Returns the first value of a list, or null if the list is empty.
@param <T> List type
@param list Input list
@return First value or null | [
"Returns",
"the",
"first",
"value",
"of",
"a",
"list",
"or",
"null",
"if",
"the",
"list",
"is",
"empty",
"."
] | 0b84f0db562253165bc06c69f631e464dca0cb48 | https://github.com/uniform-java/uniform/blob/0b84f0db562253165bc06c69f631e464dca0cb48/src/main/java/net/uniform/impl/utils/UniformUtils.java#L50-L55 |
149,374 | uniform-java/uniform | src/main/java/net/uniform/impl/utils/UniformUtils.java | UniformUtils.getBeanProperties | public static Map<String, Object> getBeanProperties(Object bean) {
Map<String, Object> props = new HashMap<>();
if (bean == null) {
return props;
}
Class<?> clazz = bean.getClass();
try {
//Public fields:
Field[] fields = clazz.getF... | java | public static Map<String, Object> getBeanProperties(Object bean) {
Map<String, Object> props = new HashMap<>();
if (bean == null) {
return props;
}
Class<?> clazz = bean.getClass();
try {
//Public fields:
Field[] fields = clazz.getF... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getBeanProperties",
"(",
"Object",
"bean",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"bean",
"==",
"null",
")",
... | Returns an index of all the accessible properties of a Java bean object.
@param bean Input object
@return Index of properties, never null | [
"Returns",
"an",
"index",
"of",
"all",
"the",
"accessible",
"properties",
"of",
"a",
"Java",
"bean",
"object",
"."
] | 0b84f0db562253165bc06c69f631e464dca0cb48 | https://github.com/uniform-java/uniform/blob/0b84f0db562253165bc06c69f631e464dca0cb48/src/main/java/net/uniform/impl/utils/UniformUtils.java#L89-L121 |
149,375 | mike10004/common-helper | ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/DefaultDatabaseContext.java | DefaultDatabaseContext.getDao | @Override
public <T> Dao<T, ?> getDao(Class<T> clz) throws SQLException {
return DaoManager.createDao(getConnectionSource(), clz);
} | java | @Override
public <T> Dao<T, ?> getDao(Class<T> clz) throws SQLException {
return DaoManager.createDao(getConnectionSource(), clz);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"Dao",
"<",
"T",
",",
"?",
">",
"getDao",
"(",
"Class",
"<",
"T",
">",
"clz",
")",
"throws",
"SQLException",
"{",
"return",
"DaoManager",
".",
"createDao",
"(",
"getConnectionSource",
"(",
")",
",",
"clz",
")... | Gets the data access object for an entity class that has an integer
primary key data type. Dao caching is performed by
the ORM library, so you don't need to take pains to hold on to this
reference.
@param <T> the entity class type
@param clz the entity class
@return the dao
@throws java.sql.SQLException if
{@link #getD... | [
"Gets",
"the",
"data",
"access",
"object",
"for",
"an",
"entity",
"class",
"that",
"has",
"an",
"integer",
"primary",
"key",
"data",
"type",
".",
"Dao",
"caching",
"is",
"performed",
"by",
"the",
"ORM",
"library",
"so",
"you",
"don",
"t",
"need",
"to",
... | 744f82d9b0768a9ad9c63a57a37ab2c93bf408f4 | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/DefaultDatabaseContext.java#L110-L113 |
149,376 | mike10004/common-helper | ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/DefaultDatabaseContext.java | DefaultDatabaseContext.getDao | @Override
public <T, K> Dao<T, K> getDao(Class<T> clazz, Class<K> keyType) throws SQLException {
return DaoManager.createDao(getConnectionSource(), clazz);
} | java | @Override
public <T, K> Dao<T, K> getDao(Class<T> clazz, Class<K> keyType) throws SQLException {
return DaoManager.createDao(getConnectionSource(), clazz);
} | [
"@",
"Override",
"public",
"<",
"T",
",",
"K",
">",
"Dao",
"<",
"T",
",",
"K",
">",
"getDao",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"K",
">",
"keyType",
")",
"throws",
"SQLException",
"{",
"return",
"DaoManager",
".",
"createDao"... | Gets the data access object for an entity class with a given key type.
Dao caching is performed by the ORM library, so you don't need to take
pains to hold on to this reference.
@param <T> the entity class type
@param <K> the key type
@param clazz the entity class
@param keyType the primary key type
@return the dao
@th... | [
"Gets",
"the",
"data",
"access",
"object",
"for",
"an",
"entity",
"class",
"with",
"a",
"given",
"key",
"type",
".",
"Dao",
"caching",
"is",
"performed",
"by",
"the",
"ORM",
"library",
"so",
"you",
"don",
"t",
"need",
"to",
"take",
"pains",
"to",
"hold... | 744f82d9b0768a9ad9c63a57a37ab2c93bf408f4 | https://github.com/mike10004/common-helper/blob/744f82d9b0768a9ad9c63a57a37ab2c93bf408f4/ormlite-helper/src/main/java/com/github/mike10004/common/dbhelp/DefaultDatabaseContext.java#L128-L131 |
149,377 | javagl/Common | src/main/java/de/javagl/common/concurrent/ExecutorServices.java | ExecutorServices.createFixedTimeoutExecutorService | public static ExecutorService createFixedTimeoutExecutorService(
int poolSize, long keepAliveTime, TimeUnit timeUnit)
{
ThreadPoolExecutor e =
new ThreadPoolExecutor(poolSize, poolSize,
keepAliveTime, timeUnit, new LinkedBlockingQueue<Runnable>());
e.allowC... | java | public static ExecutorService createFixedTimeoutExecutorService(
int poolSize, long keepAliveTime, TimeUnit timeUnit)
{
ThreadPoolExecutor e =
new ThreadPoolExecutor(poolSize, poolSize,
keepAliveTime, timeUnit, new LinkedBlockingQueue<Runnable>());
e.allowC... | [
"public",
"static",
"ExecutorService",
"createFixedTimeoutExecutorService",
"(",
"int",
"poolSize",
",",
"long",
"keepAliveTime",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"ThreadPoolExecutor",
"e",
"=",
"new",
"ThreadPoolExecutor",
"(",
"poolSize",
",",
"poolSize",
",",... | Creates an executor service with a fixed pool size, that will time
out after a certain period of inactivity.
@param poolSize The core- and maximum pool size
@param keepAliveTime The keep alive time
@param timeUnit The time unit
@return The executor service | [
"Creates",
"an",
"executor",
"service",
"with",
"a",
"fixed",
"pool",
"size",
"that",
"will",
"time",
"out",
"after",
"a",
"certain",
"period",
"of",
"inactivity",
"."
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/concurrent/ExecutorServices.java#L115-L123 |
149,378 | matthewhorridge/binaryowl | src/main/java/org/semanticweb/binaryowl/stream/PassThroughSetTransformer.java | PassThroughSetTransformer.transform | @Override
public <O extends Comparable> Set<O> transform(Set<O> set) {
return checkNotNull(set);
} | java | @Override
public <O extends Comparable> Set<O> transform(Set<O> set) {
return checkNotNull(set);
} | [
"@",
"Override",
"public",
"<",
"O",
"extends",
"Comparable",
">",
"Set",
"<",
"O",
">",
"transform",
"(",
"Set",
"<",
"O",
">",
"set",
")",
"{",
"return",
"checkNotNull",
"(",
"set",
")",
";",
"}"
] | A set transformer that returns the supplied set.
@param set The set to be transformed. Not {@code null}.
@param <O> The type of elements contained within the set.
@return The same set that was supplied. | [
"A",
"set",
"transformer",
"that",
"returns",
"the",
"supplied",
"set",
"."
] | 7fccfe804120f86b38ca855ddbb569a81a042257 | https://github.com/matthewhorridge/binaryowl/blob/7fccfe804120f86b38ca855ddbb569a81a042257/src/main/java/org/semanticweb/binaryowl/stream/PassThroughSetTransformer.java#L18-L21 |
149,379 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/wrappers/ConnectionProxy.java | ConnectionProxy.newInstance | public static Connection newInstance(Connection conn) {
return (Connection) java.lang.reflect.Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[]{Connection.class},
new ConnectionProxy(conn));
/*
return (Connection) java.lang.reflect.Proxy.newProxyInstance(conn.... | java | public static Connection newInstance(Connection conn) {
return (Connection) java.lang.reflect.Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[]{Connection.class},
new ConnectionProxy(conn));
/*
return (Connection) java.lang.reflect.Proxy.newProxyInstance(conn.... | [
"public",
"static",
"Connection",
"newInstance",
"(",
"Connection",
"conn",
")",
"{",
"return",
"(",
"Connection",
")",
"java",
".",
"lang",
".",
"reflect",
".",
"Proxy",
".",
"newProxyInstance",
"(",
"Connection",
".",
"class",
".",
"getClassLoader",
"(",
"... | Creates new SQL Connection Proxy instance
@param conn SQL Connection
@return Proxy SQL Connection | [
"Creates",
"new",
"SQL",
"Connection",
"Proxy",
"instance"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/wrappers/ConnectionProxy.java#L41-L48 |
149,380 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java | Overrider.removeOverride | public void removeOverride(String operation) {
if (this.overrideOnce.containsKey(operation) == true) {
this.overrideOnce.remove(operation);
}
if (this.override.containsKey(operation) == true) {
this.override.remove(operation);
}
} | java | public void removeOverride(String operation) {
if (this.overrideOnce.containsKey(operation) == true) {
this.overrideOnce.remove(operation);
}
if (this.override.containsKey(operation) == true) {
this.override.remove(operation);
}
} | [
"public",
"void",
"removeOverride",
"(",
"String",
"operation",
")",
"{",
"if",
"(",
"this",
".",
"overrideOnce",
".",
"containsKey",
"(",
"operation",
")",
"==",
"true",
")",
"{",
"this",
".",
"overrideOnce",
".",
"remove",
"(",
"operation",
")",
";",
"... | Removes override.
@param operation name of the operation | [
"Removes",
"override",
"."
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java#L74-L82 |
149,381 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java | Overrider.hasOverride | public boolean hasOverride(String operation) {
boolean result = false;
if (this.overrideOnce.containsKey(operation) == true || this.override.containsKey(operation) == true) {
result = true;
}
return result;
} | java | public boolean hasOverride(String operation) {
boolean result = false;
if (this.overrideOnce.containsKey(operation) == true || this.override.containsKey(operation) == true) {
result = true;
}
return result;
} | [
"public",
"boolean",
"hasOverride",
"(",
"String",
"operation",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"this",
".",
"overrideOnce",
".",
"containsKey",
"(",
"operation",
")",
"==",
"true",
"||",
"this",
".",
"override",
".",
"contains... | Checks if override is present, but it won't be actually read
@param operation name of the operation
@return true if override is present | [
"Checks",
"if",
"override",
"is",
"present",
"but",
"it",
"won",
"t",
"be",
"actually",
"read"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java#L90-L98 |
149,382 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java | Overrider.getOverride | public Object getOverride(String operation) {
Object result = null;
if (this.overrideOnce.containsKey(operation) == true) {
result = this.overrideOnce.get(operation);
this.overrideOnce.remove(operation);
} else if (this.override.containsKey(operation) == true) {
... | java | public Object getOverride(String operation) {
Object result = null;
if (this.overrideOnce.containsKey(operation) == true) {
result = this.overrideOnce.get(operation);
this.overrideOnce.remove(operation);
} else if (this.override.containsKey(operation) == true) {
... | [
"public",
"Object",
"getOverride",
"(",
"String",
"operation",
")",
"{",
"Object",
"result",
"=",
"null",
";",
"if",
"(",
"this",
".",
"overrideOnce",
".",
"containsKey",
"(",
"operation",
")",
"==",
"true",
")",
"{",
"result",
"=",
"this",
".",
"overrid... | Return override value
@param operation name of the operation
@return override value | [
"Return",
"override",
"value"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/Overrider.java#L106-L117 |
149,383 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.lastPage | public void lastPage() {
int idx = pages.size()-1;
if( idx < 0 ) {
idx = 0;
}
if( pageIndex != idx ) {
pageIndex = idx;
currentPage = null;
}
} | java | public void lastPage() {
int idx = pages.size()-1;
if( idx < 0 ) {
idx = 0;
}
if( pageIndex != idx ) {
pageIndex = idx;
currentPage = null;
}
} | [
"public",
"void",
"lastPage",
"(",
")",
"{",
"int",
"idx",
"=",
"pages",
".",
"size",
"(",
")",
"-",
"1",
";",
"if",
"(",
"idx",
"<",
"0",
")",
"{",
"idx",
"=",
"0",
";",
"}",
"if",
"(",
"pageIndex",
"!=",
"idx",
")",
"{",
"pageIndex",
"=",
... | Navigates to the last page in the iterator. | [
"Navigates",
"to",
"the",
"last",
"page",
"in",
"the",
"iterator",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L280-L290 |
149,384 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.loadPage | private boolean loadPage() {
Collection<T> list;
if( pages.size() <= pageIndex ) {
return false;
}
list = pages.get(pageIndex);
currentPage = list.iterator();
return true;
} | java | private boolean loadPage() {
Collection<T> list;
if( pages.size() <= pageIndex ) {
return false;
}
list = pages.get(pageIndex);
currentPage = list.iterator();
return true;
} | [
"private",
"boolean",
"loadPage",
"(",
")",
"{",
"Collection",
"<",
"T",
">",
"list",
";",
"if",
"(",
"pages",
".",
"size",
"(",
")",
"<=",
"pageIndex",
")",
"{",
"return",
"false",
";",
"}",
"list",
"=",
"pages",
".",
"get",
"(",
"pageIndex",
")",... | Loads the next page
@return false if there are no more pages to load | [
"Loads",
"the",
"next",
"page"
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L296-L305 |
149,385 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.setPage | public boolean setPage(int p) {
p--;
if( p < 0 ) {
return false;
}
if( p >= pages.size() ) {
return false;
}
pageIndex = p;
currentPage = null;
return true;
} | java | public boolean setPage(int p) {
p--;
if( p < 0 ) {
return false;
}
if( p >= pages.size() ) {
return false;
}
pageIndex = p;
currentPage = null;
return true;
} | [
"public",
"boolean",
"setPage",
"(",
"int",
"p",
")",
"{",
"p",
"--",
";",
"if",
"(",
"p",
"<",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"p",
">=",
"pages",
".",
"size",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"pageInde... | Navigates to the specified page number with 0 being the first page.
@param p the page number to navigate to
@return true if the page was successfully navigated to | [
"Navigates",
"to",
"the",
"specified",
"page",
"number",
"with",
"0",
"being",
"the",
"first",
"page",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L366-L377 |
149,386 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.setPageSize | public void setPageSize(int ps) {
ArrayList<T> tmp = new ArrayList<T>();
for( Collection<T> page : pages ) {
for( T item : page ) {
tmp.add(item);
}
}
setup(tmp, ps, sorter);
} | java | public void setPageSize(int ps) {
ArrayList<T> tmp = new ArrayList<T>();
for( Collection<T> page : pages ) {
for( T item : page ) {
tmp.add(item);
}
}
setup(tmp, ps, sorter);
} | [
"public",
"void",
"setPageSize",
"(",
"int",
"ps",
")",
"{",
"ArrayList",
"<",
"T",
">",
"tmp",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"Collection",
"<",
"T",
">",
"page",
":",
"pages",
")",
"{",
"for",
"(",
"T",
"it... | Changes the page size of the list and reforms the list. May cause unexpected
behavior in terms of what is considered the "current page" after resizing.
@param ps the new page size | [
"Changes",
"the",
"page",
"size",
"of",
"the",
"list",
"and",
"reforms",
"the",
"list",
".",
"May",
"cause",
"unexpected",
"behavior",
"in",
"terms",
"of",
"what",
"is",
"considered",
"the",
"current",
"page",
"after",
"resizing",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L384-L393 |
149,387 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.setup | private void setup(Collection<T> items, int ps, Comparator<T> sort) {
Collection<T> list;
Iterator<T> it;
if( sort == null ) {
list = items;
}
else {
list = new TreeSet<T>(sort);
list.addAll(items);
}
sorter = sort;
pageSize = ps;
pages = new ArrayList<Collection<T>>();
it = list.... | java | private void setup(Collection<T> items, int ps, Comparator<T> sort) {
Collection<T> list;
Iterator<T> it;
if( sort == null ) {
list = items;
}
else {
list = new TreeSet<T>(sort);
list.addAll(items);
}
sorter = sort;
pageSize = ps;
pages = new ArrayList<Collection<T>>();
it = list.... | [
"private",
"void",
"setup",
"(",
"Collection",
"<",
"T",
">",
"items",
",",
"int",
"ps",
",",
"Comparator",
"<",
"T",
">",
"sort",
")",
"{",
"Collection",
"<",
"T",
">",
"list",
";",
"Iterator",
"<",
"T",
">",
"it",
";",
"if",
"(",
"sort",
"==",
... | Sets the collection up using the specified parameters.
@param items the items in the iterator
@param ps the page size for the structure
@param sort the sorter, if any, to use for sorting | [
"Sets",
"the",
"collection",
"up",
"using",
"the",
"specified",
"parameters",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L401-L430 |
149,388 | greese/dasein-util | src/main/java/org/dasein/util/BrowseIterator.java | BrowseIterator.sort | public void sort(Comparator<T> sort) {
ArrayList<T> tmp = new ArrayList<T>();
for( Collection<T> page : pages ) {
tmp.addAll(page);
}
setup(tmp, pageSize, sort);
} | java | public void sort(Comparator<T> sort) {
ArrayList<T> tmp = new ArrayList<T>();
for( Collection<T> page : pages ) {
tmp.addAll(page);
}
setup(tmp, pageSize, sort);
} | [
"public",
"void",
"sort",
"(",
"Comparator",
"<",
"T",
">",
"sort",
")",
"{",
"ArrayList",
"<",
"T",
">",
"tmp",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
"for",
"(",
"Collection",
"<",
"T",
">",
"page",
":",
"pages",
")",
"{",
"tm... | Re-sorts the list according to the specified sorter.
@param sort the sorter to sort the list with | [
"Re",
"-",
"sorts",
"the",
"list",
"according",
"to",
"the",
"specified",
"sorter",
"."
] | 648606dcb4bd382e3287a6c897a32e65d553dc47 | https://github.com/greese/dasein-util/blob/648606dcb4bd382e3287a6c897a32e65d553dc47/src/main/java/org/dasein/util/BrowseIterator.java#L436-L443 |
149,389 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcLogger.java | MjdbcLogger.setSLF4jAvailable | private static void setSLF4jAvailable(boolean slf4jAvailable) {
if ((SLF4jAvailable != null && SLF4jAvailable == true) && slf4jAvailable == false) {
Logger.getAnonymousLogger().warning("Switching off SLF4j availability. Usually means that SLF4j was found but exception was thrown during it's usage");... | java | private static void setSLF4jAvailable(boolean slf4jAvailable) {
if ((SLF4jAvailable != null && SLF4jAvailable == true) && slf4jAvailable == false) {
Logger.getAnonymousLogger().warning("Switching off SLF4j availability. Usually means that SLF4j was found but exception was thrown during it's usage");... | [
"private",
"static",
"void",
"setSLF4jAvailable",
"(",
"boolean",
"slf4jAvailable",
")",
"{",
"if",
"(",
"(",
"SLF4jAvailable",
"!=",
"null",
"&&",
"SLF4jAvailable",
"==",
"true",
")",
"&&",
"slf4jAvailable",
"==",
"false",
")",
"{",
"Logger",
".",
"getAnonymo... | Standard Setter function.
Informs if SLF4j availability was set from true into false
@param slf4jAvailable new SLF4j availability flag | [
"Standard",
"Setter",
"function",
".",
"Informs",
"if",
"SLF4j",
"availability",
"was",
"set",
"from",
"true",
"into",
"false"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/MjdbcLogger.java#L207-L213 |
149,390 | uniform-java/uniform | src/main/java/net/uniform/impl/AbstractForm.java | AbstractForm.elementsIndexByName | protected Map<String, List<Element>> elementsIndexByName() {
HashMap<String, List<Element>> index = new HashMap<>();
for (Object part : renderingParts) {//We have to use the rendering order of elements for multiple elements with same name
if (part instanceof Element) {
El... | java | protected Map<String, List<Element>> elementsIndexByName() {
HashMap<String, List<Element>> index = new HashMap<>();
for (Object part : renderingParts) {//We have to use the rendering order of elements for multiple elements with same name
if (part instanceof Element) {
El... | [
"protected",
"Map",
"<",
"String",
",",
"List",
"<",
"Element",
">",
">",
"elementsIndexByName",
"(",
")",
"{",
"HashMap",
"<",
"String",
",",
"List",
"<",
"Element",
">",
">",
"index",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"Object"... | Creates an index of the form element by their name. Makes sure that the names are not repeated and are valid.
@return Index of elements by name | [
"Creates",
"an",
"index",
"of",
"the",
"form",
"element",
"by",
"their",
"name",
".",
"Makes",
"sure",
"that",
"the",
"names",
"are",
"not",
"repeated",
"and",
"are",
"valid",
"."
] | 0b84f0db562253165bc06c69f631e464dca0cb48 | https://github.com/uniform-java/uniform/blob/0b84f0db562253165bc06c69f631e464dca0cb48/src/main/java/net/uniform/impl/AbstractForm.java#L943-L976 |
149,391 | workplacesystems/queuj | src/main/java/com/workplacesystems/queuj/process/java/ProcessSection.java | ProcessSection.invokeSection | protected Integer invokeSection()
{
try
{
// run object is a JavaProcessRunner
S runner = getRunner(getRunObject());
if (run_method_str == null)
return null;
createRunMethod(param_types, runner);
Object[] local_params = (... | java | protected Integer invokeSection()
{
try
{
// run object is a JavaProcessRunner
S runner = getRunner(getRunObject());
if (run_method_str == null)
return null;
createRunMethod(param_types, runner);
Object[] local_params = (... | [
"protected",
"Integer",
"invokeSection",
"(",
")",
"{",
"try",
"{",
"// run object is a JavaProcessRunner",
"S",
"runner",
"=",
"getRunner",
"(",
"getRunObject",
"(",
")",
")",
";",
"if",
"(",
"run_method_str",
"==",
"null",
")",
"return",
"null",
";",
"create... | reflectively runs the relevant method | [
"reflectively",
"runs",
"the",
"relevant",
"method"
] | 4293116b412b4a20ead99963b9b05a135812c501 | https://github.com/workplacesystems/queuj/blob/4293116b412b4a20ead99963b9b05a135812c501/src/main/java/com/workplacesystems/queuj/process/java/ProcessSection.java#L74-L115 |
149,392 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/AbstractKeyedOutputHandler.java | AbstractKeyedOutputHandler.createKey | @SuppressWarnings("unchecked")
protected K createKey(QueryParameters params) throws MjdbcException {
K result = null;
if (columnName == null) {
result = (K) params.getValue(params.getNameByPosition(columnIndex));
} else {
result = (K) params.getValue(columnName);
... | java | @SuppressWarnings("unchecked")
protected K createKey(QueryParameters params) throws MjdbcException {
K result = null;
if (columnName == null) {
result = (K) params.getValue(params.getNameByPosition(columnIndex));
} else {
result = (K) params.getValue(columnName);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"K",
"createKey",
"(",
"QueryParameters",
"params",
")",
"throws",
"MjdbcException",
"{",
"K",
"result",
"=",
"null",
";",
"if",
"(",
"columnName",
"==",
"null",
")",
"{",
"result",
"=",
"(",
... | Generates key for query output row
@param params query output row
@return key for query output row
@throws org.midao.jdbc.core.exception.MjdbcException | [
"Generates",
"key",
"for",
"query",
"output",
"row"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/output/AbstractKeyedOutputHandler.java#L99-L110 |
149,393 | javagl/Common | src/main/java/de/javagl/common/iteration/CombiningIterator.java | CombiningIterator.prepareNextIterator | private void prepareNextIterator()
{
if (currentIterator == null || !currentIterator.hasNext())
{
currentIterator = null;
while (iteratorIterator.hasNext())
{
currentIterator = iteratorIterator.next();
if (currentIterator.hasNext())
{... | java | private void prepareNextIterator()
{
if (currentIterator == null || !currentIterator.hasNext())
{
currentIterator = null;
while (iteratorIterator.hasNext())
{
currentIterator = iteratorIterator.next();
if (currentIterator.hasNext())
{... | [
"private",
"void",
"prepareNextIterator",
"(",
")",
"{",
"if",
"(",
"currentIterator",
"==",
"null",
"||",
"!",
"currentIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"currentIterator",
"=",
"null",
";",
"while",
"(",
"iteratorIterator",
".",
"hasNext",
"(",... | Prepare the next iterator to use | [
"Prepare",
"the",
"next",
"iterator",
"to",
"use"
] | 5a4876b48c3a2dc61d21324733cf37512d721c33 | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/iteration/CombiningIterator.java#L71-L86 |
149,394 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java | InputUtils.getClassName | public static String getClassName(Map<String, Object> map) {
String className = null;
if (map.containsKey(MAP_CLASS_NAME) == true) {
className = (String) map.get(MAP_CLASS_NAME);
}
return className;
} | java | public static String getClassName(Map<String, Object> map) {
String className = null;
if (map.containsKey(MAP_CLASS_NAME) == true) {
className = (String) map.get(MAP_CLASS_NAME);
}
return className;
} | [
"public",
"static",
"String",
"getClassName",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"String",
"className",
"=",
"null",
";",
"if",
"(",
"map",
".",
"containsKey",
"(",
"MAP_CLASS_NAME",
")",
"==",
"true",
")",
"{",
"className",
... | InputHandler converts every object into Map.
This function returns Class name of object from which this Map was created.
@param map Map from which Class name would be returned
@return Class name from which Map was built | [
"InputHandler",
"converts",
"every",
"object",
"into",
"Map",
".",
"This",
"function",
"returns",
"Class",
"name",
"of",
"object",
"from",
"which",
"this",
"Map",
"was",
"created",
"."
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java#L58-L66 |
149,395 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java | InputUtils.setClassName | public static void setClassName(Map<String, Object> map, String className) {
String processedClassName = className;
if (processedClassName != null) {
// it is highly unlikely that class name would contain ".", but we are cleaning it just in case
processedClassName = processedCl... | java | public static void setClassName(Map<String, Object> map, String className) {
String processedClassName = className;
if (processedClassName != null) {
// it is highly unlikely that class name would contain ".", but we are cleaning it just in case
processedClassName = processedCl... | [
"public",
"static",
"void",
"setClassName",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"String",
"className",
")",
"{",
"String",
"processedClassName",
"=",
"className",
";",
"if",
"(",
"processedClassName",
"!=",
"null",
")",
"{",
"// it is ... | InputHandler converts every object into Map.
Sets Class name of object from which this Map was created.
@param map Map which would store Class name
@param className Class name | [
"InputHandler",
"converts",
"every",
"object",
"into",
"Map",
".",
"Sets",
"Class",
"name",
"of",
"object",
"from",
"which",
"this",
"Map",
"was",
"created",
"."
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java#L75-L85 |
149,396 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java | InputUtils.isClassNameKey | public static boolean isClassNameKey(String key) {
boolean equals = false;
if (MAP_CLASS_NAME.equals(key) == true) {
equals = true;
}
return equals;
} | java | public static boolean isClassNameKey(String key) {
boolean equals = false;
if (MAP_CLASS_NAME.equals(key) == true) {
equals = true;
}
return equals;
} | [
"public",
"static",
"boolean",
"isClassNameKey",
"(",
"String",
"key",
")",
"{",
"boolean",
"equals",
"=",
"false",
";",
"if",
"(",
"MAP_CLASS_NAME",
".",
"equals",
"(",
"key",
")",
"==",
"true",
")",
"{",
"equals",
"=",
"true",
";",
"}",
"return",
"eq... | Checks if this Map key is Map Class Name
@param key Key which would be checked
@return true - if key equals to Map Class Name key | [
"Checks",
"if",
"this",
"Map",
"key",
"is",
"Map",
"Class",
"Name"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java#L93-L101 |
149,397 | pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java | InputUtils.addClassName | public static String addClassName(String className, String key) {
return className.toLowerCase() + "." + key.toLowerCase();
} | java | public static String addClassName(String className, String key) {
return className.toLowerCase() + "." + key.toLowerCase();
} | [
"public",
"static",
"String",
"addClassName",
"(",
"String",
"className",
",",
"String",
"key",
")",
"{",
"return",
"className",
".",
"toLowerCase",
"(",
")",
"+",
"\".\"",
"+",
"key",
".",
"toLowerCase",
"(",
")",
";",
"}"
] | Used by InputHandlers.
Allows combining of few Maps into one Map.
In order to avoid "collisions" - Map Class name is user as prefix
@param className Map Class name
@param key Map key
@return unique key | [
"Used",
"by",
"InputHandlers",
".",
"Allows",
"combining",
"of",
"few",
"Maps",
"into",
"one",
"Map",
".",
"In",
"order",
"to",
"avoid",
"collisions",
"-",
"Map",
"Class",
"name",
"is",
"user",
"as",
"prefix"
] | ed9048ed2c792a4794a2116a25779dfb84cd9447 | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/utils/InputUtils.java#L112-L114 |
149,398 | Omertron/api-fanarttv | src/main/java/com/omertron/fanarttvapi/FanartTvApi.java | FanartTvApi.getTvArtwork | public FTSeries getTvArtwork(String id) throws FanartTvException {
URL url = ftapi.getImageUrl(BaseType.TV, id);
String page = requestWebPage(url);
FTSeries series = null;
try {
series = mapper.readValue(page, FTSeries.class);
} catch (IOException ex) {
... | java | public FTSeries getTvArtwork(String id) throws FanartTvException {
URL url = ftapi.getImageUrl(BaseType.TV, id);
String page = requestWebPage(url);
FTSeries series = null;
try {
series = mapper.readValue(page, FTSeries.class);
} catch (IOException ex) {
... | [
"public",
"FTSeries",
"getTvArtwork",
"(",
"String",
"id",
")",
"throws",
"FanartTvException",
"{",
"URL",
"url",
"=",
"ftapi",
".",
"getImageUrl",
"(",
"BaseType",
".",
"TV",
",",
"id",
")",
";",
"String",
"page",
"=",
"requestWebPage",
"(",
"url",
")",
... | Get images for TV
@param id
@return
@throws FanartTvException | [
"Get",
"images",
"for",
"TV"
] | 2a1854c840d8111935d0f6abe5232e2c3c3f318b | https://github.com/Omertron/api-fanarttv/blob/2a1854c840d8111935d0f6abe5232e2c3c3f318b/src/main/java/com/omertron/fanarttvapi/FanartTvApi.java#L118-L135 |
149,399 | Omertron/api-fanarttv | src/main/java/com/omertron/fanarttvapi/FanartTvApi.java | FanartTvApi.getMovieArtwork | public FTMovie getMovieArtwork(String id) throws FanartTvException {
URL url = ftapi.getImageUrl(BaseType.MOVIE, id);
String page = requestWebPage(url);
FTMovie movie = null;
try {
movie = mapper.readValue(page, FTMovie.class);
} catch (IOException ex) {
... | java | public FTMovie getMovieArtwork(String id) throws FanartTvException {
URL url = ftapi.getImageUrl(BaseType.MOVIE, id);
String page = requestWebPage(url);
FTMovie movie = null;
try {
movie = mapper.readValue(page, FTMovie.class);
} catch (IOException ex) {
... | [
"public",
"FTMovie",
"getMovieArtwork",
"(",
"String",
"id",
")",
"throws",
"FanartTvException",
"{",
"URL",
"url",
"=",
"ftapi",
".",
"getImageUrl",
"(",
"BaseType",
".",
"MOVIE",
",",
"id",
")",
";",
"String",
"page",
"=",
"requestWebPage",
"(",
"url",
"... | Get images for Movie
@param id
@return
@throws FanartTvException | [
"Get",
"images",
"for",
"Movie"
] | 2a1854c840d8111935d0f6abe5232e2c3c3f318b | https://github.com/Omertron/api-fanarttv/blob/2a1854c840d8111935d0f6abe5232e2c3c3f318b/src/main/java/com/omertron/fanarttvapi/FanartTvApi.java#L167-L184 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.