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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
stephenc/redmine-java-api | src/main/java/org/redmine/ta/RedmineManager.java | RedmineManager.unwrapIO | private void unwrapIO(RedmineException orig, String tag) throws IOException {
Throwable e = orig;
while (e != null) {
if (e instanceof MarkedIOException) {
final MarkedIOException marked = (MarkedIOException) e;
if (tag.equals(marked.getTag()))
throw marked.getIOException();
}
e = e.getCause()... | java | private void unwrapIO(RedmineException orig, String tag) throws IOException {
Throwable e = orig;
while (e != null) {
if (e instanceof MarkedIOException) {
final MarkedIOException marked = (MarkedIOException) e;
if (tag.equals(marked.getTag()))
throw marked.getIOException();
}
e = e.getCause()... | [
"private",
"void",
"unwrapIO",
"(",
"RedmineException",
"orig",
",",
"String",
"tag",
")",
"throws",
"IOException",
"{",
"Throwable",
"e",
"=",
"orig",
";",
"while",
"(",
"e",
"!=",
"null",
")",
"{",
"if",
"(",
"e",
"instanceof",
"MarkedIOException",
")",
... | Unwraps an IO.
@param e
exception to unwrap.
@param tag
target tag.
@throws IOException
@throws RedmineException | [
"Unwraps",
"an",
"IO",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/RedmineManager.java#L721-L731 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/RedmineManager.java | RedmineManager.addMembership | public void addMembership(Membership membership) throws RedmineException {
final Project project = membership.getProject();
if (project == null)
throw new IllegalArgumentException("Project must be set");
if (membership.getUser() == null)
throw new IllegalArgumentException("User must be set");
transport.ad... | java | public void addMembership(Membership membership) throws RedmineException {
final Project project = membership.getProject();
if (project == null)
throw new IllegalArgumentException("Project must be set");
if (membership.getUser() == null)
throw new IllegalArgumentException("User must be set");
transport.ad... | [
"public",
"void",
"addMembership",
"(",
"Membership",
"membership",
")",
"throws",
"RedmineException",
"{",
"final",
"Project",
"project",
"=",
"membership",
".",
"getProject",
"(",
")",
";",
"if",
"(",
"project",
"==",
"null",
")",
"throw",
"new",
"IllegalArg... | Add a membership.
@param membership
membership.
@throws RedmineException | [
"Add",
"a",
"membership",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/RedmineManager.java#L807-L815 | train |
Systemdir/GML-Writer-for-yED | GMLWriter/src/com/github/systemdir/gml/YedGmlWriter.java | YedGmlWriter.export | public void export(Writer output, UndirectedGraph<V, E> g) {
export(output, g, false);
} | java | public void export(Writer output, UndirectedGraph<V, E> g) {
export(output, g, false);
} | [
"public",
"void",
"export",
"(",
"Writer",
"output",
",",
"UndirectedGraph",
"<",
"V",
",",
"E",
">",
"g",
")",
"{",
"export",
"(",
"output",
",",
"g",
",",
"false",
")",
";",
"}"
] | Exports an undirected graph into a PLAIN text file in GML format.
@param output the writer to which the graph to be exported
@param g the undirected graph to be exported | [
"Exports",
"an",
"undirected",
"graph",
"into",
"a",
"PLAIN",
"text",
"file",
"in",
"GML",
"format",
"."
] | 353ecf132929889cb15968865283ee511f7c8d87 | https://github.com/Systemdir/GML-Writer-for-yED/blob/353ecf132929889cb15968865283ee511f7c8d87/GMLWriter/src/com/github/systemdir/gml/YedGmlWriter.java#L407-L409 | train |
Systemdir/GML-Writer-for-yED | GMLWriter/src/com/github/systemdir/gml/YedGmlWriter.java | YedGmlWriter.export | public void export(Writer output, DirectedGraph<V, E> g) {
export(output, g, true);
} | java | public void export(Writer output, DirectedGraph<V, E> g) {
export(output, g, true);
} | [
"public",
"void",
"export",
"(",
"Writer",
"output",
",",
"DirectedGraph",
"<",
"V",
",",
"E",
">",
"g",
")",
"{",
"export",
"(",
"output",
",",
"g",
",",
"true",
")",
";",
"}"
] | Exports a directed graph into a PLAIN text file in GML format.
@param output the writer to which the graph to be exported
@param g the directed graph to be exported | [
"Exports",
"a",
"directed",
"graph",
"into",
"a",
"PLAIN",
"text",
"file",
"in",
"GML",
"format",
"."
] | 353ecf132929889cb15968865283ee511f7c8d87 | https://github.com/Systemdir/GML-Writer-for-yED/blob/353ecf132929889cb15968865283ee511f7c8d87/GMLWriter/src/com/github/systemdir/gml/YedGmlWriter.java#L417-L419 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java | StringsCompleter2.set | public void set(final Iterable<String> strings) {
checkNotNull(strings);
candidates.clear();
addAll(strings);
} | java | public void set(final Iterable<String> strings) {
checkNotNull(strings);
candidates.clear();
addAll(strings);
} | [
"public",
"void",
"set",
"(",
"final",
"Iterable",
"<",
"String",
">",
"strings",
")",
"{",
"checkNotNull",
"(",
"strings",
")",
";",
"candidates",
".",
"clear",
"(",
")",
";",
"addAll",
"(",
"strings",
")",
";",
"}"
] | Set completion strings; replacing any existing. | [
"Set",
"completion",
"strings",
";",
"replacing",
"any",
"existing",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java#L57-L61 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java | StringsCompleter2.addAll | public void addAll(final Iterable<String> strings) {
checkNotNull(strings);
for (String string : strings) {
add(string);
}
} | java | public void addAll(final Iterable<String> strings) {
checkNotNull(strings);
for (String string : strings) {
add(string);
}
} | [
"public",
"void",
"addAll",
"(",
"final",
"Iterable",
"<",
"String",
">",
"strings",
")",
"{",
"checkNotNull",
"(",
"strings",
")",
";",
"for",
"(",
"String",
"string",
":",
"strings",
")",
"{",
"add",
"(",
"string",
")",
";",
"}",
"}"
] | Add all strings to existing candidates. | [
"Add",
"all",
"strings",
"to",
"existing",
"candidates",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java#L66-L71 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java | StringsCompleter2.add | public void add(final String string) {
checkNotNull(string);
candidates.put(string, candidate(string));
} | java | public void add(final String string) {
checkNotNull(string);
candidates.put(string, candidate(string));
} | [
"public",
"void",
"add",
"(",
"final",
"String",
"string",
")",
"{",
"checkNotNull",
"(",
"string",
")",
";",
"candidates",
".",
"put",
"(",
"string",
",",
"candidate",
"(",
"string",
")",
")",
";",
"}"
] | Add a string to existing candidates. | [
"Add",
"a",
"string",
"to",
"existing",
"candidates",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java#L84-L87 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java | StringsCompleter2.add | public void add(final String string, final Candidate candidate) {
checkNotNull(string);
checkNotNull(candidate);
candidates.put(string, candidate);
} | java | public void add(final String string, final Candidate candidate) {
checkNotNull(string);
checkNotNull(candidate);
candidates.put(string, candidate);
} | [
"public",
"void",
"add",
"(",
"final",
"String",
"string",
",",
"final",
"Candidate",
"candidate",
")",
"{",
"checkNotNull",
"(",
"string",
")",
";",
"checkNotNull",
"(",
"candidate",
")",
";",
"candidates",
".",
"put",
"(",
"string",
",",
"candidate",
")"... | Add string with specific completer. | [
"Add",
"string",
"with",
"specific",
"completer",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/jline/StringsCompleter2.java#L100-L104 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/PathSequence.java | PathSequence.initNextPath | protected void initNextPath (long initStamp, long tickStamp)
{
if (_paths.size() == 0) {
_pable.pathCompleted(tickStamp);
} else {
_curPath = _paths.remove(0);
_lastInit = initStamp;
_curPath.init(_pableRep, initStamp);
_curPath.tick(_pab... | java | protected void initNextPath (long initStamp, long tickStamp)
{
if (_paths.size() == 0) {
_pable.pathCompleted(tickStamp);
} else {
_curPath = _paths.remove(0);
_lastInit = initStamp;
_curPath.init(_pableRep, initStamp);
_curPath.tick(_pab... | [
"protected",
"void",
"initNextPath",
"(",
"long",
"initStamp",
",",
"long",
"tickStamp",
")",
"{",
"if",
"(",
"_paths",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"_pable",
".",
"pathCompleted",
"(",
"tickStamp",
")",
";",
"}",
"else",
"{",
"_curPath"... | Initialize and start the next path in the sequence. | [
"Initialize",
"and",
"start",
"the",
"next",
"path",
"in",
"the",
"sequence",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/PathSequence.java#L120-L132 | train |
vdurmont/etaprinter | src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java | ETAStatusGenerator.getStatus | public static String getStatus(String elementName, long percentage, double speed, String speedUnit, Duration eta) {
StringBuilder sb = new StringBuilder(getBar(percentage));
sb.append((long) speed);
if (elementName != null) {
sb.append(" ").append(elementName);
}
sb.a... | java | public static String getStatus(String elementName, long percentage, double speed, String speedUnit, Duration eta) {
StringBuilder sb = new StringBuilder(getBar(percentage));
sb.append((long) speed);
if (elementName != null) {
sb.append(" ").append(elementName);
}
sb.a... | [
"public",
"static",
"String",
"getStatus",
"(",
"String",
"elementName",
",",
"long",
"percentage",
",",
"double",
"speed",
",",
"String",
"speedUnit",
",",
"Duration",
"eta",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"getBar",
"(",
... | Generate the full status.
@param elementName the optional name of the element that is processed
@param percentage the progression percentage
@param speed the speed of the processing (in number of element by speed unit)
@param speedUnit the unit of the given speed
@param eta the estimated remaining dur... | [
"Generate",
"the",
"full",
"status",
"."
] | 19039bdbbece8b05ceab2a23757f4e1e8b6872cb | https://github.com/vdurmont/etaprinter/blob/19039bdbbece8b05ceab2a23757f4e1e8b6872cb/src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java#L46-L55 | train |
vdurmont/etaprinter | src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java | ETAStatusGenerator.getBar | protected static String getBar(long percentage) {
StringBuilder sb = new StringBuilder();
sb.append(percentage);
sb.append("% [");
for (int i = 0; i < 100; i++) {
if (percentage == 100 || i < percentage - 1) {
sb.append("=");
} else if (i == percen... | java | protected static String getBar(long percentage) {
StringBuilder sb = new StringBuilder();
sb.append(percentage);
sb.append("% [");
for (int i = 0; i < 100; i++) {
if (percentage == 100 || i < percentage - 1) {
sb.append("=");
} else if (i == percen... | [
"protected",
"static",
"String",
"getBar",
"(",
"long",
"percentage",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"percentage",
")",
";",
"sb",
".",
"append",
"(",
"\"% [\"",
")",
";",
"for",
"... | Generates the progress bar for the given percentage
@param percentage the progression percentage
@return the progress bar as a string | [
"Generates",
"the",
"progress",
"bar",
"for",
"the",
"given",
"percentage"
] | 19039bdbbece8b05ceab2a23757f4e1e8b6872cb | https://github.com/vdurmont/etaprinter/blob/19039bdbbece8b05ceab2a23757f4e1e8b6872cb/src/main/java/com/vdurmont/etaprinter/ETAStatusGenerator.java#L64-L79 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/impl/WebSocketHandlerAdapter.java | WebSocketHandlerAdapter.processConnect | @Override
public void processConnect(WebSocketChannel channel, WSURI location, String[] protocols) {
nextHandler.processConnect(channel, location, protocols);
} | java | @Override
public void processConnect(WebSocketChannel channel, WSURI location, String[] protocols) {
nextHandler.processConnect(channel, location, protocols);
} | [
"@",
"Override",
"public",
"void",
"processConnect",
"(",
"WebSocketChannel",
"channel",
",",
"WSURI",
"location",
",",
"String",
"[",
"]",
"protocols",
")",
"{",
"nextHandler",
".",
"processConnect",
"(",
"channel",
",",
"location",
",",
"protocols",
")",
";"... | Process connect request to uri and protocol specified | [
"Process",
"connect",
"request",
"to",
"uri",
"and",
"protocol",
"specified"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/WebSocketHandlerAdapter.java#L29-L32 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/impl/WebSocketHandlerAdapter.java | WebSocketHandlerAdapter.processAuthorize | @Override
public synchronized void processAuthorize(WebSocketChannel channel, String authorizeToken) {
nextHandler.processAuthorize(channel, authorizeToken);
} | java | @Override
public synchronized void processAuthorize(WebSocketChannel channel, String authorizeToken) {
nextHandler.processAuthorize(channel, authorizeToken);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"processAuthorize",
"(",
"WebSocketChannel",
"channel",
",",
"String",
"authorizeToken",
")",
"{",
"nextHandler",
".",
"processAuthorize",
"(",
"channel",
",",
"authorizeToken",
")",
";",
"}"
] | Send authorize token to the Gateway | [
"Send",
"authorize",
"token",
"to",
"the",
"Gateway"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/WebSocketHandlerAdapter.java#L37-L40 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/v1/xdr/ToXdr.java | ToXdr.data | public tsfile_data data(TimeSeriesCollection ts_data) {
final dictionary_delta dict_delta = new dictionary_delta();
dict_delta.gdd = new path_dictionary_delta[0];
dict_delta.mdd = new path_dictionary_delta[0];
dict_delta.sdd = new strval_dictionary_delta[0];
dict_delta.tdd = new ... | java | public tsfile_data data(TimeSeriesCollection ts_data) {
final dictionary_delta dict_delta = new dictionary_delta();
dict_delta.gdd = new path_dictionary_delta[0];
dict_delta.mdd = new path_dictionary_delta[0];
dict_delta.sdd = new strval_dictionary_delta[0];
dict_delta.tdd = new ... | [
"public",
"tsfile_data",
"data",
"(",
"TimeSeriesCollection",
"ts_data",
")",
"{",
"final",
"dictionary_delta",
"dict_delta",
"=",
"new",
"dictionary_delta",
"(",
")",
";",
"dict_delta",
".",
"gdd",
"=",
"new",
"path_dictionary_delta",
"[",
"0",
"]",
";",
"dict_... | Transform a TimeSeriesCollection into the XDR serialized form. | [
"Transform",
"a",
"TimeSeriesCollection",
"into",
"the",
"XDR",
"serialized",
"form",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v1/xdr/ToXdr.java#L79-L111 | train |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/Iterables2.java | Iterables2.simpleIterable | public static <T> Iterable<T> simpleIterable(final Iterable<T> iterable) {
requireNonNull(iterable);
return () -> iterable.iterator();
} | java | public static <T> Iterable<T> simpleIterable(final Iterable<T> iterable) {
requireNonNull(iterable);
return () -> iterable.iterator();
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"simpleIterable",
"(",
"final",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"{",
"requireNonNull",
"(",
"iterable",
")",
";",
"return",
"(",
")",
"->",
"iterable",
".",
"iterator",
"(",
")",... | Wraps any iterable into a generic iterable object. This is useful for using complex iterables such as FluentIterable
with libraries that use reflection to determine bean definitions such as Jackson. | [
"Wraps",
"any",
"iterable",
"into",
"a",
"generic",
"iterable",
"object",
".",
"This",
"is",
"useful",
"for",
"using",
"complex",
"iterables",
"such",
"as",
"FluentIterable",
"with",
"libraries",
"that",
"use",
"reflection",
"to",
"determine",
"bean",
"definitio... | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/Iterables2.java#L34-L37 | train |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/Iterables2.java | Iterables2.distinct | public static <T> Iterable<T> distinct(final Iterable<T> iterable) {
requireNonNull(iterable);
return () -> Iterators2.distinct(iterable.iterator());
} | java | public static <T> Iterable<T> distinct(final Iterable<T> iterable) {
requireNonNull(iterable);
return () -> Iterators2.distinct(iterable.iterator());
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"distinct",
"(",
"final",
"Iterable",
"<",
"T",
">",
"iterable",
")",
"{",
"requireNonNull",
"(",
"iterable",
")",
";",
"return",
"(",
")",
"->",
"Iterators2",
".",
"distinct",
"(",
"iterabl... | If we can assume the iterable is sorted, return the distinct elements. This only works
if the data provided is sorted. | [
"If",
"we",
"can",
"assume",
"the",
"iterable",
"is",
"sorted",
"return",
"the",
"distinct",
"elements",
".",
"This",
"only",
"works",
"if",
"the",
"data",
"provided",
"is",
"sorted",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/Iterables2.java#L43-L46 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java | AmqpBuffer.encodeAuthAmqPlain | public String encodeAuthAmqPlain(String username, String password)
{
AmqpBuffer bytes = new AmqpBuffer();
bytes.putShortString("LOGIN");
bytes.putTypeIdentifier("Longstr");
bytes.putLongString(username);
bytes.putShortString("PASSWORD");
bytes.putTypeIdentifi... | java | public String encodeAuthAmqPlain(String username, String password)
{
AmqpBuffer bytes = new AmqpBuffer();
bytes.putShortString("LOGIN");
bytes.putTypeIdentifier("Longstr");
bytes.putLongString(username);
bytes.putShortString("PASSWORD");
bytes.putTypeIdentifi... | [
"public",
"String",
"encodeAuthAmqPlain",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"AmqpBuffer",
"bytes",
"=",
"new",
"AmqpBuffer",
"(",
")",
";",
"bytes",
".",
"putShortString",
"(",
"\"LOGIN\"",
")",
";",
"bytes",
".",
"putTypeIdentifi... | Encodes the AMQPLAIN authentication response as an AmqpArguments | [
"Encodes",
"the",
"AMQPLAIN",
"authentication",
"response",
"as",
"an",
"AmqpArguments"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L92-L113 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java | AmqpBuffer.getMethodArguments | private Arg[] getMethodArguments(List<Parameter> param)
{
Arg[] val = new Arg[param.size()];
for (int i = 0; i < param.size(); i++)
{
String type = param.get(i).type;
Arg arg = new Arg();
arg.type = type;
arg.name = param.get(i).name... | java | private Arg[] getMethodArguments(List<Parameter> param)
{
Arg[] val = new Arg[param.size()];
for (int i = 0; i < param.size(); i++)
{
String type = param.get(i).type;
Arg arg = new Arg();
arg.type = type;
arg.name = param.get(i).name... | [
"private",
"Arg",
"[",
"]",
"getMethodArguments",
"(",
"List",
"<",
"Parameter",
">",
"param",
")",
"{",
"Arg",
"[",
"]",
"val",
"=",
"new",
"Arg",
"[",
"param",
".",
"size",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Decodes arguments given a method's parameter list | [
"Decodes",
"arguments",
"given",
"a",
"method",
"s",
"parameter",
"list"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L359-L390 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java | AmqpBuffer.getFrame | public AmqpFrame getFrame()
{
int pos = this.position();
AmqpMethod method = new AmqpMethod();
int classIndex;
AmqpFrame frame = new AmqpFrame();
// If there is at least one Frame in the buffer, attempt to decode it.
if (this.remaining() ... | java | public AmqpFrame getFrame()
{
int pos = this.position();
AmqpMethod method = new AmqpMethod();
int classIndex;
AmqpFrame frame = new AmqpFrame();
// If there is at least one Frame in the buffer, attempt to decode it.
if (this.remaining() ... | [
"public",
"AmqpFrame",
"getFrame",
"(",
")",
"{",
"int",
"pos",
"=",
"this",
".",
"position",
"(",
")",
";",
"AmqpMethod",
"method",
"=",
"new",
"AmqpMethod",
"(",
")",
";",
"int",
"classIndex",
";",
"AmqpFrame",
"frame",
"=",
"new",
"AmqpFrame",
"(",
... | Parses the ByteBuffer and returns an AMQP frame
@return AmqpFrame | [
"Parses",
"the",
"ByteBuffer",
"and",
"returns",
"an",
"AMQP",
"frame"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L396-L473 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java | AmqpBuffer.putMethodArguments | AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams)
{
for (int i = 0; i < formalParams.size(); i++)
{
String type = formalParams.get(i).type;
if (type == null)
{
throw new IllegalStateException("Unk... | java | AmqpBuffer putMethodArguments(Object[] args, List<Parameter> formalParams)
{
for (int i = 0; i < formalParams.size(); i++)
{
String type = formalParams.get(i).type;
if (type == null)
{
throw new IllegalStateException("Unk... | [
"AmqpBuffer",
"putMethodArguments",
"(",
"Object",
"[",
"]",
"args",
",",
"List",
"<",
"Parameter",
">",
"formalParams",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"formalParams",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"St... | Encodes arguments given a method's parameter list and the provided arguments | [
"Encodes",
"arguments",
"given",
"a",
"method",
"s",
"parameter",
"list",
"and",
"the",
"provided",
"arguments"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/impl/AmqpBuffer.java#L531-L550 | train |
threerings/nenya | core/src/main/java/com/threerings/media/ManagedJFrame.java | ManagedJFrame.update | @Override
public void update (Graphics g)
{
Shape clip = g.getClip();
Rectangle dirty;
if (clip != null) {
dirty = clip.getBounds();
} else {
dirty = getRootPane().getBounds();
// account for our frame insets
Insets insets = getInse... | java | @Override
public void update (Graphics g)
{
Shape clip = g.getClip();
Rectangle dirty;
if (clip != null) {
dirty = clip.getBounds();
} else {
dirty = getRootPane().getBounds();
// account for our frame insets
Insets insets = getInse... | [
"@",
"Override",
"public",
"void",
"update",
"(",
"Graphics",
"g",
")",
"{",
"Shape",
"clip",
"=",
"g",
".",
"getClip",
"(",
")",
";",
"Rectangle",
"dirty",
";",
"if",
"(",
"clip",
"!=",
"null",
")",
"{",
"dirty",
"=",
"clip",
".",
"getBounds",
"("... | We catch update requests and forward them on to the repaint infrastructure. | [
"We",
"catch",
"update",
"requests",
"and",
"forward",
"them",
"on",
"to",
"the",
"repaint",
"infrastructure",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/ManagedJFrame.java#L93-L111 | train |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/io/Serializables.java | Serializables.deserialize | public static <T extends Serializable> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
return deserialize(bytes, false);
} | java | public static <T extends Serializable> T deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
return deserialize(bytes, false);
} | [
"public",
"static",
"<",
"T",
"extends",
"Serializable",
">",
"T",
"deserialize",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"deserialize",
"(",
"bytes",
",",
"false",
")",
";",
"}"
] | Utility for returning a Serializable object from a byte array. | [
"Utility",
"for",
"returning",
"a",
"Serializable",
"object",
"from",
"a",
"byte",
"array",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/io/Serializables.java#L58-L60 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/PipelineBuilder.java | PipelineBuilder.build | public PushProcessorPipeline build(List<PushProcessorSupplier> processor_suppliers) throws Exception {
ApiServer api = null;
PushMetricRegistryInstance registry = null;
final List<PushProcessor> processors = new ArrayList<>(processor_suppliers.size());
try {
final EndpointReg... | java | public PushProcessorPipeline build(List<PushProcessorSupplier> processor_suppliers) throws Exception {
ApiServer api = null;
PushMetricRegistryInstance registry = null;
final List<PushProcessor> processors = new ArrayList<>(processor_suppliers.size());
try {
final EndpointReg... | [
"public",
"PushProcessorPipeline",
"build",
"(",
"List",
"<",
"PushProcessorSupplier",
">",
"processor_suppliers",
")",
"throws",
"Exception",
"{",
"ApiServer",
"api",
"=",
"null",
";",
"PushMetricRegistryInstance",
"registry",
"=",
"null",
";",
"final",
"List",
"<"... | Creates a push processor.
The API server is started by this method.
The returned push processor is not started.
@param processor_suppliers A list of PushProcessorSupplier, that will instantiate the push processors.
@return A Push Processor pipeline. You'll need to start it yourself.
@throws Exception indicating const... | [
"Creates",
"a",
"push",
"processor",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/PipelineBuilder.java#L124-L166 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.createCompatibleImage | public static BufferedImage createCompatibleImage (BufferedImage source, int width, int height)
{
WritableRaster raster = source.getRaster().createCompatibleWritableRaster(width, height);
return new BufferedImage(source.getColorModel(), raster, false, null);
} | java | public static BufferedImage createCompatibleImage (BufferedImage source, int width, int height)
{
WritableRaster raster = source.getRaster().createCompatibleWritableRaster(width, height);
return new BufferedImage(source.getColorModel(), raster, false, null);
} | [
"public",
"static",
"BufferedImage",
"createCompatibleImage",
"(",
"BufferedImage",
"source",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"WritableRaster",
"raster",
"=",
"source",
".",
"getRaster",
"(",
")",
".",
"createCompatibleWritableRaster",
"(",
"w... | Creates a new buffered image with the same sample model and color model as the source image
but with the new width and height. | [
"Creates",
"a",
"new",
"buffered",
"image",
"with",
"the",
"same",
"sample",
"model",
"and",
"color",
"model",
"as",
"the",
"source",
"image",
"but",
"with",
"the",
"new",
"width",
"and",
"height",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L62-L66 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.createErrorImage | public static BufferedImage createErrorImage (int width, int height)
{
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
Graphics2D g = (Graphics2D)img.getGraphics();
g.setColor(Color.red);
Label l = new Label("Error");
l.layout(g);
... | java | public static BufferedImage createErrorImage (int width, int height)
{
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED);
Graphics2D g = (Graphics2D)img.getGraphics();
g.setColor(Color.red);
Label l = new Label("Error");
l.layout(g);
... | [
"public",
"static",
"BufferedImage",
"createErrorImage",
"(",
"int",
"width",
",",
"int",
"height",
")",
"{",
"BufferedImage",
"img",
"=",
"new",
"BufferedImage",
"(",
"width",
",",
"height",
",",
"BufferedImage",
".",
"TYPE_BYTE_INDEXED",
")",
";",
"Graphics2D"... | Creates an image with the word "Error" written in it. | [
"Creates",
"an",
"image",
"with",
"the",
"word",
"Error",
"written",
"in",
"it",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L71-L87 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.recolorImage | public static BufferedImage recolorImage (BufferedImage image, Colorization[] zations)
{
ColorModel cm = image.getColorModel();
if (!(cm instanceof IndexColorModel)) {
throw new RuntimeException(Logger.format(
"Unable to recolor images with non-index color model", "cm", c... | java | public static BufferedImage recolorImage (BufferedImage image, Colorization[] zations)
{
ColorModel cm = image.getColorModel();
if (!(cm instanceof IndexColorModel)) {
throw new RuntimeException(Logger.format(
"Unable to recolor images with non-index color model", "cm", c... | [
"public",
"static",
"BufferedImage",
"recolorImage",
"(",
"BufferedImage",
"image",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"ColorModel",
"cm",
"=",
"image",
".",
"getColorModel",
"(",
")",
";",
"if",
"(",
"!",
"(",
"cm",
"instanceof",
"IndexColo... | Recolors the supplied image using the supplied colorizations. | [
"Recolors",
"the",
"supplied",
"image",
"using",
"the",
"supplied",
"colorizations",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L114-L165 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.tileImage | public static void tileImage (Graphics2D gfx, Mirage image, int x, int y, int width, int height)
{
int iwidth = image.getWidth(), iheight = image.getHeight();
int xnum = width / iwidth, xplus = width % iwidth;
int ynum = height / iheight, yplus = height % iheight;
Shape oclip = gfx.g... | java | public static void tileImage (Graphics2D gfx, Mirage image, int x, int y, int width, int height)
{
int iwidth = image.getWidth(), iheight = image.getHeight();
int xnum = width / iwidth, xplus = width % iwidth;
int ynum = height / iheight, yplus = height % iheight;
Shape oclip = gfx.g... | [
"public",
"static",
"void",
"tileImage",
"(",
"Graphics2D",
"gfx",
",",
"Mirage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"int",
"iwidth",
"=",
"image",
".",
"getWidth",
"(",
")",
",",
"iheight"... | Paints multiple copies of the supplied image using the supplied graphics context such that
the requested area is filled with the image. | [
"Paints",
"multiple",
"copies",
"of",
"the",
"supplied",
"image",
"using",
"the",
"supplied",
"graphics",
"context",
"such",
"that",
"the",
"requested",
"area",
"is",
"filled",
"with",
"the",
"image",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L171-L210 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.tileImageAcross | public static void tileImageAcross (Graphics2D gfx, Mirage image, int x, int y, int width)
{
tileImage(gfx, image, x, y, width, image.getHeight());
} | java | public static void tileImageAcross (Graphics2D gfx, Mirage image, int x, int y, int width)
{
tileImage(gfx, image, x, y, width, image.getHeight());
} | [
"public",
"static",
"void",
"tileImageAcross",
"(",
"Graphics2D",
"gfx",
",",
"Mirage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
")",
"{",
"tileImage",
"(",
"gfx",
",",
"image",
",",
"x",
",",
"y",
",",
"width",
",",
"image",
... | Paints multiple copies of the supplied image using the supplied graphics context such that
the requested width is filled with the image. | [
"Paints",
"multiple",
"copies",
"of",
"the",
"supplied",
"image",
"using",
"the",
"supplied",
"graphics",
"context",
"such",
"that",
"the",
"requested",
"width",
"is",
"filled",
"with",
"the",
"image",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L216-L219 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.tileImageDown | public static void tileImageDown (Graphics2D gfx, Mirage image, int x, int y, int height)
{
tileImage(gfx, image, x, y, image.getWidth(), height);
} | java | public static void tileImageDown (Graphics2D gfx, Mirage image, int x, int y, int height)
{
tileImage(gfx, image, x, y, image.getWidth(), height);
} | [
"public",
"static",
"void",
"tileImageDown",
"(",
"Graphics2D",
"gfx",
",",
"Mirage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"height",
")",
"{",
"tileImage",
"(",
"gfx",
",",
"image",
",",
"x",
",",
"y",
",",
"image",
".",
"getWidth",... | Paints multiple copies of the supplied image using the supplied graphics context such that
the requested height is filled with the image. | [
"Paints",
"multiple",
"copies",
"of",
"the",
"supplied",
"image",
"using",
"the",
"supplied",
"graphics",
"context",
"such",
"that",
"the",
"requested",
"height",
"is",
"filled",
"with",
"the",
"image",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L225-L228 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.createTracedImage | public static BufferedImage createTracedImage (
ImageCreator isrc, BufferedImage src, Color tcolor, int thickness)
{
return createTracedImage(isrc, src, tcolor, thickness, 1.0f, 1.0f);
} | java | public static BufferedImage createTracedImage (
ImageCreator isrc, BufferedImage src, Color tcolor, int thickness)
{
return createTracedImage(isrc, src, tcolor, thickness, 1.0f, 1.0f);
} | [
"public",
"static",
"BufferedImage",
"createTracedImage",
"(",
"ImageCreator",
"isrc",
",",
"BufferedImage",
"src",
",",
"Color",
"tcolor",
",",
"int",
"thickness",
")",
"{",
"return",
"createTracedImage",
"(",
"isrc",
",",
"src",
",",
"tcolor",
",",
"thickness"... | Creates and returns a new image consisting of the supplied image traced with the given
color and thickness. | [
"Creates",
"and",
"returns",
"a",
"new",
"image",
"consisting",
"of",
"the",
"supplied",
"image",
"traced",
"with",
"the",
"given",
"color",
"and",
"thickness",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L261-L265 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.bordersNonTransparentPixel | protected static boolean bordersNonTransparentPixel (
BufferedImage data, int wid, int hei, boolean[] traced, int x, int y)
{
// check the three-pixel row above the pixel
if (y > 0) {
for (int rxx = x - 1; rxx <= x + 1; rxx++) {
if (rxx < 0 || rxx >= wid || traced... | java | protected static boolean bordersNonTransparentPixel (
BufferedImage data, int wid, int hei, boolean[] traced, int x, int y)
{
// check the three-pixel row above the pixel
if (y > 0) {
for (int rxx = x - 1; rxx <= x + 1; rxx++) {
if (rxx < 0 || rxx >= wid || traced... | [
"protected",
"static",
"boolean",
"bordersNonTransparentPixel",
"(",
"BufferedImage",
"data",
",",
"int",
"wid",
",",
"int",
"hei",
",",
"boolean",
"[",
"]",
"traced",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"// check the three-pixel row above the pixel",
"i... | Returns whether the given pixel is bordered by any non-transparent pixel. | [
"Returns",
"whether",
"the",
"given",
"pixel",
"is",
"bordered",
"by",
"any",
"non",
"-",
"transparent",
"pixel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L340-L384 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.composeMaskedImage | public static BufferedImage composeMaskedImage (
ImageCreator isrc, BufferedImage mask, BufferedImage base)
{
int wid = base.getWidth();
int hei = base.getHeight();
Raster maskdata = mask.getData();
Raster basedata = base.getData();
// create a new image using the r... | java | public static BufferedImage composeMaskedImage (
ImageCreator isrc, BufferedImage mask, BufferedImage base)
{
int wid = base.getWidth();
int hei = base.getHeight();
Raster maskdata = mask.getData();
Raster basedata = base.getData();
// create a new image using the r... | [
"public",
"static",
"BufferedImage",
"composeMaskedImage",
"(",
"ImageCreator",
"isrc",
",",
"BufferedImage",
"mask",
",",
"BufferedImage",
"base",
")",
"{",
"int",
"wid",
"=",
"base",
".",
"getWidth",
"(",
")",
";",
"int",
"hei",
"=",
"base",
".",
"getHeigh... | Create an image using the alpha channel from the first and the RGB values from the second. | [
"Create",
"an",
"image",
"using",
"the",
"alpha",
"channel",
"from",
"the",
"first",
"and",
"the",
"RGB",
"values",
"from",
"the",
"second",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L389-L428 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.composeMaskedImage | public static BufferedImage composeMaskedImage (
ImageCreator isrc, Shape mask, BufferedImage base)
{
int wid = base.getWidth();
int hei = base.getHeight();
// alternate method for composition:
// 1. create WriteableRaster with base data
// 2. test each pixel with ma... | java | public static BufferedImage composeMaskedImage (
ImageCreator isrc, Shape mask, BufferedImage base)
{
int wid = base.getWidth();
int hei = base.getHeight();
// alternate method for composition:
// 1. create WriteableRaster with base data
// 2. test each pixel with ma... | [
"public",
"static",
"BufferedImage",
"composeMaskedImage",
"(",
"ImageCreator",
"isrc",
",",
"Shape",
"mask",
",",
"BufferedImage",
"base",
")",
"{",
"int",
"wid",
"=",
"base",
".",
"getWidth",
"(",
")",
";",
"int",
"hei",
"=",
"base",
".",
"getHeight",
"(... | Create a new image using the supplied shape as a mask from which to cut out pixels from the
supplied image. Pixels inside the shape will be added to the final image, pixels outside
the shape will be clear. | [
"Create",
"a",
"new",
"image",
"using",
"the",
"supplied",
"shape",
"as",
"a",
"mask",
"from",
"which",
"to",
"cut",
"out",
"pixels",
"from",
"the",
"supplied",
"image",
".",
"Pixels",
"inside",
"the",
"shape",
"will",
"be",
"added",
"to",
"the",
"final"... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L435-L461 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.computeTrimmedBounds | public static void computeTrimmedBounds (BufferedImage image, Rectangle tbounds)
{
// this could be more efficient, but it's run as a batch process and doesn't really take
// that long anyway
int width = image.getWidth(), height = image.getHeight();
int firstrow = -1, lastrow = -1, ... | java | public static void computeTrimmedBounds (BufferedImage image, Rectangle tbounds)
{
// this could be more efficient, but it's run as a batch process and doesn't really take
// that long anyway
int width = image.getWidth(), height = image.getHeight();
int firstrow = -1, lastrow = -1, ... | [
"public",
"static",
"void",
"computeTrimmedBounds",
"(",
"BufferedImage",
"image",
",",
"Rectangle",
"tbounds",
")",
"{",
"// this could be more efficient, but it's run as a batch process and doesn't really take",
"// that long anyway",
"int",
"width",
"=",
"image",
".",
"getWi... | Computes the bounds of the smallest rectangle that contains all non-transparent pixels of
this image. This isn't extremely efficient, so you shouldn't be doing this anywhere
exciting. | [
"Computes",
"the",
"bounds",
"of",
"the",
"smallest",
"rectangle",
"that",
"contains",
"all",
"non",
"-",
"transparent",
"pixels",
"of",
"this",
"image",
".",
"This",
"isn",
"t",
"extremely",
"efficient",
"so",
"you",
"shouldn",
"t",
"be",
"doing",
"this",
... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L479-L535 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.getEstimatedMemoryUsage | public static long getEstimatedMemoryUsage (Raster raster)
{
// we assume that the data buffer stores each element in a byte-rounded memory element;
// maybe the buffer is smarter about things than this, but we're better to err on the safe
// side
DataBuffer db = raster.getDataBuffer... | java | public static long getEstimatedMemoryUsage (Raster raster)
{
// we assume that the data buffer stores each element in a byte-rounded memory element;
// maybe the buffer is smarter about things than this, but we're better to err on the safe
// side
DataBuffer db = raster.getDataBuffer... | [
"public",
"static",
"long",
"getEstimatedMemoryUsage",
"(",
"Raster",
"raster",
")",
"{",
"// we assume that the data buffer stores each element in a byte-rounded memory element;",
"// maybe the buffer is smarter about things than this, but we're better to err on the safe",
"// side",
"DataB... | Returns the estimated memory usage in bytes for the specified raster. | [
"Returns",
"the",
"estimated",
"memory",
"usage",
"in",
"bytes",
"for",
"the",
"specified",
"raster",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L552-L560 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.getEstimatedMemoryUsage | public static long getEstimatedMemoryUsage (Iterator<BufferedImage> iter)
{
long size = 0;
while (iter.hasNext()) {
BufferedImage image = iter.next();
size += getEstimatedMemoryUsage(image);
}
return size;
} | java | public static long getEstimatedMemoryUsage (Iterator<BufferedImage> iter)
{
long size = 0;
while (iter.hasNext()) {
BufferedImage image = iter.next();
size += getEstimatedMemoryUsage(image);
}
return size;
} | [
"public",
"static",
"long",
"getEstimatedMemoryUsage",
"(",
"Iterator",
"<",
"BufferedImage",
">",
"iter",
")",
"{",
"long",
"size",
"=",
"0",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"BufferedImage",
"image",
"=",
"iter",
".",
"nex... | Returns the estimated memory usage in bytes for all buffered images in the supplied
iterator. | [
"Returns",
"the",
"estimated",
"memory",
"usage",
"in",
"bytes",
"for",
"all",
"buffered",
"images",
"in",
"the",
"supplied",
"iterator",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L566-L574 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ImageUtil.java | ImageUtil.getDefGC | protected static GraphicsConfiguration getDefGC ()
{
if (_gc == null) {
// obtain information on our graphics environment
try {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = env.getDefaultScreenDevice(... | java | protected static GraphicsConfiguration getDefGC ()
{
if (_gc == null) {
// obtain information on our graphics environment
try {
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = env.getDefaultScreenDevice(... | [
"protected",
"static",
"GraphicsConfiguration",
"getDefGC",
"(",
")",
"{",
"if",
"(",
"_gc",
"==",
"null",
")",
"{",
"// obtain information on our graphics environment",
"try",
"{",
"GraphicsEnvironment",
"env",
"=",
"GraphicsEnvironment",
".",
"getLocalGraphicsEnvironmen... | Obtains the default graphics configuration for this VM. If the JVM is in headless mode,
this method will return null. | [
"Obtains",
"the",
"default",
"graphics",
"configuration",
"for",
"this",
"VM",
".",
"If",
"the",
"JVM",
"is",
"in",
"headless",
"mode",
"this",
"method",
"will",
"return",
"null",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ImageUtil.java#L580-L593 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/SpriteManager.java | SpriteManager.getIntersectingSprites | public void getIntersectingSprites (List<Sprite> list, Shape shape)
{
int size = _sprites.size();
for (int ii = 0; ii < size; ii++) {
Sprite sprite = _sprites.get(ii);
if (sprite.intersects(shape)) {
list.add(sprite);
}
}
} | java | public void getIntersectingSprites (List<Sprite> list, Shape shape)
{
int size = _sprites.size();
for (int ii = 0; ii < size; ii++) {
Sprite sprite = _sprites.get(ii);
if (sprite.intersects(shape)) {
list.add(sprite);
}
}
} | [
"public",
"void",
"getIntersectingSprites",
"(",
"List",
"<",
"Sprite",
">",
"list",
",",
"Shape",
"shape",
")",
"{",
"int",
"size",
"=",
"_sprites",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"size",
";",
"ii",
... | When an animated view processes its dirty rectangles, it may require an expansion of the
dirty region which may in turn require the invalidation of more sprites than were originally
invalid. In such cases, the animated view can call back to the sprite manager, asking it to
append the sprites that intersect a particular... | [
"When",
"an",
"animated",
"view",
"processes",
"its",
"dirty",
"rectangles",
"it",
"may",
"require",
"an",
"expansion",
"of",
"the",
"dirty",
"region",
"which",
"may",
"in",
"turn",
"require",
"the",
"invalidation",
"of",
"more",
"sprites",
"than",
"were",
"... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/SpriteManager.java#L50-L59 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/SpriteManager.java | SpriteManager.getHitSprites | public void getHitSprites (List<Sprite> list, int x, int y)
{
for (int ii = _sprites.size() - 1; ii >= 0; ii--) {
Sprite sprite = _sprites.get(ii);
if (sprite.hitTest(x, y)) {
list.add(sprite);
}
}
} | java | public void getHitSprites (List<Sprite> list, int x, int y)
{
for (int ii = _sprites.size() - 1; ii >= 0; ii--) {
Sprite sprite = _sprites.get(ii);
if (sprite.hitTest(x, y)) {
list.add(sprite);
}
}
} | [
"public",
"void",
"getHitSprites",
"(",
"List",
"<",
"Sprite",
">",
"list",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"int",
"ii",
"=",
"_sprites",
".",
"size",
"(",
")",
"-",
"1",
";",
"ii",
">=",
"0",
";",
"ii",
"--",
")",
"{"... | When an animated view is determining what entity in its view is under the mouse pointer, it
may require a list of sprites that are "hit" by a particular pixel. The sprites' bounds are
first checked and sprites with bounds that contain the supplied point are further checked
for a non-transparent at the specified locatio... | [
"When",
"an",
"animated",
"view",
"is",
"determining",
"what",
"entity",
"in",
"its",
"view",
"is",
"under",
"the",
"mouse",
"pointer",
"it",
"may",
"require",
"a",
"list",
"of",
"sprites",
"that",
"are",
"hit",
"by",
"a",
"particular",
"pixel",
".",
"Th... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/SpriteManager.java#L72-L80 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/SpriteManager.java | SpriteManager.getHighestHitSprite | public Sprite getHighestHitSprite (int x, int y)
{
// since they're stored in lowest -> highest order..
for (int ii = _sprites.size() - 1; ii >= 0; ii--) {
Sprite sprite = _sprites.get(ii);
if (sprite.hitTest(x, y)) {
return sprite;
}
}
... | java | public Sprite getHighestHitSprite (int x, int y)
{
// since they're stored in lowest -> highest order..
for (int ii = _sprites.size() - 1; ii >= 0; ii--) {
Sprite sprite = _sprites.get(ii);
if (sprite.hitTest(x, y)) {
return sprite;
}
}
... | [
"public",
"Sprite",
"getHighestHitSprite",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"// since they're stored in lowest -> highest order..",
"for",
"(",
"int",
"ii",
"=",
"_sprites",
".",
"size",
"(",
")",
"-",
"1",
";",
"ii",
">=",
"0",
";",
"ii",
"--",... | Finds the sprite with the highest render order that hits the specified pixel.
@param x the x (screen) coordinate to be checked
@param y the y (screen) coordinate to be checked
@return the highest sprite hit | [
"Finds",
"the",
"sprite",
"with",
"the",
"highest",
"render",
"order",
"that",
"hits",
"the",
"specified",
"pixel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/SpriteManager.java#L89-L99 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/SpriteManager.java | SpriteManager.removeSprites | public void removeSprites (Predicate<Sprite> pred)
{
int idxoff = 0;
for (int ii = 0, ll = _sprites.size(); ii < ll; ii++) {
Sprite sprite = _sprites.get(ii-idxoff);
if (pred.apply(sprite)) {
_sprites.remove(sprite);
sprite.invalidate();
... | java | public void removeSprites (Predicate<Sprite> pred)
{
int idxoff = 0;
for (int ii = 0, ll = _sprites.size(); ii < ll; ii++) {
Sprite sprite = _sprites.get(ii-idxoff);
if (pred.apply(sprite)) {
_sprites.remove(sprite);
sprite.invalidate();
... | [
"public",
"void",
"removeSprites",
"(",
"Predicate",
"<",
"Sprite",
">",
"pred",
")",
"{",
"int",
"idxoff",
"=",
"0",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_sprites",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
"ii",
"+... | Removes all sprites that match the supplied predicate. | [
"Removes",
"all",
"sprites",
"that",
"match",
"the",
"supplied",
"predicate",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/SpriteManager.java#L145-L162 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/Sprite.java | Sprite.cancelMove | public void cancelMove ()
{
if (_path != null) {
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new CancelledOp(this, oldpath));
}
}
} | java | public void cancelMove ()
{
if (_path != null) {
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new CancelledOp(this, oldpath));
}
}
} | [
"public",
"void",
"cancelMove",
"(",
")",
"{",
"if",
"(",
"_path",
"!=",
"null",
")",
"{",
"Path",
"oldpath",
"=",
"_path",
";",
"_path",
"=",
"null",
";",
"oldpath",
".",
"wasRemoved",
"(",
"this",
")",
";",
"if",
"(",
"_observers",
"!=",
"null",
... | Cancels any path that the sprite may currently be moving along. | [
"Cancels",
"any",
"path",
"that",
"the",
"sprite",
"may",
"currently",
"be",
"moving",
"along",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/Sprite.java#L240-L250 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/Sprite.java | Sprite.pathCompleted | public void pathCompleted (long timestamp)
{
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new CompletedOp(this, oldpath, timestamp));
}
} | java | public void pathCompleted (long timestamp)
{
Path oldpath = _path;
_path = null;
oldpath.wasRemoved(this);
if (_observers != null) {
_observers.apply(new CompletedOp(this, oldpath, timestamp));
}
} | [
"public",
"void",
"pathCompleted",
"(",
"long",
"timestamp",
")",
"{",
"Path",
"oldpath",
"=",
"_path",
";",
"_path",
"=",
"null",
";",
"oldpath",
".",
"wasRemoved",
"(",
"this",
")",
";",
"if",
"(",
"_observers",
"!=",
"null",
")",
"{",
"_observers",
... | Called by the active path when it has completed. | [
"Called",
"by",
"the",
"active",
"path",
"when",
"it",
"has",
"completed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/Sprite.java#L271-L279 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/Sprite.java | Sprite.tickPath | protected boolean tickPath (long tickStamp)
{
if (_path == null) {
return false;
}
// initialize the path if we haven't yet
if (_pathStamp == 0) {
_path.init(this, _pathStamp = tickStamp);
}
// it's possible that as a result of init() the pat... | java | protected boolean tickPath (long tickStamp)
{
if (_path == null) {
return false;
}
// initialize the path if we haven't yet
if (_pathStamp == 0) {
_path.init(this, _pathStamp = tickStamp);
}
// it's possible that as a result of init() the pat... | [
"protected",
"boolean",
"tickPath",
"(",
"long",
"tickStamp",
")",
"{",
"if",
"(",
"_path",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"// initialize the path if we haven't yet",
"if",
"(",
"_pathStamp",
"==",
"0",
")",
"{",
"_path",
".",
"init",
... | Ticks any path assigned to this sprite.
@return true if the path relocated the sprite as a result of this tick, false if it
remained in the same position. | [
"Ticks",
"any",
"path",
"assigned",
"to",
"this",
"sprite",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/Sprite.java#L293-L307 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObjectTip.java | SceneObjectTip.layout | public void layout (Graphics2D gfx, SceneObject tipFor, Rectangle boundary)
{
layout(gfx, ICON_PAD, EXTRA_PAD);
bounds = new Rectangle(_size);
// locate the most appropriate tip layout
for (int ii = 0, ll = _layouts.size(); ii < ll; ii++) {
LayoutReg reg = _layouts.get(i... | java | public void layout (Graphics2D gfx, SceneObject tipFor, Rectangle boundary)
{
layout(gfx, ICON_PAD, EXTRA_PAD);
bounds = new Rectangle(_size);
// locate the most appropriate tip layout
for (int ii = 0, ll = _layouts.size(); ii < ll; ii++) {
LayoutReg reg = _layouts.get(i... | [
"public",
"void",
"layout",
"(",
"Graphics2D",
"gfx",
",",
"SceneObject",
"tipFor",
",",
"Rectangle",
"boundary",
")",
"{",
"layout",
"(",
"gfx",
",",
"ICON_PAD",
",",
"EXTRA_PAD",
")",
";",
"bounds",
"=",
"new",
"Rectangle",
"(",
"_size",
")",
";",
"// ... | Called to initialize the tip so that it can be painted.
@param tipFor the scene object that we're a tip for.
@param boundary the boundary of all displayable space. | [
"Called",
"to",
"initialize",
"the",
"tip",
"so",
"that",
"it",
"can",
"be",
"painted",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObjectTip.java#L87-L101 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObjectTip.java | SceneObjectTip.registerTipLayout | public static void registerTipLayout (String prefix, TipLayout layout)
{
LayoutReg reg = new LayoutReg();
reg.prefix = prefix;
reg.layout = layout;
_layouts.insertSorted(reg);
} | java | public static void registerTipLayout (String prefix, TipLayout layout)
{
LayoutReg reg = new LayoutReg();
reg.prefix = prefix;
reg.layout = layout;
_layouts.insertSorted(reg);
} | [
"public",
"static",
"void",
"registerTipLayout",
"(",
"String",
"prefix",
",",
"TipLayout",
"layout",
")",
"{",
"LayoutReg",
"reg",
"=",
"new",
"LayoutReg",
"(",
")",
";",
"reg",
".",
"prefix",
"=",
"prefix",
";",
"reg",
".",
"layout",
"=",
"layout",
";"... | It may be desirable to layout object tips specially depending on
what sort of actions they represent, so we allow different tip
layout algorithms to be registered for particular object prefixes.
The registration is simply a list searched from longest string to
shortest string for the first match to an object's action. | [
"It",
"may",
"be",
"desirable",
"to",
"layout",
"object",
"tips",
"specially",
"depending",
"on",
"what",
"sort",
"of",
"actions",
"they",
"represent",
"so",
"we",
"allow",
"different",
"tip",
"layout",
"algorithms",
"to",
"be",
"registered",
"for",
"particula... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObjectTip.java#L144-L150 | train |
calrissian/mango | mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java | NodeUtils.isLeaf | public static boolean isLeaf(Node node) {
return node instanceof Leaf || node.children() == null || node.children().size() == 0;
} | java | public static boolean isLeaf(Node node) {
return node instanceof Leaf || node.children() == null || node.children().size() == 0;
} | [
"public",
"static",
"boolean",
"isLeaf",
"(",
"Node",
"node",
")",
"{",
"return",
"node",
"instanceof",
"Leaf",
"||",
"node",
".",
"children",
"(",
")",
"==",
"null",
"||",
"node",
".",
"children",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
";",
"... | Returns true if a node is a leaf. Note that a leaf can also be a parent node that does not have any children. | [
"Returns",
"true",
"if",
"a",
"node",
"is",
"a",
"leaf",
".",
"Note",
"that",
"a",
"leaf",
"can",
"also",
"be",
"a",
"parent",
"node",
"that",
"does",
"not",
"have",
"any",
"children",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java#L32-L34 | train |
calrissian/mango | mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java | NodeUtils.isEmpty | public static boolean isEmpty(Node node) {
return (node == null || (node.children() != null && node.children().size() == 0));
} | java | public static boolean isEmpty(Node node) {
return (node == null || (node.children() != null && node.children().size() == 0));
} | [
"public",
"static",
"boolean",
"isEmpty",
"(",
"Node",
"node",
")",
"{",
"return",
"(",
"node",
"==",
"null",
"||",
"(",
"node",
".",
"children",
"(",
")",
"!=",
"null",
"&&",
"node",
".",
"children",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
"... | Determines if a node is null, or a single parent node without children. | [
"Determines",
"if",
"a",
"node",
"is",
"null",
"or",
"a",
"single",
"parent",
"node",
"without",
"children",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java#L39-L41 | train |
calrissian/mango | mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java | NodeUtils.parentContainsOnlyLeaves | public static boolean parentContainsOnlyLeaves(ParentNode parentNode) {
for (Node child : parentNode.children()) {
if (!isLeaf(child)) return false;
}
return true;
} | java | public static boolean parentContainsOnlyLeaves(ParentNode parentNode) {
for (Node child : parentNode.children()) {
if (!isLeaf(child)) return false;
}
return true;
} | [
"public",
"static",
"boolean",
"parentContainsOnlyLeaves",
"(",
"ParentNode",
"parentNode",
")",
"{",
"for",
"(",
"Node",
"child",
":",
"parentNode",
".",
"children",
"(",
")",
")",
"{",
"if",
"(",
"!",
"isLeaf",
"(",
"child",
")",
")",
"return",
"false",
... | Determines if parent node has children that are all leaves | [
"Determines",
"if",
"parent",
"node",
"has",
"children",
"that",
"are",
"all",
"leaves"
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java#L46-L51 | train |
calrissian/mango | mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java | NodeUtils.criteriaFromNode | public static Criteria criteriaFromNode(Node node, Comparator rangeComparator) {
return criteriaFromNode(node, rangeComparator, null);
} | java | public static Criteria criteriaFromNode(Node node, Comparator rangeComparator) {
return criteriaFromNode(node, rangeComparator, null);
} | [
"public",
"static",
"Criteria",
"criteriaFromNode",
"(",
"Node",
"node",
",",
"Comparator",
"rangeComparator",
")",
"{",
"return",
"criteriaFromNode",
"(",
"node",
",",
"rangeComparator",
",",
"null",
")",
";",
"}"
] | Creates criteria from a node. A Comparator is injected into all nodes which need to determine order or equality. | [
"Creates",
"criteria",
"from",
"a",
"node",
".",
"A",
"Comparator",
"is",
"injected",
"into",
"all",
"nodes",
"which",
"need",
"to",
"determine",
"order",
"or",
"equality",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-criteria/src/main/java/org/calrissian/mango/criteria/support/NodeUtils.java#L71-L73 | train |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/tools/RenameTileSet.java | RenameTileSet.renameTileSet | public static void renameTileSet (
String mapPath, String oldName, String newName)
throws PersistenceException
{
MapFileTileSetIDBroker broker =
new MapFileTileSetIDBroker(new File(mapPath));
if (!broker.renameTileSet(oldName, newName)) {
throw new Persistence... | java | public static void renameTileSet (
String mapPath, String oldName, String newName)
throws PersistenceException
{
MapFileTileSetIDBroker broker =
new MapFileTileSetIDBroker(new File(mapPath));
if (!broker.renameTileSet(oldName, newName)) {
throw new Persistence... | [
"public",
"static",
"void",
"renameTileSet",
"(",
"String",
"mapPath",
",",
"String",
"oldName",
",",
"String",
"newName",
")",
"throws",
"PersistenceException",
"{",
"MapFileTileSetIDBroker",
"broker",
"=",
"new",
"MapFileTileSetIDBroker",
"(",
"new",
"File",
"(",
... | Loads up the tileset map file with the specified path and copies
the tileset ID from the old tileset name to the new tileset name.
This is necessary when a tileset is renamed so that the new name
does not cause the tileset to be assigned a new tileset ID. Bear in
mind that the old name should never again be used as it ... | [
"Loads",
"up",
"the",
"tileset",
"map",
"file",
"with",
"the",
"specified",
"path",
"and",
"copies",
"the",
"tileset",
"ID",
"from",
"the",
"old",
"tileset",
"name",
"to",
"the",
"new",
"tileset",
"name",
".",
"This",
"is",
"necessary",
"when",
"a",
"til... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/RenameTileSet.java#L44-L55 | train |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java | ComponentBundler.trim | protected TrimmedTileSet trim (TileSet aset, OutputStream fout) throws IOException
{
return TrimmedTileSet.trimTileSet(aset, fout);
} | java | protected TrimmedTileSet trim (TileSet aset, OutputStream fout) throws IOException
{
return TrimmedTileSet.trimTileSet(aset, fout);
} | [
"protected",
"TrimmedTileSet",
"trim",
"(",
"TileSet",
"aset",
",",
"OutputStream",
"fout",
")",
"throws",
"IOException",
"{",
"return",
"TrimmedTileSet",
".",
"trimTileSet",
"(",
"aset",
",",
"fout",
")",
";",
"}"
] | Converts the tileset to a trimmed tile set and saves it at the specified location. | [
"Converts",
"the",
"tileset",
"to",
"a",
"trimmed",
"tile",
"set",
"and",
"saves",
"it",
"at",
"the",
"specified",
"location",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java#L363-L366 | train |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java | ComponentBundler.saveBroker | protected void saveBroker (File mapfile, HashMapIDBroker broker)
throws RuntimeException
{
// bail if the broker wasn't modified
if (!broker.isModified()) {
return;
}
try {
BufferedWriter bout = new BufferedWriter(new FileWriter(mapfile));
... | java | protected void saveBroker (File mapfile, HashMapIDBroker broker)
throws RuntimeException
{
// bail if the broker wasn't modified
if (!broker.isModified()) {
return;
}
try {
BufferedWriter bout = new BufferedWriter(new FileWriter(mapfile));
... | [
"protected",
"void",
"saveBroker",
"(",
"File",
"mapfile",
",",
"HashMapIDBroker",
"broker",
")",
"throws",
"RuntimeException",
"{",
"// bail if the broker wasn't modified",
"if",
"(",
"!",
"broker",
".",
"isModified",
"(",
")",
")",
"{",
"return",
";",
"}",
"tr... | Stores a persistent representation of the supplied hashmap ID
broker in the specified file. | [
"Stores",
"a",
"persistent",
"representation",
"of",
"the",
"supplied",
"hashmap",
"ID",
"broker",
"in",
"the",
"specified",
"file",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundler.java#L372-L388 | train |
groupon/monsoon | collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MBeanGroup.java | MBeanGroup.nameFromObjectName | private static GroupName nameFromObjectName(ObjectName obj_name, NamedResolverMap resolvedMap) {
String name = obj_name.getKeyProperty("name");
String type = obj_name.getKeyProperty("type");
String domain = obj_name.getDomain();
Map<String, MetricValue> tags = obj_name.getKeyPropertyLis... | java | private static GroupName nameFromObjectName(ObjectName obj_name, NamedResolverMap resolvedMap) {
String name = obj_name.getKeyProperty("name");
String type = obj_name.getKeyProperty("type");
String domain = obj_name.getDomain();
Map<String, MetricValue> tags = obj_name.getKeyPropertyLis... | [
"private",
"static",
"GroupName",
"nameFromObjectName",
"(",
"ObjectName",
"obj_name",
",",
"NamedResolverMap",
"resolvedMap",
")",
"{",
"String",
"name",
"=",
"obj_name",
".",
"getKeyProperty",
"(",
"\"name\"",
")",
";",
"String",
"type",
"=",
"obj_name",
".",
... | Extract a metric group name from a JMX ObjectName.
@param obj_name a JMX object name from which to derive a metric name.
@param resolvedMap a resolver map to use when generating the group name.
@return A metric name for the given ObjectName, with tags. | [
"Extract",
"a",
"metric",
"group",
"name",
"from",
"a",
"JMX",
"ObjectName",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MBeanGroup.java#L131-L152 | train |
groupon/monsoon | extra/influx/src/main/java/com/github/groupon/monsoon/history/influx/InfluxUtil.java | InfluxUtil.isSorted | static boolean isSorted(Iterable<? extends TimeSeriesCollection> tscIterable) {
final Iterator<? extends TimeSeriesCollection> iter = tscIterable.iterator();
if (!iter.hasNext()) return true; // Empty collection is ordered.
DateTime timestamp = iter.next().getTimestamp();
while (iter.ha... | java | static boolean isSorted(Iterable<? extends TimeSeriesCollection> tscIterable) {
final Iterator<? extends TimeSeriesCollection> iter = tscIterable.iterator();
if (!iter.hasNext()) return true; // Empty collection is ordered.
DateTime timestamp = iter.next().getTimestamp();
while (iter.ha... | [
"static",
"boolean",
"isSorted",
"(",
"Iterable",
"<",
"?",
"extends",
"TimeSeriesCollection",
">",
"tscIterable",
")",
"{",
"final",
"Iterator",
"<",
"?",
"extends",
"TimeSeriesCollection",
">",
"iter",
"=",
"tscIterable",
".",
"iterator",
"(",
")",
";",
"if"... | Validation function, to check if an iterable is sorted with ascending
timestamps.
@param tscIterable An iterable type.
@return True iff the iterable is sorted, false otherwise. | [
"Validation",
"function",
"to",
"check",
"if",
"an",
"iterable",
"is",
"sorted",
"with",
"ascending",
"timestamps",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/extra/influx/src/main/java/com/github/groupon/monsoon/history/influx/InfluxUtil.java#L95-L106 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/ClipBuffer.java | ClipBuffer.resolve | public void resolve (Observer observer)
{
// if we were waiting to unload, cancel that
if (_state == UNLOADING) {
_state = LOADED;
_manager.restoreClip(this);
}
// if we're already loaded, this is easy
if (_state == LOADED) {
if (observer ... | java | public void resolve (Observer observer)
{
// if we were waiting to unload, cancel that
if (_state == UNLOADING) {
_state = LOADED;
_manager.restoreClip(this);
}
// if we're already loaded, this is easy
if (_state == LOADED) {
if (observer ... | [
"public",
"void",
"resolve",
"(",
"Observer",
"observer",
")",
"{",
"// if we were waiting to unload, cancel that",
"if",
"(",
"_state",
"==",
"UNLOADING",
")",
"{",
"_state",
"=",
"LOADED",
";",
"_manager",
".",
"restoreClip",
"(",
"this",
")",
";",
"}",
"// ... | Instructs this buffer to resolve its underlying clip and be ready
to be played ASAP. | [
"Instructs",
"this",
"buffer",
"to",
"resolve",
"its",
"underlying",
"clip",
"and",
"be",
"ready",
"to",
"be",
"played",
"ASAP",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ClipBuffer.java#L120-L164 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/ClipBuffer.java | ClipBuffer.dispose | public void dispose ()
{
if (_buffer != null) {
// if there are sources bound to this buffer, we must wait
// for them to be unbound
if (_bound > 0) {
_state = UNLOADING;
return;
}
// free up our buffer
... | java | public void dispose ()
{
if (_buffer != null) {
// if there are sources bound to this buffer, we must wait
// for them to be unbound
if (_bound > 0) {
_state = UNLOADING;
return;
}
// free up our buffer
... | [
"public",
"void",
"dispose",
"(",
")",
"{",
"if",
"(",
"_buffer",
"!=",
"null",
")",
"{",
"// if there are sources bound to this buffer, we must wait",
"// for them to be unbound",
"if",
"(",
"_bound",
">",
"0",
")",
"{",
"_state",
"=",
"UNLOADING",
";",
"return",... | Frees up the internal audio buffers associated with this clip. | [
"Frees",
"up",
"the",
"internal",
"audio",
"buffers",
"associated",
"with",
"this",
"clip",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ClipBuffer.java#L169-L184 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/ClipBuffer.java | ClipBuffer.bind | protected boolean bind (Clip clip)
{
AL10.alGetError(); // throw away any unchecked error prior to an op we want to check
_buffer.setData(clip.format, clip.data, clip.frequency);
int errno = AL10.alGetError();
if (errno != AL10.AL_NO_ERROR) {
log.warning("Failed to bind c... | java | protected boolean bind (Clip clip)
{
AL10.alGetError(); // throw away any unchecked error prior to an op we want to check
_buffer.setData(clip.format, clip.data, clip.frequency);
int errno = AL10.alGetError();
if (errno != AL10.AL_NO_ERROR) {
log.warning("Failed to bind c... | [
"protected",
"boolean",
"bind",
"(",
"Clip",
"clip",
")",
"{",
"AL10",
".",
"alGetError",
"(",
")",
";",
"// throw away any unchecked error prior to an op we want to check",
"_buffer",
".",
"setData",
"(",
"clip",
".",
"format",
",",
"clip",
".",
"data",
",",
"c... | This method is called back on the main thread and instructs this
buffer to bind the clip data to this buffer's OpenAL buffer.
@return true if the binding succeeded, false if we were unable to
load the sound data into OpenAL. | [
"This",
"method",
"is",
"called",
"back",
"on",
"the",
"main",
"thread",
"and",
"instructs",
"this",
"buffer",
"to",
"bind",
"the",
"clip",
"data",
"to",
"this",
"buffer",
"s",
"OpenAL",
"buffer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ClipBuffer.java#L203-L224 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/ClipBuffer.java | ClipBuffer.failed | protected void failed ()
{
if (_buffer != null) {
_buffer.delete();
_buffer = null;
}
_state = UNLOADED;
_observers.apply(new ObserverList.ObserverOp<Observer>() {
public boolean apply (Observer observer) {
observer.clipFailed(Clip... | java | protected void failed ()
{
if (_buffer != null) {
_buffer.delete();
_buffer = null;
}
_state = UNLOADED;
_observers.apply(new ObserverList.ObserverOp<Observer>() {
public boolean apply (Observer observer) {
observer.clipFailed(Clip... | [
"protected",
"void",
"failed",
"(",
")",
"{",
"if",
"(",
"_buffer",
"!=",
"null",
")",
"{",
"_buffer",
".",
"delete",
"(",
")",
";",
"_buffer",
"=",
"null",
";",
"}",
"_state",
"=",
"UNLOADED",
";",
"_observers",
".",
"apply",
"(",
"new",
"ObserverLi... | Called when we fail in some part of the process in resolving our
clip data. Notifies our observers and resets the clip to the
UNLOADED state. | [
"Called",
"when",
"we",
"fail",
"in",
"some",
"part",
"of",
"the",
"process",
"in",
"resolving",
"our",
"clip",
"data",
".",
"Notifies",
"our",
"observers",
"and",
"resets",
"the",
"clip",
"to",
"the",
"UNLOADED",
"state",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/ClipBuffer.java#L231-L246 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/VolatileMirage.java | VolatileMirage.createVolatileImage | protected void createVolatileImage ()
{
// release any previous volatile image we might hold
if (_image != null) {
_image.flush();
}
// create a new, compatible, volatile image
// _image = _imgr.createVolatileImage(
// _bounds.width, _bounds.height, g... | java | protected void createVolatileImage ()
{
// release any previous volatile image we might hold
if (_image != null) {
_image.flush();
}
// create a new, compatible, volatile image
// _image = _imgr.createVolatileImage(
// _bounds.width, _bounds.height, g... | [
"protected",
"void",
"createVolatileImage",
"(",
")",
"{",
"// release any previous volatile image we might hold",
"if",
"(",
"_image",
"!=",
"null",
")",
"{",
"_image",
".",
"flush",
"(",
")",
";",
"}",
"// create a new, compatible, volatile image",
"// _image = ... | Creates our volatile image from the information in our source
image. | [
"Creates",
"our",
"volatile",
"image",
"from",
"the",
"information",
"in",
"our",
"source",
"image",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/VolatileMirage.java#L140-L155 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/io/PromptHelper.java | PromptHelper.askBoolean | public boolean askBoolean(final String question) {
checkNotNull(question);
log.trace("Ask boolean; question={}", question);
String result = readLine(String.format("%s (yes/no): ", question));
return result.equalsIgnoreCase("yes");
} | java | public boolean askBoolean(final String question) {
checkNotNull(question);
log.trace("Ask boolean; question={}", question);
String result = readLine(String.format("%s (yes/no): ", question));
return result.equalsIgnoreCase("yes");
} | [
"public",
"boolean",
"askBoolean",
"(",
"final",
"String",
"question",
")",
"{",
"checkNotNull",
"(",
"question",
")",
";",
"log",
".",
"trace",
"(",
"\"Ask boolean; question={}\"",
",",
"question",
")",
";",
"String",
"result",
"=",
"readLine",
"(",
"String",... | Ask a question which results in a boolean result. | [
"Ask",
"a",
"question",
"which",
"results",
"in",
"a",
"boolean",
"result",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/io/PromptHelper.java#L63-L68 | train |
threerings/nenya | core/src/main/java/com/threerings/util/KeyTranslatorImpl.java | KeyTranslatorImpl.addPressCommand | public void addPressCommand (int keyCode, String command, int rate)
{
addPressCommand(keyCode, command, rate, DEFAULT_REPEAT_DELAY);
} | java | public void addPressCommand (int keyCode, String command, int rate)
{
addPressCommand(keyCode, command, rate, DEFAULT_REPEAT_DELAY);
} | [
"public",
"void",
"addPressCommand",
"(",
"int",
"keyCode",
",",
"String",
"command",
",",
"int",
"rate",
")",
"{",
"addPressCommand",
"(",
"keyCode",
",",
"command",
",",
"rate",
",",
"DEFAULT_REPEAT_DELAY",
")",
";",
"}"
] | Adds a mapping from a key press to an action command string that will auto-repeat at the
specified repeat rate. Overwrites any existing mapping and repeat rate that may have
already been registered.
@param rate the number of times each second that the key press should be repeated while the
key is down, or <code>0</cod... | [
"Adds",
"a",
"mapping",
"from",
"a",
"key",
"press",
"to",
"an",
"action",
"command",
"string",
"that",
"will",
"auto",
"-",
"repeat",
"at",
"the",
"specified",
"repeat",
"rate",
".",
"Overwrites",
"any",
"existing",
"mapping",
"and",
"repeat",
"rate",
"th... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/KeyTranslatorImpl.java#L55-L58 | train |
threerings/nenya | core/src/main/java/com/threerings/util/KeyTranslatorImpl.java | KeyTranslatorImpl.addPressCommand | public void addPressCommand (int keyCode, String command, int rate, long repeatDelay)
{
KeyRecord krec = getKeyRecord(keyCode);
krec.pressCommand = command;
krec.repeatRate = rate;
krec.repeatDelay = repeatDelay;
} | java | public void addPressCommand (int keyCode, String command, int rate, long repeatDelay)
{
KeyRecord krec = getKeyRecord(keyCode);
krec.pressCommand = command;
krec.repeatRate = rate;
krec.repeatDelay = repeatDelay;
} | [
"public",
"void",
"addPressCommand",
"(",
"int",
"keyCode",
",",
"String",
"command",
",",
"int",
"rate",
",",
"long",
"repeatDelay",
")",
"{",
"KeyRecord",
"krec",
"=",
"getKeyRecord",
"(",
"keyCode",
")",
";",
"krec",
".",
"pressCommand",
"=",
"command",
... | Adds a mapping from a key press to an action command string that will auto-repeat at the
specified repeat rate after the specified auto-repeat delay has expired. Overwrites any
existing mapping for the specified key code that may have already been registered.
@param rate the number of times each second that the key pr... | [
"Adds",
"a",
"mapping",
"from",
"a",
"key",
"press",
"to",
"an",
"action",
"command",
"string",
"that",
"will",
"auto",
"-",
"repeat",
"at",
"the",
"specified",
"repeat",
"rate",
"after",
"the",
"specified",
"auto",
"-",
"repeat",
"delay",
"has",
"expired"... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/KeyTranslatorImpl.java#L70-L76 | train |
threerings/nenya | core/src/main/java/com/threerings/util/KeyTranslatorImpl.java | KeyTranslatorImpl.addReleaseCommand | public void addReleaseCommand (int keyCode, String command)
{
KeyRecord krec = getKeyRecord(keyCode);
krec.releaseCommand = command;
} | java | public void addReleaseCommand (int keyCode, String command)
{
KeyRecord krec = getKeyRecord(keyCode);
krec.releaseCommand = command;
} | [
"public",
"void",
"addReleaseCommand",
"(",
"int",
"keyCode",
",",
"String",
"command",
")",
"{",
"KeyRecord",
"krec",
"=",
"getKeyRecord",
"(",
"keyCode",
")",
";",
"krec",
".",
"releaseCommand",
"=",
"command",
";",
"}"
] | Adds a mapping from a key release to an action command string. Overwrites any existing
mapping that may already have been registered. | [
"Adds",
"a",
"mapping",
"from",
"a",
"key",
"release",
"to",
"an",
"action",
"command",
"string",
".",
"Overwrites",
"any",
"existing",
"mapping",
"that",
"may",
"already",
"have",
"been",
"registered",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/KeyTranslatorImpl.java#L82-L86 | train |
threerings/nenya | core/src/main/java/com/threerings/util/KeyTranslatorImpl.java | KeyTranslatorImpl.getKeyRecord | protected KeyRecord getKeyRecord (int keyCode)
{
KeyRecord krec = _keys.get(keyCode);
if (krec == null) {
krec = new KeyRecord();
_keys.put(keyCode, krec);
}
return krec;
} | java | protected KeyRecord getKeyRecord (int keyCode)
{
KeyRecord krec = _keys.get(keyCode);
if (krec == null) {
krec = new KeyRecord();
_keys.put(keyCode, krec);
}
return krec;
} | [
"protected",
"KeyRecord",
"getKeyRecord",
"(",
"int",
"keyCode",
")",
"{",
"KeyRecord",
"krec",
"=",
"_keys",
".",
"get",
"(",
"keyCode",
")",
";",
"if",
"(",
"krec",
"==",
"null",
")",
"{",
"krec",
"=",
"new",
"KeyRecord",
"(",
")",
";",
"_keys",
".... | Returns the key record for the specified key, creating it and inserting it in the key table
if necessary. | [
"Returns",
"the",
"key",
"record",
"for",
"the",
"specified",
"key",
"creating",
"it",
"and",
"inserting",
"it",
"in",
"the",
"key",
"table",
"if",
"necessary",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/KeyTranslatorImpl.java#L92-L100 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.addSprite | public void addSprite (Sprite sprite)
{
_metamgr.addSprite(sprite);
if (((sprite instanceof ActionSprite) ||
(sprite instanceof HoverSprite)) && (_actionSpriteCount++ == 0)) {
if (_actionHandler == null) {
_actionHandler = createActionSpriteHandler();
... | java | public void addSprite (Sprite sprite)
{
_metamgr.addSprite(sprite);
if (((sprite instanceof ActionSprite) ||
(sprite instanceof HoverSprite)) && (_actionSpriteCount++ == 0)) {
if (_actionHandler == null) {
_actionHandler = createActionSpriteHandler();
... | [
"public",
"void",
"addSprite",
"(",
"Sprite",
"sprite",
")",
"{",
"_metamgr",
".",
"addSprite",
"(",
"sprite",
")",
";",
"if",
"(",
"(",
"(",
"sprite",
"instanceof",
"ActionSprite",
")",
"||",
"(",
"sprite",
"instanceof",
"HoverSprite",
")",
")",
"&&",
"... | Adds a sprite to this panel. | [
"Adds",
"a",
"sprite",
"to",
"this",
"panel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L166-L178 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.removeSprite | public void removeSprite (Sprite sprite)
{
_metamgr.removeSprite(sprite);
if (((sprite instanceof ActionSprite) ||
(sprite instanceof HoverSprite)) && (--_actionSpriteCount == 0)) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
... | java | public void removeSprite (Sprite sprite)
{
_metamgr.removeSprite(sprite);
if (((sprite instanceof ActionSprite) ||
(sprite instanceof HoverSprite)) && (--_actionSpriteCount == 0)) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
... | [
"public",
"void",
"removeSprite",
"(",
"Sprite",
"sprite",
")",
"{",
"_metamgr",
".",
"removeSprite",
"(",
"sprite",
")",
";",
"if",
"(",
"(",
"(",
"sprite",
"instanceof",
"ActionSprite",
")",
"||",
"(",
"sprite",
"instanceof",
"HoverSprite",
")",
")",
"&&... | Removes a sprite from this panel. | [
"Removes",
"a",
"sprite",
"from",
"this",
"panel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L191-L200 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.clearSprites | public void clearSprites ()
{
_metamgr.clearSprites();
if (_actionHandler != null) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
_actionSpriteCount = 0;
}
} | java | public void clearSprites ()
{
_metamgr.clearSprites();
if (_actionHandler != null) {
removeMouseListener(_actionHandler);
removeMouseMotionListener(_actionHandler);
_actionSpriteCount = 0;
}
} | [
"public",
"void",
"clearSprites",
"(",
")",
"{",
"_metamgr",
".",
"clearSprites",
"(",
")",
";",
"if",
"(",
"_actionHandler",
"!=",
"null",
")",
"{",
"removeMouseListener",
"(",
"_actionHandler",
")",
";",
"removeMouseMotionListener",
"(",
"_actionHandler",
")",... | Removes all sprites from this panel. | [
"Removes",
"all",
"sprites",
"from",
"this",
"panel",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L205-L214 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.tick | public void tick (long tickStamp)
{
if (_metamgr.isPaused()) {
return;
}
// let derived classes do their business
willTick(tickStamp);
// tick our meta manager which will tick our sprites and animations
_metamgr.tick(tickStamp);
// let derived c... | java | public void tick (long tickStamp)
{
if (_metamgr.isPaused()) {
return;
}
// let derived classes do their business
willTick(tickStamp);
// tick our meta manager which will tick our sprites and animations
_metamgr.tick(tickStamp);
// let derived c... | [
"public",
"void",
"tick",
"(",
"long",
"tickStamp",
")",
"{",
"if",
"(",
"_metamgr",
".",
"isPaused",
"(",
")",
")",
"{",
"return",
";",
"}",
"// let derived classes do their business",
"willTick",
"(",
"tickStamp",
")",
";",
"// tick our meta manager which will t... | from interface FrameParticipant | [
"from",
"interface",
"FrameParticipant"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L256-L273 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.addObscurer | public void addObscurer (Obscurer obscurer) {
if (_obscurerList == null) {
_obscurerList = Lists.newArrayList();
}
_obscurerList.add(obscurer);
} | java | public void addObscurer (Obscurer obscurer) {
if (_obscurerList == null) {
_obscurerList = Lists.newArrayList();
}
_obscurerList.add(obscurer);
} | [
"public",
"void",
"addObscurer",
"(",
"Obscurer",
"obscurer",
")",
"{",
"if",
"(",
"_obscurerList",
"==",
"null",
")",
"{",
"_obscurerList",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"}",
"_obscurerList",
".",
"add",
"(",
"obscurer",
")",
";",
"}... | Adds an element that could be obscuring the panel and thus requires extra redrawing. | [
"Adds",
"an",
"element",
"that",
"could",
"be",
"obscuring",
"the",
"panel",
"and",
"thus",
"requires",
"extra",
"redrawing",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L366-L371 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.addObscurerDirtyRegions | protected void addObscurerDirtyRegions (boolean changedOnly)
{
if (_obscurerList != null) {
for (Obscurer obscurer : _obscurerList) {
Rectangle obscured = obscurer.getObscured(changedOnly);
if (obscured != null) {
Point pt = new Point(obscured.... | java | protected void addObscurerDirtyRegions (boolean changedOnly)
{
if (_obscurerList != null) {
for (Obscurer obscurer : _obscurerList) {
Rectangle obscured = obscurer.getObscured(changedOnly);
if (obscured != null) {
Point pt = new Point(obscured.... | [
"protected",
"void",
"addObscurerDirtyRegions",
"(",
"boolean",
"changedOnly",
")",
"{",
"if",
"(",
"_obscurerList",
"!=",
"null",
")",
"{",
"for",
"(",
"Obscurer",
"obscurer",
":",
"_obscurerList",
")",
"{",
"Rectangle",
"obscured",
"=",
"obscurer",
".",
"get... | Add dirty regions for all our obscurers. | [
"Add",
"dirty",
"regions",
"for",
"all",
"our",
"obscurers",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L385-L398 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaPanel.java | MediaPanel.paintDirtyRect | protected void paintDirtyRect (Graphics2D gfx, Rectangle rect)
{
// paint the behind the scenes stuff
paintBehind(gfx, rect);
// paint back sprites and animations
paintBits(gfx, AnimationManager.BACK, rect);
// paint the between the scenes stuff
paintBetween(gfx, re... | java | protected void paintDirtyRect (Graphics2D gfx, Rectangle rect)
{
// paint the behind the scenes stuff
paintBehind(gfx, rect);
// paint back sprites and animations
paintBits(gfx, AnimationManager.BACK, rect);
// paint the between the scenes stuff
paintBetween(gfx, re... | [
"protected",
"void",
"paintDirtyRect",
"(",
"Graphics2D",
"gfx",
",",
"Rectangle",
"rect",
")",
"{",
"// paint the behind the scenes stuff",
"paintBehind",
"(",
"gfx",
",",
"rect",
")",
";",
"// paint back sprites and animations",
"paintBits",
"(",
"gfx",
",",
"Animat... | Paints all the layers of the specified dirty region. | [
"Paints",
"all",
"the",
"layers",
"of",
"the",
"specified",
"dirty",
"region",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaPanel.java#L460-L476 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/comm/HttpUtil.java | HttpUtil.getEntityEncoding | public static String getEntityEncoding(HttpEntity entity) {
final Header header = entity.getContentEncoding();
if (header == null)
return null;
return header.getValue();
} | java | public static String getEntityEncoding(HttpEntity entity) {
final Header header = entity.getContentEncoding();
if (header == null)
return null;
return header.getValue();
} | [
"public",
"static",
"String",
"getEntityEncoding",
"(",
"HttpEntity",
"entity",
")",
"{",
"final",
"Header",
"header",
"=",
"entity",
".",
"getContentEncoding",
"(",
")",
";",
"if",
"(",
"header",
"==",
"null",
")",
"return",
"null",
";",
"return",
"header",... | Returns entity encoding.
@param entity
entitity to get encoding.
@return entity encoding string. | [
"Returns",
"entity",
"encoding",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/comm/HttpUtil.java#L98-L103 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/comm/HttpUtil.java | HttpUtil.getCharset | public static String getCharset(HttpEntity entity) {
final String guess = EntityUtils.getContentCharSet(entity);
return guess == null ? HTTP.DEFAULT_CONTENT_CHARSET : guess;
} | java | public static String getCharset(HttpEntity entity) {
final String guess = EntityUtils.getContentCharSet(entity);
return guess == null ? HTTP.DEFAULT_CONTENT_CHARSET : guess;
} | [
"public",
"static",
"String",
"getCharset",
"(",
"HttpEntity",
"entity",
")",
"{",
"final",
"String",
"guess",
"=",
"EntityUtils",
".",
"getContentCharSet",
"(",
"entity",
")",
";",
"return",
"guess",
"==",
"null",
"?",
"HTTP",
".",
"DEFAULT_CONTENT_CHARSET",
... | Returns entity charset to use.
@param entity
entity to check.
@return entity charset to use in decoding. | [
"Returns",
"entity",
"charset",
"to",
"use",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/comm/HttpUtil.java#L112-L115 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatLogic.java | ChatLogic.decodeFormat | public Tuple<String, Boolean> decodeFormat (int type, String format)
{
boolean quotes = true;
switch (placeOf(type)) {
// derived classes may wish to change the format here based on the place
case PLACE:
switch (modeOf(type)) {
case EMOTE:
quot... | java | public Tuple<String, Boolean> decodeFormat (int type, String format)
{
boolean quotes = true;
switch (placeOf(type)) {
// derived classes may wish to change the format here based on the place
case PLACE:
switch (modeOf(type)) {
case EMOTE:
quot... | [
"public",
"Tuple",
"<",
"String",
",",
"Boolean",
">",
"decodeFormat",
"(",
"int",
"type",
",",
"String",
"format",
")",
"{",
"boolean",
"quotes",
"=",
"true",
";",
"switch",
"(",
"placeOf",
"(",
"type",
")",
")",
"{",
"// derived classes may wish to change ... | Determines the format string and whether to use quotes based on the chat type. | [
"Determines",
"the",
"format",
"string",
"and",
"whether",
"to",
"use",
"quotes",
"based",
"on",
"the",
"chat",
"type",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatLogic.java#L99-L113 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatLogic.java | ChatLogic.decodeType | public int decodeType (String localtype)
{
if (ChatCodes.USER_CHAT_TYPE.equals(localtype)) {
return TELL;
} else if (ChatCodes.PLACE_CHAT_TYPE.equals(localtype)) {
return PLACE;
} else {
return 0;
}
} | java | public int decodeType (String localtype)
{
if (ChatCodes.USER_CHAT_TYPE.equals(localtype)) {
return TELL;
} else if (ChatCodes.PLACE_CHAT_TYPE.equals(localtype)) {
return PLACE;
} else {
return 0;
}
} | [
"public",
"int",
"decodeType",
"(",
"String",
"localtype",
")",
"{",
"if",
"(",
"ChatCodes",
".",
"USER_CHAT_TYPE",
".",
"equals",
"(",
"localtype",
")",
")",
"{",
"return",
"TELL",
";",
"}",
"else",
"if",
"(",
"ChatCodes",
".",
"PLACE_CHAT_TYPE",
".",
"... | Decodes the main chat type given the supplied localtype provided by the chat system. | [
"Decodes",
"the",
"main",
"chat",
"type",
"given",
"the",
"supplied",
"localtype",
"provided",
"by",
"the",
"chat",
"system",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatLogic.java#L118-L127 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatLogic.java | ChatLogic.adjustTypeByMode | public int adjustTypeByMode (int mode, int type)
{
switch (mode) {
case ChatCodes.DEFAULT_MODE:
return type | SPEAK;
case ChatCodes.EMOTE_MODE:
return type | EMOTE;
case ChatCodes.THINK_MODE:
return type | THINK;
case ChatCodes.SHOUT_MODE:
... | java | public int adjustTypeByMode (int mode, int type)
{
switch (mode) {
case ChatCodes.DEFAULT_MODE:
return type | SPEAK;
case ChatCodes.EMOTE_MODE:
return type | EMOTE;
case ChatCodes.THINK_MODE:
return type | THINK;
case ChatCodes.SHOUT_MODE:
... | [
"public",
"int",
"adjustTypeByMode",
"(",
"int",
"mode",
",",
"int",
"type",
")",
"{",
"switch",
"(",
"mode",
")",
"{",
"case",
"ChatCodes",
".",
"DEFAULT_MODE",
":",
"return",
"type",
"|",
"SPEAK",
";",
"case",
"ChatCodes",
".",
"EMOTE_MODE",
":",
"retu... | Adjust the chat type based on the mode of the chat message. | [
"Adjust",
"the",
"chat",
"type",
"based",
"on",
"the",
"mode",
"of",
"the",
"chat",
"message",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatLogic.java#L132-L148 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatLogic.java | ChatLogic.getOutlineColor | public Color getOutlineColor (int type)
{
switch (type) {
case BROADCAST:
return BROADCAST_COLOR;
case TELL:
return TELL_COLOR;
case TELLFEEDBACK:
return TELLFEEDBACK_COLOR;
case INFO:
return INFO_COLOR;
case FEEDBACK:
... | java | public Color getOutlineColor (int type)
{
switch (type) {
case BROADCAST:
return BROADCAST_COLOR;
case TELL:
return TELL_COLOR;
case TELLFEEDBACK:
return TELLFEEDBACK_COLOR;
case INFO:
return INFO_COLOR;
case FEEDBACK:
... | [
"public",
"Color",
"getOutlineColor",
"(",
"int",
"type",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"BROADCAST",
":",
"return",
"BROADCAST_COLOR",
";",
"case",
"TELL",
":",
"return",
"TELL_COLOR",
";",
"case",
"TELLFEEDBACK",
":",
"return",
"TELLFEE... | Computes the chat glyph outline color from the chat message type. | [
"Computes",
"the",
"chat",
"glyph",
"outline",
"color",
"from",
"the",
"chat",
"message",
"type",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatLogic.java#L169-L187 | train |
threerings/nenya | tools/src/main/java/com/threerings/miso/tools/xml/SparseMisoSceneParser.java | SparseMisoSceneParser.parseScene | public SparseMisoSceneModel parseScene (String path)
throws IOException, SAXException
{
_model = null;
_digester.push(this);
FileInputStream stream = null;
try {
stream = new FileInputStream(path);
_digester.parse(stream);
} finally {
... | java | public SparseMisoSceneModel parseScene (String path)
throws IOException, SAXException
{
_model = null;
_digester.push(this);
FileInputStream stream = null;
try {
stream = new FileInputStream(path);
_digester.parse(stream);
} finally {
... | [
"public",
"SparseMisoSceneModel",
"parseScene",
"(",
"String",
"path",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"_model",
"=",
"null",
";",
"_digester",
".",
"push",
"(",
"this",
")",
";",
"FileInputStream",
"stream",
"=",
"null",
";",
"try",
... | Parses the XML file at the specified path into a scene model
instance. | [
"Parses",
"the",
"XML",
"file",
"at",
"the",
"specified",
"path",
"into",
"a",
"scene",
"model",
"instance",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/miso/tools/xml/SparseMisoSceneParser.java#L70-L83 | train |
groupon/monsoon | expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java | PathMatcher.valueOf | public static PathMatcher valueOf(String str) throws ParseException {
try {
return valueOf(new StringReader(str));
} catch (IOException ex) {
throw new IllegalStateException("StringReader IO error?", ex);
}
} | java | public static PathMatcher valueOf(String str) throws ParseException {
try {
return valueOf(new StringReader(str));
} catch (IOException ex) {
throw new IllegalStateException("StringReader IO error?", ex);
}
} | [
"public",
"static",
"PathMatcher",
"valueOf",
"(",
"String",
"str",
")",
"throws",
"ParseException",
"{",
"try",
"{",
"return",
"valueOf",
"(",
"new",
"StringReader",
"(",
"str",
")",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"throw",
"... | Read path matcher from string.
@param str A string containing a path expression.
@return A PathMatcher corresponding to the parsed input
from the string.
@throws
com.groupon.lex.metrics.PathMatcher.ParseException
on invalid path expression. | [
"Read",
"path",
"matcher",
"from",
"string",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java#L386-L392 | train |
groupon/monsoon | expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java | PathMatcher.valueOf | public static PathMatcher valueOf(Reader reader) throws IOException, ParseException {
class DescriptiveErrorListener extends BaseErrorListener {
public List<String> errors = new ArrayList<>();
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSym... | java | public static PathMatcher valueOf(Reader reader) throws IOException, ParseException {
class DescriptiveErrorListener extends BaseErrorListener {
public List<String> errors = new ArrayList<>();
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSym... | [
"public",
"static",
"PathMatcher",
"valueOf",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"class",
"DescriptiveErrorListener",
"extends",
"BaseErrorListener",
"{",
"public",
"List",
"<",
"String",
">",
"errors",
"=",
"new",
"... | Read path matcher from reader.
@param reader A reader supplying the input of a path expression.
@return A PathMatcher corresponding to the parsed input
from the reader.
@throws IOException on IO errors from the reader.
@throws
com.groupon.lex.metrics.PathMatcher.ParseException
on invalid path expression. | [
"Read",
"path",
"matcher",
"from",
"reader",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/expr/src/main/java/com/groupon/lex/metrics/PathMatcher.java#L405-L447 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.getChannelListeners | public List<ChannelListener> getChannelListeners() {
if (changes == null) {
return (List<ChannelListener>)Collections.EMPTY_LIST;
}
List<EventListener> listeners = changes.getListenerList(AMQP);
if ((listeners == null) || listeners.isEmpty()) {
return (List<Chann... | java | public List<ChannelListener> getChannelListeners() {
if (changes == null) {
return (List<ChannelListener>)Collections.EMPTY_LIST;
}
List<EventListener> listeners = changes.getListenerList(AMQP);
if ((listeners == null) || listeners.isEmpty()) {
return (List<Chann... | [
"public",
"List",
"<",
"ChannelListener",
">",
"getChannelListeners",
"(",
")",
"{",
"if",
"(",
"changes",
"==",
"null",
")",
"{",
"return",
"(",
"List",
"<",
"ChannelListener",
">",
")",
"Collections",
".",
"EMPTY_LIST",
";",
"}",
"List",
"<",
"EventListe... | Returns the list of ChannelListeners registered with this AmqpChannel instance.
@return List<ChannelListener> list of ChannelListeners | [
"Returns",
"the",
"list",
"of",
"ChannelListeners",
"registered",
"with",
"this",
"AmqpChannel",
"instance",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L144-L160 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.openChannel | AmqpChannel openChannel() {
if (readyState == ReadyState.OPEN) {
// If the channel is already open, just bail.
return this;
}
// try {
Object[] args = {""};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg =... | java | AmqpChannel openChannel() {
if (readyState == ReadyState.OPEN) {
// If the channel is already open, just bail.
return this;
}
// try {
Object[] args = {""};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg =... | [
"AmqpChannel",
"openChannel",
"(",
")",
"{",
"if",
"(",
"readyState",
"==",
"ReadyState",
".",
"OPEN",
")",
"{",
"// If the channel is already open, just bail.",
"return",
"this",
";",
"}",
"// try {",
"Object",
"[",
"]",
"args",
"=",
"{",
"\"\"",
"}",
";",
... | Creates a Channel to the AMQP server on the given clients connection
@return AmqpChannel | [
"Creates",
"a",
"Channel",
"to",
"the",
"AMQP",
"server",
"on",
"the",
"given",
"clients",
"connection"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L309-L338 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.flowChannel | public AmqpChannel flowChannel(boolean active) {
isFlowOn = active;
Object[] args = {active};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodId = "20" + "20";
String methodName = "flowChannel";
AmqpMethod amqpMethod = Me... | java | public AmqpChannel flowChannel(boolean active) {
isFlowOn = active;
Object[] args = {active};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodId = "20" + "20";
String methodName = "flowChannel";
AmqpMethod amqpMethod = Me... | [
"public",
"AmqpChannel",
"flowChannel",
"(",
"boolean",
"active",
")",
"{",
"isFlowOn",
"=",
"active",
";",
"Object",
"[",
"]",
"args",
"=",
"{",
"active",
"}",
";",
"WrappedByteBuffer",
"bodyArg",
"=",
"null",
";",
"HashMap",
"<",
"String",
",",
"Object",... | This method asks the peer to pause or restart the flow of content data sent by a consumer. This is a simple flow-control mechanism that a peer can use to
avoid overflowing its queues or otherwise finding itself receiving more messages than it can process.
@param enabled
If true, the peer starts sending content frames,... | [
"This",
"method",
"asks",
"the",
"peer",
"to",
"pause",
"or",
"restart",
"the",
"flow",
"of",
"content",
"data",
"sent",
"by",
"a",
"consumer",
".",
"This",
"is",
"a",
"simple",
"flow",
"-",
"control",
"mechanism",
"that",
"a",
"peer",
"can",
"use",
"t... | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L348-L363 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.closeChannel | public AmqpChannel closeChannel(int replyCode, String replyText, int classId, int methodId1) {
if (readyState == ReadyState.CLOSED) {
return this;
}
Object[] args = {replyCode, replyText, classId, methodId1};
WrappedByteBuffer bodyArg = null;
HashMap<String, ... | java | public AmqpChannel closeChannel(int replyCode, String replyText, int classId, int methodId1) {
if (readyState == ReadyState.CLOSED) {
return this;
}
Object[] args = {replyCode, replyText, classId, methodId1};
WrappedByteBuffer bodyArg = null;
HashMap<String, ... | [
"public",
"AmqpChannel",
"closeChannel",
"(",
"int",
"replyCode",
",",
"String",
"replyText",
",",
"int",
"classId",
",",
"int",
"methodId1",
")",
"{",
"if",
"(",
"readyState",
"==",
"ReadyState",
".",
"CLOSED",
")",
"{",
"return",
"this",
";",
"}",
"Objec... | This method indicates that the sender wants to close the channel.
@param replyCode
@param replyText
@param classId
@param methodId1
@return AmqpChannel | [
"This",
"method",
"indicates",
"that",
"the",
"sender",
"wants",
"to",
"close",
"the",
"channel",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L395-L410 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.closeOkChannel | private AmqpChannel closeOkChannel() {
if (readyState == ReadyState.CLOSED) {
// If the channel has been closed, just bail.
return this;
}
Object[] args = {};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
St... | java | private AmqpChannel closeOkChannel() {
if (readyState == ReadyState.CLOSED) {
// If the channel has been closed, just bail.
return this;
}
Object[] args = {};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
St... | [
"private",
"AmqpChannel",
"closeOkChannel",
"(",
")",
"{",
"if",
"(",
"readyState",
"==",
"ReadyState",
".",
"CLOSED",
")",
"{",
"// If the channel has been closed, just bail.",
"return",
"this",
";",
"}",
"Object",
"[",
"]",
"args",
"=",
"{",
"}",
";",
"Wrapp... | Confirms to the peer that a flow command was received and processed.
@return AmqpChannel | [
"Confirms",
"to",
"the",
"peer",
"that",
"a",
"flow",
"command",
"was",
"received",
"and",
"processed",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L417-L433 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.deleteQueue | public AmqpChannel deleteQueue(String queue, boolean ifUnused, boolean ifEmpty, boolean noWait) {
Object[] args = {0, queue, ifUnused, ifEmpty, noWait};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "deleteQueue";
String methodI... | java | public AmqpChannel deleteQueue(String queue, boolean ifUnused, boolean ifEmpty, boolean noWait) {
Object[] args = {0, queue, ifUnused, ifEmpty, noWait};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "deleteQueue";
String methodI... | [
"public",
"AmqpChannel",
"deleteQueue",
"(",
"String",
"queue",
",",
"boolean",
"ifUnused",
",",
"boolean",
"ifEmpty",
",",
"boolean",
"noWait",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"0",
",",
"queue",
",",
"ifUnused",
",",
"ifEmpty",
",",
"noW... | This method deletes a queue. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration,
and all consumers on the queue are canceled.
@param queue
@param ifUnused
@param ifEmpty
@param noWait
@return AmqpChannel | [
"This",
"method",
"deletes",
"a",
"queue",
".",
"When",
"a",
"queue",
"is",
"deleted",
"any",
"pending",
"messages",
"are",
"sent",
"to",
"a",
"dead",
"-",
"letter",
"queue",
"if",
"this",
"is",
"defined",
"in",
"the",
"server",
"configuration",
"and",
"... | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L563-L589 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.unbindQueue | public AmqpChannel unbindQueue(String queue, String exchange, String routingKey, AmqpArguments arguments) {
Object[] args = {0, queue, exchange, routingKey, arguments};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "unbindQueue";
... | java | public AmqpChannel unbindQueue(String queue, String exchange, String routingKey, AmqpArguments arguments) {
Object[] args = {0, queue, exchange, routingKey, arguments};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "unbindQueue";
... | [
"public",
"AmqpChannel",
"unbindQueue",
"(",
"String",
"queue",
",",
"String",
"exchange",
",",
"String",
"routingKey",
",",
"AmqpArguments",
"arguments",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"0",
",",
"queue",
",",
"exchange",
",",
"routingKey",
... | This method unbinds a queue from an exchange.
@param queue
@param exchange
@param routingKey
@param arguments
@return AmqpChannel | [
"This",
"method",
"unbinds",
"a",
"queue",
"from",
"an",
"exchange",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L638-L649 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.qosBasic | public AmqpChannel qosBasic(int prefetchSize, int prefetchCount, boolean global) {
Object[] args = {prefetchSize, prefetchCount, global};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "qosBasic";
String methodId = "60" + "10";
... | java | public AmqpChannel qosBasic(int prefetchSize, int prefetchCount, boolean global) {
Object[] args = {prefetchSize, prefetchCount, global};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "qosBasic";
String methodId = "60" + "10";
... | [
"public",
"AmqpChannel",
"qosBasic",
"(",
"int",
"prefetchSize",
",",
"int",
"prefetchCount",
",",
"boolean",
"global",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"prefetchSize",
",",
"prefetchCount",
",",
"global",
"}",
";",
"WrappedByteBuffer",
"bodyArg... | This method requests a specific quality of service. The QoS can be specified for the current channel or for all channels on the connection. The
particular properties and semantics of a qos method always depend on the content class semantics. Though the qos method could in principle apply to both
peers, it is currently ... | [
"This",
"method",
"requests",
"a",
"specific",
"quality",
"of",
"service",
".",
"The",
"QoS",
"can",
"be",
"specified",
"for",
"the",
"current",
"channel",
"or",
"for",
"all",
"channels",
"on",
"the",
"connection",
".",
"The",
"particular",
"properties",
"an... | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L699-L710 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.publishBasic | public AmqpChannel publishBasic(ByteBuffer body, AmqpProperties properties, String exchange, String routingKey, boolean mandatory, boolean immediate) {
@SuppressWarnings("unchecked")
Map<String, Object> amqpProps = (Map<String, Object>)Collections.EMPTY_MAP;
if (properties != null) {
... | java | public AmqpChannel publishBasic(ByteBuffer body, AmqpProperties properties, String exchange, String routingKey, boolean mandatory, boolean immediate) {
@SuppressWarnings("unchecked")
Map<String, Object> amqpProps = (Map<String, Object>)Collections.EMPTY_MAP;
if (properties != null) {
... | [
"public",
"AmqpChannel",
"publishBasic",
"(",
"ByteBuffer",
"body",
",",
"AmqpProperties",
"properties",
",",
"String",
"exchange",
",",
"String",
"routingKey",
",",
"boolean",
"mandatory",
",",
"boolean",
"immediate",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"un... | This method publishes a message to a specific exchange. The message will be routed to queues as defined by the exchange configuration and distributed to
any active consumers when the transaction, if any, is committed.
@param body
@param headers
@param exchange
@param routingKey
@param mandatory
@param immediate
@retur... | [
"This",
"method",
"publishes",
"a",
"message",
"to",
"a",
"specific",
"exchange",
".",
"The",
"message",
"will",
"be",
"routed",
"to",
"queues",
"as",
"defined",
"by",
"the",
"exchange",
"configuration",
"and",
"distributed",
"to",
"any",
"active",
"consumers"... | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L834-L843 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.getBasic | public AmqpChannel getBasic(String queue, boolean noAck) {
Object[] args = {0, queue, noAck};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "getBasic";
String methodId = "60" + "70";
AmqpMethod amqpMethod = MethodLookup.... | java | public AmqpChannel getBasic(String queue, boolean noAck) {
Object[] args = {0, queue, noAck};
WrappedByteBuffer bodyArg = null;
HashMap<String, Object> headersArg = null;
String methodName = "getBasic";
String methodId = "60" + "70";
AmqpMethod amqpMethod = MethodLookup.... | [
"public",
"AmqpChannel",
"getBasic",
"(",
"String",
"queue",
",",
"boolean",
"noAck",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"0",
",",
"queue",
",",
"noAck",
"}",
";",
"WrappedByteBuffer",
"bodyArg",
"=",
"null",
";",
"HashMap",
"<",
"String",
... | Gets messages from the queue and dispatches it to the listener
@param queue
@param noAck
@return AmqpChannel | [
"Gets",
"messages",
"from",
"the",
"queue",
"and",
"dispatches",
"it",
"to",
"the",
"listener"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L852-L863 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnOpen | private void fireOnOpen(ChannelEvent e) {
if (readyState == ReadyState.OPEN) {
// If the channel has already been opened, then we should not fire
// any events.
return;
}
readyState = ReadyState.OPEN;
List<EventListener> listeners = changes.ge... | java | private void fireOnOpen(ChannelEvent e) {
if (readyState == ReadyState.OPEN) {
// If the channel has already been opened, then we should not fire
// any events.
return;
}
readyState = ReadyState.OPEN;
List<EventListener> listeners = changes.ge... | [
"private",
"void",
"fireOnOpen",
"(",
"ChannelEvent",
"e",
")",
"{",
"if",
"(",
"readyState",
"==",
"ReadyState",
".",
"OPEN",
")",
"{",
"// If the channel has already been opened, then we should not fire",
"// any events.",
"return",
";",
"}",
"readyState",
"=",
"Rea... | Fired when channel is opened
@param e | [
"Fired",
"when",
"channel",
"is",
"opened"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1265-L1278 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnDeclareExchange | private void fireOnDeclareExchange(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onDeclareExchange(e);
}
} | java | private void fireOnDeclareExchange(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onDeclareExchange(e);
}
} | [
"private",
"void",
"fireOnDeclareExchange",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
... | Fired when exchange is declared
@param e | [
"Fired",
"when",
"exchange",
"is",
"declared"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1285-L1291 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnDeclareQueue | private void fireOnDeclareQueue(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onDeclareQueue(e);
}
} | java | private void fireOnDeclareQueue(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onDeclareQueue(e);
}
} | [
"private",
"void",
"fireOnDeclareQueue",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
"... | Fired when Queue is declared
@param e | [
"Fired",
"when",
"Queue",
"is",
"declared"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1298-L1304 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnBindQueue | private void fireOnBindQueue(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onBindQueue(e);
}
} | java | private void fireOnBindQueue(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onBindQueue(e);
}
} | [
"private",
"void",
"fireOnBindQueue",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
"Cha... | Fired when Queue is bound
@param e | [
"Fired",
"when",
"Queue",
"is",
"bound"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1311-L1317 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnConsumeBasic | private void fireOnConsumeBasic(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onConsumeBasic(e);
}
} | java | private void fireOnConsumeBasic(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onConsumeBasic(e);
}
} | [
"private",
"void",
"fireOnConsumeBasic",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
"... | Fired on consume basic
@param e | [
"Fired",
"on",
"consume",
"basic"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1324-L1330 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnCommitTransaction | private void fireOnCommitTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onCommit(e);
}
} | java | private void fireOnCommitTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onCommit(e);
}
} | [
"private",
"void",
"fireOnCommitTransaction",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{"... | Fired on transaction commit
@param e | [
"Fired",
"on",
"transaction",
"commit"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1337-L1343 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnRollbackTransaction | private void fireOnRollbackTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onRollback(e);
}
} | java | private void fireOnRollbackTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onRollback(e);
}
} | [
"private",
"void",
"fireOnRollbackTransaction",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"... | Fired on transaction rollbacked
@param e | [
"Fired",
"on",
"transaction",
"rollbacked"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1350-L1356 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnSelectTransaction | private void fireOnSelectTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onSelect(e);
}
} | java | private void fireOnSelectTransaction(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onSelect(e);
}
} | [
"private",
"void",
"fireOnSelectTransaction",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{"... | Fired on transaction select
@param e | [
"Fired",
"on",
"transaction",
"select"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1363-L1369 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java | AmqpChannel.fireOnMessage | private void fireOnMessage(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onMessage(e);
}
} | java | private void fireOnMessage(ChannelEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ChannelListener amqpListener = (ChannelListener)listener;
amqpListener.onMessage(e);
}
} | [
"private",
"void",
"fireOnMessage",
"(",
"ChannelEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
"Chann... | Fired on message retreival
@param e | [
"Fired",
"on",
"message",
"retreival"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpChannel.java#L1376-L1382 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.