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/internal/RedmineJSONParser.java | RedmineJSONParser.parseStatus | public static IssueStatus parseStatus(JSONObject object)
throws JSONException {
final int id = JsonInput.getInt(object, "id");
final String name = JsonInput.getStringNotNull(object, "name");
final IssueStatus result = new IssueStatus(id, name);
if (object.has("is_default"))
result.setDefaultStatus(JsonInp... | java | public static IssueStatus parseStatus(JSONObject object)
throws JSONException {
final int id = JsonInput.getInt(object, "id");
final String name = JsonInput.getStringNotNull(object, "name");
final IssueStatus result = new IssueStatus(id, name);
if (object.has("is_default"))
result.setDefaultStatus(JsonInp... | [
"public",
"static",
"IssueStatus",
"parseStatus",
"(",
"JSONObject",
"object",
")",
"throws",
"JSONException",
"{",
"final",
"int",
"id",
"=",
"JsonInput",
".",
"getInt",
"(",
"object",
",",
"\"id\"",
")",
";",
"final",
"String",
"name",
"=",
"JsonInput",
".... | Parses a status.
@param object
object to parse.
@return parsed tracker.
@throws RedmineFormatException
if object is not a valid tracker. | [
"Parses",
"a",
"status",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L205-L216 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONParser.java | RedmineJSONParser.parseMinimalProject | public static Project parseMinimalProject(JSONObject content)
throws JSONException {
final Project result = new Project();
result.setId(JsonInput.getInt(content, "id"));
result.setIdentifier(JsonInput.getStringOrNull(content, "identifier"));
result.setName(JsonInput.getStringNotNull(content, "name"));
retu... | java | public static Project parseMinimalProject(JSONObject content)
throws JSONException {
final Project result = new Project();
result.setId(JsonInput.getInt(content, "id"));
result.setIdentifier(JsonInput.getStringOrNull(content, "identifier"));
result.setName(JsonInput.getStringNotNull(content, "name"));
retu... | [
"public",
"static",
"Project",
"parseMinimalProject",
"(",
"JSONObject",
"content",
")",
"throws",
"JSONException",
"{",
"final",
"Project",
"result",
"=",
"new",
"Project",
"(",
")",
";",
"result",
".",
"setId",
"(",
"JsonInput",
".",
"getInt",
"(",
"content"... | Parses a "minimal" version of a project.
@param content
content to parse.
@return parsed project. | [
"Parses",
"a",
"minimal",
"version",
"of",
"a",
"project",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L289-L296 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/RedmineJSONParser.java | RedmineJSONParser.parseProject | public static Project parseProject(JSONObject content) throws JSONException {
final Project result = new Project();
result.setId(JsonInput.getInt(content, "id"));
result.setIdentifier(JsonInput.getStringOrNull(content, "identifier"));
result.setName(JsonInput.getStringNotNull(content, "name"));
result.setDesc... | java | public static Project parseProject(JSONObject content) throws JSONException {
final Project result = new Project();
result.setId(JsonInput.getInt(content, "id"));
result.setIdentifier(JsonInput.getStringOrNull(content, "identifier"));
result.setName(JsonInput.getStringNotNull(content, "name"));
result.setDesc... | [
"public",
"static",
"Project",
"parseProject",
"(",
"JSONObject",
"content",
")",
"throws",
"JSONException",
"{",
"final",
"Project",
"result",
"=",
"new",
"Project",
"(",
")",
";",
"result",
".",
"setId",
"(",
"JsonInput",
".",
"getInt",
"(",
"content",
","... | Parses a project.
@param content
content to parse.
@return parsed project. | [
"Parses",
"a",
"project",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/RedmineJSONParser.java#L305-L322 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/ComponentClass.java | ComponentClass.getRenderPriority | public int getRenderPriority (String action, String component, int orientation)
{
// because we expect there to be relatively few priority overrides, we simply search
// linearly through the list for the closest match
int ocount = (_overrides != null) ? _overrides.size() : 0;
for (in... | java | public int getRenderPriority (String action, String component, int orientation)
{
// because we expect there to be relatively few priority overrides, we simply search
// linearly through the list for the closest match
int ocount = (_overrides != null) ? _overrides.size() : 0;
for (in... | [
"public",
"int",
"getRenderPriority",
"(",
"String",
"action",
",",
"String",
"component",
",",
"int",
"orientation",
")",
"{",
"// because we expect there to be relatively few priority overrides, we simply search",
"// linearly through the list for the closest match",
"int",
"ocou... | Returns the render priority appropriate for the specified action, orientation and
component. | [
"Returns",
"the",
"render",
"priority",
"appropriate",
"for",
"the",
"specified",
"action",
"orientation",
"and",
"component",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/ComponentClass.java#L159-L174 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/ComponentClass.java | ComponentClass.addPriorityOverride | public void addPriorityOverride (PriorityOverride override)
{
if (_overrides == null) {
_overrides = new ComparableArrayList<PriorityOverride>();
}
_overrides.insertSorted(override);
} | java | public void addPriorityOverride (PriorityOverride override)
{
if (_overrides == null) {
_overrides = new ComparableArrayList<PriorityOverride>();
}
_overrides.insertSorted(override);
} | [
"public",
"void",
"addPriorityOverride",
"(",
"PriorityOverride",
"override",
")",
"{",
"if",
"(",
"_overrides",
"==",
"null",
")",
"{",
"_overrides",
"=",
"new",
"ComparableArrayList",
"<",
"PriorityOverride",
">",
"(",
")",
";",
"}",
"_overrides",
".",
"inse... | Adds the supplied render priority override record to this component class. | [
"Adds",
"the",
"supplied",
"render",
"priority",
"override",
"record",
"to",
"this",
"component",
"class",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/ComponentClass.java#L179-L185 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java | FringeConfiguration.fringesOn | public int fringesOn (int first, int second)
{
FringeRecord f1 = _frecs.get(first);
// we better have a fringe record for the first
if (null != f1) {
// it had better have some tilesets defined
if (f1.tilesets.size() > 0) {
FringeRecord f2 = _frecs.... | java | public int fringesOn (int first, int second)
{
FringeRecord f1 = _frecs.get(first);
// we better have a fringe record for the first
if (null != f1) {
// it had better have some tilesets defined
if (f1.tilesets.size() > 0) {
FringeRecord f2 = _frecs.... | [
"public",
"int",
"fringesOn",
"(",
"int",
"first",
",",
"int",
"second",
")",
"{",
"FringeRecord",
"f1",
"=",
"_frecs",
".",
"get",
"(",
"first",
")",
";",
"// we better have a fringe record for the first",
"if",
"(",
"null",
"!=",
"f1",
")",
"{",
"// it had... | If the first base tileset fringes upon the second, return the
fringe priority of the first base tileset, otherwise return -1. | [
"If",
"the",
"first",
"base",
"tileset",
"fringes",
"upon",
"the",
"second",
"return",
"the",
"fringe",
"priority",
"of",
"the",
"first",
"base",
"tileset",
"otherwise",
"return",
"-",
"1",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java#L119-L140 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java | FringeConfiguration.getFringe | public FringeTileSetRecord getFringe (int baseset, int hashValue)
{
FringeRecord f = _frecs.get(baseset);
return f.tilesets.get(
hashValue % f.tilesets.size());
} | java | public FringeTileSetRecord getFringe (int baseset, int hashValue)
{
FringeRecord f = _frecs.get(baseset);
return f.tilesets.get(
hashValue % f.tilesets.size());
} | [
"public",
"FringeTileSetRecord",
"getFringe",
"(",
"int",
"baseset",
",",
"int",
"hashValue",
")",
"{",
"FringeRecord",
"f",
"=",
"_frecs",
".",
"get",
"(",
"baseset",
")",
";",
"return",
"f",
".",
"tilesets",
".",
"get",
"(",
"hashValue",
"%",
"f",
".",... | Get a random FringeTileSetRecord from amongst the ones
listed for the specified base tileset. | [
"Get",
"a",
"random",
"FringeTileSetRecord",
"from",
"amongst",
"the",
"ones",
"listed",
"for",
"the",
"specified",
"base",
"tileset",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/FringeConfiguration.java#L146-L151 | train |
threerings/nenya | core/src/main/java/com/threerings/media/ManagedJApplet.java | ManagedJApplet.getWindow | public Window getWindow ()
{
Component parent = getParent();
while (!(parent instanceof Window) && parent != null) {
parent = parent.getParent();
}
return (Window)parent;
} | java | public Window getWindow ()
{
Component parent = getParent();
while (!(parent instanceof Window) && parent != null) {
parent = parent.getParent();
}
return (Window)parent;
} | [
"public",
"Window",
"getWindow",
"(",
")",
"{",
"Component",
"parent",
"=",
"getParent",
"(",
")",
";",
"while",
"(",
"!",
"(",
"parent",
"instanceof",
"Window",
")",
"&&",
"parent",
"!=",
"null",
")",
"{",
"parent",
"=",
"parent",
".",
"getParent",
"(... | from interface FrameManager.ManagedRoot | [
"from",
"interface",
"FrameManager",
".",
"ManagedRoot"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/ManagedJApplet.java#L40-L47 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagData.java | TagData.getAttributeString | public String getAttributeString(String attName) {
Object o = attributes.get(attName);
if (o == null) {
return null;
} else {
return (String) o;
}
} | java | public String getAttributeString(String attName) {
Object o = attributes.get(attName);
if (o == null) {
return null;
} else {
return (String) o;
}
} | [
"public",
"String",
"getAttributeString",
"(",
"String",
"attName",
")",
"{",
"Object",
"o",
"=",
"attributes",
".",
"get",
"(",
"attName",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"(",
"Str... | Get the value for a given attribute.
@param attName the name of the attribute
@return the attribute value string
@throws ClassCastException if attribute value is not a String | [
"Get",
"the",
"value",
"for",
"a",
"given",
"attribute",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagData.java#L170-L177 | train |
jdillon/gshell | gshell-personality/src/main/java/com/planet57/gshell/Main.java | Main.maybeSetProperty | private void maybeSetProperty(final String name, final String value) {
if (System.getProperty(name) == null) {
System.setProperty(name, value);
}
} | java | private void maybeSetProperty(final String name, final String value) {
if (System.getProperty(name) == null) {
System.setProperty(name, value);
}
} | [
"private",
"void",
"maybeSetProperty",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"System",
".",
"getProperty",
"(",
"name",
")",
"==",
"null",
")",
"{",
"System",
".",
"setProperty",
"(",
"name",
",",
"value",
... | Helper to only set a property if not already set. | [
"Helper",
"to",
"only",
"set",
"a",
"property",
"if",
"not",
"already",
"set",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-personality/src/main/java/com/planet57/gshell/Main.java#L63-L67 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatGlyph.java | ChatGlyph.render | public void render (Graphics2D gfx)
{
Object oalias = SwingUtil.activateAntiAliasing(gfx);
gfx.setColor(getBackground());
gfx.fill(_shape);
gfx.setColor(_outline);
gfx.draw(_shape);
SwingUtil.restoreAntiAliasing(gfx, oalias);
if (_icon != null) {
... | java | public void render (Graphics2D gfx)
{
Object oalias = SwingUtil.activateAntiAliasing(gfx);
gfx.setColor(getBackground());
gfx.fill(_shape);
gfx.setColor(_outline);
gfx.draw(_shape);
SwingUtil.restoreAntiAliasing(gfx, oalias);
if (_icon != null) {
... | [
"public",
"void",
"render",
"(",
"Graphics2D",
"gfx",
")",
"{",
"Object",
"oalias",
"=",
"SwingUtil",
".",
"activateAntiAliasing",
"(",
"gfx",
")",
";",
"gfx",
".",
"setColor",
"(",
"getBackground",
"(",
")",
")",
";",
"gfx",
".",
"fill",
"(",
"_shape",
... | Render the chat glyph with no thought to dirty rectangles or
restoring composites. | [
"Render",
"the",
"chat",
"glyph",
"with",
"no",
"thought",
"to",
"dirty",
"rectangles",
"or",
"restoring",
"composites",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatGlyph.java#L101-L117 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ChatGlyph.java | ChatGlyph.translate | public void translate (int dx, int dy)
{
setLocation(_bounds.x + dx, _bounds.y + dy);
} | java | public void translate (int dx, int dy)
{
setLocation(_bounds.x + dx, _bounds.y + dy);
} | [
"public",
"void",
"translate",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"setLocation",
"(",
"_bounds",
".",
"x",
"+",
"dx",
",",
"_bounds",
".",
"y",
"+",
"dy",
")",
";",
"}"
] | Attempt to translate this glyph. | [
"Attempt",
"to",
"translate",
"this",
"glyph",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ChatGlyph.java#L176-L179 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/MisoConfig.java | MisoConfig.getSceneMetrics | public static MisoSceneMetrics getSceneMetrics ()
{
return new MisoSceneMetrics(
config.getValue(TILE_WIDTH_KEY, DEF_TILE_WIDTH),
config.getValue(TILE_HEIGHT_KEY, DEF_TILE_HEIGHT),
config.getValue(FINE_GRAN_KEY, DEF_FINE_GRAN));
} | java | public static MisoSceneMetrics getSceneMetrics ()
{
return new MisoSceneMetrics(
config.getValue(TILE_WIDTH_KEY, DEF_TILE_WIDTH),
config.getValue(TILE_HEIGHT_KEY, DEF_TILE_HEIGHT),
config.getValue(FINE_GRAN_KEY, DEF_FINE_GRAN));
} | [
"public",
"static",
"MisoSceneMetrics",
"getSceneMetrics",
"(",
")",
"{",
"return",
"new",
"MisoSceneMetrics",
"(",
"config",
".",
"getValue",
"(",
"TILE_WIDTH_KEY",
",",
"DEF_TILE_WIDTH",
")",
",",
"config",
".",
"getValue",
"(",
"TILE_HEIGHT_KEY",
",",
"DEF_TILE... | Creates scene metrics with information obtained from the deployed
config file. | [
"Creates",
"scene",
"metrics",
"with",
"information",
"obtained",
"from",
"the",
"deployed",
"config",
"file",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/MisoConfig.java#L38-L44 | train |
tonilopezmr/Android-EasySQLite | easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteHelper.java | SQLiteHelper.onCreate | @Override
public void onCreate(SQLiteDatabase db) {
try {
if(builder.tables == null){
throw new SQLiteHelperException("The array of String tables can't be null!!");
}
executePragma(db);
builder.onCreateCallback.onCreate(db);
} catch (S... | java | @Override
public void onCreate(SQLiteDatabase db) {
try {
if(builder.tables == null){
throw new SQLiteHelperException("The array of String tables can't be null!!");
}
executePragma(db);
builder.onCreateCallback.onCreate(db);
} catch (S... | [
"@",
"Override",
"public",
"void",
"onCreate",
"(",
"SQLiteDatabase",
"db",
")",
"{",
"try",
"{",
"if",
"(",
"builder",
".",
"tables",
"==",
"null",
")",
"{",
"throw",
"new",
"SQLiteHelperException",
"(",
"\"The array of String tables can't be null!!\"",
")",
";... | Called when the database is created for the first time. This is where the
creation of tables and the initial population of the tables should happen.
@param db The database. | [
"Called",
"when",
"the",
"database",
"is",
"created",
"for",
"the",
"first",
"time",
".",
"This",
"is",
"where",
"the",
"creation",
"of",
"tables",
"and",
"the",
"initial",
"population",
"of",
"the",
"tables",
"should",
"happen",
"."
] | bb991a43c9fa11522e5367570ee2335b99bca7c0 | https://github.com/tonilopezmr/Android-EasySQLite/blob/bb991a43c9fa11522e5367570ee2335b99bca7c0/easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteHelper.java#L66-L78 | train |
tonilopezmr/Android-EasySQLite | easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteHelper.java | SQLiteHelper.onUpgrade | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
try {
if (builder.tableNames == null) {
throw new SQLiteHelperException("The array of String tableNames can't be null!!");
}
builder.onUpgradeCallback.onUpgrade(db, oldVe... | java | @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
try {
if (builder.tableNames == null) {
throw new SQLiteHelperException("The array of String tableNames can't be null!!");
}
builder.onUpgradeCallback.onUpgrade(db, oldVe... | [
"@",
"Override",
"public",
"void",
"onUpgrade",
"(",
"SQLiteDatabase",
"db",
",",
"int",
"oldVersion",
",",
"int",
"newVersion",
")",
"{",
"try",
"{",
"if",
"(",
"builder",
".",
"tableNames",
"==",
"null",
")",
"{",
"throw",
"new",
"SQLiteHelperException",
... | Called when the database needs to be upgraded. The implementation
should use this method to drop tables, add tables, or do anything else it
needs to upgrade to the new schema version.
@param db The database.
@param oldVersion The old database version.
@param newVersion The new database version. | [
"Called",
"when",
"the",
"database",
"needs",
"to",
"be",
"upgraded",
".",
"The",
"implementation",
"should",
"use",
"this",
"method",
"to",
"drop",
"tables",
"add",
"tables",
"or",
"do",
"anything",
"else",
"it",
"needs",
"to",
"upgrade",
"to",
"the",
"ne... | bb991a43c9fa11522e5367570ee2335b99bca7c0 | https://github.com/tonilopezmr/Android-EasySQLite/blob/bb991a43c9fa11522e5367570ee2335b99bca7c0/easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteHelper.java#L101-L112 | train |
Systemdir/GML-Writer-for-yED | GMLWriter/src/com/github/systemdir/gml/model/Tools.java | Tools.getHex | static String getHex(Color color) {
return String.format("#%02x%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
} | java | static String getHex(Color color) {
return String.format("#%02x%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
} | [
"static",
"String",
"getHex",
"(",
"Color",
"color",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"#%02x%02x%02x%02x\"",
",",
"color",
".",
"getRed",
"(",
")",
",",
"color",
".",
"getGreen",
"(",
")",
",",
"color",
".",
"getBlue",
"(",
")",
",",... | create rgba hex from a java color | [
"create",
"rgba",
"hex",
"from",
"a",
"java",
"color"
] | 353ecf132929889cb15968865283ee511f7c8d87 | https://github.com/Systemdir/GML-Writer-for-yED/blob/353ecf132929889cb15968865283ee511f7c8d87/GMLWriter/src/com/github/systemdir/gml/model/Tools.java#L65-L67 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.getConnectionListeners | public List<ConnectionListener> getConnectionListeners() {
if (changes == null) {
return (List<ConnectionListener>)Collections.EMPTY_LIST;
}
List<EventListener> listeners = changes.getListenerList(AMQP);
if ((listeners == null) || listeners.isEmpty()) {
return (L... | java | public List<ConnectionListener> getConnectionListeners() {
if (changes == null) {
return (List<ConnectionListener>)Collections.EMPTY_LIST;
}
List<EventListener> listeners = changes.getListenerList(AMQP);
if ((listeners == null) || listeners.isEmpty()) {
return (L... | [
"public",
"List",
"<",
"ConnectionListener",
">",
"getConnectionListeners",
"(",
")",
"{",
"if",
"(",
"changes",
"==",
"null",
")",
"{",
"return",
"(",
"List",
"<",
"ConnectionListener",
">",
")",
"Collections",
".",
"EMPTY_LIST",
";",
"}",
"List",
"<",
"E... | Returns the list of ConnectionListeners registered with this AmqpClient instance.
@return List<ConnectionListener> list of ConnectionListeners | [
"Returns",
"the",
"list",
"of",
"ConnectionListeners",
"registered",
"with",
"this",
"AmqpClient",
"instance",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L343-L359 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.connect | public void connect(String url, String virtualHost, String username, String password) {
if (websocket != null) {
throw new IllegalStateException("AmqpClient already connected");
}
this.readyState = ReadyState.CONNECTING;
this.url = url;
this.userName = username;
... | java | public void connect(String url, String virtualHost, String username, String password) {
if (websocket != null) {
throw new IllegalStateException("AmqpClient already connected");
}
this.readyState = ReadyState.CONNECTING;
this.url = url;
this.userName = username;
... | [
"public",
"void",
"connect",
"(",
"String",
"url",
",",
"String",
"virtualHost",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"if",
"(",
"websocket",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"AmqpClient already... | Connect to AMQP Broker via Kaazing Gateway
@param url Location of AMQP Broker or Server
@param virtualHost Name of the virtual host
@param username Username to connect to the AMQP Server
@param password Password to connect to the AMQP Server | [
"Connect",
"to",
"AMQP",
"Broker",
"via",
"Kaazing",
"Gateway"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L377-L389 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.disconnect | public void disconnect() {
if (readyState == ReadyState.OPEN) {
// readyState should be set to ReadyState.CLOSED ONLY AFTER the
// the WebSocket has been successfully closed in
// socketClosedHandler().
this.closeConnection(0, "", 0, 0, null, null);
} else... | java | public void disconnect() {
if (readyState == ReadyState.OPEN) {
// readyState should be set to ReadyState.CLOSED ONLY AFTER the
// the WebSocket has been successfully closed in
// socketClosedHandler().
this.closeConnection(0, "", 0, 0, null, null);
} else... | [
"public",
"void",
"disconnect",
"(",
")",
"{",
"if",
"(",
"readyState",
"==",
"ReadyState",
".",
"OPEN",
")",
"{",
"// readyState should be set to ReadyState.CLOSED ONLY AFTER the",
"// the WebSocket has been successfully closed in",
"// socketClosedHandler().",
"this",
".",
... | Disconnects from Amqp Server. | [
"Disconnects",
"from",
"Amqp",
"Server",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L394-L403 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.openChannel | public AmqpChannel openChannel() {
int id = ++this.channelCount;
AmqpChannel chan = new AmqpChannel(id, this);
channels.put(id, chan);
return chan;
} | java | public AmqpChannel openChannel() {
int id = ++this.channelCount;
AmqpChannel chan = new AmqpChannel(id, this);
channels.put(id, chan);
return chan;
} | [
"public",
"AmqpChannel",
"openChannel",
"(",
")",
"{",
"int",
"id",
"=",
"++",
"this",
".",
"channelCount",
";",
"AmqpChannel",
"chan",
"=",
"new",
"AmqpChannel",
"(",
"id",
",",
"this",
")",
";",
"channels",
".",
"put",
"(",
"id",
",",
"chan",
")",
... | Opens a channel on server.
@return AmqpChannel | [
"Opens",
"a",
"channel",
"on",
"server",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L410-L415 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.closedHandler | void closedHandler(Object context, String input, Object frame, String stateName) {
if (getReadyState() == ReadyState.CLOSED) {
return;
}
// TODO: Determine whether channels need to be cleaned up.
if (this.channels.size() != 0) {
for (int i = 1; i <= this.... | java | void closedHandler(Object context, String input, Object frame, String stateName) {
if (getReadyState() == ReadyState.CLOSED) {
return;
}
// TODO: Determine whether channels need to be cleaned up.
if (this.channels.size() != 0) {
for (int i = 1; i <= this.... | [
"void",
"closedHandler",
"(",
"Object",
"context",
",",
"String",
"input",
",",
"Object",
"frame",
",",
"String",
"stateName",
")",
"{",
"if",
"(",
"getReadyState",
"(",
")",
"==",
"ReadyState",
".",
"CLOSED",
")",
"{",
"return",
";",
"}",
"// TODO: Determ... | should be the order following in all our client implementations. | [
"should",
"be",
"the",
"order",
"following",
"in",
"all",
"our",
"client",
"implementations",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L593-L634 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.socketClosedHandler | private void socketClosedHandler() {
// If the book-keeping has already been completed earlier, then
// we should just bail.
if (getReadyState() == ReadyState.CLOSED) {
return;
}
// TODO: Determine whether channels need to be cleaned up
if (this.chann... | java | private void socketClosedHandler() {
// If the book-keeping has already been completed earlier, then
// we should just bail.
if (getReadyState() == ReadyState.CLOSED) {
return;
}
// TODO: Determine whether channels need to be cleaned up
if (this.chann... | [
"private",
"void",
"socketClosedHandler",
"(",
")",
"{",
"// If the book-keeping has already been completed earlier, then",
"// we should just bail.",
"if",
"(",
"getReadyState",
"(",
")",
"==",
"ReadyState",
".",
"CLOSED",
")",
"{",
"return",
";",
"}",
"// TODO: Determin... | closing the channels, raising events, and such. | [
"closing",
"the",
"channels",
"raising",
"events",
"and",
"such",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L653-L681 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.tuneOkConnection | AmqpClient tuneOkConnection(int channelMax, int frameMax, int heartbeat) {
this.tuneOkConnection(channelMax, frameMax, heartbeat, null, null);
return this;
} | java | AmqpClient tuneOkConnection(int channelMax, int frameMax, int heartbeat) {
this.tuneOkConnection(channelMax, frameMax, heartbeat, null, null);
return this;
} | [
"AmqpClient",
"tuneOkConnection",
"(",
"int",
"channelMax",
",",
"int",
"frameMax",
",",
"int",
"heartbeat",
")",
"{",
"this",
".",
"tuneOkConnection",
"(",
"channelMax",
",",
"frameMax",
",",
"heartbeat",
",",
"null",
",",
"null",
")",
";",
"return",
"this"... | Sends a TuneOkConnection to server.
@param channelMax
@param frameMax
@param heartbeat
@return AmqpClient | [
"Sends",
"a",
"TuneOkConnection",
"to",
"server",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L814-L817 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.closeOkConnection | AmqpClient closeOkConnection(Continuation callback, ErrorHandler error) {
Object[] args = {};
AmqpBuffer bodyArg = null;
String methodName = "closeOkConnection";
String methodId = "10" + "50";
AmqpMethod amqpMethod = MethodLookup.LookupMethod(methodId);
Object[] argument... | java | AmqpClient closeOkConnection(Continuation callback, ErrorHandler error) {
Object[] args = {};
AmqpBuffer bodyArg = null;
String methodName = "closeOkConnection";
String methodId = "10" + "50";
AmqpMethod amqpMethod = MethodLookup.LookupMethod(methodId);
Object[] argument... | [
"AmqpClient",
"closeOkConnection",
"(",
"Continuation",
"callback",
",",
"ErrorHandler",
"error",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"{",
"}",
";",
"AmqpBuffer",
"bodyArg",
"=",
"null",
";",
"String",
"methodName",
"=",
"\"closeOkConnection\"",
";",
"S... | Sends a CloseOkConnection to server.
@param callback
@param error
@return AmqpClient | [
"Sends",
"a",
"CloseOkConnection",
"to",
"server",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L927-L937 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java | AmqpClient.fireOnClosed | private void fireOnClosed(ConnectionEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ConnectionListener amqpListener = (ConnectionListener)listener;
amqpListener.onConnectionClose(e);
}
} | java | private void fireOnClosed(ConnectionEvent e) {
List<EventListener> listeners = changes.getListenerList(AMQP);
for (EventListener listener : listeners) {
ConnectionListener amqpListener = (ConnectionListener)listener;
amqpListener.onConnectionClose(e);
}
} | [
"private",
"void",
"fireOnClosed",
"(",
"ConnectionEvent",
"e",
")",
"{",
"List",
"<",
"EventListener",
">",
"listeners",
"=",
"changes",
".",
"getListenerList",
"(",
"AMQP",
")",
";",
"for",
"(",
"EventListener",
"listener",
":",
"listeners",
")",
"{",
"Con... | Occurs when the connection to the AMQP server is closed
@param e | [
"Occurs",
"when",
"the",
"connection",
"to",
"the",
"AMQP",
"server",
"is",
"closed"
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpClient.java#L965-L971 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/CompositedMultiFrameImage.java | CompositedMultiFrameImage.createCompositedMirage | protected CompositedMirage createCompositedMirage (int index)
{
if (_sources.length == 1 && _sources[0].frames instanceof TileSetFrameImage) {
TileSetFrameImage frames = (TileSetFrameImage)_sources[0].frames;
Rectangle tbounds = new Rectangle();
frames.getTrimmedBounds(_o... | java | protected CompositedMirage createCompositedMirage (int index)
{
if (_sources.length == 1 && _sources[0].frames instanceof TileSetFrameImage) {
TileSetFrameImage frames = (TileSetFrameImage)_sources[0].frames;
Rectangle tbounds = new Rectangle();
frames.getTrimmedBounds(_o... | [
"protected",
"CompositedMirage",
"createCompositedMirage",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"_sources",
".",
"length",
"==",
"1",
"&&",
"_sources",
"[",
"0",
"]",
".",
"frames",
"instanceof",
"TileSetFrameImage",
")",
"{",
"TileSetFrameImage",
"frames",... | Creates a composited image for the specified frame. | [
"Creates",
"a",
"composited",
"image",
"for",
"the",
"specified",
"frame",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CompositedMultiFrameImage.java#L117-L128 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/bundle/BundledComponentRepository.java | BundledComponentRepository.createComponent | protected void createComponent (
int componentId, String cclass, String cname, FrameProvider fprov)
{
// look up the component class information
ComponentClass clazz = _classes.get(cclass);
if (clazz == null) {
log.warning("Non-existent component class",
"... | java | protected void createComponent (
int componentId, String cclass, String cname, FrameProvider fprov)
{
// look up the component class information
ComponentClass clazz = _classes.get(cclass);
if (clazz == null) {
log.warning("Non-existent component class",
"... | [
"protected",
"void",
"createComponent",
"(",
"int",
"componentId",
",",
"String",
"cclass",
",",
"String",
"cname",
",",
"FrameProvider",
"fprov",
")",
"{",
"// look up the component class information",
"ComponentClass",
"clazz",
"=",
"_classes",
".",
"get",
"(",
"c... | Creates a component and inserts it into the component table. | [
"Creates",
"a",
"component",
"and",
"inserts",
"it",
"into",
"the",
"component",
"table",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/bundle/BundledComponentRepository.java#L246-L274 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/ImageSprite.java | ImageSprite.setFrames | public void setFrames (MultiFrameImage frames)
{
if (frames == null) {
// log.warning("Someone set up us the null frames!", "sprite", this);
return;
}
// if these are the same frames we already had, no need to do a bunch of pointless business
if (frames == _f... | java | public void setFrames (MultiFrameImage frames)
{
if (frames == null) {
// log.warning("Someone set up us the null frames!", "sprite", this);
return;
}
// if these are the same frames we already had, no need to do a bunch of pointless business
if (frames == _f... | [
"public",
"void",
"setFrames",
"(",
"MultiFrameImage",
"frames",
")",
"{",
"if",
"(",
"frames",
"==",
"null",
")",
"{",
"// log.warning(\"Someone set up us the null frames!\", \"sprite\", this);",
"return",
";",
"}",
"// if these are the same frames we already had, no need to d... | Set the image array used to render the sprite.
@param frames the sprite images. | [
"Set",
"the",
"image",
"array",
"used",
"to",
"render",
"the",
"sprite",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/ImageSprite.java#L157-L173 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/ImageSprite.java | ImageSprite.setFrameIndex | protected void setFrameIndex (int frameIdx, boolean forceUpdate)
{
// make sure we're displaying a valid frame
frameIdx = (frameIdx % _frames.getFrameCount());
// if this is the same frame we're already displaying and we're
// not being forced to update, we can stop now
if (... | java | protected void setFrameIndex (int frameIdx, boolean forceUpdate)
{
// make sure we're displaying a valid frame
frameIdx = (frameIdx % _frames.getFrameCount());
// if this is the same frame we're already displaying and we're
// not being forced to update, we can stop now
if (... | [
"protected",
"void",
"setFrameIndex",
"(",
"int",
"frameIdx",
",",
"boolean",
"forceUpdate",
")",
"{",
"// make sure we're displaying a valid frame",
"frameIdx",
"=",
"(",
"frameIdx",
"%",
"_frames",
".",
"getFrameCount",
"(",
")",
")",
";",
"// if this is the same fr... | Instructs the sprite to display the specified frame index. | [
"Instructs",
"the",
"sprite",
"to",
"display",
"the",
"specified",
"frame",
"index",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/ImageSprite.java#L188-L215 | train |
groupon/monsoon | collectors/collectd/src/main/java/com/groupon/lex/metrics/collector/collectd/CollectdPushCollector.java | CollectdPushCollector.up_down_host_ | private MetricGroup up_down_host_(String host, boolean up) {
final GroupName group = GroupName.valueOf(
getBasePath(),
Tags.valueOf(singletonMap("host", MetricValue.fromStrValue(host))));
return new SimpleMetricGroup(group, singleton(up ? UP_METRIC : DOWN_METRIC));
} | java | private MetricGroup up_down_host_(String host, boolean up) {
final GroupName group = GroupName.valueOf(
getBasePath(),
Tags.valueOf(singletonMap("host", MetricValue.fromStrValue(host))));
return new SimpleMetricGroup(group, singleton(up ? UP_METRIC : DOWN_METRIC));
} | [
"private",
"MetricGroup",
"up_down_host_",
"(",
"String",
"host",
",",
"boolean",
"up",
")",
"{",
"final",
"GroupName",
"group",
"=",
"GroupName",
".",
"valueOf",
"(",
"getBasePath",
"(",
")",
",",
"Tags",
".",
"valueOf",
"(",
"singletonMap",
"(",
"\"host\""... | Return a metric group indicating if the host is up or down. | [
"Return",
"a",
"metric",
"group",
"indicating",
"if",
"the",
"host",
"is",
"up",
"or",
"down",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/collectd/src/main/java/com/groupon/lex/metrics/collector/collectd/CollectdPushCollector.java#L289-L294 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/JspFactory.java | JspFactory.getDefaultFactory | public static synchronized JspFactory getDefaultFactory() {
if (deflt == null) {
try {
Class factory = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
if (factory != null) {
deflt = (JspFactory) factory.newInstance();
}
... | java | public static synchronized JspFactory getDefaultFactory() {
if (deflt == null) {
try {
Class factory = Class.forName("org.apache.jasper.runtime.JspFactoryImpl");
if (factory != null) {
deflt = (JspFactory) factory.newInstance();
}
... | [
"public",
"static",
"synchronized",
"JspFactory",
"getDefaultFactory",
"(",
")",
"{",
"if",
"(",
"deflt",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
"factory",
"=",
"Class",
".",
"forName",
"(",
"\"org.apache.jasper.runtime.JspFactoryImpl\"",
")",
";",
"if",
... | Returns the default factory for this implementation.
@return the default factory for this implementation | [
"Returns",
"the",
"default",
"factory",
"for",
"this",
"implementation",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/JspFactory.java#L115-L126 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagInfo.java | TagInfo.getVariableInfo | public VariableInfo[] getVariableInfo(TagData data) {
VariableInfo[] result = null;
TagExtraInfo tei = getTagExtraInfo();
if (tei != null) {
result = tei.getVariableInfo( data );
}
return result;
} | java | public VariableInfo[] getVariableInfo(TagData data) {
VariableInfo[] result = null;
TagExtraInfo tei = getTagExtraInfo();
if (tei != null) {
result = tei.getVariableInfo( data );
}
return result;
} | [
"public",
"VariableInfo",
"[",
"]",
"getVariableInfo",
"(",
"TagData",
"data",
")",
"{",
"VariableInfo",
"[",
"]",
"result",
"=",
"null",
";",
"TagExtraInfo",
"tei",
"=",
"getTagExtraInfo",
"(",
")",
";",
"if",
"(",
"tei",
"!=",
"null",
")",
"{",
"result... | Information on the scripting objects created by this tag at runtime.
This is a convenience method on the associated TagExtraInfo class.
@param data TagData describing this action.
@return if a TagExtraInfo object is associated with this TagInfo, the
result of getTagExtraInfo().getVariableInfo( data ), otherwise
null. | [
"Information",
"on",
"the",
"scripting",
"objects",
"created",
"by",
"this",
"tag",
"at",
"runtime",
".",
"This",
"is",
"a",
"convenience",
"method",
"on",
"the",
"associated",
"TagExtraInfo",
"class",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagInfo.java#L273-L280 | train |
jdillon/gshell | gshell-launcher/src/main/java/com/planet57/gshell/launcher/Configuration.java | Configuration.getProperty | @Nullable
private String getProperty(final String name) {
assert name != null;
ensureConfigured();
return evaluate(System.getProperty(name, props.getProperty(name)));
} | java | @Nullable
private String getProperty(final String name) {
assert name != null;
ensureConfigured();
return evaluate(System.getProperty(name, props.getProperty(name)));
} | [
"@",
"Nullable",
"private",
"String",
"getProperty",
"(",
"final",
"String",
"name",
")",
"{",
"assert",
"name",
"!=",
"null",
";",
"ensureConfigured",
"(",
")",
";",
"return",
"evaluate",
"(",
"System",
".",
"getProperty",
"(",
"name",
",",
"props",
".",
... | Get the value of a property, checking system properties, then configuration properties and evaluating the result. | [
"Get",
"the",
"value",
"of",
"a",
"property",
"checking",
"system",
"properties",
"then",
"configuration",
"properties",
"and",
"evaluating",
"the",
"result",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-launcher/src/main/java/com/planet57/gshell/launcher/Configuration.java#L141-L146 | train |
calrissian/mango | mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java | JsonAttributeMappings.fromJson | public static Collection<Attribute> fromJson(ObjectNode object) throws IOException {
Collection<Attribute> attributes = new HashSet<>();
convertJsonObject(attributes, object, "", 0, new HashMap<>());
return attributes;
} | java | public static Collection<Attribute> fromJson(ObjectNode object) throws IOException {
Collection<Attribute> attributes = new HashSet<>();
convertJsonObject(attributes, object, "", 0, new HashMap<>());
return attributes;
} | [
"public",
"static",
"Collection",
"<",
"Attribute",
">",
"fromJson",
"(",
"ObjectNode",
"object",
")",
"throws",
"IOException",
"{",
"Collection",
"<",
"Attribute",
">",
"attributes",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"convertJsonObject",
"(",
"attri... | Flattens a raw nested json string representation into a collection of attributes.
@throws IOException | [
"Flattens",
"a",
"raw",
"nested",
"json",
"string",
"representation",
"into",
"a",
"collection",
"of",
"attributes",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java#L61-L66 | train |
calrissian/mango | mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java | JsonAttributeMappings.toJsonString | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | java | public static String toJsonString(Collection<Attribute> attributeCollection, ObjectMapper objectMapper) throws JsonProcessingException {
return objectMapper.writeValueAsString(toObject(attributeCollection));
} | [
"public",
"static",
"String",
"toJsonString",
"(",
"Collection",
"<",
"Attribute",
">",
"attributeCollection",
",",
"ObjectMapper",
"objectMapper",
")",
"throws",
"JsonProcessingException",
"{",
"return",
"objectMapper",
".",
"writeValueAsString",
"(",
"toObject",
"(",
... | Re-expands a flattened json representation from a collection of attributes back into a raw
nested json string. | [
"Re",
"-",
"expands",
"a",
"flattened",
"json",
"representation",
"from",
"a",
"collection",
"of",
"attributes",
"back",
"into",
"a",
"raw",
"nested",
"json",
"string",
"."
] | a95aa5e77af9aa0e629787228d80806560023452 | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-json/src/main/java/org/calrissian/mango/json/mappings/JsonAttributeMappings.java#L100-L102 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/AutoFringer.java | AutoFringer.getFringeTile | public BaseTile getFringeTile (MisoSceneModel scene, int col, int row,
Map<FringeTile, WeakReference<FringeTile>> fringes, Map<Long, BufferedImage> masks)
{
// get the tileset id of the base tile we are considering
int underset = adjustTileSetId(scene.getBaseTileId(col, row) >> 16);
... | java | public BaseTile getFringeTile (MisoSceneModel scene, int col, int row,
Map<FringeTile, WeakReference<FringeTile>> fringes, Map<Long, BufferedImage> masks)
{
// get the tileset id of the base tile we are considering
int underset = adjustTileSetId(scene.getBaseTileId(col, row) >> 16);
... | [
"public",
"BaseTile",
"getFringeTile",
"(",
"MisoSceneModel",
"scene",
",",
"int",
"col",
",",
"int",
"row",
",",
"Map",
"<",
"FringeTile",
",",
"WeakReference",
"<",
"FringeTile",
">",
">",
"fringes",
",",
"Map",
"<",
"Long",
",",
"BufferedImage",
">",
"m... | Compute and return the fringe tile to be inserted at the specified location. | [
"Compute",
"and",
"return",
"the",
"fringe",
"tile",
"to",
"be",
"inserted",
"at",
"the",
"specified",
"location",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/AutoFringer.java#L103-L172 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/AutoFringer.java | AutoFringer.composeFringeTile | protected FringeTile composeFringeTile (FringerRec[] fringers,
Map<FringeTile, WeakReference<FringeTile>> fringes, int hashValue, boolean passable,
Map<Long, BufferedImage> masks)
{
// sort the array so that higher priority fringers get drawn first
QuickSort.sort(fringers);
... | java | protected FringeTile composeFringeTile (FringerRec[] fringers,
Map<FringeTile, WeakReference<FringeTile>> fringes, int hashValue, boolean passable,
Map<Long, BufferedImage> masks)
{
// sort the array so that higher priority fringers get drawn first
QuickSort.sort(fringers);
... | [
"protected",
"FringeTile",
"composeFringeTile",
"(",
"FringerRec",
"[",
"]",
"fringers",
",",
"Map",
"<",
"FringeTile",
",",
"WeakReference",
"<",
"FringeTile",
">",
">",
"fringes",
",",
"int",
"hashValue",
",",
"boolean",
"passable",
",",
"Map",
"<",
"Long",
... | Compose a FringeTile out of the various fringe images needed. | [
"Compose",
"a",
"FringeTile",
"out",
"of",
"the",
"various",
"fringe",
"images",
"needed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/AutoFringer.java#L177-L231 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/AutoFringer.java | AutoFringer.getTileImage | protected BufferedImage getTileImage (BufferedImage img,
FringeConfiguration.FringeTileSetRecord tsr, int baseset, int index, int hashValue,
Map<Long, BufferedImage> masks)
throws NoSuchTileSetException
{
int fringeset = tsr.fringe_tsid;
TileSet fset = _tmgr.getTileSet(fringe... | java | protected BufferedImage getTileImage (BufferedImage img,
FringeConfiguration.FringeTileSetRecord tsr, int baseset, int index, int hashValue,
Map<Long, BufferedImage> masks)
throws NoSuchTileSetException
{
int fringeset = tsr.fringe_tsid;
TileSet fset = _tmgr.getTileSet(fringe... | [
"protected",
"BufferedImage",
"getTileImage",
"(",
"BufferedImage",
"img",
",",
"FringeConfiguration",
".",
"FringeTileSetRecord",
"tsr",
",",
"int",
"baseset",
",",
"int",
"index",
",",
"int",
"hashValue",
",",
"Map",
"<",
"Long",
",",
"BufferedImage",
">",
"ma... | Retrieve or compose an image for the specified fringe. | [
"Retrieve",
"or",
"compose",
"an",
"image",
"for",
"the",
"specified",
"fringe",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/AutoFringer.java#L236-L260 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/tile/AutoFringer.java | AutoFringer.getFringeIndexes | protected int[] getFringeIndexes (int bits)
{
int index = BITS_TO_INDEX[bits];
if (index != -1) {
int[] ret = new int[1];
ret[0] = index;
return ret;
}
// otherwise, split the bits into contiguous components
// look for a zero and start o... | java | protected int[] getFringeIndexes (int bits)
{
int index = BITS_TO_INDEX[bits];
if (index != -1) {
int[] ret = new int[1];
ret[0] = index;
return ret;
}
// otherwise, split the bits into contiguous components
// look for a zero and start o... | [
"protected",
"int",
"[",
"]",
"getFringeIndexes",
"(",
"int",
"bits",
")",
"{",
"int",
"index",
"=",
"BITS_TO_INDEX",
"[",
"bits",
"]",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"int",
"[",
"]",
"ret",
"=",
"new",
"int",
"[",
"1",
"]",
... | Get the fringe index specified by the fringebits. If no index is available, try breaking
down the bits into contiguous regions of bits and look for indexes for those. | [
"Get",
"the",
"fringe",
"index",
"specified",
"by",
"the",
"fringebits",
".",
"If",
"no",
"index",
"is",
"available",
"try",
"breaking",
"down",
"the",
"bits",
"into",
"contiguous",
"regions",
"of",
"bits",
"and",
"look",
"for",
"indexes",
"for",
"those",
... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/tile/AutoFringer.java#L287-L336 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.getSound | public Sound getSound (String path)
{
ClipBuffer buffer = null;
if (_manager.isInitialized()) {
buffer = _manager.getClip(_provider, path);
}
return (buffer == null) ? new BlankSound() : new Sound(this, buffer);
} | java | public Sound getSound (String path)
{
ClipBuffer buffer = null;
if (_manager.isInitialized()) {
buffer = _manager.getClip(_provider, path);
}
return (buffer == null) ? new BlankSound() : new Sound(this, buffer);
} | [
"public",
"Sound",
"getSound",
"(",
"String",
"path",
")",
"{",
"ClipBuffer",
"buffer",
"=",
"null",
";",
"if",
"(",
"_manager",
".",
"isInitialized",
"(",
")",
")",
"{",
"buffer",
"=",
"_manager",
".",
"getClip",
"(",
"_provider",
",",
"path",
")",
";... | Obtains an "instance" of the specified sound which can be positioned, played, looped and
otherwise used to make noise. | [
"Obtains",
"an",
"instance",
"of",
"the",
"specified",
"sound",
"which",
"can",
"be",
"positioned",
"played",
"looped",
"and",
"otherwise",
"used",
"to",
"make",
"noise",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L69-L76 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.dispose | public void dispose ()
{
reclaimAll();
for (PooledSource pooled : _sources) {
pooled.source.delete();
}
_sources.clear();
// remove from the manager
_manager.removeGroup(this);
} | java | public void dispose ()
{
reclaimAll();
for (PooledSource pooled : _sources) {
pooled.source.delete();
}
_sources.clear();
// remove from the manager
_manager.removeGroup(this);
} | [
"public",
"void",
"dispose",
"(",
")",
"{",
"reclaimAll",
"(",
")",
";",
"for",
"(",
"PooledSource",
"pooled",
":",
"_sources",
")",
"{",
"pooled",
".",
"source",
".",
"delete",
"(",
")",
";",
"}",
"_sources",
".",
"clear",
"(",
")",
";",
"// remove ... | Disposes this sound group, freeing up the OpenAL sources with which it is associated. All
sounds obtained from this group will no longer be usable and should be discarded. | [
"Disposes",
"this",
"sound",
"group",
"freeing",
"up",
"the",
"OpenAL",
"sources",
"with",
"which",
"it",
"is",
"associated",
".",
"All",
"sounds",
"obtained",
"from",
"this",
"group",
"will",
"no",
"longer",
"be",
"usable",
"and",
"should",
"be",
"discarded... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L82-L92 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.reclaimAll | public void reclaimAll ()
{
// make sure any bound sources are released
for (PooledSource pooled : _sources) {
if (pooled.holder != null) {
pooled.holder.stop();
pooled.holder.reclaim();
pooled.holder = null;
}
}
} | java | public void reclaimAll ()
{
// make sure any bound sources are released
for (PooledSource pooled : _sources) {
if (pooled.holder != null) {
pooled.holder.stop();
pooled.holder.reclaim();
pooled.holder = null;
}
}
} | [
"public",
"void",
"reclaimAll",
"(",
")",
"{",
"// make sure any bound sources are released",
"for",
"(",
"PooledSource",
"pooled",
":",
"_sources",
")",
"{",
"if",
"(",
"pooled",
".",
"holder",
"!=",
"null",
")",
"{",
"pooled",
".",
"holder",
".",
"stop",
"... | Stops and reclaims all sounds from this sound group but does not free the sources. | [
"Stops",
"and",
"reclaims",
"all",
"sounds",
"from",
"this",
"sound",
"group",
"but",
"does",
"not",
"free",
"the",
"sources",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L97-L107 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundGroup.java | SoundGroup.baseGainChanged | protected void baseGainChanged ()
{
// notify any sound currently holding a source
for (int ii = 0, nn = _sources.size(); ii < nn; ii++) {
Sound holder = _sources.get(ii).holder;
if (holder != null) {
holder.updateSourceGain();
}
}
} | java | protected void baseGainChanged ()
{
// notify any sound currently holding a source
for (int ii = 0, nn = _sources.size(); ii < nn; ii++) {
Sound holder = _sources.get(ii).holder;
if (holder != null) {
holder.updateSourceGain();
}
}
} | [
"protected",
"void",
"baseGainChanged",
"(",
")",
"{",
"// notify any sound currently holding a source",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
"=",
"_sources",
".",
"size",
"(",
")",
";",
"ii",
"<",
"nn",
";",
"ii",
"++",
")",
"{",
"Sound",
"hold... | Called by the manager when the base gain has changed. | [
"Called",
"by",
"the",
"manager",
"when",
"the",
"base",
"gain",
"has",
"changed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundGroup.java#L169-L178 | train |
threerings/nenya | core/src/main/java/com/threerings/media/animation/MultiFrameAnimation.java | MultiFrameAnimation.setFrameIndex | protected void setFrameIndex (int fidx)
{
_fidx = fidx;
_bounds.width = _frames.getWidth(_fidx);
_bounds.height = _frames.getHeight(_fidx);
} | java | protected void setFrameIndex (int fidx)
{
_fidx = fidx;
_bounds.width = _frames.getWidth(_fidx);
_bounds.height = _frames.getHeight(_fidx);
} | [
"protected",
"void",
"setFrameIndex",
"(",
"int",
"fidx",
")",
"{",
"_fidx",
"=",
"fidx",
";",
"_bounds",
".",
"width",
"=",
"_frames",
".",
"getWidth",
"(",
"_fidx",
")",
";",
"_bounds",
".",
"height",
"=",
"_frames",
".",
"getHeight",
"(",
"_fidx",
"... | Sets the frame index and updates our dimensions. | [
"Sets",
"the",
"frame",
"index",
"and",
"updates",
"our",
"dimensions",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/MultiFrameAnimation.java#L110-L115 | train |
tonilopezmr/Android-EasySQLite | easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteDelegate.java | SQLiteDelegate.read | @Override
public synchronized T read(T dto) throws Exception {
Cursor cursor = db.query(transformer.getTableName(), transformer.getFields(), transformer.getWhereClause(dto),null, null,null,null);
T object = null;
if (cursor.moveToFirst()){
object = transformer.transform(cursor);
... | java | @Override
public synchronized T read(T dto) throws Exception {
Cursor cursor = db.query(transformer.getTableName(), transformer.getFields(), transformer.getWhereClause(dto),null, null,null,null);
T object = null;
if (cursor.moveToFirst()){
object = transformer.transform(cursor);
... | [
"@",
"Override",
"public",
"synchronized",
"T",
"read",
"(",
"T",
"dto",
")",
"throws",
"Exception",
"{",
"Cursor",
"cursor",
"=",
"db",
".",
"query",
"(",
"transformer",
".",
"getTableName",
"(",
")",
",",
"transformer",
".",
"getFields",
"(",
")",
",",... | Convenience method for reading rows in the database.
@param dto row in database
@return T object
@throws Exception on error | [
"Convenience",
"method",
"for",
"reading",
"rows",
"in",
"the",
"database",
"."
] | bb991a43c9fa11522e5367570ee2335b99bca7c0 | https://github.com/tonilopezmr/Android-EasySQLite/blob/bb991a43c9fa11522e5367570ee2335b99bca7c0/easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteDelegate.java#L112-L120 | train |
tonilopezmr/Android-EasySQLite | easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteDelegate.java | SQLiteDelegate.readAll | @Override
public synchronized Collection<T> readAll() throws Exception {
Cursor cursor = db.query(transformer.getTableName(), transformer.getFields(), null, null, null, null, null);
Collection<T> list = getAllCursor(cursor);
return list;
} | java | @Override
public synchronized Collection<T> readAll() throws Exception {
Cursor cursor = db.query(transformer.getTableName(), transformer.getFields(), null, null, null, null, null);
Collection<T> list = getAllCursor(cursor);
return list;
} | [
"@",
"Override",
"public",
"synchronized",
"Collection",
"<",
"T",
">",
"readAll",
"(",
")",
"throws",
"Exception",
"{",
"Cursor",
"cursor",
"=",
"db",
".",
"query",
"(",
"transformer",
".",
"getTableName",
"(",
")",
",",
"transformer",
".",
"getFields",
"... | Convenience method for reading all rows in the table of database.
@return Collection objects
@throws Exception on error | [
"Convenience",
"method",
"for",
"reading",
"all",
"rows",
"in",
"the",
"table",
"of",
"database",
"."
] | bb991a43c9fa11522e5367570ee2335b99bca7c0 | https://github.com/tonilopezmr/Android-EasySQLite/blob/bb991a43c9fa11522e5367570ee2335b99bca7c0/easysqlite/src/main/java/com/tonilopezmr/easysqlite/SQLiteDelegate.java#L128-L133 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.dot | public static int dot (Point v1s, Point v1e, Point v2s, Point v2e)
{
return ((v1e.x - v1s.x) * (v2e.x - v2s.x) + (v1e.y - v1s.y) * (v2e.y - v2s.y));
} | java | public static int dot (Point v1s, Point v1e, Point v2s, Point v2e)
{
return ((v1e.x - v1s.x) * (v2e.x - v2s.x) + (v1e.y - v1s.y) * (v2e.y - v2s.y));
} | [
"public",
"static",
"int",
"dot",
"(",
"Point",
"v1s",
",",
"Point",
"v1e",
",",
"Point",
"v2s",
",",
"Point",
"v2e",
")",
"{",
"return",
"(",
"(",
"v1e",
".",
"x",
"-",
"v1s",
".",
"x",
")",
"*",
"(",
"v2e",
".",
"x",
"-",
"v2s",
".",
"x",
... | Computes and returns the dot product of the two vectors.
@param v1s the starting point of the first vector.
@param v1e the ending point of the first vector.
@param v2s the starting point of the second vector.
@param v2e the ending point of the second vector. | [
"Computes",
"and",
"returns",
"the",
"dot",
"product",
"of",
"the",
"two",
"vectors",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L41-L44 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.dot | public static int dot (Point vs, Point v1e, Point v2e)
{
return ((v1e.x - vs.x) * (v2e.x - vs.x) + (v1e.y - vs.y) * (v2e.y - vs.y));
} | java | public static int dot (Point vs, Point v1e, Point v2e)
{
return ((v1e.x - vs.x) * (v2e.x - vs.x) + (v1e.y - vs.y) * (v2e.y - vs.y));
} | [
"public",
"static",
"int",
"dot",
"(",
"Point",
"vs",
",",
"Point",
"v1e",
",",
"Point",
"v2e",
")",
"{",
"return",
"(",
"(",
"v1e",
".",
"x",
"-",
"vs",
".",
"x",
")",
"*",
"(",
"v2e",
".",
"x",
"-",
"vs",
".",
"x",
")",
"+",
"(",
"v1e",
... | Computes and returns the dot product of the two vectors. The vectors are assumed to start
with the same coordinate and end with different coordinates.
@param vs the starting point of both vectors.
@param v1e the ending point of the first vector.
@param v2e the ending point of the second vector. | [
"Computes",
"and",
"returns",
"the",
"dot",
"product",
"of",
"the",
"two",
"vectors",
".",
"The",
"vectors",
"are",
"assumed",
"to",
"start",
"with",
"the",
"same",
"coordinate",
"and",
"end",
"with",
"different",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L64-L67 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.lineIntersection | public static boolean lineIntersection (Point2D p1, Point2D p2, boolean seg1,
Point2D p3, Point2D p4, boolean seg2, Point2D result)
{
// see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/
double y43 = p4.getY() - p3.getY();
double x21 =... | java | public static boolean lineIntersection (Point2D p1, Point2D p2, boolean seg1,
Point2D p3, Point2D p4, boolean seg2, Point2D result)
{
// see http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/
double y43 = p4.getY() - p3.getY();
double x21 =... | [
"public",
"static",
"boolean",
"lineIntersection",
"(",
"Point2D",
"p1",
",",
"Point2D",
"p2",
",",
"boolean",
"seg1",
",",
"Point2D",
"p3",
",",
"Point2D",
"p4",
",",
"boolean",
"seg2",
",",
"Point2D",
"result",
")",
"{",
"// see http://astronomy.swin.edu.au/~p... | Calculate the intersection of two lines. Either line may be considered as a line segment,
and the intersecting point is only considered valid if it lies upon the segment. Note that
Point extends Point2D.
@param p1 and p2 the coordinates of the first line.
@param seg1 if the first line should be considered a segment.
... | [
"Calculate",
"the",
"intersection",
"of",
"two",
"lines",
".",
"Either",
"line",
"may",
"be",
"considered",
"as",
"a",
"line",
"segment",
"and",
"the",
"intersecting",
"point",
"is",
"only",
"considered",
"valid",
"if",
"it",
"lies",
"upon",
"the",
"segment"... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L117-L148 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.grow | public static Rectangle grow (Rectangle source, Rectangle target)
{
if (target == null) {
log.warning("Can't grow with null rectangle [src=" + source + ", tgt=" + target + "].",
new Exception());
} else if (source == null) {
source = new Rectangle(targ... | java | public static Rectangle grow (Rectangle source, Rectangle target)
{
if (target == null) {
log.warning("Can't grow with null rectangle [src=" + source + ", tgt=" + target + "].",
new Exception());
} else if (source == null) {
source = new Rectangle(targ... | [
"public",
"static",
"Rectangle",
"grow",
"(",
"Rectangle",
"source",
",",
"Rectangle",
"target",
")",
"{",
"if",
"(",
"target",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Can't grow with null rectangle [src=\"",
"+",
"source",
"+",
"\", tgt=\"",
"+... | Adds the target rectangle to the bounds of the source rectangle. If the source rectangle is
null, a new rectangle is created that is the size of the target rectangle.
@return the source rectangle. | [
"Adds",
"the",
"target",
"rectangle",
"to",
"the",
"bounds",
"of",
"the",
"source",
"rectangle",
".",
"If",
"the",
"source",
"rectangle",
"is",
"null",
"a",
"new",
"rectangle",
"is",
"created",
"that",
"is",
"the",
"size",
"of",
"the",
"target",
"rectangle... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L200-L211 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.getTile | public static Rectangle getTile (
int width, int height, int tileWidth, int tileHeight, int tileIndex)
{
Rectangle bounds = new Rectangle();
getTile(width, height, tileWidth, tileHeight, tileIndex, bounds);
return bounds;
} | java | public static Rectangle getTile (
int width, int height, int tileWidth, int tileHeight, int tileIndex)
{
Rectangle bounds = new Rectangle();
getTile(width, height, tileWidth, tileHeight, tileIndex, bounds);
return bounds;
} | [
"public",
"static",
"Rectangle",
"getTile",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
",",
"int",
"tileIndex",
")",
"{",
"Rectangle",
"bounds",
"=",
"new",
"Rectangle",
"(",
")",
";",
"getTile",
"(",
"w... | Returns the rectangle containing the specified tile in the supplied larger rectangle. Tiles
go from left to right, top to bottom. | [
"Returns",
"the",
"rectangle",
"containing",
"the",
"specified",
"tile",
"in",
"the",
"supplied",
"larger",
"rectangle",
".",
"Tiles",
"go",
"from",
"left",
"to",
"right",
"top",
"to",
"bottom",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L217-L223 | train |
threerings/nenya | core/src/main/java/com/threerings/geom/GeomUtil.java | GeomUtil.getTile | public static void getTile (int width, int height, int tileWidth, int tileHeight, int tileIndex,
Rectangle bounds)
{
// figure out from whence to crop the tile
int tilesPerRow = width / tileWidth;
// if we got a bogus region, return bogus tile bounds
... | java | public static void getTile (int width, int height, int tileWidth, int tileHeight, int tileIndex,
Rectangle bounds)
{
// figure out from whence to crop the tile
int tilesPerRow = width / tileWidth;
// if we got a bogus region, return bogus tile bounds
... | [
"public",
"static",
"void",
"getTile",
"(",
"int",
"width",
",",
"int",
"height",
",",
"int",
"tileWidth",
",",
"int",
"tileHeight",
",",
"int",
"tileIndex",
",",
"Rectangle",
"bounds",
")",
"{",
"// figure out from whence to crop the tile",
"int",
"tilesPerRow",
... | Fills in the bounds of the specified tile in the supplied larger rectangle. Tiles go from
left to right, top to bottom. | [
"Fills",
"in",
"the",
"bounds",
"of",
"the",
"specified",
"tile",
"in",
"the",
"supplied",
"larger",
"rectangle",
".",
"Tiles",
"go",
"from",
"left",
"to",
"right",
"top",
"to",
"bottom",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/geom/GeomUtil.java#L229-L245 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/ws/impl/WebSocketImpl.java | WebSocketImpl.setNegotiatedExtensions | private void setNegotiatedExtensions(String extensionsHeader) {
if ((extensionsHeader == null) ||
(extensionsHeader.trim().length() == 0)) {
_negotiatedExtensions = null;
return;
}
String[] extns = extensionsHeader.split(",");
List<String... | java | private void setNegotiatedExtensions(String extensionsHeader) {
if ((extensionsHeader == null) ||
(extensionsHeader.trim().length() == 0)) {
_negotiatedExtensions = null;
return;
}
String[] extns = extensionsHeader.split(",");
List<String... | [
"private",
"void",
"setNegotiatedExtensions",
"(",
"String",
"extensionsHeader",
")",
"{",
"if",
"(",
"(",
"extensionsHeader",
"==",
"null",
")",
"||",
"(",
"extensionsHeader",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
"_n... | RFC 3864 format. | [
"RFC",
"3864",
"format",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/ws/impl/WebSocketImpl.java#L972-L1048 | train |
groupon/robo-remote | RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/components/ListView.java | ListView.scrollToIndex | public static int scrollToIndex(String listRef, int itemIndex) throws Exception {
int listViewIndex = getListViewIndex(listRef);
if (itemIndex >= numItemsInList(listRef))
throw new Exception("Item index is greater than number of items in the list");
// scroll to the top of this vie... | java | public static int scrollToIndex(String listRef, int itemIndex) throws Exception {
int listViewIndex = getListViewIndex(listRef);
if (itemIndex >= numItemsInList(listRef))
throw new Exception("Item index is greater than number of items in the list");
// scroll to the top of this vie... | [
"public",
"static",
"int",
"scrollToIndex",
"(",
"String",
"listRef",
",",
"int",
"itemIndex",
")",
"throws",
"Exception",
"{",
"int",
"listViewIndex",
"=",
"getListViewIndex",
"(",
"listRef",
")",
";",
"if",
"(",
"itemIndex",
">=",
"numItemsInList",
"(",
"lis... | Scrolls the specified item index onto the screen and returns the offset based on the current visible list
@param listRef
@param itemIndex
@return
@throws Exception | [
"Scrolls",
"the",
"specified",
"item",
"index",
"onto",
"the",
"screen",
"and",
"returns",
"the",
"offset",
"based",
"on",
"the",
"current",
"visible",
"list"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/components/ListView.java#L93-L135 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/TrailingAverage.java | TrailingAverage.value | public int value ()
{
int end = Math.min(_history.length, _index);
int value = 0;
for (int ii = 0; ii < end; ii++) {
value += _history[ii];
}
return (end > 0) ? (value/end) : 0;
} | java | public int value ()
{
int end = Math.min(_history.length, _index);
int value = 0;
for (int ii = 0; ii < end; ii++) {
value += _history[ii];
}
return (end > 0) ? (value/end) : 0;
} | [
"public",
"int",
"value",
"(",
")",
"{",
"int",
"end",
"=",
"Math",
".",
"min",
"(",
"_history",
".",
"length",
",",
"_index",
")",
";",
"int",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"end",
";",
"ii",
"++",... | Returns the current averaged value. | [
"Returns",
"the",
"current",
"averaged",
"value",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/TrailingAverage.java#L56-L64 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.loop | protected Frob loop (String pkgPath, String key, float pan, byte cmd)
{
SoundKey skey = new SoundKey(cmd, pkgPath, key, 0, _clipVol, pan);
addToPlayQueue(skey);
return skey; // it is a frob
} | java | protected Frob loop (String pkgPath, String key, float pan, byte cmd)
{
SoundKey skey = new SoundKey(cmd, pkgPath, key, 0, _clipVol, pan);
addToPlayQueue(skey);
return skey; // it is a frob
} | [
"protected",
"Frob",
"loop",
"(",
"String",
"pkgPath",
",",
"String",
"key",
",",
"float",
"pan",
",",
"byte",
"cmd",
")",
"{",
"SoundKey",
"skey",
"=",
"new",
"SoundKey",
"(",
"cmd",
",",
"pkgPath",
",",
"key",
",",
"0",
",",
"_clipVol",
",",
"pan",... | Loop the specified sound. | [
"Loop",
"the",
"specified",
"sound",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L176-L181 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.addToPlayQueue | protected void addToPlayQueue (SoundKey skey)
{
boolean queued = enqueue(skey, true);
if (queued) {
if (_verbose.getValue()) {
log.info("Sound request [key=" + skey.key + "].");
}
} else /* if (_verbose.getValue()) */ {
log.warning("SoundM... | java | protected void addToPlayQueue (SoundKey skey)
{
boolean queued = enqueue(skey, true);
if (queued) {
if (_verbose.getValue()) {
log.info("Sound request [key=" + skey.key + "].");
}
} else /* if (_verbose.getValue()) */ {
log.warning("SoundM... | [
"protected",
"void",
"addToPlayQueue",
"(",
"SoundKey",
"skey",
")",
"{",
"boolean",
"queued",
"=",
"enqueue",
"(",
"skey",
",",
"true",
")",
";",
"if",
"(",
"queued",
")",
"{",
"if",
"(",
"_verbose",
".",
"getValue",
"(",
")",
")",
"{",
"log",
".",
... | Add the sound clip key to the queue to be played. | [
"Add",
"the",
"sound",
"clip",
"key",
"to",
"the",
"queue",
"to",
"be",
"played",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L186-L198 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.enqueue | protected boolean enqueue (SoundKey key, boolean okToStartNew)
{
boolean add;
boolean queued;
synchronized (_queue) {
if (key.cmd == PLAY && _queue.size() > MAX_QUEUE_SIZE) {
queued = add = false;
} else {
_queue.appendLoud(key);
... | java | protected boolean enqueue (SoundKey key, boolean okToStartNew)
{
boolean add;
boolean queued;
synchronized (_queue) {
if (key.cmd == PLAY && _queue.size() > MAX_QUEUE_SIZE) {
queued = add = false;
} else {
_queue.appendLoud(key);
... | [
"protected",
"boolean",
"enqueue",
"(",
"SoundKey",
"key",
",",
"boolean",
"okToStartNew",
")",
"{",
"boolean",
"add",
";",
"boolean",
"queued",
";",
"synchronized",
"(",
"_queue",
")",
"{",
"if",
"(",
"key",
".",
"cmd",
"==",
"PLAY",
"&&",
"_queue",
"."... | Enqueue a new SoundKey. | [
"Enqueue",
"a",
"new",
"SoundKey",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L203-L233 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.spoolerRun | protected void spoolerRun ()
{
while (true) {
try {
SoundKey key;
synchronized (_queue) {
_freeSpoolers++;
key = _queue.get(MAX_WAIT_TIME);
_freeSpoolers--;
if (key == null || key.cmd... | java | protected void spoolerRun ()
{
while (true) {
try {
SoundKey key;
synchronized (_queue) {
_freeSpoolers++;
key = _queue.get(MAX_WAIT_TIME);
_freeSpoolers--;
if (key == null || key.cmd... | [
"protected",
"void",
"spoolerRun",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"SoundKey",
"key",
";",
"synchronized",
"(",
"_queue",
")",
"{",
"_freeSpoolers",
"++",
";",
"key",
"=",
"_queue",
".",
"get",
"(",
"MAX_WAIT_TIME",
")",
";",... | This is the primary run method of the sound-playing threads. | [
"This",
"is",
"the",
"primary",
"run",
"method",
"of",
"the",
"sound",
"-",
"playing",
"threads",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L238-L265 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.processKey | protected void processKey (SoundKey key)
throws Exception
{
switch (key.cmd) {
case PLAY:
case LOOP:
playSound(key);
break;
case LOCK:
if (!isTesting()) {
synchronized (_clipCache) {
try {
... | java | protected void processKey (SoundKey key)
throws Exception
{
switch (key.cmd) {
case PLAY:
case LOOP:
playSound(key);
break;
case LOCK:
if (!isTesting()) {
synchronized (_clipCache) {
try {
... | [
"protected",
"void",
"processKey",
"(",
"SoundKey",
"key",
")",
"throws",
"Exception",
"{",
"switch",
"(",
"key",
".",
"cmd",
")",
"{",
"case",
"PLAY",
":",
"case",
"LOOP",
":",
"playSound",
"(",
"key",
")",
";",
"break",
";",
"case",
"LOCK",
":",
"i... | Process the requested command in the specified SoundKey. | [
"Process",
"the",
"requested",
"command",
"in",
"the",
"specified",
"SoundKey",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L270-L302 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.getClipData | protected byte[] getClipData (SoundKey key)
throws IOException, UnsupportedAudioFileException
{
byte[][] data;
synchronized (_clipCache) {
// if we're testing, clear all non-locked sounds every time
if (isTesting()) {
_clipCache.clear();
}
... | java | protected byte[] getClipData (SoundKey key)
throws IOException, UnsupportedAudioFileException
{
byte[][] data;
synchronized (_clipCache) {
// if we're testing, clear all non-locked sounds every time
if (isTesting()) {
_clipCache.clear();
}
... | [
"protected",
"byte",
"[",
"]",
"getClipData",
"(",
"SoundKey",
"key",
")",
"throws",
"IOException",
",",
"UnsupportedAudioFileException",
"{",
"byte",
"[",
"]",
"[",
"]",
"data",
";",
"synchronized",
"(",
"_clipCache",
")",
"{",
"// if we're testing, clear all non... | Called by spooling threads, loads clip data from the resource manager or the cache. | [
"Called",
"by",
"spooling",
"threads",
"loads",
"clip",
"data",
"from",
"the",
"resource",
"manager",
"or",
"the",
"cache",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L484-L519 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.adjustVolume | protected static void adjustVolume (Line line, float vol)
{
FloatControl control = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
// the only problem is that gain is specified in decibals, which is a logarithmic scale.
// Since we want max volume to leave the sample unchange... | java | protected static void adjustVolume (Line line, float vol)
{
FloatControl control = (FloatControl) line.getControl(FloatControl.Type.MASTER_GAIN);
// the only problem is that gain is specified in decibals, which is a logarithmic scale.
// Since we want max volume to leave the sample unchange... | [
"protected",
"static",
"void",
"adjustVolume",
"(",
"Line",
"line",
",",
"float",
"vol",
")",
"{",
"FloatControl",
"control",
"=",
"(",
"FloatControl",
")",
"line",
".",
"getControl",
"(",
"FloatControl",
".",
"Type",
".",
"MASTER_GAIN",
")",
";",
"// the on... | Use the gain control to implement volume. | [
"Use",
"the",
"gain",
"control",
"to",
"implement",
"volume",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L577-L593 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java | JavaSoundPlayer.adjustPan | protected static void adjustPan (Line line, float pan)
{
try {
FloatControl control = (FloatControl) line.getControl(FloatControl.Type.PAN);
control.setValue(pan);
} catch (Exception e) {
log.debug("Cannot set pan on line: " + e);
}
} | java | protected static void adjustPan (Line line, float pan)
{
try {
FloatControl control = (FloatControl) line.getControl(FloatControl.Type.PAN);
control.setValue(pan);
} catch (Exception e) {
log.debug("Cannot set pan on line: " + e);
}
} | [
"protected",
"static",
"void",
"adjustPan",
"(",
"Line",
"line",
",",
"float",
"pan",
")",
"{",
"try",
"{",
"FloatControl",
"control",
"=",
"(",
"FloatControl",
")",
"line",
".",
"getControl",
"(",
"FloatControl",
".",
"Type",
".",
"PAN",
")",
";",
"cont... | Set the pan value for the specified line. | [
"Set",
"the",
"pan",
"value",
"for",
"the",
"specified",
"line",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/JavaSoundPlayer.java#L598-L606 | train |
threerings/nenya | core/src/main/java/com/threerings/media/FrameInterval.java | FrameInterval.tick | public void tick (long tickStamp)
{
if (_nextTime == -1) {
// First time through
_nextTime = tickStamp + _initDelay;
} else if (tickStamp >= _nextTime) {
// If we're repeating, set the next time to run, otherwise, reset
if (_repeatDelay != 0L) {
... | java | public void tick (long tickStamp)
{
if (_nextTime == -1) {
// First time through
_nextTime = tickStamp + _initDelay;
} else if (tickStamp >= _nextTime) {
// If we're repeating, set the next time to run, otherwise, reset
if (_repeatDelay != 0L) {
... | [
"public",
"void",
"tick",
"(",
"long",
"tickStamp",
")",
"{",
"if",
"(",
"_nextTime",
"==",
"-",
"1",
")",
"{",
"// First time through",
"_nextTime",
"=",
"tickStamp",
"+",
"_initDelay",
";",
"}",
"else",
"if",
"(",
"tickStamp",
">=",
"_nextTime",
")",
"... | documentation inherited from FrameParticipant | [
"documentation",
"inherited",
"from",
"FrameParticipant"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/FrameInterval.java#L48-L64 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sprite/OrientableImageSprite.java | OrientableImageSprite.getRotationTransform | private AffineTransform getRotationTransform ()
{
double theta;
switch (_orient) {
case NORTH:
default:
theta = 0.0;
break;
case SOUTH:
theta = Math.PI;
break;
case EAST:
... | java | private AffineTransform getRotationTransform ()
{
double theta;
switch (_orient) {
case NORTH:
default:
theta = 0.0;
break;
case SOUTH:
theta = Math.PI;
break;
case EAST:
... | [
"private",
"AffineTransform",
"getRotationTransform",
"(",
")",
"{",
"double",
"theta",
";",
"switch",
"(",
"_orient",
")",
"{",
"case",
"NORTH",
":",
"default",
":",
"theta",
"=",
"0.0",
";",
"break",
";",
"case",
"SOUTH",
":",
"theta",
"=",
"Math",
"."... | Computes and returns the rotation transform for this
sprite.
@return the newly computed rotation transform | [
"Computes",
"and",
"returns",
"the",
"rotation",
"transform",
"for",
"this",
"sprite",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sprite/OrientableImageSprite.java#L68-L144 | train |
groupon/monsoon | expr/src/main/java/com/groupon/lex/metrics/MetricMatcher.java | MetricMatcher.filter | public Stream<Entry<MatchedName, MetricValue>> filter(Context t) {
return t.getTSData().getCurrentCollection().get(this::match, x -> true).stream()
.flatMap(this::filterMetricsInTsv);
} | java | public Stream<Entry<MatchedName, MetricValue>> filter(Context t) {
return t.getTSData().getCurrentCollection().get(this::match, x -> true).stream()
.flatMap(this::filterMetricsInTsv);
} | [
"public",
"Stream",
"<",
"Entry",
"<",
"MatchedName",
",",
"MetricValue",
">",
">",
"filter",
"(",
"Context",
"t",
")",
"{",
"return",
"t",
".",
"getTSData",
"(",
")",
".",
"getCurrentCollection",
"(",
")",
".",
"get",
"(",
"this",
"::",
"match",
",",
... | Create a stream of TimeSeriesMetricDeltas with values. | [
"Create",
"a",
"stream",
"of",
"TimeSeriesMetricDeltas",
"with",
"values",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/expr/src/main/java/com/groupon/lex/metrics/MetricMatcher.java#L85-L88 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ColorUtil.java | ColorUtil.blend | public static final Color blend (Color c1, Color c2)
{
return new Color((c1.getRed() + c2.getRed()) >> 1,
(c1.getGreen() + c2.getGreen()) >> 1,
(c1.getBlue() + c2.getBlue()) >> 1);
} | java | public static final Color blend (Color c1, Color c2)
{
return new Color((c1.getRed() + c2.getRed()) >> 1,
(c1.getGreen() + c2.getGreen()) >> 1,
(c1.getBlue() + c2.getBlue()) >> 1);
} | [
"public",
"static",
"final",
"Color",
"blend",
"(",
"Color",
"c1",
",",
"Color",
"c2",
")",
"{",
"return",
"new",
"Color",
"(",
"(",
"c1",
".",
"getRed",
"(",
")",
"+",
"c2",
".",
"getRed",
"(",
")",
")",
">>",
"1",
",",
"(",
"c1",
".",
"getGre... | Blends the two supplied colors.
@return a color halfway between the two colors. | [
"Blends",
"the",
"two",
"supplied",
"colors",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorUtil.java#L34-L39 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/ColorUtil.java | ColorUtil.blend | public static final Color blend (Color c1, Color c2, float firstperc)
{
float p2 = 1.0f - firstperc;
return new Color((int) (c1.getRed() * firstperc + c2.getRed() * p2),
(int) (c1.getGreen() * firstperc + c2.getGreen() * p2),
(int) (c1.getBlue() * firstperc + c2.get... | java | public static final Color blend (Color c1, Color c2, float firstperc)
{
float p2 = 1.0f - firstperc;
return new Color((int) (c1.getRed() * firstperc + c2.getRed() * p2),
(int) (c1.getGreen() * firstperc + c2.getGreen() * p2),
(int) (c1.getBlue() * firstperc + c2.get... | [
"public",
"static",
"final",
"Color",
"blend",
"(",
"Color",
"c1",
",",
"Color",
"c2",
",",
"float",
"firstperc",
")",
"{",
"float",
"p2",
"=",
"1.0f",
"-",
"firstperc",
";",
"return",
"new",
"Color",
"(",
"(",
"int",
")",
"(",
"c1",
".",
"getRed",
... | Blends the two supplied colors, using the supplied percentage
as the amount of the first color to use.
@param firstperc The percentage of the first color to use, from 0.0f
to 1.0f inclusive. | [
"Blends",
"the",
"two",
"supplied",
"colors",
"using",
"the",
"supplied",
"percentage",
"as",
"the",
"amount",
"of",
"the",
"first",
"color",
"to",
"use",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/ColorUtil.java#L48-L54 | train |
jdillon/gshell | gshell-core/src/main/java/com/planet57/gshell/MainSupport.java | MainSupport.setupLogging | protected void setupLogging(@Nullable final Level level) {
// install JUL adapter
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
// conifgure gossip bootstrap loggers with target factory
Log.configure(LoggerFactory.getILoggerFactory());
log.debug("Logging setup;... | java | protected void setupLogging(@Nullable final Level level) {
// install JUL adapter
SLF4JBridgeHandler.removeHandlersForRootLogger();
SLF4JBridgeHandler.install();
// conifgure gossip bootstrap loggers with target factory
Log.configure(LoggerFactory.getILoggerFactory());
log.debug("Logging setup;... | [
"protected",
"void",
"setupLogging",
"(",
"@",
"Nullable",
"final",
"Level",
"level",
")",
"{",
"// install JUL adapter",
"SLF4JBridgeHandler",
".",
"removeHandlersForRootLogger",
"(",
")",
";",
"SLF4JBridgeHandler",
".",
"install",
"(",
")",
";",
"// conifgure gossip... | Setup logging environment. | [
"Setup",
"logging",
"environment",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-core/src/main/java/com/planet57/gshell/MainSupport.java#L258-L266 | train |
threerings/nenya | core/src/main/java/com/threerings/media/animation/AnimationWaiter.java | AnimationWaiter.addAnimations | public void addAnimations (Animation[] anims)
{
int acount = anims.length;
for (int ii = 0; ii < acount; ii++) {
addAnimation(anims[ii]);
}
} | java | public void addAnimations (Animation[] anims)
{
int acount = anims.length;
for (int ii = 0; ii < acount; ii++) {
addAnimation(anims[ii]);
}
} | [
"public",
"void",
"addAnimations",
"(",
"Animation",
"[",
"]",
"anims",
")",
"{",
"int",
"acount",
"=",
"anims",
".",
"length",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"acount",
";",
"ii",
"++",
")",
"{",
"addAnimation",
"(",
"anims... | Adds the supplied animations to the animation waiter for
observation. | [
"Adds",
"the",
"supplied",
"animations",
"to",
"the",
"animation",
"waiter",
"for",
"observation",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/AnimationWaiter.java#L45-L51 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundManager.java | SoundManager.createSoundManager | public static SoundManager createSoundManager (RunQueue rqueue)
{
if (_soundmgr != null) {
throw new IllegalStateException("A sound manager has already been created.");
}
_soundmgr = new SoundManager(rqueue);
return _soundmgr;
} | java | public static SoundManager createSoundManager (RunQueue rqueue)
{
if (_soundmgr != null) {
throw new IllegalStateException("A sound manager has already been created.");
}
_soundmgr = new SoundManager(rqueue);
return _soundmgr;
} | [
"public",
"static",
"SoundManager",
"createSoundManager",
"(",
"RunQueue",
"rqueue",
")",
"{",
"if",
"(",
"_soundmgr",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"A sound manager has already been created.\"",
")",
";",
"}",
"_soundmgr",
... | Creates, initializes and returns the singleton sound manager instance.
@param rqueue a queue that the sound manager can use to post short runnables that must be
executed on the same thread from which all other sound methods will be called. | [
"Creates",
"initializes",
"and",
"returns",
"the",
"singleton",
"sound",
"manager",
"instance",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundManager.java#L66-L73 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundManager.java | SoundManager.updateStreams | public void updateStreams (float time)
{
// iterate backwards through the list so that streams can dispose of themselves during
// their update
for (int ii = _streams.size() - 1; ii >= 0; ii--) {
_streams.get(ii).update(time);
}
// delete any finalized objects
... | java | public void updateStreams (float time)
{
// iterate backwards through the list so that streams can dispose of themselves during
// their update
for (int ii = _streams.size() - 1; ii >= 0; ii--) {
_streams.get(ii).update(time);
}
// delete any finalized objects
... | [
"public",
"void",
"updateStreams",
"(",
"float",
"time",
")",
"{",
"// iterate backwards through the list so that streams can dispose of themselves during",
"// their update",
"for",
"(",
"int",
"ii",
"=",
"_streams",
".",
"size",
"(",
")",
"-",
"1",
";",
"ii",
">=",
... | Updates all of the streams controlled by the manager. This should be called once per frame
by the application.
@param time the number of seconds elapsed since the last update | [
"Updates",
"all",
"of",
"the",
"streams",
"controlled",
"by",
"the",
"manager",
".",
"This",
"should",
"be",
"called",
"once",
"per",
"frame",
"by",
"the",
"application",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundManager.java#L166-L176 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundManager.java | SoundManager.loadClip | public void loadClip (ClipProvider provider, String path, Observer observer)
{
getClip(provider, path, observer);
} | java | public void loadClip (ClipProvider provider, String path, Observer observer)
{
getClip(provider, path, observer);
} | [
"public",
"void",
"loadClip",
"(",
"ClipProvider",
"provider",
",",
"String",
"path",
",",
"Observer",
"observer",
")",
"{",
"getClip",
"(",
"provider",
",",
"path",
",",
"observer",
")",
";",
"}"
] | Loads a clip buffer for the sound clip loaded via the specified provider with the
specified path. The loaded clip is placed in the cache. | [
"Loads",
"a",
"clip",
"buffer",
"for",
"the",
"sound",
"clip",
"loaded",
"via",
"the",
"specified",
"provider",
"with",
"the",
"specified",
"path",
".",
"The",
"loaded",
"clip",
"is",
"placed",
"in",
"the",
"cache",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundManager.java#L191-L194 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/SoundManager.java | SoundManager.deleteFinalizedObjects | protected synchronized void deleteFinalizedObjects ()
{
if (_finalizedSources != null) {
IntBuffer idbuf = BufferUtils.createIntBuffer(_finalizedSources.length);
idbuf.put(_finalizedSources).rewind();
AL10.alDeleteSources(idbuf);
_finalizedSources = null;
... | java | protected synchronized void deleteFinalizedObjects ()
{
if (_finalizedSources != null) {
IntBuffer idbuf = BufferUtils.createIntBuffer(_finalizedSources.length);
idbuf.put(_finalizedSources).rewind();
AL10.alDeleteSources(idbuf);
_finalizedSources = null;
... | [
"protected",
"synchronized",
"void",
"deleteFinalizedObjects",
"(",
")",
"{",
"if",
"(",
"_finalizedSources",
"!=",
"null",
")",
"{",
"IntBuffer",
"idbuf",
"=",
"BufferUtils",
".",
"createIntBuffer",
"(",
"_finalizedSources",
".",
"length",
")",
";",
"idbuf",
".... | Deletes all finalized objects. | [
"Deletes",
"all",
"finalized",
"objects",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/SoundManager.java#L369-L383 | train |
threerings/nenya | core/src/main/java/com/threerings/media/animation/FloatingTextAnimation.java | FloatingTextAnimation.paintLabels | protected void paintLabels (Graphics2D gfx, int x, int y)
{
_label.render(gfx, x, y);
} | java | protected void paintLabels (Graphics2D gfx, int x, int y)
{
_label.render(gfx, x, y);
} | [
"protected",
"void",
"paintLabels",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"_label",
".",
"render",
"(",
"gfx",
",",
"x",
",",
"y",
")",
";",
"}"
] | Derived classes may wish to extend score animation and render more than just the standard
single label.
@param x the upper left coordinate of the animation.
@param y the upper left coordinate of the animation. | [
"Derived",
"classes",
"may",
"wish",
"to",
"extend",
"score",
"animation",
"and",
"render",
"more",
"than",
"just",
"the",
"standard",
"single",
"label",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/animation/FloatingTextAnimation.java#L195-L198 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java | ValidationDataGroup.addRule | public void addRule(ValidationData vd) {
this.rules.addAll(vd.getValidationRules().stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
} | java | public void addRule(ValidationData vd) {
this.rules.addAll(vd.getValidationRules().stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
} | [
"public",
"void",
"addRule",
"(",
"ValidationData",
"vd",
")",
"{",
"this",
".",
"rules",
".",
"addAll",
"(",
"vd",
".",
"getValidationRules",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"vr",
"->",
"vr",
".",
"isUse",
"(",
")",
")",
"."... | Add rule.
@param vd the vd | [
"Add",
"rule",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java#L36-L38 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java | ValidationDataGroup.initDataGroup | public void initDataGroup(ParamType paramType, List<ValidationData> lists) {
this.paramType = paramType;
lists.forEach(vd -> {
this.addRule(vd);
});
} | java | public void initDataGroup(ParamType paramType, List<ValidationData> lists) {
this.paramType = paramType;
lists.forEach(vd -> {
this.addRule(vd);
});
} | [
"public",
"void",
"initDataGroup",
"(",
"ParamType",
"paramType",
",",
"List",
"<",
"ValidationData",
">",
"lists",
")",
"{",
"this",
".",
"paramType",
"=",
"paramType",
";",
"lists",
".",
"forEach",
"(",
"vd",
"->",
"{",
"this",
".",
"addRule",
"(",
"vd... | Init data group.
@param paramType the param type
@param lists the lists | [
"Init",
"data",
"group",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/store/ValidationDataGroup.java#L46-L53 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/GoogleV3MapWidget.java | GoogleV3MapWidget.addMapZoomEndHandler | @Override
public HandlerRegistration addMapZoomEndHandler(final Runnable zoomHandler){
return mapWidget.addZoomChangeHandler(zoomChangeMapEvent -> zoomHandler.run());
} | java | @Override
public HandlerRegistration addMapZoomEndHandler(final Runnable zoomHandler){
return mapWidget.addZoomChangeHandler(zoomChangeMapEvent -> zoomHandler.run());
} | [
"@",
"Override",
"public",
"HandlerRegistration",
"addMapZoomEndHandler",
"(",
"final",
"Runnable",
"zoomHandler",
")",
"{",
"return",
"mapWidget",
".",
"addZoomChangeHandler",
"(",
"zoomChangeMapEvent",
"->",
"zoomHandler",
".",
"run",
"(",
")",
")",
";",
"}"
] | Add zoom handler, event is not exposed at present
@param zoomHandler runnable zoom handler | [
"Add",
"zoom",
"handler",
"event",
"is",
"not",
"exposed",
"at",
"present"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/GoogleV3MapWidget.java#L215-L218 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JProduct.java | JProduct.sameProduct | public boolean sameProduct(JProduct p, Map<String, String> featLinks, boolean exactContent) {
List<JCell> tempCells = new ArrayList<>(this.cells);
if(p.getCells().size() != this.cells.size()){
return false;
}
for(JCell pC : p.getCells()){
for(JCell thisC: this.cells){
if(tempCells.contains(thisC)){
... | java | public boolean sameProduct(JProduct p, Map<String, String> featLinks, boolean exactContent) {
List<JCell> tempCells = new ArrayList<>(this.cells);
if(p.getCells().size() != this.cells.size()){
return false;
}
for(JCell pC : p.getCells()){
for(JCell thisC: this.cells){
if(tempCells.contains(thisC)){
... | [
"public",
"boolean",
"sameProduct",
"(",
"JProduct",
"p",
",",
"Map",
"<",
"String",
",",
"String",
">",
"featLinks",
",",
"boolean",
"exactContent",
")",
"{",
"List",
"<",
"JCell",
">",
"tempCells",
"=",
"new",
"ArrayList",
"<>",
"(",
"this",
".",
"cell... | Compares cells of both products omitting ids
@param p the product to compare
@param featLinks the links between the features of the 2 JSONFormat objects
@param exactContent
@return true if cells of both products are the same, omits ids | [
"Compares",
"cells",
"of",
"both",
"products",
"omitting",
"ids"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JProduct.java#L34-L52 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/AnnotationUtil.java | AnnotationUtil.getAnnotation | public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) {
return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
} | java | public static Annotation getAnnotation(Annotation[] annotations, Class<?> annotationClass) {
return Arrays.stream(annotations).filter(annotation -> annotation.annotationType().equals(annotationClass)).findFirst().orElse(null);
} | [
"public",
"static",
"Annotation",
"getAnnotation",
"(",
"Annotation",
"[",
"]",
"annotations",
",",
"Class",
"<",
"?",
">",
"annotationClass",
")",
"{",
"return",
"Arrays",
".",
"stream",
"(",
"annotations",
")",
".",
"filter",
"(",
"annotation",
"->",
"anno... | Gets annotation.
@param annotations the annotations
@param annotationClass the annotation class
@return the annotation | [
"Gets",
"annotation",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/AnnotationUtil.java#L18-L20 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/store/ValidationStore.java | ValidationStore.getValidationDatas | public List<ValidationData> getValidationDatas(ParamType paramType, String key) {
if (this.urlMap == null || this.validationDataRuleListMap == null) {
log.info("url map is empty :: " + key );
return null;
}
if (key == null || paramType == null) {
throw new Va... | java | public List<ValidationData> getValidationDatas(ParamType paramType, String key) {
if (this.urlMap == null || this.validationDataRuleListMap == null) {
log.info("url map is empty :: " + key );
return null;
}
if (key == null || paramType == null) {
throw new Va... | [
"public",
"List",
"<",
"ValidationData",
">",
"getValidationDatas",
"(",
"ParamType",
"paramType",
",",
"String",
"key",
")",
"{",
"if",
"(",
"this",
".",
"urlMap",
"==",
"null",
"||",
"this",
".",
"validationDataRuleListMap",
"==",
"null",
")",
"{",
"log",
... | Gets validation datas.
@param paramType the param type
@param key the key
@return the validation datas | [
"Gets",
"validation",
"datas",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/store/ValidationStore.java#L83-L100 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/component/validationRule/rule/AssistType.java | AssistType.all | public static AssistType all() {
AssistType assistType = new AssistType();
assistType.nullable = true;
assistType.string = true;
assistType.number = true;
assistType.enumType = true;
assistType.list = true;
assistType.obj = true;
return assistType;
} | java | public static AssistType all() {
AssistType assistType = new AssistType();
assistType.nullable = true;
assistType.string = true;
assistType.number = true;
assistType.enumType = true;
assistType.list = true;
assistType.obj = true;
return assistType;
} | [
"public",
"static",
"AssistType",
"all",
"(",
")",
"{",
"AssistType",
"assistType",
"=",
"new",
"AssistType",
"(",
")",
";",
"assistType",
".",
"nullable",
"=",
"true",
";",
"assistType",
".",
"string",
"=",
"true",
";",
"assistType",
".",
"number",
"=",
... | All assist type.
@return the assist type | [
"All",
"assist",
"type",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/component/validationRule/rule/AssistType.java#L24-L33 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/component/DetailParam.java | DetailParam.getReqUrls | public List<ReqUrl> getReqUrls() {
String url = this.getClassMappingUrl(this.getParentClass());
RequestAnnotation requestAnnotation = new RequestAnnotation(this.getParentMethod());
url += this.getRequestMappingUrl(requestAnnotation.getValue());
List<ReqUrl> list = new ArrayList<>();
... | java | public List<ReqUrl> getReqUrls() {
String url = this.getClassMappingUrl(this.getParentClass());
RequestAnnotation requestAnnotation = new RequestAnnotation(this.getParentMethod());
url += this.getRequestMappingUrl(requestAnnotation.getValue());
List<ReqUrl> list = new ArrayList<>();
... | [
"public",
"List",
"<",
"ReqUrl",
">",
"getReqUrls",
"(",
")",
"{",
"String",
"url",
"=",
"this",
".",
"getClassMappingUrl",
"(",
"this",
".",
"getParentClass",
"(",
")",
")",
";",
"RequestAnnotation",
"requestAnnotation",
"=",
"new",
"RequestAnnotation",
"(",
... | Gets req urls.
@return the req urls | [
"Gets",
"req",
"urls",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/component/DetailParam.java#L78-L91 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JSONFormat.java | JSONFormat.sameJSONFormat | public boolean sameJSONFormat(JSONFormat jf){
Map<String,String> featLinks = new HashMap<>();
if(!this.name.equals(jf.name) || !this.creator.equals(jf.creator) || !this.license.equals(jf.license) || !this.source.equals(jf.source)){
return false;
}else if(!this.sameFeatures(jf, featLinks)){
System.out.print... | java | public boolean sameJSONFormat(JSONFormat jf){
Map<String,String> featLinks = new HashMap<>();
if(!this.name.equals(jf.name) || !this.creator.equals(jf.creator) || !this.license.equals(jf.license) || !this.source.equals(jf.source)){
return false;
}else if(!this.sameFeatures(jf, featLinks)){
System.out.print... | [
"public",
"boolean",
"sameJSONFormat",
"(",
"JSONFormat",
"jf",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"featLinks",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"name",
".",
"equals",
"(",
"jf",
".",
"name",
... | Checks if the JSONFormat in parameter is the same as this, omitting ids and jcell.jvalue.value content
@param jf the format to compare
@return true if this and jf are the same, omits ids | [
"Checks",
"if",
"the",
"JSONFormat",
"in",
"parameter",
"is",
"the",
"same",
"as",
"this",
"omitting",
"ids",
"and",
"jcell",
".",
"jvalue",
".",
"value",
"content"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/JSONformating/model/JSONFormat.java#L395-L407 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java | DefaultLocalJSONDataProvider.validateFacetFields | private void validateFacetFields(String[] facetFieldList) {
if(facetFieldList == null || facetFieldList.length == 0){
return;
}
for (String facetfield : facetFieldList){
if(schema.getColumnIndex(facetfield) < 0){
throw new IllegalArgumentException("Facet f... | java | private void validateFacetFields(String[] facetFieldList) {
if(facetFieldList == null || facetFieldList.length == 0){
return;
}
for (String facetfield : facetFieldList){
if(schema.getColumnIndex(facetfield) < 0){
throw new IllegalArgumentException("Facet f... | [
"private",
"void",
"validateFacetFields",
"(",
"String",
"[",
"]",
"facetFieldList",
")",
"{",
"if",
"(",
"facetFieldList",
"==",
"null",
"||",
"facetFieldList",
".",
"length",
"==",
"0",
")",
"{",
"return",
";",
"}",
"for",
"(",
"String",
"facetfield",
":... | Check each facet field is present in schema.
@param facetFieldList an array of facet fields | [
"Check",
"each",
"facet",
"field",
"is",
"present",
"in",
"schema",
"."
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java#L136-L146 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java | DefaultLocalJSONDataProvider.calculateFacetList | private FacetList calculateFacetList(AbstractDataTable table, String[] facetFields) {
if(facetFields == null || facetFields.length == 0){
throw new NullPointerException("Facet field list empty");
}
FacetList facetList = new FacetList();
for (String facetField : facetFields) ... | java | private FacetList calculateFacetList(AbstractDataTable table, String[] facetFields) {
if(facetFields == null || facetFields.length == 0){
throw new NullPointerException("Facet field list empty");
}
FacetList facetList = new FacetList();
for (String facetField : facetFields) ... | [
"private",
"FacetList",
"calculateFacetList",
"(",
"AbstractDataTable",
"table",
",",
"String",
"[",
"]",
"facetFields",
")",
"{",
"if",
"(",
"facetFields",
"==",
"null",
"||",
"facetFields",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"NullPointerExce... | facet field -> list of facet field values
@param table gwt datatable as internal table data source
@param facetFields list of field to calculate facet values for | [
"facet",
"field",
"-",
">",
"list",
"of",
"facet",
"field",
"values"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java#L304-L314 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/SimpleClientFactory.java | SimpleClientFactory.getDataProvider | public DataProvider getDataProvider(){
if(this.dataProvider == null){
// EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getDataProvider", "begin");
// EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getSchema", "begin");
D... | java | public DataProvider getDataProvider(){
if(this.dataProvider == null){
// EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getDataProvider", "begin");
// EventLogger.logEvent("org.wwarn.surveyor.client.mvp.SimpleClientFactory", "getSchema", "begin");
D... | [
"public",
"DataProvider",
"getDataProvider",
"(",
")",
"{",
"if",
"(",
"this",
".",
"dataProvider",
"==",
"null",
")",
"{",
"// EventLogger.logEvent(\"org.wwarn.surveyor.client.mvp.SimpleClientFactory\", \"getDataProvider\", \"begin\");",
"// EventLogger.logEven... | Lazy initialise Dataprovider
@return DataProvider | [
"Lazy",
"initialise",
"Dataprovider"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/SimpleClientFactory.java#L99-L139 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/SimpleClientFactory.java | SimpleClientFactory.setConfigDynamically | @Override
public void setConfigDynamically(Config viewConfig) {
if(viewConfig instanceof MapViewConfig) {
MapViewConfig newMapViewConfig = (MapViewConfig) viewConfig;
updateMapViewConfig(newMapViewConfig);
}
} | java | @Override
public void setConfigDynamically(Config viewConfig) {
if(viewConfig instanceof MapViewConfig) {
MapViewConfig newMapViewConfig = (MapViewConfig) viewConfig;
updateMapViewConfig(newMapViewConfig);
}
} | [
"@",
"Override",
"public",
"void",
"setConfigDynamically",
"(",
"Config",
"viewConfig",
")",
"{",
"if",
"(",
"viewConfig",
"instanceof",
"MapViewConfig",
")",
"{",
"MapViewConfig",
"newMapViewConfig",
"=",
"(",
"MapViewConfig",
")",
"viewConfig",
";",
"updateMapView... | This method configures dynamically any config in the xml.
Right now, only overrides the coordinates of the map but it could be use to override any configuration
@param viewConfig | [
"This",
"method",
"configures",
"dynamically",
"any",
"config",
"in",
"the",
"xml",
".",
"Right",
"now",
"only",
"overrides",
"the",
"coordinates",
"of",
"the",
"map",
"but",
"it",
"could",
"be",
"use",
"to",
"override",
"any",
"configuration"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/SimpleClientFactory.java#L208-L215 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java | ValidationSessionComponent.sessionCheck | public void sessionCheck(HttpServletRequest req) {
String authHeader = req.getHeader("Authorization");
if (authHeader != null && this.validationSessionCheck(authHeader)) {
return;
}
if (req.getCookies() != null) {
Cookie cookie = Arrays.stream(req.getCookies()).f... | java | public void sessionCheck(HttpServletRequest req) {
String authHeader = req.getHeader("Authorization");
if (authHeader != null && this.validationSessionCheck(authHeader)) {
return;
}
if (req.getCookies() != null) {
Cookie cookie = Arrays.stream(req.getCookies()).f... | [
"public",
"void",
"sessionCheck",
"(",
"HttpServletRequest",
"req",
")",
"{",
"String",
"authHeader",
"=",
"req",
".",
"getHeader",
"(",
"\"Authorization\"",
")",
";",
"if",
"(",
"authHeader",
"!=",
"null",
"&&",
"this",
".",
"validationSessionCheck",
"(",
"au... | Session check.
@param req the req | [
"Session",
"check",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java#L53-L74 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java | ValidationSessionComponent.checkAuth | public ValidationSessionInfo checkAuth(ValidationLoginInfo info, HttpServletRequest req, HttpServletResponse res) {
if (info.getToken() == null || info.getToken().isEmpty()) {
throw new ValidationLibException("UnAuthorization", HttpStatus.UNAUTHORIZED);
}
if (this.validationConfig.g... | java | public ValidationSessionInfo checkAuth(ValidationLoginInfo info, HttpServletRequest req, HttpServletResponse res) {
if (info.getToken() == null || info.getToken().isEmpty()) {
throw new ValidationLibException("UnAuthorization", HttpStatus.UNAUTHORIZED);
}
if (this.validationConfig.g... | [
"public",
"ValidationSessionInfo",
"checkAuth",
"(",
"ValidationLoginInfo",
"info",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"if",
"(",
"info",
".",
"getToken",
"(",
")",
"==",
"null",
"||",
"info",
".",
"getToken",
"(",
"... | Check auth validation session info.
@param info the info
@param req the req
@param res the res
@return the validation session info | [
"Check",
"auth",
"validation",
"session",
"info",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java#L84-L103 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java | ValidationSessionComponent.createSession | public ValidationSessionInfo createSession(HttpServletRequest req, HttpServletResponse res) {
String key = this.getSessionKey();
ValidationSessionInfo sessionInfo = new ValidationSessionInfo(req, key);
this.sessionMap.put(key, sessionInfo);
res.addCookie(new Cookie("AuthToken", key));
... | java | public ValidationSessionInfo createSession(HttpServletRequest req, HttpServletResponse res) {
String key = this.getSessionKey();
ValidationSessionInfo sessionInfo = new ValidationSessionInfo(req, key);
this.sessionMap.put(key, sessionInfo);
res.addCookie(new Cookie("AuthToken", key));
... | [
"public",
"ValidationSessionInfo",
"createSession",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"{",
"String",
"key",
"=",
"this",
".",
"getSessionKey",
"(",
")",
";",
"ValidationSessionInfo",
"sessionInfo",
"=",
"new",
"ValidationSession... | Create session validation session info.
@param req the req
@param res the res
@return the validation session info | [
"Create",
"session",
"validation",
"session",
"info",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java#L122-L128 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java | ValidationSessionComponent.getSession | public Object getSession(HttpServletRequest req) {
if (req.getCookies() == null) {
return null;
}
Cookie cookie = Arrays.stream(req.getCookies()).filter(c -> c.getName().equalsIgnoreCase("ValidationSession")).findFirst().orElse(null);
if (cookie == null) {
retur... | java | public Object getSession(HttpServletRequest req) {
if (req.getCookies() == null) {
return null;
}
Cookie cookie = Arrays.stream(req.getCookies()).filter(c -> c.getName().equalsIgnoreCase("ValidationSession")).findFirst().orElse(null);
if (cookie == null) {
retur... | [
"public",
"Object",
"getSession",
"(",
"HttpServletRequest",
"req",
")",
"{",
"if",
"(",
"req",
".",
"getCookies",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Cookie",
"cookie",
"=",
"Arrays",
".",
"stream",
"(",
"req",
".",
"getCook... | Gets session.
@param req the req
@return the session | [
"Gets",
"session",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/setting/session/ValidationSessionComponent.java#L136-L147 | train |
lightblue-platform/lightblue-client | http/src/main/java/com/redhat/lightblue/client/http/transport/JavaNetHttpTransport.java | JavaNetHttpTransport.response | private String response(HttpURLConnection connection) throws LightblueHttpClientException {
try (InputStream responseStream = connection.getInputStream()) {
return readResponseStream(responseStream, connection);
} catch (IOException e) {
return readErrorStream(connection,e);
... | java | private String response(HttpURLConnection connection) throws LightblueHttpClientException {
try (InputStream responseStream = connection.getInputStream()) {
return readResponseStream(responseStream, connection);
} catch (IOException e) {
return readErrorStream(connection,e);
... | [
"private",
"String",
"response",
"(",
"HttpURLConnection",
"connection",
")",
"throws",
"LightblueHttpClientException",
"{",
"try",
"(",
"InputStream",
"responseStream",
"=",
"connection",
".",
"getInputStream",
"(",
")",
")",
"{",
"return",
"readResponseStream",
"(",... | Parses response, whether or not the request was successful, if possible.
Reads entire input stream and closes it so the socket knows it is
finished and may be put back into a pool for reuse. | [
"Parses",
"response",
"whether",
"or",
"not",
"the",
"request",
"was",
"successful",
"if",
"possible",
".",
"Reads",
"entire",
"input",
"stream",
"and",
"closes",
"it",
"so",
"the",
"socket",
"knows",
"it",
"is",
"finished",
"and",
"may",
"be",
"put",
"bac... | 03790aff34e90d3889f60fd6c603c21a21dc1a40 | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/http/src/main/java/com/redhat/lightblue/client/http/transport/JavaNetHttpTransport.java#L207-L213 | train |
lightblue-platform/lightblue-client | http/src/main/java/com/redhat/lightblue/client/http/transport/JavaNetHttpTransport.java | JavaNetHttpTransport.readResponseStream | private String readResponseStream(InputStream responseStream, HttpURLConnection connection)
throws IOException {
LOGGER.debug("Reading response stream");
InputStream decodedStream = responseStream;
if (compression == Compression.LZF && "lzf".equals(connection.getHeaderField("Content-... | java | private String readResponseStream(InputStream responseStream, HttpURLConnection connection)
throws IOException {
LOGGER.debug("Reading response stream");
InputStream decodedStream = responseStream;
if (compression == Compression.LZF && "lzf".equals(connection.getHeaderField("Content-... | [
"private",
"String",
"readResponseStream",
"(",
"InputStream",
"responseStream",
",",
"HttpURLConnection",
"connection",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Reading response stream\"",
")",
";",
"InputStream",
"decodedStream",
"=",
"respon... | Tries to efficiently allocate the response string if the "Content-Length"
header is set. | [
"Tries",
"to",
"efficiently",
"allocate",
"the",
"response",
"string",
"if",
"the",
"Content",
"-",
"Length",
"header",
"is",
"set",
"."
] | 03790aff34e90d3889f60fd6c603c21a21dc1a40 | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/http/src/main/java/com/redhat/lightblue/client/http/transport/JavaNetHttpTransport.java#L239-L255 | train |
needle4j/needle4j | src/main/java/org/needle4j/db/operation/AbstractDBOperation.java | AbstractDBOperation.openConnection | protected void openConnection() throws SQLException {
if (connection == null) {
try {
Class.forName(configuration.getJdbcDriver());
} catch (NullPointerException npe) {
throw new RuntimeException("error while lookup jdbc driver class. jdbc driver is not co... | java | protected void openConnection() throws SQLException {
if (connection == null) {
try {
Class.forName(configuration.getJdbcDriver());
} catch (NullPointerException npe) {
throw new RuntimeException("error while lookup jdbc driver class. jdbc driver is not co... | [
"protected",
"void",
"openConnection",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"connection",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"configuration",
".",
"getJdbcDriver",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Null... | Establish a connection to the given database.
@throws SQLException
if a database access error occurs | [
"Establish",
"a",
"connection",
"to",
"the",
"given",
"database",
"."
] | 55fbcdeed72be5cf26e4404b0fe40282792b51f2 | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L43-L57 | train |
needle4j/needle4j | src/main/java/org/needle4j/db/operation/AbstractDBOperation.java | AbstractDBOperation.closeConnection | protected void closeConnection() throws SQLException {
if (connection != null && !connection.isClosed()) {
connection.close();
connection = null;
}
} | java | protected void closeConnection() throws SQLException {
if (connection != null && !connection.isClosed()) {
connection.close();
connection = null;
}
} | [
"protected",
"void",
"closeConnection",
"(",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"connection",
"!=",
"null",
"&&",
"!",
"connection",
".",
"isClosed",
"(",
")",
")",
"{",
"connection",
".",
"close",
"(",
")",
";",
"connection",
"=",
"null",
";... | Close the connection to the database.
@throws SQLException
if a database access error occurs | [
"Close",
"the",
"connection",
"to",
"the",
"database",
"."
] | 55fbcdeed72be5cf26e4404b0fe40282792b51f2 | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L65-L71 | train |
needle4j/needle4j | src/main/java/org/needle4j/db/operation/AbstractDBOperation.java | AbstractDBOperation.executeScript | protected void executeScript(final String filename, final Statement statement) throws SQLException {
LOG.info("Executing sql script: " + filename);
InputStream fileInputStream;
try {
fileInputStream = ConfigurationLoader.loadResource(filename);
} catch (FileNotFoundException... | java | protected void executeScript(final String filename, final Statement statement) throws SQLException {
LOG.info("Executing sql script: " + filename);
InputStream fileInputStream;
try {
fileInputStream = ConfigurationLoader.loadResource(filename);
} catch (FileNotFoundException... | [
"protected",
"void",
"executeScript",
"(",
"final",
"String",
"filename",
",",
"final",
"Statement",
"statement",
")",
"throws",
"SQLException",
"{",
"LOG",
".",
"info",
"(",
"\"Executing sql script: \"",
"+",
"filename",
")",
";",
"InputStream",
"fileInputStream",
... | Execute the given sql script.
@param filename
the filename of the sql script
@param statement
the {@link Statement} to be used for executing a SQL
statement.
@throws SQLException
if a database access error occurs | [
"Execute",
"the",
"given",
"sql",
"script",
"."
] | 55fbcdeed72be5cf26e4404b0fe40282792b51f2 | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/db/operation/AbstractDBOperation.java#L183-L196 | train |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java | SerdesManagerImpl.register | @SuppressWarnings("unchecked")
public <T> HandlerRegistration register(Deserializer<T> deserializer) {
final HandlerRegistration reg = bindDeserializerToType(deserializer, deserializer.handledType());
if (deserializer instanceof HasImpl) {
Class[] impls = ((HasImpl) deserializer).implTy... | java | @SuppressWarnings("unchecked")
public <T> HandlerRegistration register(Deserializer<T> deserializer) {
final HandlerRegistration reg = bindDeserializerToType(deserializer, deserializer.handledType());
if (deserializer instanceof HasImpl) {
Class[] impls = ((HasImpl) deserializer).implTy... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"HandlerRegistration",
"register",
"(",
"Deserializer",
"<",
"T",
">",
"deserializer",
")",
"{",
"final",
"HandlerRegistration",
"reg",
"=",
"bindDeserializerToType",
"(",
"deserializer",
... | Register a deserializer of the given type.
@param deserializer The deserializer of T.
@param <T> The type of the object to be deserialized.
@return The {@link com.google.web.bindery.event.shared.HandlerRegistration} object,
capable of cancelling this HandlerRegistration to the {@link SerdesManagerImpl}. | [
"Register",
"a",
"deserializer",
"of",
"the",
"given",
"type",
"."
] | 40163a75cd17815d5089935d0dd97b8d652ad6d4 | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java#L57-L82 | train |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java | SerdesManagerImpl.register | @SuppressWarnings("unchecked")
public <T> HandlerRegistration register(Serializer<T> serializer) {
final HandlerRegistration reg = bindSerializerToType(serializer, serializer.handledType());
if (serializer instanceof HasImpl) {
Class[] impls = ((HasImpl) serializer).implTypes();
... | java | @SuppressWarnings("unchecked")
public <T> HandlerRegistration register(Serializer<T> serializer) {
final HandlerRegistration reg = bindSerializerToType(serializer, serializer.handledType());
if (serializer instanceof HasImpl) {
Class[] impls = ((HasImpl) serializer).implTypes();
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"HandlerRegistration",
"register",
"(",
"Serializer",
"<",
"T",
">",
"serializer",
")",
"{",
"final",
"HandlerRegistration",
"reg",
"=",
"bindSerializerToType",
"(",
"serializer",
",",
... | Register a serializer of the given type.
@param serializer The serializer of T.
@param <T> The type of the object to be serialized.
@return The {@link HandlerRegistration} object, capable of cancelling this HandlerRegistration
to the {@link SerdesManagerImpl}. | [
"Register",
"a",
"serializer",
"of",
"the",
"given",
"type",
"."
] | 40163a75cd17815d5089935d0dd97b8d652ad6d4 | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java#L93-L118 | train |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java | SerdesManagerImpl.getDeserializer | @SuppressWarnings("unchecked")
public <T> Deserializer<T> getDeserializer(Class<T> type, String mediaType) throws SerializationException {
checkNotNull(type, "Type (Class<T>) cannot be null.");
checkNotNull(mediaType, "Media-Type cannot be null.");
final String typeName = getClassName(type)... | java | @SuppressWarnings("unchecked")
public <T> Deserializer<T> getDeserializer(Class<T> type, String mediaType) throws SerializationException {
checkNotNull(type, "Type (Class<T>) cannot be null.");
checkNotNull(mediaType, "Media-Type cannot be null.");
final String typeName = getClassName(type)... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Deserializer",
"<",
"T",
">",
"getDeserializer",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"mediaType",
")",
"throws",
"SerializationException",
"{",
"checkNotNull",
"(",
... | Retrieve Deserializer from manager.
@param type The type class of the deserializer.
@param <T> The type of the deserializer.
@return The deserializer of the specified type.
@throws SerializationException if no deserializer was registered for the class. | [
"Retrieve",
"Deserializer",
"from",
"manager",
"."
] | 40163a75cd17815d5089935d0dd97b8d652ad6d4 | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java#L151-L179 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.