repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
samskivert/samskivert | src/main/java/com/samskivert/util/IntSets.java | IntSets.difference | public static IntSet difference (IntSet set1, IntSet set2)
{
return and(set1, notView(set2));
} | java | public static IntSet difference (IntSet set1, IntSet set2)
{
return and(set1, notView(set2));
} | [
"public",
"static",
"IntSet",
"difference",
"(",
"IntSet",
"set1",
",",
"IntSet",
"set2",
")",
"{",
"return",
"and",
"(",
"set1",
",",
"notView",
"(",
"set2",
")",
")",
";",
"}"
] | Creates a new IntSet, initially populated with ints contained in set1 but not in set2.
Set2 may also contain elements not present in set1, these are ignored. | [
"Creates",
"a",
"new",
"IntSet",
"initially",
"populated",
"with",
"ints",
"contained",
"in",
"set1",
"but",
"not",
"in",
"set2",
".",
"Set2",
"may",
"also",
"contain",
"elements",
"not",
"present",
"in",
"set1",
"these",
"are",
"ignored",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntSets.java#L131-L134 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/IntSets.java | IntSets.checkNotNull | protected static void checkNotNull (Object[] array)
{
checkNotNull((Object)array);
for (Object o : array) {
checkNotNull(o);
}
} | java | protected static void checkNotNull (Object[] array)
{
checkNotNull((Object)array);
for (Object o : array) {
checkNotNull(o);
}
} | [
"protected",
"static",
"void",
"checkNotNull",
"(",
"Object",
"[",
"]",
"array",
")",
"{",
"checkNotNull",
"(",
"(",
"Object",
")",
"array",
")",
";",
"for",
"(",
"Object",
"o",
":",
"array",
")",
"{",
"checkNotNull",
"(",
"o",
")",
";",
"}",
"}"
] | Validate the specified arguments. | [
"Validate",
"the",
"specified",
"arguments",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/IntSets.java#L170-L176 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.setSentinel | public void setSentinel (int sentinel)
{
if (_sentinel == sentinel) {
return;
}
if (contains(sentinel)) {
throw new IllegalArgumentException("Set contains sentinel value " + sentinel);
}
// replace every instance of the old sentinel with the new
... | java | public void setSentinel (int sentinel)
{
if (_sentinel == sentinel) {
return;
}
if (contains(sentinel)) {
throw new IllegalArgumentException("Set contains sentinel value " + sentinel);
}
// replace every instance of the old sentinel with the new
... | [
"public",
"void",
"setSentinel",
"(",
"int",
"sentinel",
")",
"{",
"if",
"(",
"_sentinel",
"==",
"sentinel",
")",
"{",
"return",
";",
"}",
"if",
"(",
"contains",
"(",
"sentinel",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Set contai... | Sets the sentinel value, which cannot itself be stored in the set because it is used
internally to represent an unused location.
@exception IllegalArgumentException if the set currently contains the requested sentinel. | [
"Sets",
"the",
"sentinel",
"value",
"which",
"cannot",
"itself",
"be",
"stored",
"in",
"the",
"set",
"because",
"it",
"is",
"used",
"internally",
"to",
"represent",
"an",
"unused",
"location",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L80-L95 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.interator | public Interator interator ()
{
return new AbstractInterator() {
public boolean hasNext () {
checkConcurrentModification();
return _pos < _size;
}
public int nextInt () {
checkConcurrentModification();
if (_p... | java | public Interator interator ()
{
return new AbstractInterator() {
public boolean hasNext () {
checkConcurrentModification();
return _pos < _size;
}
public int nextInt () {
checkConcurrentModification();
if (_p... | [
"public",
"Interator",
"interator",
"(",
")",
"{",
"return",
"new",
"AbstractInterator",
"(",
")",
"{",
"public",
"boolean",
"hasNext",
"(",
")",
"{",
"checkConcurrentModification",
"(",
")",
";",
"return",
"_pos",
"<",
"_size",
";",
"}",
"public",
"int",
... | documentation inherited from interface IntSet | [
"documentation",
"inherited",
"from",
"interface",
"IntSet"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L106-L159 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.rehash | protected void rehash (int ncount)
{
int[] obuckets = _buckets;
createBuckets(ncount);
for (int idx = 0, pos = 0; pos < _size; idx++) {
int value = obuckets[idx];
if (value != _sentinel) {
readd(value);
pos++;
}
}
... | java | protected void rehash (int ncount)
{
int[] obuckets = _buckets;
createBuckets(ncount);
for (int idx = 0, pos = 0; pos < _size; idx++) {
int value = obuckets[idx];
if (value != _sentinel) {
readd(value);
pos++;
}
}
... | [
"protected",
"void",
"rehash",
"(",
"int",
"ncount",
")",
"{",
"int",
"[",
"]",
"obuckets",
"=",
"_buckets",
";",
"createBuckets",
"(",
"ncount",
")",
";",
"for",
"(",
"int",
"idx",
"=",
"0",
",",
"pos",
"=",
"0",
";",
"pos",
"<",
"_size",
";",
"... | Recreates the bucket array with the specified new count. | [
"Recreates",
"the",
"bucket",
"array",
"with",
"the",
"specified",
"new",
"count",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L285-L297 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.readd | protected void readd (int value)
{
int mask = _buckets.length - 1;
int start = hash(value) & mask, idx = start;
do {
if (_buckets[idx] == _sentinel) {
_buckets[idx] = value;
return;
}
} while ((idx = idx + 1 & mask) != start);
... | java | protected void readd (int value)
{
int mask = _buckets.length - 1;
int start = hash(value) & mask, idx = start;
do {
if (_buckets[idx] == _sentinel) {
_buckets[idx] = value;
return;
}
} while ((idx = idx + 1 & mask) != start);
... | [
"protected",
"void",
"readd",
"(",
"int",
"value",
")",
"{",
"int",
"mask",
"=",
"_buckets",
".",
"length",
"-",
"1",
";",
"int",
"start",
"=",
"hash",
"(",
"value",
")",
"&",
"mask",
",",
"idx",
"=",
"start",
";",
"do",
"{",
"if",
"(",
"_buckets... | Adds a value that we know is neither equal to the sentinel nor already in the set. | [
"Adds",
"a",
"value",
"that",
"we",
"know",
"is",
"neither",
"equal",
"to",
"the",
"sentinel",
"nor",
"already",
"in",
"the",
"set",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L310-L323 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.writeObject | private void writeObject (ObjectOutputStream out)
throws IOException
{
out.defaultWriteObject();
for (int idx = 0, pos = 0; pos < _size; idx++) {
int value = _buckets[idx];
if (value != _sentinel) {
out.writeInt(value);
pos++;
... | java | private void writeObject (ObjectOutputStream out)
throws IOException
{
out.defaultWriteObject();
for (int idx = 0, pos = 0; pos < _size; idx++) {
int value = _buckets[idx];
if (value != _sentinel) {
out.writeInt(value);
pos++;
... | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"defaultWriteObject",
"(",
")",
";",
"for",
"(",
"int",
"idx",
"=",
"0",
",",
"pos",
"=",
"0",
";",
"pos",
"<",
"_size",
";",
"idx",
"++"... | Custom serializer. | [
"Custom",
"serializer",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L364-L375 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.readObject | private void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
in.defaultReadObject();
createBuckets(getBucketCount(_size));
for (int ii = 0; ii < _size; ii++) {
readd(in.readInt());
}
} | java | private void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
in.defaultReadObject();
createBuckets(getBucketCount(_size));
for (int ii = 0; ii < _size; ii++) {
readd(in.readInt());
}
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"createBuckets",
"(",
"getBucketCount",
"(",
"_size",
")",
")",
";",
"for",
"(",
"... | Custom deserializer. | [
"Custom",
"deserializer",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L380-L388 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/HashIntSet.java | HashIntSet.getBucketCount | protected static int getBucketCount (int capacity, float loadFactor)
{
int size = (int)(capacity / loadFactor);
int highest = Integer.highestOneBit(size);
return Math.max((size == highest) ? highest : (highest << 1), MIN_BUCKET_COUNT);
} | java | protected static int getBucketCount (int capacity, float loadFactor)
{
int size = (int)(capacity / loadFactor);
int highest = Integer.highestOneBit(size);
return Math.max((size == highest) ? highest : (highest << 1), MIN_BUCKET_COUNT);
} | [
"protected",
"static",
"int",
"getBucketCount",
"(",
"int",
"capacity",
",",
"float",
"loadFactor",
")",
"{",
"int",
"size",
"=",
"(",
"int",
")",
"(",
"capacity",
"/",
"loadFactor",
")",
";",
"int",
"highest",
"=",
"Integer",
".",
"highestOneBit",
"(",
... | Computes the number of buckets needed to provide the given capacity with the specified load
factor. | [
"Computes",
"the",
"number",
"of",
"buckets",
"needed",
"to",
"provide",
"the",
"given",
"capacity",
"with",
"the",
"specified",
"load",
"factor",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/HashIntSet.java#L414-L419 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/JsonExporter.java | JsonExporter.setGridAxisColors | private void setGridAxisColors(ro.nextreports.jofc2.model.Chart flashChart, XAxis xAxis, YAxis yAxis) {
boolean isHorizontal = chart.getType().isHorizontal();
Color xGridColor = chart.getXGridColor();
Color yGridColor = chart.getYGridColor();
if (xGridColor != null) {
getXAxi... | java | private void setGridAxisColors(ro.nextreports.jofc2.model.Chart flashChart, XAxis xAxis, YAxis yAxis) {
boolean isHorizontal = chart.getType().isHorizontal();
Color xGridColor = chart.getXGridColor();
Color yGridColor = chart.getYGridColor();
if (xGridColor != null) {
getXAxi... | [
"private",
"void",
"setGridAxisColors",
"(",
"ro",
".",
"nextreports",
".",
"jofc2",
".",
"model",
".",
"Chart",
"flashChart",
",",
"XAxis",
"xAxis",
",",
"YAxis",
"yAxis",
")",
"{",
"boolean",
"isHorizontal",
"=",
"chart",
".",
"getType",
"(",
")",
".",
... | to hide a grid we set its color to chart background color | [
"to",
"hide",
"a",
"grid",
"we",
"set",
"its",
"color",
"to",
"chart",
"background",
"color"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/JsonExporter.java#L653-L677 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/JsonExporter.java | JsonExporter.setTicks | private void setTicks(XAxis xAxis, YAxis yAxis, boolean showXLabel, boolean showYLabel) {
boolean isHorizontal = chart.getType().isHorizontal();
if ((!showXLabel && !isHorizontal) || (!showYLabel && isHorizontal)) {
xAxis.setTickHeight(0);
}
if ((!showYLabel && !isHorizontal... | java | private void setTicks(XAxis xAxis, YAxis yAxis, boolean showXLabel, boolean showYLabel) {
boolean isHorizontal = chart.getType().isHorizontal();
if ((!showXLabel && !isHorizontal) || (!showYLabel && isHorizontal)) {
xAxis.setTickHeight(0);
}
if ((!showYLabel && !isHorizontal... | [
"private",
"void",
"setTicks",
"(",
"XAxis",
"xAxis",
",",
"YAxis",
"yAxis",
",",
"boolean",
"showXLabel",
",",
"boolean",
"showYLabel",
")",
"{",
"boolean",
"isHorizontal",
"=",
"chart",
".",
"getType",
"(",
")",
".",
"isHorizontal",
"(",
")",
";",
"if",
... | hide ticks if we do not show labels | [
"hide",
"ticks",
"if",
"we",
"do",
"not",
"show",
"labels"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/JsonExporter.java#L696-L705 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MouseHijacker.java | MouseHijacker.hijack | public void hijack ()
{
_mls = _comp.getMouseListeners();
for (int ii=0; ii < _mls.length; ii++) {
_comp.removeMouseListener(_mls[ii]);
}
_mmls = _comp.getMouseMotionListeners();
for (int ii=0; ii < _mmls.length; ii++) {
_comp.removeMouseMotionListene... | java | public void hijack ()
{
_mls = _comp.getMouseListeners();
for (int ii=0; ii < _mls.length; ii++) {
_comp.removeMouseListener(_mls[ii]);
}
_mmls = _comp.getMouseMotionListeners();
for (int ii=0; ii < _mmls.length; ii++) {
_comp.removeMouseMotionListene... | [
"public",
"void",
"hijack",
"(",
")",
"{",
"_mls",
"=",
"_comp",
".",
"getMouseListeners",
"(",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"_mls",
".",
"length",
";",
"ii",
"++",
")",
"{",
"_comp",
".",
"removeMouseListener",
"(",... | Hijack the component's mouse listeners. | [
"Hijack",
"the",
"component",
"s",
"mouse",
"listeners",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MouseHijacker.java#L60-L73 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/CookieUtil.java | CookieUtil.getCookie | public static Cookie getCookie (HttpServletRequest req, String name)
{
Cookie[] cookies = req.getCookies();
if (cookies != null) {
for (int ii=0, nn=cookies.length; ii < nn; ii++) {
if (cookies[ii].getName().equals(name)) {
return cookies[ii];
... | java | public static Cookie getCookie (HttpServletRequest req, String name)
{
Cookie[] cookies = req.getCookies();
if (cookies != null) {
for (int ii=0, nn=cookies.length; ii < nn; ii++) {
if (cookies[ii].getName().equals(name)) {
return cookies[ii];
... | [
"public",
"static",
"Cookie",
"getCookie",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"req",
".",
"getCookies",
"(",
")",
";",
"if",
"(",
"cookies",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
... | Get the cookie of the specified name, or null if not found. | [
"Get",
"the",
"cookie",
"of",
"the",
"specified",
"name",
"or",
"null",
"if",
"not",
"found",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/CookieUtil.java#L20-L32 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/CookieUtil.java | CookieUtil.getCookieValue | public static String getCookieValue (HttpServletRequest req, String name)
{
Cookie c = getCookie(req, name);
return (c == null) ? null : c.getValue();
} | java | public static String getCookieValue (HttpServletRequest req, String name)
{
Cookie c = getCookie(req, name);
return (c == null) ? null : c.getValue();
} | [
"public",
"static",
"String",
"getCookieValue",
"(",
"HttpServletRequest",
"req",
",",
"String",
"name",
")",
"{",
"Cookie",
"c",
"=",
"getCookie",
"(",
"req",
",",
"name",
")",
";",
"return",
"(",
"c",
"==",
"null",
")",
"?",
"null",
":",
"c",
".",
... | Get the value of the cookie for the cookie of the specified name, or null if not found. | [
"Get",
"the",
"value",
"of",
"the",
"cookie",
"for",
"the",
"cookie",
"of",
"the",
"specified",
"name",
"or",
"null",
"if",
"not",
"found",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/CookieUtil.java#L37-L41 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/util/CookieUtil.java | CookieUtil.clearCookie | public static void clearCookie (HttpServletResponse rsp, String name)
{
Cookie c = new Cookie(name, "x");
c.setPath("/");
c.setMaxAge(0);
rsp.addCookie(c);
} | java | public static void clearCookie (HttpServletResponse rsp, String name)
{
Cookie c = new Cookie(name, "x");
c.setPath("/");
c.setMaxAge(0);
rsp.addCookie(c);
} | [
"public",
"static",
"void",
"clearCookie",
"(",
"HttpServletResponse",
"rsp",
",",
"String",
"name",
")",
"{",
"Cookie",
"c",
"=",
"new",
"Cookie",
"(",
"name",
",",
"\"x\"",
")",
";",
"c",
".",
"setPath",
"(",
"\"/\"",
")",
";",
"c",
".",
"setMaxAge",... | Clear the cookie with the specified name. | [
"Clear",
"the",
"cookie",
"with",
"the",
"specified",
"name",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/util/CookieUtil.java#L46-L52 | train |
samskivert/samskivert | src/main/java/com/samskivert/velocity/Application.java | Application.translate | public final String translate (InvocationContext ctx, String msg)
{
return _msgmgr.getMessage(ctx.getRequest(), msg);
} | java | public final String translate (InvocationContext ctx, String msg)
{
return _msgmgr.getMessage(ctx.getRequest(), msg);
} | [
"public",
"final",
"String",
"translate",
"(",
"InvocationContext",
"ctx",
",",
"String",
"msg",
")",
"{",
"return",
"_msgmgr",
".",
"getMessage",
"(",
"ctx",
".",
"getRequest",
"(",
")",
",",
"msg",
")",
";",
"}"
] | A convenience function for translating messages. | [
"A",
"convenience",
"function",
"for",
"translating",
"messages",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/velocity/Application.java#L264-L267 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/RtfExporter.java | RtfExporter.addMetaData | private void addMetaData() {
document.addTitle(getDocumentTitle());
document.addAuthor(ReleaseInfoAdapter.getCompany());
document.addCreator("NextReports " + ReleaseInfoAdapter.getVersionNumber());
document.addSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
document.addCrea... | java | private void addMetaData() {
document.addTitle(getDocumentTitle());
document.addAuthor(ReleaseInfoAdapter.getCompany());
document.addCreator("NextReports " + ReleaseInfoAdapter.getVersionNumber());
document.addSubject("Created by NextReports Designer" + ReleaseInfoAdapter.getVersionNumber());
document.addCrea... | [
"private",
"void",
"addMetaData",
"(",
")",
"{",
"document",
".",
"addTitle",
"(",
"getDocumentTitle",
"(",
")",
")",
";",
"document",
".",
"addAuthor",
"(",
"ReleaseInfoAdapter",
".",
"getCompany",
"(",
")",
")",
";",
"document",
".",
"addCreator",
"(",
"... | to opening the document | [
"to",
"opening",
"the",
"document"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/RtfExporter.java#L119-L126 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Throttle.java | Throttle.reinit | public void reinit (int operations, long period)
{
_period = period;
if (operations != _ops.length) {
long[] ops = new long[operations];
if (operations > _ops.length) {
// copy to a larger buffer, leaving zeroes at the beginning
int lastOp = _... | java | public void reinit (int operations, long period)
{
_period = period;
if (operations != _ops.length) {
long[] ops = new long[operations];
if (operations > _ops.length) {
// copy to a larger buffer, leaving zeroes at the beginning
int lastOp = _... | [
"public",
"void",
"reinit",
"(",
"int",
"operations",
",",
"long",
"period",
")",
"{",
"_period",
"=",
"period",
";",
"if",
"(",
"operations",
"!=",
"_ops",
".",
"length",
")",
"{",
"long",
"[",
"]",
"ops",
"=",
"new",
"long",
"[",
"operations",
"]",... | Updates the number of operations for this throttle to a new maximum, retaining the current
history of operations if the limit is being increased and truncating the oldest operations
if the limit is decreased.
@param operations the new maximum number of operations.
@param period the new period. | [
"Updates",
"the",
"number",
"of",
"operations",
"for",
"this",
"throttle",
"to",
"a",
"new",
"maximum",
"retaining",
"the",
"current",
"history",
"of",
"operations",
"if",
"the",
"limit",
"is",
"being",
"increased",
"and",
"truncating",
"the",
"oldest",
"opera... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Throttle.java#L59-L80 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/queryexec/util/StringUtil.java | StringUtil.stripBlankLines | public static String stripBlankLines(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
BufferedReader in = new BufferedReader(new StringReader(text));
boolean doneOneLine = false;
while (... | java | public static String stripBlankLines(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
BufferedReader in = new BufferedReader(new StringReader(text));
boolean doneOneLine = false;
while (... | [
"public",
"static",
"String",
"stripBlankLines",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"BufferedReader",
"i... | Remove all blank lines from a string. A blank line is defined to be a
line where the only characters are whitespace. We always ensure that the
line contains a newline at the end.
@param text
The string to strip blank lines from
@return The blank line stripped reply | [
"Remove",
"all",
"blank",
"lines",
"from",
"a",
"string",
".",
"A",
"blank",
"line",
"is",
"defined",
"to",
"be",
"a",
"line",
"where",
"the",
"only",
"characters",
"are",
"whitespace",
".",
"We",
"always",
"ensure",
"that",
"the",
"line",
"contains",
"a... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/util/StringUtil.java#L42-L72 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/queryexec/util/StringUtil.java | StringUtil.stripMultiLineComments | public static String stripMultiLineComments(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// Comment rules:
/*/ This is still a comment
/* /* */ // Comments do not nes... | java | public static String stripMultiLineComments(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// Comment rules:
/*/ This is still a comment
/* /* */ // Comments do not nes... | [
"public",
"static",
"String",
"stripMultiLineComments",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// Comment rul... | Remove all the multi-line comments from a block of text
@param text The text to remove multi-line comments from
@return The multi-line comment free text | [
"Remove",
"all",
"the",
"multi",
"-",
"line",
"comments",
"from",
"a",
"block",
"of",
"text"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/util/StringUtil.java#L112-L176 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/queryexec/util/StringUtil.java | StringUtil.stripSingleLineComments | public static String stripSingleLineComments(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// First we strip multi line comments. I think this is important:
BufferedReader in = new BufferedReade... | java | public static String stripSingleLineComments(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// First we strip multi line comments. I think this is important:
BufferedReader in = new BufferedReade... | [
"public",
"static",
"String",
"stripSingleLineComments",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// First we s... | Remove all the single-line comments from a block of text
@param text The text to remove single-line comments from
@return The single-line comment free text | [
"Remove",
"all",
"the",
"single",
"-",
"line",
"comments",
"from",
"a",
"block",
"of",
"text"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/util/StringUtil.java#L183-L212 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/queryexec/util/StringUtil.java | StringUtil.trimLines | public static String trimLines(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// First we strip multi line comments. I think this is important:
BufferedReader in = new BufferedReader(new StringRe... | java | public static String trimLines(String text) {
if (text == null) {
return null;
}
try {
StringBuffer output = new StringBuffer();
// First we strip multi line comments. I think this is important:
BufferedReader in = new BufferedReader(new StringRe... | [
"public",
"static",
"String",
"trimLines",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"StringBuffer",
"output",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"// First we strip multi lin... | Remove any leading or trailing spaces from a line of code.
This function could be improved by making it strip unnecessary double
spaces, but since we would need to leave double spaces inside strings
this is not simple and since the benefit is small, we'll leave it for now
@param text The javascript program to strip spa... | [
"Remove",
"any",
"leading",
"or",
"trailing",
"spaces",
"from",
"a",
"line",
"of",
"code",
".",
"This",
"function",
"could",
"be",
"improved",
"by",
"making",
"it",
"strip",
"unnecessary",
"double",
"spaces",
"but",
"since",
"we",
"would",
"need",
"to",
"l... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/util/StringUtil.java#L222-L246 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/queryexec/util/StringUtil.java | StringUtil.deleteExcededSpaces | public static String deleteExcededSpaces(String text) {
int size = text.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < size; i++) {
char ch = text.charAt(i);
if (ch == ' ') {
if (i > 0) {
char ch2 = text.charAt(i-1);
... | java | public static String deleteExcededSpaces(String text) {
int size = text.length();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < size; i++) {
char ch = text.charAt(i);
if (ch == ' ') {
if (i > 0) {
char ch2 = text.charAt(i-1);
... | [
"public",
"static",
"String",
"deleteExcededSpaces",
"(",
"String",
"text",
")",
"{",
"int",
"size",
"=",
"text",
".",
"length",
"(",
")",
";",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i... | Only one space between words. | [
"Only",
"one",
"space",
"between",
"words",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/queryexec/util/StringUtil.java#L269-L287 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserManager.java | UserManager.loadUser | public User loadUser (HttpServletRequest req)
throws PersistenceException
{
String authcook = CookieUtil.getCookieValue(req, _userAuthCookie);
if (USERMGR_DEBUG) {
log.info("Loading user by cookie", _userAuthCookie, authcook);
}
return loadUser(authcook);
} | java | public User loadUser (HttpServletRequest req)
throws PersistenceException
{
String authcook = CookieUtil.getCookieValue(req, _userAuthCookie);
if (USERMGR_DEBUG) {
log.info("Loading user by cookie", _userAuthCookie, authcook);
}
return loadUser(authcook);
} | [
"public",
"User",
"loadUser",
"(",
"HttpServletRequest",
"req",
")",
"throws",
"PersistenceException",
"{",
"String",
"authcook",
"=",
"CookieUtil",
".",
"getCookieValue",
"(",
"req",
",",
"_userAuthCookie",
")",
";",
"if",
"(",
"USERMGR_DEBUG",
")",
"{",
"log",... | Fetches the necessary authentication information from the http request and loads the user
identified by that information.
@return the user associated with the request or null if no user was associated with the
request or if the authentication information is bogus. | [
"Fetches",
"the",
"necessary",
"authentication",
"information",
"from",
"the",
"http",
"request",
"and",
"loads",
"the",
"user",
"identified",
"by",
"that",
"information",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserManager.java#L164-L172 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserManager.java | UserManager.loadUser | public User loadUser (String authcode)
throws PersistenceException
{
User user = (authcode == null) ? null : _repository.loadUserBySession(authcode);
if (USERMGR_DEBUG) {
log.info("Loaded user by authcode", "code", authcode, "user", user);
}
return user;
} | java | public User loadUser (String authcode)
throws PersistenceException
{
User user = (authcode == null) ? null : _repository.loadUserBySession(authcode);
if (USERMGR_DEBUG) {
log.info("Loaded user by authcode", "code", authcode, "user", user);
}
return user;
} | [
"public",
"User",
"loadUser",
"(",
"String",
"authcode",
")",
"throws",
"PersistenceException",
"{",
"User",
"user",
"=",
"(",
"authcode",
"==",
"null",
")",
"?",
"null",
":",
"_repository",
".",
"loadUserBySession",
"(",
"authcode",
")",
";",
"if",
"(",
"... | Loads up a user based on the supplied session authentication token. | [
"Loads",
"up",
"a",
"user",
"based",
"on",
"the",
"supplied",
"session",
"authentication",
"token",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserManager.java#L177-L185 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserManager.java | UserManager.login | public User login (String username, Password password, boolean persist,
HttpServletRequest req, HttpServletResponse rsp, Authenticator auth)
throws PersistenceException, AuthenticationFailedException
{
// load up the requested user
User user = _repository.loadUser(user... | java | public User login (String username, Password password, boolean persist,
HttpServletRequest req, HttpServletResponse rsp, Authenticator auth)
throws PersistenceException, AuthenticationFailedException
{
// load up the requested user
User user = _repository.loadUser(user... | [
"public",
"User",
"login",
"(",
"String",
"username",
",",
"Password",
"password",
",",
"boolean",
"persist",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
",",
"Authenticator",
"auth",
")",
"throws",
"PersistenceException",
",",
"Authenticati... | Attempts to authenticate the requester and initiate an authenticated session for them. An
authenticated session involves their receiving a cookie that proves them to be authenticated
and an entry in the session database being created that maps their information to their
userid. If this call completes, the session was e... | [
"Attempts",
"to",
"authenticate",
"the",
"requester",
"and",
"initiate",
"an",
"authenticated",
"session",
"for",
"them",
".",
"An",
"authenticated",
"session",
"involves",
"their",
"receiving",
"a",
"cookie",
"that",
"proves",
"them",
"to",
"be",
"authenticated",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserManager.java#L230-L247 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/user/UserManager.java | UserManager.effectLogin | public void effectLogin (
User user, int expires, HttpServletRequest req, HttpServletResponse rsp)
throws PersistenceException
{
String authcode = _repository.registerSession(user, Math.max(expires, 1));
Cookie acookie = new Cookie(_userAuthCookie, authcode);
// strip the hos... | java | public void effectLogin (
User user, int expires, HttpServletRequest req, HttpServletResponse rsp)
throws PersistenceException
{
String authcode = _repository.registerSession(user, Math.max(expires, 1));
Cookie acookie = new Cookie(_userAuthCookie, authcode);
// strip the hos... | [
"public",
"void",
"effectLogin",
"(",
"User",
"user",
",",
"int",
"expires",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
")",
"throws",
"PersistenceException",
"{",
"String",
"authcode",
"=",
"_repository",
".",
"registerSession",
"(",
"us... | If a user is already known to be authenticated for one reason or other, this method can be
used to give them the appropriate authentication cookies to effect their login.
@param expires the number of days in which to expire the session cookie, 0 means expire at
the end of the browser session. | [
"If",
"a",
"user",
"is",
"already",
"known",
"to",
"be",
"authenticated",
"for",
"one",
"reason",
"or",
"other",
"this",
"method",
"can",
"be",
"used",
"to",
"give",
"them",
"the",
"appropriate",
"authentication",
"cookies",
"to",
"effect",
"their",
"login",... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/user/UserManager.java#L290-L306 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/MessageManager.java | MessageManager.exists | public boolean exists (HttpServletRequest req, String path)
{
return (getMessage(req, path, false) != null);
} | java | public boolean exists (HttpServletRequest req, String path)
{
return (getMessage(req, path, false) != null);
} | [
"public",
"boolean",
"exists",
"(",
"HttpServletRequest",
"req",
",",
"String",
"path",
")",
"{",
"return",
"(",
"getMessage",
"(",
"req",
",",
"path",
",",
"false",
")",
"!=",
"null",
")",
";",
"}"
] | Return true if the specifed path exists in the resource bundle. | [
"Return",
"true",
"if",
"the",
"specifed",
"path",
"exists",
"in",
"the",
"resource",
"bundle",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/MessageManager.java#L63-L66 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/MessageManager.java | MessageManager.getMessage | public String getMessage (HttpServletRequest req, String path)
{
return getMessage(req, path, true);
} | java | public String getMessage (HttpServletRequest req, String path)
{
return getMessage(req, path, true);
} | [
"public",
"String",
"getMessage",
"(",
"HttpServletRequest",
"req",
",",
"String",
"path",
")",
"{",
"return",
"getMessage",
"(",
"req",
",",
"path",
",",
"true",
")",
";",
"}"
] | Looks up the message with the specified path in the resource bundle most appropriate for the
locales described as preferred by the request. Always reports missing paths. | [
"Looks",
"up",
"the",
"message",
"with",
"the",
"specified",
"path",
"in",
"the",
"resource",
"bundle",
"most",
"appropriate",
"for",
"the",
"locales",
"described",
"as",
"preferred",
"by",
"the",
"request",
".",
"Always",
"reports",
"missing",
"paths",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/MessageManager.java#L72-L75 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/MessageManager.java | MessageManager.resolveBundles | protected ResourceBundle[] resolveBundles (HttpServletRequest req)
{
// first look to see if we've cached the bundles for this request in the request object
ResourceBundle[] bundles = null;
if (req != null) {
bundles = (ResourceBundle[])req.getAttribute(getBundleCacheName());
... | java | protected ResourceBundle[] resolveBundles (HttpServletRequest req)
{
// first look to see if we've cached the bundles for this request in the request object
ResourceBundle[] bundles = null;
if (req != null) {
bundles = (ResourceBundle[])req.getAttribute(getBundleCacheName());
... | [
"protected",
"ResourceBundle",
"[",
"]",
"resolveBundles",
"(",
"HttpServletRequest",
"req",
")",
"{",
"// first look to see if we've cached the bundles for this request in the request object",
"ResourceBundle",
"[",
"]",
"bundles",
"=",
"null",
";",
"if",
"(",
"req",
"!=",... | Finds the closest matching resource bundle for the locales specified as preferred by the
client in the supplied http request. | [
"Finds",
"the",
"closest",
"matching",
"resource",
"bundle",
"for",
"the",
"locales",
"specified",
"as",
"preferred",
"by",
"the",
"client",
"in",
"the",
"supplied",
"http",
"request",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/MessageManager.java#L183-L233 | train |
samskivert/samskivert | src/main/java/com/samskivert/servlet/MessageManager.java | MessageManager.resolveBundle | protected ResourceBundle resolveBundle (HttpServletRequest req, String bundlePath,
ClassLoader loader, boolean silent)
{
ResourceBundle bundle = null;
if (req != null) {
Enumeration<?> locales = req.getLocales();
while (locales.has... | java | protected ResourceBundle resolveBundle (HttpServletRequest req, String bundlePath,
ClassLoader loader, boolean silent)
{
ResourceBundle bundle = null;
if (req != null) {
Enumeration<?> locales = req.getLocales();
while (locales.has... | [
"protected",
"ResourceBundle",
"resolveBundle",
"(",
"HttpServletRequest",
"req",
",",
"String",
"bundlePath",
",",
"ClassLoader",
"loader",
",",
"boolean",
"silent",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"null",
";",
"if",
"(",
"req",
"!=",
"null",
")",
... | Resolves the default resource bundle based on the locale information provided in the
supplied http request object. | [
"Resolves",
"the",
"default",
"resource",
"bundle",
"based",
"on",
"the",
"locale",
"information",
"provided",
"in",
"the",
"supplied",
"http",
"request",
"object",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/servlet/MessageManager.java#L239-L288 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/FileUtil.java | FileUtil.unpackJar | public static boolean unpackJar (JarFile jar, File target)
{
boolean failure = false;
Enumeration<?> entries = jar.entries();
while (!failure && entries.hasMoreElements()) {
JarEntry entry = (JarEntry)entries.nextElement();
File efile = new File(target, entry.getName(... | java | public static boolean unpackJar (JarFile jar, File target)
{
boolean failure = false;
Enumeration<?> entries = jar.entries();
while (!failure && entries.hasMoreElements()) {
JarEntry entry = (JarEntry)entries.nextElement();
File efile = new File(target, entry.getName(... | [
"public",
"static",
"boolean",
"unpackJar",
"(",
"JarFile",
"jar",
",",
"File",
"target",
")",
"{",
"boolean",
"failure",
"=",
"false",
";",
"Enumeration",
"<",
"?",
">",
"entries",
"=",
"jar",
".",
"entries",
"(",
")",
";",
"while",
"(",
"!",
"failure... | Unpacks the specified jar file intto the specified target directory.
@return true if the jar file was successfully unpacked, false if an
error occurred that prevented the unpacking. The error will be logged. | [
"Unpacks",
"the",
"specified",
"jar",
"file",
"intto",
"the",
"specified",
"target",
"directory",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/FileUtil.java#L78-L125 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/Controller.java | Controller.setControlledPanel | public void setControlledPanel (final JComponent panel)
{
panel.addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged (HierarchyEvent e) {
boolean nowShowing = panel.isDisplayable();
//System.err.println("Controller." + Controller.this +
... | java | public void setControlledPanel (final JComponent panel)
{
panel.addHierarchyListener(new HierarchyListener() {
public void hierarchyChanged (HierarchyEvent e) {
boolean nowShowing = panel.isDisplayable();
//System.err.println("Controller." + Controller.this +
... | [
"public",
"void",
"setControlledPanel",
"(",
"final",
"JComponent",
"panel",
")",
"{",
"panel",
".",
"addHierarchyListener",
"(",
"new",
"HierarchyListener",
"(",
")",
"{",
"public",
"void",
"hierarchyChanged",
"(",
"HierarchyEvent",
"e",
")",
"{",
"boolean",
"n... | Lets this controller know about the panel that it is controlling. | [
"Lets",
"this",
"controller",
"know",
"about",
"the",
"panel",
"that",
"it",
"is",
"controlling",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Controller.java#L156-L176 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/Controller.java | Controller.handleAction | public boolean handleAction (ActionEvent action)
{
Object arg = null;
if (action instanceof CommandEvent) {
arg = ((CommandEvent)action).getArgument();
}
return handleAction(action.getSource(), action.getActionCommand(), arg);
} | java | public boolean handleAction (ActionEvent action)
{
Object arg = null;
if (action instanceof CommandEvent) {
arg = ((CommandEvent)action).getArgument();
}
return handleAction(action.getSource(), action.getActionCommand(), arg);
} | [
"public",
"boolean",
"handleAction",
"(",
"ActionEvent",
"action",
")",
"{",
"Object",
"arg",
"=",
"null",
";",
"if",
"(",
"action",
"instanceof",
"CommandEvent",
")",
"{",
"arg",
"=",
"(",
"(",
"CommandEvent",
")",
"action",
")",
".",
"getArgument",
"(",
... | Instructs this controller to process this action event. When an action
is posted by a user interface element, it will be posted to the
controller in closest scope for that element. If that controller handles
the event, it should return true from this method to indicate that
processing should stop. If it cannot handle t... | [
"Instructs",
"this",
"controller",
"to",
"process",
"this",
"action",
"event",
".",
"When",
"an",
"action",
"is",
"posted",
"by",
"a",
"user",
"interface",
"element",
"it",
"will",
"be",
"posted",
"to",
"the",
"controller",
"in",
"closest",
"scope",
"for",
... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/Controller.java#L247-L254 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/DefaultLogProvider.java | DefaultLogProvider.obtainTermSize | protected static void obtainTermSize ()
{
if (_tdimens == null) {
_tdimens = TermUtil.getTerminalSize();
// if we were unable to obtain our dimensions, use defaults
if (_tdimens == null) {
_tdimens = new Dimension(132, 24);
}
}
} | java | protected static void obtainTermSize ()
{
if (_tdimens == null) {
_tdimens = TermUtil.getTerminalSize();
// if we were unable to obtain our dimensions, use defaults
if (_tdimens == null) {
_tdimens = new Dimension(132, 24);
}
}
} | [
"protected",
"static",
"void",
"obtainTermSize",
"(",
")",
"{",
"if",
"(",
"_tdimens",
"==",
"null",
")",
"{",
"_tdimens",
"=",
"TermUtil",
".",
"getTerminalSize",
"(",
")",
";",
"// if we were unable to obtain our dimensions, use defaults",
"if",
"(",
"_tdimens",
... | Attempts to obtain the dimensions of the terminal window in which
we're running. This is extremely platform specific, but feel free
to add code to do the right thing for your platform. | [
"Attempts",
"to",
"obtain",
"the",
"dimensions",
"of",
"the",
"terminal",
"window",
"in",
"which",
"we",
"re",
"running",
".",
"This",
"is",
"extremely",
"platform",
"specific",
"but",
"feel",
"free",
"to",
"add",
"code",
"to",
"do",
"the",
"right",
"thing... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/DefaultLogProvider.java#L167-L177 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/exporter/CsvExporter.java | CsvExporter.put | private void put(PrintStream p, String s) {
if (s == null) {
// nl();
put(p, " ");
return;
}
if (wasPreviousField) {
p.print(separator);
}
if (trim) {
s = s.trim();
}
if (s.indexOf(quote) >= 0) {
... | java | private void put(PrintStream p, String s) {
if (s == null) {
// nl();
put(p, " ");
return;
}
if (wasPreviousField) {
p.print(separator);
}
if (trim) {
s = s.trim();
}
if (s.indexOf(quote) >= 0) {
... | [
"private",
"void",
"put",
"(",
"PrintStream",
"p",
",",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"// nl();",
"put",
"(",
"p",
",",
"\" \"",
")",
";",
"return",
";",
"}",
"if",
"(",
"wasPreviousField",
")",
"{",
"p",
".",
... | Write one csv field to the file, followed by a separator unless it is the
last field on the line. Lead and trailing blanks will be removed.
@param p print stream
@param s The string to write. Any additional quotes or embedded quotes
will be provided by put. Null means start a new line. | [
"Write",
"one",
"csv",
"field",
"to",
"the",
"file",
"followed",
"by",
"a",
"separator",
"unless",
"it",
"is",
"the",
"last",
"field",
"on",
"the",
"line",
".",
"Lead",
"and",
"trailing",
"blanks",
"will",
"be",
"removed",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/exporter/CsvExporter.java#L157-L195 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/DebugChords.java | DebugChords.activate | public static void activate ()
{
// capture low-level keyboard events via the keyboard focus manager
if (_dispatcher == null) {
_dispatcher = new KeyEventDispatcher() {
public boolean dispatchKeyEvent (KeyEvent e) {
return DebugChords.dispatchKeyEvent(... | java | public static void activate ()
{
// capture low-level keyboard events via the keyboard focus manager
if (_dispatcher == null) {
_dispatcher = new KeyEventDispatcher() {
public boolean dispatchKeyEvent (KeyEvent e) {
return DebugChords.dispatchKeyEvent(... | [
"public",
"static",
"void",
"activate",
"(",
")",
"{",
"// capture low-level keyboard events via the keyboard focus manager",
"if",
"(",
"_dispatcher",
"==",
"null",
")",
"{",
"_dispatcher",
"=",
"new",
"KeyEventDispatcher",
"(",
")",
"{",
"public",
"boolean",
"dispat... | Initializes the debug chords services and wires up the key event
listener that will be used to invoke the bound code. | [
"Initializes",
"the",
"debug",
"chords",
"services",
"and",
"wires",
"up",
"the",
"key",
"event",
"listener",
"that",
"will",
"be",
"used",
"to",
"invoke",
"the",
"bound",
"code",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/DebugChords.java#L44-L58 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/DebugChords.java | DebugChords.registerHook | public static void registerHook (int modifierMask, int keyCode, Hook hook)
{
// store the hooks mapped by key code
ArrayList<Tuple<Integer,Hook>> list = _bindings.get(keyCode);
if (list == null) {
list = new ArrayList<Tuple<Integer,Hook>>();
_bindings.put(keyCode, lis... | java | public static void registerHook (int modifierMask, int keyCode, Hook hook)
{
// store the hooks mapped by key code
ArrayList<Tuple<Integer,Hook>> list = _bindings.get(keyCode);
if (list == null) {
list = new ArrayList<Tuple<Integer,Hook>>();
_bindings.put(keyCode, lis... | [
"public",
"static",
"void",
"registerHook",
"(",
"int",
"modifierMask",
",",
"int",
"keyCode",
",",
"Hook",
"hook",
")",
"{",
"// store the hooks mapped by key code",
"ArrayList",
"<",
"Tuple",
"<",
"Integer",
",",
"Hook",
">",
">",
"list",
"=",
"_bindings",
"... | Registers the supplied debug hook to be invoked when the specified
key combination is depressed.
@param modifierMask a mask with bits on for all modifiers that must
be present when the specified key code is received (e.g. {@link
KeyEvent#CTRL_DOWN_MASK}|{@link KeyEvent#ALT_DOWN_MASK}).
@param keyCode the code that ide... | [
"Registers",
"the",
"supplied",
"debug",
"hook",
"to",
"be",
"invoked",
"when",
"the",
"specified",
"key",
"combination",
"is",
"depressed",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/DebugChords.java#L72-L83 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/jora/Cursor.java | Cursor.next | public V next ()
throws SQLException
{
// if we closed everything up after the last call to next(),
// table will be null here and we should bail immediately
if (_table == null) {
return null;
}
if (_result == null) {
if (_qbeObject != null) {... | java | public V next ()
throws SQLException
{
// if we closed everything up after the last call to next(),
// table will be null here and we should bail immediately
if (_table == null) {
return null;
}
if (_result == null) {
if (_qbeObject != null) {... | [
"public",
"V",
"next",
"(",
")",
"throws",
"SQLException",
"{",
"// if we closed everything up after the last call to next(),",
"// table will be null here and we should bail immediately",
"if",
"(",
"_table",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",... | A cursor is initially positioned before its first row; the first call to
next makes the first row the current row; the second call makes the
second row the current row, etc.
<P> If an input stream from the previous row is open, it is implicitly
closed. The ResultSet's warning chain is cleared when a new row is read.
... | [
"A",
"cursor",
"is",
"initially",
"positioned",
"before",
"its",
"first",
"row",
";",
"the",
"first",
"call",
"to",
"next",
"makes",
"the",
"first",
"row",
"the",
"current",
"row",
";",
"the",
"second",
"call",
"makes",
"the",
"second",
"row",
"the",
"cu... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/Cursor.java#L32-L67 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/jora/Cursor.java | Cursor.get | public V get ()
throws SQLException
{
V result = next();
if (result != null) {
int spurious = 0;
while (next() != null) {
spurious++;
}
if (spurious > 0) {
log.warning("Cursor.get() quietly tossed " + spurious + ... | java | public V get ()
throws SQLException
{
V result = next();
if (result != null) {
int spurious = 0;
while (next() != null) {
spurious++;
}
if (spurious > 0) {
log.warning("Cursor.get() quietly tossed " + spurious + ... | [
"public",
"V",
"get",
"(",
")",
"throws",
"SQLException",
"{",
"V",
"result",
"=",
"next",
"(",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"int",
"spurious",
"=",
"0",
";",
"while",
"(",
"next",
"(",
")",
"!=",
"null",
")",
"{",
"sp... | Returns the first element matched by this cursor or null if no elements
were matched. Checks to ensure that no subsequent elements were matched
by the query, logs a warning if there were spurious additional matches. | [
"Returns",
"the",
"first",
"element",
"matched",
"by",
"this",
"cursor",
"or",
"null",
"if",
"no",
"elements",
"were",
"matched",
".",
"Checks",
"to",
"ensure",
"that",
"no",
"subsequent",
"elements",
"were",
"matched",
"by",
"the",
"query",
"logs",
"a",
"... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/Cursor.java#L74-L89 | train |
samskivert/samskivert | src/main/java/com/samskivert/jdbc/jora/Cursor.java | Cursor.close | public void close ()
throws SQLException
{
if (_result != null) {
_result.close();
_result = null;
}
if (_stmt != null) {
_stmt.close();
_stmt = null;
}
} | java | public void close ()
throws SQLException
{
if (_result != null) {
_result.close();
_result = null;
}
if (_stmt != null) {
_stmt.close();
_stmt = null;
}
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"_result",
"!=",
"null",
")",
"{",
"_result",
".",
"close",
"(",
")",
";",
"_result",
"=",
"null",
";",
"}",
"if",
"(",
"_stmt",
"!=",
"null",
")",
"{",
"_stmt",
".",
... | Close the Cursor, even if we haven't read all the possible objects. | [
"Close",
"the",
"Cursor",
"even",
"if",
"we",
"haven",
"t",
"read",
"all",
"the",
"possible",
"objects",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/Cursor.java#L141-L152 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.setReport | public void setReport(Report report) {
this.report = report;
if (this.report.getQuery() != null) {
this.report.getQuery().setDialect(dialect);
}
} | java | public void setReport(Report report) {
this.report = report;
if (this.report.getQuery() != null) {
this.report.getQuery().setDialect(dialect);
}
} | [
"public",
"void",
"setReport",
"(",
"Report",
"report",
")",
"{",
"this",
".",
"report",
"=",
"report",
";",
"if",
"(",
"this",
".",
"report",
".",
"getQuery",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"report",
".",
"getQuery",
"(",
")",
".",... | Set next report object
@param report
next report object | [
"Set",
"next",
"report",
"object"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L195-L200 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.setAlerts | public void setAlerts(List<Alert> alerts) {
if (format == null) {
throw new IllegalStateException(
"You have to use setFormat with a valid output format before using setAlert!");
}
if (!ALARM_FORMAT.equals(format) && !INDICATOR_FORMAT.equals(format) && !DISPLAY_FORMAT.equals(format)) {
throw new Illega... | java | public void setAlerts(List<Alert> alerts) {
if (format == null) {
throw new IllegalStateException(
"You have to use setFormat with a valid output format before using setAlert!");
}
if (!ALARM_FORMAT.equals(format) && !INDICATOR_FORMAT.equals(format) && !DISPLAY_FORMAT.equals(format)) {
throw new Illega... | [
"public",
"void",
"setAlerts",
"(",
"List",
"<",
"Alert",
">",
"alerts",
")",
"{",
"if",
"(",
"format",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"You have to use setFormat with a valid output format before using setAlert!\"",
")",
";",
... | Set a list of alert object for report of type alarm
@param alerts
list of alert object | [
"Set",
"a",
"list",
"of",
"alert",
"object",
"for",
"report",
"of",
"type",
"alarm"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L293-L303 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.executeQuery | public QueryResult executeQuery() throws ReportRunnerException, InterruptedException {
if (connection == null) {
throw new ReportRunnerException("Connection is null!");
}
if (report == null) {
throw new ReportRunnerException("Report is null!");
}
String sql = getSql();
// retrieves the report parame... | java | public QueryResult executeQuery() throws ReportRunnerException, InterruptedException {
if (connection == null) {
throw new ReportRunnerException("Connection is null!");
}
if (report == null) {
throw new ReportRunnerException("Report is null!");
}
String sql = getSql();
// retrieves the report parame... | [
"public",
"QueryResult",
"executeQuery",
"(",
")",
"throws",
"ReportRunnerException",
",",
"InterruptedException",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"{",
"throw",
"new",
"ReportRunnerException",
"(",
"\"Connection is null!\"",
")",
";",
"}",
"if",
"... | Execute query This method is useful in case you are not interested about
report layout, but only query and you want to make your own business.
@return QueryResult object
@throws ReportRunnerException
if Runner object is not correctly configured
@throws InterruptedException
if process was interrupted | [
"Execute",
"query",
"This",
"method",
"is",
"useful",
"in",
"case",
"you",
"are",
"not",
"interested",
"about",
"report",
"layout",
"but",
"only",
"query",
"and",
"you",
"want",
"to",
"make",
"your",
"own",
"business",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L331-L369 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.run | public boolean run(OutputStream stream) throws ReportRunnerException, NoDataFoundException {
if ((stream == null) && !TABLE_FORMAT.equals(format) && !ALARM_FORMAT.equals(format)
&& !INDICATOR_FORMAT.equals(format) && !DISPLAY_FORMAT.equals(format)) {
throw new ReportRunnerException("OutputStream cannot be nul... | java | public boolean run(OutputStream stream) throws ReportRunnerException, NoDataFoundException {
if ((stream == null) && !TABLE_FORMAT.equals(format) && !ALARM_FORMAT.equals(format)
&& !INDICATOR_FORMAT.equals(format) && !DISPLAY_FORMAT.equals(format)) {
throw new ReportRunnerException("OutputStream cannot be nul... | [
"public",
"boolean",
"run",
"(",
"OutputStream",
"stream",
")",
"throws",
"ReportRunnerException",
",",
"NoDataFoundException",
"{",
"if",
"(",
"(",
"stream",
"==",
"null",
")",
"&&",
"!",
"TABLE_FORMAT",
".",
"equals",
"(",
"format",
")",
"&&",
"!",
"ALARM_... | Export the current report to the specified output format
@param stream
output stream to write the exported report
@throws ReportRunnerException
if FluentReportRunner object is not correctly configured
@return true if export process finished, or false if export process was
stopped
@throws NoDataFoundException
if repor... | [
"Export",
"the",
"current",
"report",
"to",
"the",
"specified",
"output",
"format"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L384-L441 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.removeExporterEventListener | public void removeExporterEventListener(ExporterEventListener listener) {
listenerList.remove(listener);
if (exporter != null) {
exporter.removeExporterEventListener(listener);
}
} | java | public void removeExporterEventListener(ExporterEventListener listener) {
listenerList.remove(listener);
if (exporter != null) {
exporter.removeExporterEventListener(listener);
}
} | [
"public",
"void",
"removeExporterEventListener",
"(",
"ExporterEventListener",
"listener",
")",
"{",
"listenerList",
".",
"remove",
"(",
"listener",
")",
";",
"if",
"(",
"exporter",
"!=",
"null",
")",
"{",
"exporter",
".",
"removeExporterEventListener",
"(",
"list... | Remove an exporter event listener
@param listener
exporter event listener | [
"Remove",
"an",
"exporter",
"event",
"listener"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L577-L582 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.getAlarmData | public AlarmData getAlarmData() {
if (ALARM_FORMAT.equals(format)) {
AlarmExporter alarmExporter = (AlarmExporter) exporter;
return alarmExporter.getData();
} else {
return new AlarmData();
}
} | java | public AlarmData getAlarmData() {
if (ALARM_FORMAT.equals(format)) {
AlarmExporter alarmExporter = (AlarmExporter) exporter;
return alarmExporter.getData();
} else {
return new AlarmData();
}
} | [
"public",
"AlarmData",
"getAlarmData",
"(",
")",
"{",
"if",
"(",
"ALARM_FORMAT",
".",
"equals",
"(",
"format",
")",
")",
"{",
"AlarmExporter",
"alarmExporter",
"=",
"(",
"AlarmExporter",
")",
"exporter",
";",
"return",
"alarmExporter",
".",
"getData",
"(",
"... | Get alarm data ALARM exporter
@return alarm data for ALARM exporter | [
"Get",
"alarm",
"data",
"ALARM",
"exporter"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L603-L610 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.getIndicatorData | public IndicatorData getIndicatorData() {
if (INDICATOR_FORMAT.equals(format)) {
IndicatorExporter ie = (IndicatorExporter) exporter;
return ie.getData();
} else {
return new IndicatorData();
}
} | java | public IndicatorData getIndicatorData() {
if (INDICATOR_FORMAT.equals(format)) {
IndicatorExporter ie = (IndicatorExporter) exporter;
return ie.getData();
} else {
return new IndicatorData();
}
} | [
"public",
"IndicatorData",
"getIndicatorData",
"(",
")",
"{",
"if",
"(",
"INDICATOR_FORMAT",
".",
"equals",
"(",
"format",
")",
")",
"{",
"IndicatorExporter",
"ie",
"=",
"(",
"IndicatorExporter",
")",
"exporter",
";",
"return",
"ie",
".",
"getData",
"(",
")"... | Get indicator data INDICATOR exporter
@return indicator data for INDICATOR exporter | [
"Get",
"indicator",
"data",
"INDICATOR",
"exporter"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L617-L624 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/ReportRunner.java | ReportRunner.getDisplayData | public DisplayData getDisplayData() {
if (DISPLAY_FORMAT.equals(format)) {
DisplayExporter de = (DisplayExporter) exporter;
return de.getData();
} else {
return new DisplayData();
}
} | java | public DisplayData getDisplayData() {
if (DISPLAY_FORMAT.equals(format)) {
DisplayExporter de = (DisplayExporter) exporter;
return de.getData();
} else {
return new DisplayData();
}
} | [
"public",
"DisplayData",
"getDisplayData",
"(",
")",
"{",
"if",
"(",
"DISPLAY_FORMAT",
".",
"equals",
"(",
"format",
")",
")",
"{",
"DisplayExporter",
"de",
"=",
"(",
"DisplayExporter",
")",
"exporter",
";",
"return",
"de",
".",
"getData",
"(",
")",
";",
... | Get display data DISPLAY exporter
@return display data for DISPLAY exporter | [
"Get",
"display",
"data",
"DISPLAY",
"exporter"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/ReportRunner.java#L631-L638 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/LRUHashMap.java | LRUHashMap.flush | protected void flush ()
{
if (!_canFlush) {
return;
}
// If we've exceeded our size, remove things until we're back
// under the required size.
if (_size > _maxSize) {
// This works because the entrySet iterator of a LinkedHashMap
// retur... | java | protected void flush ()
{
if (!_canFlush) {
return;
}
// If we've exceeded our size, remove things until we're back
// under the required size.
if (_size > _maxSize) {
// This works because the entrySet iterator of a LinkedHashMap
// retur... | [
"protected",
"void",
"flush",
"(",
")",
"{",
"if",
"(",
"!",
"_canFlush",
")",
"{",
"return",
";",
"}",
"// If we've exceeded our size, remove things until we're back",
"// under the required size.",
"if",
"(",
"_size",
">",
"_maxSize",
")",
"{",
"// This works becaus... | Flushes entries from the cache until we're back under our desired
cache size. | [
"Flushes",
"entries",
"from",
"the",
"cache",
"until",
"we",
"re",
"back",
"under",
"our",
"desired",
"cache",
"size",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/LRUHashMap.java#L228-L248 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/LRUHashMap.java | LRUHashMap.entryRemoved | protected void entryRemoved (V entry)
{
if (entry != null) {
_size -= _sizer.computeSize(entry);
if (_remobs != null) {
_remobs.removedFromMap(this, entry);
}
}
} | java | protected void entryRemoved (V entry)
{
if (entry != null) {
_size -= _sizer.computeSize(entry);
if (_remobs != null) {
_remobs.removedFromMap(this, entry);
}
}
} | [
"protected",
"void",
"entryRemoved",
"(",
"V",
"entry",
")",
"{",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"_size",
"-=",
"_sizer",
".",
"computeSize",
"(",
"entry",
")",
";",
"if",
"(",
"_remobs",
"!=",
"null",
")",
"{",
"_remobs",
".",
"removedF... | Adjust our size to reflect the removal of the specified entry. | [
"Adjust",
"our",
"size",
"to",
"reflect",
"the",
"removal",
"of",
"the",
"specified",
"entry",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/LRUHashMap.java#L253-L261 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/ExpiringReference.java | ExpiringReference.create | public static <T> ExpiringReference<T> create (T value, long expireMillis)
{
return new ExpiringReference<T>(value, expireMillis);
} | java | public static <T> ExpiringReference<T> create (T value, long expireMillis)
{
return new ExpiringReference<T>(value, expireMillis);
} | [
"public",
"static",
"<",
"T",
">",
"ExpiringReference",
"<",
"T",
">",
"create",
"(",
"T",
"value",
",",
"long",
"expireMillis",
")",
"{",
"return",
"new",
"ExpiringReference",
"<",
"T",
">",
"(",
"value",
",",
"expireMillis",
")",
";",
"}"
] | Creates an expiring reference with the supplied value and expiration time. | [
"Creates",
"an",
"expiring",
"reference",
"with",
"the",
"supplied",
"value",
"and",
"expiration",
"time",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ExpiringReference.java#L23-L26 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/ExpiringReference.java | ExpiringReference.get | public static <T> T get (ExpiringReference<T> value)
{
return (value == null) ? null : value.getValue();
} | java | public static <T> T get (ExpiringReference<T> value)
{
return (value == null) ? null : value.getValue();
} | [
"public",
"static",
"<",
"T",
">",
"T",
"get",
"(",
"ExpiringReference",
"<",
"T",
">",
"value",
")",
"{",
"return",
"(",
"value",
"==",
"null",
")",
"?",
"null",
":",
"value",
".",
"getValue",
"(",
")",
";",
"}"
] | Gets the value from an expiring reference but returns null if the supplied reference
reference is null. | [
"Gets",
"the",
"value",
"from",
"an",
"expiring",
"reference",
"but",
"returns",
"null",
"if",
"the",
"supplied",
"reference",
"reference",
"is",
"null",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ExpiringReference.java#L32-L35 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/ExpiringReference.java | ExpiringReference.getValue | public T getValue ()
{
// if the value is still around and it's expired, clear it
if (_value != null && System.currentTimeMillis() >= _expires) {
_value = null;
}
// then return the value (which may be cleared to null by now)
return _value;
} | java | public T getValue ()
{
// if the value is still around and it's expired, clear it
if (_value != null && System.currentTimeMillis() >= _expires) {
_value = null;
}
// then return the value (which may be cleared to null by now)
return _value;
} | [
"public",
"T",
"getValue",
"(",
")",
"{",
"// if the value is still around and it's expired, clear it",
"if",
"(",
"_value",
"!=",
"null",
"&&",
"System",
".",
"currentTimeMillis",
"(",
")",
">=",
"_expires",
")",
"{",
"_value",
"=",
"null",
";",
"}",
"// then r... | Returns the value with which we were created or null if the value has
expired. | [
"Returns",
"the",
"value",
"with",
"which",
"we",
"were",
"created",
"or",
"null",
"if",
"the",
"value",
"has",
"expired",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/ExpiringReference.java#L51-L59 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MenuUtil.java | MenuUtil.addMenuItem | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name)
{
return addMenuItem(l, menu, name, null, null);
} | java | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name)
{
return addMenuItem(l, menu, name, null, null);
} | [
"public",
"static",
"JMenuItem",
"addMenuItem",
"(",
"ActionListener",
"l",
",",
"JMenu",
"menu",
",",
"String",
"name",
")",
"{",
"return",
"addMenuItem",
"(",
"l",
",",
"menu",
",",
"name",
",",
"null",
",",
"null",
")",
";",
"}"
] | Adds a new menu item to the menu with the specified name.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@return the new menu item. | [
"Adds",
"a",
"new",
"menu",
"item",
"to",
"the",
"menu",
"with",
"the",
"specified",
"name",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MenuUtil.java#L99-L103 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MenuUtil.java | MenuUtil.createItem | protected static JMenuItem createItem (String name, Integer mnem, KeyStroke accel)
{
JMenuItem item = new JMenuItem(name);
if (mnem != null) {
item.setMnemonic(mnem.intValue());
}
if (accel != null) {
item.setAccelerator(accel);
}
return item;
... | java | protected static JMenuItem createItem (String name, Integer mnem, KeyStroke accel)
{
JMenuItem item = new JMenuItem(name);
if (mnem != null) {
item.setMnemonic(mnem.intValue());
}
if (accel != null) {
item.setAccelerator(accel);
}
return item;
... | [
"protected",
"static",
"JMenuItem",
"createItem",
"(",
"String",
"name",
",",
"Integer",
"mnem",
",",
"KeyStroke",
"accel",
")",
"{",
"JMenuItem",
"item",
"=",
"new",
"JMenuItem",
"(",
"name",
")",
";",
"if",
"(",
"mnem",
"!=",
"null",
")",
"{",
"item",
... | Creates and configures a menu item. | [
"Creates",
"and",
"configures",
"a",
"menu",
"item",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MenuUtil.java#L181-L191 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/MultiLineLabel.java | MultiLineLabel.setText | public void setText (String text)
{
if (_label.setText(text)) {
_dirty = true;
// clear out our constrained size where appropriate
if (_constrain == HORIZONTAL || _constrain == VERTICAL) {
_constrainedSize = 0;
_label.clearTargetDimens();
... | java | public void setText (String text)
{
if (_label.setText(text)) {
_dirty = true;
// clear out our constrained size where appropriate
if (_constrain == HORIZONTAL || _constrain == VERTICAL) {
_constrainedSize = 0;
_label.clearTargetDimens();
... | [
"public",
"void",
"setText",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"_label",
".",
"setText",
"(",
"text",
")",
")",
"{",
"_dirty",
"=",
"true",
";",
"// clear out our constrained size where appropriate",
"if",
"(",
"_constrain",
"==",
"HORIZONTAL",
"||",... | Sets the text displayed by this label. | [
"Sets",
"the",
"text",
"displayed",
"by",
"this",
"label",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/MultiLineLabel.java#L137-L149 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/MultiLineLabel.java | MultiLineLabel.layoutLabel | protected void layoutLabel ()
{
Graphics2D gfx = (Graphics2D)getGraphics();
if (gfx != null) {
// re-layout the label
_label.layout(gfx);
gfx.dispose();
// note that we're no longer dirty
_dirty = false;
}
} | java | protected void layoutLabel ()
{
Graphics2D gfx = (Graphics2D)getGraphics();
if (gfx != null) {
// re-layout the label
_label.layout(gfx);
gfx.dispose();
// note that we're no longer dirty
_dirty = false;
}
} | [
"protected",
"void",
"layoutLabel",
"(",
")",
"{",
"Graphics2D",
"gfx",
"=",
"(",
"Graphics2D",
")",
"getGraphics",
"(",
")",
";",
"if",
"(",
"gfx",
"!=",
"null",
")",
"{",
"// re-layout the label",
"_label",
".",
"layout",
"(",
"gfx",
")",
";",
"gfx",
... | Called when the label has changed in some meaningful way and we'd accordingly like to
re-layout the label, update our component's size, and repaint everything to suit. | [
"Called",
"when",
"the",
"label",
"has",
"changed",
"in",
"some",
"meaningful",
"way",
"and",
"we",
"d",
"accordingly",
"like",
"to",
"re",
"-",
"layout",
"the",
"label",
"update",
"our",
"component",
"s",
"size",
"and",
"repaint",
"everything",
"to",
"sui... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/MultiLineLabel.java#L297-L308 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/querybuilder/sql/dialect/DialectFactory.java | DialectFactory.determineDialect | public static Dialect determineDialect(String databaseName, String databaseMajorVersion)
throws DialectException {
if (databaseName == null) {
throw new DialectException("Dialect must be explicitly set");
}
String dialectName;
// TODO workaround ... | java | public static Dialect determineDialect(String databaseName, String databaseMajorVersion)
throws DialectException {
if (databaseName == null) {
throw new DialectException("Dialect must be explicitly set");
}
String dialectName;
// TODO workaround ... | [
"public",
"static",
"Dialect",
"determineDialect",
"(",
"String",
"databaseName",
",",
"String",
"databaseMajorVersion",
")",
"throws",
"DialectException",
"{",
"if",
"(",
"databaseName",
"==",
"null",
")",
"{",
"throw",
"new",
"DialectException",
"(",
"\"Dialect mu... | Determine the appropriate Dialect to use given the database product name
and major version.
@param databaseName The name of the database product (obtained from metadata).
@param databaseMajorVersion The major version of the database product (obtained from metadata).
@return An appropriate dialect instance.
@throws Di... | [
"Determine",
"the",
"appropriate",
"Dialect",
"to",
"use",
"given",
"the",
"database",
"product",
"name",
"and",
"major",
"version",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/querybuilder/sql/dialect/DialectFactory.java#L84-L105 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/querybuilder/sql/dialect/DialectFactory.java | DialectFactory.buildDialect | public static Dialect buildDialect(String dialectName) throws DialectException {
try {
return (Dialect) loadDialect(dialectName).newInstance();
} catch (ClassNotFoundException e) {
throw new DialectException("Dialect class not found: " + dialectName);
} catch (Exception e... | java | public static Dialect buildDialect(String dialectName) throws DialectException {
try {
return (Dialect) loadDialect(dialectName).newInstance();
} catch (ClassNotFoundException e) {
throw new DialectException("Dialect class not found: " + dialectName);
} catch (Exception e... | [
"public",
"static",
"Dialect",
"buildDialect",
"(",
"String",
"dialectName",
")",
"throws",
"DialectException",
"{",
"try",
"{",
"return",
"(",
"Dialect",
")",
"loadDialect",
"(",
"dialectName",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Cla... | Returns a dialect instance given the name of the class to use.
@param dialectName The name of the dialect class.
@return The dialect instance.
@throws DialectException | [
"Returns",
"a",
"dialect",
"instance",
"given",
"the",
"name",
"of",
"the",
"class",
"to",
"use",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/querybuilder/sql/dialect/DialectFactory.java#L115-L123 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Runnables.java | Runnables.asRunnable | public static Runnable asRunnable (Object instance, String methodName)
{
Class<?> clazz = instance.getClass();
Method method = findMethod(clazz, methodName);
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalArgumentException(
clazz.getName() + "." ... | java | public static Runnable asRunnable (Object instance, String methodName)
{
Class<?> clazz = instance.getClass();
Method method = findMethod(clazz, methodName);
if (Modifier.isStatic(method.getModifiers())) {
throw new IllegalArgumentException(
clazz.getName() + "." ... | [
"public",
"static",
"Runnable",
"asRunnable",
"(",
"Object",
"instance",
",",
"String",
"methodName",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"instance",
".",
"getClass",
"(",
")",
";",
"Method",
"method",
"=",
"findMethod",
"(",
"clazz",
",",
"m... | Creates a runnable that invokes the specified method on the specified instance via
reflection.
<p> NOTE: if you specify a protected or private method this method will call {@link
Method#setAccessible} to make the method accessible. If you're writing secure code or need
to run in a sandbox, don't use this functionality... | [
"Creates",
"a",
"runnable",
"that",
"invokes",
"the",
"specified",
"method",
"on",
"the",
"specified",
"instance",
"via",
"reflection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Runnables.java#L37-L46 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Runnables.java | Runnables.asRunnable | public static Runnable asRunnable (Class<?> clazz, String methodName)
{
Method method = findMethod(clazz, methodName);
if (!Modifier.isStatic(method.getModifiers())) {
throw new IllegalArgumentException(
clazz.getName() + "." + methodName + "() must be static");
}... | java | public static Runnable asRunnable (Class<?> clazz, String methodName)
{
Method method = findMethod(clazz, methodName);
if (!Modifier.isStatic(method.getModifiers())) {
throw new IllegalArgumentException(
clazz.getName() + "." + methodName + "() must be static");
}... | [
"public",
"static",
"Runnable",
"asRunnable",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
")",
"{",
"Method",
"method",
"=",
"findMethod",
"(",
"clazz",
",",
"methodName",
")",
";",
"if",
"(",
"!",
"Modifier",
".",
"isStatic",
"(",... | Creates a runnable that invokes the specified static method via reflection.
<p> NOTE: if you specify a protected or private method this method will call {@link
Method#setAccessible} to make the method accessible. If you're writing secure code or need
to run in a sandbox, don't use this functionality.
@throws IllegalA... | [
"Creates",
"a",
"runnable",
"that",
"invokes",
"the",
"specified",
"static",
"method",
"via",
"reflection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Runnables.java#L58-L66 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/ChartRunner.java | ChartRunner.setConnection | public void setConnection(Connection connection, boolean csv) {
this.connection = connection;
this.csv = csv;
try {
dialect = DialectUtil.getDialect(connection);
} catch (Exception e) {
e.printStackTrace();
}
if (chart != null) {
if (chart.getRepo... | java | public void setConnection(Connection connection, boolean csv) {
this.connection = connection;
this.csv = csv;
try {
dialect = DialectUtil.getDialect(connection);
} catch (Exception e) {
e.printStackTrace();
}
if (chart != null) {
if (chart.getRepo... | [
"public",
"void",
"setConnection",
"(",
"Connection",
"connection",
",",
"boolean",
"csv",
")",
"{",
"this",
".",
"connection",
"=",
"connection",
";",
"this",
".",
"csv",
"=",
"csv",
";",
"try",
"{",
"dialect",
"=",
"DialectUtil",
".",
"getDialect",
"(",
... | Set database connection
@param connection database connection
@param csv true for a csv file connection | [
"Set",
"database",
"connection"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/ChartRunner.java#L100-L113 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/ChartRunner.java | ChartRunner.setChart | public void setChart(Chart chart) {
this.chart = chart;
if (this.chart.getReport().getQuery() != null) {
this.chart.getReport().getQuery().setDialect(dialect);
}
} | java | public void setChart(Chart chart) {
this.chart = chart;
if (this.chart.getReport().getQuery() != null) {
this.chart.getReport().getQuery().setDialect(dialect);
}
} | [
"public",
"void",
"setChart",
"(",
"Chart",
"chart",
")",
"{",
"this",
".",
"chart",
"=",
"chart",
";",
"if",
"(",
"this",
".",
"chart",
".",
"getReport",
"(",
")",
".",
"getQuery",
"(",
")",
"!=",
"null",
")",
"{",
"this",
".",
"chart",
".",
"ge... | Set next chart object
@param chart next chart object | [
"Set",
"next",
"chart",
"object"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/ChartRunner.java#L129-L134 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/chart/ChartRunner.java | ChartRunner.run | public boolean run(OutputStream stream) throws ReportRunnerException,
NoDataFoundException, InterruptedException {
if ((stream == null) && GRAPHIC_FORMAT.equals(format)) {
throw new ReportRunnerException("OutputStream cannot be null!");
}
if ((stream != null) && TABLE_FORMAT.equa... | java | public boolean run(OutputStream stream) throws ReportRunnerException,
NoDataFoundException, InterruptedException {
if ((stream == null) && GRAPHIC_FORMAT.equals(format)) {
throw new ReportRunnerException("OutputStream cannot be null!");
}
if ((stream != null) && TABLE_FORMAT.equa... | [
"public",
"boolean",
"run",
"(",
"OutputStream",
"stream",
")",
"throws",
"ReportRunnerException",
",",
"NoDataFoundException",
",",
"InterruptedException",
"{",
"if",
"(",
"(",
"stream",
"==",
"null",
")",
"&&",
"GRAPHIC_FORMAT",
".",
"equals",
"(",
"format",
"... | Export the current chart to the specified output format
For IMAGE_FORMAT use withImagePath method.
@param stream output stream to write the exported chart
@throws ReportRunnerException if ChartRunner object is not correctly configured
@throws NoDataFoundException if chart has no data
@throws InterruptedException if pr... | [
"Export",
"the",
"current",
"chart",
"to",
"the",
"specified",
"output",
"format",
"For",
"IMAGE_FORMAT",
"use",
"withImagePath",
"method",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/chart/ChartRunner.java#L299-L385 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/RepeatRecordFilter.java | RepeatRecordFilter.configureDefaultHandler | public static void configureDefaultHandler (int maxRepeat)
{
Logger logger = LogManager.getLogManager().getLogger("");
Handler[] handlers = logger.getHandlers();
RepeatRecordFilter filter = new RepeatRecordFilter(maxRepeat);
for (int ii = 0; ii < handlers.length; ii++) {
... | java | public static void configureDefaultHandler (int maxRepeat)
{
Logger logger = LogManager.getLogManager().getLogger("");
Handler[] handlers = logger.getHandlers();
RepeatRecordFilter filter = new RepeatRecordFilter(maxRepeat);
for (int ii = 0; ii < handlers.length; ii++) {
... | [
"public",
"static",
"void",
"configureDefaultHandler",
"(",
"int",
"maxRepeat",
")",
"{",
"Logger",
"logger",
"=",
"LogManager",
".",
"getLogManager",
"(",
")",
".",
"getLogger",
"(",
"\"\"",
")",
";",
"Handler",
"[",
"]",
"handlers",
"=",
"logger",
".",
"... | Configures the default logging handlers to use an instance of this
filter. | [
"Configures",
"the",
"default",
"logging",
"handlers",
"to",
"use",
"an",
"instance",
"of",
"this",
"filter",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/RepeatRecordFilter.java#L27-L35 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Log.java | Log.levelFromString | public static int levelFromString (String level)
{
if (level.equalsIgnoreCase("debug")) {
return DEBUG;
} else if (level.equalsIgnoreCase("info")) {
return INFO;
} else if (level.equalsIgnoreCase("warning")) {
return WARNING;
} else {
r... | java | public static int levelFromString (String level)
{
if (level.equalsIgnoreCase("debug")) {
return DEBUG;
} else if (level.equalsIgnoreCase("info")) {
return INFO;
} else if (level.equalsIgnoreCase("warning")) {
return WARNING;
} else {
r... | [
"public",
"static",
"int",
"levelFromString",
"(",
"String",
"level",
")",
"{",
"if",
"(",
"level",
".",
"equalsIgnoreCase",
"(",
"\"debug\"",
")",
")",
"{",
"return",
"DEBUG",
";",
"}",
"else",
"if",
"(",
"level",
".",
"equalsIgnoreCase",
"(",
"\"info\"",... | Returns the log level that matches the specified string or -1 if
the string could not be interpretted as a log level. | [
"Returns",
"the",
"log",
"level",
"that",
"matches",
"the",
"specified",
"string",
"or",
"-",
"1",
"if",
"the",
"string",
"could",
"not",
"be",
"interpretted",
"as",
"a",
"log",
"level",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Log.java#L162-L173 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/TermUtil.java | TermUtil.getSizeViaResize | protected static Dimension getSizeViaResize ()
{
BufferedReader bin = null;
try {
Process proc = Runtime.getRuntime().exec("resize");
InputStream in = proc.getInputStream();
bin = new BufferedReader(new InputStreamReader(in));
Pattern regex = Pattern.c... | java | protected static Dimension getSizeViaResize ()
{
BufferedReader bin = null;
try {
Process proc = Runtime.getRuntime().exec("resize");
InputStream in = proc.getInputStream();
bin = new BufferedReader(new InputStreamReader(in));
Pattern regex = Pattern.c... | [
"protected",
"static",
"Dimension",
"getSizeViaResize",
"(",
")",
"{",
"BufferedReader",
"bin",
"=",
"null",
";",
"try",
"{",
"Process",
"proc",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"exec",
"(",
"\"resize\"",
")",
";",
"InputStream",
"in",
"="... | Tries to obtain the terminal dimensions by running 'resize'. | [
"Tries",
"to",
"obtain",
"the",
"terminal",
"dimensions",
"by",
"running",
"resize",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/TermUtil.java#L88-L126 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/TermUtil.java | TermUtil.safeToInt | protected static int safeToInt (String intstr)
{
if (!StringUtil.isBlank(intstr)) {
try {
return Integer.parseInt(intstr);
} catch (NumberFormatException nfe) {
}
}
return -1;
} | java | protected static int safeToInt (String intstr)
{
if (!StringUtil.isBlank(intstr)) {
try {
return Integer.parseInt(intstr);
} catch (NumberFormatException nfe) {
}
}
return -1;
} | [
"protected",
"static",
"int",
"safeToInt",
"(",
"String",
"intstr",
")",
"{",
"if",
"(",
"!",
"StringUtil",
".",
"isBlank",
"(",
"intstr",
")",
")",
"{",
"try",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"intstr",
")",
";",
"}",
"catch",
"(",
"N... | Converts the string to an integer, returning -1 on any error. | [
"Converts",
"the",
"string",
"to",
"an",
"integer",
"returning",
"-",
"1",
"on",
"any",
"error",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/TermUtil.java#L129-L138 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Queue.java | Queue.append0 | protected void append0 (T item, boolean notify)
{
if (_count == _size) {
makeMoreRoom();
}
_items[_end] = item;
_end = (_end + 1) % _size;
_count++;
if (notify) {
notify();
}
} | java | protected void append0 (T item, boolean notify)
{
if (_count == _size) {
makeMoreRoom();
}
_items[_end] = item;
_end = (_end + 1) % _size;
_count++;
if (notify) {
notify();
}
} | [
"protected",
"void",
"append0",
"(",
"T",
"item",
",",
"boolean",
"notify",
")",
"{",
"if",
"(",
"_count",
"==",
"_size",
")",
"{",
"makeMoreRoom",
"(",
")",
";",
"}",
"_items",
"[",
"_end",
"]",
"=",
"item",
";",
"_end",
"=",
"(",
"_end",
"+",
"... | Internal append method. If subclassing queue, be sure to call
this method from inside a synchronized block. | [
"Internal",
"append",
"method",
".",
"If",
"subclassing",
"queue",
"be",
"sure",
"to",
"call",
"this",
"method",
"from",
"inside",
"a",
"synchronized",
"block",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Queue.java#L107-L119 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Queue.java | Queue.getNonBlocking | public synchronized T getNonBlocking ()
{
if (_count == 0) {
return null;
}
// pull the object off, and clear our reference to it
T retval = _items[_start];
_items[_start] = null;
_start = (_start + 1) % _size;
_count--;
return retval;
... | java | public synchronized T getNonBlocking ()
{
if (_count == 0) {
return null;
}
// pull the object off, and clear our reference to it
T retval = _items[_start];
_items[_start] = null;
_start = (_start + 1) % _size;
_count--;
return retval;
... | [
"public",
"synchronized",
"T",
"getNonBlocking",
"(",
")",
"{",
"if",
"(",
"_count",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"// pull the object off, and clear our reference to it",
"T",
"retval",
"=",
"_items",
"[",
"_start",
"]",
";",
"_items",
"[",... | Returns the next item on the queue or null if the queue is
empty. This method will not block waiting for an item to be added
to the queue. | [
"Returns",
"the",
"next",
"item",
"on",
"the",
"queue",
"or",
"null",
"if",
"the",
"queue",
"is",
"empty",
".",
"This",
"method",
"will",
"not",
"block",
"waiting",
"for",
"an",
"item",
"to",
"be",
"added",
"to",
"the",
"queue",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Queue.java#L126-L140 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Queue.java | Queue.get | public synchronized T get ()
{
while (_count == 0) {
try { wait(); } catch (InterruptedException e) {}
}
// pull the object off, and clear our reference to it
T retval = _items[_start];
_items[_start] = null;
_start = (_start + 1) % _size;
_count... | java | public synchronized T get ()
{
while (_count == 0) {
try { wait(); } catch (InterruptedException e) {}
}
// pull the object off, and clear our reference to it
T retval = _items[_start];
_items[_start] = null;
_start = (_start + 1) % _size;
_count... | [
"public",
"synchronized",
"T",
"get",
"(",
")",
"{",
"while",
"(",
"_count",
"==",
"0",
")",
"{",
"try",
"{",
"wait",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"}",
"}",
"// pull the object off, and clear our reference to it",
... | Gets the next item from the queue, blocking until an item is added
to the queue if the queue is empty at time of invocation. | [
"Gets",
"the",
"next",
"item",
"from",
"the",
"queue",
"blocking",
"until",
"an",
"item",
"is",
"added",
"to",
"the",
"queue",
"if",
"the",
"queue",
"is",
"empty",
"at",
"time",
"of",
"invocation",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Queue.java#L177-L195 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/Queue.java | Queue.shrink | private void shrink ()
{
T[] items = newArray(_size / 2);
if (_start > _end) {
// the data wraps around
System.arraycopy(_items, _start, items, 0, _size - _start);
System.arraycopy(_items, 0, items, _size - _start, _end + 1);
} else {
// the ... | java | private void shrink ()
{
T[] items = newArray(_size / 2);
if (_start > _end) {
// the data wraps around
System.arraycopy(_items, _start, items, 0, _size - _start);
System.arraycopy(_items, 0, items, _size - _start, _end + 1);
} else {
// the ... | [
"private",
"void",
"shrink",
"(",
")",
"{",
"T",
"[",
"]",
"items",
"=",
"newArray",
"(",
"_size",
"/",
"2",
")",
";",
"if",
"(",
"_start",
">",
"_end",
")",
"{",
"// the data wraps around",
"System",
".",
"arraycopy",
"(",
"_items",
",",
"_start",
"... | shrink by half | [
"shrink",
"by",
"half"
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Queue.java#L209-L227 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.addAll | @ReplacedBy("com.google.common.collect.Iterators#addAll(Collection, com.google.common.collect.Iterators#forEnumeration(Enumeration))")
public static <T, C extends Collection<T>> C addAll (C col, Enumeration<? extends T> enm)
{
while (enm.hasMoreElements()) {
col.add(enm.nextElement());
... | java | @ReplacedBy("com.google.common.collect.Iterators#addAll(Collection, com.google.common.collect.Iterators#forEnumeration(Enumeration))")
public static <T, C extends Collection<T>> C addAll (C col, Enumeration<? extends T> enm)
{
while (enm.hasMoreElements()) {
col.add(enm.nextElement());
... | [
"@",
"ReplacedBy",
"(",
"\"com.google.common.collect.Iterators#addAll(Collection, com.google.common.collect.Iterators#forEnumeration(Enumeration))\"",
")",
"public",
"static",
"<",
"T",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"C",
"addAll",
"(",
"C",
"col",
... | Adds all items returned by the enumeration to the supplied collection
and returns the supplied collection. | [
"Adds",
"all",
"items",
"returned",
"by",
"the",
"enumeration",
"to",
"the",
"supplied",
"collection",
"and",
"returns",
"the",
"supplied",
"collection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L30-L37 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.addAll | @ReplacedBy("com.google.common.collect.Iterators#addAll()")
public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter)
{
while (iter.hasNext()) {
col.add(iter.next());
}
return col;
} | java | @ReplacedBy("com.google.common.collect.Iterators#addAll()")
public static <T, C extends Collection<T>> C addAll (C col, Iterator<? extends T> iter)
{
while (iter.hasNext()) {
col.add(iter.next());
}
return col;
} | [
"@",
"ReplacedBy",
"(",
"\"com.google.common.collect.Iterators#addAll()\"",
")",
"public",
"static",
"<",
"T",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"C",
"addAll",
"(",
"C",
"col",
",",
"Iterator",
"<",
"?",
"extends",
"T",
">",
"iter",
")... | Adds all items returned by the iterator to the supplied collection and
returns the supplied collection. | [
"Adds",
"all",
"items",
"returned",
"by",
"the",
"iterator",
"to",
"the",
"supplied",
"collection",
"and",
"returns",
"the",
"supplied",
"collection",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L43-L50 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.addAll | @ReplacedBy("java.util.Collections#addAll()")
public static <T, E extends T, C extends Collection<T>> C addAll (C col, E[] values)
{
if (values != null) {
for (E value : values) {
col.add(value);
}
}
return col;
} | java | @ReplacedBy("java.util.Collections#addAll()")
public static <T, E extends T, C extends Collection<T>> C addAll (C col, E[] values)
{
if (values != null) {
for (E value : values) {
col.add(value);
}
}
return col;
} | [
"@",
"ReplacedBy",
"(",
"\"java.util.Collections#addAll()\"",
")",
"public",
"static",
"<",
"T",
",",
"E",
"extends",
"T",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"C",
"addAll",
"(",
"C",
"col",
",",
"E",
"[",
"]",
"values",
")",
"{",
... | Adds all items in the given object array to the supplied collection and
returns the supplied collection. If the supplied array is null, nothing
is added to the collection. | [
"Adds",
"all",
"items",
"in",
"the",
"given",
"object",
"array",
"to",
"the",
"supplied",
"collection",
"and",
"returns",
"the",
"supplied",
"collection",
".",
"If",
"the",
"supplied",
"array",
"is",
"null",
"nothing",
"is",
"added",
"to",
"the",
"collection... | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L57-L66 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.addAll | public static <T, C extends Collection<T>> C addAll (
C col, Iterable<? extends Collection<? extends T>> values)
{
for (Collection<? extends T> val : values) {
col.addAll(val);
}
return col;
} | java | public static <T, C extends Collection<T>> C addAll (
C col, Iterable<? extends Collection<? extends T>> values)
{
for (Collection<? extends T> val : values) {
col.addAll(val);
}
return col;
} | [
"public",
"static",
"<",
"T",
",",
"C",
"extends",
"Collection",
"<",
"T",
">",
">",
"C",
"addAll",
"(",
"C",
"col",
",",
"Iterable",
"<",
"?",
"extends",
"Collection",
"<",
"?",
"extends",
"T",
">",
">",
"values",
")",
"{",
"for",
"(",
"Collection... | Folds all the specified values into the supplied collection and returns it. | [
"Folds",
"all",
"the",
"specified",
"values",
"into",
"the",
"supplied",
"collection",
"and",
"returns",
"it",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L71-L78 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/CollectionUtil.java | CollectionUtil.putAll | public static <K, V, M extends Map<K, V>> M putAll (
M map, Iterable<? extends Map<? extends K, ? extends V>> values)
{
for (Map<? extends K, ? extends V> val : values) {
map.putAll(val);
}
return map;
} | java | public static <K, V, M extends Map<K, V>> M putAll (
M map, Iterable<? extends Map<? extends K, ? extends V>> values)
{
for (Map<? extends K, ? extends V> val : values) {
map.putAll(val);
}
return map;
} | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"M",
"extends",
"Map",
"<",
"K",
",",
"V",
">",
">",
"M",
"putAll",
"(",
"M",
"map",
",",
"Iterable",
"<",
"?",
"extends",
"Map",
"<",
"?",
"extends",
"K",
",",
"?",
"extends",
"V",
">",
">",
"valu... | Folds all the specified values into the supplied map and returns it. | [
"Folds",
"all",
"the",
"specified",
"values",
"into",
"the",
"supplied",
"map",
"and",
"returns",
"it",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/CollectionUtil.java#L83-L90 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.parametersAreDefined | public void parametersAreDefined(Report report) throws ParameterNotFoundException {
String[] paramNames;
String sql = report.getSql();
if (sql == null) {
sql = report.getQuery().toString();
}
Query query = new Query(sql);
paramNames = query.getParameterNames()... | java | public void parametersAreDefined(Report report) throws ParameterNotFoundException {
String[] paramNames;
String sql = report.getSql();
if (sql == null) {
sql = report.getQuery().toString();
}
Query query = new Query(sql);
paramNames = query.getParameterNames()... | [
"public",
"void",
"parametersAreDefined",
"(",
"Report",
"report",
")",
"throws",
"ParameterNotFoundException",
"{",
"String",
"[",
"]",
"paramNames",
";",
"String",
"sql",
"=",
"report",
".",
"getSql",
"(",
")",
";",
"if",
"(",
"sql",
"==",
"null",
")",
"... | Test if all parameters used in the report are defined
@param report report object
@throws ParameterNotFoundException if a parameter used in the report is not defined | [
"Test",
"if",
"all",
"parameters",
"used",
"in",
"the",
"report",
"are",
"defined"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L81-L103 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getRuntimeParameterValues | public static List<IdName> getRuntimeParameterValues(Connection con, QueryParameter qp, Map<String, QueryParameter> map,
Map<String, Object> vals) throws Exception {
List<IdName> values = new ArrayList<IdName>();
if (qp.isManualSource(... | java | public static List<IdName> getRuntimeParameterValues(Connection con, QueryParameter qp, Map<String, QueryParameter> map,
Map<String, Object> vals) throws Exception {
List<IdName> values = new ArrayList<IdName>();
if (qp.isManualSource(... | [
"public",
"static",
"List",
"<",
"IdName",
">",
"getRuntimeParameterValues",
"(",
"Connection",
"con",
",",
"QueryParameter",
"qp",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"vals",
")",
"t... | Get values for a parameter sql at runtime
All parent parameters must have the values in the map.
@param con database connection
@param qp parameter
@param map report map of parameters
@param vals map of parameter values
@return values for parameter with sql source
@throws Exception if an exception occurs | [
"Get",
"values",
"for",
"a",
"parameter",
"sql",
"at",
"runtime",
"All",
"parent",
"parameters",
"must",
"have",
"the",
"values",
"in",
"the",
"map",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L353-L404 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterValues | public static List<IdName> getParameterValues(Connection con, QueryParameter qp, Map<String, QueryParameter> map,
Map<String, Serializable> vals) throws Exception {
Map<String, Object> objVals = new HashMap<String, Object>();
for (String key :... | java | public static List<IdName> getParameterValues(Connection con, QueryParameter qp, Map<String, QueryParameter> map,
Map<String, Serializable> vals) throws Exception {
Map<String, Object> objVals = new HashMap<String, Object>();
for (String key :... | [
"public",
"static",
"List",
"<",
"IdName",
">",
"getParameterValues",
"(",
"Connection",
"con",
",",
"QueryParameter",
"qp",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
",",
"Map",
"<",
"String",
",",
"Serializable",
">",
"vals",
")",
"th... | Get values for a dependent parameter sql
All parent parameters must have the values in the map.
@param con database connection
@param qp parameter
@param map report map of parameters
@param vals map of parameter values
@return values for parameter with sql source
@throws Exception if an exception occurs | [
"Get",
"values",
"for",
"a",
"dependent",
"parameter",
"sql",
"All",
"parent",
"parameters",
"must",
"have",
"the",
"values",
"in",
"the",
"map",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L418-L467 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getDefaultSourceValues | public static ArrayList<Serializable> getDefaultSourceValues(Connection con, QueryParameter qp) throws Exception {
ArrayList<Serializable> result = new ArrayList<Serializable>();
List<IdName> list = getSelectValues(con, qp.getDefaultSource(), false, QueryParameter.NO_ORDER);
if (QueryPar... | java | public static ArrayList<Serializable> getDefaultSourceValues(Connection con, QueryParameter qp) throws Exception {
ArrayList<Serializable> result = new ArrayList<Serializable>();
List<IdName> list = getSelectValues(con, qp.getDefaultSource(), false, QueryParameter.NO_ORDER);
if (QueryPar... | [
"public",
"static",
"ArrayList",
"<",
"Serializable",
">",
"getDefaultSourceValues",
"(",
"Connection",
"con",
",",
"QueryParameter",
"qp",
")",
"throws",
"Exception",
"{",
"ArrayList",
"<",
"Serializable",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Serializabl... | Get values for a default source
@param con connection
@param qp parameter
@return a list of default values
@throws Exception if select failes | [
"Get",
"values",
"for",
"a",
"default",
"source"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L477-L490 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedNotHiddenParametersMap | public static Map<String, QueryParameter> getUsedNotHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, false);
} | java | public static Map<String, QueryParameter> getUsedNotHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, false);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedNotHiddenParametersMap",
"(",
"Report",
"report",
")",
"{",
"return",
"getUsedParametersMap",
"(",
"report",
",",
"false",
",",
"false",
")",
";",
"}"
] | Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will not contain the hidden parameters.
@param report next report object
@return used not-hidden parameters map | [
"Get",
"used",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
"defined",
... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L655-L657 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedHiddenParametersMap | public static Map<String, QueryParameter> getUsedHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, true);
} | java | public static Map<String, QueryParameter> getUsedHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, true);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedHiddenParametersMap",
"(",
"Report",
"report",
")",
"{",
"return",
"getUsedParametersMap",
"(",
"report",
",",
"false",
",",
"true",
")",
";",
"}"
] | Get used hidden parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain only the hidden parameters.
@param report next report object
@return used hidden parameters map | [
"Get",
"used",
"hidden",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L667-L669 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedParametersMap | public static Map<String, QueryParameter> getUsedParametersMap(Query query, Map<String, QueryParameter> allParameters) {
Set<String> paramNames = new HashSet<String>(Arrays.asList(query.getParameterNames()));
for (QueryParameter p : allParameters.values()) {
paramNames.addAll(p.ge... | java | public static Map<String, QueryParameter> getUsedParametersMap(Query query, Map<String, QueryParameter> allParameters) {
Set<String> paramNames = new HashSet<String>(Arrays.asList(query.getParameterNames()));
for (QueryParameter p : allParameters.values()) {
paramNames.addAll(p.ge... | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedParametersMap",
"(",
"Query",
"query",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"allParameters",
")",
"{",
"Set",
"<",
"String",
">",
"paramNames",
"=",
"new",
"HashS... | Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain also the hidden parameters and all parameters used just inside other parameters.
@param query query objec... | [
"Get",
"used",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
"defined",
... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L729-L749 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedParametersMap | public static Map<String, QueryParameter> getUsedParametersMap(String sql, Map<String, QueryParameter> allParameters) {
Query query = new Query(sql);
return getUsedParametersMap(query, allParameters);
} | java | public static Map<String, QueryParameter> getUsedParametersMap(String sql, Map<String, QueryParameter> allParameters) {
Query query = new Query(sql);
return getUsedParametersMap(query, allParameters);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedParametersMap",
"(",
"String",
"sql",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"allParameters",
")",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
"sql",
")",
";... | Get used parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain also the hidden parameters.
@param sql sql
@param allParameters parameters map
@return used parameters ... | [
"Get",
"used",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
"defined",
... | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L789-L792 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.allParametersAreHidden | public static boolean allParametersAreHidden(Map<String, QueryParameter> map) {
for (QueryParameter qp : map.values()) {
if (!qp.isHidden()) {
return false;
}
}
return true;
} | java | public static boolean allParametersAreHidden(Map<String, QueryParameter> map) {
for (QueryParameter qp : map.values()) {
if (!qp.isHidden()) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"allParametersAreHidden",
"(",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
")",
"{",
"for",
"(",
"QueryParameter",
"qp",
":",
"map",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"!",
"qp",
".",
"isHidden",
"... | See if all parameters are hidden
@param map map of parameters
@return true if all parameters are hidden | [
"See",
"if",
"all",
"parameters",
"are",
"hidden"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L801-L808 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.allParametersHaveDefaults | public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) {
for (QueryParameter qp : map.values()) {
if ((qp.getDefaultValues() == null) || (qp.getDefaultValues().size() == 0)) {
if ((qp.getDefaultSource() == null) || "".equals(qp.getDefaultSource().trim())) {
... | java | public static boolean allParametersHaveDefaults(Map<String, QueryParameter> map) {
for (QueryParameter qp : map.values()) {
if ((qp.getDefaultValues() == null) || (qp.getDefaultValues().size() == 0)) {
if ((qp.getDefaultSource() == null) || "".equals(qp.getDefaultSource().trim())) {
... | [
"public",
"static",
"boolean",
"allParametersHaveDefaults",
"(",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
")",
"{",
"for",
"(",
"QueryParameter",
"qp",
":",
"map",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"(",
"qp",
".",
"getDefaultV... | See if all parameters have default values
@param map map of parameters
@return true if all parameters have default values | [
"See",
"if",
"all",
"parameters",
"have",
"default",
"values"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L816-L825 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.initAllRuntimeParameterValues | public static void initAllRuntimeParameterValues(QueryParameter param,
List<IdName> values, Map<String, Object> parameterValues) throws QueryException {
if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
parameterValues.put(param.ge... | java | public static void initAllRuntimeParameterValues(QueryParameter param,
List<IdName> values, Map<String, Object> parameterValues) throws QueryException {
if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
parameterValues.put(param.ge... | [
"public",
"static",
"void",
"initAllRuntimeParameterValues",
"(",
"QueryParameter",
"param",
",",
"List",
"<",
"IdName",
">",
"values",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"throws",
"QueryException",
"{",
"if",
"(",
"param",
... | Init parameter values map with all the values
@param param parameter
@param values all parameter values
@param parameterValues map of parameter values
@throws QueryException if could not get parameter values | [
"Init",
"parameter",
"values",
"map",
"with",
"all",
"the",
"values"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L835-L847 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.initDefaultParameterValues | public static void initDefaultParameterValues(QueryParameter param,
List<Serializable> defValues, Map<String, Object> parameterValues) throws QueryException {
if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
parameterValues.put(pa... | java | public static void initDefaultParameterValues(QueryParameter param,
List<Serializable> defValues, Map<String, Object> parameterValues) throws QueryException {
if (param.getSelection().equals(QueryParameter.SINGLE_SELECTION)) {
parameterValues.put(pa... | [
"public",
"static",
"void",
"initDefaultParameterValues",
"(",
"QueryParameter",
"param",
",",
"List",
"<",
"Serializable",
">",
"defValues",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"throws",
"QueryException",
"{",
"if",
"(",
"para... | Init parameter values map with the default values
@param param parameter
@param defValues default values
@param parameterValues map of parameter values
@throws QueryException if could not get default parameter values | [
"Init",
"parameter",
"values",
"map",
"with",
"the",
"default",
"values"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L857-L869 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.initStaticDefaultParameterValues | public static void initStaticDefaultParameterValues(QueryParameter param,
Map<String, Object> parameterValues) throws QueryException {
List<Serializable> defValues;
if ((param.getDefaultValues() != null) && (param.getDefaultValues().size() > 0)) {
... | java | public static void initStaticDefaultParameterValues(QueryParameter param,
Map<String, Object> parameterValues) throws QueryException {
List<Serializable> defValues;
if ((param.getDefaultValues() != null) && (param.getDefaultValues().size() > 0)) {
... | [
"public",
"static",
"void",
"initStaticDefaultParameterValues",
"(",
"QueryParameter",
"param",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"throws",
"QueryException",
"{",
"List",
"<",
"Serializable",
">",
"defValues",
";",
"if",
"(",
... | Init parameter values map with the static default values of a parameter
@param param parameter
@param parameterValues map of parameter values
@throws QueryException if could not get default parameter values | [
"Init",
"parameter",
"values",
"map",
"with",
"the",
"static",
"default",
"values",
"of",
"a",
"parameter"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L900-L911 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.initAllRuntimeParameterValues | public static void initAllRuntimeParameterValues(Connection conn, QueryParameter param, Map<String,QueryParameter> map,
Map<String, Object> parameterValues) throws QueryException {
List<IdName> allValues = new ArrayList<IdName>();
if ((param.getSou... | java | public static void initAllRuntimeParameterValues(Connection conn, QueryParameter param, Map<String,QueryParameter> map,
Map<String, Object> parameterValues) throws QueryException {
List<IdName> allValues = new ArrayList<IdName>();
if ((param.getSou... | [
"public",
"static",
"void",
"initAllRuntimeParameterValues",
"(",
"Connection",
"conn",
",",
"QueryParameter",
"param",
",",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"throws",... | Init parameter values map with all the values from select source of a parameter at runtime
@param conn database connection
@param param parameter
@param map report map of parameters
@param parameterValues map of parameter values
@throws QueryException if could not get parameter values | [
"Init",
"parameter",
"values",
"map",
"with",
"all",
"the",
"values",
"from",
"select",
"source",
"of",
"a",
"parameter",
"at",
"runtime"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L945-L957 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.initStaticNotHiddenDefaultParameterValues | public static void initStaticNotHiddenDefaultParameterValues(Report report,
Map<String, Object> parameterValues) throws QueryException {
Map<String, QueryParameter> params = getUsedParametersMap(report);
for (QueryParameter qp : params.values())... | java | public static void initStaticNotHiddenDefaultParameterValues(Report report,
Map<String, Object> parameterValues) throws QueryException {
Map<String, QueryParameter> params = getUsedParametersMap(report);
for (QueryParameter qp : params.values())... | [
"public",
"static",
"void",
"initStaticNotHiddenDefaultParameterValues",
"(",
"Report",
"report",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"throws",
"QueryException",
"{",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"params",
"=... | Init parameter values map with the static default values for all not-hidden parameters of a report
@param report report
@param parameterValues map of parameter values
@throws QueryException if could not get default parameter values | [
"Init",
"parameter",
"values",
"map",
"with",
"the",
"static",
"default",
"values",
"for",
"all",
"not",
"-",
"hidden",
"parameters",
"of",
"a",
"report"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L989-L997 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.toMap | public static Map<String, QueryParameter> toMap(List<QueryParameter> parameters) {
Map<String, QueryParameter> map = new HashMap<String, QueryParameter>();
for (QueryParameter qp : parameters) {
map.put(qp.getName(), qp);
}
return map;
} | java | public static Map<String, QueryParameter> toMap(List<QueryParameter> parameters) {
Map<String, QueryParameter> map = new HashMap<String, QueryParameter>();
for (QueryParameter qp : parameters) {
map.put(qp.getName(), qp);
}
return map;
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"toMap",
"(",
"List",
"<",
"QueryParameter",
">",
"parameters",
")",
"{",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"QueryParame... | Convert a list of QueryParameter object to a map where the key is the parameter name
and the value is the parameter
@param parameters list of parameters
@return map of parameters | [
"Convert",
"a",
"list",
"of",
"QueryParameter",
"object",
"to",
"a",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1040-L1046 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getParameterValueFromStringWithPattern | public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception {
if (pattern == null) {
return getParameterValueFromString(parameterClass, value);
} else {
if (QueryParameter.DATE_VALUE.equals(parameterClass) ||
QueryParameter.TIME... | java | public static Object getParameterValueFromStringWithPattern(String parameterClass, String value, String pattern) throws Exception {
if (pattern == null) {
return getParameterValueFromString(parameterClass, value);
} else {
if (QueryParameter.DATE_VALUE.equals(parameterClass) ||
QueryParameter.TIME... | [
"public",
"static",
"Object",
"getParameterValueFromStringWithPattern",
"(",
"String",
"parameterClass",
",",
"String",
"value",
",",
"String",
"pattern",
")",
"throws",
"Exception",
"{",
"if",
"(",
"pattern",
"==",
"null",
")",
"{",
"return",
"getParameterValueFrom... | Get parameter value from a string represenation using a pattern
@param parameterClass parameter class
@param value string value representation
@param pattern value pattern
@return parameter value from string representation using pattern
@throws Exception if string value cannot be parse | [
"Get",
"parameter",
"value",
"from",
"a",
"string",
"represenation",
"using",
"a",
"pattern"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1067-L1081 | train |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.intersectParametersMap | public static Map<String, QueryParameter> intersectParametersMap(List<Report> reports) {
Map<String, QueryParameter> map = new LinkedHashMap<String, QueryParameter>();
if ((reports == null) || (reports.size() == 0)) {
return map;
}
if (reports.size() == 1) {
return getUsedParametersMap(r... | java | public static Map<String, QueryParameter> intersectParametersMap(List<Report> reports) {
Map<String, QueryParameter> map = new LinkedHashMap<String, QueryParameter>();
if ((reports == null) || (reports.size() == 0)) {
return map;
}
if (reports.size() == 1) {
return getUsedParametersMap(r... | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"intersectParametersMap",
"(",
"List",
"<",
"Report",
">",
"reports",
")",
"{",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"map",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
... | Get a map with all the identical parameters for a list of reports
@param reports list of reports
@return a map with all the identical parameters for a list of reports
see QueryParameter.compare(Object o) | [
"Get",
"a",
"map",
"with",
"all",
"the",
"identical",
"parameters",
"for",
"a",
"list",
"of",
"reports"
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L1158-L1178 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsibleList.java | CollapsibleList.addSection | public int addSection (String label, ListModel model)
{
add(new JLabel(label));
add(new JList(model));
return getSectionCount()-1;
} | java | public int addSection (String label, ListModel model)
{
add(new JLabel(label));
add(new JList(model));
return getSectionCount()-1;
} | [
"public",
"int",
"addSection",
"(",
"String",
"label",
",",
"ListModel",
"model",
")",
"{",
"add",
"(",
"new",
"JLabel",
"(",
"label",
")",
")",
";",
"add",
"(",
"new",
"JList",
"(",
"model",
")",
")",
";",
"return",
"getSectionCount",
"(",
")",
"-",... | Adds a section to this collapsible list.
@param label the title of the section.
@param model the list model to use for the new section.
@return the index of the newly added section. | [
"Adds",
"a",
"section",
"to",
"this",
"collapsible",
"list",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L64-L69 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsibleList.java | CollapsibleList.getSectionList | public JList getSectionList (int index)
{
@SuppressWarnings("unchecked") JList list = (JList)getComponent(index*2+1);
return list;
} | java | public JList getSectionList (int index)
{
@SuppressWarnings("unchecked") JList list = (JList)getComponent(index*2+1);
return list;
} | [
"public",
"JList",
"getSectionList",
"(",
"int",
"index",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"JList",
"list",
"=",
"(",
"JList",
")",
"getComponent",
"(",
"index",
"*",
"2",
"+",
"1",
")",
";",
"return",
"list",
";",
"}"
] | Returns the list object associated with the specified section. | [
"Returns",
"the",
"list",
"object",
"associated",
"with",
"the",
"specified",
"section",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L83-L87 | train |
samskivert/samskivert | src/main/java/com/samskivert/swing/CollapsibleList.java | CollapsibleList.toggleCollapsed | public void toggleCollapsed (int index)
{
JList list = getSectionList(index);
list.setVisible(!list.isVisible());
} | java | public void toggleCollapsed (int index)
{
JList list = getSectionList(index);
list.setVisible(!list.isVisible());
} | [
"public",
"void",
"toggleCollapsed",
"(",
"int",
"index",
")",
"{",
"JList",
"list",
"=",
"getSectionList",
"(",
"index",
")",
";",
"list",
".",
"setVisible",
"(",
"!",
"list",
".",
"isVisible",
"(",
")",
")",
";",
"}"
] | Toggles the collapsed state of the specified section. | [
"Toggles",
"the",
"collapsed",
"state",
"of",
"the",
"specified",
"section",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/CollapsibleList.java#L92-L96 | train |
samskivert/samskivert | src/main/java/com/samskivert/util/MethodFinder.java | MethodFinder.findConstructor | public Constructor<?> findConstructor (Class<?>[] parameterTypes)
throws NoSuchMethodException
{
// make sure the constructor list is loaded
maybeLoadConstructors();
if (parameterTypes == null) {
parameterTypes = new Class<?>[0];
}
return (Constructor<?>... | java | public Constructor<?> findConstructor (Class<?>[] parameterTypes)
throws NoSuchMethodException
{
// make sure the constructor list is loaded
maybeLoadConstructors();
if (parameterTypes == null) {
parameterTypes = new Class<?>[0];
}
return (Constructor<?>... | [
"public",
"Constructor",
"<",
"?",
">",
"findConstructor",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"throws",
"NoSuchMethodException",
"{",
"// make sure the constructor list is loaded",
"maybeLoadConstructors",
"(",
")",
";",
"if",
"(",
"parame... | Returns the most specific public constructor in my target class that accepts the number and
type of parameters in the given Class array in a reflective invocation.
<p> A null value or Void.TYPE parameterTypes matches a corresponding Object or array
reference in a constructor's formal parameter list, but not a primitiv... | [
"Returns",
"the",
"most",
"specific",
"public",
"constructor",
"in",
"my",
"target",
"class",
"that",
"accepts",
"the",
"number",
"and",
"type",
"of",
"parameters",
"in",
"the",
"given",
"Class",
"array",
"in",
"a",
"reflective",
"invocation",
"."
] | a64d9ef42b69819bdb2c66bddac6a64caef928b6 | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/MethodFinder.java#L80-L91 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.