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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
threerings/nenya | core/src/main/java/com/threerings/media/util/LineSegmentPath.java | LineSegmentPath.createPath | protected void createPath (List<Point> points)
{
Point last = null;
int size = points.size();
for (int ii = 0; ii < size; ii++) {
Point p = points.get(ii);
int dir = (ii == 0) ? NORTH : DirectionUtil.getDirection(last, p);
addNode(p.x, p.y, dir);
... | java | protected void createPath (List<Point> points)
{
Point last = null;
int size = points.size();
for (int ii = 0; ii < size; ii++) {
Point p = points.get(ii);
int dir = (ii == 0) ? NORTH : DirectionUtil.getDirection(last, p);
addNode(p.x, p.y, dir);
... | [
"protected",
"void",
"createPath",
"(",
"List",
"<",
"Point",
">",
"points",
")",
"{",
"Point",
"last",
"=",
"null",
";",
"int",
"size",
"=",
"points",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"size",
";",
... | Populate the path with the path nodes that lead the pathable from its starting position to
the given destination coordinates following the given list of screen coordinates. | [
"Populate",
"the",
"path",
"with",
"the",
"path",
"nodes",
"that",
"lead",
"the",
"pathable",
"from",
"its",
"starting",
"position",
"to",
"the",
"given",
"destination",
"coordinates",
"following",
"the",
"given",
"list",
"of",
"screen",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/LineSegmentPath.java#L318-L329 | train |
threerings/nenya | core/src/main/java/com/threerings/util/BrowserUtil.java | BrowserUtil.browseURL | public static void browseURL (URL url, ResultListener<Void> listener, String genagent)
{
String[] cmd;
if (RunAnywhere.isWindows()) {
// TODO: test this on Vinders 98
// cmd = new String[] { "rundll32", "url.dll,FileProtocolHandler",
// url.toString() };
... | java | public static void browseURL (URL url, ResultListener<Void> listener, String genagent)
{
String[] cmd;
if (RunAnywhere.isWindows()) {
// TODO: test this on Vinders 98
// cmd = new String[] { "rundll32", "url.dll,FileProtocolHandler",
// url.toString() };
... | [
"public",
"static",
"void",
"browseURL",
"(",
"URL",
"url",
",",
"ResultListener",
"<",
"Void",
">",
"listener",
",",
"String",
"genagent",
")",
"{",
"String",
"[",
"]",
"cmd",
";",
"if",
"(",
"RunAnywhere",
".",
"isWindows",
"(",
")",
")",
"{",
"// TO... | Opens the user's web browser with the specified URL.
@param url the URL to display in an external browser.
@param listener a listener to be notified if we failed to launch the
browser. <em>Note:</em> it will not be notified of success.
@param genagent the path to the browser to execute on non-Windows,
non-MacOS. | [
"Opens",
"the",
"user",
"s",
"web",
"browser",
"with",
"the",
"specified",
"URL",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/util/BrowserUtil.java#L57-L94 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setPosition | public void setPosition (float x, float y, float z)
{
if (_px != x || _py != y || _pz != z) {
AL10.alSource3f(_id, AL10.AL_POSITION, _px = x, _py = y, _pz = z);
}
} | java | public void setPosition (float x, float y, float z)
{
if (_px != x || _py != y || _pz != z) {
AL10.alSource3f(_id, AL10.AL_POSITION, _px = x, _py = y, _pz = z);
}
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"_px",
"!=",
"x",
"||",
"_py",
"!=",
"y",
"||",
"_pz",
"!=",
"z",
")",
"{",
"AL10",
".",
"alSource3f",
"(",
"_id",
",",
"AL10",
".",
... | Sets the position of the source. | [
"Sets",
"the",
"position",
"of",
"the",
"source",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L59-L64 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setVelocity | public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alSource3f(_id, AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z);
}
} | java | public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alSource3f(_id, AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z);
}
} | [
"public",
"void",
"setVelocity",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"_vx",
"!=",
"x",
"||",
"_vy",
"!=",
"y",
"||",
"_vz",
"!=",
"z",
")",
"{",
"AL10",
".",
"alSource3f",
"(",
"_id",
",",
"AL10",
".",
... | Sets the velocity of the source. | [
"Sets",
"the",
"velocity",
"of",
"the",
"source",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L69-L74 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setGain | public void setGain (float gain)
{
if (_gain != gain) {
AL10.alSourcef(_id, AL10.AL_GAIN, _gain = gain);
}
} | java | public void setGain (float gain)
{
if (_gain != gain) {
AL10.alSourcef(_id, AL10.AL_GAIN, _gain = gain);
}
} | [
"public",
"void",
"setGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_gain",
"!=",
"gain",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_GAIN",
",",
"_gain",
"=",
"gain",
")",
";",
"}",
"}"
] | Sets the gain of the source. | [
"Sets",
"the",
"gain",
"of",
"the",
"source",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L79-L84 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setSourceRelative | public void setSourceRelative (boolean relative)
{
if (_sourceRelative != relative) {
_sourceRelative = relative;
AL10.alSourcei(_id, AL10.AL_SOURCE_RELATIVE, relative ? AL10.AL_TRUE : AL10.AL_FALSE);
}
} | java | public void setSourceRelative (boolean relative)
{
if (_sourceRelative != relative) {
_sourceRelative = relative;
AL10.alSourcei(_id, AL10.AL_SOURCE_RELATIVE, relative ? AL10.AL_TRUE : AL10.AL_FALSE);
}
} | [
"public",
"void",
"setSourceRelative",
"(",
"boolean",
"relative",
")",
"{",
"if",
"(",
"_sourceRelative",
"!=",
"relative",
")",
"{",
"_sourceRelative",
"=",
"relative",
";",
"AL10",
".",
"alSourcei",
"(",
"_id",
",",
"AL10",
".",
"AL_SOURCE_RELATIVE",
",",
... | Sets whether or not the position, velocity, etc., of the source are relative to the
listener. | [
"Sets",
"whether",
"or",
"not",
"the",
"position",
"velocity",
"etc",
".",
"of",
"the",
"source",
"are",
"relative",
"to",
"the",
"listener",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L90-L96 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setLooping | public void setLooping (boolean looping)
{
if (_looping != looping) {
_looping = looping;
AL10.alSourcei(_id, AL10.AL_LOOPING, looping ? AL10.AL_TRUE : AL10.AL_FALSE);
}
} | java | public void setLooping (boolean looping)
{
if (_looping != looping) {
_looping = looping;
AL10.alSourcei(_id, AL10.AL_LOOPING, looping ? AL10.AL_TRUE : AL10.AL_FALSE);
}
} | [
"public",
"void",
"setLooping",
"(",
"boolean",
"looping",
")",
"{",
"if",
"(",
"_looping",
"!=",
"looping",
")",
"{",
"_looping",
"=",
"looping",
";",
"AL10",
".",
"alSourcei",
"(",
"_id",
",",
"AL10",
".",
"AL_LOOPING",
",",
"looping",
"?",
"AL10",
"... | Sets whether or not the source is looping. | [
"Sets",
"whether",
"or",
"not",
"the",
"source",
"is",
"looping",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L101-L107 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setMinGain | public void setMinGain (float gain)
{
if (_minGain != gain) {
AL10.alSourcef(_id, AL10.AL_MIN_GAIN, _minGain = gain);
}
} | java | public void setMinGain (float gain)
{
if (_minGain != gain) {
AL10.alSourcef(_id, AL10.AL_MIN_GAIN, _minGain = gain);
}
} | [
"public",
"void",
"setMinGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_minGain",
"!=",
"gain",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_MIN_GAIN",
",",
"_minGain",
"=",
"gain",
")",
";",
"}",
"}"
] | Sets the minimum gain. | [
"Sets",
"the",
"minimum",
"gain",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L112-L117 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setMaxGain | public void setMaxGain (float gain)
{
if (_maxGain != gain) {
AL10.alSourcef(_id, AL10.AL_MAX_GAIN, _maxGain = gain);
}
} | java | public void setMaxGain (float gain)
{
if (_maxGain != gain) {
AL10.alSourcef(_id, AL10.AL_MAX_GAIN, _maxGain = gain);
}
} | [
"public",
"void",
"setMaxGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_maxGain",
"!=",
"gain",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_MAX_GAIN",
",",
"_maxGain",
"=",
"gain",
")",
";",
"}",
"}"
] | Sets the maximum gain. | [
"Sets",
"the",
"maximum",
"gain",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L122-L127 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setReferenceDistance | public void setReferenceDistance (float distance)
{
if (_referenceDistance != distance) {
AL10.alSourcef(_id, AL10.AL_REFERENCE_DISTANCE, _referenceDistance = distance);
}
} | java | public void setReferenceDistance (float distance)
{
if (_referenceDistance != distance) {
AL10.alSourcef(_id, AL10.AL_REFERENCE_DISTANCE, _referenceDistance = distance);
}
} | [
"public",
"void",
"setReferenceDistance",
"(",
"float",
"distance",
")",
"{",
"if",
"(",
"_referenceDistance",
"!=",
"distance",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_REFERENCE_DISTANCE",
",",
"_referenceDistance",
"=",
"distance"... | Sets the reference distance for attenuation. | [
"Sets",
"the",
"reference",
"distance",
"for",
"attenuation",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L132-L137 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setRolloffFactor | public void setRolloffFactor (float rolloff)
{
if (_rolloffFactor != rolloff) {
AL10.alSourcef(_id, AL10.AL_ROLLOFF_FACTOR, _rolloffFactor = rolloff);
}
} | java | public void setRolloffFactor (float rolloff)
{
if (_rolloffFactor != rolloff) {
AL10.alSourcef(_id, AL10.AL_ROLLOFF_FACTOR, _rolloffFactor = rolloff);
}
} | [
"public",
"void",
"setRolloffFactor",
"(",
"float",
"rolloff",
")",
"{",
"if",
"(",
"_rolloffFactor",
"!=",
"rolloff",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_ROLLOFF_FACTOR",
",",
"_rolloffFactor",
"=",
"rolloff",
")",
";",
"... | Sets the rolloff factor for attenuation. | [
"Sets",
"the",
"rolloff",
"factor",
"for",
"attenuation",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L142-L147 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setMaxDistance | public void setMaxDistance (float distance)
{
if (_maxDistance != distance) {
AL10.alSourcef(_id, AL10.AL_MAX_DISTANCE, _maxDistance = distance);
}
} | java | public void setMaxDistance (float distance)
{
if (_maxDistance != distance) {
AL10.alSourcef(_id, AL10.AL_MAX_DISTANCE, _maxDistance = distance);
}
} | [
"public",
"void",
"setMaxDistance",
"(",
"float",
"distance",
")",
"{",
"if",
"(",
"_maxDistance",
"!=",
"distance",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_MAX_DISTANCE",
",",
"_maxDistance",
"=",
"distance",
")",
";",
"}",
... | Sets the maximum distance for attenuation. | [
"Sets",
"the",
"maximum",
"distance",
"for",
"attenuation",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L152-L157 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setPitch | public void setPitch (float pitch)
{
if (_pitch != pitch) {
AL10.alSourcef(_id, AL10.AL_PITCH, _pitch = pitch);
}
} | java | public void setPitch (float pitch)
{
if (_pitch != pitch) {
AL10.alSourcef(_id, AL10.AL_PITCH, _pitch = pitch);
}
} | [
"public",
"void",
"setPitch",
"(",
"float",
"pitch",
")",
"{",
"if",
"(",
"_pitch",
"!=",
"pitch",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_PITCH",
",",
"_pitch",
"=",
"pitch",
")",
";",
"}",
"}"
] | Sets the pitch multiplier. | [
"Sets",
"the",
"pitch",
"multiplier",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L162-L167 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setDirection | public void setDirection (float x, float y, float z)
{
if (_dx != x || _dy != y || _dz != z) {
AL10.alSource3f(_id, AL10.AL_DIRECTION, _dx = x, _dy = y, _dz = z);
}
} | java | public void setDirection (float x, float y, float z)
{
if (_dx != x || _dy != y || _dz != z) {
AL10.alSource3f(_id, AL10.AL_DIRECTION, _dx = x, _dy = y, _dz = z);
}
} | [
"public",
"void",
"setDirection",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"_dx",
"!=",
"x",
"||",
"_dy",
"!=",
"y",
"||",
"_dz",
"!=",
"z",
")",
"{",
"AL10",
".",
"alSource3f",
"(",
"_id",
",",
"AL10",
".",... | Sets the direction of the source. | [
"Sets",
"the",
"direction",
"of",
"the",
"source",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L172-L177 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setConeInnerAngle | public void setConeInnerAngle (float angle)
{
if (_coneInnerAngle != angle) {
AL10.alSourcef(_id, AL10.AL_CONE_INNER_ANGLE, _coneInnerAngle = angle);
}
} | java | public void setConeInnerAngle (float angle)
{
if (_coneInnerAngle != angle) {
AL10.alSourcef(_id, AL10.AL_CONE_INNER_ANGLE, _coneInnerAngle = angle);
}
} | [
"public",
"void",
"setConeInnerAngle",
"(",
"float",
"angle",
")",
"{",
"if",
"(",
"_coneInnerAngle",
"!=",
"angle",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_CONE_INNER_ANGLE",
",",
"_coneInnerAngle",
"=",
"angle",
")",
";",
"}... | Sets the inside angle of the sound cone. | [
"Sets",
"the",
"inside",
"angle",
"of",
"the",
"sound",
"cone",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L182-L187 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setConeOuterAngle | public void setConeOuterAngle (float angle)
{
if (_coneOuterAngle != angle) {
AL10.alSourcef(_id, AL10.AL_CONE_OUTER_ANGLE, _coneOuterAngle = angle);
}
} | java | public void setConeOuterAngle (float angle)
{
if (_coneOuterAngle != angle) {
AL10.alSourcef(_id, AL10.AL_CONE_OUTER_ANGLE, _coneOuterAngle = angle);
}
} | [
"public",
"void",
"setConeOuterAngle",
"(",
"float",
"angle",
")",
"{",
"if",
"(",
"_coneOuterAngle",
"!=",
"angle",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_CONE_OUTER_ANGLE",
",",
"_coneOuterAngle",
"=",
"angle",
")",
";",
"}... | Sets the outside angle of the sound cone. | [
"Sets",
"the",
"outside",
"angle",
"of",
"the",
"sound",
"cone",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L192-L197 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setConeOuterGain | public void setConeOuterGain (float gain)
{
if (_coneOuterGain != gain) {
AL10.alSourcef(_id, AL10.AL_CONE_OUTER_GAIN, _coneOuterGain = gain);
}
} | java | public void setConeOuterGain (float gain)
{
if (_coneOuterGain != gain) {
AL10.alSourcef(_id, AL10.AL_CONE_OUTER_GAIN, _coneOuterGain = gain);
}
} | [
"public",
"void",
"setConeOuterGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_coneOuterGain",
"!=",
"gain",
")",
"{",
"AL10",
".",
"alSourcef",
"(",
"_id",
",",
"AL10",
".",
"AL_CONE_OUTER_GAIN",
",",
"_coneOuterGain",
"=",
"gain",
")",
";",
"}",
"}... | Sets the gain outside of the sound cone. | [
"Sets",
"the",
"gain",
"outside",
"of",
"the",
"sound",
"cone",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L202-L207 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.setBuffer | public void setBuffer (Buffer buffer)
{
_queue.clear();
if (buffer != null) {
_queue.add(buffer);
}
AL10.alSourcei(_id, AL10.AL_BUFFER, buffer == null ? AL10.AL_NONE : buffer.getId());
} | java | public void setBuffer (Buffer buffer)
{
_queue.clear();
if (buffer != null) {
_queue.add(buffer);
}
AL10.alSourcei(_id, AL10.AL_BUFFER, buffer == null ? AL10.AL_NONE : buffer.getId());
} | [
"public",
"void",
"setBuffer",
"(",
"Buffer",
"buffer",
")",
"{",
"_queue",
".",
"clear",
"(",
")",
";",
"if",
"(",
"buffer",
"!=",
"null",
")",
"{",
"_queue",
".",
"add",
"(",
"buffer",
")",
";",
"}",
"AL10",
".",
"alSourcei",
"(",
"_id",
",",
"... | Sets the source buffer. Equivalent to unqueueing all buffers, then queuing the provided
buffer. Cannot be called when the source is playing or paused.
@param buffer the buffer to set, or <code>null</code> to clear. | [
"Sets",
"the",
"source",
"buffer",
".",
"Equivalent",
"to",
"unqueueing",
"all",
"buffers",
"then",
"queuing",
"the",
"provided",
"buffer",
".",
"Cannot",
"be",
"called",
"when",
"the",
"source",
"is",
"playing",
"or",
"paused",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L215-L222 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.queueBuffers | public void queueBuffers (Buffer... buffers)
{
IntBuffer idbuf = BufferUtils.createIntBuffer(buffers.length);
for (int ii = 0; ii < buffers.length; ii++) {
Buffer buffer = buffers[ii];
_queue.add(buffer);
idbuf.put(ii, buffer.getId());
}
AL10.alSou... | java | public void queueBuffers (Buffer... buffers)
{
IntBuffer idbuf = BufferUtils.createIntBuffer(buffers.length);
for (int ii = 0; ii < buffers.length; ii++) {
Buffer buffer = buffers[ii];
_queue.add(buffer);
idbuf.put(ii, buffer.getId());
}
AL10.alSou... | [
"public",
"void",
"queueBuffers",
"(",
"Buffer",
"...",
"buffers",
")",
"{",
"IntBuffer",
"idbuf",
"=",
"BufferUtils",
".",
"createIntBuffer",
"(",
"buffers",
".",
"length",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"buffers",
".",
"... | Enqueues the specified buffers. | [
"Enqueues",
"the",
"specified",
"buffers",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L227-L236 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.unqueueBuffers | public void unqueueBuffers (Buffer... buffers)
{
IntBuffer idbuf = BufferUtils.createIntBuffer(buffers.length);
for (int ii = 0; ii < buffers.length; ii++) {
Buffer buffer = buffers[ii];
_queue.remove(buffer);
idbuf.put(ii, buffer.getId());
}
AL10.... | java | public void unqueueBuffers (Buffer... buffers)
{
IntBuffer idbuf = BufferUtils.createIntBuffer(buffers.length);
for (int ii = 0; ii < buffers.length; ii++) {
Buffer buffer = buffers[ii];
_queue.remove(buffer);
idbuf.put(ii, buffer.getId());
}
AL10.... | [
"public",
"void",
"unqueueBuffers",
"(",
"Buffer",
"...",
"buffers",
")",
"{",
"IntBuffer",
"idbuf",
"=",
"BufferUtils",
".",
"createIntBuffer",
"(",
"buffers",
".",
"length",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"buffers",
".",
... | Removes the specified buffers from the queue. | [
"Removes",
"the",
"specified",
"buffers",
"from",
"the",
"queue",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L241-L250 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Source.java | Source.delete | public void delete ()
{
IntBuffer idbuf = BufferUtils.createIntBuffer(1);
idbuf.put(_id).rewind();
AL10.alDeleteSources(idbuf);
_id = 0;
_queue.clear();
} | java | public void delete ()
{
IntBuffer idbuf = BufferUtils.createIntBuffer(1);
idbuf.put(_id).rewind();
AL10.alDeleteSources(idbuf);
_id = 0;
_queue.clear();
} | [
"public",
"void",
"delete",
"(",
")",
"{",
"IntBuffer",
"idbuf",
"=",
"BufferUtils",
".",
"createIntBuffer",
"(",
"1",
")",
";",
"idbuf",
".",
"put",
"(",
"_id",
")",
".",
"rewind",
"(",
")",
";",
"AL10",
".",
"alDeleteSources",
"(",
"idbuf",
")",
";... | Deletes this source, rendering it unusable. | [
"Deletes",
"this",
"source",
"rendering",
"it",
"unusable",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Source.java#L352-L359 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileManager.java | TileManager.loadTileSet | public UniformTileSet loadTileSet (String imgPath, int width, int height)
{
return loadCachedTileSet("", imgPath, width, height);
} | java | public UniformTileSet loadTileSet (String imgPath, int width, int height)
{
return loadCachedTileSet("", imgPath, width, height);
} | [
"public",
"UniformTileSet",
"loadTileSet",
"(",
"String",
"imgPath",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"loadCachedTileSet",
"(",
"\"\"",
",",
"imgPath",
",",
"width",
",",
"height",
")",
";",
"}"
] | Loads up a tileset from the specified image with the specified metadata parameters. | [
"Loads",
"up",
"a",
"tileset",
"from",
"the",
"specified",
"image",
"with",
"the",
"specified",
"metadata",
"parameters",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileManager.java#L64-L67 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileManager.java | TileManager.getTileSet | public TileSet getTileSet (String name)
throws NoSuchTileSetException
{
// make sure we have a repository configured
if (_setrep == null) {
throw new NoSuchTileSetException(name);
}
try {
return _setrep.getTileSet(name);
} catch (PersistenceEx... | java | public TileSet getTileSet (String name)
throws NoSuchTileSetException
{
// make sure we have a repository configured
if (_setrep == null) {
throw new NoSuchTileSetException(name);
}
try {
return _setrep.getTileSet(name);
} catch (PersistenceEx... | [
"public",
"TileSet",
"getTileSet",
"(",
"String",
"name",
")",
"throws",
"NoSuchTileSetException",
"{",
"// make sure we have a repository configured",
"if",
"(",
"_setrep",
"==",
"null",
")",
"{",
"throw",
"new",
"NoSuchTileSetException",
"(",
"name",
")",
";",
"}"... | Returns the tileset with the specified name.
@throws NoSuchTileSetException if no tileset with the specified name is available via our
configured tile set repository. | [
"Returns",
"the",
"tileset",
"with",
"the",
"specified",
"name",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileManager.java#L172-L186 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.getProperties | public Map<String, Object> getProperties() {
// Shallow copy entries to a newly instantiated HashMap.
Map<String, Object> clone = new HashMap<String, Object>();
Set<Entry<String, Object>> set = _properties.entrySet();
for (Entry<String, Object> entry : set) {
// Ther... | java | public Map<String, Object> getProperties() {
// Shallow copy entries to a newly instantiated HashMap.
Map<String, Object> clone = new HashMap<String, Object>();
Set<Entry<String, Object>> set = _properties.entrySet();
for (Entry<String, Object> entry : set) {
// Ther... | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getProperties",
"(",
")",
"{",
"// Shallow copy entries to a newly instantiated HashMap.",
"Map",
"<",
"String",
",",
"Object",
">",
"clone",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")... | Returns a clone of the properties HashMap by shallow copying the values.
@return HashMap with the name-value pairs | [
"Returns",
"a",
"clone",
"of",
"the",
"properties",
"HashMap",
"by",
"shallow",
"copying",
"the",
"values",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L267-L278 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setAppId | public void setAppId(String appId) {
if (appId == null) {
_properties.remove(AMQP_PROP_APP_ID);
return;
}
_properties.put(AMQP_PROP_APP_ID, appId);
} | java | public void setAppId(String appId) {
if (appId == null) {
_properties.remove(AMQP_PROP_APP_ID);
return;
}
_properties.put(AMQP_PROP_APP_ID, appId);
} | [
"public",
"void",
"setAppId",
"(",
"String",
"appId",
")",
"{",
"if",
"(",
"appId",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_APP_ID",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_APP_ID",
",",
"app... | Sets the value of "appId" property. If a null value is passed in, it
indicates that the property is not set.
@param appId value of "appId" property | [
"Sets",
"the",
"value",
"of",
"appId",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L326-L332 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setContentType | public void setContentType(String contentType) {
if (contentType == null) {
_properties.remove(AMQP_PROP_CONTENT_TYPE);
return;
}
_properties.put(AMQP_PROP_CONTENT_TYPE, contentType);
} | java | public void setContentType(String contentType) {
if (contentType == null) {
_properties.remove(AMQP_PROP_CONTENT_TYPE);
return;
}
_properties.put(AMQP_PROP_CONTENT_TYPE, contentType);
} | [
"public",
"void",
"setContentType",
"(",
"String",
"contentType",
")",
"{",
"if",
"(",
"contentType",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_CONTENT_TYPE",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PRO... | Sets the value of "contentType" property. If a null value is passed in, it
indicates that the property is not set.
@param contentType value of "contentType" property | [
"Sets",
"the",
"value",
"of",
"contentType",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L340-L347 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setContentEncoding | public void setContentEncoding(String encoding) {
if (encoding == null) {
_properties.remove(AMQP_PROP_CONTENT_ENCODING);
return;
}
_properties.put(AMQP_PROP_CONTENT_ENCODING, encoding);
} | java | public void setContentEncoding(String encoding) {
if (encoding == null) {
_properties.remove(AMQP_PROP_CONTENT_ENCODING);
return;
}
_properties.put(AMQP_PROP_CONTENT_ENCODING, encoding);
} | [
"public",
"void",
"setContentEncoding",
"(",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_CONTENT_ENCODING",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_P... | Sets the value of "contentEncoding" property. If a null value is passed
in, it indicates that the property is not set.
@param encoding value of "contentEncoding" property | [
"Sets",
"the",
"value",
"of",
"contentEncoding",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L355-L362 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setCorrelationId | public void setCorrelationId(String correlationId) {
if (correlationId == null) {
_properties.remove(AMQP_PROP_CORRELATION_ID);
return;
}
_properties.put(AMQP_PROP_CORRELATION_ID, correlationId);
} | java | public void setCorrelationId(String correlationId) {
if (correlationId == null) {
_properties.remove(AMQP_PROP_CORRELATION_ID);
return;
}
_properties.put(AMQP_PROP_CORRELATION_ID, correlationId);
} | [
"public",
"void",
"setCorrelationId",
"(",
"String",
"correlationId",
")",
"{",
"if",
"(",
"correlationId",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_CORRELATION_ID",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"... | Sets the value of "correlationId" property. If a null value is passed
in, it indicates that the property is not set.
@param correlationId value of "correlationId" property | [
"Sets",
"the",
"value",
"of",
"correlationId",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L370-L377 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setDeliveryMode | public void setDeliveryMode(Integer deliveryMode) {
if (deliveryMode == null) {
_properties.remove(AMQP_PROP_DELIVERY_MODE);
return;
}
// Perhaps, we could do an enum for deliveryMode. But, it will require
// some major changes in encoding and decoding an... | java | public void setDeliveryMode(Integer deliveryMode) {
if (deliveryMode == null) {
_properties.remove(AMQP_PROP_DELIVERY_MODE);
return;
}
// Perhaps, we could do an enum for deliveryMode. But, it will require
// some major changes in encoding and decoding an... | [
"public",
"void",
"setDeliveryMode",
"(",
"Integer",
"deliveryMode",
")",
"{",
"if",
"(",
"deliveryMode",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_DELIVERY_MODE",
")",
";",
"return",
";",
"}",
"// Perhaps, we could do an enum for deliver... | Sets the value of "deliveryMode" property. If a null value is passed
in, it indicates that the property is not set.
@param deliveryMode value of "deliveryMode" property | [
"Sets",
"the",
"value",
"of",
"deliveryMode",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L385-L402 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setExpiration | public void setExpiration(String expiration) {
if (expiration == null) {
_properties.remove(AMQP_PROP_EXPIRATION);
return;
}
_properties.put(AMQP_PROP_EXPIRATION, expiration);
} | java | public void setExpiration(String expiration) {
if (expiration == null) {
_properties.remove(AMQP_PROP_EXPIRATION);
return;
}
_properties.put(AMQP_PROP_EXPIRATION, expiration);
} | [
"public",
"void",
"setExpiration",
"(",
"String",
"expiration",
")",
"{",
"if",
"(",
"expiration",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_EXPIRATION",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_EXP... | Sets the value of "expiration" property. If a null value is passed
in, it indicates that the property is not set.
@param expiration value of "expiration" property | [
"Sets",
"the",
"value",
"of",
"expiration",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L410-L417 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setHeaders | public void setHeaders(AmqpArguments headers) {
if (headers == null) {
_properties.remove(AMQP_PROP_HEADERS);
return;
}
_properties.put(AMQP_PROP_HEADERS, headers);
} | java | public void setHeaders(AmqpArguments headers) {
if (headers == null) {
_properties.remove(AMQP_PROP_HEADERS);
return;
}
_properties.put(AMQP_PROP_HEADERS, headers);
} | [
"public",
"void",
"setHeaders",
"(",
"AmqpArguments",
"headers",
")",
"{",
"if",
"(",
"headers",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_HEADERS",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_HEADERS"... | Sets the value of "headers" property. If a null value is passed
in, it indicates that the property is not set.
@param headers value of "headers" property | [
"Sets",
"the",
"value",
"of",
"headers",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L425-L432 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setMessageId | public void setMessageId(String messageId) {
if (messageId == null) {
_properties.remove(AMQP_PROP_MESSAGE_ID);
return;
}
_properties.put(AMQP_PROP_MESSAGE_ID, messageId);
} | java | public void setMessageId(String messageId) {
if (messageId == null) {
_properties.remove(AMQP_PROP_MESSAGE_ID);
return;
}
_properties.put(AMQP_PROP_MESSAGE_ID, messageId);
} | [
"public",
"void",
"setMessageId",
"(",
"String",
"messageId",
")",
"{",
"if",
"(",
"messageId",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_MESSAGE_ID",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_MESSAG... | Sets the value of "messageId" property. If a null value is passed
in, it indicates that the property is not set.
@param messageId value of "messageId" property | [
"Sets",
"the",
"value",
"of",
"messageId",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L440-L447 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setPriority | public void setPriority(Integer priority) {
if (priority == null) {
_properties.remove(AMQP_PROP_PRIORITY);
return;
}
int priorityValue = priority.intValue();
if ((priorityValue < 0) || (priorityValue > 9)) {
String s = "AMQP 0-9-1 spe... | java | public void setPriority(Integer priority) {
if (priority == null) {
_properties.remove(AMQP_PROP_PRIORITY);
return;
}
int priorityValue = priority.intValue();
if ((priorityValue < 0) || (priorityValue > 9)) {
String s = "AMQP 0-9-1 spe... | [
"public",
"void",
"setPriority",
"(",
"Integer",
"priority",
")",
"{",
"if",
"(",
"priority",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_PRIORITY",
")",
";",
"return",
";",
"}",
"int",
"priorityValue",
"=",
"priority",
".",
"intV... | Sets the value of "priority" property. If a null value is passed
in, it indicates that the property is not set.
@param priority value of "priority" property | [
"Sets",
"the",
"value",
"of",
"priority",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L455-L468 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setReplyTo | public void setReplyTo(String replyTo) {
if (replyTo == null) {
_properties.remove(AMQP_PROP_REPLY_TO);
return;
}
_properties.put(AMQP_PROP_REPLY_TO, replyTo);
} | java | public void setReplyTo(String replyTo) {
if (replyTo == null) {
_properties.remove(AMQP_PROP_REPLY_TO);
return;
}
_properties.put(AMQP_PROP_REPLY_TO, replyTo);
} | [
"public",
"void",
"setReplyTo",
"(",
"String",
"replyTo",
")",
"{",
"if",
"(",
"replyTo",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_REPLY_TO",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_REPLY_TO",
"... | Sets the value of "replyTo" property. If a null value is passed
in, it indicates that the property is not set.
@param replyTo value of "replyTo" property | [
"Sets",
"the",
"value",
"of",
"replyTo",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L476-L483 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setTimestamp | public void setTimestamp(Timestamp timestamp) {
if (timestamp == null) {
_properties.remove(AMQP_PROP_TIMESTAMP);
return;
}
_properties.put(AMQP_PROP_TIMESTAMP, timestamp);
} | java | public void setTimestamp(Timestamp timestamp) {
if (timestamp == null) {
_properties.remove(AMQP_PROP_TIMESTAMP);
return;
}
_properties.put(AMQP_PROP_TIMESTAMP, timestamp);
} | [
"public",
"void",
"setTimestamp",
"(",
"Timestamp",
"timestamp",
")",
"{",
"if",
"(",
"timestamp",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_TIMESTAMP",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_TIME... | Sets the value of "timestamp" property. If a null value is passed
in, it indicates that the property is not set.
@param timestamp value of "timestamp" property | [
"Sets",
"the",
"value",
"of",
"timestamp",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L491-L498 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setType | public void setType(String type) {
if (type == null) {
_properties.remove(AMQP_PROP_TYPE);
return;
}
_properties.put(AMQP_PROP_TYPE, type);
} | java | public void setType(String type) {
if (type == null) {
_properties.remove(AMQP_PROP_TYPE);
return;
}
_properties.put(AMQP_PROP_TYPE, type);
} | [
"public",
"void",
"setType",
"(",
"String",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_TYPE",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_TYPE",
",",
"type",
"... | Sets the value of "type" property. If a null value is passed
in, it indicates that the property is not set.
@param type value of "type" property | [
"Sets",
"the",
"value",
"of",
"type",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L506-L513 | train |
kaazing/java.client | amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java | AmqpProperties.setUserId | public void setUserId(String userId) {
if (userId == null) {
_properties.remove(AMQP_PROP_USER_ID);
return;
}
_properties.put(AMQP_PROP_USER_ID, userId);
} | java | public void setUserId(String userId) {
if (userId == null) {
_properties.remove(AMQP_PROP_USER_ID);
return;
}
_properties.put(AMQP_PROP_USER_ID, userId);
} | [
"public",
"void",
"setUserId",
"(",
"String",
"userId",
")",
"{",
"if",
"(",
"userId",
"==",
"null",
")",
"{",
"_properties",
".",
"remove",
"(",
"AMQP_PROP_USER_ID",
")",
";",
"return",
";",
"}",
"_properties",
".",
"put",
"(",
"AMQP_PROP_USER_ID",
",",
... | Sets the value of "userId" property. If a null value is passed
in, it indicates that the property is not set.
@param userId value of "userId" property | [
"Sets",
"the",
"value",
"of",
"userId",
"property",
".",
"If",
"a",
"null",
"value",
"is",
"passed",
"in",
"it",
"indicates",
"that",
"the",
"property",
"is",
"not",
"set",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/amqp-0-9-1/amqp/src/main/java/org/kaazing/net/ws/amqp/AmqpProperties.java#L521-L528 | train |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java | TileSetBundler.createBundle | public boolean createBundle (
File target, TileSetBundle bundle, ImageProvider improv, String imageBase, long newestMod)
throws IOException
{
return createBundleJar(target, bundle, improv, imageBase, _keepRawPngs, _uncompressed);
} | java | public boolean createBundle (
File target, TileSetBundle bundle, ImageProvider improv, String imageBase, long newestMod)
throws IOException
{
return createBundleJar(target, bundle, improv, imageBase, _keepRawPngs, _uncompressed);
} | [
"public",
"boolean",
"createBundle",
"(",
"File",
"target",
",",
"TileSetBundle",
"bundle",
",",
"ImageProvider",
"improv",
",",
"String",
"imageBase",
",",
"long",
"newestMod",
")",
"throws",
"IOException",
"{",
"return",
"createBundleJar",
"(",
"target",
",",
... | Finish the creation of a tileset bundle jar file.
@param target the tileset bundle file that will be created.
@param bundle contains the tilesets we'd like to save out to the bundle.
@param improv the image provider.
@param imageBase the base directory for getting images for non
@param newestMod the most recent modifi... | [
"Finish",
"the",
"creation",
"of",
"a",
"tileset",
"bundle",
"jar",
"file",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/bundle/tools/TileSetBundler.java#L349-L354 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java | BundledTileSetRepository.initBundles | protected void initBundles (ResourceManager rmgr, String name)
{
// first we obtain the resource set from which we will load up our
// tileset bundles
ResourceBundle[] rbundles = rmgr.getResourceSet(name);
// sanity check
if (rbundles == null) {
log.warning("Unab... | java | protected void initBundles (ResourceManager rmgr, String name)
{
// first we obtain the resource set from which we will load up our
// tileset bundles
ResourceBundle[] rbundles = rmgr.getResourceSet(name);
// sanity check
if (rbundles == null) {
log.warning("Unab... | [
"protected",
"void",
"initBundles",
"(",
"ResourceManager",
"rmgr",
",",
"String",
"name",
")",
"{",
"// first we obtain the resource set from which we will load up our",
"// tileset bundles",
"ResourceBundle",
"[",
"]",
"rbundles",
"=",
"rmgr",
".",
"getResourceSet",
"(",
... | Initializes our bundles, | [
"Initializes",
"our",
"bundles"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java#L79-L108 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java | BundledTileSetRepository.addBundle | protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
ResourceBundle bundle)
{
try {
TileSetBundle tsb = BundleUtil.extractBundle(bundle);
// initialize it and add it to the list
tsb.init(bundle);
addBundle(idmap, namem... | java | protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
ResourceBundle bundle)
{
try {
TileSetBundle tsb = BundleUtil.extractBundle(bundle);
// initialize it and add it to the list
tsb.init(bundle);
addBundle(idmap, namem... | [
"protected",
"void",
"addBundle",
"(",
"HashIntMap",
"<",
"TileSet",
">",
"idmap",
",",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"namemap",
",",
"ResourceBundle",
"bundle",
")",
"{",
"try",
"{",
"TileSetBundle",
"tsb",
"=",
"BundleUtil",
".",
"extractB... | Extracts the tileset bundle from the supplied resource bundle
and registers it. | [
"Extracts",
"the",
"tileset",
"bundle",
"from",
"the",
"supplied",
"resource",
"bundle",
"and",
"registers",
"it",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java#L123-L136 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java | BundledTileSetRepository.addBundle | protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
TileSetBundle bundle)
{
IMImageProvider improv = (_imgr == null) ?
null : new IMImageProvider(_imgr, bundle);
// map all of the tilesets in this bundle
for (IntMa... | java | protected void addBundle (HashIntMap<TileSet> idmap, HashMap<String, Integer> namemap,
TileSetBundle bundle)
{
IMImageProvider improv = (_imgr == null) ?
null : new IMImageProvider(_imgr, bundle);
// map all of the tilesets in this bundle
for (IntMa... | [
"protected",
"void",
"addBundle",
"(",
"HashIntMap",
"<",
"TileSet",
">",
"idmap",
",",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"namemap",
",",
"TileSetBundle",
"bundle",
")",
"{",
"IMImageProvider",
"improv",
"=",
"(",
"_imgr",
"==",
"null",
")",
"... | Adds the tilesets in the supplied bundle to our tileset mapping
tables. Any tilesets with the same name or id will be overwritten. | [
"Adds",
"the",
"tilesets",
"in",
"the",
"supplied",
"bundle",
"to",
"our",
"tileset",
"mapping",
"tables",
".",
"Any",
"tilesets",
"with",
"the",
"same",
"name",
"or",
"id",
"will",
"be",
"overwritten",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/BundledTileSetRepository.java#L142-L156 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/ObjectActionHandler.java | ObjectActionHandler.createIndicator | public SceneObjectIndicator createIndicator (MisoScenePanel panel, String text, Icon icon)
{
return new SceneObjectTip(text, icon);
} | java | public SceneObjectIndicator createIndicator (MisoScenePanel panel, String text, Icon icon)
{
return new SceneObjectTip(text, icon);
} | [
"public",
"SceneObjectIndicator",
"createIndicator",
"(",
"MisoScenePanel",
"panel",
",",
"String",
"text",
",",
"Icon",
"icon",
")",
"{",
"return",
"new",
"SceneObjectTip",
"(",
"text",
",",
"icon",
")",
";",
"}"
] | Creates an indicator for this type of object action. | [
"Creates",
"an",
"indicator",
"for",
"this",
"type",
"of",
"object",
"action",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/ObjectActionHandler.java#L116-L119 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/ObjectActionHandler.java | ObjectActionHandler.register | public static void register (String prefix, ObjectActionHandler handler)
{
// make sure we know about potential funny business
if (_oahandlers.containsKey(prefix)) {
log.warning("Warning! Overwriting previous object action handler registration, all " +
"hell could... | java | public static void register (String prefix, ObjectActionHandler handler)
{
// make sure we know about potential funny business
if (_oahandlers.containsKey(prefix)) {
log.warning("Warning! Overwriting previous object action handler registration, all " +
"hell could... | [
"public",
"static",
"void",
"register",
"(",
"String",
"prefix",
",",
"ObjectActionHandler",
"handler",
")",
"{",
"// make sure we know about potential funny business",
"if",
"(",
"_oahandlers",
".",
"containsKey",
"(",
"prefix",
")",
")",
"{",
"log",
".",
"warning"... | Registers an object action handler which will be called when a user clicks on an object in
a scene that has an associated action. | [
"Registers",
"an",
"object",
"action",
"handler",
"which",
"will",
"be",
"called",
"when",
"a",
"user",
"clicks",
"on",
"an",
"object",
"in",
"a",
"scene",
"that",
"has",
"an",
"associated",
"action",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/ObjectActionHandler.java#L133-L141 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/MathUtil.java | MathUtil.bound | public static int bound (int low, int value, int high)
{
return Math.min(high, Math.max(low, value));
} | java | public static int bound (int low, int value, int high)
{
return Math.min(high, Math.max(low, value));
} | [
"public",
"static",
"int",
"bound",
"(",
"int",
"low",
",",
"int",
"value",
",",
"int",
"high",
")",
"{",
"return",
"Math",
".",
"min",
"(",
"high",
",",
"Math",
".",
"max",
"(",
"low",
",",
"value",
")",
")",
";",
"}"
] | Bounds the supplied value within the specified range.
@return low if {@code value < low}, high if {@code value > high} and value otherwise. | [
"Bounds",
"the",
"supplied",
"value",
"within",
"the",
"specified",
"range",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/MathUtil.java#L34-L37 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/MathUtil.java | MathUtil.distanceSq | public static int distanceSq (int x0, int y0, int x1, int y1)
{
return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0));
} | java | public static int distanceSq (int x0, int y0, int x1, int y1)
{
return ((x1 - x0) * (x1 - x0)) + ((y1 - y0) * (y1 - y0));
} | [
"public",
"static",
"int",
"distanceSq",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"return",
"(",
"(",
"x1",
"-",
"x0",
")",
"*",
"(",
"x1",
"-",
"x0",
")",
")",
"+",
"(",
"(",
"y1",
"-",
"y0",
")",
... | Return the squared distance between the given points. | [
"Return",
"the",
"squared",
"distance",
"between",
"the",
"given",
"points",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/MathUtil.java#L42-L45 | train |
threerings/nenya | core/src/main/java/com/threerings/media/util/MathUtil.java | MathUtil.stddev | public static float[] stddev (int[] values, int start, int length)
{
// first we need the mean
float mean = 0f;
for (int ii = start, end = start + length; ii < end; ii++) {
mean += values[ii];
}
mean /= length;
// next we compute the variance
floa... | java | public static float[] stddev (int[] values, int start, int length)
{
// first we need the mean
float mean = 0f;
for (int ii = start, end = start + length; ii < end; ii++) {
mean += values[ii];
}
mean /= length;
// next we compute the variance
floa... | [
"public",
"static",
"float",
"[",
"]",
"stddev",
"(",
"int",
"[",
"]",
"values",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"// first we need the mean",
"float",
"mean",
"=",
"0f",
";",
"for",
"(",
"int",
"ii",
"=",
"start",
",",
"end",
"="... | Computes the standard deviation of the supplied values.
@return an array of three values: the mean, variance and standard deviation, in that order. | [
"Computes",
"the",
"standard",
"deviation",
"of",
"the",
"supplied",
"values",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/util/MathUtil.java#L121-L140 | train |
HotelsDotCom/corc | corc-cascading/src/main/java/com/hotels/corc/cascading/OrcFile.java | OrcFile.validateNamesUnique | private void validateNamesUnique(List<String> names) {
List<String> seenNames = new ArrayList<>(names.size());
for (int i = 0; i < names.size(); i++) {
String lowerCaseName = names.get(i).toLowerCase();
int index = seenNames.indexOf(lowerCaseName);
if (index != -1) {
throw new IllegalA... | java | private void validateNamesUnique(List<String> names) {
List<String> seenNames = new ArrayList<>(names.size());
for (int i = 0; i < names.size(); i++) {
String lowerCaseName = names.get(i).toLowerCase();
int index = seenNames.indexOf(lowerCaseName);
if (index != -1) {
throw new IllegalA... | [
"private",
"void",
"validateNamesUnique",
"(",
"List",
"<",
"String",
">",
"names",
")",
"{",
"List",
"<",
"String",
">",
"seenNames",
"=",
"new",
"ArrayList",
"<>",
"(",
"names",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
"... | For full ORC compatibility, field names should be unique when lowercased. | [
"For",
"full",
"ORC",
"compatibility",
"field",
"names",
"should",
"be",
"unique",
"when",
"lowercased",
"."
] | 37ecb5966315e4cf630a878ffcbada61c50bdcd3 | https://github.com/HotelsDotCom/corc/blob/37ecb5966315e4cf630a878ffcbada61c50bdcd3/corc-cascading/src/main/java/com/hotels/corc/cascading/OrcFile.java#L128-L139 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/ObjectTile.java | ObjectTile.setSpot | public void setSpot (int x, int y, byte orient)
{
_spot = new Point(x, y);
_sorient = orient;
} | java | public void setSpot (int x, int y, byte orient)
{
_spot = new Point(x, y);
_sorient = orient;
} | [
"public",
"void",
"setSpot",
"(",
"int",
"x",
",",
"int",
"y",
",",
"byte",
"orient",
")",
"{",
"_spot",
"=",
"new",
"Point",
"(",
"x",
",",
"y",
")",
";",
"_sorient",
"=",
"orient",
";",
"}"
] | Configures the "spot" associated with this object. | [
"Configures",
"the",
"spot",
"associated",
"with",
"this",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/ObjectTile.java#L122-L126 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/ObjectTile.java | ObjectTile.hasConstraint | public boolean hasConstraint (String constraint)
{
return (_constraints == null) ? false :
ListUtil.contains(_constraints, constraint);
} | java | public boolean hasConstraint (String constraint)
{
return (_constraints == null) ? false :
ListUtil.contains(_constraints, constraint);
} | [
"public",
"boolean",
"hasConstraint",
"(",
"String",
"constraint",
")",
"{",
"return",
"(",
"_constraints",
"==",
"null",
")",
"?",
"false",
":",
"ListUtil",
".",
"contains",
"(",
"_constraints",
",",
"constraint",
")",
";",
"}"
] | Checks whether this object has the given constraint. | [
"Checks",
"whether",
"this",
"object",
"has",
"the",
"given",
"constraint",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/ObjectTile.java#L172-L176 | train |
jdillon/gshell | gshell-util/src/main/java/com/planet57/gshell/util/cli2/OptionDescriptor.java | OptionDescriptor.getSyntax | public String getSyntax() {
if (name != null && longName != null) {
return String.format("-%s (--%s)", name, longName);
}
else if (name != null) {
return String.format("-%s", name);
}
else if (longName != null) {
return String.format("--%s", longName);
}
throw new Error();
... | java | public String getSyntax() {
if (name != null && longName != null) {
return String.format("-%s (--%s)", name, longName);
}
else if (name != null) {
return String.format("-%s", name);
}
else if (longName != null) {
return String.format("--%s", longName);
}
throw new Error();
... | [
"public",
"String",
"getSyntax",
"(",
")",
"{",
"if",
"(",
"name",
"!=",
"null",
"&&",
"longName",
"!=",
"null",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"-%s (--%s)\"",
",",
"name",
",",
"longName",
")",
";",
"}",
"else",
"if",
"(",
"name... | Returns the option syntax, sans optional token if option takes an argument. | [
"Returns",
"the",
"option",
"syntax",
"sans",
"optional",
"token",
"if",
"option",
"takes",
"an",
"argument",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-util/src/main/java/com/planet57/gshell/util/cli2/OptionDescriptor.java#L109-L120 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.setLocalePrefix | public void setLocalePrefix (final String prefix)
{
setLocaleHandler(
new LocaleHandler() {
public String getLocalePath (String path) {
return PathUtil.appendPath(prefix, path);
}
});
} | java | public void setLocalePrefix (final String prefix)
{
setLocaleHandler(
new LocaleHandler() {
public String getLocalePath (String path) {
return PathUtil.appendPath(prefix, path);
}
});
} | [
"public",
"void",
"setLocalePrefix",
"(",
"final",
"String",
"prefix",
")",
"{",
"setLocaleHandler",
"(",
"new",
"LocaleHandler",
"(",
")",
"{",
"public",
"String",
"getLocalePath",
"(",
"String",
"path",
")",
"{",
"return",
"PathUtil",
".",
"appendPath",
"(",... | Configure a default LocaleHandler with the specified prefix. | [
"Configure",
"a",
"default",
"LocaleHandler",
"with",
"the",
"specified",
"prefix",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L258-L266 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.initBundles | public void initBundles (String resourceDir, String configPath, InitObserver initObs)
throws IOException
{
// reinitialize our resource dir if it was specified
if (resourceDir != null) {
initResourceDir(resourceDir);
}
// load up our configuration
Propert... | java | public void initBundles (String resourceDir, String configPath, InitObserver initObs)
throws IOException
{
// reinitialize our resource dir if it was specified
if (resourceDir != null) {
initResourceDir(resourceDir);
}
// load up our configuration
Propert... | [
"public",
"void",
"initBundles",
"(",
"String",
"resourceDir",
",",
"String",
"configPath",
",",
"InitObserver",
"initObs",
")",
"throws",
"IOException",
"{",
"// reinitialize our resource dir if it was specified",
"if",
"(",
"resourceDir",
"!=",
"null",
")",
"{",
"in... | Initializes the bundle sets to be made available by this resource manager. Applications
that wish to make use of resource bundles should call this method after constructing the
resource manager.
@param resourceDir the base directory to which the paths in the supplied configuration file
are relative. If this is null, ... | [
"Initializes",
"the",
"bundle",
"sets",
"to",
"be",
"made",
"available",
"by",
"this",
"resource",
"manager",
".",
"Applications",
"that",
"wish",
"to",
"make",
"use",
"of",
"resource",
"bundles",
"should",
"call",
"this",
"method",
"after",
"constructing",
"t... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L301-L366 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.checkBundle | public boolean checkBundle (String path)
{
File bfile = getResourceFile(path);
return (bfile == null) ? false : new FileResourceBundle(bfile, true, _unpack).isUnpacked();
} | java | public boolean checkBundle (String path)
{
File bfile = getResourceFile(path);
return (bfile == null) ? false : new FileResourceBundle(bfile, true, _unpack).isUnpacked();
} | [
"public",
"boolean",
"checkBundle",
"(",
"String",
"path",
")",
"{",
"File",
"bfile",
"=",
"getResourceFile",
"(",
"path",
")",
";",
"return",
"(",
"bfile",
"==",
"null",
")",
"?",
"false",
":",
"new",
"FileResourceBundle",
"(",
"bfile",
",",
"true",
","... | Checks to see if the specified bundle exists, is unpacked and is ready to be used. | [
"Checks",
"to",
"see",
"if",
"the",
"specified",
"bundle",
"exists",
"is",
"unpacked",
"and",
"is",
"ready",
"to",
"be",
"used",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L458-L462 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.getResource | public InputStream getResource (String path)
throws IOException
{
String localePath = getLocalePath(path);
InputStream in;
// first look for this resource in our default resource bundle
for (ResourceBundle bundle : _default) {
// Try a localized version first.
... | java | public InputStream getResource (String path)
throws IOException
{
String localePath = getLocalePath(path);
InputStream in;
// first look for this resource in our default resource bundle
for (ResourceBundle bundle : _default) {
// Try a localized version first.
... | [
"public",
"InputStream",
"getResource",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"localePath",
"=",
"getLocalePath",
"(",
"path",
")",
";",
"InputStream",
"in",
";",
"// first look for this resource in our default resource bundle",
"for",
"(",... | Fetches a resource from the local repository.
@param path the path to the resource (ie. "config/miso.properties"). This should not begin
with a slash.
@exception IOException thrown if a problem occurs locating or reading the resource. | [
"Fetches",
"a",
"resource",
"from",
"the",
"local",
"repository",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L533-L577 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.addModificationObserver | public void addModificationObserver (String path, ModificationObserver obs)
{
ObservedResource resource = _observed.get(path);
if (resource == null) {
File file = getResourceFile(path);
if (file == null) {
return; // only resource files will ever be modified
... | java | public void addModificationObserver (String path, ModificationObserver obs)
{
ObservedResource resource = _observed.get(path);
if (resource == null) {
File file = getResourceFile(path);
if (file == null) {
return; // only resource files will ever be modified
... | [
"public",
"void",
"addModificationObserver",
"(",
"String",
"path",
",",
"ModificationObserver",
"obs",
")",
"{",
"ObservedResource",
"resource",
"=",
"_observed",
".",
"get",
"(",
"path",
")",
";",
"if",
"(",
"resource",
"==",
"null",
")",
"{",
"File",
"fil... | Adds a modification observer for the specified resource. Note that only a weak reference to
the observer will be retained, and thus this will not prevent the observer from being
garbage-collected. | [
"Adds",
"a",
"modification",
"observer",
"for",
"the",
"specified",
"resource",
".",
"Note",
"that",
"only",
"a",
"weak",
"reference",
"to",
"the",
"observer",
"will",
"be",
"retained",
"and",
"thus",
"this",
"will",
"not",
"prevent",
"the",
"observer",
"fro... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L727-L738 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.removeModificationObserver | public void removeModificationObserver (String path, ModificationObserver obs)
{
ObservedResource resource = _observed.get(path);
if (resource != null) {
resource.observers.remove(obs);
}
} | java | public void removeModificationObserver (String path, ModificationObserver obs)
{
ObservedResource resource = _observed.get(path);
if (resource != null) {
resource.observers.remove(obs);
}
} | [
"public",
"void",
"removeModificationObserver",
"(",
"String",
"path",
",",
"ModificationObserver",
"obs",
")",
"{",
"ObservedResource",
"resource",
"=",
"_observed",
".",
"get",
"(",
"path",
")",
";",
"if",
"(",
"resource",
"!=",
"null",
")",
"{",
"resource",... | Removes a modification observer from the list maintained for the specified resource. | [
"Removes",
"a",
"modification",
"observer",
"from",
"the",
"list",
"maintained",
"for",
"the",
"specified",
"resource",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L743-L749 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.loadConfig | protected Properties loadConfig (String configPath)
throws IOException
{
Properties config = new Properties();
try {
config.load(new FileInputStream(new File(_rdir, configPath)));
} catch (Exception e) {
String errmsg = "Unable to load resource manager config ... | java | protected Properties loadConfig (String configPath)
throws IOException
{
Properties config = new Properties();
try {
config.load(new FileInputStream(new File(_rdir, configPath)));
} catch (Exception e) {
String errmsg = "Unable to load resource manager config ... | [
"protected",
"Properties",
"loadConfig",
"(",
"String",
"configPath",
")",
"throws",
"IOException",
"{",
"Properties",
"config",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"config",
".",
"load",
"(",
"new",
"FileInputStream",
"(",
"new",
"File",
"(... | Loads the configuration properties for our resource sets. | [
"Loads",
"the",
"configuration",
"properties",
"for",
"our",
"resource",
"sets",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L771-L784 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.resolveResourceSet | protected void resolveResourceSet (
String setName, String definition, String setType, List<ResourceBundle> dlist)
{
List<ResourceBundle> set = Lists.newArrayList();
StringTokenizer tok = new StringTokenizer(definition, ":");
while (tok.hasMoreTokens()) {
set.add(createRe... | java | protected void resolveResourceSet (
String setName, String definition, String setType, List<ResourceBundle> dlist)
{
List<ResourceBundle> set = Lists.newArrayList();
StringTokenizer tok = new StringTokenizer(definition, ":");
while (tok.hasMoreTokens()) {
set.add(createRe... | [
"protected",
"void",
"resolveResourceSet",
"(",
"String",
"setName",
",",
"String",
"definition",
",",
"String",
"setType",
",",
"List",
"<",
"ResourceBundle",
">",
"dlist",
")",
"{",
"List",
"<",
"ResourceBundle",
">",
"set",
"=",
"Lists",
".",
"newArrayList"... | Loads up a resource set based on the supplied definition information. | [
"Loads",
"up",
"a",
"resource",
"set",
"based",
"on",
"the",
"supplied",
"definition",
"information",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L799-L816 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.createResourceBundle | protected ResourceBundle createResourceBundle (String setType, String path,
List<ResourceBundle> dlist)
{
if (setType.equals(FILE_SET_TYPE)) {
FileResourceBundle bundle =
createFileResourceBundle(getResourceFile(path), true, _unpack);
if (!bundle.isUnpacked() ... | java | protected ResourceBundle createResourceBundle (String setType, String path,
List<ResourceBundle> dlist)
{
if (setType.equals(FILE_SET_TYPE)) {
FileResourceBundle bundle =
createFileResourceBundle(getResourceFile(path), true, _unpack);
if (!bundle.isUnpacked() ... | [
"protected",
"ResourceBundle",
"createResourceBundle",
"(",
"String",
"setType",
",",
"String",
"path",
",",
"List",
"<",
"ResourceBundle",
">",
"dlist",
")",
"{",
"if",
"(",
"setType",
".",
"equals",
"(",
"FILE_SET_TYPE",
")",
")",
"{",
"FileResourceBundle",
... | Creates a ResourceBundle based on the supplied definition information. | [
"Creates",
"a",
"ResourceBundle",
"based",
"on",
"the",
"supplied",
"definition",
"information",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L821-L836 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.createFileResourceBundle | protected FileResourceBundle createFileResourceBundle (
File source, boolean delay, boolean unpack)
{
return new FileResourceBundle(source, delay, unpack);
} | java | protected FileResourceBundle createFileResourceBundle (
File source, boolean delay, boolean unpack)
{
return new FileResourceBundle(source, delay, unpack);
} | [
"protected",
"FileResourceBundle",
"createFileResourceBundle",
"(",
"File",
"source",
",",
"boolean",
"delay",
",",
"boolean",
"unpack",
")",
"{",
"return",
"new",
"FileResourceBundle",
"(",
"source",
",",
"delay",
",",
"unpack",
")",
";",
"}"
] | Creates an appropriate bundle for fetching resources from files. | [
"Creates",
"an",
"appropriate",
"bundle",
"for",
"fetching",
"resources",
"from",
"files",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L841-L845 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.createNetworkResourceBundle | protected ResourceBundle createNetworkResourceBundle (
String root, String path, Set<String> rsrcList)
{
return new NetworkResourceBundle(root, path, rsrcList);
} | java | protected ResourceBundle createNetworkResourceBundle (
String root, String path, Set<String> rsrcList)
{
return new NetworkResourceBundle(root, path, rsrcList);
} | [
"protected",
"ResourceBundle",
"createNetworkResourceBundle",
"(",
"String",
"root",
",",
"String",
"path",
",",
"Set",
"<",
"String",
">",
"rsrcList",
")",
"{",
"return",
"new",
"NetworkResourceBundle",
"(",
"root",
",",
"path",
",",
"rsrcList",
")",
";",
"}"... | Creates an appropriate bundle for fetching resources from the network. | [
"Creates",
"an",
"appropriate",
"bundle",
"for",
"fetching",
"resources",
"from",
"the",
"network",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L850-L854 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.getInputStreamFromClasspath | protected InputStream getInputStreamFromClasspath (final String fullyQualifiedPath)
{
return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
public InputStream run () {
return _loader.getResourceAsStream(fullyQualifiedPath);
}
});
} | java | protected InputStream getInputStreamFromClasspath (final String fullyQualifiedPath)
{
return AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
public InputStream run () {
return _loader.getResourceAsStream(fullyQualifiedPath);
}
});
} | [
"protected",
"InputStream",
"getInputStreamFromClasspath",
"(",
"final",
"String",
"fullyQualifiedPath",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"InputStream",
">",
"(",
")",
"{",
"public",
"InputStream",
"run"... | Returns an InputStream from this manager's classloader for the given path. | [
"Returns",
"an",
"InputStream",
"from",
"this",
"manager",
"s",
"classloader",
"for",
"the",
"given",
"path",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L859-L866 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.getLocalePath | protected String getLocalePath (String path)
{
return (_localeHandler == null) ? null : _localeHandler.getLocalePath(path);
} | java | protected String getLocalePath (String path)
{
return (_localeHandler == null) ? null : _localeHandler.getLocalePath(path);
} | [
"protected",
"String",
"getLocalePath",
"(",
"String",
"path",
")",
"{",
"return",
"(",
"_localeHandler",
"==",
"null",
")",
"?",
"null",
":",
"_localeHandler",
".",
"getLocalePath",
"(",
"path",
")",
";",
"}"
] | Transform the path into a locale-specific one, or return null. | [
"Transform",
"the",
"path",
"into",
"a",
"locale",
"-",
"specific",
"one",
"or",
"return",
"null",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L871-L874 | train |
threerings/nenya | core/src/main/java/com/threerings/resource/ResourceManager.java | ResourceManager.getNumericJavaVersion | protected static int getNumericJavaVersion (String verstr)
{
Matcher m = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?.*").matcher(verstr);
if (!m.matches()) {
// if we can't parse the java version we're in weird land and should probably just try
// our luck with what we'... | java | protected static int getNumericJavaVersion (String verstr)
{
Matcher m = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)(_\\d+)?.*").matcher(verstr);
if (!m.matches()) {
// if we can't parse the java version we're in weird land and should probably just try
// our luck with what we'... | [
"protected",
"static",
"int",
"getNumericJavaVersion",
"(",
"String",
"verstr",
")",
"{",
"Matcher",
"m",
"=",
"Pattern",
".",
"compile",
"(",
"\"(\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)(_\\\\d+)?.*\"",
")",
".",
"matcher",
"(",
"verstr",
")",
";",
"if",
"(",
"!",
"m"... | Converts the java version string to a more comparable numeric version number. | [
"Converts",
"the",
"java",
"version",
"string",
"to",
"a",
"more",
"comparable",
"numeric",
"version",
"number",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/resource/ResourceManager.java#L946-L961 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/TileSetBundle.java | TileSetBundle.writeObject | private void writeObject (ObjectOutputStream out)
throws IOException
{
out.writeInt(size());
for (IntEntry<TileSet> entry : intEntrySet()) {
out.writeInt(entry.getIntKey());
out.writeObject(entry.getValue());
}
} | java | private void writeObject (ObjectOutputStream out)
throws IOException
{
out.writeInt(size());
for (IntEntry<TileSet> entry : intEntrySet()) {
out.writeInt(entry.getIntKey());
out.writeObject(entry.getValue());
}
} | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeInt",
"(",
"size",
"(",
")",
")",
";",
"for",
"(",
"IntEntry",
"<",
"TileSet",
">",
"entry",
":",
"intEntrySet",
"(",
")",
")",
"{",
... | custom serialization process | [
"custom",
"serialization",
"process"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/TileSetBundle.java#L99-L108 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/TileSetBundle.java | TileSetBundle.readObject | private void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
int count = in.readInt();
for (int ii = 0; ii < count; ii++) {
int tileSetId = in.readInt();
TileSet set = (TileSet)in.readObject();
put(tileSetId, set);
}... | java | private void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
int count = in.readInt();
for (int ii = 0; ii < count; ii++) {
int tileSetId = in.readInt();
TileSet set = (TileSet)in.readObject();
put(tileSetId, set);
}... | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"int",
"count",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"count",
";",
... | custom unserialization process | [
"custom",
"unserialization",
"process"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/TileSetBundle.java#L111-L121 | train |
groupon/monsoon | verify/src/main/java/com/groupon/lex/metrics/Verify.java | Verify.run | public void run() {
boolean validation_fail = false;
boolean arg_seen = true;
for (String file : files) {
final Report v = new Report(new File(file).getAbsoluteFile(), recursive);
if (v.hasErrors()) validation_fail = true;
if (arg_seen) {
arg_s... | java | public void run() {
boolean validation_fail = false;
boolean arg_seen = true;
for (String file : files) {
final Report v = new Report(new File(file).getAbsoluteFile(), recursive);
if (v.hasErrors()) validation_fail = true;
if (arg_seen) {
arg_s... | [
"public",
"void",
"run",
"(",
")",
"{",
"boolean",
"validation_fail",
"=",
"false",
";",
"boolean",
"arg_seen",
"=",
"true",
";",
"for",
"(",
"String",
"file",
":",
"files",
")",
"{",
"final",
"Report",
"v",
"=",
"new",
"Report",
"(",
"new",
"File",
... | Perform validation.
Prints to stdout. | [
"Perform",
"validation",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/verify/src/main/java/com/groupon/lex/metrics/Verify.java#L100-L117 | train |
groupon/monsoon | collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java | MetricListener.onNewMbean | private synchronized void onNewMbean(ObjectName obj) {
if (detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping registration of {0}: already present", obj);
return;
}
MBeanGroup instance = new MBeanGroup(obj, resolvedMap);
detected_groups_.... | java | private synchronized void onNewMbean(ObjectName obj) {
if (detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping registration of {0}: already present", obj);
return;
}
MBeanGroup instance = new MBeanGroup(obj, resolvedMap);
detected_groups_.... | [
"private",
"synchronized",
"void",
"onNewMbean",
"(",
"ObjectName",
"obj",
")",
"{",
"if",
"(",
"detected_groups_",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"obj",
")",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"skipping reg... | Respond to MBeans being added.
@param obj The name of the MBean being added. | [
"Respond",
"to",
"MBeans",
"being",
"added",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java#L141-L150 | train |
groupon/monsoon | collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java | MetricListener.onRemovedMbean | private synchronized void onRemovedMbean(ObjectName obj) {
if (!detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping de-registration of {0}: not present", obj);
return;
}
MBeanGroup instance = detected_groups_.get(obj);
detected_groups_.rem... | java | private synchronized void onRemovedMbean(ObjectName obj) {
if (!detected_groups_.keySet().contains(obj)) {
LOG.log(Level.WARNING, "skipping de-registration of {0}: not present", obj);
return;
}
MBeanGroup instance = detected_groups_.get(obj);
detected_groups_.rem... | [
"private",
"synchronized",
"void",
"onRemovedMbean",
"(",
"ObjectName",
"obj",
")",
"{",
"if",
"(",
"!",
"detected_groups_",
".",
"keySet",
"(",
")",
".",
"contains",
"(",
"obj",
")",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"s... | Respond to MBeans being removed.
@param obj The name of the MBean being removed. | [
"Respond",
"to",
"MBeans",
"being",
"removed",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/collectors/jmx/src/main/java/com/groupon/lex/metrics/jmx/MetricListener.java#L157-L166 | train |
jdillon/gshell | gshell-api/src/main/java/com/planet57/gshell/help/HelpPageUtil.java | HelpPageUtil.renderIndex | public static void renderIndex(final PrintWriter out, final Collection<? extends HelpPage> pages) {
checkNotNull(out);
checkNotNull(pages);
checkArgument(!pages.isEmpty(), "No help pages to render index");
// construct a printf format with sizing for showing columns
int max = pages.stream().mapToI... | java | public static void renderIndex(final PrintWriter out, final Collection<? extends HelpPage> pages) {
checkNotNull(out);
checkNotNull(pages);
checkArgument(!pages.isEmpty(), "No help pages to render index");
// construct a printf format with sizing for showing columns
int max = pages.stream().mapToI... | [
"public",
"static",
"void",
"renderIndex",
"(",
"final",
"PrintWriter",
"out",
",",
"final",
"Collection",
"<",
"?",
"extends",
"HelpPage",
">",
"pages",
")",
"{",
"checkNotNull",
"(",
"out",
")",
";",
"checkNotNull",
"(",
"pages",
")",
";",
"checkArgument",... | Render a column-formatted index of help pages. | [
"Render",
"a",
"column",
"-",
"formatted",
"index",
"of",
"help",
"pages",
"."
] | b587c1a4672d2e4905871462fa3b38a1f7b94e90 | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-api/src/main/java/com/planet57/gshell/help/HelpPageUtil.java#L41-L63 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MediaOverlay.java | MediaOverlay.addDirtyRegion | public void addDirtyRegion (Rectangle rect)
{
// Only add dirty regions where rect intersects our actual media as the set region will
// propagate out to the repaint manager.
for (AbstractMedia media : _metamgr) {
Rectangle intersection = media.getBounds().intersection(rect);
... | java | public void addDirtyRegion (Rectangle rect)
{
// Only add dirty regions where rect intersects our actual media as the set region will
// propagate out to the repaint manager.
for (AbstractMedia media : _metamgr) {
Rectangle intersection = media.getBounds().intersection(rect);
... | [
"public",
"void",
"addDirtyRegion",
"(",
"Rectangle",
"rect",
")",
"{",
"// Only add dirty regions where rect intersects our actual media as the set region will",
"// propagate out to the repaint manager.",
"for",
"(",
"AbstractMedia",
"media",
":",
"_metamgr",
")",
"{",
"Rectang... | Adds a dirty region to this overlay. | [
"Adds",
"a",
"dirty",
"region",
"to",
"this",
"overlay",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MediaOverlay.java#L127-L137 | train |
stephenc/redmine-java-api | src/main/java/org/redmine/ta/internal/comm/BaseCommunicator.java | BaseCommunicator.runEvictor | private void runEvictor(ConnectionEvictor evictor2) {
final Thread evictorThread = new Thread(evictor2);
evictorThread.setDaemon(true);
evictorThread
.setName("Redmine communicator connection eviction thread");
evictorThread.start();
} | java | private void runEvictor(ConnectionEvictor evictor2) {
final Thread evictorThread = new Thread(evictor2);
evictorThread.setDaemon(true);
evictorThread
.setName("Redmine communicator connection eviction thread");
evictorThread.start();
} | [
"private",
"void",
"runEvictor",
"(",
"ConnectionEvictor",
"evictor2",
")",
"{",
"final",
"Thread",
"evictorThread",
"=",
"new",
"Thread",
"(",
"evictor2",
")",
";",
"evictorThread",
".",
"setDaemon",
"(",
"true",
")",
";",
"evictorThread",
".",
"setName",
"("... | Runs an evictor thread. | [
"Runs",
"an",
"evictor",
"thread",
"."
] | 7e5270c84aba32d74a506260ec47ff86ab6c9d84 | https://github.com/stephenc/redmine-java-api/blob/7e5270c84aba32d74a506260ec47ff86ab6c9d84/src/main/java/org/redmine/ta/internal/comm/BaseCommunicator.java#L56-L62 | train |
groupon/monsoon | remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java | Client.addAll | @Override
public boolean addAll(Collection<? extends TimeSeriesCollection> c) {
try {
final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_TCP);
try {
final list_of_timeseries_collection enc_c = encodeTSCCollection(c);
return BlockingWrapp... | java | @Override
public boolean addAll(Collection<? extends TimeSeriesCollection> c) {
try {
final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_TCP);
try {
final list_of_timeseries_collection enc_c = encodeTSCCollection(c);
return BlockingWrapp... | [
"@",
"Override",
"public",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"extends",
"TimeSeriesCollection",
">",
"c",
")",
"{",
"try",
"{",
"final",
"rh_protoClient",
"client",
"=",
"getRpcClient",
"(",
"OncRpcProtocols",
".",
"ONCRPC_TCP",
")",
";",
"try"... | Add multiple TimeSeriesCollections to the history. | [
"Add",
"multiple",
"TimeSeriesCollections",
"to",
"the",
"history",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java#L131-L145 | train |
groupon/monsoon | remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java | Client.getEnd | @Override
public DateTime getEnd() {
try {
final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP);
try {
return decodeTimestamp(BlockingWrapper.execute(() -> client.getEnd_1()));
} finally {
client.close();
}
... | java | @Override
public DateTime getEnd() {
try {
final rh_protoClient client = getRpcClient(OncRpcProtocols.ONCRPC_UDP);
try {
return decodeTimestamp(BlockingWrapper.execute(() -> client.getEnd_1()));
} finally {
client.close();
}
... | [
"@",
"Override",
"public",
"DateTime",
"getEnd",
"(",
")",
"{",
"try",
"{",
"final",
"rh_protoClient",
"client",
"=",
"getRpcClient",
"(",
"OncRpcProtocols",
".",
"ONCRPC_UDP",
")",
";",
"try",
"{",
"return",
"decodeTimestamp",
"(",
"BlockingWrapper",
".",
"ex... | Return the highest timestamp in the stored metrics.
@return The highest timestamp in the stored metrics. | [
"Return",
"the",
"highest",
"timestamp",
"in",
"the",
"stored",
"metrics",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/remote_history/src/main/java/com/groupon/monsoon/remote/history/Client.java#L172-L185 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/v2/tables/RTFMetricTable.java | RTFMetricTable.getAll | public MetricValue[] getAll(int startInclusive, int endExclusive) {
return IntStream.range(startInclusive, endExclusive)
.mapToObj(this::getOrNull)
.toArray(MetricValue[]::new);
} | java | public MetricValue[] getAll(int startInclusive, int endExclusive) {
return IntStream.range(startInclusive, endExclusive)
.mapToObj(this::getOrNull)
.toArray(MetricValue[]::new);
} | [
"public",
"MetricValue",
"[",
"]",
"getAll",
"(",
"int",
"startInclusive",
",",
"int",
"endExclusive",
")",
"{",
"return",
"IntStream",
".",
"range",
"(",
"startInclusive",
",",
"endExclusive",
")",
".",
"mapToObj",
"(",
"this",
"::",
"getOrNull",
")",
".",
... | Returns metric values at the given range.
Absence of a value is represented by a null value in the array.
@param startInclusive The first index of the range.
@param endExclusive The past-the-end index of the range.
@return An array of metric values, with null values representing absence
of the metric. | [
"Returns",
"metric",
"values",
"at",
"the",
"given",
"range",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v2/tables/RTFMetricTable.java#L137-L141 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/impl/auth/DefaultDispatchChallengeHandler.java | DefaultDispatchChallengeHandler.lookup | public List<ChallengeHandler> lookup(String location) {
List<ChallengeHandler> result = Collections.emptyList();
if (location != null) {
Node<ChallengeHandler, UriElement> resultNode = findBestMatchingNode(location);
if (resultNode != null) {
return resultNode.get... | java | public List<ChallengeHandler> lookup(String location) {
List<ChallengeHandler> result = Collections.emptyList();
if (location != null) {
Node<ChallengeHandler, UriElement> resultNode = findBestMatchingNode(location);
if (resultNode != null) {
return resultNode.get... | [
"public",
"List",
"<",
"ChallengeHandler",
">",
"lookup",
"(",
"String",
"location",
")",
"{",
"List",
"<",
"ChallengeHandler",
">",
"result",
"=",
"Collections",
".",
"emptyList",
"(",
")",
";",
"if",
"(",
"location",
"!=",
"null",
")",
"{",
"Node",
"<"... | Locate all challenge handlers to serve the given location.
@param location a location
@return a collection of {@link ChallengeHandler}s if found registered at a matching location or an empty list if none are found. | [
"Locate",
"all",
"challenge",
"handlers",
"to",
"serve",
"the",
"given",
"location",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/impl/auth/DefaultDispatchChallengeHandler.java#L145-L154 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/net/impl/auth/DefaultDispatchChallengeHandler.java | DefaultDispatchChallengeHandler.lookup | ChallengeHandler lookup(ChallengeRequest challengeRequest) {
ChallengeHandler result = null;
String location = challengeRequest.getLocation();
if (location != null) {
Node<ChallengeHandler,UriElement> resultNode = findBestMatchingNode(location);
//
// If we f... | java | ChallengeHandler lookup(ChallengeRequest challengeRequest) {
ChallengeHandler result = null;
String location = challengeRequest.getLocation();
if (location != null) {
Node<ChallengeHandler,UriElement> resultNode = findBestMatchingNode(location);
//
// If we f... | [
"ChallengeHandler",
"lookup",
"(",
"ChallengeRequest",
"challengeRequest",
")",
"{",
"ChallengeHandler",
"result",
"=",
"null",
";",
"String",
"location",
"=",
"challengeRequest",
".",
"getLocation",
"(",
")",
";",
"if",
"(",
"location",
"!=",
"null",
")",
"{",
... | Locate a challenge handler factory to serve the given location and challenge type.
@param challengeRequest A challenge string from the server.
@return a challenge handler registered to handle the challenge at the location,
or <code>null</code> if none could be found. | [
"Locate",
"a",
"challenge",
"handler",
"factory",
"to",
"serve",
"the",
"given",
"location",
"and",
"challenge",
"type",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/net/impl/auth/DefaultDispatchChallengeHandler.java#L164-L187 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java | CachingResolver.refresh | private void refresh() {
try {
// Invoke underlying getTuples unsynchronized.
// This way it won't block tuple access, in case it is a long
// running or expensive function.
final CompletableFuture<? extends Collection<ResolverTuple>> fut = underlying.getTuples();... | java | private void refresh() {
try {
// Invoke underlying getTuples unsynchronized.
// This way it won't block tuple access, in case it is a long
// running or expensive function.
final CompletableFuture<? extends Collection<ResolverTuple>> fut = underlying.getTuples();... | [
"private",
"void",
"refresh",
"(",
")",
"{",
"try",
"{",
"// Invoke underlying getTuples unsynchronized.",
"// This way it won't block tuple access, in case it is a long",
"// running or expensive function.",
"final",
"CompletableFuture",
"<",
"?",
"extends",
"Collection",
"<",
"... | Attempt to refresh the resolver result.
@return a boolean, with true indicating success and false indicating failure. | [
"Attempt",
"to",
"refresh",
"the",
"resolver",
"result",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java#L161-L184 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java | CachingResolver.update | private void update(Collection<ResolverTuple> underlyingTuples, Throwable t) {
if (t != null)
applyException(t);
else if (underlyingTuples != null)
applyUpdate(underlyingTuples);
else
applyException(null);
} | java | private void update(Collection<ResolverTuple> underlyingTuples, Throwable t) {
if (t != null)
applyException(t);
else if (underlyingTuples != null)
applyUpdate(underlyingTuples);
else
applyException(null);
} | [
"private",
"void",
"update",
"(",
"Collection",
"<",
"ResolverTuple",
">",
"underlyingTuples",
",",
"Throwable",
"t",
")",
"{",
"if",
"(",
"t",
"!=",
"null",
")",
"applyException",
"(",
"t",
")",
";",
"else",
"if",
"(",
"underlyingTuples",
"!=",
"null",
... | Update callback, called when the completable future completes. | [
"Update",
"callback",
"called",
"when",
"the",
"completable",
"future",
"completes",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java#L187-L194 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java | CachingResolver.applyUpdate | private synchronized void applyUpdate(Collection<ResolverTuple> underlyingTuples) {
lastRefresh = DateTime.now();
tuples = underlyingTuples;
exception = null;
reschedule(minAge.getMillis());
} | java | private synchronized void applyUpdate(Collection<ResolverTuple> underlyingTuples) {
lastRefresh = DateTime.now();
tuples = underlyingTuples;
exception = null;
reschedule(minAge.getMillis());
} | [
"private",
"synchronized",
"void",
"applyUpdate",
"(",
"Collection",
"<",
"ResolverTuple",
">",
"underlyingTuples",
")",
"{",
"lastRefresh",
"=",
"DateTime",
".",
"now",
"(",
")",
";",
"tuples",
"=",
"underlyingTuples",
";",
"exception",
"=",
"null",
";",
"res... | Apply updated tuple collection. | [
"Apply",
"updated",
"tuple",
"collection",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java#L197-L202 | train |
groupon/monsoon | impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java | CachingResolver.reschedule | private synchronized void reschedule(long millis) {
currentFut = null; // Remove current future.
if (!closed) {
SCHEDULER.schedule(this::refresh, millis, TimeUnit.MILLISECONDS);
} else {
try {
underlying.close();
} catch (Exception ex) {
... | java | private synchronized void reschedule(long millis) {
currentFut = null; // Remove current future.
if (!closed) {
SCHEDULER.schedule(this::refresh, millis, TimeUnit.MILLISECONDS);
} else {
try {
underlying.close();
} catch (Exception ex) {
... | [
"private",
"synchronized",
"void",
"reschedule",
"(",
"long",
"millis",
")",
"{",
"currentFut",
"=",
"null",
";",
"// Remove current future.",
"if",
"(",
"!",
"closed",
")",
"{",
"SCHEDULER",
".",
"schedule",
"(",
"this",
"::",
"refresh",
",",
"millis",
",",... | Schedule next invocation of the update task. | [
"Schedule",
"next",
"invocation",
"of",
"the",
"update",
"task",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/impl/src/main/java/com/groupon/lex/metrics/resolver/CachingResolver.java#L214-L226 | train |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java | ComponentBundlerUtil.parseActionTileSets | public static Map<String, TileSet> parseActionTileSets (File file)
throws IOException, SAXException
{
return parseActionTileSets(new BufferedInputStream(new FileInputStream(file)));
} | java | public static Map<String, TileSet> parseActionTileSets (File file)
throws IOException, SAXException
{
return parseActionTileSets(new BufferedInputStream(new FileInputStream(file)));
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"TileSet",
">",
"parseActionTileSets",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"return",
"parseActionTileSets",
"(",
"new",
"BufferedInputStream",
"(",
"new",
"FileInputStream",
"(... | Parses the action tileset definitions in the supplied file and puts them into a hash map,
keyed on action name. | [
"Parses",
"the",
"action",
"tileset",
"definitions",
"in",
"the",
"supplied",
"file",
"and",
"puts",
"them",
"into",
"a",
"hash",
"map",
"keyed",
"on",
"action",
"name",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java#L49-L53 | train |
threerings/nenya | tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java | ComponentBundlerUtil.parseActionTileSets | public static Map<String, TileSet> parseActionTileSets (InputStream in)
throws IOException, SAXException
{
Digester digester = new Digester();
digester.addSetProperties("actions" + ActionRuleSet.ACTION_PATH);
addTileSetRuleSet(digester, new SwissArmyTileSetRuleSet());
addTile... | java | public static Map<String, TileSet> parseActionTileSets (InputStream in)
throws IOException, SAXException
{
Digester digester = new Digester();
digester.addSetProperties("actions" + ActionRuleSet.ACTION_PATH);
addTileSetRuleSet(digester, new SwissArmyTileSetRuleSet());
addTile... | [
"public",
"static",
"Map",
"<",
"String",
",",
"TileSet",
">",
"parseActionTileSets",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
",",
"SAXException",
"{",
"Digester",
"digester",
"=",
"new",
"Digester",
"(",
")",
";",
"digester",
".",
"addSetPrope... | Parses the action tileset definitions in the supplied input stream, and puts them into a
hash map, keyed on action name. | [
"Parses",
"the",
"action",
"tileset",
"definitions",
"in",
"the",
"supplied",
"input",
"stream",
"and",
"puts",
"them",
"into",
"a",
"hash",
"map",
"keyed",
"on",
"action",
"name",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/bundle/tools/ComponentBundlerUtil.java#L59-L71 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/BundleUtil.java | BundleUtil.extractBundle | public static TileSetBundle extractBundle (ResourceBundle bundle)
throws IOException, ClassNotFoundException
{
// unserialize the tileset bundles array
InputStream tbin = null;
try {
tbin = bundle.getResource(METADATA_PATH);
ObjectInputStream oin = new ObjectI... | java | public static TileSetBundle extractBundle (ResourceBundle bundle)
throws IOException, ClassNotFoundException
{
// unserialize the tileset bundles array
InputStream tbin = null;
try {
tbin = bundle.getResource(METADATA_PATH);
ObjectInputStream oin = new ObjectI... | [
"public",
"static",
"TileSetBundle",
"extractBundle",
"(",
"ResourceBundle",
"bundle",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// unserialize the tileset bundles array",
"InputStream",
"tbin",
"=",
"null",
";",
"try",
"{",
"tbin",
"=",
"bundle... | Extracts, but does not initialize, a serialized tileset bundle
instance from the supplied resource bundle. | [
"Extracts",
"but",
"does",
"not",
"initialize",
"a",
"serialized",
"tileset",
"bundle",
"instance",
"from",
"the",
"supplied",
"resource",
"bundle",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/BundleUtil.java#L46-L60 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/bundle/BundleUtil.java | BundleUtil.extractBundle | public static TileSetBundle extractBundle (File file)
throws IOException, ClassNotFoundException
{
// unserialize the tileset bundles array
FileInputStream fin = new FileInputStream(file);
try {
ObjectInputStream oin = new ObjectInputStream(
new BufferedIn... | java | public static TileSetBundle extractBundle (File file)
throws IOException, ClassNotFoundException
{
// unserialize the tileset bundles array
FileInputStream fin = new FileInputStream(file);
try {
ObjectInputStream oin = new ObjectInputStream(
new BufferedIn... | [
"public",
"static",
"TileSetBundle",
"extractBundle",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// unserialize the tileset bundles array",
"FileInputStream",
"fin",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"try"... | Extracts, but does not initialize, a serialized tileset bundle
instance from the supplied file. | [
"Extracts",
"but",
"does",
"not",
"initialize",
"a",
"serialized",
"tileset",
"bundle",
"instance",
"from",
"the",
"supplied",
"file",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/bundle/BundleUtil.java#L66-L79 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java | FileUtil.createTempFile | public static FileChannel createTempFile(Path dir, String prefix, String suffix) throws IOException {
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW, DELETE_ON_CLOSE}).getFileChannel();
} | java | public static FileChannel createTempFile(Path dir, String prefix, String suffix) throws IOException {
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW, DELETE_ON_CLOSE}).getFileChannel();
} | [
"public",
"static",
"FileChannel",
"createTempFile",
"(",
"Path",
"dir",
",",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"return",
"createNewFileImpl",
"(",
"dir",
",",
"prefix",
",",
"suffix",
",",
"new",
"OpenOption",
"["... | Create a temporary file that will be removed when it is closed. | [
"Create",
"a",
"temporary",
"file",
"that",
"will",
"be",
"removed",
"when",
"it",
"is",
"closed",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java#L58-L60 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java | FileUtil.createTempFile | public static FileChannel createTempFile(String prefix, String suffix) throws IOException {
return createTempFile(TMPDIR, prefix, suffix);
} | java | public static FileChannel createTempFile(String prefix, String suffix) throws IOException {
return createTempFile(TMPDIR, prefix, suffix);
} | [
"public",
"static",
"FileChannel",
"createTempFile",
"(",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"return",
"createTempFile",
"(",
"TMPDIR",
",",
"prefix",
",",
"suffix",
")",
";",
"}"
] | Create a temporary file that will be removed when it is closed, in the
tmpdir location. | [
"Create",
"a",
"temporary",
"file",
"that",
"will",
"be",
"removed",
"when",
"it",
"is",
"closed",
"in",
"the",
"tmpdir",
"location",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java#L66-L68 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java | FileUtil.createNewFile | public static NamedFileChannel createNewFile(Path dir, String prefix, String suffix) throws IOException {
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW});
} | java | public static NamedFileChannel createNewFile(Path dir, String prefix, String suffix) throws IOException {
return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW});
} | [
"public",
"static",
"NamedFileChannel",
"createNewFile",
"(",
"Path",
"dir",
",",
"String",
"prefix",
",",
"String",
"suffix",
")",
"throws",
"IOException",
"{",
"return",
"createNewFileImpl",
"(",
"dir",
",",
"prefix",
",",
"suffix",
",",
"new",
"OpenOption",
... | Creates a new file and opens it for reading and writing. | [
"Creates",
"a",
"new",
"file",
"and",
"opens",
"it",
"for",
"reading",
"and",
"writing",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/FileUtil.java#L73-L75 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObject.java | SceneObject.paint | public void paint (Graphics2D gfx)
{
// if we're rendering footprints, paint that
boolean footpaint = _fprintDebug.getValue();
if (footpaint) {
gfx.setColor(Color.black);
gfx.draw(_footprint);
if (_hideObjects.getValue()) {
// We're in foo... | java | public void paint (Graphics2D gfx)
{
// if we're rendering footprints, paint that
boolean footpaint = _fprintDebug.getValue();
if (footpaint) {
gfx.setColor(Color.black);
gfx.draw(_footprint);
if (_hideObjects.getValue()) {
// We're in foo... | [
"public",
"void",
"paint",
"(",
"Graphics2D",
"gfx",
")",
"{",
"// if we're rendering footprints, paint that",
"boolean",
"footpaint",
"=",
"_fprintDebug",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"footpaint",
")",
"{",
"gfx",
".",
"setColor",
"(",
"Color",
... | Requests that this scene object render itself. | [
"Requests",
"that",
"this",
"scene",
"object",
"render",
"itself",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObject.java#L111-L165 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObject.java | SceneObject.setPriority | public void setPriority (byte priority)
{
info.priority = (byte)Math.max(
Byte.MIN_VALUE, Math.min(Byte.MAX_VALUE, priority));
} | java | public void setPriority (byte priority)
{
info.priority = (byte)Math.max(
Byte.MIN_VALUE, Math.min(Byte.MAX_VALUE, priority));
} | [
"public",
"void",
"setPriority",
"(",
"byte",
"priority",
")",
"{",
"info",
".",
"priority",
"=",
"(",
"byte",
")",
"Math",
".",
"max",
"(",
"Byte",
".",
"MIN_VALUE",
",",
"Math",
".",
"min",
"(",
"Byte",
".",
"MAX_VALUE",
",",
"priority",
")",
")",
... | Overrides the render priority of this object. | [
"Overrides",
"the",
"render",
"priority",
"of",
"this",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObject.java#L228-L232 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObject.java | SceneObject.relocateObject | public void relocateObject (MisoSceneMetrics metrics, int tx, int ty)
{
// Log.info("Relocating object " + this + " to " +
// StringUtil.coordsToString(tx, ty));
info.x = tx;
info.y = ty;
computeInfo(metrics);
} | java | public void relocateObject (MisoSceneMetrics metrics, int tx, int ty)
{
// Log.info("Relocating object " + this + " to " +
// StringUtil.coordsToString(tx, ty));
info.x = tx;
info.y = ty;
computeInfo(metrics);
} | [
"public",
"void",
"relocateObject",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"// Log.info(\"Relocating object \" + this + \" to \" +",
"// StringUtil.coordsToString(tx, ty));",
"info",
".",
"x",
"=",
"tx",
";... | Updates this object's origin tile coordinate. Its bounds and other
cached screen coordinate information are updated. | [
"Updates",
"this",
"object",
"s",
"origin",
"tile",
"coordinate",
".",
"Its",
"bounds",
"and",
"other",
"cached",
"screen",
"coordinate",
"information",
"are",
"updated",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObject.java#L248-L255 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneObject.java | SceneObject.computeInfo | protected void computeInfo (MisoSceneMetrics metrics)
{
// start with the screen coordinates of our origin tile
Point tpos = MisoUtil.tileToScreen(
metrics, info.x, info.y, new Point());
// if the tile has an origin coordinate, use that, otherwise
// compute it from the ... | java | protected void computeInfo (MisoSceneMetrics metrics)
{
// start with the screen coordinates of our origin tile
Point tpos = MisoUtil.tileToScreen(
metrics, info.x, info.y, new Point());
// if the tile has an origin coordinate, use that, otherwise
// compute it from the ... | [
"protected",
"void",
"computeInfo",
"(",
"MisoSceneMetrics",
"metrics",
")",
"{",
"// start with the screen coordinates of our origin tile",
"Point",
"tpos",
"=",
"MisoUtil",
".",
"tileToScreen",
"(",
"metrics",
",",
"info",
".",
"x",
",",
"info",
".",
"y",
",",
"... | Computes our screen bounds, tile footprint and other useful cached metrics. | [
"Computes",
"our",
"screen",
"bounds",
"tile",
"footprint",
"and",
"other",
"useful",
"cached",
"metrics",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneObject.java#L291-L331 | train |
tonilopezmr/Android-EasySQLite | app/src/main/java/com/tonilopezmr/sample/domain/interactor/GetSubjectListUseCaseImp.java | GetSubjectListUseCaseImp.run | @Override
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
subjectRepository.getSubjectsCollection(new SubjectRepository.SubjectListCallback() {
@Override
public void onSubjectList... | java | @Override
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
subjectRepository.getSubjectsCollection(new SubjectRepository.SubjectListCallback() {
@Override
public void onSubjectList... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"3000",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"subjectRepository",
".",
"... | Interactor User case | [
"Interactor",
"User",
"case"
] | bb991a43c9fa11522e5367570ee2335b99bca7c0 | https://github.com/tonilopezmr/Android-EasySQLite/blob/bb991a43c9fa11522e5367570ee2335b99bca7c0/app/src/main/java/com/tonilopezmr/sample/domain/interactor/GetSubjectListUseCaseImp.java#L43-L73 | train |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/xdr/support/TmpFileBasedColumnMajorTSData.java | Builder.fixBacklog | private void fixBacklog() throws IOException {
try {
writers.values().parallelStream()
.forEach(groupWriter -> {
try {
groupWriter.fixBacklog(timestamps.size());
} catch (IOExcepti... | java | private void fixBacklog() throws IOException {
try {
writers.values().parallelStream()
.forEach(groupWriter -> {
try {
groupWriter.fixBacklog(timestamps.size());
} catch (IOExcepti... | [
"private",
"void",
"fixBacklog",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"writers",
".",
"values",
"(",
")",
".",
"parallelStream",
"(",
")",
".",
"forEach",
"(",
"groupWriter",
"->",
"{",
"try",
"{",
"groupWriter",
".",
"fixBacklog",
"(",
"t... | Pad all groups with empty maps, to ensure it's the same size as
timestamps list.
We want to keep all the Group instances to have the same number of
maps as the timestamps list, so we can zip the two together. | [
"Pad",
"all",
"groups",
"with",
"empty",
"maps",
"to",
"ensure",
"it",
"s",
"the",
"same",
"size",
"as",
"timestamps",
"list",
"."
] | eb68d72ba4c01fe018dc981097dbee033908f5c7 | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/xdr/support/TmpFileBasedColumnMajorTSData.java#L114-L127 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MetaMediaManager.java | MetaMediaManager.setPaused | public void setPaused (boolean paused)
{
// sanity check
if ((paused && (_pauseTime != 0)) || (!paused && (_pauseTime == 0))) {
log.warning("Requested to pause when paused or vice-versa", "paused", paused);
return;
}
_paused = paused;
if (_paused) {
... | java | public void setPaused (boolean paused)
{
// sanity check
if ((paused && (_pauseTime != 0)) || (!paused && (_pauseTime == 0))) {
log.warning("Requested to pause when paused or vice-versa", "paused", paused);
return;
}
_paused = paused;
if (_paused) {
... | [
"public",
"void",
"setPaused",
"(",
"boolean",
"paused",
")",
"{",
"// sanity check",
"if",
"(",
"(",
"paused",
"&&",
"(",
"_pauseTime",
"!=",
"0",
")",
")",
"||",
"(",
"!",
"paused",
"&&",
"(",
"_pauseTime",
"==",
"0",
")",
")",
")",
"{",
"log",
"... | Pauses the sprites and animations that are currently active on this media panel. Also stops
listening to the frame tick while paused. | [
"Pauses",
"the",
"sprites",
"and",
"animations",
"that",
"are",
"currently",
"active",
"on",
"this",
"media",
"panel",
".",
"Also",
"stops",
"listening",
"to",
"the",
"frame",
"tick",
"while",
"paused",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MetaMediaManager.java#L110-L132 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MetaMediaManager.java | MetaMediaManager.paintMedia | public void paintMedia (Graphics2D gfx, int layer, Rectangle dirty)
{
if (layer == FRONT) {
_spritemgr.paint(gfx, layer, dirty);
_animmgr.paint(gfx, layer, dirty);
} else {
_animmgr.paint(gfx, layer, dirty);
_spritemgr.paint(gfx, layer, dirty);
... | java | public void paintMedia (Graphics2D gfx, int layer, Rectangle dirty)
{
if (layer == FRONT) {
_spritemgr.paint(gfx, layer, dirty);
_animmgr.paint(gfx, layer, dirty);
} else {
_animmgr.paint(gfx, layer, dirty);
_spritemgr.paint(gfx, layer, dirty);
... | [
"public",
"void",
"paintMedia",
"(",
"Graphics2D",
"gfx",
",",
"int",
"layer",
",",
"Rectangle",
"dirty",
")",
"{",
"if",
"(",
"layer",
"==",
"FRONT",
")",
"{",
"_spritemgr",
".",
"paint",
"(",
"gfx",
",",
"layer",
",",
"dirty",
")",
";",
"_animmgr",
... | Renders the sprites and animations that intersect the supplied dirty region in the specified
layer. | [
"Renders",
"the",
"sprites",
"and",
"animations",
"that",
"intersect",
"the",
"supplied",
"dirty",
"region",
"in",
"the",
"specified",
"layer",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MetaMediaManager.java#L300-L309 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MetaMediaManager.java | MetaMediaManager.paintPerf | public void paintPerf (Graphics2D gfx)
{
if (_perfRect != null && FrameManager._perfDebug.getValue()) {
gfx.setClip(null);
_perfLabel.render(gfx, _perfRect.x, _perfRect.y);
}
} | java | public void paintPerf (Graphics2D gfx)
{
if (_perfRect != null && FrameManager._perfDebug.getValue()) {
gfx.setClip(null);
_perfLabel.render(gfx, _perfRect.x, _perfRect.y);
}
} | [
"public",
"void",
"paintPerf",
"(",
"Graphics2D",
"gfx",
")",
"{",
"if",
"(",
"_perfRect",
"!=",
"null",
"&&",
"FrameManager",
".",
"_perfDebug",
".",
"getValue",
"(",
")",
")",
"{",
"gfx",
".",
"setClip",
"(",
"null",
")",
";",
"_perfLabel",
".",
"ren... | Renders our performance debugging information if enabled. | [
"Renders",
"our",
"performance",
"debugging",
"information",
"if",
"enabled",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MetaMediaManager.java#L314-L320 | train |
threerings/nenya | core/src/main/java/com/threerings/media/MetaMediaManager.java | MetaMediaManager.viewLocationDidChange | public void viewLocationDidChange (int dx, int dy)
{
if (_perfRect != null) {
Rectangle sdirty = new Rectangle(_perfRect);
sdirty.translate(-dx, -dy);
_remgr.addDirtyRegion(sdirty);
}
// let our sprites and animations know what's up
_animmgr.viewL... | java | public void viewLocationDidChange (int dx, int dy)
{
if (_perfRect != null) {
Rectangle sdirty = new Rectangle(_perfRect);
sdirty.translate(-dx, -dy);
_remgr.addDirtyRegion(sdirty);
}
// let our sprites and animations know what's up
_animmgr.viewL... | [
"public",
"void",
"viewLocationDidChange",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"if",
"(",
"_perfRect",
"!=",
"null",
")",
"{",
"Rectangle",
"sdirty",
"=",
"new",
"Rectangle",
"(",
"_perfRect",
")",
";",
"sdirty",
".",
"translate",
"(",
"-",
"... | If our host supports scrolling around in a virtual view, it should call this method when the
view origin changes. | [
"If",
"our",
"host",
"supports",
"scrolling",
"around",
"in",
"a",
"virtual",
"view",
"it",
"should",
"call",
"this",
"method",
"when",
"the",
"view",
"origin",
"changes",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/MetaMediaManager.java#L326-L337 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/Tile.java | Tile.setImage | public void setImage (Mirage image)
{
if (_mirage != null) {
_totalTileMemory -= _mirage.getEstimatedMemoryUsage();
}
_mirage = image;
if (_mirage != null) {
_totalTileMemory += _mirage.getEstimatedMemoryUsage();
}
} | java | public void setImage (Mirage image)
{
if (_mirage != null) {
_totalTileMemory -= _mirage.getEstimatedMemoryUsage();
}
_mirage = image;
if (_mirage != null) {
_totalTileMemory += _mirage.getEstimatedMemoryUsage();
}
} | [
"public",
"void",
"setImage",
"(",
"Mirage",
"image",
")",
"{",
"if",
"(",
"_mirage",
"!=",
"null",
")",
"{",
"_totalTileMemory",
"-=",
"_mirage",
".",
"getEstimatedMemoryUsage",
"(",
")",
";",
"}",
"_mirage",
"=",
"image",
";",
"if",
"(",
"_mirage",
"!=... | Configures this tile with its tile image. | [
"Configures",
"this",
"tile",
"with",
"its",
"tile",
"image",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/Tile.java#L80-L89 | train |
threerings/nenya | core/src/main/java/com/threerings/media/tile/Tile.java | Tile.paint | public void paint (Graphics2D gfx, int x, int y)
{
_mirage.paint(gfx, x, y);
} | java | public void paint (Graphics2D gfx, int x, int y)
{
_mirage.paint(gfx, x, y);
} | [
"public",
"void",
"paint",
"(",
"Graphics2D",
"gfx",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"_mirage",
".",
"paint",
"(",
"gfx",
",",
"x",
",",
"y",
")",
";",
"}"
] | Render the tile image at the specified position in the given
graphics context. | [
"Render",
"the",
"tile",
"image",
"at",
"the",
"specified",
"position",
"in",
"the",
"given",
"graphics",
"context",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/Tile.java#L119-L122 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.