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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,800 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/WindDirection.java | WindDirection.setPointer2Type | public void setPointer2Type(final PointerType POINTER2_TYPE) {
pointer2Type = POINTER2_TYPE;
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
} | java | public void setPointer2Type(final PointerType POINTER2_TYPE) {
pointer2Type = POINTER2_TYPE;
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
} | [
"public",
"void",
"setPointer2Type",
"(",
"final",
"PointerType",
"POINTER2_TYPE",
")",
"{",
"pointer2Type",
"=",
"POINTER2_TYPE",
";",
"init",
"(",
"getInnerBounds",
"(",
")",
".",
"width",
",",
"getInnerBounds",
"(",
")",
".",
"height",
")",
";",
"repaint",
... | Sets the pointertype of the second pointer
@param POINTER2_TYPE | [
"Sets",
"the",
"pointertype",
"of",
"the",
"second",
"pointer"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/WindDirection.java#L445-L449 |
3,801 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/WindDirection.java | WindDirection.setCustomPointer2Color | public void setCustomPointer2Color(final Color COLOR) {
this.customPointer2Color = new CustomColorDef(COLOR);
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
} | java | public void setCustomPointer2Color(final Color COLOR) {
this.customPointer2Color = new CustomColorDef(COLOR);
init(getInnerBounds().width, getInnerBounds().height);
repaint(getInnerBounds());
} | [
"public",
"void",
"setCustomPointer2Color",
"(",
"final",
"Color",
"COLOR",
")",
"{",
"this",
".",
"customPointer2Color",
"=",
"new",
"CustomColorDef",
"(",
"COLOR",
")",
";",
"init",
"(",
"getInnerBounds",
"(",
")",
".",
"width",
",",
"getInnerBounds",
"(",
... | Sets the color from which the custom pointer2 color is calculated
@param COLOR | [
"Sets",
"the",
"color",
"from",
"which",
"the",
"custom",
"pointer2",
"color",
"is",
"calculated"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/WindDirection.java#L463-L467 |
3,802 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_BACKGROUND_Image | protected BufferedImage create_BACKGROUND_Image(final int WIDTH, final int HEIGHT, BufferedImage image) {
if (WIDTH <= 0 || HEIGHT <= 0) {
return UTIL.createImage(1, 1, Transparency.TRANSLUCENT);
}
if (image == null) {
image = UTIL.createImage(WIDTH, HEIGHT, Transparency... | java | protected BufferedImage create_BACKGROUND_Image(final int WIDTH, final int HEIGHT, BufferedImage image) {
if (WIDTH <= 0 || HEIGHT <= 0) {
return UTIL.createImage(1, 1, Transparency.TRANSLUCENT);
}
if (image == null) {
image = UTIL.createImage(WIDTH, HEIGHT, Transparency... | [
"protected",
"BufferedImage",
"create_BACKGROUND_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"BufferedImage",
"image",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"0",
"||",
"HEIGHT",
"<=",
"0",
")",
"{",
"return",
"UTIL",
".",
"creat... | Returns the background image with the currently active backgroundcolor
with the given width and height.
@param WIDTH
@param HEIGHT
@param image
@return buffered image containing the background with the selected background design | [
"Returns",
"the",
"background",
"image",
"with",
"the",
"currently",
"active",
"backgroundcolor",
"with",
"the",
"given",
"width",
"and",
"height",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L917-L943 |
3,803 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java | AbstractLinear.create_MEASURED_VALUE_Image | protected BufferedImage create_MEASURED_VALUE_Image(final int WIDTH, final int HEIGHT, final Color COLOR) {
if (WIDTH <= 20 || HEIGHT <= 20) // 20 is needed otherwise the image size could be smaller than 1
{
return UTIL.createImage(1, 1, Transparency.TRANSLUCENT);
}
final in... | java | protected BufferedImage create_MEASURED_VALUE_Image(final int WIDTH, final int HEIGHT, final Color COLOR) {
if (WIDTH <= 20 || HEIGHT <= 20) // 20 is needed otherwise the image size could be smaller than 1
{
return UTIL.createImage(1, 1, Transparency.TRANSLUCENT);
}
final in... | [
"protected",
"BufferedImage",
"create_MEASURED_VALUE_Image",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
",",
"final",
"Color",
"COLOR",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"20",
"||",
"HEIGHT",
"<=",
"20",
")",
"// 20 is needed otherwise the im... | Returns the image of the MinMeasuredValue and MaxMeasuredValue dependend
on the given color
@param WIDTH
@param HEIGHT
@param COLOR
@return a buffered image of either the min measured value or the max measured value indicator | [
"Returns",
"the",
"image",
"of",
"the",
"MinMeasuredValue",
"and",
"MaxMeasuredValue",
"dependend",
"on",
"the",
"given",
"color"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/AbstractLinear.java#L1293-L1334 |
3,804 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.init | private void init(final int WIDTH, final int HEIGHT) {
if (WIDTH <= 1 || HEIGHT <= 1) {
return;
}
final double CORNER_RADIUS = WIDTH > HEIGHT ? (HEIGHT * 0.095) : (WIDTH * 0.095);
if (recreateImages) {
if (sparkLineBackgroundImage != null) {
spark... | java | private void init(final int WIDTH, final int HEIGHT) {
if (WIDTH <= 1 || HEIGHT <= 1) {
return;
}
final double CORNER_RADIUS = WIDTH > HEIGHT ? (HEIGHT * 0.095) : (WIDTH * 0.095);
if (recreateImages) {
if (sparkLineBackgroundImage != null) {
spark... | [
"private",
"void",
"init",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"1",
"||",
"HEIGHT",
"<=",
"1",
")",
"{",
"return",
";",
"}",
"final",
"double",
"CORNER_RADIUS",
"=",
"WIDTH",
">",
"HEIGHT",... | Initializes the sparkline component with the given width and height
@param WIDTH
@param HEIGHT | [
"Initializes",
"the",
"sparkline",
"component",
"with",
"the",
"given",
"width",
"and",
"height"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L201-L259 |
3,805 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.addDataPoint | public void addDataPoint(final double DATA) {
for (DataPoint dataPoint : DATA_LIST) {
if (System.currentTimeMillis() - dataPoint.getTimeStamp() > timeFrame) {
trashList.add(dataPoint);
}
}
for (DataPoint dataPoint : trashList) {
DATA_LIST.remo... | java | public void addDataPoint(final double DATA) {
for (DataPoint dataPoint : DATA_LIST) {
if (System.currentTimeMillis() - dataPoint.getTimeStamp() > timeFrame) {
trashList.add(dataPoint);
}
}
for (DataPoint dataPoint : trashList) {
DATA_LIST.remo... | [
"public",
"void",
"addDataPoint",
"(",
"final",
"double",
"DATA",
")",
"{",
"for",
"(",
"DataPoint",
"dataPoint",
":",
"DATA_LIST",
")",
"{",
"if",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"dataPoint",
".",
"getTimeStamp",
"(",
")",
">",
"... | Adds a new value to the DATA_LIST of the sparkline
@param DATA | [
"Adds",
"a",
"new",
"value",
"to",
"the",
"DATA_LIST",
"of",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L328-L342 |
3,806 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.getDataList | public List<DataPoint> getDataList() {
List<DataPoint> dataListCopy = new LinkedList<eu.hansolo.steelseries.tools.DataPoint>();
dataListCopy.addAll(DATA_LIST);
return dataListCopy;
} | java | public List<DataPoint> getDataList() {
List<DataPoint> dataListCopy = new LinkedList<eu.hansolo.steelseries.tools.DataPoint>();
dataListCopy.addAll(DATA_LIST);
return dataListCopy;
} | [
"public",
"List",
"<",
"DataPoint",
">",
"getDataList",
"(",
")",
"{",
"List",
"<",
"DataPoint",
">",
"dataListCopy",
"=",
"new",
"LinkedList",
"<",
"eu",
".",
"hansolo",
".",
"steelseries",
".",
"tools",
".",
"DataPoint",
">",
"(",
")",
";",
"dataListCo... | Returns the linked list that contains the current data of the sparkline
@return the linked list that contains the current data of the sparkline | [
"Returns",
"the",
"linked",
"list",
"that",
"contains",
"the",
"current",
"data",
"of",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L369-L373 |
3,807 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setDataList | public void setDataList(LinkedList<DataPoint> dataList) {
DATA_LIST.clear();
DATA_LIST.addAll(dataList);
repaint(INNER_BOUNDS);
} | java | public void setDataList(LinkedList<DataPoint> dataList) {
DATA_LIST.clear();
DATA_LIST.addAll(dataList);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setDataList",
"(",
"LinkedList",
"<",
"DataPoint",
">",
"dataList",
")",
"{",
"DATA_LIST",
".",
"clear",
"(",
")",
";",
"DATA_LIST",
".",
"addAll",
"(",
"dataList",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
";",
"}"
] | Clears the existing DATA_LIST and adds all elements from the given LinkedList to it
@param dataList | [
"Clears",
"the",
"existing",
"DATA_LIST",
"and",
"adds",
"all",
"elements",
"from",
"the",
"given",
"LinkedList",
"to",
"it"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L379-L383 |
3,808 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.getVariance | public double getVariance() {
if (!DATA_LIST.isEmpty()) {
double sum = 0;
double sumOfSquares = 0;
double average = 0;
for (DataPoint dataPoint : DATA_LIST) {
sumOfSquares += (dataPoint.getValue() * dataPoint.getValue());
sum += dat... | java | public double getVariance() {
if (!DATA_LIST.isEmpty()) {
double sum = 0;
double sumOfSquares = 0;
double average = 0;
for (DataPoint dataPoint : DATA_LIST) {
sumOfSquares += (dataPoint.getValue() * dataPoint.getValue());
sum += dat... | [
"public",
"double",
"getVariance",
"(",
")",
"{",
"if",
"(",
"!",
"DATA_LIST",
".",
"isEmpty",
"(",
")",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"double",
"sumOfSquares",
"=",
"0",
";",
"double",
"average",
"=",
"0",
";",
"for",
"(",
"DataPoint",
... | Returns the calculated varianz of the current data
@return the calculated varianz of the current data | [
"Returns",
"the",
"calculated",
"varianz",
"of",
"the",
"current",
"data"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L421-L434 |
3,809 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.getAverage | public double getAverage() {
if (!DATA_LIST.isEmpty()) {
double sum = 0;
for (DataPoint dataPoint : DATA_LIST) {
sum += dataPoint.getValue();
}
return sum / DATA_LIST.size();
}
return 0;
} | java | public double getAverage() {
if (!DATA_LIST.isEmpty()) {
double sum = 0;
for (DataPoint dataPoint : DATA_LIST) {
sum += dataPoint.getValue();
}
return sum / DATA_LIST.size();
}
return 0;
} | [
"public",
"double",
"getAverage",
"(",
")",
"{",
"if",
"(",
"!",
"DATA_LIST",
".",
"isEmpty",
"(",
")",
")",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"DataPoint",
"dataPoint",
":",
"DATA_LIST",
")",
"{",
"sum",
"+=",
"dataPoint",
".",
"getVal... | Returns the calculated average of the current data
@return the calculated average of the current data | [
"Returns",
"the",
"calculated",
"average",
"of",
"the",
"current",
"data"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L440-L449 |
3,810 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.getMedian | public double getMedian() {
if (DATA_LIST.size() > 2) {
sortData();
if (sortedList.size() % 2 != 0) {
return sortedList.get((sortedList.size() / 2));
} else {
return (sortedList.get(sortedList.size() / 2 - 1) + sortedList.get(sortedList.size()... | java | public double getMedian() {
if (DATA_LIST.size() > 2) {
sortData();
if (sortedList.size() % 2 != 0) {
return sortedList.get((sortedList.size() / 2));
} else {
return (sortedList.get(sortedList.size() / 2 - 1) + sortedList.get(sortedList.size()... | [
"public",
"double",
"getMedian",
"(",
")",
"{",
"if",
"(",
"DATA_LIST",
".",
"size",
"(",
")",
">",
"2",
")",
"{",
"sortData",
"(",
")",
";",
"if",
"(",
"sortedList",
".",
"size",
"(",
")",
"%",
"2",
"!=",
"0",
")",
"{",
"return",
"sortedList",
... | Returns the median of the measured values
@return the median of the measured values | [
"Returns",
"the",
"median",
"of",
"the",
"measured",
"values"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L498-L509 |
3,811 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setTimeFrame | public void setTimeFrame(final long TIME_FRAME) {
this.timeFrame = TIME_FRAME;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setTimeFrame(final long TIME_FRAME) {
this.timeFrame = TIME_FRAME;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setTimeFrame",
"(",
"final",
"long",
"TIME_FRAME",
")",
"{",
"this",
".",
"timeFrame",
"=",
"TIME_FRAME",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
... | Defines the current timeframe of the sparkline in milliseconds
@param TIME_FRAME | [
"Defines",
"the",
"current",
"timeframe",
"of",
"the",
"sparkline",
"in",
"milliseconds"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L523-L527 |
3,812 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setFilled | public void setFilled(final boolean FILLED) {
this.filled = FILLED;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setFilled(final boolean FILLED) {
this.filled = FILLED;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setFilled",
"(",
"final",
"boolean",
"FILLED",
")",
"{",
"this",
".",
"filled",
"=",
"FILLED",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
";",
"}"
... | Enables or disables the filling of the area below the sparkline
@param FILLED | [
"Enables",
"or",
"disables",
"the",
"filling",
"of",
"the",
"area",
"below",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L565-L569 |
3,813 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setSmoothing | public void setSmoothing(final boolean SMOOTHING) {
this.smoothing = SMOOTHING;
if (SMOOTHING) {
hiLoIndicatorVisible = false;
}
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setSmoothing(final boolean SMOOTHING) {
this.smoothing = SMOOTHING;
if (SMOOTHING) {
hiLoIndicatorVisible = false;
}
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setSmoothing",
"(",
"final",
"boolean",
"SMOOTHING",
")",
"{",
"this",
".",
"smoothing",
"=",
"SMOOTHING",
";",
"if",
"(",
"SMOOTHING",
")",
"{",
"hiLoIndicatorVisible",
"=",
"false",
";",
"}",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
... | Enables or disables the smoothing of the POINT_LIST and so of the sparkline
@param SMOOTHING | [
"Enables",
"or",
"disables",
"the",
"smoothing",
"of",
"the",
"POINT_LIST",
"and",
"so",
"of",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L583-L590 |
3,814 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setSparkLineColor | public void setSparkLineColor(final LcdColor LCD_COLOR) {
this.lineColor = LCD_COLOR.TEXT_COLOR;
this.sparkLineColor = LCD_COLOR;
recreateImages = true;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setSparkLineColor(final LcdColor LCD_COLOR) {
this.lineColor = LCD_COLOR.TEXT_COLOR;
this.sparkLineColor = LCD_COLOR;
recreateImages = true;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setSparkLineColor",
"(",
"final",
"LcdColor",
"LCD_COLOR",
")",
"{",
"this",
".",
"lineColor",
"=",
"LCD_COLOR",
".",
"TEXT_COLOR",
";",
"this",
".",
"sparkLineColor",
"=",
"LCD_COLOR",
";",
"recreateImages",
"=",
"true",
";",
"init",
"(",
... | Sets the color theme for the sparkline.
@param LCD_COLOR | [
"Sets",
"the",
"color",
"theme",
"for",
"the",
"sparkline",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L604-L610 |
3,815 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setLineColor | public void setLineColor(final Color LINE_COLOR) {
this.lineColor = LINE_COLOR;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setLineColor(final Color LINE_COLOR) {
this.lineColor = LINE_COLOR;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setLineColor",
"(",
"final",
"Color",
"LINE_COLOR",
")",
"{",
"this",
".",
"lineColor",
"=",
"LINE_COLOR",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
... | Sets the color of the sparkline
@param LINE_COLOR | [
"Sets",
"the",
"color",
"of",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L640-L644 |
3,816 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setAreaFill | public void setAreaFill(final ColorDef AREA_FILL_COLOR) {
this.areaFill = AREA_FILL_COLOR;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setAreaFill(final ColorDef AREA_FILL_COLOR) {
this.areaFill = AREA_FILL_COLOR;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setAreaFill",
"(",
"final",
"ColorDef",
"AREA_FILL_COLOR",
")",
"{",
"this",
".",
"areaFill",
"=",
"AREA_FILL_COLOR",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUNDS... | Sets the colordefinition of the area below the sparkline
@param AREA_FILL_COLOR | [
"Sets",
"the",
"colordefinition",
"of",
"the",
"area",
"below",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L658-L662 |
3,817 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setCustomAreaFillTop | public void setCustomAreaFillTop(final Color CUSTOM_AREA_FILL_COLOR_TOP) {
customAreaFillTop = CUSTOM_AREA_FILL_COLOR_TOP;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setCustomAreaFillTop(final Color CUSTOM_AREA_FILL_COLOR_TOP) {
customAreaFillTop = CUSTOM_AREA_FILL_COLOR_TOP;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setCustomAreaFillTop",
"(",
"final",
"Color",
"CUSTOM_AREA_FILL_COLOR_TOP",
")",
"{",
"customAreaFillTop",
"=",
"CUSTOM_AREA_FILL_COLOR_TOP",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
... | Sets the color that will be used for a custom area gradient at top
@param CUSTOM_AREA_FILL_COLOR_TOP | [
"Sets",
"the",
"color",
"that",
"will",
"be",
"used",
"for",
"a",
"custom",
"area",
"gradient",
"at",
"top"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L676-L680 |
3,818 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setCustomAreaFillBottom | public void setCustomAreaFillBottom(final Color CUSTOM_AREA_FILL_COLOR_BOTTOM) {
customAreaFillBottom = CUSTOM_AREA_FILL_COLOR_BOTTOM;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setCustomAreaFillBottom(final Color CUSTOM_AREA_FILL_COLOR_BOTTOM) {
customAreaFillBottom = CUSTOM_AREA_FILL_COLOR_BOTTOM;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setCustomAreaFillBottom",
"(",
"final",
"Color",
"CUSTOM_AREA_FILL_COLOR_BOTTOM",
")",
"{",
"customAreaFillBottom",
"=",
"CUSTOM_AREA_FILL_COLOR_BOTTOM",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"... | Sets the color that will be used for a custom area gradient at bottom
@param CUSTOM_AREA_FILL_COLOR_BOTTOM | [
"Sets",
"the",
"color",
"that",
"will",
"be",
"used",
"for",
"a",
"custom",
"area",
"gradient",
"at",
"bottom"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L694-L698 |
3,819 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setLineWidth | public void setLineWidth(final float LINE_WIDTH) {
lineWidth = LINE_WIDTH;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setLineWidth(final float LINE_WIDTH) {
lineWidth = LINE_WIDTH;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setLineWidth",
"(",
"final",
"float",
"LINE_WIDTH",
")",
"{",
"lineWidth",
"=",
"LINE_WIDTH",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
";",
"}"
] | Defines the width of the sparkline
@param LINE_WIDTH | [
"Defines",
"the",
"width",
"of",
"the",
"sparkline"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L712-L716 |
3,820 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setLineShadow | public void setLineShadow(final boolean LINE_SHADOW_VISIBLE) {
lineShadowVisible = LINE_SHADOW_VISIBLE;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setLineShadow(final boolean LINE_SHADOW_VISIBLE) {
lineShadowVisible = LINE_SHADOW_VISIBLE;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setLineShadow",
"(",
"final",
"boolean",
"LINE_SHADOW_VISIBLE",
")",
"{",
"lineShadowVisible",
"=",
"LINE_SHADOW_VISIBLE",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repaint",
"(",
"INNER_BOUND... | Enables or disables the visibility of the sparkline shadow
@param LINE_SHADOW_VISIBLE | [
"Enables",
"or",
"disables",
"the",
"visibility",
"of",
"the",
"sparkline",
"shadow"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L730-L734 |
3,821 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.setSmoothFunction | public void setSmoothFunction(final SmoothingFunction SMOOTHING_FUNCTION) {
this.smoothFunction = SMOOTHING_FUNCTION;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | java | public void setSmoothFunction(final SmoothingFunction SMOOTHING_FUNCTION) {
this.smoothFunction = SMOOTHING_FUNCTION;
init(INNER_BOUNDS.width, INNER_BOUNDS.height);
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setSmoothFunction",
"(",
"final",
"SmoothingFunction",
"SMOOTHING_FUNCTION",
")",
"{",
"this",
".",
"smoothFunction",
"=",
"SMOOTHING_FUNCTION",
";",
"init",
"(",
"INNER_BOUNDS",
".",
"width",
",",
"INNER_BOUNDS",
".",
"height",
")",
";",
"repai... | Defines the smoothing function that will be applied to the data if selected
@param SMOOTHING_FUNCTION | [
"Defines",
"the",
"smoothing",
"function",
"that",
"will",
"be",
"applied",
"to",
"the",
"data",
"if",
"selected"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L821-L825 |
3,822 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.calculate | private void calculate(final int WIDTH, final int HEIGHT) {
// Set start and stop values
start = DATA_LIST.getFirst().getValue();
stop = DATA_LIST.getLast().getValue();
// Find min and max values
lo = DATA_LIST.getFirst().getValue();
hi = DATA_LIST.getFirst().getValue();... | java | private void calculate(final int WIDTH, final int HEIGHT) {
// Set start and stop values
start = DATA_LIST.getFirst().getValue();
stop = DATA_LIST.getLast().getValue();
// Find min and max values
lo = DATA_LIST.getFirst().getValue();
hi = DATA_LIST.getFirst().getValue();... | [
"private",
"void",
"calculate",
"(",
"final",
"int",
"WIDTH",
",",
"final",
"int",
"HEIGHT",
")",
"{",
"// Set start and stop values",
"start",
"=",
"DATA_LIST",
".",
"getFirst",
"(",
")",
".",
"getValue",
"(",
")",
";",
"stop",
"=",
"DATA_LIST",
".",
"get... | Calculates the sparkline with all it's parameters. This methods
will be called everytime a new value was added to the DATA_LIST
@param WIDTH
@param HEIGHT | [
"Calculates",
"the",
"sparkline",
"with",
"all",
"it",
"s",
"parameters",
".",
"This",
"methods",
"will",
"be",
"called",
"everytime",
"a",
"new",
"value",
"was",
"added",
"to",
"the",
"DATA_LIST"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L936-L979 |
3,823 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.calcHiLoValues | private void calcHiLoValues(double y, int index) {
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
hi = y;
hiIndex = index;
}
} | java | private void calcHiLoValues(double y, int index) {
if (y < lo) {
lo = y;
loIndex = index;
}
if (y > hi) {
hi = y;
hiIndex = index;
}
} | [
"private",
"void",
"calcHiLoValues",
"(",
"double",
"y",
",",
"int",
"index",
")",
"{",
"if",
"(",
"y",
"<",
"lo",
")",
"{",
"lo",
"=",
"y",
";",
"loIndex",
"=",
"index",
";",
"}",
"if",
"(",
"y",
">",
"hi",
")",
"{",
"hi",
"=",
"y",
";",
"... | Calculates the max and min measured values and stores the index of the
related values in in loIndex and hiIndex.
@param y
@param index | [
"Calculates",
"the",
"max",
"and",
"min",
"measured",
"values",
"and",
"stores",
"the",
"index",
"of",
"the",
"related",
"values",
"in",
"in",
"loIndex",
"and",
"hiIndex",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1036-L1046 |
3,824 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.sortData | private void sortData() {
sortedList.clear();
for (DataPoint dataPoint : DATA_LIST) {
sortedList.add(dataPoint.getValue());
}
Collections.sort(sortedList);
} | java | private void sortData() {
sortedList.clear();
for (DataPoint dataPoint : DATA_LIST) {
sortedList.add(dataPoint.getValue());
}
Collections.sort(sortedList);
} | [
"private",
"void",
"sortData",
"(",
")",
"{",
"sortedList",
".",
"clear",
"(",
")",
";",
"for",
"(",
"DataPoint",
"dataPoint",
":",
"DATA_LIST",
")",
"{",
"sortedList",
".",
"add",
"(",
"dataPoint",
".",
"getValue",
"(",
")",
")",
";",
"}",
"Collection... | Puts all values in a ArrayList and sorts them | [
"Puts",
"all",
"values",
"in",
"a",
"ArrayList",
"and",
"sorts",
"them"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1051-L1057 |
3,825 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.continuousAverage | private double continuousAverage(final double Y0, final double Y1, final double Y2) {
final double A = 1;
final double B = 1;
final double C = 1;
return ((A * Y0) + (B * Y1) + (C * Y2)) / (A + B + C);
} | java | private double continuousAverage(final double Y0, final double Y1, final double Y2) {
final double A = 1;
final double B = 1;
final double C = 1;
return ((A * Y0) + (B * Y1) + (C * Y2)) / (A + B + C);
} | [
"private",
"double",
"continuousAverage",
"(",
"final",
"double",
"Y0",
",",
"final",
"double",
"Y1",
",",
"final",
"double",
"Y2",
")",
"{",
"final",
"double",
"A",
"=",
"1",
";",
"final",
"double",
"B",
"=",
"1",
";",
"final",
"double",
"C",
"=",
"... | Returns the value smoothed by a continuous average function
@param Y0
@param Y1
@param Y2
@return the value smoothed by a continous average function | [
"Returns",
"the",
"value",
"smoothed",
"by",
"a",
"continuous",
"average",
"function"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1068-L1074 |
3,826 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.cubicInterpolate | private double cubicInterpolate(final double Y0, final double Y1, final double Y2, final double Y3, final double MU) {
final double A0;
final double A1;
final double A2;
final double A3;
final double MU2;
MU2 = MU * MU;
A0 = Y3 - Y2 - Y0 + Y1;
A1 = Y0 - Y... | java | private double cubicInterpolate(final double Y0, final double Y1, final double Y2, final double Y3, final double MU) {
final double A0;
final double A1;
final double A2;
final double A3;
final double MU2;
MU2 = MU * MU;
A0 = Y3 - Y2 - Y0 + Y1;
A1 = Y0 - Y... | [
"private",
"double",
"cubicInterpolate",
"(",
"final",
"double",
"Y0",
",",
"final",
"double",
"Y1",
",",
"final",
"double",
"Y2",
",",
"final",
"double",
"Y3",
",",
"final",
"double",
"MU",
")",
"{",
"final",
"double",
"A0",
";",
"final",
"double",
"A1"... | Returns the value smoothed by a cubic spline interpolation function
@param Y0
@param Y1
@param Y2
@param Y3
@param MU
@return the value smoothed by a cubic spline interpolation function | [
"Returns",
"the",
"value",
"smoothed",
"by",
"a",
"cubic",
"spline",
"interpolation",
"function"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1085-L1099 |
3,827 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.cosInterpolate | private double cosInterpolate(final double Y1, final double Y2, final double MU) {
final double MU2;
MU2 = (1 - Math.cos(MU * Math.PI)) / 2;
return (Y1 * (1 - MU2) + Y2 * MU2);
} | java | private double cosInterpolate(final double Y1, final double Y2, final double MU) {
final double MU2;
MU2 = (1 - Math.cos(MU * Math.PI)) / 2;
return (Y1 * (1 - MU2) + Y2 * MU2);
} | [
"private",
"double",
"cosInterpolate",
"(",
"final",
"double",
"Y1",
",",
"final",
"double",
"Y2",
",",
"final",
"double",
"MU",
")",
"{",
"final",
"double",
"MU2",
";",
"MU2",
"=",
"(",
"1",
"-",
"Math",
".",
"cos",
"(",
"MU",
"*",
"Math",
".",
"P... | Returns the value smoothed by a cosinus interpolation function
@param Y1
@param Y2
@param MU
@return the value smoothed by a cosinus interpolation function | [
"Returns",
"the",
"value",
"smoothed",
"by",
"a",
"cosinus",
"interpolation",
"function"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1108-L1113 |
3,828 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.hermiteInterpolate | private double hermiteInterpolate(final double Y0, final double Y1, final double Y2, final double Y3,
final double MU, final double TENSION, final double BIAS) {
double m0;
double m1;
final double MU2;
final double Mu3;
final double A0;
... | java | private double hermiteInterpolate(final double Y0, final double Y1, final double Y2, final double Y3,
final double MU, final double TENSION, final double BIAS) {
double m0;
double m1;
final double MU2;
final double Mu3;
final double A0;
... | [
"private",
"double",
"hermiteInterpolate",
"(",
"final",
"double",
"Y0",
",",
"final",
"double",
"Y1",
",",
"final",
"double",
"Y2",
",",
"final",
"double",
"Y3",
",",
"final",
"double",
"MU",
",",
"final",
"double",
"TENSION",
",",
"final",
"double",
"BIA... | Returns the value smoothed by a hermite interpolation function
@param Y0
@param Y1
@param Y2
@param Y3
@param MU
@param TENSION
@param BIAS
@return the value smoothed by a hermite interpolation function | [
"Returns",
"the",
"value",
"smoothed",
"by",
"a",
"hermite",
"interpolation",
"function"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1126-L1149 |
3,829 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java | SparkLine.create_HI_INDICATOR_Image | private BufferedImage create_HI_INDICATOR_Image(final int WIDTH) {
if (WIDTH <= 0) {
return null;
}
// Define the size of the indicator
int indicatorSize = (int) (0.015 * WIDTH);
if (indicatorSize < 4) {
indicatorSize = 4;
}
if (indicatorS... | java | private BufferedImage create_HI_INDICATOR_Image(final int WIDTH) {
if (WIDTH <= 0) {
return null;
}
// Define the size of the indicator
int indicatorSize = (int) (0.015 * WIDTH);
if (indicatorSize < 4) {
indicatorSize = 4;
}
if (indicatorS... | [
"private",
"BufferedImage",
"create_HI_INDICATOR_Image",
"(",
"final",
"int",
"WIDTH",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"// Define the size of the indicator",
"int",
"indicatorSize",
"=",
"(",
"int",
")",
"(",
"0.0... | Returns a buffered image that contains the hi value indicator
@param WIDTH
@return a buffered image that contains the hi value indicator | [
"Returns",
"a",
"buffered",
"image",
"that",
"contains",
"the",
"hi",
"value",
"indicator"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/gauges/SparkLine.java#L1447-L1505 |
3,830 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Clock.java | Clock.setHour | public void setHour(final int HOUR) {
hour = HOUR % 12;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | java | public void setHour(final int HOUR) {
hour = HOUR % 12;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | [
"public",
"void",
"setHour",
"(",
"final",
"int",
"HOUR",
")",
"{",
"hour",
"=",
"HOUR",
"%",
"12",
";",
"calculateAngles",
"(",
"hour",
",",
"minute",
",",
"second",
")",
";",
"repaint",
"(",
"getInnerBounds",
"(",
")",
")",
";",
"}"
] | Sets the current hour of the clock
@param HOUR | [
"Sets",
"the",
"current",
"hour",
"of",
"the",
"clock"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Clock.java#L322-L326 |
3,831 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Clock.java | Clock.setMinute | public void setMinute(final int MINUTE) {
minute = MINUTE % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | java | public void setMinute(final int MINUTE) {
minute = MINUTE % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | [
"public",
"void",
"setMinute",
"(",
"final",
"int",
"MINUTE",
")",
"{",
"minute",
"=",
"MINUTE",
"%",
"60",
";",
"calculateAngles",
"(",
"hour",
",",
"minute",
",",
"second",
")",
";",
"repaint",
"(",
"getInnerBounds",
"(",
")",
")",
";",
"}"
] | Sets the current minute of the clock
@param MINUTE | [
"Sets",
"the",
"current",
"minute",
"of",
"the",
"clock"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Clock.java#L340-L344 |
3,832 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Clock.java | Clock.setSecond | public void setSecond(final int SECOND) {
second = SECOND % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | java | public void setSecond(final int SECOND) {
second = SECOND % 60;
calculateAngles(hour, minute, second);
repaint(getInnerBounds());
} | [
"public",
"void",
"setSecond",
"(",
"final",
"int",
"SECOND",
")",
"{",
"second",
"=",
"SECOND",
"%",
"60",
";",
"calculateAngles",
"(",
"hour",
",",
"minute",
",",
"second",
")",
";",
"repaint",
"(",
"getInnerBounds",
"(",
")",
")",
";",
"}"
] | Sets the current second of the clock
@param SECOND | [
"Sets",
"the",
"current",
"second",
"of",
"the",
"clock"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Clock.java#L358-L362 |
3,833 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.setLocation | public void setLocation(final Point2D LOCATION) {
this.lon = LOCATION.getX();
this.lat = LOCATION.getY();
this.LOCATION.setLocation(LOCATION);
this.LOCATION_XY.setLocation(toXY(this.lat, this.lon));
adjustDirection();
} | java | public void setLocation(final Point2D LOCATION) {
this.lon = LOCATION.getX();
this.lat = LOCATION.getY();
this.LOCATION.setLocation(LOCATION);
this.LOCATION_XY.setLocation(toXY(this.lat, this.lon));
adjustDirection();
} | [
"public",
"void",
"setLocation",
"(",
"final",
"Point2D",
"LOCATION",
")",
"{",
"this",
".",
"lon",
"=",
"LOCATION",
".",
"getX",
"(",
")",
";",
"this",
".",
"lat",
"=",
"LOCATION",
".",
"getY",
"(",
")",
";",
"this",
".",
"LOCATION",
".",
"setLocati... | Sets the location of the poi by the given Point2D
@param LOCATION | [
"Sets",
"the",
"location",
"of",
"the",
"poi",
"by",
"the",
"given",
"Point2D"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L321-L327 |
3,834 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.setLocation | public final void setLocation(final double LAT, final double LON) {
this.lon = LON; // X
this.lat = LAT; // Y
this.LOCATION.setLocation(LON, LAT);
this.LOCATION_XY.setLocation(toXY(LAT, LON));
adjustDirection();
} | java | public final void setLocation(final double LAT, final double LON) {
this.lon = LON; // X
this.lat = LAT; // Y
this.LOCATION.setLocation(LON, LAT);
this.LOCATION_XY.setLocation(toXY(LAT, LON));
adjustDirection();
} | [
"public",
"final",
"void",
"setLocation",
"(",
"final",
"double",
"LAT",
",",
"final",
"double",
"LON",
")",
"{",
"this",
".",
"lon",
"=",
"LON",
";",
"// X",
"this",
".",
"lat",
"=",
"LAT",
";",
"// Y",
"this",
".",
"LOCATION",
".",
"setLocation",
"... | Sets the location of the poi by the given latitude
and longitude values
@param LAT
@param LON | [
"Sets",
"the",
"location",
"of",
"the",
"poi",
"by",
"the",
"given",
"latitude",
"and",
"longitude",
"values"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L335-L341 |
3,835 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.distanceTo | public double distanceTo(final double LAT, final double LON) {
final double EARTH_RADIUS = 6371000.0; // m
return Math.abs(Math.acos(Math.sin(Math.toRadians(LAT)) * Math.sin(Math.toRadians(this.lat)) + Math.cos(Math.toRadians(LAT)) * Math.cos(Math.toRadians(this.lat)) * Math.cos(Math.toRadians(LON - thi... | java | public double distanceTo(final double LAT, final double LON) {
final double EARTH_RADIUS = 6371000.0; // m
return Math.abs(Math.acos(Math.sin(Math.toRadians(LAT)) * Math.sin(Math.toRadians(this.lat)) + Math.cos(Math.toRadians(LAT)) * Math.cos(Math.toRadians(this.lat)) * Math.cos(Math.toRadians(LON - thi... | [
"public",
"double",
"distanceTo",
"(",
"final",
"double",
"LAT",
",",
"final",
"double",
"LON",
")",
"{",
"final",
"double",
"EARTH_RADIUS",
"=",
"6371000.0",
";",
"// m",
"return",
"Math",
".",
"abs",
"(",
"Math",
".",
"acos",
"(",
"Math",
".",
"sin",
... | Returns the distance in meters of the poi to the coordinate defined
by the given latitude and longitude. The calculation takes the
earth radius into account.
@param LAT
@param LON
@return the distance in meters to the given coordinate | [
"Returns",
"the",
"distance",
"in",
"meters",
"of",
"the",
"poi",
"to",
"the",
"coordinate",
"defined",
"by",
"the",
"given",
"latitude",
"and",
"longitude",
".",
"The",
"calculation",
"takes",
"the",
"earth",
"radius",
"into",
"account",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L371-L374 |
3,836 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.shiftTo | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.asin(Math.sin(LAT1) * Math.cos(DISTANCE / EARTH_RADIUS) + M... | java | public Point2D shiftTo(final double DISTANCE, final double ANGLE) {
final double EARTH_RADIUS = 6371000.0; // m
final double LON1 = Math.toRadians(this.lon);
final double LAT1 = Math.toRadians(this.lat);
final double LAT2 = Math.asin(Math.sin(LAT1) * Math.cos(DISTANCE / EARTH_RADIUS) + M... | [
"public",
"Point2D",
"shiftTo",
"(",
"final",
"double",
"DISTANCE",
",",
"final",
"double",
"ANGLE",
")",
"{",
"final",
"double",
"EARTH_RADIUS",
"=",
"6371000.0",
";",
"// m",
"final",
"double",
"LON1",
"=",
"Math",
".",
"toRadians",
"(",
"this",
".",
"lo... | Moves the poi to the position defined by the given distance and angle
@param DISTANCE
@param ANGLE
@return the poi moved by the given distance and angle | [
"Moves",
"the",
"poi",
"to",
"the",
"position",
"defined",
"by",
"the",
"given",
"distance",
"and",
"angle"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L382-L393 |
3,837 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.toXY | public final Point2D toXY(final double LAT, final double LON) {
final double LATITUDE = (LAT * (-1)) + 90.0;
final double LONGITUDE = LON + 180.0;
final double X = Math.round(LONGITUDE * (WORLD_MAP.getWidth() / 360));
final double Y = Math.round(LATITUDE * (WORLD_MAP.getHeight() / 180))... | java | public final Point2D toXY(final double LAT, final double LON) {
final double LATITUDE = (LAT * (-1)) + 90.0;
final double LONGITUDE = LON + 180.0;
final double X = Math.round(LONGITUDE * (WORLD_MAP.getWidth() / 360));
final double Y = Math.round(LATITUDE * (WORLD_MAP.getHeight() / 180))... | [
"public",
"final",
"Point2D",
"toXY",
"(",
"final",
"double",
"LAT",
",",
"final",
"double",
"LON",
")",
"{",
"final",
"double",
"LATITUDE",
"=",
"(",
"LAT",
"*",
"(",
"-",
"1",
")",
")",
"+",
"90.0",
";",
"final",
"double",
"LONGITUDE",
"=",
"LON",
... | Converts the given latitude and longitude to x,y values
@param LAT
@param LON
@return Point2D with the location of the given lat, lon | [
"Converts",
"the",
"given",
"latitude",
"and",
"longitude",
"to",
"x",
"y",
"values"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L439-L447 |
3,838 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Poi.java | Poi.create_POI_Image | private BufferedImage create_POI_Image(final int WIDTH) {
if (WIDTH <= 0) {
return null;
}
final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.TRANSLUCENT);
final java.awt.Graphics2D G2 = IMAGE.createGraphics();
G2.setRende... | java | private BufferedImage create_POI_Image(final int WIDTH) {
if (WIDTH <= 0) {
return null;
}
final java.awt.image.BufferedImage IMAGE = UTIL.createImage(WIDTH, WIDTH, java.awt.Transparency.TRANSLUCENT);
final java.awt.Graphics2D G2 = IMAGE.createGraphics();
G2.setRende... | [
"private",
"BufferedImage",
"create_POI_Image",
"(",
"final",
"int",
"WIDTH",
")",
"{",
"if",
"(",
"WIDTH",
"<=",
"0",
")",
"{",
"return",
"null",
";",
"}",
"final",
"java",
".",
"awt",
".",
"image",
".",
"BufferedImage",
"IMAGE",
"=",
"UTIL",
".",
"cr... | Creates the image of the poi
@param WIDTH
@return buffered image of the poi | [
"Creates",
"the",
"image",
"of",
"the",
"poi"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Poi.java#L456-L488 |
3,839 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.setRange | public void setRange(final double RANGE) {
this.range = RANGE;
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} | java | public void setRange(final double RANGE) {
this.range = RANGE;
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} | [
"public",
"void",
"setRange",
"(",
"final",
"double",
"RANGE",
")",
"{",
"this",
".",
"range",
"=",
"RANGE",
";",
"checkForBlips",
"(",
")",
";",
"init",
"(",
"getInnerBounds",
"(",
")",
".",
"width",
",",
"getInnerBounds",
"(",
")",
".",
"height",
")"... | Sets the range of the radar in meters which means
the distance from the center of the radar to it's
outer circle
@param RANGE | [
"Sets",
"the",
"range",
"of",
"the",
"radar",
"in",
"meters",
"which",
"means",
"the",
"distance",
"from",
"the",
"center",
"of",
"the",
"radar",
"to",
"it",
"s",
"outer",
"circle"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L237-L242 |
3,840 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.setMyLocation | public void setMyLocation(final double LON, final double LAT) {
this.MY_LOCATION.setLocation(LON, LAT);
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} | java | public void setMyLocation(final double LON, final double LAT) {
this.MY_LOCATION.setLocation(LON, LAT);
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} | [
"public",
"void",
"setMyLocation",
"(",
"final",
"double",
"LON",
",",
"final",
"double",
"LAT",
")",
"{",
"this",
".",
"MY_LOCATION",
".",
"setLocation",
"(",
"LON",
",",
"LAT",
")",
";",
"checkForBlips",
"(",
")",
";",
"init",
"(",
"getInnerBounds",
"(... | Defines the position of the center of the radar by the
given coordinates as latitude and longitude
@param LON
@param LAT | [
"Defines",
"the",
"position",
"of",
"the",
"center",
"of",
"the",
"radar",
"by",
"the",
"given",
"coordinates",
"as",
"latitude",
"and",
"longitude"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L273-L278 |
3,841 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.addPoi | public void addPoi(final Poi BLIP) {
if (pois.keySet().contains(BLIP.getName())) {
updatePoi(BLIP.getName(), BLIP.getLocation());
} else {
pois.put(BLIP.getName(), BLIP);
}
checkForBlips();
} | java | public void addPoi(final Poi BLIP) {
if (pois.keySet().contains(BLIP.getName())) {
updatePoi(BLIP.getName(), BLIP.getLocation());
} else {
pois.put(BLIP.getName(), BLIP);
}
checkForBlips();
} | [
"public",
"void",
"addPoi",
"(",
"final",
"Poi",
"BLIP",
")",
"{",
"if",
"(",
"pois",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"BLIP",
".",
"getName",
"(",
")",
")",
")",
"{",
"updatePoi",
"(",
"BLIP",
".",
"getName",
"(",
")",
",",
"BLIP",... | Adds a new point of interest to the list of poi's of the radar
Keep in mind that only the poi's are visible as blips that are
in the range of the radar.
@param BLIP | [
"Adds",
"a",
"new",
"point",
"of",
"interest",
"to",
"the",
"list",
"of",
"poi",
"s",
"of",
"the",
"radar",
"Keep",
"in",
"mind",
"that",
"only",
"the",
"poi",
"s",
"are",
"visible",
"as",
"blips",
"that",
"are",
"in",
"the",
"range",
"of",
"the",
... | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L286-L293 |
3,842 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.removePoi | public void removePoi(Poi BLIP) {
if (pois.keySet().contains(BLIP.getName())) {
pois.remove(BLIP.getName());
checkForBlips();
}
} | java | public void removePoi(Poi BLIP) {
if (pois.keySet().contains(BLIP.getName())) {
pois.remove(BLIP.getName());
checkForBlips();
}
} | [
"public",
"void",
"removePoi",
"(",
"Poi",
"BLIP",
")",
"{",
"if",
"(",
"pois",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"BLIP",
".",
"getName",
"(",
")",
")",
")",
"{",
"pois",
".",
"remove",
"(",
"BLIP",
".",
"getName",
"(",
")",
")",
"... | Removes a point of interest from the radar
Keep in mind that only the poi's are visible as blips that are
in the range of the radar.
@param BLIP | [
"Removes",
"a",
"point",
"of",
"interest",
"from",
"the",
"radar",
"Keep",
"in",
"mind",
"that",
"only",
"the",
"poi",
"s",
"are",
"visible",
"as",
"blips",
"that",
"are",
"in",
"the",
"range",
"of",
"the",
"radar",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L316-L321 |
3,843 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.getPoi | public Poi getPoi(final String NAME) {
final Poi POINT_OF_INTEREST;
if (pois.keySet().contains(NAME)) {
POINT_OF_INTEREST = pois.get(NAME);
} else {
POINT_OF_INTEREST = null;
}
return POINT_OF_INTEREST;
} | java | public Poi getPoi(final String NAME) {
final Poi POINT_OF_INTEREST;
if (pois.keySet().contains(NAME)) {
POINT_OF_INTEREST = pois.get(NAME);
} else {
POINT_OF_INTEREST = null;
}
return POINT_OF_INTEREST;
} | [
"public",
"Poi",
"getPoi",
"(",
"final",
"String",
"NAME",
")",
"{",
"final",
"Poi",
"POINT_OF_INTEREST",
";",
"if",
"(",
"pois",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"NAME",
")",
")",
"{",
"POINT_OF_INTEREST",
"=",
"pois",
".",
"get",
"(",
... | Returns the point of interest given by it's name
Keep in mind that only the poi's are visible as blips that are
in the range of the radar.
@param NAME
@return the point of interest given by it's name | [
"Returns",
"the",
"point",
"of",
"interest",
"given",
"by",
"it",
"s",
"name",
"Keep",
"in",
"mind",
"that",
"only",
"the",
"poi",
"s",
"are",
"visible",
"as",
"blips",
"that",
"are",
"in",
"the",
"range",
"of",
"the",
"radar",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L330-L339 |
3,844 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.animate | public void animate(final boolean RUN) {
if (isEnabled()) {
if (RUN) {
if (timeline.getState() != Timeline.TimelineState.PLAYING_FORWARD && timeline.getState() != Timeline.TimelineState.SUSPENDED) {
timeline = new Timeline(this);
timeline.addPr... | java | public void animate(final boolean RUN) {
if (isEnabled()) {
if (RUN) {
if (timeline.getState() != Timeline.TimelineState.PLAYING_FORWARD && timeline.getState() != Timeline.TimelineState.SUSPENDED) {
timeline = new Timeline(this);
timeline.addPr... | [
"public",
"void",
"animate",
"(",
"final",
"boolean",
"RUN",
")",
"{",
"if",
"(",
"isEnabled",
"(",
")",
")",
"{",
"if",
"(",
"RUN",
")",
"{",
"if",
"(",
"timeline",
".",
"getState",
"(",
")",
"!=",
"Timeline",
".",
"TimelineState",
".",
"PLAYING_FOR... | Animates the radar beam of the component. This has no effect
on the functionality but is only eye candy.
@param RUN enables/disables the animation of the beam | [
"Animates",
"the",
"radar",
"beam",
"of",
"the",
"component",
".",
"This",
"has",
"no",
"effect",
"on",
"the",
"functionality",
"but",
"is",
"only",
"eye",
"candy",
"."
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L346-L362 |
3,845 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Radar.java | Radar.checkForBlips | private void checkForBlips() {
blips.clear();
for (Poi poi : pois.values()) {
if (poi.distanceTo(MY_LOCATION) < this.range) {
if (!blips.keySet().contains(poi.getName())) {
blips.put(poi.getName(), poi);
}
}
}
} | java | private void checkForBlips() {
blips.clear();
for (Poi poi : pois.values()) {
if (poi.distanceTo(MY_LOCATION) < this.range) {
if (!blips.keySet().contains(poi.getName())) {
blips.put(poi.getName(), poi);
}
}
}
} | [
"private",
"void",
"checkForBlips",
"(",
")",
"{",
"blips",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Poi",
"poi",
":",
"pois",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"poi",
".",
"distanceTo",
"(",
"MY_LOCATION",
")",
"<",
"this",
".",
"ra... | Checks for poi's in the range of the radar | [
"Checks",
"for",
"poi",
"s",
"in",
"the",
"range",
"of",
"the",
"radar"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Radar.java#L367-L376 |
3,846 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Battery.java | Battery.setValue | public void setValue(final int VALUE) {
value = VALUE < 0 ? 0 : (VALUE > 100 ? 100 : VALUE);
init(getWidth(), getHeight());
repaint(INNER_BOUNDS);
} | java | public void setValue(final int VALUE) {
value = VALUE < 0 ? 0 : (VALUE > 100 ? 100 : VALUE);
init(getWidth(), getHeight());
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setValue",
"(",
"final",
"int",
"VALUE",
")",
"{",
"value",
"=",
"VALUE",
"<",
"0",
"?",
"0",
":",
"(",
"VALUE",
">",
"100",
"?",
"100",
":",
"VALUE",
")",
";",
"init",
"(",
"getWidth",
"(",
")",
",",
"getHeight",
"(",
")",
"... | Sets the current charge of the battery as integer from 0 - 100
@param VALUE | [
"Sets",
"the",
"current",
"charge",
"of",
"the",
"battery",
"as",
"integer",
"from",
"0",
"-",
"100"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Battery.java#L160-L164 |
3,847 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Battery.java | Battery.setLightPosition | public void setLightPosition(final Orientation LIGHT_POSITION) {
lightPosition = LIGHT_POSITION;
init(getWidth(), getHeight());
repaint(INNER_BOUNDS);
} | java | public void setLightPosition(final Orientation LIGHT_POSITION) {
lightPosition = LIGHT_POSITION;
init(getWidth(), getHeight());
repaint(INNER_BOUNDS);
} | [
"public",
"void",
"setLightPosition",
"(",
"final",
"Orientation",
"LIGHT_POSITION",
")",
"{",
"lightPosition",
"=",
"LIGHT_POSITION",
";",
"init",
"(",
"getWidth",
"(",
")",
",",
"getHeight",
"(",
")",
")",
";",
"repaint",
"(",
"INNER_BOUNDS",
")",
";",
"}"... | Set the position of the light that affects the gradient of the battery frame
@param LIGHT_POSITION | [
"Set",
"the",
"position",
"of",
"the",
"light",
"that",
"affects",
"the",
"gradient",
"of",
"the",
"battery",
"frame"
] | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Battery.java#L178-L182 |
3,848 | HanSolo/SteelSeries-Swing | src/main/java/eu/hansolo/steelseries/extras/Battery.java | Battery.calcInnerBounds | private void calcInnerBounds() {
final java.awt.Insets INSETS = getInsets();
INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, (getWidth() - INSETS.left - INSETS.right), (getHeight() - INSETS.top - INSETS.bottom));
} | java | private void calcInnerBounds() {
final java.awt.Insets INSETS = getInsets();
INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, (getWidth() - INSETS.left - INSETS.right), (getHeight() - INSETS.top - INSETS.bottom));
} | [
"private",
"void",
"calcInnerBounds",
"(",
")",
"{",
"final",
"java",
".",
"awt",
".",
"Insets",
"INSETS",
"=",
"getInsets",
"(",
")",
";",
"INNER_BOUNDS",
".",
"setBounds",
"(",
"INSETS",
".",
"left",
",",
"INSETS",
".",
"top",
",",
"(",
"getWidth",
"... | Calculates the rectangle that specifies the area that is available
for painting the gauge. This means that if the component has insets
that are larger than 0, these will be taken into account. | [
"Calculates",
"the",
"rectangle",
"that",
"specifies",
"the",
"area",
"that",
"is",
"available",
"for",
"painting",
"the",
"gauge",
".",
"This",
"means",
"that",
"if",
"the",
"component",
"has",
"insets",
"that",
"are",
"larger",
"than",
"0",
"these",
"will"... | c2f7b45a477757ef21bbb6a1174ddedb2250ae57 | https://github.com/HanSolo/SteelSeries-Swing/blob/c2f7b45a477757ef21bbb6a1174ddedb2250ae57/src/main/java/eu/hansolo/steelseries/extras/Battery.java#L373-L376 |
3,849 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java | MongoReader.init | public void init(Partition partition) {
try {
List<ServerAddress> addressList = new ArrayList<>();
for (String s : (List<String>) ((DeepPartition) partition).splitWrapper().getReplicas()) {
addressList.add(new ServerAddress(s));
}
//Credentials
... | java | public void init(Partition partition) {
try {
List<ServerAddress> addressList = new ArrayList<>();
for (String s : (List<String>) ((DeepPartition) partition).splitWrapper().getReplicas()) {
addressList.add(new ServerAddress(s));
}
//Credentials
... | [
"public",
"void",
"init",
"(",
"Partition",
"partition",
")",
"{",
"try",
"{",
"List",
"<",
"ServerAddress",
">",
"addressList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"(",
"List",
"<",
"String",
">",
")",
"(",
... | Init void.
@param partition the partition | [
"Init",
"void",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java#L120-L151 |
3,850 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java | MongoReader.createQueryPartition | private DBObject createQueryPartition(MongoPartition partition) {
QueryBuilder queryBuilderMin = QueryBuilder.start(partition.getKey());
DBObject bsonObjectMin = queryBuilderMin.greaterThanEquals(partition.splitWrapper().getStartToken()).get();
QueryBuilder queryBuilderMax = QueryBuilder.start... | java | private DBObject createQueryPartition(MongoPartition partition) {
QueryBuilder queryBuilderMin = QueryBuilder.start(partition.getKey());
DBObject bsonObjectMin = queryBuilderMin.greaterThanEquals(partition.splitWrapper().getStartToken()).get();
QueryBuilder queryBuilderMax = QueryBuilder.start... | [
"private",
"DBObject",
"createQueryPartition",
"(",
"MongoPartition",
"partition",
")",
"{",
"QueryBuilder",
"queryBuilderMin",
"=",
"QueryBuilder",
".",
"start",
"(",
"partition",
".",
"getKey",
"(",
")",
")",
";",
"DBObject",
"bsonObjectMin",
"=",
"queryBuilderMin... | Create query partition.
@param partition the partition
@return the dB object | [
"Create",
"query",
"partition",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java#L159-L179 |
3,851 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java | MongoReader.generateFilterQuery | private DBObject generateFilterQuery(MongoPartition partition) {
if (mongoDeepJobConfig.getQuery() != null) {
QueryBuilder queryBuilder = QueryBuilder.start();
queryBuilder.and(createQueryPartition(partition), mongoDeepJobConfig.getQuery());
LOG.debug("mongodb query "+quer... | java | private DBObject generateFilterQuery(MongoPartition partition) {
if (mongoDeepJobConfig.getQuery() != null) {
QueryBuilder queryBuilder = QueryBuilder.start();
queryBuilder.and(createQueryPartition(partition), mongoDeepJobConfig.getQuery());
LOG.debug("mongodb query "+quer... | [
"private",
"DBObject",
"generateFilterQuery",
"(",
"MongoPartition",
"partition",
")",
"{",
"if",
"(",
"mongoDeepJobConfig",
".",
"getQuery",
"(",
")",
"!=",
"null",
")",
"{",
"QueryBuilder",
"queryBuilder",
"=",
"QueryBuilder",
".",
"start",
"(",
")",
";",
"q... | Generate filter query.
@param partition the partition
@return the dB object | [
"Generate",
"filter",
"query",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/reader/MongoReader.java#L187-L201 |
3,852 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/config/MongoDeepJobConfig.java | MongoDeepJobConfig.validate | private void validate() {
if (host.isEmpty()) {
throw new IllegalArgumentException("host cannot be null");
}
if (catalog == null) {
throw new IllegalArgumentException("database cannot be null");
}
if (table == null) {
throw new IllegalArgument... | java | private void validate() {
if (host.isEmpty()) {
throw new IllegalArgumentException("host cannot be null");
}
if (catalog == null) {
throw new IllegalArgumentException("database cannot be null");
}
if (table == null) {
throw new IllegalArgument... | [
"private",
"void",
"validate",
"(",
")",
"{",
"if",
"(",
"host",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"host cannot be null\"",
")",
";",
"}",
"if",
"(",
"catalog",
"==",
"null",
")",
"{",
"throw",
"new",
... | validates connection parameters | [
"validates",
"connection",
"parameters"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/config/MongoDeepJobConfig.java#L428-L441 |
3,853 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/config/MongoDeepJobConfig.java | MongoDeepJobConfig.filterQuery | public MongoDeepJobConfig<T> filterQuery(Filter[] filters) {
if (filters.length > 0) {
List<BasicDBObject> list = new ArrayList<>();
QueryBuilder queryBuilder = QueryBuilder.start();
for (int i = 0; i < filters.length; i++) {
BasicDBObject bsonObject = new B... | java | public MongoDeepJobConfig<T> filterQuery(Filter[] filters) {
if (filters.length > 0) {
List<BasicDBObject> list = new ArrayList<>();
QueryBuilder queryBuilder = QueryBuilder.start();
for (int i = 0; i < filters.length; i++) {
BasicDBObject bsonObject = new B... | [
"public",
"MongoDeepJobConfig",
"<",
"T",
">",
"filterQuery",
"(",
"Filter",
"[",
"]",
"filters",
")",
"{",
"if",
"(",
"filters",
".",
"length",
">",
"0",
")",
"{",
"List",
"<",
"BasicDBObject",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
"... | Filter query.
@param filters the filters
@return the mongo deep job config | [
"Filter",
"query",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/config/MongoDeepJobConfig.java#L540-L566 |
3,854 | Stratio/deep-spark | deep-elasticsearch/src/main/java/com/stratio/deep/es/config/ESConfigFactory.java | ESConfigFactory.createES | public static <T extends IDeepType> ESDeepJobConfig<T> createES(Class<T> entityClass) {
return new ESDeepJobConfig<>(entityClass);
} | java | public static <T extends IDeepType> ESDeepJobConfig<T> createES(Class<T> entityClass) {
return new ESDeepJobConfig<>(entityClass);
} | [
"public",
"static",
"<",
"T",
"extends",
"IDeepType",
">",
"ESDeepJobConfig",
"<",
"T",
">",
"createES",
"(",
"Class",
"<",
"T",
">",
"entityClass",
")",
"{",
"return",
"new",
"ESDeepJobConfig",
"<>",
"(",
"entityClass",
")",
";",
"}"
] | Creates a new entity-based ElasticSearch job configuration object.
@param entityClass the class instance of the entity class that will be used to map db objects to Java objects.
@param <T> the generic type of the entity object implementing IDeepType.
@return a new entity-based ElasticSearch job configuration o... | [
"Creates",
"a",
"new",
"entity",
"-",
"based",
"ElasticSearch",
"job",
"configuration",
"object",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-elasticsearch/src/main/java/com/stratio/deep/es/config/ESConfigFactory.java#L50-L52 |
3,855 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/CassandraDeepJobConfig.java | CassandraDeepJobConfig.fetchTableMetadata | public TableMetadata fetchTableMetadata() {
Metadata metadata = getSession().getCluster().getMetadata();
KeyspaceMetadata ksMetadata = metadata.getKeyspace(quote(this.catalog));
if (ksMetadata != null) {
return ksMetadata.getTable(quote(this.table));
} else {
re... | java | public TableMetadata fetchTableMetadata() {
Metadata metadata = getSession().getCluster().getMetadata();
KeyspaceMetadata ksMetadata = metadata.getKeyspace(quote(this.catalog));
if (ksMetadata != null) {
return ksMetadata.getTable(quote(this.table));
} else {
re... | [
"public",
"TableMetadata",
"fetchTableMetadata",
"(",
")",
"{",
"Metadata",
"metadata",
"=",
"getSession",
"(",
")",
".",
"getCluster",
"(",
")",
".",
"getMetadata",
"(",
")",
";",
"KeyspaceMetadata",
"ksMetadata",
"=",
"metadata",
".",
"getKeyspace",
"(",
"qu... | Fetches table metadata from the underlying datastore, using DataStax java driver.
@return the table metadata as returned by the driver. | [
"Fetches",
"table",
"metadata",
"from",
"the",
"underlying",
"datastore",
"using",
"DataStax",
"java",
"driver",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/CassandraDeepJobConfig.java#L210-L220 |
3,856 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/CassandraDeepJobConfig.java | CassandraDeepJobConfig.waitForNewTableMetadata | private void waitForNewTableMetadata() {
TableMetadata metadata;
int retries = 0;
final int waitTime = 100;
do {
metadata = getSession()
.getCluster()
.getMetadata()
.getKeyspace(this.catalog)
.ge... | java | private void waitForNewTableMetadata() {
TableMetadata metadata;
int retries = 0;
final int waitTime = 100;
do {
metadata = getSession()
.getCluster()
.getMetadata()
.getKeyspace(this.catalog)
.ge... | [
"private",
"void",
"waitForNewTableMetadata",
"(",
")",
"{",
"TableMetadata",
"metadata",
";",
"int",
"retries",
"=",
"0",
";",
"final",
"int",
"waitTime",
"=",
"100",
";",
"do",
"{",
"metadata",
"=",
"getSession",
"(",
")",
".",
"getCluster",
"(",
")",
... | waits until table metadata is not null | [
"waits",
"until",
"table",
"metadata",
"is",
"not",
"null"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/config/CassandraDeepJobConfig.java#L261-L290 |
3,857 | Stratio/deep-spark | deep-jdbc/src/main/java/com/stratio/deep/jdbc/writer/JdbcWriter.java | JdbcWriter.save | public void save(Map<String, Object> row) throws Exception {
Tuple2<List<String>, String> data = sqlFromRow(row);
PreparedStatement statement = conn.prepareStatement(data._2());
int i = 1;
for(String columnName:data._1()) {
statement.setObject(i, row.get(columnName));
... | java | public void save(Map<String, Object> row) throws Exception {
Tuple2<List<String>, String> data = sqlFromRow(row);
PreparedStatement statement = conn.prepareStatement(data._2());
int i = 1;
for(String columnName:data._1()) {
statement.setObject(i, row.get(columnName));
... | [
"public",
"void",
"save",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"row",
")",
"throws",
"Exception",
"{",
"Tuple2",
"<",
"List",
"<",
"String",
">",
",",
"String",
">",
"data",
"=",
"sqlFromRow",
"(",
"row",
")",
";",
"PreparedStatement",
"state... | Saves data.
@param row Data structure representing a row as a Map of column_name:column_value
@throws SQLException | [
"Saves",
"data",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-jdbc/src/main/java/com/stratio/deep/jdbc/writer/JdbcWriter.java#L66-L75 |
3,858 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.newTypeInstance | @SuppressWarnings("unchecked")
public static <T> T newTypeInstance(String className, Class<T> returnClass) {
try {
Class<T> clazz = (Class<T>) Class.forName(className);
return clazz.newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundExcepti... | java | @SuppressWarnings("unchecked")
public static <T> T newTypeInstance(String className, Class<T> returnClass) {
try {
Class<T> clazz = (Class<T>) Class.forName(className);
return clazz.newInstance();
} catch (InstantiationException | IllegalAccessException | ClassNotFoundExcepti... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"newTypeInstance",
"(",
"String",
"className",
",",
"Class",
"<",
"T",
">",
"returnClass",
")",
"{",
"try",
"{",
"Class",
"<",
"T",
">",
"clazz",
"=",
"(",
"Cla... | Creates a new instance of the given class name.
@param <T> the type parameter
@param className the class object for which a new instance should be created.
@param returnClass the return class
@return the new instance of class clazz. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"name",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L96-L104 |
3,859 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.quote | public static String quote(String identifier) {
if (StringUtils.isEmpty(identifier)) {
return identifier;
}
String res = identifier.trim();
if (!res.startsWith("\"")) {
res = "\"" + res;
}
if (!res.endsWith("\"")) {
res = res + "\"";... | java | public static String quote(String identifier) {
if (StringUtils.isEmpty(identifier)) {
return identifier;
}
String res = identifier.trim();
if (!res.startsWith("\"")) {
res = "\"" + res;
}
if (!res.endsWith("\"")) {
res = res + "\"";... | [
"public",
"static",
"String",
"quote",
"(",
"String",
"identifier",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"identifier",
")",
")",
"{",
"return",
"identifier",
";",
"}",
"String",
"res",
"=",
"identifier",
".",
"trim",
"(",
")",
";",
... | Quoting for working with uppercase
@param identifier the identifier
@return the string | [
"Quoting",
"for",
"working",
"with",
"uppercase"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L112-L129 |
3,860 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.batchQueryGenerator | public static String batchQueryGenerator(List<String> statements) {
StringBuilder sb = new StringBuilder("BEGIN BATCH \n");
for (String statement : statements) {
sb.append(statement).append("\n");
}
sb.append(" APPLY BATCH;");
return sb.toString();
} | java | public static String batchQueryGenerator(List<String> statements) {
StringBuilder sb = new StringBuilder("BEGIN BATCH \n");
for (String statement : statements) {
sb.append(statement).append("\n");
}
sb.append(" APPLY BATCH;");
return sb.toString();
} | [
"public",
"static",
"String",
"batchQueryGenerator",
"(",
"List",
"<",
"String",
">",
"statements",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"BEGIN BATCH \\n\"",
")",
";",
"for",
"(",
"String",
"statement",
":",
"statements",
")",
"... | Returns a CQL batch query wrapping the given statements.
@param statements the list of statements to use to generate the batch statement.
@return the batch statement. | [
"Returns",
"a",
"CQL",
"batch",
"query",
"wrapping",
"the",
"given",
"statements",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L161-L171 |
3,861 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.prepareTuple4CqlDriver | public static Tuple2<String[], Object[]> prepareTuple4CqlDriver(Tuple2<Cells, Cells> tuple) {
Cells keys = tuple._1();
Cells columns = tuple._2();
String[] names = new String[keys.size() + columns.size()];
Object[] values = new Object[keys.size() + columns.size()];
for (int k =... | java | public static Tuple2<String[], Object[]> prepareTuple4CqlDriver(Tuple2<Cells, Cells> tuple) {
Cells keys = tuple._1();
Cells columns = tuple._2();
String[] names = new String[keys.size() + columns.size()];
Object[] values = new Object[keys.size() + columns.size()];
for (int k =... | [
"public",
"static",
"Tuple2",
"<",
"String",
"[",
"]",
",",
"Object",
"[",
"]",
">",
"prepareTuple4CqlDriver",
"(",
"Tuple2",
"<",
"Cells",
",",
"Cells",
">",
"tuple",
")",
"{",
"Cells",
"keys",
"=",
"tuple",
".",
"_1",
"(",
")",
";",
"Cells",
"colum... | Splits columns names and values as required by Datastax java driver to generate an Insert query.
@param tuple an object containing the key Cell(s) as the first element and all the other columns as the second element.
@return an object containing an array of column names as the first element and an array of column valu... | [
"Splits",
"columns",
"names",
"and",
"values",
"as",
"required",
"by",
"Datastax",
"java",
"driver",
"to",
"generate",
"an",
"Insert",
"query",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L179-L201 |
3,862 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.findSetter | @SuppressWarnings("unchecked")
public static Method findSetter(String propertyName, Class entityClass, Class valueType) {
Method setter;
String setterName = "set" + propertyName.substring(0, 1).toUpperCase() +
propertyName.substring(1);
try {
setter = entityClass... | java | @SuppressWarnings("unchecked")
public static Method findSetter(String propertyName, Class entityClass, Class valueType) {
Method setter;
String setterName = "set" + propertyName.substring(0, 1).toUpperCase() +
propertyName.substring(1);
try {
setter = entityClass... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Method",
"findSetter",
"(",
"String",
"propertyName",
",",
"Class",
"entityClass",
",",
"Class",
"valueType",
")",
"{",
"Method",
"setter",
";",
"String",
"setterName",
"=",
"\"set\"",
"+",... | Resolves the setter name for the property whose name is 'propertyName' whose type is 'valueType'
in the entity bean whose class is 'entityClass'.
If we don't find a setter following Java's naming conventions, before throwing an exception we try to
resolve the setter following Scala's naming conventions.
@param propert... | [
"Resolves",
"the",
"setter",
"name",
"for",
"the",
"property",
"whose",
"name",
"is",
"propertyName",
"whose",
"type",
"is",
"valueType",
"in",
"the",
"entity",
"bean",
"whose",
"class",
"is",
"entityClass",
".",
"If",
"we",
"don",
"t",
"find",
"a",
"sette... | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L214-L232 |
3,863 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.findGetter | @SuppressWarnings("unchecked")
public static Method findGetter(String propertyName, Class entityClass) {
Method getter;
String getterName = "get" + propertyName.substring(0, 1).toUpperCase() +
propertyName.substring(1);
try {
getter = entityClass.getMethod(getter... | java | @SuppressWarnings("unchecked")
public static Method findGetter(String propertyName, Class entityClass) {
Method getter;
String getterName = "get" + propertyName.substring(0, 1).toUpperCase() +
propertyName.substring(1);
try {
getter = entityClass.getMethod(getter... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Method",
"findGetter",
"(",
"String",
"propertyName",
",",
"Class",
"entityClass",
")",
"{",
"Method",
"getter",
";",
"String",
"getterName",
"=",
"\"get\"",
"+",
"propertyName",
".",
"subs... | Resolves the getter name for the property whose name is 'propertyName' whose type is 'valueType'
in the entity bean whose class is 'entityClass'.
If we don't find a setter following Java's naming conventions, before throwing an exception we try to
resolve the setter following Scala's naming conventions.
@param propert... | [
"Resolves",
"the",
"getter",
"name",
"for",
"the",
"property",
"whose",
"name",
"is",
"propertyName",
"whose",
"type",
"is",
"valueType",
"in",
"the",
"entity",
"bean",
"whose",
"class",
"is",
"entityClass",
".",
"If",
"we",
"don",
"t",
"find",
"a",
"sette... | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L267-L285 |
3,864 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.inetAddressFromLocation | public static InetAddress inetAddressFromLocation(String location) {
try {
return InetAddress.getByName(location);
} catch (UnknownHostException e) {
throw new DeepIOException(e);
}
} | java | public static InetAddress inetAddressFromLocation(String location) {
try {
return InetAddress.getByName(location);
} catch (UnknownHostException e) {
throw new DeepIOException(e);
}
} | [
"public",
"static",
"InetAddress",
"inetAddressFromLocation",
"(",
"String",
"location",
")",
"{",
"try",
"{",
"return",
"InetAddress",
".",
"getByName",
"(",
"location",
")",
";",
"}",
"catch",
"(",
"UnknownHostException",
"e",
")",
"{",
"throw",
"new",
"Deep... | Returns the inet address for the specified location.
@param location the address as String
@return the InetAddress object associated to the provided address. | [
"Returns",
"the",
"inet",
"address",
"for",
"the",
"specified",
"location",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L293-L299 |
3,865 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.getAllFieldsRec | private static Field[] getAllFieldsRec(Class clazz, List<Field> fields) {
Class superClazz = clazz.getSuperclass();
if (superClazz != null) {
getAllFieldsRec(superClazz, fields);
}
fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
return fields.toArray(new Fie... | java | private static Field[] getAllFieldsRec(Class clazz, List<Field> fields) {
Class superClazz = clazz.getSuperclass();
if (superClazz != null) {
getAllFieldsRec(superClazz, fields);
}
fields.addAll(Arrays.asList(clazz.getDeclaredFields()));
return fields.toArray(new Fie... | [
"private",
"static",
"Field",
"[",
"]",
"getAllFieldsRec",
"(",
"Class",
"clazz",
",",
"List",
"<",
"Field",
">",
"fields",
")",
"{",
"Class",
"superClazz",
"=",
"clazz",
".",
"getSuperclass",
"(",
")",
";",
"if",
"(",
"superClazz",
"!=",
"null",
")",
... | Get all fields rec.
@param clazz the clazz
@param fields the fields
@return the field [ ] | [
"Get",
"all",
"fields",
"rec",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L318-L326 |
3,866 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.removeAddressPort | public static List<String> removeAddressPort(List<String> stringList) {
List<String> adresNoPort = new ArrayList<>();
for (String s : stringList) {
int index = s.indexOf(":");
if (index > -1) {
adresNoPort.add(s.substring(0, index));
continue;
... | java | public static List<String> removeAddressPort(List<String> stringList) {
List<String> adresNoPort = new ArrayList<>();
for (String s : stringList) {
int index = s.indexOf(":");
if (index > -1) {
adresNoPort.add(s.substring(0, index));
continue;
... | [
"public",
"static",
"List",
"<",
"String",
">",
"removeAddressPort",
"(",
"List",
"<",
"String",
">",
"stringList",
")",
"{",
"List",
"<",
"String",
">",
"adresNoPort",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"stri... | Remove address port.
@param stringList the string list
@return the list | [
"Remove",
"address",
"port",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L341-L354 |
3,867 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.splitListByComma | public static String splitListByComma(List<String> hosts) {
boolean firstHost = true;
StringBuilder hostConnection = new StringBuilder();
for (String host : hosts) {
if (!firstHost) {
hostConnection.append(",");
}
hostConnection.append(host.tri... | java | public static String splitListByComma(List<String> hosts) {
boolean firstHost = true;
StringBuilder hostConnection = new StringBuilder();
for (String host : hosts) {
if (!firstHost) {
hostConnection.append(",");
}
hostConnection.append(host.tri... | [
"public",
"static",
"String",
"splitListByComma",
"(",
"List",
"<",
"String",
">",
"hosts",
")",
"{",
"boolean",
"firstHost",
"=",
"true",
";",
"StringBuilder",
"hostConnection",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"String",
"host",
":",
... | Split list by comma.
@param hosts the hosts
@return string | [
"Split",
"list",
"by",
"comma",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L362-L373 |
3,868 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.getExtractorInstance | public static <T, S extends BaseConfig> IExtractor<T, S> getExtractorInstance(S config) {
try {
Class<T> rdd = (Class<T>) config.getExtractorImplClass();
if (rdd == null) {
rdd = (Class<T>) Class.forName(config.getExtractorImplClassName());
}
Cons... | java | public static <T, S extends BaseConfig> IExtractor<T, S> getExtractorInstance(S config) {
try {
Class<T> rdd = (Class<T>) config.getExtractorImplClass();
if (rdd == null) {
rdd = (Class<T>) Class.forName(config.getExtractorImplClassName());
}
Cons... | [
"public",
"static",
"<",
"T",
",",
"S",
"extends",
"BaseConfig",
">",
"IExtractor",
"<",
"T",
",",
"S",
">",
"getExtractorInstance",
"(",
"S",
"config",
")",
"{",
"try",
"{",
"Class",
"<",
"T",
">",
"rdd",
"=",
"(",
"Class",
"<",
"T",
">",
")",
"... | Gets extractor instance.
@param config the config
@return the extractor instance | [
"Gets",
"extractor",
"instance",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L381-L403 |
3,869 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.castNumberType | public static Object castNumberType(Object object, Class clazz) {
if (Number.class.isAssignableFrom(clazz)) {
// AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
if (Double.class.isAssignableFrom(clazz)) {
return ((N... | java | public static Object castNumberType(Object object, Class clazz) {
if (Number.class.isAssignableFrom(clazz)) {
// AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, Short
if (Double.class.isAssignableFrom(clazz)) {
return ((N... | [
"public",
"static",
"Object",
"castNumberType",
"(",
"Object",
"object",
",",
"Class",
"clazz",
")",
"{",
"if",
"(",
"Number",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
")",
"{",
"// AtomicInteger, AtomicLong, BigDecimal, BigInteger, Byte, D... | Cast number type.
@param object the object
@param clazz the clazz
@return object | [
"Cast",
"number",
"type",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L412-L447 |
3,870 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.cloneObjectWithParents | public static <T> T cloneObjectWithParents (T t) throws IllegalAccessException, InstantiationException {
T clone = (T) t.getClass().newInstance();
List<Field> allFields = new ArrayList<>();
Class parentClass = t.getClass().getSuperclass();
while (parentClass != null) {
Col... | java | public static <T> T cloneObjectWithParents (T t) throws IllegalAccessException, InstantiationException {
T clone = (T) t.getClass().newInstance();
List<Field> allFields = new ArrayList<>();
Class parentClass = t.getClass().getSuperclass();
while (parentClass != null) {
Col... | [
"public",
"static",
"<",
"T",
">",
"T",
"cloneObjectWithParents",
"(",
"T",
"t",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"T",
"clone",
"=",
"(",
"T",
")",
"t",
".",
"getClass",
"(",
")",
".",
"newInstance",
"(",
")",
... | Returns an instance clone.
this method gets every class property by reflection, including its parents properties
@param t
@param <T>
@return T object. | [
"Returns",
"an",
"instance",
"clone",
".",
"this",
"method",
"gets",
"every",
"class",
"property",
"by",
"reflection",
"including",
"its",
"parents",
"properties"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L498-L538 |
3,871 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java | Utils.newBlockingFixedThreadPoolExecutor | public static ExecutorService newBlockingFixedThreadPoolExecutor(int nThreads, int queueSize) {
BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(queueSize);
RejectedExecutionHandler blockingRejectedExecutionHandler = new RejectedExecutionHandler() {
@Override
publ... | java | public static ExecutorService newBlockingFixedThreadPoolExecutor(int nThreads, int queueSize) {
BlockingQueue<Runnable> blockingQueue = new ArrayBlockingQueue<>(queueSize);
RejectedExecutionHandler blockingRejectedExecutionHandler = new RejectedExecutionHandler() {
@Override
publ... | [
"public",
"static",
"ExecutorService",
"newBlockingFixedThreadPoolExecutor",
"(",
"int",
"nThreads",
",",
"int",
"queueSize",
")",
"{",
"BlockingQueue",
"<",
"Runnable",
">",
"blockingQueue",
"=",
"new",
"ArrayBlockingQueue",
"<>",
"(",
"queueSize",
")",
";",
"Rejec... | Returns an instance of ThreadPoolExecutor using an bounded queue and blocking when the worker queue is full.
@param nThreads thread pool size
@param queueSize workers queue size
@return thread pool executor | [
"Returns",
"an",
"instance",
"of",
"ThreadPoolExecutor",
"using",
"an",
"bounded",
"queue",
"and",
"blocking",
"when",
"the",
"worker",
"queue",
"is",
"full",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/Utils.java#L546-L562 |
3,872 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/config/DeepJobConfig.java | DeepJobConfig.getNameSpace | public String getNameSpace() {
if (nameSpace == null) {
nameSpace = new StringBuilder().append(catalog).append(".").append(table).toString();
}
return nameSpace;
} | java | public String getNameSpace() {
if (nameSpace == null) {
nameSpace = new StringBuilder().append(catalog).append(".").append(table).toString();
}
return nameSpace;
} | [
"public",
"String",
"getNameSpace",
"(",
")",
"{",
"if",
"(",
"nameSpace",
"==",
"null",
")",
"{",
"nameSpace",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"catalog",
")",
".",
"append",
"(",
"\".\"",
")",
".",
"append",
"(",
"table",
... | Get name space.
@return the string | [
"Get",
"name",
"space",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/config/DeepJobConfig.java#L129-L135 |
3,873 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/config/DeepJobConfig.java | DeepJobConfig.initialize | public S initialize(ExtractorConfig extractorConfig) {
setExtractorImplClassName(extractorConfig.getExtractorImplClassName());
setEntityClass(extractorConfig.getEntityClass());
setRddId(extractorConfig.getRddId());
setPartitionId(extractorConfig.getPartitionId());
Map<String, S... | java | public S initialize(ExtractorConfig extractorConfig) {
setExtractorImplClassName(extractorConfig.getExtractorImplClassName());
setEntityClass(extractorConfig.getEntityClass());
setRddId(extractorConfig.getRddId());
setPartitionId(extractorConfig.getPartitionId());
Map<String, S... | [
"public",
"S",
"initialize",
"(",
"ExtractorConfig",
"extractorConfig",
")",
"{",
"setExtractorImplClassName",
"(",
"extractorConfig",
".",
"getExtractorImplClassName",
"(",
")",
")",
";",
"setEntityClass",
"(",
"extractorConfig",
".",
"getEntityClass",
"(",
")",
")",... | Initialize s.
@param extractorConfig the extractor config
@return the s | [
"Initialize",
"s",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/config/DeepJobConfig.java#L191-L238 |
3,874 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.isShardedCollection | private boolean isShardedCollection(DBCollection collection) {
DB config = collection.getDB().getMongo().getDB("config");
DBCollection configCollections = config.getCollection("collections");
DBObject dbObject = configCollections.findOne(new BasicDBObject(MONGO_DEFAULT_ID, collection.getFullNa... | java | private boolean isShardedCollection(DBCollection collection) {
DB config = collection.getDB().getMongo().getDB("config");
DBCollection configCollections = config.getCollection("collections");
DBObject dbObject = configCollections.findOne(new BasicDBObject(MONGO_DEFAULT_ID, collection.getFullNa... | [
"private",
"boolean",
"isShardedCollection",
"(",
"DBCollection",
"collection",
")",
"{",
"DB",
"config",
"=",
"collection",
".",
"getDB",
"(",
")",
".",
"getMongo",
"(",
")",
".",
"getDB",
"(",
"\"config\"",
")",
";",
"DBCollection",
"configCollections",
"=",... | Is sharded collection.
@param collection the collection
@return the boolean | [
"Is",
"sharded",
"collection",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L137-L144 |
3,875 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getShards | private Map<String, String[]> getShards(DBCollection collection) {
DB config = collection.getDB().getSisterDB("config");
DBCollection configShards = config.getCollection("shards");
DBCursor cursorShards = configShards.find();
Map<String, String[]> map = new HashMap<>();
while (... | java | private Map<String, String[]> getShards(DBCollection collection) {
DB config = collection.getDB().getSisterDB("config");
DBCollection configShards = config.getCollection("shards");
DBCursor cursorShards = configShards.find();
Map<String, String[]> map = new HashMap<>();
while (... | [
"private",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"getShards",
"(",
"DBCollection",
"collection",
")",
"{",
"DB",
"config",
"=",
"collection",
".",
"getDB",
"(",
")",
".",
"getSisterDB",
"(",
"\"config\"",
")",
";",
"DBCollection",
"configShar... | Gets shards.
@param collection the collection
@return the shards | [
"Gets",
"shards",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L152-L169 |
3,876 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getChunks | private DBCursor getChunks(DBCollection collection) {
DB config = collection.getDB().getSisterDB("config");
DBCollection configChunks = config.getCollection("chunks");
return configChunks.find(new BasicDBObject("ns", collection.getFullName()));
} | java | private DBCursor getChunks(DBCollection collection) {
DB config = collection.getDB().getSisterDB("config");
DBCollection configChunks = config.getCollection("chunks");
return configChunks.find(new BasicDBObject("ns", collection.getFullName()));
} | [
"private",
"DBCursor",
"getChunks",
"(",
"DBCollection",
"collection",
")",
"{",
"DB",
"config",
"=",
"collection",
".",
"getDB",
"(",
")",
".",
"getSisterDB",
"(",
"\"config\"",
")",
";",
"DBCollection",
"configChunks",
"=",
"config",
".",
"getCollection",
"(... | Gets chunks.
@param collection the collection
@return the chunks | [
"Gets",
"chunks",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L177-L181 |
3,877 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.calculateSplits | private DeepPartition[] calculateSplits(DBCollection collection) {
BasicDBList splitData = getSplitData(collection);
List<ServerAddress> serverAddressList = collection.getDB().getMongo().getServerAddressList();
if (splitData == null) {
Pair<BasicDBList, List<ServerAddress>> pair = ... | java | private DeepPartition[] calculateSplits(DBCollection collection) {
BasicDBList splitData = getSplitData(collection);
List<ServerAddress> serverAddressList = collection.getDB().getMongo().getServerAddressList();
if (splitData == null) {
Pair<BasicDBList, List<ServerAddress>> pair = ... | [
"private",
"DeepPartition",
"[",
"]",
"calculateSplits",
"(",
"DBCollection",
"collection",
")",
"{",
"BasicDBList",
"splitData",
"=",
"getSplitData",
"(",
"collection",
")",
";",
"List",
"<",
"ServerAddress",
">",
"serverAddressList",
"=",
"collection",
".",
"get... | Calculate splits.
@param collection the collection
@return the deep partition [ ] | [
"Calculate",
"splits",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L189-L229 |
3,878 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getSplitData | private BasicDBList getSplitData(DBCollection collection) {
final DBObject cmd = BasicDBObjectBuilder.start("splitVector", collection.getFullName())
.add("keyPattern", new BasicDBObject(MONGO_DEFAULT_ID, 1))
.add("force", false)
.add("maxChunkSize", splitSize)
... | java | private BasicDBList getSplitData(DBCollection collection) {
final DBObject cmd = BasicDBObjectBuilder.start("splitVector", collection.getFullName())
.add("keyPattern", new BasicDBObject(MONGO_DEFAULT_ID, 1))
.add("force", false)
.add("maxChunkSize", splitSize)
... | [
"private",
"BasicDBList",
"getSplitData",
"(",
"DBCollection",
"collection",
")",
"{",
"final",
"DBObject",
"cmd",
"=",
"BasicDBObjectBuilder",
".",
"start",
"(",
"\"splitVector\"",
",",
"collection",
".",
"getFullName",
"(",
")",
")",
".",
"add",
"(",
"\"keyPat... | Gets split data.
@param collection the collection
@return the split data | [
"Gets",
"split",
"data",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L237-L248 |
3,879 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getSplitDataCollectionShardEnviroment | private Pair<BasicDBList, List<ServerAddress>> getSplitDataCollectionShardEnviroment(Map<String, String[]> shards,
String dbName,
String colle... | java | private Pair<BasicDBList, List<ServerAddress>> getSplitDataCollectionShardEnviroment(Map<String, String[]> shards,
String dbName,
String colle... | [
"private",
"Pair",
"<",
"BasicDBList",
",",
"List",
"<",
"ServerAddress",
">",
">",
"getSplitDataCollectionShardEnviroment",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"shards",
",",
"String",
"dbName",
",",
"String",
"collectionName",
")",
"{",
... | Gets split data collection shard enviroment.
@param shards the shards
@param dbName the db name
@param collectionName the collection name
@return the split data collection shard enviroment | [
"Gets",
"split",
"data",
"collection",
"shard",
"enviroment",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L258-L288 |
3,880 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.calculateShardChunks | private DeepPartition[] calculateShardChunks(DBCollection collection) {
DBCursor chuncks = getChunks(collection);
Map<String, String[]> shards = getShards(collection);
MongoPartition[] deepPartitions = new MongoPartition[chuncks.count()];
int i = 0;
boolean keyAssigned = false... | java | private DeepPartition[] calculateShardChunks(DBCollection collection) {
DBCursor chuncks = getChunks(collection);
Map<String, String[]> shards = getShards(collection);
MongoPartition[] deepPartitions = new MongoPartition[chuncks.count()];
int i = 0;
boolean keyAssigned = false... | [
"private",
"DeepPartition",
"[",
"]",
"calculateShardChunks",
"(",
"DBCollection",
"collection",
")",
"{",
"DBCursor",
"chuncks",
"=",
"getChunks",
"(",
"collection",
")",
";",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"shards",
"=",
"getShards",
"... | Calculates shard chunks.
@param collection the collection
@return the deep partition [ ] | [
"Calculates",
"shard",
"chunks",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L301-L333 |
3,881 | Stratio/deep-spark | deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java | MongoNativeExtractor.getServerAddressList | private List<ServerAddress> getServerAddressList(List<String> addressStringList) throws UnknownHostException {
List<ServerAddress> addressList = new ArrayList<>();
for (String addressString : addressStringList) {
addressList.add(new ServerAddress(addressString));
}
return a... | java | private List<ServerAddress> getServerAddressList(List<String> addressStringList) throws UnknownHostException {
List<ServerAddress> addressList = new ArrayList<>();
for (String addressString : addressStringList) {
addressList.add(new ServerAddress(addressString));
}
return a... | [
"private",
"List",
"<",
"ServerAddress",
">",
"getServerAddressList",
"(",
"List",
"<",
"String",
">",
"addressStringList",
")",
"throws",
"UnknownHostException",
"{",
"List",
"<",
"ServerAddress",
">",
"addressList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";"... | Gets server address list.
@param addressStringList the address string list
@return the server address list
@throws UnknownHostException the unknown host exception | [
"Gets",
"server",
"address",
"list",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-mongodb/src/main/java/com/stratio/deep/mongodb/extractor/MongoNativeExtractor.java#L342-L350 |
3,882 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createRDD | public <T> RDD<T> createRDD(ExtractorConfig<T> config) {
return new DeepRDD<>(this.sc(), config);
} | java | public <T> RDD<T> createRDD(ExtractorConfig<T> config) {
return new DeepRDD<>(this.sc(), config);
} | [
"public",
"<",
"T",
">",
"RDD",
"<",
"T",
">",
"createRDD",
"(",
"ExtractorConfig",
"<",
"T",
">",
"config",
")",
"{",
"return",
"new",
"DeepRDD",
"<>",
"(",
"this",
".",
"sc",
"(",
")",
",",
"config",
")",
";",
"}"
] | Creates a RDD.
@param <T> the type parameter
@param config the config
@return the rDD | [
"Creates",
"a",
"RDD",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L155-L157 |
3,883 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createJavaRDD | public <T> JavaRDD<T> createJavaRDD(
ExtractorConfig<T> config) {
return new DeepJavaRDD<>((DeepRDD<T, ExtractorConfig<T>>) createRDD(config));
} | java | public <T> JavaRDD<T> createJavaRDD(
ExtractorConfig<T> config) {
return new DeepJavaRDD<>((DeepRDD<T, ExtractorConfig<T>>) createRDD(config));
} | [
"public",
"<",
"T",
">",
"JavaRDD",
"<",
"T",
">",
"createJavaRDD",
"(",
"ExtractorConfig",
"<",
"T",
">",
"config",
")",
"{",
"return",
"new",
"DeepJavaRDD",
"<>",
"(",
"(",
"DeepRDD",
"<",
"T",
",",
"ExtractorConfig",
"<",
"T",
">",
">",
")",
"crea... | Creates a JavaRDD.
@param <T> the type parameter
@param config the config
@return the java rDD | [
"Creates",
"a",
"JavaRDD",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L170-L173 |
3,884 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createJavaRowRDD | public static JavaRDD<Row> createJavaRowRDD(JavaRDD<Cells> cellsRDD) throws UnsupportedDataTypeException {
JavaRDD<Row> result = cellsRDD.map(new Function<Cells, Row>() {
@Override
public Row call(Cells cells) throws Exception {
return CellsUtils.getRowFromCells(cells);
... | java | public static JavaRDD<Row> createJavaRowRDD(JavaRDD<Cells> cellsRDD) throws UnsupportedDataTypeException {
JavaRDD<Row> result = cellsRDD.map(new Function<Cells, Row>() {
@Override
public Row call(Cells cells) throws Exception {
return CellsUtils.getRowFromCells(cells);
... | [
"public",
"static",
"JavaRDD",
"<",
"Row",
">",
"createJavaRowRDD",
"(",
"JavaRDD",
"<",
"Cells",
">",
"cellsRDD",
")",
"throws",
"UnsupportedDataTypeException",
"{",
"JavaRDD",
"<",
"Row",
">",
"result",
"=",
"cellsRDD",
".",
"map",
"(",
"new",
"Function",
... | Creates a JavaRDD of SparkSQL rows
@param cellsRDD RDD of cells for transforming.
@return Java RDD of SparkSQL rows
@throws UnsupportedDataTypeException | [
"Creates",
"a",
"JavaRDD",
"of",
"SparkSQL",
"rows"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L185-L193 |
3,885 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createJavaSchemaRDD | public DataFrame createJavaSchemaRDD(ExtractorConfig<Cells> config) throws UnsupportedDataTypeException, UnsupportedOperationException {
JavaRDD<Cells> cellsRDD = createJavaRDD(config);
JavaRDD<Row> rowsRDD = DeepSparkContext.createJavaRowRDD(cellsRDD);
try {
Cells firstCells = cells... | java | public DataFrame createJavaSchemaRDD(ExtractorConfig<Cells> config) throws UnsupportedDataTypeException, UnsupportedOperationException {
JavaRDD<Cells> cellsRDD = createJavaRDD(config);
JavaRDD<Row> rowsRDD = DeepSparkContext.createJavaRowRDD(cellsRDD);
try {
Cells firstCells = cells... | [
"public",
"DataFrame",
"createJavaSchemaRDD",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"throws",
"UnsupportedDataTypeException",
",",
"UnsupportedOperationException",
"{",
"JavaRDD",
"<",
"Cells",
">",
"cellsRDD",
"=",
"createJavaRDD",
"(",
"config",
... | Creates a JavaSchemaRDD from a DeepJobConfig and a JavaSQLContext.
@param config Specific Deep ExtractorConfig.
@return A JavaSchemaRDD built from Cells.
@throws UnsupportedDataTypeException | [
"Creates",
"a",
"JavaSchemaRDD",
"from",
"a",
"DeepJobConfig",
"and",
"a",
"JavaSQLContext",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L201-L211 |
3,886 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.textFile | public RDD textFile(ExtractorConfig<Cells> config) throws IllegalArgumentException {
if(ExtractorConstants.HDFS.equals(config.getExtractorImplClassName())) {
return createHDFSRDD(config);
} else if(ExtractorConstants.S3.equals(config.getExtractorImplClassName())) {
return createS... | java | public RDD textFile(ExtractorConfig<Cells> config) throws IllegalArgumentException {
if(ExtractorConstants.HDFS.equals(config.getExtractorImplClassName())) {
return createHDFSRDD(config);
} else if(ExtractorConstants.S3.equals(config.getExtractorImplClassName())) {
return createS... | [
"public",
"RDD",
"textFile",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"ExtractorConstants",
".",
"HDFS",
".",
"equals",
"(",
"config",
".",
"getExtractorImplClassName",
"(",
")",
")",
")",
... | Returns a Cells RDD from a HDFS or S3 ExtractorConfig.
@param config ExtractorConfig for HDFS or S3.
@return RDD of Cells.
@throws IllegalArgumentException | [
"Returns",
"a",
"Cells",
"RDD",
"from",
"a",
"HDFS",
"or",
"S3",
"ExtractorConfig",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L263-L270 |
3,887 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createHDFSRDD | public RDD<Cells> createHDFSRDD(ExtractorConfig<Cells> config) {
Serializable host = config.getValues().get(ExtractorConstants.HOST);
Serializable port = config.getValues().get(ExtractorConstants.PORT);
Serializable path = config.getValues().get(ExtractorConstants.FS_FILE_PATH);
final ... | java | public RDD<Cells> createHDFSRDD(ExtractorConfig<Cells> config) {
Serializable host = config.getValues().get(ExtractorConstants.HOST);
Serializable port = config.getValues().get(ExtractorConstants.PORT);
Serializable path = config.getValues().get(ExtractorConstants.FS_FILE_PATH);
final ... | [
"public",
"RDD",
"<",
"Cells",
">",
"createHDFSRDD",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"{",
"Serializable",
"host",
"=",
"config",
".",
"getValues",
"(",
")",
".",
"get",
"(",
"ExtractorConstants",
".",
"HOST",
")",
";",
"Serializab... | Returns a Cells RDD from HDFS.
@param config HDFS ExtractorConfig.
@return Cells RDD. | [
"Returns",
"a",
"Cells",
"RDD",
"from",
"HDFS",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L277-L291 |
3,888 | Stratio/deep-spark | deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java | DeepSparkContext.createS3RDD | public RDD<Cells> createS3RDD(ExtractorConfig<Cells> config) {
Serializable bucket = config.getValues().get(ExtractorConstants.S3_BUCKET);
Serializable path = config.getValues().get(ExtractorConstants.FS_FILE_PATH);
final TextFileDataTable textFileDataTable = UtilFS.createTextFileMetaDataFromC... | java | public RDD<Cells> createS3RDD(ExtractorConfig<Cells> config) {
Serializable bucket = config.getValues().get(ExtractorConstants.S3_BUCKET);
Serializable path = config.getValues().get(ExtractorConstants.FS_FILE_PATH);
final TextFileDataTable textFileDataTable = UtilFS.createTextFileMetaDataFromC... | [
"public",
"RDD",
"<",
"Cells",
">",
"createS3RDD",
"(",
"ExtractorConfig",
"<",
"Cells",
">",
"config",
")",
"{",
"Serializable",
"bucket",
"=",
"config",
".",
"getValues",
"(",
")",
".",
"get",
"(",
"ExtractorConstants",
".",
"S3_BUCKET",
")",
";",
"Seria... | Returns a Cells RDD from S3 fileSystem.
@param config Amazon S3 ExtractorConfig.
@return RDD of Cells. | [
"Returns",
"a",
"Cells",
"RDD",
"from",
"S3",
"fileSystem",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-core/src/main/java/com/stratio/deep/core/context/DeepSparkContext.java#L298-L314 |
3,889 | Stratio/deep-spark | deep-aerospike/src/main/java/com/stratio/deep/aerospike/config/AerospikeConfigFactory.java | AerospikeConfigFactory.createAerospike | public static <T extends IDeepType> AerospikeDeepJobConfig<T> createAerospike(Class<T> entityClass) {
return new AerospikeDeepJobConfig<>(entityClass);
} | java | public static <T extends IDeepType> AerospikeDeepJobConfig<T> createAerospike(Class<T> entityClass) {
return new AerospikeDeepJobConfig<>(entityClass);
} | [
"public",
"static",
"<",
"T",
"extends",
"IDeepType",
">",
"AerospikeDeepJobConfig",
"<",
"T",
">",
"createAerospike",
"(",
"Class",
"<",
"T",
">",
"entityClass",
")",
"{",
"return",
"new",
"AerospikeDeepJobConfig",
"<>",
"(",
"entityClass",
")",
";",
"}"
] | Creates a new entity-based Aerospike job configuration object.
@param entityClass the class instance of the entity class that will be used to map db objects to Java objects.
@param <T> the generic type of the entity object implementing IDeepType.
@return a new entity-based Aerospike job configuration object. | [
"Creates",
"a",
"new",
"entity",
"-",
"based",
"Aerospike",
"job",
"configuration",
"object",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-aerospike/src/main/java/com/stratio/deep/aerospike/config/AerospikeConfigFactory.java#L46-L48 |
3,890 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java | AnnotationUtils.deepFieldName | public static String deepFieldName(Field field) {
DeepField annotation = field.getAnnotation(DeepField.class);
if (StringUtils.isNotEmpty(annotation.fieldName())) {
return annotation.fieldName();
} else {
return field.getName();
}
} | java | public static String deepFieldName(Field field) {
DeepField annotation = field.getAnnotation(DeepField.class);
if (StringUtils.isNotEmpty(annotation.fieldName())) {
return annotation.fieldName();
} else {
return field.getName();
}
} | [
"public",
"static",
"String",
"deepFieldName",
"(",
"Field",
"field",
")",
"{",
"DeepField",
"annotation",
"=",
"field",
".",
"getAnnotation",
"(",
"DeepField",
".",
"class",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"annotation",
".",
"fie... | Returns the field name as known by the datastore. If the provided field object DeepField annotation
specifies the fieldName property, the value of this property will be returned, otherwise the java field name
will be returned.
@param field the Field object associated to the property for which we want to resolve the na... | [
"Returns",
"the",
"field",
"name",
"as",
"known",
"by",
"the",
"datastore",
".",
"If",
"the",
"provided",
"field",
"object",
"DeepField",
"annotation",
"specifies",
"the",
"fieldName",
"property",
"the",
"value",
"of",
"this",
"property",
"will",
"be",
"return... | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/AnnotationUtils.java#L47-L55 |
3,891 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.mergeTokenRanges | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
final Iterable<Comparable> allRanges = Ordering.natural().sortedCopy(concat(toke... | java | static List<DeepTokenRange> mergeTokenRanges(Map<String, Iterable<Comparable>> tokens,
final Session session,
final IPartitioner p) {
final Iterable<Comparable> allRanges = Ordering.natural().sortedCopy(concat(toke... | [
"static",
"List",
"<",
"DeepTokenRange",
">",
"mergeTokenRanges",
"(",
"Map",
"<",
"String",
",",
"Iterable",
"<",
"Comparable",
">",
">",
"tokens",
",",
"final",
"Session",
"session",
",",
"final",
"IPartitioner",
"p",
")",
"{",
"final",
"Iterable",
"<",
... | Merges the list of tokens for each cluster machine to a single list of token ranges.
@param tokens the map of tokens for each cluster machine.
@param session the connection to the cluster.
@param p the partitioner used in the cluster.
@return the merged lists of tokens transformed to DeepTokenRange(s). The retu... | [
"Merges",
"the",
"list",
"of",
"tokens",
"for",
"each",
"cluster",
"machine",
"to",
"a",
"single",
"list",
"of",
"token",
"ranges",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L106-L122 |
3,892 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.bisectTokeRange | private static void bisectTokeRange(
DeepTokenRange range, final IPartitioner partitioner, final int bisectFactor,
final List<DeepTokenRange> accumulator) {
final AbstractType tkValidator = partitioner.getTokenValidator();
Token leftToken = partitioner.getTokenFactory().fromByt... | java | private static void bisectTokeRange(
DeepTokenRange range, final IPartitioner partitioner, final int bisectFactor,
final List<DeepTokenRange> accumulator) {
final AbstractType tkValidator = partitioner.getTokenValidator();
Token leftToken = partitioner.getTokenFactory().fromByt... | [
"private",
"static",
"void",
"bisectTokeRange",
"(",
"DeepTokenRange",
"range",
",",
"final",
"IPartitioner",
"partitioner",
",",
"final",
"int",
"bisectFactor",
",",
"final",
"List",
"<",
"DeepTokenRange",
">",
"accumulator",
")",
"{",
"final",
"AbstractType",
"t... | Recursive function that splits a given token range to a given number of token ranges.
@param range the token range to be splitted.
@param partitioner the cassandra partitioner.
@param bisectFactor the actual number of pieces the original token range will be splitted to.
@param accumulator a token range accumu... | [
"Recursive",
"function",
"that",
"splits",
"a",
"given",
"token",
"range",
"to",
"a",
"given",
"number",
"of",
"token",
"ranges",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L209-L231 |
3,893 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java | RangeUtils.getPartitioner | public static IPartitioner getPartitioner(ICassandraDeepJobConfig config) {
try {
return (IPartitioner) Class.forName(config.getPartitionerClassName()).newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new DeepGenericExcep... | java | public static IPartitioner getPartitioner(ICassandraDeepJobConfig config) {
try {
return (IPartitioner) Class.forName(config.getPartitionerClassName()).newInstance();
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new DeepGenericExcep... | [
"public",
"static",
"IPartitioner",
"getPartitioner",
"(",
"ICassandraDeepJobConfig",
"config",
")",
"{",
"try",
"{",
"return",
"(",
"IPartitioner",
")",
"Class",
".",
"forName",
"(",
"config",
".",
"getPartitionerClassName",
"(",
")",
")",
".",
"newInstance",
"... | Creates a new instance of the cassandra partitioner configured in the configuration object.
@param config the Deep configuration object.
@return an instance of the cassandra partitioner configured in the configuration object. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"cassandra",
"partitioner",
"configured",
"in",
"the",
"configuration",
"object",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/RangeUtils.java#L239-L245 |
3,894 | Stratio/deep-spark | deep-jdbc/src/main/java/com/stratio/deep/jdbc/reader/JdbcReader.java | JdbcReader.init | public void init(Partition p) throws Exception {
Class.forName(jdbcDeepJobConfig.getDriverClass());
conn = DriverManager.getConnection(jdbcDeepJobConfig.getConnectionUrl(),
jdbcDeepJobConfig.getUsername(),
jdbcDeepJobConfig.getPassword());
Statement statement = co... | java | public void init(Partition p) throws Exception {
Class.forName(jdbcDeepJobConfig.getDriverClass());
conn = DriverManager.getConnection(jdbcDeepJobConfig.getConnectionUrl(),
jdbcDeepJobConfig.getUsername(),
jdbcDeepJobConfig.getPassword());
Statement statement = co... | [
"public",
"void",
"init",
"(",
"Partition",
"p",
")",
"throws",
"Exception",
"{",
"Class",
".",
"forName",
"(",
"jdbcDeepJobConfig",
".",
"getDriverClass",
"(",
")",
")",
";",
"conn",
"=",
"DriverManager",
".",
"getConnection",
"(",
"jdbcDeepJobConfig",
".",
... | Initialized the reader
@param p
Spark partition.
@throws Exception | [
"Initialized",
"the",
"reader"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-jdbc/src/main/java/com/stratio/deep/jdbc/reader/JdbcReader.java#L84-L100 |
3,895 | Stratio/deep-spark | deep-jdbc/src/main/java/com/stratio/deep/jdbc/reader/JdbcReader.java | JdbcReader.close | public void close() throws Exception {
try {
if (resultSet != null) {
resultSet.close();
}
} finally {
if (conn != null) {
conn.close();
}
}
} | java | public void close() throws Exception {
try {
if (resultSet != null) {
resultSet.close();
}
} finally {
if (conn != null) {
conn.close();
}
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"resultSet",
"!=",
"null",
")",
"{",
"resultSet",
".",
"close",
"(",
")",
";",
"}",
"}",
"finally",
"{",
"if",
"(",
"conn",
"!=",
"null",
")",
"{",
"conn",
".... | closes the resultset and the jdbc connection.
@throws java.lang.Exception | [
"closes",
"the",
"resultset",
"and",
"the",
"jdbc",
"connection",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-jdbc/src/main/java/com/stratio/deep/jdbc/reader/JdbcReader.java#L137-L147 |
3,896 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java | DeepRecordReader.createConnection | private Session createConnection() {
/* reorder locations */
List<String> locations = Lists.newArrayList(split.getReplicas());
Collections.sort(locations, new DeepPartitionLocationComparator());
Exception lastException = null;
LOG.debug("createConnection: " + locations);
... | java | private Session createConnection() {
/* reorder locations */
List<String> locations = Lists.newArrayList(split.getReplicas());
Collections.sort(locations, new DeepPartitionLocationComparator());
Exception lastException = null;
LOG.debug("createConnection: " + locations);
... | [
"private",
"Session",
"createConnection",
"(",
")",
"{",
"/* reorder locations */",
"List",
"<",
"String",
">",
"locations",
"=",
"Lists",
".",
"newArrayList",
"(",
"split",
".",
"getReplicas",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"locations",
... | Creates a new connection. Reuses a cached connection if possible.
@return the new session | [
"Creates",
"a",
"new",
"connection",
".",
"Reuses",
"a",
"cached",
"connection",
"if",
"possible",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java#L189-L209 |
3,897 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java | DeepRecordReader.reachEndRange | private boolean reachEndRange() {
// current row key
ByteBuffer rowKey;
if (keyValidator instanceof CompositeType) {
ByteBuffer[] keys = new ByteBuffer[partitionBoundColumns.size()];
for (int i = 0; i < partitionBoundColumns.size(); i++) {
keys[i] = parti... | java | private boolean reachEndRange() {
// current row key
ByteBuffer rowKey;
if (keyValidator instanceof CompositeType) {
ByteBuffer[] keys = new ByteBuffer[partitionBoundColumns.size()];
for (int i = 0; i < partitionBoundColumns.size(); i++) {
keys[i] = parti... | [
"private",
"boolean",
"reachEndRange",
"(",
")",
"{",
"// current row key",
"ByteBuffer",
"rowKey",
";",
"if",
"(",
"keyValidator",
"instanceof",
"CompositeType",
")",
"{",
"ByteBuffer",
"[",
"]",
"keys",
"=",
"new",
"ByteBuffer",
"[",
"partitionBoundColumns",
"."... | check whether current row is at the end of range
@return the boolean | [
"check",
"whether",
"current",
"row",
"is",
"at",
"the",
"end",
"of",
"range"
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java#L662-L681 |
3,898 | Stratio/deep-spark | deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java | DeepRecordReader.next | @Override
public Pair<Map<String, ByteBuffer>, Map<String, ByteBuffer>> next() {
if (!this.hasNext()) {
throw new DeepIllegalAccessException("DeepRecordReader exhausted");
}
return rowIterator.next();
} | java | @Override
public Pair<Map<String, ByteBuffer>, Map<String, ByteBuffer>> next() {
if (!this.hasNext()) {
throw new DeepIllegalAccessException("DeepRecordReader exhausted");
}
return rowIterator.next();
} | [
"@",
"Override",
"public",
"Pair",
"<",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
",",
"Map",
"<",
"String",
",",
"ByteBuffer",
">",
">",
"next",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasNext",
"(",
")",
")",
"{",
"throw",
"new",
"Deep... | Returns the next element in the underlying rowIterator.
@return the next element in the underlying rowIterator. | [
"Returns",
"the",
"next",
"element",
"in",
"the",
"underlying",
"rowIterator",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-cassandra/src/main/java/com/stratio/deep/cassandra/cql/DeepRecordReader.java#L726-L732 |
3,899 | Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/config/ExtractorConfig.java | ExtractorConfig.getInteger | public Integer getInteger(String key) {
try {
return getValue(Integer.class, key);
} catch (ClassCastException e) {
String value = getString(key);
return Integer.parseInt(value.split(",")[0]);
}
} | java | public Integer getInteger(String key) {
try {
return getValue(Integer.class, key);
} catch (ClassCastException e) {
String value = getString(key);
return Integer.parseInt(value.split(",")[0]);
}
} | [
"public",
"Integer",
"getInteger",
"(",
"String",
"key",
")",
"{",
"try",
"{",
"return",
"getValue",
"(",
"Integer",
".",
"class",
",",
"key",
")",
";",
"}",
"catch",
"(",
"ClassCastException",
"e",
")",
"{",
"String",
"value",
"=",
"getString",
"(",
"... | Gets integer.
@param key the key
@return the integer | [
"Gets",
"integer",
"."
] | b9621c9b7a6d996f80fce1d073d696a157bed095 | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/config/ExtractorConfig.java#L118-L126 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.