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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,600 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getDayOfWeek | public static int getDayOfWeek(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DAY_OF_WEEK);
} | java | public static int getDayOfWeek(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DAY_OF_WEEK);
} | [
"public",
"static",
"int",
"getDayOfWeek",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"c",
".",
"get",
"(",
"Calendar",
".",
"DAY_OF_WEEK",
... | Get the day of week of the date
@param date date
@return day of week of the date | [
"Get",
"the",
"day",
"of",
"week",
"of",
"the",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L157-L161 |
39,601 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getHour | public static int getHour(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.HOUR_OF_DAY);
} | java | public static int getHour(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.HOUR_OF_DAY);
} | [
"public",
"static",
"int",
"getHour",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"c",
".",
"get",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
")",... | Get the hour of the date
@param date date
@return hour of the date | [
"Get",
"the",
"hour",
"of",
"the",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L168-L172 |
39,602 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getMinute | public static int getMinute(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.MINUTE);
} | java | public static int getMinute(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.MINUTE);
} | [
"public",
"static",
"int",
"getMinute",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"c",
".",
"get",
"(",
"Calendar",
".",
"MINUTE",
")",
... | Get the minute of the date
@param date date
@return minute of the date | [
"Get",
"the",
"minute",
"of",
"the",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L179-L183 |
39,603 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getSecond | public static int getSecond(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.SECOND);
} | java | public static int getSecond(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.SECOND);
} | [
"public",
"static",
"int",
"getSecond",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"c",
".",
"get",
"(",
"Calendar",
".",
"SECOND",
")",
... | Get the second of the date
@param date date
@return second of the date | [
"Get",
"the",
"second",
"of",
"the",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L190-L194 |
39,604 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.floor | public static Date floor(Date d) {
Calendar c = Calendar.getInstance();
c.setTime(d);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
} | java | public static Date floor(Date d) {
Calendar c = Calendar.getInstance();
c.setTime(d);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
} | [
"public",
"static",
"Date",
"floor",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"d",
")",
";",
"c",
".",
"set",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"0",
")",
";... | Rounds a date to hour 0, minute 0, second 0 and millisecond 0
@param d the date
@return the rounded date | [
"Rounds",
"a",
"date",
"to",
"hour",
"0",
"minute",
"0",
"second",
"0",
"and",
"millisecond",
"0"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L201-L209 |
39,605 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameDay | public static boolean sameDay(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_YEAR);
... | java | public static boolean sameDay(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int day = cal.get(Calendar.DAY_OF_YEAR);
... | [
"public",
"static",
"boolean",
"sameDay",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"=",
... | Test to see if two dates are in the same day of year
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same day of year | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"day",
"of",
"year"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L232-L247 |
39,606 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameWeek | public static boolean sameWeek(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int week = cal.get(Calendar.WEEK_OF_YEAR... | java | public static boolean sameWeek(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int week = cal.get(Calendar.WEEK_OF_YEAR... | [
"public",
"static",
"boolean",
"sameWeek",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"=",... | Test to see if two dates are in the same week
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same week | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"week"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L255-L270 |
39,607 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameMonth | public static boolean sameMonth(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
... | java | public static boolean sameMonth(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
... | [
"public",
"static",
"boolean",
"sameMonth",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"="... | Test to see if two dates are in the same month
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same month | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L278-L293 |
39,608 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.sameHour | public static boolean sameHour(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
... | java | public static boolean sameHour(Date dateOne, Date dateTwo) {
if ((dateOne == null) || (dateTwo == null)) {
return false;
}
Calendar cal = Calendar.getInstance();
cal.setTime(dateOne);
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH);
... | [
"public",
"static",
"boolean",
"sameHour",
"(",
"Date",
"dateOne",
",",
"Date",
"dateTwo",
")",
"{",
"if",
"(",
"(",
"dateOne",
"==",
"null",
")",
"||",
"(",
"dateTwo",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"Calendar",
"cal",
"=",... | Test to see if two dates are in the same hour of day
@param dateOne first date
@param dateTwo second date
@return true if the two dates are in the same hour of day | [
"Test",
"to",
"see",
"if",
"two",
"dates",
"are",
"in",
"the",
"same",
"hour",
"of",
"day"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L301-L321 |
39,609 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getNumberOfDays | public static int getNumberOfDays(Date first, Date second)
{
Calendar c = Calendar.getInstance();
int result = 0;
int compare = first.compareTo(second);
if (compare > 0) return 0;
if (compare == 0) return 1;
c.setTime(first);
int firstDay = c.... | java | public static int getNumberOfDays(Date first, Date second)
{
Calendar c = Calendar.getInstance();
int result = 0;
int compare = first.compareTo(second);
if (compare > 0) return 0;
if (compare == 0) return 1;
c.setTime(first);
int firstDay = c.... | [
"public",
"static",
"int",
"getNumberOfDays",
"(",
"Date",
"first",
",",
"Date",
"second",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"int",
"result",
"=",
"0",
";",
"int",
"compare",
"=",
"first",
".",
"compareTo",
... | Get number of days between two dates
@param first first date
@param second second date
@return number of days if first date less than second date,
0 if first date is bigger than second date,
1 if dates are the same | [
"Get",
"number",
"of",
"days",
"between",
"two",
"dates"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L332-L373 |
39,610 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getElapsedTime | public static int[] getElapsedTime(Date first, Date second) {
if (first.compareTo(second) == 1 ) {
return null;
}
int difDays = 0;
int difHours = 0;
int difMinutes = 0;
Calendar c = Calendar.getInstance();
c.setTime(first);
int h1 = c.... | java | public static int[] getElapsedTime(Date first, Date second) {
if (first.compareTo(second) == 1 ) {
return null;
}
int difDays = 0;
int difHours = 0;
int difMinutes = 0;
Calendar c = Calendar.getInstance();
c.setTime(first);
int h1 = c.... | [
"public",
"static",
"int",
"[",
"]",
"getElapsedTime",
"(",
"Date",
"first",
",",
"Date",
"second",
")",
"{",
"if",
"(",
"first",
".",
"compareTo",
"(",
"second",
")",
"==",
"1",
")",
"{",
"return",
"null",
";",
"}",
"int",
"difDays",
"=",
"0",
";"... | Get elapsedtime between two dates
@param first first date
@param second second date
@return null if first date is after second date
an integer array of three elemets ( days, hours minutes ) | [
"Get",
"elapsedtime",
"between",
"two",
"dates"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L382-L423 |
39,611 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addMinutes | public static Date addMinutes(Date d, int minutes) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MINUTE, minutes);
return cal.getTime();
} | java | public static Date addMinutes(Date d, int minutes) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MINUTE, minutes);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addMinutes",
"(",
"Date",
"d",
",",
"int",
"minutes",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
... | Add minutes to a date
@param d date
@param minutes minutes
@return new date | [
"Add",
"minutes",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L431-L436 |
39,612 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.setMinutes | public static Date setMinutes(Date d, int minutes) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MINUTE, minutes);
return cal.getTime();
} | java | public static Date setMinutes(Date d, int minutes) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MINUTE, minutes);
return cal.getTime();
} | [
"public",
"static",
"Date",
"setMinutes",
"(",
"Date",
"d",
",",
"int",
"minutes",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
... | Set minutes to a date
@param d date
@param minutes minutes
@return new date | [
"Set",
"minutes",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L444-L449 |
39,613 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addHours | public static Date addHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | java | public static Date addHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addHours",
"(",
"Date",
"d",
",",
"int",
"hours",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"HOU... | Add hours to a date
@param d date
@param hours hours
@return new date | [
"Add",
"hours",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L457-L462 |
39,614 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.setHours | public static Date setHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | java | public static Date setHours(Date d, int hours) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.HOUR_OF_DAY, hours);
return cal.getTime();
} | [
"public",
"static",
"Date",
"setHours",
"(",
"Date",
"d",
",",
"int",
"hours",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOU... | Set hours to a date
@param d date
@param hours hours
@return new date | [
"Set",
"hours",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L470-L475 |
39,615 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addDays | public static Date addDays(Date d, int days) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.DAY_OF_YEAR, days);
return cal.getTime();
} | java | public static Date addDays(Date d, int days) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.DAY_OF_YEAR, days);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addDays",
"(",
"Date",
"d",
",",
"int",
"days",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"DAY_O... | Add days to a date
@param d date
@param days days
@return new date | [
"Add",
"days",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L483-L488 |
39,616 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addWeeks | public static Date addWeeks(Date d, int weeks) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.WEEK_OF_YEAR, weeks);
return cal.getTime();
} | java | public static Date addWeeks(Date d, int weeks) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.WEEK_OF_YEAR, weeks);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addWeeks",
"(",
"Date",
"d",
",",
"int",
"weeks",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"WEE... | Add weeks to a date
@param d date
@param weeks weeks
@return new date | [
"Add",
"weeks",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L496-L501 |
39,617 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.addMonths | public static Date addMonths(Date d, int months) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, months);
return cal.getTime();
} | java | public static Date addMonths(Date d, int months) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, months);
return cal.getTime();
} | [
"public",
"static",
"Date",
"addMonths",
"(",
"Date",
"d",
",",
"int",
"months",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"M... | Add months to a date
@param d date
@param months months
@return new date | [
"Add",
"months",
"to",
"a",
"date"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L509-L514 |
39,618 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastDayOfMonth | public static int getLastDayOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.getActualMaximum(Calendar.DATE);
} | java | public static int getLastDayOfMonth(Date date) {
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.getActualMaximum(Calendar.DATE);
} | [
"public",
"static",
"int",
"getLastDayOfMonth",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"c",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"c",
".",
"setTime",
"(",
"date",
")",
";",
"return",
"c",
".",
"getActualMaximum",
"(",
"Calendar",
".",
... | Get last day from a month
@param date date
@return last day from a month | [
"Get",
"last",
"day",
"from",
"a",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L521-L525 |
39,619 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFromTimestamp | public static Date getFromTimestamp(Timestamp timestamp) {
if (timestamp == null) {
return null;
}
return new Date(timestamp.getTime());
} | java | public static Date getFromTimestamp(Timestamp timestamp) {
if (timestamp == null) {
return null;
}
return new Date(timestamp.getTime());
} | [
"public",
"static",
"Date",
"getFromTimestamp",
"(",
"Timestamp",
"timestamp",
")",
"{",
"if",
"(",
"timestamp",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"Date",
"(",
"timestamp",
".",
"getTime",
"(",
")",
")",
";",
"}"
] | Get a date from a timestamp
@param timestamp time stamp
@return date from a timestamp | [
"Get",
"a",
"date",
"from",
"a",
"timestamp"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L532-L537 |
39,620 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFirstDayFromCurrentWeek | public static Date getFirstDayFromCurrentWeek(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.s... | java | public static Date getFirstDayFromCurrentWeek(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.s... | [
"public",
"static",
"Date",
"getFirstDayFromCurrentWeek",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_WEEK"... | Get first date from current week
@param d date
@return first date from current week | [
"Get",
"first",
"date",
"from",
"current",
"week"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L581-L590 |
39,621 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastDayFromCurrentWeek | public static Date getLastDayFromCurrentWeek(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
// depends on Locale (if a week starts on Monday or on Sunday)
if (cal.getFirstDayOfWeek() == Calendar.SUNDAY) {
cal.add(Calendar.WEEK_OF_YEAR, 1);
}
... | java | public static Date getLastDayFromCurrentWeek(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
// depends on Locale (if a week starts on Monday or on Sunday)
if (cal.getFirstDayOfWeek() == Calendar.SUNDAY) {
cal.add(Calendar.WEEK_OF_YEAR, 1);
}
... | [
"public",
"static",
"Date",
"getLastDayFromCurrentWeek",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"// depends on Locale (if a week starts on Monday or on Sunday)",
... | Get last date from current week
@param d date
@return last date from current week | [
"Get",
"last",
"date",
"from",
"current",
"week"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L597-L610 |
39,622 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFirstDayFromLastMonth | public static Date getFirstDayFromLastMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Cale... | java | public static Date getFirstDayFromLastMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Cale... | [
"public",
"static",
"Date",
"getFirstDayFromLastMonth",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"MONTH",
",",... | Get first date from last month
@param d date
@return first date from last month | [
"Get",
"first",
"date",
"from",
"last",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L617-L627 |
39,623 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastDayFromLastMonth | public static Date getLastDayFromLastMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE... | java | public static Date getLastDayFromLastMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.MONTH, -1);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE... | [
"public",
"static",
"Date",
"getLastDayFromLastMonth",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"MONTH",
",",
... | Get last date from last month
@param d date
@return last date from last month | [
"Get",
"last",
"date",
"from",
"last",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L634-L644 |
39,624 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFirstDayFromCurrentMonth | public static Date getFirstDayFromCurrentMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
c... | java | public static Date getFirstDayFromCurrentMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
c... | [
"public",
"static",
"Date",
"getFirstDayFromCurrentMonth",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONT... | Get first date from current month
@param d date
@return first date from current month | [
"Get",
"first",
"date",
"from",
"current",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L651-L660 |
39,625 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastDayFromCurrentMonth | public static Date getLastDayFromCurrentMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Cal... | java | public static Date getLastDayFromCurrentMonth(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DATE));
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
cal.set(Cal... | [
"public",
"static",
"Date",
"getLastDayFromCurrentMonth",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"DAY_OF_MONTH... | Get last date from current month
@param d date
@return last date from current month | [
"Get",
"last",
"date",
"from",
"current",
"month"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L667-L676 |
39,626 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFirstDayFromLastYear | public static Date getFirstDayFromLastYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.YEAR, -1);
cal.set(Calendar.MONTH, Calendar.JANUARY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
... | java | public static Date getFirstDayFromLastYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(Calendar.YEAR, -1);
cal.set(Calendar.MONTH, Calendar.JANUARY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
... | [
"public",
"static",
"Date",
"getFirstDayFromLastYear",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"(",
"Calendar",
".",
"YEAR",
",",
... | Get first date from last year
@param d date
@return first date from last year | [
"Get",
"first",
"date",
"from",
"last",
"year"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L683-L694 |
39,627 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getFirstDayFromCurrentYear | public static Date getFirstDayFromCurrentYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MONTH, Calendar.JANUARY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, ... | java | public static Date getFirstDayFromCurrentYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MONTH, Calendar.JANUARY);
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, ... | [
"public",
"static",
"Date",
"getFirstDayFromCurrentYear",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"MONTH",
",... | Get first date from current year
@param d date
@return first date from current year | [
"Get",
"first",
"date",
"from",
"current",
"year"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L719-L729 |
39,628 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastDayFromCurrentYear | public static Date getLastDayFromCurrentYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MONTH, Calendar.DECEMBER);
cal.set(Calendar.DAY_OF_MONTH, 31);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
... | java | public static Date getLastDayFromCurrentYear(Date d) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.set(Calendar.MONTH, Calendar.DECEMBER);
cal.set(Calendar.DAY_OF_MONTH, 31);
cal.set(Calendar.HOUR_OF_DAY, 23);
cal.set(Calendar.MINUTE, 59);
... | [
"public",
"static",
"Date",
"getLastDayFromCurrentYear",
"(",
"Date",
"d",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"MONTH",
","... | Get last date from current year
@param d date
@return last date from current year | [
"Get",
"last",
"date",
"from",
"current",
"year"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L736-L746 |
39,629 | nextreports/nextreports-engine | src/ro/nextreports/engine/util/DateUtil.java | DateUtil.getLastNDay | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | java | public static Date getLastNDay(Date d, int n, int unitType) {
Calendar cal = Calendar.getInstance();
cal.setTime(d);
cal.add(unitType, -n);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
... | [
"public",
"static",
"Date",
"getLastNDay",
"(",
"Date",
"d",
",",
"int",
"n",
",",
"int",
"unitType",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"d",
")",
";",
"cal",
".",
"add",
"("... | Get date with n unitType before
@param d date
@param n number of units
@param unitType unit type : one of Calendar.DAY_OF_YEAR, Calendar.WEEK_OF_YEAR, Calendar.MONTH, Calendar.YEAR;
@return | [
"Get",
"date",
"with",
"n",
"unitType",
"before"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/DateUtil.java#L755-L764 |
39,630 | samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsiblePanel.java | CollapsiblePanel.setTriggerContainer | public void setTriggerContainer (JComponent comp, JPanel content, boolean collapsed)
{
// these are our only two components.
add(comp);
add(_content = content);
// When the content is shown, make sure it's scrolled visible
_content.addComponentListener(new ComponentAdapter()... | java | public void setTriggerContainer (JComponent comp, JPanel content, boolean collapsed)
{
// these are our only two components.
add(comp);
add(_content = content);
// When the content is shown, make sure it's scrolled visible
_content.addComponentListener(new ComponentAdapter()... | [
"public",
"void",
"setTriggerContainer",
"(",
"JComponent",
"comp",
",",
"JPanel",
"content",
",",
"boolean",
"collapsed",
")",
"{",
"// these are our only two components.",
"add",
"(",
"comp",
")",
";",
"add",
"(",
"_content",
"=",
"content",
")",
";",
"// When... | Set a component which contains the trigger button. | [
"Set",
"a",
"component",
"which",
"contains",
"the",
"trigger",
"button",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsiblePanel.java#L93-L119 |
39,631 | samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsiblePanel.java | CollapsiblePanel.setTrigger | public void setTrigger (AbstractButton trigger,
Icon collapsed, Icon uncollapsed)
{
_trigger = trigger;
_trigger.setHorizontalAlignment(SwingConstants.LEFT);
_trigger.setHorizontalTextPosition(SwingConstants.RIGHT);
_downIcon = collapsed;
_upIcon =... | java | public void setTrigger (AbstractButton trigger,
Icon collapsed, Icon uncollapsed)
{
_trigger = trigger;
_trigger.setHorizontalAlignment(SwingConstants.LEFT);
_trigger.setHorizontalTextPosition(SwingConstants.RIGHT);
_downIcon = collapsed;
_upIcon =... | [
"public",
"void",
"setTrigger",
"(",
"AbstractButton",
"trigger",
",",
"Icon",
"collapsed",
",",
"Icon",
"uncollapsed",
")",
"{",
"_trigger",
"=",
"trigger",
";",
"_trigger",
".",
"setHorizontalAlignment",
"(",
"SwingConstants",
".",
"LEFT",
")",
";",
"_trigger"... | Set the trigger button. | [
"Set",
"the",
"trigger",
"button",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsiblePanel.java#L124-L133 |
39,632 | samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsiblePanel.java | CollapsiblePanel.setCollapsed | public void setCollapsed (boolean collapse)
{
if (collapse) {
_content.setVisible(false);
_trigger.setIcon(_downIcon);
} else {
_content.setVisible(true);
_trigger.setIcon(_upIcon);
}
SwingUtil.refresh(this);
} | java | public void setCollapsed (boolean collapse)
{
if (collapse) {
_content.setVisible(false);
_trigger.setIcon(_downIcon);
} else {
_content.setVisible(true);
_trigger.setIcon(_upIcon);
}
SwingUtil.refresh(this);
} | [
"public",
"void",
"setCollapsed",
"(",
"boolean",
"collapse",
")",
"{",
"if",
"(",
"collapse",
")",
"{",
"_content",
".",
"setVisible",
"(",
"false",
")",
";",
"_trigger",
".",
"setIcon",
"(",
"_downIcon",
")",
";",
"}",
"else",
"{",
"_content",
".",
"... | Set the collapsion state. | [
"Set",
"the",
"collapsion",
"state",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsiblePanel.java#L172-L183 |
39,633 | samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.add | public static int[] add (int[] list, int value)
{
// make sure we've got a list to work with
if (list == null) {
return new int[] { value };
}
// check to see if the element is in the list
int llength = list.length;
for (int i = 0; i < llength; i++) {
... | java | public static int[] add (int[] list, int value)
{
// make sure we've got a list to work with
if (list == null) {
return new int[] { value };
}
// check to see if the element is in the list
int llength = list.length;
for (int i = 0; i < llength; i++) {
... | [
"public",
"static",
"int",
"[",
"]",
"add",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"value",
")",
"{",
"// make sure we've got a list to work with",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"new",
"int",
"[",
"]",
"{",
"value",
"}",
";",
... | Adds the specified value to the list iff it is not already in the
list.
@param list the list to which to add the value. Can be null.
@param value the value to add.
@return a reference to the list with value added (might not be the
list you passed in due to expansion, or allocation). | [
"Adds",
"the",
"specified",
"value",
"to",
"the",
"list",
"iff",
"it",
"is",
"not",
"already",
"in",
"the",
"list",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L26-L47 |
39,634 | samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.contains | public static boolean contains (int[] list, int value)
{
int llength = list.length; // no optimizing bastards
for (int i = 0; i < llength; i++) {
if (list[i] == value) {
return true;
}
}
return false;
} | java | public static boolean contains (int[] list, int value)
{
int llength = list.length; // no optimizing bastards
for (int i = 0; i < llength; i++) {
if (list[i] == value) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"value",
")",
"{",
"int",
"llength",
"=",
"list",
".",
"length",
";",
"// no optimizing bastards",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"llength",
";",
"... | Looks for an element that is equal to the supplied value.
@return true if a matching value was found, false otherwise. | [
"Looks",
"for",
"an",
"element",
"that",
"is",
"equal",
"to",
"the",
"supplied",
"value",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L54-L63 |
39,635 | samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.remove | public static int[] remove (int[] list, int value)
{
// nothing to remove from an empty list
if (list == null) {
return null;
}
// search for the index of the element to be removed
int llength = list.length; // no optimizing bastards
for (int i = 0; i < l... | java | public static int[] remove (int[] list, int value)
{
// nothing to remove from an empty list
if (list == null) {
return null;
}
// search for the index of the element to be removed
int llength = list.length; // no optimizing bastards
for (int i = 0; i < l... | [
"public",
"static",
"int",
"[",
"]",
"remove",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"value",
")",
"{",
"// nothing to remove from an empty list",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// search for the index of the elemen... | Removes the first value that is equal to the supplied value. A new
array will be created containing all other elements, except the
located element, in the order they existed in the original list.
@return the new array minus the found value, or the original array. | [
"Removes",
"the",
"first",
"value",
"that",
"is",
"equal",
"to",
"the",
"supplied",
"value",
".",
"A",
"new",
"array",
"will",
"be",
"created",
"containing",
"all",
"other",
"elements",
"except",
"the",
"located",
"element",
"in",
"the",
"order",
"they",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L90-L107 |
39,636 | samskivert/samskivert | src/main/java/com/samskivert/util/CompactIntListUtil.java | CompactIntListUtil.removeAt | public static int[] removeAt (int[] list, int index)
{
// this will NPE if the bastards passed a null list, which is how
// we'll let them know not to do that
int nlength = list.length-1;
// create a new array minus the removed element
int[] nlist = new int[nlength];
... | java | public static int[] removeAt (int[] list, int index)
{
// this will NPE if the bastards passed a null list, which is how
// we'll let them know not to do that
int nlength = list.length-1;
// create a new array minus the removed element
int[] nlist = new int[nlength];
... | [
"public",
"static",
"int",
"[",
"]",
"removeAt",
"(",
"int",
"[",
"]",
"list",
",",
"int",
"index",
")",
"{",
"// this will NPE if the bastards passed a null list, which is how",
"// we'll let them know not to do that",
"int",
"nlength",
"=",
"list",
".",
"length",
"-... | Removes the value at the specified index. A new array will be
created containing all other elements, except the specified
element, in the order they existed in the original list.
@return the new array minus the specified element. | [
"Removes",
"the",
"value",
"at",
"the",
"specified",
"index",
".",
"A",
"new",
"array",
"will",
"be",
"created",
"containing",
"all",
"other",
"elements",
"except",
"the",
"specified",
"element",
"in",
"the",
"order",
"they",
"existed",
"in",
"the",
"origina... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CompactIntListUtil.java#L116-L128 |
39,637 | samskivert/samskivert | src/main/java/com/samskivert/util/CountHashMap.java | CountHashMap.incrementCount | public int incrementCount (K key, int amount)
{
int[] val = get(key);
if (val == null) {
put(key, val = new int[1]);
}
val[0] += amount;
return val[0];
/* Alternate implementation, less hashing on the first increment but more garbage created
* ev... | java | public int incrementCount (K key, int amount)
{
int[] val = get(key);
if (val == null) {
put(key, val = new int[1]);
}
val[0] += amount;
return val[0];
/* Alternate implementation, less hashing on the first increment but more garbage created
* ev... | [
"public",
"int",
"incrementCount",
"(",
"K",
"key",
",",
"int",
"amount",
")",
"{",
"int",
"[",
"]",
"val",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"put",
"(",
"key",
",",
"val",
"=",
"new",
"int",
"[",
"1"... | Increment the value associated with the specified key, return the new value. | [
"Increment",
"the",
"value",
"associated",
"with",
"the",
"specified",
"key",
"return",
"the",
"new",
"value",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountHashMap.java#L42-L63 |
39,638 | samskivert/samskivert | src/main/java/com/samskivert/util/CountHashMap.java | CountHashMap.setCount | public int setCount (K key, int count)
{
int[] val = get(key);
if (val == null) {
put(key, new int[] { count });
return 0; // old value
}
int oldVal = val[0];
val[0] = count;
return oldVal;
} | java | public int setCount (K key, int count)
{
int[] val = get(key);
if (val == null) {
put(key, new int[] { count });
return 0; // old value
}
int oldVal = val[0];
val[0] = count;
return oldVal;
} | [
"public",
"int",
"setCount",
"(",
"K",
"key",
",",
"int",
"count",
")",
"{",
"int",
"[",
"]",
"val",
"=",
"get",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"{",
"put",
"(",
"key",
",",
"new",
"int",
"[",
"]",
"{",
"count",
"... | Set the count for the specified key.
@return the old count. | [
"Set",
"the",
"count",
"for",
"the",
"specified",
"key",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountHashMap.java#L79-L89 |
39,639 | samskivert/samskivert | src/main/java/com/samskivert/util/CountHashMap.java | CountHashMap.compress | public void compress ()
{
for (Iterator<int[]> itr = values().iterator(); itr.hasNext(); ) {
if (itr.next()[0] == 0) {
itr.remove();
}
}
} | java | public void compress ()
{
for (Iterator<int[]> itr = values().iterator(); itr.hasNext(); ) {
if (itr.next()[0] == 0) {
itr.remove();
}
}
} | [
"public",
"void",
"compress",
"(",
")",
"{",
"for",
"(",
"Iterator",
"<",
"int",
"[",
"]",
">",
"itr",
"=",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"itr",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"if",
"(",
"itr",
".",
"next",
"("... | Compress the count map- remove entries for which the value is 0. | [
"Compress",
"the",
"count",
"map",
"-",
"remove",
"entries",
"for",
"which",
"the",
"value",
"is",
"0",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountHashMap.java#L106-L113 |
39,640 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/DialogUtil.java | DialogUtil.createDialog | public static JInternalDialog createDialog (JFrame frame, JPanel content)
{
return createDialog(frame, null, content);
} | java | public static JInternalDialog createDialog (JFrame frame, JPanel content)
{
return createDialog(frame, null, content);
} | [
"public",
"static",
"JInternalDialog",
"createDialog",
"(",
"JFrame",
"frame",
",",
"JPanel",
"content",
")",
"{",
"return",
"createDialog",
"(",
"frame",
",",
"null",
",",
"content",
")",
";",
"}"
] | Creates and shows an internal dialog with the specified panel. | [
"Creates",
"and",
"shows",
"an",
"internal",
"dialog",
"with",
"the",
"specified",
"panel",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/DialogUtil.java#L25-L28 |
39,641 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/DialogUtil.java | DialogUtil.createDialog | public static JInternalDialog createDialog (
JFrame frame, String title, JPanel content)
{
JInternalDialog dialog = new JInternalDialog(frame);
dialog.setOpaque(false);
if (title != null) {
dialog.setTitle(title);
}
setContent(dialog, content);
Swi... | java | public static JInternalDialog createDialog (
JFrame frame, String title, JPanel content)
{
JInternalDialog dialog = new JInternalDialog(frame);
dialog.setOpaque(false);
if (title != null) {
dialog.setTitle(title);
}
setContent(dialog, content);
Swi... | [
"public",
"static",
"JInternalDialog",
"createDialog",
"(",
"JFrame",
"frame",
",",
"String",
"title",
",",
"JPanel",
"content",
")",
"{",
"JInternalDialog",
"dialog",
"=",
"new",
"JInternalDialog",
"(",
"frame",
")",
";",
"dialog",
".",
"setOpaque",
"(",
"fal... | Creates and shows an internal dialog with the specified title and
panel. | [
"Creates",
"and",
"shows",
"an",
"internal",
"dialog",
"with",
"the",
"specified",
"title",
"and",
"panel",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/DialogUtil.java#L34-L46 |
39,642 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/DialogUtil.java | DialogUtil.setContent | public static void setContent (JInternalDialog dialog, JPanel content)
{
Container holder = dialog.getContentPane();
holder.removeAll();
holder.add(content, BorderLayout.CENTER);
dialog.pack();
} | java | public static void setContent (JInternalDialog dialog, JPanel content)
{
Container holder = dialog.getContentPane();
holder.removeAll();
holder.add(content, BorderLayout.CENTER);
dialog.pack();
} | [
"public",
"static",
"void",
"setContent",
"(",
"JInternalDialog",
"dialog",
",",
"JPanel",
"content",
")",
"{",
"Container",
"holder",
"=",
"dialog",
".",
"getContentPane",
"(",
")",
";",
"holder",
".",
"removeAll",
"(",
")",
";",
"holder",
".",
"add",
"("... | Sets the content panel of the supplied internal dialog. | [
"Sets",
"the",
"content",
"panel",
"of",
"the",
"supplied",
"internal",
"dialog",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/DialogUtil.java#L51-L57 |
39,643 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/DialogUtil.java | DialogUtil.getInternalDialog | public static JInternalDialog getInternalDialog (Component any)
{
Component parent = any;
while (parent != null && !(parent instanceof JInternalDialog)) {
parent = parent.getParent();
}
return (JInternalDialog) parent;
} | java | public static JInternalDialog getInternalDialog (Component any)
{
Component parent = any;
while (parent != null && !(parent instanceof JInternalDialog)) {
parent = parent.getParent();
}
return (JInternalDialog) parent;
} | [
"public",
"static",
"JInternalDialog",
"getInternalDialog",
"(",
"Component",
"any",
")",
"{",
"Component",
"parent",
"=",
"any",
";",
"while",
"(",
"parent",
"!=",
"null",
"&&",
"!",
"(",
"parent",
"instanceof",
"JInternalDialog",
")",
")",
"{",
"parent",
"... | Returns the internal dialog that is a parent of the specified
component. | [
"Returns",
"the",
"internal",
"dialog",
"that",
"is",
"a",
"parent",
"of",
"the",
"specified",
"component",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/DialogUtil.java#L63-L71 |
39,644 | samskivert/samskivert | src/main/java/com/samskivert/swing/util/DialogUtil.java | DialogUtil.invalidateDialog | public static void invalidateDialog (Component any)
{
JInternalDialog dialog = getInternalDialog(any);
if (dialog == null) {
return;
}
SwingUtil.applyToHierarchy(dialog, new SwingUtil.ComponentOp() {
public void apply (Component comp) {
comp.i... | java | public static void invalidateDialog (Component any)
{
JInternalDialog dialog = getInternalDialog(any);
if (dialog == null) {
return;
}
SwingUtil.applyToHierarchy(dialog, new SwingUtil.ComponentOp() {
public void apply (Component comp) {
comp.i... | [
"public",
"static",
"void",
"invalidateDialog",
"(",
"Component",
"any",
")",
"{",
"JInternalDialog",
"dialog",
"=",
"getInternalDialog",
"(",
"any",
")",
";",
"if",
"(",
"dialog",
"==",
"null",
")",
"{",
"return",
";",
"}",
"SwingUtil",
".",
"applyToHierarc... | Invalidates and resizes the entire dialog given any component
within the dialog in question. | [
"Invalidates",
"and",
"resizes",
"the",
"entire",
"dialog",
"given",
"any",
"component",
"within",
"the",
"dialog",
"in",
"question",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/DialogUtil.java#L77-L91 |
39,645 | samskivert/samskivert | src/main/java/com/samskivert/util/CountMap.java | CountMap.add | public int add (K key, int amount)
{
CountEntry<K> entry = _backing.get(key);
if (entry == null) {
_backing.put(key, new CountEntry<K>(key, amount));
return amount;
}
return (entry.count += amount);
} | java | public int add (K key, int amount)
{
CountEntry<K> entry = _backing.get(key);
if (entry == null) {
_backing.put(key, new CountEntry<K>(key, amount));
return amount;
}
return (entry.count += amount);
} | [
"public",
"int",
"add",
"(",
"K",
"key",
",",
"int",
"amount",
")",
"{",
"CountEntry",
"<",
"K",
">",
"entry",
"=",
"_backing",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"entry",
"==",
"null",
")",
"{",
"_backing",
".",
"put",
"(",
"key",
",... | Add the specified amount to the count for the specified key, return the new count.
Adding 0 will ensure that a Map.Entry is created for the specified key. | [
"Add",
"the",
"specified",
"amount",
"to",
"the",
"count",
"for",
"the",
"specified",
"key",
"return",
"the",
"new",
"count",
".",
"Adding",
"0",
"will",
"ensure",
"that",
"a",
"Map",
".",
"Entry",
"is",
"created",
"for",
"the",
"specified",
"key",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountMap.java#L63-L71 |
39,646 | samskivert/samskivert | src/main/java/com/samskivert/util/CountMap.java | CountMap.getCount | public int getCount (K key)
{
CountEntry<K> entry = _backing.get(key);
return (entry == null) ? 0 : entry.count;
} | java | public int getCount (K key)
{
CountEntry<K> entry = _backing.get(key);
return (entry == null) ? 0 : entry.count;
} | [
"public",
"int",
"getCount",
"(",
"K",
"key",
")",
"{",
"CountEntry",
"<",
"K",
">",
"entry",
"=",
"_backing",
".",
"get",
"(",
"key",
")",
";",
"return",
"(",
"entry",
"==",
"null",
")",
"?",
"0",
":",
"entry",
".",
"count",
";",
"}"
] | Get the count for the specified key. If the key is not present, 0 is returned. | [
"Get",
"the",
"count",
"for",
"the",
"specified",
"key",
".",
"If",
"the",
"key",
"is",
"not",
"present",
"0",
"is",
"returned",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountMap.java#L76-L80 |
39,647 | samskivert/samskivert | src/main/java/com/samskivert/util/CountMap.java | CountMap.compress | public void compress ()
{
for (Iterator<CountEntry<K>> it = _backing.values().iterator(); it.hasNext(); ) {
if (it.next().count == 0) {
it.remove();
}
}
} | java | public void compress ()
{
for (Iterator<CountEntry<K>> it = _backing.values().iterator(); it.hasNext(); ) {
if (it.next().count == 0) {
it.remove();
}
}
} | [
"public",
"void",
"compress",
"(",
")",
"{",
"for",
"(",
"Iterator",
"<",
"CountEntry",
"<",
"K",
">",
">",
"it",
"=",
"_backing",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"if",
"("... | Remove any keys for which the count is currently 0. | [
"Remove",
"any",
"keys",
"for",
"which",
"the",
"count",
"is",
"currently",
"0",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CountMap.java#L85-L92 |
39,648 | samskivert/samskivert | src/main/java/com/samskivert/util/Randoms.java | Randoms.pickPluck | protected <T> T pickPluck (Iterable<? extends T> iterable, T ifEmpty, boolean remove)
{
if (iterable instanceof Collection) {
// optimized path for Collection
@SuppressWarnings("unchecked")
Collection<? extends T> coll = (Collection<? extends T>)iterable;
int ... | java | protected <T> T pickPluck (Iterable<? extends T> iterable, T ifEmpty, boolean remove)
{
if (iterable instanceof Collection) {
// optimized path for Collection
@SuppressWarnings("unchecked")
Collection<? extends T> coll = (Collection<? extends T>)iterable;
int ... | [
"protected",
"<",
"T",
">",
"T",
"pickPluck",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"iterable",
",",
"T",
"ifEmpty",
",",
"boolean",
"remove",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"Collection",
")",
"{",
"// optimized path for Collection"... | Shared code for pick and pluck. | [
"Shared",
"code",
"for",
"pick",
"and",
"pluck",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Randoms.java#L305-L363 |
39,649 | samskivert/samskivert | src/main/java/com/samskivert/util/Invoker.java | Invoker.postUnit | public void postUnit (Unit unit)
{
if (shutdownRequested()) {
throw new IllegalStateException("Cannot post units to shutdown invoker.");
}
// note the time
unit.queueStamp = System.currentTimeMillis();
// and append it to the queue
_queue.append(unit);
... | java | public void postUnit (Unit unit)
{
if (shutdownRequested()) {
throw new IllegalStateException("Cannot post units to shutdown invoker.");
}
// note the time
unit.queueStamp = System.currentTimeMillis();
// and append it to the queue
_queue.append(unit);
... | [
"public",
"void",
"postUnit",
"(",
"Unit",
"unit",
")",
"{",
"if",
"(",
"shutdownRequested",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot post units to shutdown invoker.\"",
")",
";",
"}",
"// note the time",
"unit",
".",
"queueStamp... | Posts a unit to this invoker for subsequent invocation on the invoker's thread. | [
"Posts",
"a",
"unit",
"to",
"this",
"invoker",
"for",
"subsequent",
"invocation",
"on",
"the",
"invoker",
"s",
"thread",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Invoker.java#L143-L152 |
39,650 | samskivert/samskivert | src/main/java/com/samskivert/util/Invoker.java | Invoker.shutdown | @Override
public void shutdown ()
{
_shutdownRequested = true;
_queue.append(new Unit() {
@Override public boolean invoke () {
_running = false;
return false;
}
});
} | java | @Override
public void shutdown ()
{
_shutdownRequested = true;
_queue.append(new Unit() {
@Override public boolean invoke () {
_running = false;
return false;
}
});
} | [
"@",
"Override",
"public",
"void",
"shutdown",
"(",
")",
"{",
"_shutdownRequested",
"=",
"true",
";",
"_queue",
".",
"append",
"(",
"new",
"Unit",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"invoke",
"(",
")",
"{",
"_running",
"=",
"false",
"... | Shuts down the invoker thread by queueing up a unit that will cause the thread to exit after
all currently queued units are processed. | [
"Shuts",
"down",
"the",
"invoker",
"thread",
"by",
"queueing",
"up",
"a",
"unit",
"that",
"will",
"cause",
"the",
"thread",
"to",
"exit",
"after",
"all",
"currently",
"queued",
"units",
"are",
"processed",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Invoker.java#L225-L235 |
39,651 | samskivert/samskivert | src/main/java/com/samskivert/util/Invoker.java | Invoker.didInvokeUnit | protected void didInvokeUnit (Unit unit, long start)
{
// track some performance metrics
if (PERF_TRACK) {
long duration = System.currentTimeMillis() - start;
Object key = unit.getClass();
recordMetrics(key, duration);
// report long runners
... | java | protected void didInvokeUnit (Unit unit, long start)
{
// track some performance metrics
if (PERF_TRACK) {
long duration = System.currentTimeMillis() - start;
Object key = unit.getClass();
recordMetrics(key, duration);
// report long runners
... | [
"protected",
"void",
"didInvokeUnit",
"(",
"Unit",
"unit",
",",
"long",
"start",
")",
"{",
"// track some performance metrics",
"if",
"(",
"PERF_TRACK",
")",
"{",
"long",
"duration",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"start",
";",
"Object... | Called before we process an invoker unit.
@param unit the unit about to be invoked.
@param start a timestamp recorded immediately before invocation if {@link #PERF_TRACK} is
enabled, 0L otherwise. | [
"Called",
"before",
"we",
"process",
"an",
"invoker",
"unit",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Invoker.java#L276-L300 |
39,652 | samskivert/samskivert | src/main/java/com/samskivert/util/ComparableTuple.java | ComparableTuple.compareTo | public int compareTo (ComparableTuple<L, R> other)
{
int rv = ObjectUtil.compareTo(left, other.left);
return (rv != 0) ? rv : ObjectUtil.compareTo(right, other.right);
} | java | public int compareTo (ComparableTuple<L, R> other)
{
int rv = ObjectUtil.compareTo(left, other.left);
return (rv != 0) ? rv : ObjectUtil.compareTo(right, other.right);
} | [
"public",
"int",
"compareTo",
"(",
"ComparableTuple",
"<",
"L",
",",
"R",
">",
"other",
")",
"{",
"int",
"rv",
"=",
"ObjectUtil",
".",
"compareTo",
"(",
"left",
",",
"other",
".",
"left",
")",
";",
"return",
"(",
"rv",
"!=",
"0",
")",
"?",
"rv",
... | from interface Comparable | [
"from",
"interface",
"Comparable"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ComparableTuple.java#L24-L28 |
39,653 | samskivert/samskivert | src/main/java/com/samskivert/xml/SimpleParser.java | SimpleParser.parseStream | public void parseStream (InputStream stream)
throws IOException
{
try {
// read the XML input stream and construct the scene object
_chars = new StringBuilder();
XMLUtil.parse(this, stream);
} catch (ParserConfigurationException pce) {
throw (... | java | public void parseStream (InputStream stream)
throws IOException
{
try {
// read the XML input stream and construct the scene object
_chars = new StringBuilder();
XMLUtil.parse(this, stream);
} catch (ParserConfigurationException pce) {
throw (... | [
"public",
"void",
"parseStream",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"try",
"{",
"// read the XML input stream and construct the scene object",
"_chars",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"XMLUtil",
".",
"parse",
"(",
"this",
"... | Parse the given input stream.
@param stream the input stream from which the XML source to be
parsed can be loaded.
@exception IOException thrown if an error occurs while parsing
the stream. | [
"Parse",
"the",
"given",
"input",
"stream",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/xml/SimpleParser.java#L59-L73 |
39,654 | samskivert/samskivert | src/main/java/com/samskivert/xml/SimpleParser.java | SimpleParser.getInputStream | protected InputStream getInputStream (String path)
throws IOException
{
FileInputStream fis = new FileInputStream(path);
return new BufferedInputStream(fis);
} | java | protected InputStream getInputStream (String path)
throws IOException
{
FileInputStream fis = new FileInputStream(path);
return new BufferedInputStream(fis);
} | [
"protected",
"InputStream",
"getInputStream",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"FileInputStream",
"fis",
"=",
"new",
"FileInputStream",
"(",
"path",
")",
";",
"return",
"new",
"BufferedInputStream",
"(",
"fis",
")",
";",
"}"
] | Returns an input stream to read data from the given file name. | [
"Returns",
"an",
"input",
"stream",
"to",
"read",
"data",
"from",
"the",
"given",
"file",
"name",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/xml/SimpleParser.java#L91-L96 |
39,655 | samskivert/samskivert | src/main/java/com/samskivert/xml/SimpleParser.java | SimpleParser.parseInt | protected int parseInt (String val)
{
try {
return (val == null) ? -1 : Integer.parseInt(val);
} catch (NumberFormatException nfe) {
log.warning("Malformed integer value", "val", val);
return -1;
}
} | java | protected int parseInt (String val)
{
try {
return (val == null) ? -1 : Integer.parseInt(val);
} catch (NumberFormatException nfe) {
log.warning("Malformed integer value", "val", val);
return -1;
}
} | [
"protected",
"int",
"parseInt",
"(",
"String",
"val",
")",
"{",
"try",
"{",
"return",
"(",
"val",
"==",
"null",
")",
"?",
"-",
"1",
":",
"Integer",
".",
"parseInt",
"(",
"val",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"nfe",
")",
"{",
... | Parse the given string as an integer and return the integer
value, or -1 if the string is malformed. | [
"Parse",
"the",
"given",
"string",
"as",
"an",
"integer",
"and",
"return",
"the",
"integer",
"value",
"or",
"-",
"1",
"if",
"the",
"string",
"is",
"malformed",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/xml/SimpleParser.java#L102-L110 |
39,656 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.truncate | public static String truncate (String s, int maxLength, String append)
{
if ((s == null) || (s.length() <= maxLength)) {
return s;
} else {
return s.substring(0, maxLength - append.length()) + append;
}
} | java | public static String truncate (String s, int maxLength, String append)
{
if ((s == null) || (s.length() <= maxLength)) {
return s;
} else {
return s.substring(0, maxLength - append.length()) + append;
}
} | [
"public",
"static",
"String",
"truncate",
"(",
"String",
"s",
",",
"int",
"maxLength",
",",
"String",
"append",
")",
"{",
"if",
"(",
"(",
"s",
"==",
"null",
")",
"||",
"(",
"s",
".",
"length",
"(",
")",
"<=",
"maxLength",
")",
")",
"{",
"return",
... | Truncate the specified String if it is longer than maxLength. The string will be truncated
at a position such that it is maxLength chars long after the addition of the 'append'
String.
@param append a String to add to the truncated String only after truncation. | [
"Truncate",
"the",
"specified",
"String",
"if",
"it",
"is",
"longer",
"than",
"maxLength",
".",
"The",
"string",
"will",
"be",
"truncated",
"at",
"a",
"position",
"such",
"that",
"it",
"is",
"maxLength",
"chars",
"long",
"after",
"the",
"addition",
"of",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L125-L132 |
39,657 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.capitalize | public static String capitalize (String s)
{
if (isBlank(s)) {
return s;
}
char c = s.charAt(0);
if (Character.isUpperCase(c)) {
return s;
} else {
return String.valueOf(Character.toUpperCase(c)) + s.substring(1);
}
} | java | public static String capitalize (String s)
{
if (isBlank(s)) {
return s;
}
char c = s.charAt(0);
if (Character.isUpperCase(c)) {
return s;
} else {
return String.valueOf(Character.toUpperCase(c)) + s.substring(1);
}
} | [
"public",
"static",
"String",
"capitalize",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"isBlank",
"(",
"s",
")",
")",
"{",
"return",
"s",
";",
"}",
"char",
"c",
"=",
"s",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"Character",
".",
"isUpperCase"... | Returns a version of the supplied string with the first letter capitalized. | [
"Returns",
"a",
"version",
"of",
"the",
"supplied",
"string",
"with",
"the",
"first",
"letter",
"capitalized",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L137-L148 |
39,658 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.toUSLowerCase | public static String toUSLowerCase (String s)
{
return isBlank(s) ? s : s.toLowerCase(Locale.US);
} | java | public static String toUSLowerCase (String s)
{
return isBlank(s) ? s : s.toLowerCase(Locale.US);
} | [
"public",
"static",
"String",
"toUSLowerCase",
"(",
"String",
"s",
")",
"{",
"return",
"isBlank",
"(",
"s",
")",
"?",
"s",
":",
"s",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"}"
] | Returns a US locale lower case string. Useful when manipulating filenames and resource
keys which would not have locale specific characters. | [
"Returns",
"a",
"US",
"locale",
"lower",
"case",
"string",
".",
"Useful",
"when",
"manipulating",
"filenames",
"and",
"resource",
"keys",
"which",
"would",
"not",
"have",
"locale",
"specific",
"characters",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L154-L157 |
39,659 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.toUSUpperCase | public static String toUSUpperCase (String s)
{
return isBlank(s) ? s : s.toUpperCase(Locale.US);
} | java | public static String toUSUpperCase (String s)
{
return isBlank(s) ? s : s.toUpperCase(Locale.US);
} | [
"public",
"static",
"String",
"toUSUpperCase",
"(",
"String",
"s",
")",
"{",
"return",
"isBlank",
"(",
"s",
")",
"?",
"s",
":",
"s",
".",
"toUpperCase",
"(",
"Locale",
".",
"US",
")",
";",
"}"
] | Returns a US locale upper case string. Useful when manipulating filenames and resource
keys which would not have locale specific characters. | [
"Returns",
"a",
"US",
"locale",
"upper",
"case",
"string",
".",
"Useful",
"when",
"manipulating",
"filenames",
"and",
"resource",
"keys",
"which",
"would",
"not",
"have",
"locale",
"specific",
"characters",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L163-L166 |
39,660 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.sanitize | public static String sanitize (String source, CharacterValidator validator)
{
if (source == null) {
return null;
}
int nn = source.length();
StringBuilder buf = new StringBuilder(nn);
for (int ii=0; ii < nn; ii++) {
char c = source.charAt(ii);
... | java | public static String sanitize (String source, CharacterValidator validator)
{
if (source == null) {
return null;
}
int nn = source.length();
StringBuilder buf = new StringBuilder(nn);
for (int ii=0; ii < nn; ii++) {
char c = source.charAt(ii);
... | [
"public",
"static",
"String",
"sanitize",
"(",
"String",
"source",
",",
"CharacterValidator",
"validator",
")",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"nn",
"=",
"source",
".",
"length",
"(",
")",
";",
"Str... | Sanitize the specified String so that only valid characters are in it. | [
"Sanitize",
"the",
"specified",
"String",
"so",
"that",
"only",
"valid",
"characters",
"are",
"in",
"it",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L179-L193 |
39,661 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.sanitize | public static String sanitize (String source, String charRegex)
{
final StringBuilder buf = new StringBuilder(" ");
final Matcher matcher = Pattern.compile(charRegex).matcher(buf);
return sanitize(source, new CharacterValidator() {
public boolean isValid (char c) {
... | java | public static String sanitize (String source, String charRegex)
{
final StringBuilder buf = new StringBuilder(" ");
final Matcher matcher = Pattern.compile(charRegex).matcher(buf);
return sanitize(source, new CharacterValidator() {
public boolean isValid (char c) {
... | [
"public",
"static",
"String",
"sanitize",
"(",
"String",
"source",
",",
"String",
"charRegex",
")",
"{",
"final",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"\" \"",
")",
";",
"final",
"Matcher",
"matcher",
"=",
"Pattern",
".",
"compile",
"(",... | Sanitize the specified String such that each character must match against the regex
specified. | [
"Sanitize",
"the",
"specified",
"String",
"such",
"that",
"each",
"character",
"must",
"match",
"against",
"the",
"regex",
"specified",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L199-L209 |
39,662 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.pad | public static String pad (String value, int width, char c)
{
// sanity check
if (width <= 0) {
throw new IllegalArgumentException("Pad width must be greater than zero.");
}
int l = value.length();
return (l >= width) ? value
: value + f... | java | public static String pad (String value, int width, char c)
{
// sanity check
if (width <= 0) {
throw new IllegalArgumentException("Pad width must be greater than zero.");
}
int l = value.length();
return (l >= width) ? value
: value + f... | [
"public",
"static",
"String",
"pad",
"(",
"String",
"value",
",",
"int",
"width",
",",
"char",
"c",
")",
"{",
"// sanity check",
"if",
"(",
"width",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Pad width must be greater than zero.\"",... | Pads the supplied string to the requested string width by appending the specified character
to the end of the returned string.
If the original string is wider than the requested width, it is returned unmodified. | [
"Pads",
"the",
"supplied",
"string",
"to",
"the",
"requested",
"string",
"width",
"by",
"appending",
"the",
"specified",
"character",
"to",
"the",
"end",
"of",
"the",
"returned",
"string",
".",
"If",
"the",
"original",
"string",
"is",
"wider",
"than",
"the",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L255-L264 |
39,663 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.fill | public static String fill (char c, int count)
{
char[] sameChars = new char[count];
Arrays.fill(sameChars, c);
return new String(sameChars);
} | java | public static String fill (char c, int count)
{
char[] sameChars = new char[count];
Arrays.fill(sameChars, c);
return new String(sameChars);
} | [
"public",
"static",
"String",
"fill",
"(",
"char",
"c",
",",
"int",
"count",
")",
"{",
"char",
"[",
"]",
"sameChars",
"=",
"new",
"char",
"[",
"count",
"]",
";",
"Arrays",
".",
"fill",
"(",
"sameChars",
",",
"c",
")",
";",
"return",
"new",
"String"... | Returns a string containing the specified character repeated the specified number of times. | [
"Returns",
"a",
"string",
"containing",
"the",
"specified",
"character",
"repeated",
"the",
"specified",
"number",
"of",
"times",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L303-L308 |
39,664 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.split | public static String[] split (String source, String sep)
{
// handle the special case of a zero-component source
if (isBlank(source)) {
return new String[0];
}
int tcount = 0, tpos = -1, tstart = 0;
// count up the number of tokens
while ((tpos = source.... | java | public static String[] split (String source, String sep)
{
// handle the special case of a zero-component source
if (isBlank(source)) {
return new String[0];
}
int tcount = 0, tpos = -1, tstart = 0;
// count up the number of tokens
while ((tpos = source.... | [
"public",
"static",
"String",
"[",
"]",
"split",
"(",
"String",
"source",
",",
"String",
"sep",
")",
"{",
"// handle the special case of a zero-component source",
"if",
"(",
"isBlank",
"(",
"source",
")",
")",
"{",
"return",
"new",
"String",
"[",
"0",
"]",
"... | Splits the supplied string into components based on the specified separator string. | [
"Splits",
"the",
"supplied",
"string",
"into",
"components",
"based",
"on",
"the",
"specified",
"separator",
"string",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L999-L1027 |
39,665 | samskivert/samskivert | src/main/java/com/samskivert/util/StringUtil.java | StringUtil.wordWrap | public static String wordWrap (String str, int width)
{
int size = str.length();
StringBuilder buf = new StringBuilder(size + size/width);
int lastidx = 0;
while (lastidx < size) {
if (lastidx + width >= size) {
buf.append(str.substring(lastidx));
... | java | public static String wordWrap (String str, int width)
{
int size = str.length();
StringBuilder buf = new StringBuilder(size + size/width);
int lastidx = 0;
while (lastidx < size) {
if (lastidx + width >= size) {
buf.append(str.substring(lastidx));
... | [
"public",
"static",
"String",
"wordWrap",
"(",
"String",
"str",
",",
"int",
"width",
")",
"{",
"int",
"size",
"=",
"str",
".",
"length",
"(",
")",
";",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"size",
"+",
"size",
"/",
"width",
")",
... | Wordwraps a string. Treats any whitespace character as a single character.
<p>If you want the text to wrap for a graphical display, use a wordwrapping component
such as {@link com.samskivert.swing.Label} instead.
@param str String to word-wrap.
@param width Maximum line length. | [
"Wordwraps",
"a",
"string",
".",
"Treats",
"any",
"whitespace",
"character",
"as",
"a",
"single",
"character",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/StringUtil.java#L1224-L1254 |
39,666 | nextreports/nextreports-engine | src/ro/nextreports/engine/chart/Chart.java | Chart.getI18nkeys | public List<String> getI18nkeys() {
if (i18nkeys == null) {
return new ArrayList<String>();
}
Collections.sort(i18nkeys, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return Collator.getInstance().compare(o1, o2);
}
});
return i18nkeys;
} | java | public List<String> getI18nkeys() {
if (i18nkeys == null) {
return new ArrayList<String>();
}
Collections.sort(i18nkeys, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return Collator.getInstance().compare(o1, o2);
}
});
return i18nkeys;
} | [
"public",
"List",
"<",
"String",
">",
"getI18nkeys",
"(",
")",
"{",
"if",
"(",
"i18nkeys",
"==",
"null",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"}",
"Collections",
".",
"sort",
"(",
"i18nkeys",
",",
"new",
"Compara... | Get keys for internationalized strings
@return list of keys for internationalized strings | [
"Get",
"keys",
"for",
"internationalized",
"strings"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/Chart.java#L666-L678 |
39,667 | samskivert/samskivert | src/main/java/com/samskivert/velocity/I18nTool.java | I18nTool.xlate | public String xlate (String key, Object arg)
{
return _msgmgr.getMessage(_req, key, new Object[] { arg });
} | java | public String xlate (String key, Object arg)
{
return _msgmgr.getMessage(_req, key, new Object[] { arg });
} | [
"public",
"String",
"xlate",
"(",
"String",
"key",
",",
"Object",
"arg",
")",
"{",
"return",
"_msgmgr",
".",
"getMessage",
"(",
"_req",
",",
"key",
",",
"new",
"Object",
"[",
"]",
"{",
"arg",
"}",
")",
";",
"}"
] | Looks up the specified message and creates the translation string
using the supplied argument. | [
"Looks",
"up",
"the",
"specified",
"message",
"and",
"creates",
"the",
"translation",
"string",
"using",
"the",
"supplied",
"argument",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/I18nTool.java#L71-L74 |
39,668 | samskivert/samskivert | src/main/java/com/samskivert/velocity/I18nTool.java | I18nTool.xlate | public String xlate (String key, Object arg1, Object arg2)
{
return _msgmgr.getMessage(_req, key, new Object[] { arg1, arg2 });
} | java | public String xlate (String key, Object arg1, Object arg2)
{
return _msgmgr.getMessage(_req, key, new Object[] { arg1, arg2 });
} | [
"public",
"String",
"xlate",
"(",
"String",
"key",
",",
"Object",
"arg1",
",",
"Object",
"arg2",
")",
"{",
"return",
"_msgmgr",
".",
"getMessage",
"(",
"_req",
",",
"key",
",",
"new",
"Object",
"[",
"]",
"{",
"arg1",
",",
"arg2",
"}",
")",
";",
"}"... | Looks up the specified message and creates the translation string
using the supplied arguments. | [
"Looks",
"up",
"the",
"specified",
"message",
"and",
"creates",
"the",
"translation",
"string",
"using",
"the",
"supplied",
"arguments",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/I18nTool.java#L80-L83 |
39,669 | samskivert/samskivert | src/main/java/com/samskivert/velocity/I18nTool.java | I18nTool.date | protected String date (int style, Object arg)
{
Date when = massageDate(arg);
if (when == null) {
return "<!" + arg + ">";
}
return DateFormat.getDateInstance(style, getLocale()).format(when);
} | java | protected String date (int style, Object arg)
{
Date when = massageDate(arg);
if (when == null) {
return "<!" + arg + ">";
}
return DateFormat.getDateInstance(style, getLocale()).format(when);
} | [
"protected",
"String",
"date",
"(",
"int",
"style",
",",
"Object",
"arg",
")",
"{",
"Date",
"when",
"=",
"massageDate",
"(",
"arg",
")",
";",
"if",
"(",
"when",
"==",
"null",
")",
"{",
"return",
"\"<!\"",
"+",
"arg",
"+",
"\">\"",
";",
"}",
"return... | Helper function for formatting dates. | [
"Helper",
"function",
"for",
"formatting",
"dates",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/I18nTool.java#L137-L144 |
39,670 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.export | public boolean export() throws QueryException, NoDataFoundException {
start = true;
testForData();
if (needsFirstCrossing() && !(this instanceof FirstCrossingExporter)) {
FirstCrossingExporter fe = new FirstCrossingExporter(bean);
fe.export();
// get template values from Fir... | java | public boolean export() throws QueryException, NoDataFoundException {
start = true;
testForData();
if (needsFirstCrossing() && !(this instanceof FirstCrossingExporter)) {
FirstCrossingExporter fe = new FirstCrossingExporter(bean);
fe.export();
// get template values from Fir... | [
"public",
"boolean",
"export",
"(",
")",
"throws",
"QueryException",
",",
"NoDataFoundException",
"{",
"start",
"=",
"true",
";",
"testForData",
"(",
")",
";",
"if",
"(",
"needsFirstCrossing",
"(",
")",
"&&",
"!",
"(",
"this",
"instanceof",
"FirstCrossingExpor... | header page band and footer page band are written in PDF and RTF exporters | [
"header",
"page",
"band",
"and",
"footer",
"page",
"band",
"are",
"written",
"in",
"PDF",
"and",
"RTF",
"exporters"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L268-L306 |
39,671 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.getIgnoredCellElements | protected Set<CellElement> getIgnoredCellElements(Band band) {
Set<CellElement> result = new HashSet<CellElement>();
int rows = band.getRowCount();
int cols = band.getColumnCount();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
BandElement ... | java | protected Set<CellElement> getIgnoredCellElements(Band band) {
Set<CellElement> result = new HashSet<CellElement>();
int rows = band.getRowCount();
int cols = band.getColumnCount();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
BandElement ... | [
"protected",
"Set",
"<",
"CellElement",
">",
"getIgnoredCellElements",
"(",
"Band",
"band",
")",
"{",
"Set",
"<",
"CellElement",
">",
"result",
"=",
"new",
"HashSet",
"<",
"CellElement",
">",
"(",
")",
";",
"int",
"rows",
"=",
"band",
".",
"getRowCount",
... | and the other merged cells are null band elements. | [
"and",
"the",
"other",
"merged",
"cells",
"are",
"null",
"band",
"elements",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L586-L619 |
39,672 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.getIgnoredCellElementsForColSpan | protected Set<CellElement> getIgnoredCellElementsForColSpan(Band band) {
Set<CellElement> result = new HashSet<CellElement>();
int rows = band.getRowCount();
int cols = band.getColumnCount();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
Ba... | java | protected Set<CellElement> getIgnoredCellElementsForColSpan(Band band) {
Set<CellElement> result = new HashSet<CellElement>();
int rows = band.getRowCount();
int cols = band.getColumnCount();
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
Ba... | [
"protected",
"Set",
"<",
"CellElement",
">",
"getIgnoredCellElementsForColSpan",
"(",
"Band",
"band",
")",
"{",
"Set",
"<",
"CellElement",
">",
"result",
"=",
"new",
"HashSet",
"<",
"CellElement",
">",
"(",
")",
";",
"int",
"rows",
"=",
"band",
".",
"getRo... | because there was no support for row span | [
"because",
"there",
"was",
"no",
"support",
"for",
"row",
"span"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L623-L643 |
39,673 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.fireExporterEvent | void fireExporterEvent(ExporterEvent evt) {
Object[] listeners = listenerList.getListenerList();
// Each listener occupies two elements - the first is the listener class
// and the second is the listener instance
for (int i = 0; i < listeners.length; i += 2) {
if (listeners[i... | java | void fireExporterEvent(ExporterEvent evt) {
Object[] listeners = listenerList.getListenerList();
// Each listener occupies two elements - the first is the listener class
// and the second is the listener instance
for (int i = 0; i < listeners.length; i += 2) {
if (listeners[i... | [
"void",
"fireExporterEvent",
"(",
"ExporterEvent",
"evt",
")",
"{",
"Object",
"[",
"]",
"listeners",
"=",
"listenerList",
".",
"getListenerList",
"(",
")",
";",
"// Each listener occupies two elements - the first is the listener class",
"// and the second is the listener instan... | This private class is used to fire ExporterEvents | [
"This",
"private",
"class",
"is",
"used",
"to",
"fire",
"ExporterEvents"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L1587-L1596 |
39,674 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.getFunctionTemplate | private String getFunctionTemplate(GroupCache gc, FunctionBandElement fbe, boolean previous) throws QueryException {
StringBuilder templateKey = new StringBuilder();
if (gc == null) {
// function in Header
templateKey.append("F_").
append(fbe.getFunction()).append("_").
append(fbe.getColumn());... | java | private String getFunctionTemplate(GroupCache gc, FunctionBandElement fbe, boolean previous) throws QueryException {
StringBuilder templateKey = new StringBuilder();
if (gc == null) {
// function in Header
templateKey.append("F_").
append(fbe.getFunction()).append("_").
append(fbe.getColumn());... | [
"private",
"String",
"getFunctionTemplate",
"(",
"GroupCache",
"gc",
",",
"FunctionBandElement",
"fbe",
",",
"boolean",
"previous",
")",
"throws",
"QueryException",
"{",
"StringBuilder",
"templateKey",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"gc",
... | string template used by functions in header and group header bands | [
"string",
"template",
"used",
"by",
"functions",
"in",
"header",
"and",
"group",
"header",
"bands"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L2105-L2144 |
39,675 | nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/ResultExporter.java | ResultExporter.getCurrentValueForGroup | protected String getCurrentValueForGroup(String group) {
Object obj = groupValues.get(group);
if (obj == null) {
return "";
}
return obj.toString();
} | java | protected String getCurrentValueForGroup(String group) {
Object obj = groupValues.get(group);
if (obj == null) {
return "";
}
return obj.toString();
} | [
"protected",
"String",
"getCurrentValueForGroup",
"(",
"String",
"group",
")",
"{",
"Object",
"obj",
"=",
"groupValues",
".",
"get",
"(",
"group",
")",
";",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"return",
"obj",
".",
"to... | group is G1, G2 ,... | [
"group",
"is",
"G1",
"G2",
"..."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/ResultExporter.java#L2188-L2194 |
39,676 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.getValueFromElement | public static String getValueFromElement(Element element, String tagName) {
NodeList elementNodeList = element.getElementsByTagName(tagName);
if (elementNodeList == null) {
return "";
} else {
Element tagElement = (Element) elementNodeList.item(0);
if (tagElem... | java | public static String getValueFromElement(Element element, String tagName) {
NodeList elementNodeList = element.getElementsByTagName(tagName);
if (elementNodeList == null) {
return "";
} else {
Element tagElement = (Element) elementNodeList.item(0);
if (tagElem... | [
"public",
"static",
"String",
"getValueFromElement",
"(",
"Element",
"element",
",",
"String",
"tagName",
")",
"{",
"NodeList",
"elementNodeList",
"=",
"element",
".",
"getElementsByTagName",
"(",
"tagName",
")",
";",
"if",
"(",
"elementNodeList",
"==",
"null",
... | Gets the string value of the tag element name passed
@param element
@param tagName
@return | [
"Gets",
"the",
"string",
"value",
"of",
"the",
"tag",
"element",
"name",
"passed"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L93-L109 |
39,677 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.convertDocToString | public static String convertDocToString(Document doc) throws TransformerException {
//set up a transformer
TransformerFactory transfac = TransformerFactory.newInstance();
Transformer trans = transfac.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
... | java | public static String convertDocToString(Document doc) throws TransformerException {
//set up a transformer
TransformerFactory transfac = TransformerFactory.newInstance();
Transformer trans = transfac.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
... | [
"public",
"static",
"String",
"convertDocToString",
"(",
"Document",
"doc",
")",
"throws",
"TransformerException",
"{",
"//set up a transformer",
"TransformerFactory",
"transfac",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"Transformer",
"trans",
"=",... | Convert a DOM document to a string
@param doc
@return
@throws TransformerException | [
"Convert",
"a",
"DOM",
"document",
"to",
"a",
"string"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L182-L195 |
39,678 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.writeDocumentToFile | public static boolean writeDocumentToFile(Document doc, String localFile) {
try {
TransformerFactory transfact = TransformerFactory.newInstance();
Transformer trans = transfact.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
trans.... | java | public static boolean writeDocumentToFile(Document doc, String localFile) {
try {
TransformerFactory transfact = TransformerFactory.newInstance();
Transformer trans = transfact.newTransformer();
trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, YES);
trans.... | [
"public",
"static",
"boolean",
"writeDocumentToFile",
"(",
"Document",
"doc",
",",
"String",
"localFile",
")",
"{",
"try",
"{",
"TransformerFactory",
"transfact",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"Transformer",
"trans",
"=",
"transfact... | Write the Document out to a file using nice formatting
@param doc The document to save
@param localFile The file to write to
@return | [
"Write",
"the",
"Document",
"out",
"to",
"a",
"file",
"using",
"nice",
"formatting"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L204-L219 |
39,679 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.appendChild | public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
Element child = doc.createElement(elementName);
Text text = doc.createTextNode(elementValue);
child.appendChild(text);
parentElement.appendChild(child);
} | java | public static void appendChild(Document doc, Element parentElement, String elementName, String elementValue) {
Element child = doc.createElement(elementName);
Text text = doc.createTextNode(elementValue);
child.appendChild(text);
parentElement.appendChild(child);
} | [
"public",
"static",
"void",
"appendChild",
"(",
"Document",
"doc",
",",
"Element",
"parentElement",
",",
"String",
"elementName",
",",
"String",
"elementValue",
")",
"{",
"Element",
"child",
"=",
"doc",
".",
"createElement",
"(",
"elementName",
")",
";",
"Text... | Add a child element to a parent element
@param doc
@param parentElement
@param elementName
@param elementValue | [
"Add",
"a",
"child",
"element",
"to",
"a",
"parent",
"element"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L229-L234 |
39,680 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java | DOMHelper.waiting | private static void waiting(int milliseconds) {
long t0, t1;
t0 = System.currentTimeMillis();
do {
t1 = System.currentTimeMillis();
} while ((t1 - t0) < milliseconds);
} | java | private static void waiting(int milliseconds) {
long t0, t1;
t0 = System.currentTimeMillis();
do {
t1 = System.currentTimeMillis();
} while ((t1 - t0) < milliseconds);
} | [
"private",
"static",
"void",
"waiting",
"(",
"int",
"milliseconds",
")",
"{",
"long",
"t0",
",",
"t1",
";",
"t0",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"do",
"{",
"t1",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"}",
"w... | Wait for a few milliseconds
@param milliseconds | [
"Wait",
"for",
"a",
"few",
"milliseconds"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/DOMHelper.java#L241-L247 |
39,681 | houbie/lesscss | src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java | CompilationTask.execute | public Collection<CompilationUnit> execute() throws IOException {
List<CompilationUnit> compiledUnits = new ArrayList<CompilationUnit>();
logger.debug("CompilationTask: execute");
long start = System.currentTimeMillis();
for (CompilationUnit unit : compilationUnits) {
if (com... | java | public Collection<CompilationUnit> execute() throws IOException {
List<CompilationUnit> compiledUnits = new ArrayList<CompilationUnit>();
logger.debug("CompilationTask: execute");
long start = System.currentTimeMillis();
for (CompilationUnit unit : compilationUnits) {
if (com... | [
"public",
"Collection",
"<",
"CompilationUnit",
">",
"execute",
"(",
")",
"throws",
"IOException",
"{",
"List",
"<",
"CompilationUnit",
">",
"compiledUnits",
"=",
"new",
"ArrayList",
"<",
"CompilationUnit",
">",
"(",
")",
";",
"logger",
".",
"debug",
"(",
"\... | Execute the lazy compilation.
@return the compilation units that were dirty and got compiled
@throws IOException When a resource cannot be read/written | [
"Execute",
"the",
"lazy",
"compilation",
"."
] | 65196738939263d767e7933f34322536a0c7090f | https://github.com/houbie/lesscss/blob/65196738939263d767e7933f34322536a0c7090f/src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java#L117-L128 |
39,682 | houbie/lesscss | src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java | CompilationTask.startDaemon | public void startDaemon(final long interval) {
if (daemon != null) {
throw new RuntimeException("Trying to start daemon while it is still running");
}
stopDaemon = false;
daemon = new Thread(new Runnable() {
@Override
public void run() {
... | java | public void startDaemon(final long interval) {
if (daemon != null) {
throw new RuntimeException("Trying to start daemon while it is still running");
}
stopDaemon = false;
daemon = new Thread(new Runnable() {
@Override
public void run() {
... | [
"public",
"void",
"startDaemon",
"(",
"final",
"long",
"interval",
")",
"{",
"if",
"(",
"daemon",
"!=",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Trying to start daemon while it is still running\"",
")",
";",
"}",
"stopDaemon",
"=",
"false",
... | Start a daemon thread that will execute this CompilationTask periodically.
@param interval execution interval in milliseconds | [
"Start",
"a",
"daemon",
"thread",
"that",
"will",
"execute",
"this",
"CompilationTask",
"periodically",
"."
] | 65196738939263d767e7933f34322536a0c7090f | https://github.com/houbie/lesscss/blob/65196738939263d767e7933f34322536a0c7090f/src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java#L135-L163 |
39,683 | houbie/lesscss | src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java | CompilationTask.compileIfDirty | private boolean compileIfDirty(CompilationUnit unit) throws IOException {
if (isDirty(unit)) {
logger.debug("compiling less: {}", unit);
long start = System.currentTimeMillis();
try {
String sourceMapFileName = unit.getSourceMapFile() != null ? unit.getSource... | java | private boolean compileIfDirty(CompilationUnit unit) throws IOException {
if (isDirty(unit)) {
logger.debug("compiling less: {}", unit);
long start = System.currentTimeMillis();
try {
String sourceMapFileName = unit.getSourceMapFile() != null ? unit.getSource... | [
"private",
"boolean",
"compileIfDirty",
"(",
"CompilationUnit",
"unit",
")",
"throws",
"IOException",
"{",
"if",
"(",
"isDirty",
"(",
"unit",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"compiling less: {}\"",
",",
"unit",
")",
";",
"long",
"start",
"=",
... | Compile a CompilationUnit if dirty.
@param unit CompilationUnit
@return true if the CompilationUnit was dirty
@throws IOException | [
"Compile",
"a",
"CompilationUnit",
"if",
"dirty",
"."
] | 65196738939263d767e7933f34322536a0c7090f | https://github.com/houbie/lesscss/blob/65196738939263d767e7933f34322536a0c7090f/src/main/java/com/github/houbie/lesscss/builder/CompilationTask.java#L179-L205 |
39,684 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getSeries | public Series getSeries(String id, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(SERIES_URL)
.append(id)
.append("/");
if (StringU... | java | public Series getSeries(String id, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(SERIES_URL)
.append(id)
.append("/");
if (StringU... | [
"public",
"Series",
"getSeries",
"(",
"String",
"id",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"urlBuilder",
".",
"append",
"(",
"BASE_URL",
")",
".",
"append",
... | Get the series information
@param id
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"the",
"series",
"information"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L96-L114 |
39,685 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getEpisode | public Episode getEpisode(String seriesId, int seasonNbr, int episodeNbr, String language) throws TvDbException {
return getTVEpisode(seriesId, seasonNbr, episodeNbr, language, "/default/");
} | java | public Episode getEpisode(String seriesId, int seasonNbr, int episodeNbr, String language) throws TvDbException {
return getTVEpisode(seriesId, seasonNbr, episodeNbr, language, "/default/");
} | [
"public",
"Episode",
"getEpisode",
"(",
"String",
"seriesId",
",",
"int",
"seasonNbr",
",",
"int",
"episodeNbr",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"return",
"getTVEpisode",
"(",
"seriesId",
",",
"seasonNbr",
",",
"episodeNbr",
",",
... | Get a specific episode's information
@param seriesId
@param seasonNbr
@param episodeNbr
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"specific",
"episode",
"s",
"information"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L179-L181 |
39,686 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getTVEpisode | private Episode getTVEpisode(String seriesId, int seasonNbr, int episodeNbr, String language, String episodeType) throws TvDbException {
if (!isValidNumber(seriesId) || !isValidNumber(seasonNbr) || !isValidNumber(episodeNbr)) {
// Invalid number passed
return new Episode();
}
... | java | private Episode getTVEpisode(String seriesId, int seasonNbr, int episodeNbr, String language, String episodeType) throws TvDbException {
if (!isValidNumber(seriesId) || !isValidNumber(seasonNbr) || !isValidNumber(episodeNbr)) {
// Invalid number passed
return new Episode();
}
... | [
"private",
"Episode",
"getTVEpisode",
"(",
"String",
"seriesId",
",",
"int",
"seasonNbr",
",",
"int",
"episodeNbr",
",",
"String",
"language",
",",
"String",
"episodeType",
")",
"throws",
"TvDbException",
"{",
"if",
"(",
"!",
"isValidNumber",
"(",
"seriesId",
... | Generic function to get either the standard TV episode list or the DVD
list
@param seriesId
@param seasonNbr
@param episodeNbr
@param language
@param episodeType
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Generic",
"function",
"to",
"get",
"either",
"the",
"standard",
"TV",
"episode",
"list",
"or",
"the",
"DVD",
"list"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L209-L231 |
39,687 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getActors | public List<Actor> getActors(String seriesId) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(SERIES_URL)
.append(seriesId)
.append("/actors.xml");
... | java | public List<Actor> getActors(String seriesId) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(SERIES_URL)
.append(seriesId)
.append("/actors.xml");
... | [
"public",
"List",
"<",
"Actor",
">",
"getActors",
"(",
"String",
"seriesId",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"urlBuilder",
".",
"append",
"(",
"BASE_URL",
")",
".",
"append",
"("... | Get a list of actors from the series id
@param seriesId
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"list",
"of",
"actors",
"from",
"the",
"series",
"id"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L325-L335 |
39,688 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.searchSeries | public List<Series> searchSeries(String title, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
try {
urlBuilder.append(BASE_URL)
.append("GetSeries.php?seriesname=")
.append(URLEncoder.encode(title, "UTF-8")... | java | public List<Series> searchSeries(String title, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
try {
urlBuilder.append(BASE_URL)
.append("GetSeries.php?seriesname=")
.append(URLEncoder.encode(title, "UTF-8")... | [
"public",
"List",
"<",
"Series",
">",
"searchSeries",
"(",
"String",
"title",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"urlBuilder",
".",
"append",
... | Get a list of series using a title and language
@param title
@param language
@return
@throws TvDbException | [
"Get",
"a",
"list",
"of",
"series",
"using",
"a",
"title",
"and",
"language"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L345-L363 |
39,689 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getEpisodeById | public Episode getEpisodeById(String episodeId, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append("/episodes/")
.append(episodeId)
.append("/... | java | public Episode getEpisodeById(String episodeId, String language) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append("/episodes/")
.append(episodeId)
.append("/... | [
"public",
"Episode",
"getEpisodeById",
"(",
"String",
"episodeId",
",",
"String",
"language",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"urlBuilder",
".",
"append",
"(",
"BASE_URL",
")",
".",
... | Get information for a specific episode
@param episodeId
@param language
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"information",
"for",
"a",
"specific",
"episode"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L373-L388 |
39,690 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java | TheTVDBApi.getWeeklyUpdates | public TVDBUpdates getWeeklyUpdates(int seriesId) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(WEEKLY_UPDATES_URL);
LOG.trace(URL, urlBuilder.toString());
return TvdbParser... | java | public TVDBUpdates getWeeklyUpdates(int seriesId) throws TvDbException {
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(BASE_URL)
.append(apiKey)
.append(WEEKLY_UPDATES_URL);
LOG.trace(URL, urlBuilder.toString());
return TvdbParser... | [
"public",
"TVDBUpdates",
"getWeeklyUpdates",
"(",
"int",
"seriesId",
")",
"throws",
"TvDbException",
"{",
"StringBuilder",
"urlBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"urlBuilder",
".",
"append",
"(",
"BASE_URL",
")",
".",
"append",
"(",
"apiKey",
... | Get the weekly updates limited by Series ID
@param seriesId 0 (zero) gets all series
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"the",
"weekly",
"updates",
"limited",
"by",
"Series",
"ID"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/TheTVDBApi.java#L407-L416 |
39,691 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getActors | public static List<Actor> getActors(String urlString) throws TvDbException {
List<Actor> results = new ArrayList<>();
Actor actor;
Document doc;
NodeList nlActor;
Node nActor;
Element eActor;
try {
doc = DOMHelper.getEventDocFromUrl(urlString);
... | java | public static List<Actor> getActors(String urlString) throws TvDbException {
List<Actor> results = new ArrayList<>();
Actor actor;
Document doc;
NodeList nlActor;
Node nActor;
Element eActor;
try {
doc = DOMHelper.getEventDocFromUrl(urlString);
... | [
"public",
"static",
"List",
"<",
"Actor",
">",
"getActors",
"(",
"String",
"urlString",
")",
"throws",
"TvDbException",
"{",
"List",
"<",
"Actor",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Actor",
"actor",
";",
"Document",
"doc",
";"... | Get a list of the actors from the URL
@param urlString
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"list",
"of",
"the",
"actors",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L99-L142 |
39,692 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getAllEpisodes | public static List<Episode> getAllEpisodes(String urlString, int season) throws TvDbException {
List<Episode> episodeList = new ArrayList<>();
Episode episode;
NodeList nlEpisode;
Node nEpisode;
Element eEpisode;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
... | java | public static List<Episode> getAllEpisodes(String urlString, int season) throws TvDbException {
List<Episode> episodeList = new ArrayList<>();
Episode episode;
NodeList nlEpisode;
Node nEpisode;
Element eEpisode;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
... | [
"public",
"static",
"List",
"<",
"Episode",
">",
"getAllEpisodes",
"(",
"String",
"urlString",
",",
"int",
"season",
")",
"throws",
"TvDbException",
"{",
"List",
"<",
"Episode",
">",
"episodeList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Episode",
"... | Get all the episodes from the URL
@param urlString
@param season
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"all",
"the",
"episodes",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L152-L174 |
39,693 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getBanners | public static Banners getBanners(String urlString) throws TvDbException {
Banners banners = new Banners();
Banner banner;
NodeList nlBanners;
Node nBanner;
Element eBanner;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc != null) {
n... | java | public static Banners getBanners(String urlString) throws TvDbException {
Banners banners = new Banners();
Banner banner;
NodeList nlBanners;
Node nBanner;
Element eBanner;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc != null) {
n... | [
"public",
"static",
"Banners",
"getBanners",
"(",
"String",
"urlString",
")",
"throws",
"TvDbException",
"{",
"Banners",
"banners",
"=",
"new",
"Banners",
"(",
")",
";",
"Banner",
"banner",
";",
"NodeList",
"nlBanners",
";",
"Node",
"nBanner",
";",
"Element",
... | Get a list of banners from the URL
@param urlString
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"list",
"of",
"banners",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L183-L206 |
39,694 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getEpisode | public static Episode getEpisode(String urlString) throws TvDbException {
Episode episode = new Episode();
NodeList nlEpisode;
Node nEpisode;
Element eEpisode;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc == null) {
return new Episode();
... | java | public static Episode getEpisode(String urlString) throws TvDbException {
Episode episode = new Episode();
NodeList nlEpisode;
Node nEpisode;
Element eEpisode;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc == null) {
return new Episode();
... | [
"public",
"static",
"Episode",
"getEpisode",
"(",
"String",
"urlString",
")",
"throws",
"TvDbException",
"{",
"Episode",
"episode",
"=",
"new",
"Episode",
"(",
")",
";",
"NodeList",
"nlEpisode",
";",
"Node",
"nEpisode",
";",
"Element",
"eEpisode",
";",
"Docume... | Get the episode information from the URL
@param urlString
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"the",
"episode",
"information",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L215-L240 |
39,695 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getSeriesList | public static List<Series> getSeriesList(String urlString) throws TvDbException {
List<Series> seriesList = new ArrayList<>();
Series series;
NodeList nlSeries;
Node nSeries;
Element eSeries;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc... | java | public static List<Series> getSeriesList(String urlString) throws TvDbException {
List<Series> seriesList = new ArrayList<>();
Series series;
NodeList nlSeries;
Node nSeries;
Element eSeries;
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc... | [
"public",
"static",
"List",
"<",
"Series",
">",
"getSeriesList",
"(",
"String",
"urlString",
")",
"throws",
"TvDbException",
"{",
"List",
"<",
"Series",
">",
"seriesList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Series",
"series",
";",
"NodeList",
"... | Get a list of series from the URL
@param urlString
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"list",
"of",
"series",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L249-L274 |
39,696 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.getUpdates | public static TVDBUpdates getUpdates(String urlString, int seriesId) throws TvDbException {
TVDBUpdates updates = new TVDBUpdates();
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc != null) {
Node root = doc.getChildNodes().item(0);
List<SeriesUpdate> se... | java | public static TVDBUpdates getUpdates(String urlString, int seriesId) throws TvDbException {
TVDBUpdates updates = new TVDBUpdates();
Document doc = DOMHelper.getEventDocFromUrl(urlString);
if (doc != null) {
Node root = doc.getChildNodes().item(0);
List<SeriesUpdate> se... | [
"public",
"static",
"TVDBUpdates",
"getUpdates",
"(",
"String",
"urlString",
",",
"int",
"seriesId",
")",
"throws",
"TvDbException",
"{",
"TVDBUpdates",
"updates",
"=",
"new",
"TVDBUpdates",
"(",
")",
";",
"Document",
"doc",
"=",
"DOMHelper",
".",
"getEventDocFr... | Get a list of updates from the URL
@param urlString
@param seriesId
@return
@throws com.omertron.thetvdbapi.TvDbException | [
"Get",
"a",
"list",
"of",
"updates",
"from",
"the",
"URL"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L284-L330 |
39,697 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.parseErrorMessage | public static String parseErrorMessage(String errorMessage) {
StringBuilder response = new StringBuilder();
Pattern pattern = Pattern.compile(".*?/series/(\\d*?)/default/(\\d*?)/(\\d*?)/.*?");
Matcher matcher = pattern.matcher(errorMessage);
// See if the error message matches the patt... | java | public static String parseErrorMessage(String errorMessage) {
StringBuilder response = new StringBuilder();
Pattern pattern = Pattern.compile(".*?/series/(\\d*?)/default/(\\d*?)/(\\d*?)/.*?");
Matcher matcher = pattern.matcher(errorMessage);
// See if the error message matches the patt... | [
"public",
"static",
"String",
"parseErrorMessage",
"(",
"String",
"errorMessage",
")",
"{",
"StringBuilder",
"response",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Pattern",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"\".*?/series/(\\\\d*?)/default/(\\\\d*?)/(\... | Parse the error message to return a more user friendly message
@param errorMessage
@return | [
"Parse",
"the",
"error",
"message",
"to",
"return",
"a",
"more",
"user",
"friendly",
"message"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L374-L413 |
39,698 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.parseList | private static List<String> parseList(String input, String delim) {
List<String> result = new ArrayList<>();
StringTokenizer st = new StringTokenizer(input, delim);
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
if (token.length() > 0) {
... | java | private static List<String> parseList(String input, String delim) {
List<String> result = new ArrayList<>();
StringTokenizer st = new StringTokenizer(input, delim);
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
if (token.length() > 0) {
... | [
"private",
"static",
"List",
"<",
"String",
">",
"parseList",
"(",
"String",
"input",
",",
"String",
"delim",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"StringTokenizer",
"st",
"=",
"new",
"StringTokeni... | Create a List from a delimited string
@param input
@param delim | [
"Create",
"a",
"List",
"from",
"a",
"delimited",
"string"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L421-L433 |
39,699 | Omertron/api-thetvdb | src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java | TvdbParser.parseNextBanner | private static Banner parseNextBanner(Element eBanner) {
Banner banner = new Banner();
String artwork;
artwork = DOMHelper.getValueFromElement(eBanner, BANNER_PATH);
if (!artwork.isEmpty()) {
banner.setUrl(URL_BANNER + artwork);
}
artwork = DOMHelper.getValu... | java | private static Banner parseNextBanner(Element eBanner) {
Banner banner = new Banner();
String artwork;
artwork = DOMHelper.getValueFromElement(eBanner, BANNER_PATH);
if (!artwork.isEmpty()) {
banner.setUrl(URL_BANNER + artwork);
}
artwork = DOMHelper.getValu... | [
"private",
"static",
"Banner",
"parseNextBanner",
"(",
"Element",
"eBanner",
")",
"{",
"Banner",
"banner",
"=",
"new",
"Banner",
"(",
")",
";",
"String",
"artwork",
";",
"artwork",
"=",
"DOMHelper",
".",
"getValueFromElement",
"(",
"eBanner",
",",
"BANNER_PATH... | Parse the banner record from the document
@param eBanner
@throws Throwable | [
"Parse",
"the",
"banner",
"record",
"from",
"the",
"document"
] | 2ff9f9580e76043f19d2fc3234d87e16a95fa485 | https://github.com/Omertron/api-thetvdb/blob/2ff9f9580e76043f19d2fc3234d87e16a95fa485/src/main/java/com/omertron/thetvdbapi/tools/TvdbParser.java#L441-L477 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.