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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
dkpro/dkpro-argumentation | dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java | ArgumentUnitUtils.setProperty | public static String setProperty(ArgumentUnit argumentUnit, String propertyName,
String propertyValue)
{
Properties properties = ArgumentUnitUtils.getProperties(argumentUnit);
String result = (String) properties.setProperty(propertyName, propertyValue);
ArgumentUnitUtils.setPrope... | java | public static String setProperty(ArgumentUnit argumentUnit, String propertyName,
String propertyValue)
{
Properties properties = ArgumentUnitUtils.getProperties(argumentUnit);
String result = (String) properties.setProperty(propertyName, propertyValue);
ArgumentUnitUtils.setPrope... | [
"public",
"static",
"String",
"setProperty",
"(",
"ArgumentUnit",
"argumentUnit",
",",
"String",
"propertyName",
",",
"String",
"propertyValue",
")",
"{",
"Properties",
"properties",
"=",
"ArgumentUnitUtils",
".",
"getProperties",
"(",
"argumentUnit",
")",
";",
"Str... | Sets the property
@param argumentUnit argument component
@param propertyName property name
@param propertyValue property value
@return the previous value of the specified key in this property
list, or {@code null} if it did not have one. | [
"Sets",
"the",
"property"
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java#L152-L160 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java | ArgumentUnitUtils.getProperty | public static String getProperty(ArgumentUnit argumentUnit, String propertyName)
{
Properties properties = ArgumentUnitUtils.getProperties(argumentUnit);
return (String) properties.get(propertyName);
} | java | public static String getProperty(ArgumentUnit argumentUnit, String propertyName)
{
Properties properties = ArgumentUnitUtils.getProperties(argumentUnit);
return (String) properties.get(propertyName);
} | [
"public",
"static",
"String",
"getProperty",
"(",
"ArgumentUnit",
"argumentUnit",
",",
"String",
"propertyName",
")",
"{",
"Properties",
"properties",
"=",
"ArgumentUnitUtils",
".",
"getProperties",
"(",
"argumentUnit",
")",
";",
"return",
"(",
"String",
")",
"pro... | Returns the property value
@param argumentUnit argument component
@param propertyName property name
@return the value to which the specified key is mapped, or
{@code null} if this map contains no mapping for the key | [
"Returns",
"the",
"property",
"value"
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java#L170-L174 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java | ArgumentUnitUtils.isImplicit | public static boolean isImplicit(ArgumentUnit argumentUnit)
throws IllegalStateException
{
// is the implicit flag set?
String implicitProperty = ArgumentUnitUtils.getProperty(argumentUnit,
ArgumentUnitUtils.PROP_KEY_IS_IMPLICIT);
// is the length really zero?
... | java | public static boolean isImplicit(ArgumentUnit argumentUnit)
throws IllegalStateException
{
// is the implicit flag set?
String implicitProperty = ArgumentUnitUtils.getProperty(argumentUnit,
ArgumentUnitUtils.PROP_KEY_IS_IMPLICIT);
// is the length really zero?
... | [
"public",
"static",
"boolean",
"isImplicit",
"(",
"ArgumentUnit",
"argumentUnit",
")",
"throws",
"IllegalStateException",
"{",
"// is the implicit flag set?",
"String",
"implicitProperty",
"=",
"ArgumentUnitUtils",
".",
"getProperty",
"(",
"argumentUnit",
",",
"ArgumentUnit... | Returns true is the argumentUnit length is 0 and flag is set to implicit. If length is
greater than zero and flag is not set to implicit, returns false. In any other case, throws
an exception
@param argumentUnit argument unit
@return boolean
@throws java.lang.IllegalStateException if the implicit flag and length are i... | [
"Returns",
"true",
"is",
"the",
"argumentUnit",
"length",
"is",
"0",
"and",
"flag",
"is",
"set",
"to",
"implicit",
".",
"If",
"length",
"is",
"greater",
"than",
"zero",
"and",
"flag",
"is",
"not",
"set",
"to",
"implicit",
"returns",
"false",
".",
"In",
... | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java#L185-L207 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java | ArgumentUnitUtils.setIsImplicit | public static void setIsImplicit(ArgumentUnit argumentUnit, boolean implicit)
throws IllegalArgumentException
{
int length = argumentUnit.getEnd() - argumentUnit.getBegin();
if (length > 0) {
throw new IllegalArgumentException("Cannot set 'implicit' property to component " +... | java | public static void setIsImplicit(ArgumentUnit argumentUnit, boolean implicit)
throws IllegalArgumentException
{
int length = argumentUnit.getEnd() - argumentUnit.getBegin();
if (length > 0) {
throw new IllegalArgumentException("Cannot set 'implicit' property to component " +... | [
"public",
"static",
"void",
"setIsImplicit",
"(",
"ArgumentUnit",
"argumentUnit",
",",
"boolean",
"implicit",
")",
"throws",
"IllegalArgumentException",
"{",
"int",
"length",
"=",
"argumentUnit",
".",
"getEnd",
"(",
")",
"-",
"argumentUnit",
".",
"getBegin",
"(",
... | Sets the implicit value to the argument
@param argumentUnit argument unit
@param implicit boolean value
@throws java.lang.IllegalArgumentException if the length of argument is non-zero | [
"Sets",
"the",
"implicit",
"value",
"to",
"the",
"argument"
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java#L216-L228 | train |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DSet.java | DSet.newDSet | public static <E extends DSet.Entry> DSet<E> newDSet (Iterable<? extends E> source)
{
return new DSet<E>(source);
} | java | public static <E extends DSet.Entry> DSet<E> newDSet (Iterable<? extends E> source)
{
return new DSet<E>(source);
} | [
"public",
"static",
"<",
"E",
"extends",
"DSet",
".",
"Entry",
">",
"DSet",
"<",
"E",
">",
"newDSet",
"(",
"Iterable",
"<",
"?",
"extends",
"E",
">",
"source",
")",
"{",
"return",
"new",
"DSet",
"<",
"E",
">",
"(",
"source",
")",
";",
"}"
] | Creates a new DSet of the appropriate generic type. | [
"Creates",
"a",
"new",
"DSet",
"of",
"the",
"appropriate",
"generic",
"type",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DSet.java#L83-L86 | train |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DSet.java | DSet.writeObject | public void writeObject (ObjectOutputStream out)
throws IOException
{
out.writeInt(_size);
for (int ii = 0; ii < _size; ii++) {
out.writeObject(_entries[ii]);
}
} | java | public void writeObject (ObjectOutputStream out)
throws IOException
{
out.writeInt(_size);
for (int ii = 0; ii < _size; ii++) {
out.writeObject(_entries[ii]);
}
} | [
"public",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeInt",
"(",
"_size",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"_size",
";",
"ii",
"++",
")",
"{",
"out",
".",
... | Custom writer method. @see Streamable. | [
"Custom",
"writer",
"method",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DSet.java#L497-L504 | train |
threerings/narya | core/src/main/java/com/threerings/presents/dobj/DSet.java | DSet.readObject | public void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
_size = in.readInt();
// ensure our capacity is a power of 2 (for consistency)
int capacity = INITIAL_CAPACITY;
while (capacity < _size) {
capacity <<= 1;
}
... | java | public void readObject (ObjectInputStream in)
throws IOException, ClassNotFoundException
{
_size = in.readInt();
// ensure our capacity is a power of 2 (for consistency)
int capacity = INITIAL_CAPACITY;
while (capacity < _size) {
capacity <<= 1;
}
... | [
"public",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"_size",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"// ensure our capacity is a power of 2 (for consistency)",
"int",
"capacity",
"=",
"IN... | Custom reader method. @see Streamable. | [
"Custom",
"reader",
"method",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DSet.java#L507-L522 | train |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.addTranslation | public void addTranslation (String oldname, String newname)
{
if (_translations == null) {
_translations = Maps.newHashMap();
}
_translations.put(oldname, newname);
} | java | public void addTranslation (String oldname, String newname)
{
if (_translations == null) {
_translations = Maps.newHashMap();
}
_translations.put(oldname, newname);
} | [
"public",
"void",
"addTranslation",
"(",
"String",
"oldname",
",",
"String",
"newname",
")",
"{",
"if",
"(",
"_translations",
"==",
"null",
")",
"{",
"_translations",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"}",
"_translations",
".",
"put",
"(",
"... | Configures this object input stream with a mapping from an old class name to a new
one. Serialized instances of the old class name will use the new class name when
unserializing. | [
"Configures",
"this",
"object",
"input",
"stream",
"with",
"a",
"mapping",
"from",
"an",
"old",
"class",
"name",
"to",
"a",
"new",
"one",
".",
"Serialized",
"instances",
"of",
"the",
"old",
"class",
"name",
"will",
"use",
"the",
"new",
"class",
"name",
"... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L67-L73 | train |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.readIntern | public String readIntern ()
throws IOException
{
// create our intern map if necessary
if (_internmap == null) {
_internmap = Lists.newArrayList();
// insert a zeroth element
_internmap.add(null);
}
// read in the intern code for this inst... | java | public String readIntern ()
throws IOException
{
// create our intern map if necessary
if (_internmap == null) {
_internmap = Lists.newArrayList();
// insert a zeroth element
_internmap.add(null);
}
// read in the intern code for this inst... | [
"public",
"String",
"readIntern",
"(",
")",
"throws",
"IOException",
"{",
"// create our intern map if necessary",
"if",
"(",
"_internmap",
"==",
"null",
")",
"{",
"_internmap",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// insert a zeroth element",
"_intern... | Reads a pooled string value from the input stream. | [
"Reads",
"a",
"pooled",
"string",
"value",
"from",
"the",
"input",
"stream",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L109-L153 | train |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.readClassMapping | protected ClassMapping readClassMapping ()
throws IOException, ClassNotFoundException
{
// create our classmap if necessary
if (_classmap == null) {
_classmap = Lists.newArrayList();
// insert a zeroth element
_classmap.add(null);
}
// rea... | java | protected ClassMapping readClassMapping ()
throws IOException, ClassNotFoundException
{
// create our classmap if necessary
if (_classmap == null) {
_classmap = Lists.newArrayList();
// insert a zeroth element
_classmap.add(null);
}
// rea... | [
"protected",
"ClassMapping",
"readClassMapping",
"(",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// create our classmap if necessary",
"if",
"(",
"_classmap",
"==",
"null",
")",
"{",
"_classmap",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
"... | Reads a class mapping from the stream.
@return the class mapping, or <code>null</code> to represent a null value. | [
"Reads",
"a",
"class",
"mapping",
"from",
"the",
"stream",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L169-L221 | train |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.mapClass | protected ClassMapping mapClass (short code, String cname)
throws IOException, ClassNotFoundException
{
// create a class mapping record, and cache it
ClassMapping cmap = createClassMapping(code, cname);
_classmap.add(code, cmap);
return cmap;
} | java | protected ClassMapping mapClass (short code, String cname)
throws IOException, ClassNotFoundException
{
// create a class mapping record, and cache it
ClassMapping cmap = createClassMapping(code, cname);
_classmap.add(code, cmap);
return cmap;
} | [
"protected",
"ClassMapping",
"mapClass",
"(",
"short",
"code",
",",
"String",
"cname",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// create a class mapping record, and cache it",
"ClassMapping",
"cmap",
"=",
"createClassMapping",
"(",
"code",
",",
... | Creates, adds, and returns the class mapping for the specified code and class name. | [
"Creates",
"adds",
"and",
"returns",
"the",
"class",
"mapping",
"for",
"the",
"specified",
"code",
"and",
"class",
"name",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L226-L233 | train |
threerings/narya | core/src/main/java/com/threerings/io/ObjectInputStream.java | ObjectInputStream.createClassMapping | protected ClassMapping createClassMapping (short code, String cname)
throws IOException, ClassNotFoundException
{
// resolve the class and streamer
ClassLoader loader = (_loader != null) ? _loader :
Thread.currentThread().getContextClassLoader();
Class<?> sclass = Class.f... | java | protected ClassMapping createClassMapping (short code, String cname)
throws IOException, ClassNotFoundException
{
// resolve the class and streamer
ClassLoader loader = (_loader != null) ? _loader :
Thread.currentThread().getContextClassLoader();
Class<?> sclass = Class.f... | [
"protected",
"ClassMapping",
"createClassMapping",
"(",
"short",
"code",
",",
"String",
"cname",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"// resolve the class and streamer",
"ClassLoader",
"loader",
"=",
"(",
"_loader",
"!=",
"null",
")",
"?"... | Creates and returns a class mapping for the specified code and class name. | [
"Creates",
"and",
"returns",
"a",
"class",
"mapping",
"for",
"the",
"specified",
"code",
"and",
"class",
"name",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectInputStream.java#L238-L258 | train |
threerings/narya | core/src/main/java/com/threerings/presents/client/DeltaCalculator.java | DeltaCalculator.gotPong | public boolean gotPong (PongResponse pong)
{
if (_ping == null) {
// an errant pong that is likely being processed late after
// a new connection was opened.
return false;
}
// don't freak out if they keep calling gotPong() after we're done
if (_it... | java | public boolean gotPong (PongResponse pong)
{
if (_ping == null) {
// an errant pong that is likely being processed late after
// a new connection was opened.
return false;
}
// don't freak out if they keep calling gotPong() after we're done
if (_it... | [
"public",
"boolean",
"gotPong",
"(",
"PongResponse",
"pong",
")",
"{",
"if",
"(",
"_ping",
"==",
"null",
")",
"{",
"// an errant pong that is likely being processed late after",
"// a new connection was opened.",
"return",
"false",
";",
"}",
"// don't freak out if they keep... | Must be called when the pong response arrives back from the server.
@return true if we've iterated sufficiently many times to establish
a stable time delta estimate. | [
"Must",
"be",
"called",
"when",
"the",
"pong",
"response",
"arrives",
"back",
"from",
"the",
"server",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/DeltaCalculator.java#L71-L103 | train |
threerings/narya | core/src/main/java/com/threerings/presents/util/SafeSubscriber.java | SafeSubscriber.subscribe | public void subscribe (DObjectManager omgr)
{
if (_active) {
log.warning("Active safesub asked to resubscribe " + this + ".", new Exception());
return;
}
// note that we are now again in the "wishing to be subscribed" state
_active = true;
// make su... | java | public void subscribe (DObjectManager omgr)
{
if (_active) {
log.warning("Active safesub asked to resubscribe " + this + ".", new Exception());
return;
}
// note that we are now again in the "wishing to be subscribed" state
_active = true;
// make su... | [
"public",
"void",
"subscribe",
"(",
"DObjectManager",
"omgr",
")",
"{",
"if",
"(",
"_active",
")",
"{",
"log",
".",
"warning",
"(",
"\"Active safesub asked to resubscribe \"",
"+",
"this",
"+",
"\".\"",
",",
"new",
"Exception",
"(",
")",
")",
";",
"return",
... | Initiates the subscription process. | [
"Initiates",
"the",
"subscription",
"process",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/SafeSubscriber.java#L79-L112 | train |
threerings/narya | core/src/main/java/com/threerings/presents/util/SafeSubscriber.java | SafeSubscriber.unsubscribe | public void unsubscribe (DObjectManager omgr)
{
if (!_active) {
// we may be non-active and have no object which could mean
// that subscription failed; in which case we don't want to
// complain about anything, just quietly ignore the
// unsubscribe request
... | java | public void unsubscribe (DObjectManager omgr)
{
if (!_active) {
// we may be non-active and have no object which could mean
// that subscription failed; in which case we don't want to
// complain about anything, just quietly ignore the
// unsubscribe request
... | [
"public",
"void",
"unsubscribe",
"(",
"DObjectManager",
"omgr",
")",
"{",
"if",
"(",
"!",
"_active",
")",
"{",
"// we may be non-active and have no object which could mean",
"// that subscription failed; in which case we don't want to",
"// complain about anything, just quietly ignor... | Terminates the object subscription. If the initial subscription has
not yet completed, the desire to terminate will be noted and the
subscription will be terminated as soon as it completes. | [
"Terminates",
"the",
"object",
"subscription",
".",
"If",
"the",
"initial",
"subscription",
"has",
"not",
"yet",
"completed",
"the",
"desire",
"to",
"terminate",
"will",
"be",
"noted",
"and",
"the",
"subscription",
"will",
"be",
"terminated",
"as",
"soon",
"as... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/SafeSubscriber.java#L119-L163 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java | ChatHistory.clear | public void clear (final Name username)
{
// if we're holding this username for a session observer, postpone until after the current
// dispatch finishes
if (_holds.contains(username)) {
_holds.remove(username);
_omgr.postRunnable(new Runnable () {
pub... | java | public void clear (final Name username)
{
// if we're holding this username for a session observer, postpone until after the current
// dispatch finishes
if (_holds.contains(username)) {
_holds.remove(username);
_omgr.postRunnable(new Runnable () {
pub... | [
"public",
"void",
"clear",
"(",
"final",
"Name",
"username",
")",
"{",
"// if we're holding this username for a session observer, postpone until after the current",
"// dispatch finishes",
"if",
"(",
"_holds",
".",
"contains",
"(",
"username",
")",
")",
"{",
"_holds",
"."... | Clears the chat history for the specified user. | [
"Clears",
"the",
"chat",
"history",
"for",
"the",
"specified",
"user",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java#L121-L137 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java | ChatHistory.prune | protected void prune (long now, List<Entry> history)
{
int prunepos = 0;
for (int ll = history.size(); prunepos < ll; prunepos++) {
Entry entry = history.get(prunepos);
if (now - entry.message.timestamp < HISTORY_EXPIRATION) {
break; // stop when we get to the... | java | protected void prune (long now, List<Entry> history)
{
int prunepos = 0;
for (int ll = history.size(); prunepos < ll; prunepos++) {
Entry entry = history.get(prunepos);
if (now - entry.message.timestamp < HISTORY_EXPIRATION) {
break; // stop when we get to the... | [
"protected",
"void",
"prune",
"(",
"long",
"now",
",",
"List",
"<",
"Entry",
">",
"history",
")",
"{",
"int",
"prunepos",
"=",
"0",
";",
"for",
"(",
"int",
"ll",
"=",
"history",
".",
"size",
"(",
")",
";",
"prunepos",
"<",
"ll",
";",
"prunepos",
... | Prunes all messages from this history which are expired. | [
"Prunes",
"all",
"messages",
"from",
"this",
"history",
"which",
"are",
"expired",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatHistory.java#L196-L206 | train |
threerings/narya | core/src/main/java/com/threerings/presents/server/ClientResolver.java | ClientResolver.reportSuccess | protected void reportSuccess ()
{
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
ClientResolutionListener crl = _listeners.get(ii);
try {
// add a reference for each listener
_clobj.reference();
crl.clientResolved(_username, ... | java | protected void reportSuccess ()
{
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
ClientResolutionListener crl = _listeners.get(ii);
try {
// add a reference for each listener
_clobj.reference();
crl.clientResolved(_username, ... | [
"protected",
"void",
"reportSuccess",
"(",
")",
"{",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_listeners",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
"ii",
"++",
")",
"{",
"ClientResolutionListener",
"crl",
"=",
"_listeners",
".",
... | Reports success to our resolution listeners. | [
"Reports",
"success",
"to",
"our",
"resolution",
"listeners",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientResolver.java#L170-L182 | train |
threerings/narya | core/src/main/java/com/threerings/presents/server/ClientResolver.java | ClientResolver.reportFailure | protected void reportFailure (Exception cause)
{
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
ClientResolutionListener crl = _listeners.get(ii);
try {
crl.resolutionFailed(_username, cause);
} catch (Exception e) {
log.warning(... | java | protected void reportFailure (Exception cause)
{
for (int ii = 0, ll = _listeners.size(); ii < ll; ii++) {
ClientResolutionListener crl = _listeners.get(ii);
try {
crl.resolutionFailed(_username, cause);
} catch (Exception e) {
log.warning(... | [
"protected",
"void",
"reportFailure",
"(",
"Exception",
"cause",
")",
"{",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"ll",
"=",
"_listeners",
".",
"size",
"(",
")",
";",
"ii",
"<",
"ll",
";",
"ii",
"++",
")",
"{",
"ClientResolutionListener",
"crl",
"="... | Reports failure to our resolution listeners. | [
"Reports",
"failure",
"to",
"our",
"resolution",
"listeners",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ClientResolver.java#L187-L198 | train |
xbib/marc | src/main/java/org/xbib/marc/xml/MarcContentHandler.java | MarcContentHandler.setMarcListener | public MarcContentHandler setMarcListener(String type, MarcListener listener) {
this.listeners.put(type, listener);
return this;
} | java | public MarcContentHandler setMarcListener(String type, MarcListener listener) {
this.listeners.put(type, listener);
return this;
} | [
"public",
"MarcContentHandler",
"setMarcListener",
"(",
"String",
"type",
",",
"MarcListener",
"listener",
")",
"{",
"this",
".",
"listeners",
".",
"put",
"(",
"type",
",",
"listener",
")",
";",
"return",
"this",
";",
"}"
] | Set MARC listener for a specific record type.
@param type the record type
@param listener the MARC listener
@return this handler | [
"Set",
"MARC",
"listener",
"for",
"a",
"specific",
"record",
"type",
"."
] | d8426fcfc686507cab59b3d8181b08f83718418c | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/xml/MarcContentHandler.java#L101-L104 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.moveTo | public boolean moveTo (int placeId)
{
// make sure the placeId is valid
if (placeId < 0) {
log.warning("Refusing moveTo(): invalid placeId " + placeId + ".");
return false;
}
// first check to see if our observers are happy with this move request
if (... | java | public boolean moveTo (int placeId)
{
// make sure the placeId is valid
if (placeId < 0) {
log.warning("Refusing moveTo(): invalid placeId " + placeId + ".");
return false;
}
// first check to see if our observers are happy with this move request
if (... | [
"public",
"boolean",
"moveTo",
"(",
"int",
"placeId",
")",
"{",
"// make sure the placeId is valid",
"if",
"(",
"placeId",
"<",
"0",
")",
"{",
"log",
".",
"warning",
"(",
"\"Refusing moveTo(): invalid placeId \"",
"+",
"placeId",
"+",
"\".\"",
")",
";",
"return"... | Requests that this client be moved to the specified place. A request will be made and when
the response is received, the location observers will be notified of success or failure.
@return true if the move to request was issued, false if it was rejected by a location
observer or because we have another request outstand... | [
"Requests",
"that",
"this",
"client",
"be",
"moved",
"to",
"the",
"specified",
"place",
".",
"A",
"request",
"will",
"be",
"made",
"and",
"when",
"the",
"response",
"is",
"received",
"the",
"location",
"observers",
"will",
"be",
"notified",
"of",
"success",
... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L125-L182 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.leavePlace | public boolean leavePlace ()
{
if (_pendingPlaceId != -1) {
return false;
}
_lservice.leavePlace();
didLeavePlace();
// let our observers know that we're no longer in a location
_observers.apply(_didChangeOp);
return true;
} | java | public boolean leavePlace ()
{
if (_pendingPlaceId != -1) {
return false;
}
_lservice.leavePlace();
didLeavePlace();
// let our observers know that we're no longer in a location
_observers.apply(_didChangeOp);
return true;
} | [
"public",
"boolean",
"leavePlace",
"(",
")",
"{",
"if",
"(",
"_pendingPlaceId",
"!=",
"-",
"1",
")",
"{",
"return",
"false",
";",
"}",
"_lservice",
".",
"leavePlace",
"(",
")",
";",
"didLeavePlace",
"(",
")",
";",
"// let our observers know that we're no longe... | Issues a request to leave our current location.
@return true if we were able to leave, false if we are in the middle of moving somewhere and
can't yet leave. | [
"Issues",
"a",
"request",
"to",
"leave",
"our",
"current",
"location",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L207-L220 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.mayMoveTo | public boolean mayMoveTo (final int placeId, ResultListener<PlaceConfig> rl)
{
final boolean[] vetoed = new boolean[1];
_observers.apply(new ObserverOp<LocationObserver>() {
public boolean apply (LocationObserver obs) {
vetoed[0] = (vetoed[0] || !obs.locationMayChange(pla... | java | public boolean mayMoveTo (final int placeId, ResultListener<PlaceConfig> rl)
{
final boolean[] vetoed = new boolean[1];
_observers.apply(new ObserverOp<LocationObserver>() {
public boolean apply (LocationObserver obs) {
vetoed[0] = (vetoed[0] || !obs.locationMayChange(pla... | [
"public",
"boolean",
"mayMoveTo",
"(",
"final",
"int",
"placeId",
",",
"ResultListener",
"<",
"PlaceConfig",
">",
"rl",
")",
"{",
"final",
"boolean",
"[",
"]",
"vetoed",
"=",
"new",
"boolean",
"[",
"1",
"]",
";",
"_observers",
".",
"apply",
"(",
"new",
... | This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. In such situations, they should call this method before moving to a
new location to check to be sure that all of the registered location observers are amenable
to a location change.
@param placeId the p... | [
"This",
"can",
"be",
"called",
"by",
"cooperating",
"directors",
"that",
"need",
"to",
"coopt",
"the",
"moving",
"process",
"to",
"extend",
"it",
"in",
"some",
"way",
"or",
"other",
".",
"In",
"such",
"situations",
"they",
"should",
"call",
"this",
"method... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L233-L257 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.mayLeavePlace | protected void mayLeavePlace ()
{
if (_controller != null) {
try {
_controller.mayLeavePlace(_plobj);
} catch (Exception e) {
log.warning("Place controller choked in mayLeavePlace", "plobj", _plobj, e);
}
}
} | java | protected void mayLeavePlace ()
{
if (_controller != null) {
try {
_controller.mayLeavePlace(_plobj);
} catch (Exception e) {
log.warning("Place controller choked in mayLeavePlace", "plobj", _plobj, e);
}
}
} | [
"protected",
"void",
"mayLeavePlace",
"(",
")",
"{",
"if",
"(",
"_controller",
"!=",
"null",
")",
"{",
"try",
"{",
"_controller",
".",
"mayLeavePlace",
"(",
"_plobj",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
".",
"warning",
"(",
... | Called to inform our controller that we may be leaving the current place. | [
"Called",
"to",
"inform",
"our",
"controller",
"that",
"we",
"may",
"be",
"leaving",
"the",
"current",
"place",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L262-L271 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.didMoveTo | public void didMoveTo (int placeId, PlaceConfig config)
{
if (_moveListener != null) {
_moveListener.requestCompleted(config);
_moveListener = null;
}
// keep track of our previous place id
_previousPlaceId = _placeId;
// clear out our last request t... | java | public void didMoveTo (int placeId, PlaceConfig config)
{
if (_moveListener != null) {
_moveListener.requestCompleted(config);
_moveListener = null;
}
// keep track of our previous place id
_previousPlaceId = _placeId;
// clear out our last request t... | [
"public",
"void",
"didMoveTo",
"(",
"int",
"placeId",
",",
"PlaceConfig",
"config",
")",
"{",
"if",
"(",
"_moveListener",
"!=",
"null",
")",
"{",
"_moveListener",
".",
"requestCompleted",
"(",
"config",
")",
";",
"_moveListener",
"=",
"null",
";",
"}",
"//... | This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. In such situations, they will be responsible for receiving the
successful move response and they should let the location director know that the move has
been effected.
@param placeId the place oid of ou... | [
"This",
"can",
"be",
"called",
"by",
"cooperating",
"directors",
"that",
"need",
"to",
"coopt",
"the",
"moving",
"process",
"to",
"extend",
"it",
"in",
"some",
"way",
"or",
"other",
".",
"In",
"such",
"situations",
"they",
"will",
"be",
"responsible",
"for... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L282-L317 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.didLeavePlace | public void didLeavePlace ()
{
// unsubscribe from our old place object
if (_subber != null) {
_subber.unsubscribe(_ctx.getDObjectManager());
_subber = null;
}
// let the old controller know that things are going away
if (_plobj != null && _controller... | java | public void didLeavePlace ()
{
// unsubscribe from our old place object
if (_subber != null) {
_subber.unsubscribe(_ctx.getDObjectManager());
_subber = null;
}
// let the old controller know that things are going away
if (_plobj != null && _controller... | [
"public",
"void",
"didLeavePlace",
"(",
")",
"{",
"// unsubscribe from our old place object",
"if",
"(",
"_subber",
"!=",
"null",
")",
"{",
"_subber",
".",
"unsubscribe",
"(",
"_ctx",
".",
"getDObjectManager",
"(",
")",
")",
";",
"_subber",
"=",
"null",
";",
... | Called when we're leaving our current location. Informs the location's controller that we're
departing, unsubscribes from the location's place object, and clears out our internal place
information. | [
"Called",
"when",
"we",
"re",
"leaving",
"our",
"current",
"location",
".",
"Informs",
"the",
"location",
"s",
"controller",
"that",
"we",
"re",
"departing",
"unsubscribes",
"from",
"the",
"location",
"s",
"place",
"object",
"and",
"clears",
"out",
"our",
"i... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L324-L345 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.failedToMoveTo | public void failedToMoveTo (int placeId, String reason)
{
if (_moveListener != null) {
_moveListener.requestFailed(new MoveFailedException(reason));
_moveListener = null;
}
// clear out our last request time
_lastRequestTime = 0;
// let our observers... | java | public void failedToMoveTo (int placeId, String reason)
{
if (_moveListener != null) {
_moveListener.requestFailed(new MoveFailedException(reason));
_moveListener = null;
}
// clear out our last request time
_lastRequestTime = 0;
// let our observers... | [
"public",
"void",
"failedToMoveTo",
"(",
"int",
"placeId",
",",
"String",
"reason",
")",
"{",
"if",
"(",
"_moveListener",
"!=",
"null",
")",
"{",
"_moveListener",
".",
"requestFailed",
"(",
"new",
"MoveFailedException",
"(",
"reason",
")",
")",
";",
"_moveLi... | This can be called by cooperating directors that need to coopt the moving process to extend
it in some way or other. If the coopted move request fails, this failure can be propagated
to the location observers if appropriate.
@param placeId the place oid to which we failed to move.
@param reason the reason code given f... | [
"This",
"can",
"be",
"called",
"by",
"cooperating",
"directors",
"that",
"need",
"to",
"coopt",
"the",
"moving",
"process",
"to",
"extend",
"it",
"in",
"some",
"way",
"or",
"other",
".",
"If",
"the",
"coopted",
"move",
"request",
"fails",
"this",
"failure"... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L355-L367 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.checkRepeatMove | public boolean checkRepeatMove ()
{
long now = System.currentTimeMillis();
if (now - _lastRequestTime < STALE_REQUEST_DURATION) {
return true;
} else {
_lastRequestTime = now;
return false;
}
} | java | public boolean checkRepeatMove ()
{
long now = System.currentTimeMillis();
if (now - _lastRequestTime < STALE_REQUEST_DURATION) {
return true;
} else {
_lastRequestTime = now;
return false;
}
} | [
"public",
"boolean",
"checkRepeatMove",
"(",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"now",
"-",
"_lastRequestTime",
"<",
"STALE_REQUEST_DURATION",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"_las... | Called to test and set a time stamp that we use to determine if a pending moveTo request is
stale. | [
"Called",
"to",
"test",
"and",
"set",
"a",
"time",
"stamp",
"that",
"we",
"use",
"to",
"determine",
"if",
"a",
"pending",
"moveTo",
"request",
"is",
"stale",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L373-L383 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.setFailureHandler | public void setFailureHandler (FailureHandler handler)
{
if (_failureHandler != null) {
log.warning("Requested to set failure handler, but we've already got one. The " +
"conflicting entities will likely need to perform more sophisticated " +
"coor... | java | public void setFailureHandler (FailureHandler handler)
{
if (_failureHandler != null) {
log.warning("Requested to set failure handler, but we've already got one. The " +
"conflicting entities will likely need to perform more sophisticated " +
"coor... | [
"public",
"void",
"setFailureHandler",
"(",
"FailureHandler",
"handler",
")",
"{",
"if",
"(",
"_failureHandler",
"!=",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Requested to set failure handler, but we've already got one. The \"",
"+",
"\"conflicting entities will li... | Sets the failure handler which will recover from place object fetching failures. In the
event that we are unable to fetch our place object after making a successful moveTo request,
we attempt to rectify the failure by moving back to the last known working location. Because
entites that cooperate with the location direc... | [
"Sets",
"the",
"failure",
"handler",
"which",
"will",
"recover",
"from",
"place",
"object",
"fetching",
"failures",
".",
"In",
"the",
"event",
"that",
"we",
"are",
"unable",
"to",
"fetch",
"our",
"place",
"object",
"after",
"making",
"a",
"successful",
"move... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L527-L538 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.removeGlobals | public void removeGlobals ()
{
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (name.indexOf('.') == -1) {
i.remove();
} else if (name.startsWith("java.lang")) {
i.remove();
}
... | java | public void removeGlobals ()
{
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (name.indexOf('.') == -1) {
i.remove();
} else if (name.startsWith("java.lang")) {
i.remove();
}
... | [
"public",
"void",
"removeGlobals",
"(",
")",
"{",
"Iterator",
"<",
"String",
">",
"i",
"=",
"_imports",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"name",
"=",
"i",
".",
"next",
"(",
")",
";",... | Gets rid of primitive and java.lang imports. | [
"Gets",
"rid",
"of",
"primitive",
"and",
"java",
".",
"lang",
"imports",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L117-L128 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.removeSamePackage | public void removeSamePackage (String pkg)
{
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (name.startsWith(pkg) &&
name.indexOf('.', pkg.length() + 1) == -1) {
i.remove();
}
... | java | public void removeSamePackage (String pkg)
{
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (name.startsWith(pkg) &&
name.indexOf('.', pkg.length() + 1) == -1) {
i.remove();
}
... | [
"public",
"void",
"removeSamePackage",
"(",
"String",
"pkg",
")",
"{",
"Iterator",
"<",
"String",
">",
"i",
"=",
"_imports",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"name",
"=",
"i",
".",
"ne... | Remove all classes that are in the same package.
@param pkg package to remove | [
"Remove",
"all",
"classes",
"that",
"are",
"in",
"the",
"same",
"package",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L142-L152 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.translateClassArrays | public void translateClassArrays ()
{
ImportSet arrayTypes = new ImportSet();
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
int bracket = name.lastIndexOf('[');
if (bracket != -1 &&
name.charAt(brac... | java | public void translateClassArrays ()
{
ImportSet arrayTypes = new ImportSet();
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
int bracket = name.lastIndexOf('[');
if (bracket != -1 &&
name.charAt(brac... | [
"public",
"void",
"translateClassArrays",
"(",
")",
"{",
"ImportSet",
"arrayTypes",
"=",
"new",
"ImportSet",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"i",
"=",
"_imports",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")... | Inserts imports for the non-primitive classes contained in all array imports. | [
"Inserts",
"imports",
"for",
"the",
"non",
"-",
"primitive",
"classes",
"contained",
"in",
"all",
"array",
"imports",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L196-L210 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.popIn | public void popIn ()
{
String front = _pushed.remove(_pushed.size() - 1);
if (front != null) {
_imports.add(front);
}
} | java | public void popIn ()
{
String front = _pushed.remove(_pushed.size() - 1);
if (front != null) {
_imports.add(front);
}
} | [
"public",
"void",
"popIn",
"(",
")",
"{",
"String",
"front",
"=",
"_pushed",
".",
"remove",
"(",
"_pushed",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"if",
"(",
"front",
"!=",
"null",
")",
"{",
"_imports",
".",
"add",
"(",
"front",
")",
";",
"... | Re-adds the most recently popped import to the set. If a null value was pushed, does
nothing.
@throws IndexOutOfBoundsException if there is nothing to pop | [
"Re",
"-",
"adds",
"the",
"most",
"recently",
"popped",
"import",
"to",
"the",
"set",
".",
"If",
"a",
"null",
"value",
"was",
"pushed",
"does",
"nothing",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L238-L244 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.replace | public void replace (String... replace)
{
HashSet<String> toAdd = Sets.newHashSet();
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
for (int j = 0; j < replace.length; j += 2) {
if (name.equals(replace[j])) {
... | java | public void replace (String... replace)
{
HashSet<String> toAdd = Sets.newHashSet();
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
for (int j = 0; j < replace.length; j += 2) {
if (name.equals(replace[j])) {
... | [
"public",
"void",
"replace",
"(",
"String",
"...",
"replace",
")",
"{",
"HashSet",
"<",
"String",
">",
"toAdd",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
"Iterator",
"<",
"String",
">",
"i",
"=",
"_imports",
".",
"iterator",
"(",
")",
";",
"whil... | Replaces any import exactly each find string with the corresponding replace string.
See the description above.
@param replace array of pairs for search/replace | [
"Replaces",
"any",
"import",
"exactly",
"each",
"find",
"string",
"with",
"the",
"corresponding",
"replace",
"string",
".",
"See",
"the",
"description",
"above",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L265-L280 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.removeAll | public int removeAll (String pattern)
{
Pattern pat = makePattern(pattern);
int removed = 0;
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (pat.matcher(name).matches()) {
i.remove();
... | java | public int removeAll (String pattern)
{
Pattern pat = makePattern(pattern);
int removed = 0;
Iterator<String> i = _imports.iterator();
while (i.hasNext()) {
String name = i.next();
if (pat.matcher(name).matches()) {
i.remove();
... | [
"public",
"int",
"removeAll",
"(",
"String",
"pattern",
")",
"{",
"Pattern",
"pat",
"=",
"makePattern",
"(",
"pattern",
")",
";",
"int",
"removed",
"=",
"0",
";",
"Iterator",
"<",
"String",
">",
"i",
"=",
"_imports",
".",
"iterator",
"(",
")",
";",
"... | Remove all imports matching the given pattern.
@param pattern the dumbed down regex to match (see description above)
@return the number of imports removed | [
"Remove",
"all",
"imports",
"matching",
"the",
"given",
"pattern",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L297-L310 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.toGroups | public List<List<String>> toGroups ()
{
List<String> list = Lists.newArrayList(_imports);
Collections.sort(list, new Comparator<String>() {
public int compare (String class1, String class2) {
return ComparisonChain.start()
.compare(findImportGroup(clas... | java | public List<List<String>> toGroups ()
{
List<String> list = Lists.newArrayList(_imports);
Collections.sort(list, new Comparator<String>() {
public int compare (String class1, String class2) {
return ComparisonChain.start()
.compare(findImportGroup(clas... | [
"public",
"List",
"<",
"List",
"<",
"String",
">",
">",
"toGroups",
"(",
")",
"{",
"List",
"<",
"String",
">",
"list",
"=",
"Lists",
".",
"newArrayList",
"(",
"_imports",
")",
";",
"Collections",
".",
"sort",
"(",
"list",
",",
"new",
"Comparator",
"<... | Converts the set of imports to groups of class names, according to conventional package
ordering and spacing. Within each group, sorting is alphabetical. | [
"Converts",
"the",
"set",
"of",
"imports",
"to",
"groups",
"of",
"class",
"names",
"according",
"to",
"conventional",
"package",
"ordering",
"and",
"spacing",
".",
"Within",
"each",
"group",
"sorting",
"is",
"alphabetical",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L341-L366 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.toList | public List<String> toList ()
{
ComparableArrayList<String> list = new ComparableArrayList<String>();
list.addAll(_imports);
list.sort();
return list;
} | java | public List<String> toList ()
{
ComparableArrayList<String> list = new ComparableArrayList<String>();
list.addAll(_imports);
list.sort();
return list;
} | [
"public",
"List",
"<",
"String",
">",
"toList",
"(",
")",
"{",
"ComparableArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ComparableArrayList",
"<",
"String",
">",
"(",
")",
";",
"list",
".",
"addAll",
"(",
"_imports",
")",
";",
"list",
".",
"sort... | Convert the set of imports to a sorted list, ready to be output to a generated file.
@return the sorted list of imports | [
"Convert",
"the",
"set",
"of",
"imports",
"to",
"a",
"sorted",
"list",
"ready",
"to",
"be",
"output",
"to",
"a",
"generated",
"file",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L372-L378 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.findImportGroup | protected int findImportGroup (String imp)
{
int bestGroup = -1;
int bestPrefixLength = -1;
int ii = -1;
for (String prefix : getImportGroups()) {
ii++;
if (!imp.startsWith(prefix)) {
continue;
}
if (prefix.length() > be... | java | protected int findImportGroup (String imp)
{
int bestGroup = -1;
int bestPrefixLength = -1;
int ii = -1;
for (String prefix : getImportGroups()) {
ii++;
if (!imp.startsWith(prefix)) {
continue;
}
if (prefix.length() > be... | [
"protected",
"int",
"findImportGroup",
"(",
"String",
"imp",
")",
"{",
"int",
"bestGroup",
"=",
"-",
"1",
";",
"int",
"bestPrefixLength",
"=",
"-",
"1",
";",
"int",
"ii",
"=",
"-",
"1",
";",
"for",
"(",
"String",
"prefix",
":",
"getImportGroups",
"(",
... | Find the index of the best import group to use for the specified import. | [
"Find",
"the",
"index",
"of",
"the",
"best",
"import",
"group",
"to",
"use",
"for",
"the",
"specified",
"import",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L389-L405 | train |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/ImportSet.java | ImportSet.makePattern | protected static Pattern makePattern (String input)
{
StringBuilder pattern = new StringBuilder('^');
while (true) {
String[] parts = _splitter.split(input, 2);
pattern.append(Pattern.quote(parts[0]));
if (parts.length == 1) {
break;
}... | java | protected static Pattern makePattern (String input)
{
StringBuilder pattern = new StringBuilder('^');
while (true) {
String[] parts = _splitter.split(input, 2);
pattern.append(Pattern.quote(parts[0]));
if (parts.length == 1) {
break;
}... | [
"protected",
"static",
"Pattern",
"makePattern",
"(",
"String",
"input",
")",
"{",
"StringBuilder",
"pattern",
"=",
"new",
"StringBuilder",
"(",
"'",
"'",
")",
";",
"while",
"(",
"true",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"_splitter",
".",
"spli... | Create a real regular expression from the dumbed down input.
@param input the dumbed down wildcard expression
@return the calculated regular expression | [
"Create",
"a",
"real",
"regular",
"expression",
"from",
"the",
"dumbed",
"down",
"input",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/ImportSet.java#L420-L442 | train |
threerings/narya | core/src/main/java/com/threerings/presents/util/ClassUtil.java | ClassUtil.getMethod | public static Method getMethod (String name, Object target, Map<String, Method> cache)
{
Class<?> tclass = target.getClass();
String key = tclass.getName() + ":" + name;
Method method = cache.get(key);
if (method == null) {
method = findMethod(tclass, name);
... | java | public static Method getMethod (String name, Object target, Map<String, Method> cache)
{
Class<?> tclass = target.getClass();
String key = tclass.getName() + ":" + name;
Method method = cache.get(key);
if (method == null) {
method = findMethod(tclass, name);
... | [
"public",
"static",
"Method",
"getMethod",
"(",
"String",
"name",
",",
"Object",
"target",
",",
"Map",
"<",
"String",
",",
"Method",
">",
"cache",
")",
"{",
"Class",
"<",
"?",
">",
"tclass",
"=",
"target",
".",
"getClass",
"(",
")",
";",
"String",
"k... | Locates and returns the first method in the supplied class whose name is equal to the
specified name. If a method is located, it will be cached in the supplied cache so that
subsequent requests will immediately return the method from the cache rather than
re-reflecting.
@return the method with the specified name or nu... | [
"Locates",
"and",
"returns",
"the",
"first",
"method",
"in",
"the",
"supplied",
"class",
"whose",
"name",
"is",
"equal",
"to",
"the",
"specified",
"name",
".",
"If",
"a",
"method",
"is",
"located",
"it",
"will",
"be",
"cached",
"in",
"the",
"supplied",
"... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/ClassUtil.java#L46-L60 | train |
threerings/narya | core/src/main/java/com/threerings/presents/util/ClassUtil.java | ClassUtil.getMethod | public static Method getMethod (String name, Object target, Object[] args)
{
Class<?> tclass = target.getClass();
Method meth = null;
try {
MethodFinder finder = new MethodFinder(tclass);
meth = finder.findMethod(name, args);
} catch (NoSuchMethodException n... | java | public static Method getMethod (String name, Object target, Object[] args)
{
Class<?> tclass = target.getClass();
Method meth = null;
try {
MethodFinder finder = new MethodFinder(tclass);
meth = finder.findMethod(name, args);
} catch (NoSuchMethodException n... | [
"public",
"static",
"Method",
"getMethod",
"(",
"String",
"name",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Class",
"<",
"?",
">",
"tclass",
"=",
"target",
".",
"getClass",
"(",
")",
";",
"Method",
"meth",
"=",
"null",
";",... | Looks up the method on the specified object that has a signature that matches the supplied
arguments array. This is very expensive, so you shouldn't be doing this for something that
happens frequently.
@return the best matching method with the specified name that accepts the supplied
arguments, or null if no method co... | [
"Looks",
"up",
"the",
"method",
"on",
"the",
"specified",
"object",
"that",
"has",
"a",
"signature",
"that",
"matches",
"the",
"supplied",
"arguments",
"array",
".",
"This",
"is",
"very",
"expensive",
"so",
"you",
"shouldn",
"t",
"be",
"doing",
"this",
"fo... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/ClassUtil.java#L72-L91 | train |
threerings/narya | core/src/main/java/com/threerings/presents/util/ClassUtil.java | ClassUtil.findMethod | public static Method findMethod (Class<?> clazz, String name)
{
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(name)) {
return method;
}
}
return null;
} | java | public static Method findMethod (Class<?> clazz, String name)
{
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(name)) {
return method;
}
}
return null;
} | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"methods",
")",
"{"... | Locates and returns the first method in the supplied class whose name is equal to the
specified name.
@return the method with the specified name or null if no method with that name could be
found. | [
"Locates",
"and",
"returns",
"the",
"first",
"method",
"in",
"the",
"supplied",
"class",
"whose",
"name",
"is",
"equal",
"to",
"the",
"specified",
"name",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/ClassUtil.java#L100-L109 | train |
threerings/narya | core/src/main/java/com/threerings/presents/server/Authenticator.java | Authenticator.authenticateConnection | public void authenticateConnection (Invoker invoker, final AuthingConnection conn,
final ResultListener<AuthingConnection> onComplete)
{
final AuthRequest req = conn.getAuthRequest();
final AuthResponseData rdata = createResponseData();
final AuthRespo... | java | public void authenticateConnection (Invoker invoker, final AuthingConnection conn,
final ResultListener<AuthingConnection> onComplete)
{
final AuthRequest req = conn.getAuthRequest();
final AuthResponseData rdata = createResponseData();
final AuthRespo... | [
"public",
"void",
"authenticateConnection",
"(",
"Invoker",
"invoker",
",",
"final",
"AuthingConnection",
"conn",
",",
"final",
"ResultListener",
"<",
"AuthingConnection",
">",
"onComplete",
")",
"{",
"final",
"AuthRequest",
"req",
"=",
"conn",
".",
"getAuthRequest"... | Called by the connection management code when an authenticating connection has received its
authentication request from the client. | [
"Called",
"by",
"the",
"connection",
"management",
"code",
"when",
"an",
"authenticating",
"connection",
"has",
"received",
"its",
"authentication",
"request",
"from",
"the",
"client",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/Authenticator.java#L57-L98 | train |
xbib/marc | src/main/java/org/xbib/marc/io/ScanBuffer.java | ScanBuffer.append | public int append(int newByte) {
int old = buffer2[pos];
buffer2[pos] = newByte;
buffer[pos] = cs ? (char) newByte : Character.toLowerCase((char) newByte);
pos = (++pos < buffer.length) ? pos : 0;
return old;
} | java | public int append(int newByte) {
int old = buffer2[pos];
buffer2[pos] = newByte;
buffer[pos] = cs ? (char) newByte : Character.toLowerCase((char) newByte);
pos = (++pos < buffer.length) ? pos : 0;
return old;
} | [
"public",
"int",
"append",
"(",
"int",
"newByte",
")",
"{",
"int",
"old",
"=",
"buffer2",
"[",
"pos",
"]",
";",
"buffer2",
"[",
"pos",
"]",
"=",
"newByte",
";",
"buffer",
"[",
"pos",
"]",
"=",
"cs",
"?",
"(",
"char",
")",
"newByte",
":",
"Charact... | Append byte.
@param newByte the byte
@return old byte | [
"Append",
"byte",
"."
] | d8426fcfc686507cab59b3d8181b08f83718418c | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/ScanBuffer.java#L101-L107 | train |
xbib/marc | src/main/java/org/xbib/marc/io/ScanBuffer.java | ScanBuffer.hasData | public boolean hasData() {
int apos = token.length - 1;
int rpos = pos - 1;
for (; rpos > -1 && apos > -1; rpos--, apos--) {
if (buffer2[rpos] != -1) {
return true;
}
}
for (rpos = buffer2.length - 1; apos > -1; rpos--, apos--) {
... | java | public boolean hasData() {
int apos = token.length - 1;
int rpos = pos - 1;
for (; rpos > -1 && apos > -1; rpos--, apos--) {
if (buffer2[rpos] != -1) {
return true;
}
}
for (rpos = buffer2.length - 1; apos > -1; rpos--, apos--) {
... | [
"public",
"boolean",
"hasData",
"(",
")",
"{",
"int",
"apos",
"=",
"token",
".",
"length",
"-",
"1",
";",
"int",
"rpos",
"=",
"pos",
"-",
"1",
";",
"for",
"(",
";",
"rpos",
">",
"-",
"1",
"&&",
"apos",
">",
"-",
"1",
";",
"rpos",
"--",
",",
... | Has scan buffer any data?
@return true if it has data | [
"Has",
"scan",
"buffer",
"any",
"data?"
] | d8426fcfc686507cab59b3d8181b08f83718418c | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/ScanBuffer.java#L139-L153 | train |
xbib/marc | src/main/java/org/xbib/marc/io/ScanBuffer.java | ScanBuffer.clear | public void clear(int i) {
char ch = (char) -1;
int apos = i - 1;
int rpos = pos - 1;
for (; rpos > -1 && apos > -1; rpos--, apos--) {
buffer[rpos] = ch;
buffer2[rpos] = -1;
}
for (rpos = buffer.length - 1; apos > -1; rpos--, apos--) {
... | java | public void clear(int i) {
char ch = (char) -1;
int apos = i - 1;
int rpos = pos - 1;
for (; rpos > -1 && apos > -1; rpos--, apos--) {
buffer[rpos] = ch;
buffer2[rpos] = -1;
}
for (rpos = buffer.length - 1; apos > -1; rpos--, apos--) {
... | [
"public",
"void",
"clear",
"(",
"int",
"i",
")",
"{",
"char",
"ch",
"=",
"(",
"char",
")",
"-",
"1",
";",
"int",
"apos",
"=",
"i",
"-",
"1",
";",
"int",
"rpos",
"=",
"pos",
"-",
"1",
";",
"for",
"(",
";",
"rpos",
">",
"-",
"1",
"&&",
"apo... | Clear scan buffer at position.
@param i the position | [
"Clear",
"scan",
"buffer",
"at",
"position",
"."
] | d8426fcfc686507cab59b3d8181b08f83718418c | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/ScanBuffer.java#L159-L171 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/data/LocationMarshaller.java | LocationMarshaller.moveTo | public void moveTo (int arg1, LocationService.MoveListener arg2)
{
LocationMarshaller.MoveMarshaller listener2 = new LocationMarshaller.MoveMarshaller();
listener2.listener = arg2;
sendRequest(MOVE_TO, new Object[] {
Integer.valueOf(arg1), listener2
});
} | java | public void moveTo (int arg1, LocationService.MoveListener arg2)
{
LocationMarshaller.MoveMarshaller listener2 = new LocationMarshaller.MoveMarshaller();
listener2.listener = arg2;
sendRequest(MOVE_TO, new Object[] {
Integer.valueOf(arg1), listener2
});
} | [
"public",
"void",
"moveTo",
"(",
"int",
"arg1",
",",
"LocationService",
".",
"MoveListener",
"arg2",
")",
"{",
"LocationMarshaller",
".",
"MoveMarshaller",
"listener2",
"=",
"new",
"LocationMarshaller",
".",
"MoveMarshaller",
"(",
")",
";",
"listener2",
".",
"li... | from interface LocationService | [
"from",
"interface",
"LocationService"
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/data/LocationMarshaller.java#L89-L96 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/SpeakHandler.java | SpeakHandler.speak | public void speak (ClientObject caller, String message, byte mode)
{
// ensure that the caller has normal chat privileges
BodyObject source = (_locator != null) ? _locator.forClient(caller) :
(BodyObject) caller;
String errmsg = source.checkAccess(ChatCodes.CHAT_ACCESS, null);
... | java | public void speak (ClientObject caller, String message, byte mode)
{
// ensure that the caller has normal chat privileges
BodyObject source = (_locator != null) ? _locator.forClient(caller) :
(BodyObject) caller;
String errmsg = source.checkAccess(ChatCodes.CHAT_ACCESS, null);
... | [
"public",
"void",
"speak",
"(",
"ClientObject",
"caller",
",",
"String",
"message",
",",
"byte",
"mode",
")",
"{",
"// ensure that the caller has normal chat privileges",
"BodyObject",
"source",
"=",
"(",
"_locator",
"!=",
"null",
")",
"?",
"_locator",
".",
"forCl... | from interface SpeakProvider | [
"from",
"interface",
"SpeakProvider"
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakHandler.java#L87-L114 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/server/SpeakHandler.java | SpeakHandler.sendSpeak | protected void sendSpeak (BodyObject source, String message, byte mode)
{
SpeakUtil.sendSpeak(_speakObj, source.getVisibleName(), null, message, mode);
} | java | protected void sendSpeak (BodyObject source, String message, byte mode)
{
SpeakUtil.sendSpeak(_speakObj, source.getVisibleName(), null, message, mode);
} | [
"protected",
"void",
"sendSpeak",
"(",
"BodyObject",
"source",
",",
"String",
"message",
",",
"byte",
"mode",
")",
"{",
"SpeakUtil",
".",
"sendSpeak",
"(",
"_speakObj",
",",
"source",
".",
"getVisibleName",
"(",
")",
",",
"null",
",",
"message",
",",
"mode... | Sends the actual speak message. | [
"Sends",
"the",
"actual",
"speak",
"message",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakHandler.java#L119-L122 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentSimplifiedTokenBIOAnnotator.java | ArgumentSimplifiedTokenBIOAnnotator.selectMainArgumentComponent | protected ArgumentComponent selectMainArgumentComponent(
List<ArgumentComponent> argumentComponents)
{
ArgumentComponent result = null;
int maxLength = Integer.MIN_VALUE;
for (ArgumentComponent argumentComponent : argumentComponents) {
int length = argumentComponent.... | java | protected ArgumentComponent selectMainArgumentComponent(
List<ArgumentComponent> argumentComponents)
{
ArgumentComponent result = null;
int maxLength = Integer.MIN_VALUE;
for (ArgumentComponent argumentComponent : argumentComponents) {
int length = argumentComponent.... | [
"protected",
"ArgumentComponent",
"selectMainArgumentComponent",
"(",
"List",
"<",
"ArgumentComponent",
">",
"argumentComponents",
")",
"{",
"ArgumentComponent",
"result",
"=",
"null",
";",
"int",
"maxLength",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"for",
"(",
"Argu... | Selects the main argument component from a list of components that are present in the
sentence; currently the longest
@param argumentComponents list of argument components
@return argument component | [
"Selects",
"the",
"main",
"argument",
"component",
"from",
"a",
"list",
"of",
"components",
"that",
"are",
"present",
"in",
"the",
"sentence",
";",
"currently",
"the",
"longest"
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-preprocessing/src/main/java/org/dkpro/argumentation/preprocessing/annotation/ArgumentSimplifiedTokenBIOAnnotator.java#L236-L256 | train |
threerings/narya | core/src/main/java/com/threerings/presents/server/InvocationException.java | InvocationException.requireAccess | public static void requireAccess (ClientObject clobj, Permission perm, Object context)
throws InvocationException
{
String errmsg = clobj.checkAccess(perm, context);
if (errmsg != null) {
throw new InvocationException(errmsg);
}
} | java | public static void requireAccess (ClientObject clobj, Permission perm, Object context)
throws InvocationException
{
String errmsg = clobj.checkAccess(perm, context);
if (errmsg != null) {
throw new InvocationException(errmsg);
}
} | [
"public",
"static",
"void",
"requireAccess",
"(",
"ClientObject",
"clobj",
",",
"Permission",
"perm",
",",
"Object",
"context",
")",
"throws",
"InvocationException",
"{",
"String",
"errmsg",
"=",
"clobj",
".",
"checkAccess",
"(",
"perm",
",",
"context",
")",
"... | Requires that the specified client have the specified permissions.
@throws InvocationException if they do not. | [
"Requires",
"that",
"the",
"specified",
"client",
"have",
"the",
"specified",
"permissions",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/InvocationException.java#L39-L46 | train |
threerings/narya | core/src/main/java/com/threerings/io/ArrayMask.java | ArrayMask.writeTo | public void writeTo (ObjectOutputStream out)
throws IOException
{
out.writeShort(_mask.length);
out.write(_mask);
} | java | public void writeTo (ObjectOutputStream out)
throws IOException
{
out.writeShort(_mask.length);
out.write(_mask);
} | [
"public",
"void",
"writeTo",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeShort",
"(",
"_mask",
".",
"length",
")",
";",
"out",
".",
"write",
"(",
"_mask",
")",
";",
"}"
] | Writes this mask to the specified output stream. | [
"Writes",
"this",
"mask",
"to",
"the",
"specified",
"output",
"stream",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ArrayMask.java#L71-L76 | train |
threerings/narya | core/src/main/java/com/threerings/io/ArrayMask.java | ArrayMask.readFrom | public void readFrom (ObjectInputStream in)
throws IOException
{
int length = in.readShort();
_mask = new byte[length];
in.read(_mask);
} | java | public void readFrom (ObjectInputStream in)
throws IOException
{
int length = in.readShort();
_mask = new byte[length];
in.read(_mask);
} | [
"public",
"void",
"readFrom",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
"{",
"int",
"length",
"=",
"in",
".",
"readShort",
"(",
")",
";",
"_mask",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"in",
".",
"read",
"(",
"_mask",
")",
... | Reads this mask from the specified input stream. | [
"Reads",
"this",
"mask",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ArrayMask.java#L81-L87 | train |
threerings/narya | core/src/main/java/com/threerings/nio/conman/Connection.java | Connection.init | public void init (ConnectionManager cmgr, SocketChannel channel, long createStamp)
throws IOException
{
_cmgr = cmgr;
_channel = channel;
_lastEvent = createStamp;
_connectionId = ++_lastConnectionId;
} | java | public void init (ConnectionManager cmgr, SocketChannel channel, long createStamp)
throws IOException
{
_cmgr = cmgr;
_channel = channel;
_lastEvent = createStamp;
_connectionId = ++_lastConnectionId;
} | [
"public",
"void",
"init",
"(",
"ConnectionManager",
"cmgr",
",",
"SocketChannel",
"channel",
",",
"long",
"createStamp",
")",
"throws",
"IOException",
"{",
"_cmgr",
"=",
"cmgr",
";",
"_channel",
"=",
"channel",
";",
"_lastEvent",
"=",
"createStamp",
";",
"_con... | Initializes a connection object with a socket and related info.
@param cmgr The connection manager with which this connection is associated.
@param channel The socket channel from which we'll be reading messages.
@param createStamp The time at which this connection was created. | [
"Initializes",
"a",
"connection",
"object",
"with",
"a",
"socket",
"and",
"related",
"info",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/Connection.java#L47-L54 | train |
threerings/narya | core/src/main/java/com/threerings/nio/conman/Connection.java | Connection.networkFailure | public void networkFailure (IOException ioe)
{
// if we're already closed, then something is seriously funny
if (isClosed()) {
log.warning("Failure reported on closed connection " + this + ".", new Exception());
return;
}
// let the connection manager know we... | java | public void networkFailure (IOException ioe)
{
// if we're already closed, then something is seriously funny
if (isClosed()) {
log.warning("Failure reported on closed connection " + this + ".", new Exception());
return;
}
// let the connection manager know we... | [
"public",
"void",
"networkFailure",
"(",
"IOException",
"ioe",
")",
"{",
"// if we're already closed, then something is seriously funny",
"if",
"(",
"isClosed",
"(",
")",
")",
"{",
"log",
".",
"warning",
"(",
"\"Failure reported on closed connection \"",
"+",
"this",
"+... | Called when there is a failure reading or writing to this connection. We notify the
connection manager and close ourselves down. | [
"Called",
"when",
"there",
"is",
"a",
"failure",
"reading",
"or",
"writing",
"to",
"this",
"connection",
".",
"We",
"notify",
"the",
"connection",
"manager",
"and",
"close",
"ourselves",
"down",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/Connection.java#L131-L144 | train |
threerings/narya | core/src/main/java/com/threerings/nio/conman/Connection.java | Connection.checkIdle | public boolean checkIdle (long idleStamp)
{
if (_lastEvent > idleStamp) {
return false;
}
if (!isClosed()) {
log.info("Disconnecting non-communicative client",
"conn", this, "idle", (System.currentTimeMillis() - _lastEvent) + "ms");
}
... | java | public boolean checkIdle (long idleStamp)
{
if (_lastEvent > idleStamp) {
return false;
}
if (!isClosed()) {
log.info("Disconnecting non-communicative client",
"conn", this, "idle", (System.currentTimeMillis() - _lastEvent) + "ms");
}
... | [
"public",
"boolean",
"checkIdle",
"(",
"long",
"idleStamp",
")",
"{",
"if",
"(",
"_lastEvent",
">",
"idleStamp",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"isClosed",
"(",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Disconnecting non-communic... | from interface NetEventHandler | [
"from",
"interface",
"NetEventHandler"
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/Connection.java#L147-L157 | train |
threerings/narya | core/src/main/java/com/threerings/nio/conman/Connection.java | Connection.closeSocket | protected void closeSocket ()
{
if (_channel == null) {
return;
}
log.debug("Closing channel " + this + ".");
try {
_channel.close();
} catch (IOException ioe) {
log.warning("Error closing connection", "conn", this, "error", ioe);
... | java | protected void closeSocket ()
{
if (_channel == null) {
return;
}
log.debug("Closing channel " + this + ".");
try {
_channel.close();
} catch (IOException ioe) {
log.warning("Error closing connection", "conn", this, "error", ioe);
... | [
"protected",
"void",
"closeSocket",
"(",
")",
"{",
"if",
"(",
"_channel",
"==",
"null",
")",
"{",
"return",
";",
"}",
"log",
".",
"debug",
"(",
"\"Closing channel \"",
"+",
"this",
"+",
"\".\"",
")",
";",
"try",
"{",
"_channel",
".",
"close",
"(",
")... | Closes the socket associated with this connection. This happens when we receive EOF, are
requested to close down or when our connection fails. | [
"Closes",
"the",
"socket",
"associated",
"with",
"this",
"connection",
".",
"This",
"happens",
"when",
"we",
"receive",
"EOF",
"are",
"requested",
"to",
"close",
"down",
"or",
"when",
"our",
"connection",
"fails",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/nio/conman/Connection.java#L175-L190 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.checkToken | public String checkToken (BureauCredentials creds)
{
Bureau bureau = _bureaus.get(creds.clientId);
if (bureau == null) {
return "Bureau " + creds.clientId + " not found";
}
if (bureau.clientObj != null) {
return "Bureau " + creds.clientId + " already logged in... | java | public String checkToken (BureauCredentials creds)
{
Bureau bureau = _bureaus.get(creds.clientId);
if (bureau == null) {
return "Bureau " + creds.clientId + " not found";
}
if (bureau.clientObj != null) {
return "Bureau " + creds.clientId + " already logged in... | [
"public",
"String",
"checkToken",
"(",
"BureauCredentials",
"creds",
")",
"{",
"Bureau",
"bureau",
"=",
"_bureaus",
".",
"get",
"(",
"creds",
".",
"clientId",
")",
";",
"if",
"(",
"bureau",
"==",
"null",
")",
"{",
"return",
"\"Bureau \"",
"+",
"creds",
"... | Check the credentials to make sure this is one of our bureaus.
@return null if all's well, otherwise a string describing the authentication failure | [
"Check",
"the",
"credentials",
"to",
"make",
"sure",
"this",
"is",
"one",
"of",
"our",
"bureaus",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L150-L163 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.startAgent | public void startAgent (AgentObject agent)
{
agent.setLocal(AgentData.class, new AgentData());
Bureau bureau = _bureaus.get(agent.bureauId);
if (bureau != null && bureau.ready()) {
_omgr.registerObject(agent);
log.info("Bureau ready, sending createAgent", "agent", a... | java | public void startAgent (AgentObject agent)
{
agent.setLocal(AgentData.class, new AgentData());
Bureau bureau = _bureaus.get(agent.bureauId);
if (bureau != null && bureau.ready()) {
_omgr.registerObject(agent);
log.info("Bureau ready, sending createAgent", "agent", a... | [
"public",
"void",
"startAgent",
"(",
"AgentObject",
"agent",
")",
"{",
"agent",
".",
"setLocal",
"(",
"AgentData",
".",
"class",
",",
"new",
"AgentData",
"(",
")",
")",
";",
"Bureau",
"bureau",
"=",
"_bureaus",
".",
"get",
"(",
"agent",
".",
"bureauId",
... | Starts a new agent using the data in the given object, creating a new bureau if necessary. | [
"Starts",
"a",
"new",
"agent",
"using",
"the",
"data",
"in",
"the",
"given",
"object",
"creating",
"a",
"new",
"bureau",
"if",
"necessary",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L244-L280 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.destroyAgent | public void destroyAgent (AgentObject agent)
{
FoundAgent found = resolve(null, agent.getOid(), "destroyAgent");
if (found == null) {
return;
}
log.info("Destroying agent", "agent", agent.which());
// transition the agent to a new state and perform the effect of... | java | public void destroyAgent (AgentObject agent)
{
FoundAgent found = resolve(null, agent.getOid(), "destroyAgent");
if (found == null) {
return;
}
log.info("Destroying agent", "agent", agent.which());
// transition the agent to a new state and perform the effect of... | [
"public",
"void",
"destroyAgent",
"(",
"AgentObject",
"agent",
")",
"{",
"FoundAgent",
"found",
"=",
"resolve",
"(",
"null",
",",
"agent",
".",
"getOid",
"(",
")",
",",
"\"destroyAgent\"",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
"{",
"return",
... | Destroys a previously started agent using the data in the given object. | [
"Destroys",
"a",
"previously",
"started",
"agent",
"using",
"the",
"data",
"in",
"the",
"given",
"object",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L285-L314 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.lookupClient | public PresentsSession lookupClient (String bureauId)
{
Bureau bureau = _bureaus.get(bureauId);
if (bureau == null) {
return null;
}
return bureau.client;
} | java | public PresentsSession lookupClient (String bureauId)
{
Bureau bureau = _bureaus.get(bureauId);
if (bureau == null) {
return null;
}
return bureau.client;
} | [
"public",
"PresentsSession",
"lookupClient",
"(",
"String",
"bureauId",
")",
"{",
"Bureau",
"bureau",
"=",
"_bureaus",
".",
"get",
"(",
"bureauId",
")",
";",
"if",
"(",
"bureau",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"bureau",
"."... | Returns the active session for a bureau of the given id. | [
"Returns",
"the",
"active",
"session",
"for",
"a",
"bureau",
"of",
"the",
"given",
"id",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L319-L326 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.getLaunchError | public Exception getLaunchError (AgentObject agentObj)
{
AgentData data = agentObj.getLocal(AgentData.class);
if (data == null) {
return null;
}
return data.launchError;
} | java | public Exception getLaunchError (AgentObject agentObj)
{
AgentData data = agentObj.getLocal(AgentData.class);
if (data == null) {
return null;
}
return data.launchError;
} | [
"public",
"Exception",
"getLaunchError",
"(",
"AgentObject",
"agentObj",
")",
"{",
"AgentData",
"data",
"=",
"agentObj",
".",
"getLocal",
"(",
"AgentData",
".",
"class",
")",
";",
"if",
"(",
"data",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"re... | If this agent's bureau encountered an error on launch, return it. | [
"If",
"this",
"agent",
"s",
"bureau",
"encountered",
"an",
"error",
"on",
"launch",
"return",
"it",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L331-L338 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.bureauInitialized | protected void bureauInitialized (ClientObject client, String bureauId)
{
final Bureau bureau = _bureaus.get(bureauId);
if (bureau == null) {
log.warning("Initialization of non-existent bureau", "bureauId", bureauId);
return;
}
bureau.clientObj = client;
... | java | protected void bureauInitialized (ClientObject client, String bureauId)
{
final Bureau bureau = _bureaus.get(bureauId);
if (bureau == null) {
log.warning("Initialization of non-existent bureau", "bureauId", bureauId);
return;
}
bureau.clientObj = client;
... | [
"protected",
"void",
"bureauInitialized",
"(",
"ClientObject",
"client",
",",
"String",
"bureauId",
")",
"{",
"final",
"Bureau",
"bureau",
"=",
"_bureaus",
".",
"get",
"(",
"bureauId",
")",
";",
"if",
"(",
"bureau",
"==",
"null",
")",
"{",
"log",
".",
"w... | Callback for when the bureau client acknowledges starting up. Starts all pending agents and
causes subsequent agent start requests to be sent directly to the bureau. | [
"Callback",
"for",
"when",
"the",
"bureau",
"client",
"acknowledges",
"starting",
"up",
".",
"Starts",
"all",
"pending",
"agents",
"and",
"causes",
"subsequent",
"agent",
"start",
"requests",
"to",
"be",
"sent",
"directly",
"to",
"the",
"bureau",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L374-L405 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.agentCreated | protected void agentCreated (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreated");
if (found == null) {
return;
}
log.info("Agent creation confirmed", "agent", found.agent.which());
if (found.state == AgentState.STARTED... | java | protected void agentCreated (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreated");
if (found == null) {
return;
}
log.info("Agent creation confirmed", "agent", found.agent.which());
if (found.state == AgentState.STARTED... | [
"protected",
"void",
"agentCreated",
"(",
"ClientObject",
"client",
",",
"int",
"agentId",
")",
"{",
"FoundAgent",
"found",
"=",
"resolve",
"(",
"client",
",",
"agentId",
",",
"\"agentCreated\"",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
"{",
"retur... | Callback for when the bureau client acknowledges the creation of an agent. | [
"Callback",
"for",
"when",
"the",
"bureau",
"client",
"acknowledges",
"the",
"creation",
"of",
"an",
"agent",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L426-L452 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.agentCreationFailed | protected void agentCreationFailed (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreationFailed");
if (found == null) {
return;
}
log.info("Agent creation failed", "agent", found.agent.which());
if (found.state == AgentSt... | java | protected void agentCreationFailed (ClientObject client, int agentId)
{
FoundAgent found = resolve(client, agentId, "agentCreationFailed");
if (found == null) {
return;
}
log.info("Agent creation failed", "agent", found.agent.which());
if (found.state == AgentSt... | [
"protected",
"void",
"agentCreationFailed",
"(",
"ClientObject",
"client",
",",
"int",
"agentId",
")",
"{",
"FoundAgent",
"found",
"=",
"resolve",
"(",
"client",
",",
"agentId",
",",
"\"agentCreationFailed\"",
")",
";",
"if",
"(",
"found",
"==",
"null",
")",
... | Callback for when the bureau client acknowledges the failure to create an agent. | [
"Callback",
"for",
"when",
"the",
"bureau",
"client",
"acknowledges",
"the",
"failure",
"to",
"create",
"an",
"agent",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L457-L479 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.clientDestroyed | protected void clientDestroyed (Bureau bureau)
{
log.info("Client destroyed, destroying all agents", "bureau", bureau);
// clean up any agents attached to this bureau
for (AgentObject agent : bureau.agentStates.keySet()) {
_omgr.destroyObject(agent.getOid());
}
b... | java | protected void clientDestroyed (Bureau bureau)
{
log.info("Client destroyed, destroying all agents", "bureau", bureau);
// clean up any agents attached to this bureau
for (AgentObject agent : bureau.agentStates.keySet()) {
_omgr.destroyObject(agent.getOid());
}
b... | [
"protected",
"void",
"clientDestroyed",
"(",
"Bureau",
"bureau",
")",
"{",
"log",
".",
"info",
"(",
"\"Client destroyed, destroying all agents\"",
",",
"\"bureau\"",
",",
"bureau",
")",
";",
"// clean up any agents attached to this bureau",
"for",
"(",
"AgentObject",
"a... | Callback for when a client is destroyed. | [
"Callback",
"for",
"when",
"a",
"client",
"is",
"destroyed",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L511-L524 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.resolve | protected FoundAgent resolve (ClientObject client, int agentId, String resolver)
{
com.threerings.presents.dobj.DObject dobj = _omgr.getObject(agentId);
if (dobj == null) {
log.warning("Non-existent agent", "function", resolver, "agentId", agentId);
return null;
}
... | java | protected FoundAgent resolve (ClientObject client, int agentId, String resolver)
{
com.threerings.presents.dobj.DObject dobj = _omgr.getObject(agentId);
if (dobj == null) {
log.warning("Non-existent agent", "function", resolver, "agentId", agentId);
return null;
}
... | [
"protected",
"FoundAgent",
"resolve",
"(",
"ClientObject",
"client",
",",
"int",
"agentId",
",",
"String",
"resolver",
")",
"{",
"com",
".",
"threerings",
".",
"presents",
".",
"dobj",
".",
"DObject",
"dobj",
"=",
"_omgr",
".",
"getObject",
"(",
"agentId",
... | Does lots of null checks and lookups and resolves the given information into FoundAgent. | [
"Does",
"lots",
"of",
"null",
"checks",
"and",
"lookups",
"and",
"resolves",
"the",
"given",
"information",
"into",
"FoundAgent",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L529-L561 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.generateToken | protected String generateToken (String bureauId)
{
String tokenSource = bureauId + "@" + System.currentTimeMillis() + "r" + Math.random();
return StringUtil.md5hex(tokenSource);
} | java | protected String generateToken (String bureauId)
{
String tokenSource = bureauId + "@" + System.currentTimeMillis() + "r" + Math.random();
return StringUtil.md5hex(tokenSource);
} | [
"protected",
"String",
"generateToken",
"(",
"String",
"bureauId",
")",
"{",
"String",
"tokenSource",
"=",
"bureauId",
"+",
"\"@\"",
"+",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"\"r\"",
"+",
"Math",
".",
"random",
"(",
")",
";",
"return",
"Stri... | Create a hard-to-guess token that the bureau can use to authenticate itself when it tries
to log in. | [
"Create",
"a",
"hard",
"-",
"to",
"-",
"guess",
"token",
"that",
"the",
"bureau",
"can",
"use",
"to",
"authenticate",
"itself",
"when",
"it",
"tries",
"to",
"log",
"in",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L567-L571 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.launchTimeoutExpired | protected void launchTimeoutExpired (Bureau bureau)
{
if (bureau.clientObj != null) {
return; // all's well, ignore
}
if (!_bureaus.containsKey(bureau.bureauId)) {
// bureau has already managed to get destroyed before the launch timeout, ignore
return;
... | java | protected void launchTimeoutExpired (Bureau bureau)
{
if (bureau.clientObj != null) {
return; // all's well, ignore
}
if (!_bureaus.containsKey(bureau.bureauId)) {
// bureau has already managed to get destroyed before the launch timeout, ignore
return;
... | [
"protected",
"void",
"launchTimeoutExpired",
"(",
"Bureau",
"bureau",
")",
"{",
"if",
"(",
"bureau",
".",
"clientObj",
"!=",
"null",
")",
"{",
"return",
";",
"// all's well, ignore",
"}",
"if",
"(",
"!",
"_bureaus",
".",
"containsKey",
"(",
"bureau",
".",
... | Called by the launcher unit timeout time after launching.
@param bureau bureau whose launch occurred | [
"Called",
"by",
"the",
"launcher",
"unit",
"timeout",
"time",
"after",
"launching",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L577-L589 | train |
threerings/narya | core/src/main/java/com/threerings/bureau/server/BureauRegistry.java | BureauRegistry.handleLaunchError | protected void handleLaunchError (Bureau bureau, Exception error, String cause)
{
if (cause == null && error != null) {
cause = error.getMessage();
}
log.info("Bureau failed to launch", "bureau", bureau, "cause", cause);
// clean up any agents attached to this bureau
... | java | protected void handleLaunchError (Bureau bureau, Exception error, String cause)
{
if (cause == null && error != null) {
cause = error.getMessage();
}
log.info("Bureau failed to launch", "bureau", bureau, "cause", cause);
// clean up any agents attached to this bureau
... | [
"protected",
"void",
"handleLaunchError",
"(",
"Bureau",
"bureau",
",",
"Exception",
"error",
",",
"String",
"cause",
")",
"{",
"if",
"(",
"cause",
"==",
"null",
"&&",
"error",
"!=",
"null",
")",
"{",
"cause",
"=",
"error",
".",
"getMessage",
"(",
")",
... | Called when something goes wrong with launching a bureau. | [
"Called",
"when",
"something",
"goes",
"wrong",
"with",
"launching",
"a",
"bureau",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/server/BureauRegistry.java#L594-L609 | train |
threerings/narya | core/src/main/java/com/threerings/admin/client/ConfigEditorPanel.java | ConfigEditorPanel.gotConfigInfo | public void gotConfigInfo (final String[] keys, final int[] oids)
{
// make sure we're still added
if (!isDisplayable()) {
return;
}
Integer indexes[] = new Integer[keys.length];
for (int ii = 0; ii < indexes.length; ii++) {
indexes[ii] = ii;
... | java | public void gotConfigInfo (final String[] keys, final int[] oids)
{
// make sure we're still added
if (!isDisplayable()) {
return;
}
Integer indexes[] = new Integer[keys.length];
for (int ii = 0; ii < indexes.length; ii++) {
indexes[ii] = ii;
... | [
"public",
"void",
"gotConfigInfo",
"(",
"final",
"String",
"[",
"]",
"keys",
",",
"final",
"int",
"[",
"]",
"oids",
")",
"{",
"// make sure we're still added",
"if",
"(",
"!",
"isDisplayable",
"(",
")",
")",
"{",
"return",
";",
"}",
"Integer",
"indexes",
... | Called in response to our getConfigInfo server-side service request. | [
"Called",
"in",
"response",
"to",
"our",
"getConfigInfo",
"server",
"-",
"side",
"service",
"request",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/ConfigEditorPanel.java#L112-L139 | train |
xbib/marc | src/main/java/org/xbib/marc/io/PatternInputStream.java | PatternInputStream.readChunk | @Override
public Chunk<byte[], BytesReference> readChunk() throws IOException {
Chunk<byte[], BytesReference> chunk = internalReadChunk();
if (chunk != null) {
processChunk(chunk);
}
return chunk;
} | java | @Override
public Chunk<byte[], BytesReference> readChunk() throws IOException {
Chunk<byte[], BytesReference> chunk = internalReadChunk();
if (chunk != null) {
processChunk(chunk);
}
return chunk;
} | [
"@",
"Override",
"public",
"Chunk",
"<",
"byte",
"[",
"]",
",",
"BytesReference",
">",
"readChunk",
"(",
")",
"throws",
"IOException",
"{",
"Chunk",
"<",
"byte",
"[",
"]",
",",
"BytesReference",
">",
"chunk",
"=",
"internalReadChunk",
"(",
")",
";",
"if"... | Read next chunk from this stream.
@return a chunk
@throws IOException if chunk can not be read | [
"Read",
"next",
"chunk",
"from",
"this",
"stream",
"."
] | d8426fcfc686507cab59b3d8181b08f83718418c | https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/PatternInputStream.java#L72-L79 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.addChatterObserver | public boolean addChatterObserver (ChatterObserver co)
{
boolean added = _chatterObservers.add(co);
co.chattersUpdated(_chatters.listIterator());
return added;
} | java | public boolean addChatterObserver (ChatterObserver co)
{
boolean added = _chatterObservers.add(co);
co.chattersUpdated(_chatters.listIterator());
return added;
} | [
"public",
"boolean",
"addChatterObserver",
"(",
"ChatterObserver",
"co",
")",
"{",
"boolean",
"added",
"=",
"_chatterObservers",
".",
"add",
"(",
"co",
")",
";",
"co",
".",
"chattersUpdated",
"(",
"_chatters",
".",
"listIterator",
"(",
")",
")",
";",
"return... | Adds an observer that watches the chatters list, and updates it immediately. | [
"Adds",
"an",
"observer",
"that",
"watches",
"the",
"chatters",
"list",
"and",
"updates",
"it",
"immediately",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L219-L225 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.registerCommandHandler | public void registerCommandHandler (MessageBundle msg, String command, CommandHandler handler)
{
// the usage key is derived from the untranslated command
handler._usageKey = "m.usage_" + command;
String key = "c." + command;
handler._aliases = msg.exists(key) ? msg.get(key).split("... | java | public void registerCommandHandler (MessageBundle msg, String command, CommandHandler handler)
{
// the usage key is derived from the untranslated command
handler._usageKey = "m.usage_" + command;
String key = "c." + command;
handler._aliases = msg.exists(key) ? msg.get(key).split("... | [
"public",
"void",
"registerCommandHandler",
"(",
"MessageBundle",
"msg",
",",
"String",
"command",
",",
"CommandHandler",
"handler",
")",
"{",
"// the usage key is derived from the untranslated command",
"handler",
".",
"_usageKey",
"=",
"\"m.usage_\"",
"+",
"command",
";... | Registers a chat command handler.
@param msg the message bundle via which the slash command will be translated (as
<code>c.</code><i>command</i>). If no translation exists the command will be
<code>/</code><i>command</i>.
@param command the name of the command that will be used to invoke this handler (e.g.
<code>tell<... | [
"Registers",
"a",
"chat",
"command",
"handler",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L265-L275 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.clearDisplays | public void clearDisplays ()
{
_displays.apply(new ObserverList.ObserverOp<ChatDisplay>() {
public boolean apply (ChatDisplay observer) {
observer.clear();
return true;
}
});
} | java | public void clearDisplays ()
{
_displays.apply(new ObserverList.ObserverOp<ChatDisplay>() {
public boolean apply (ChatDisplay observer) {
observer.clear();
return true;
}
});
} | [
"public",
"void",
"clearDisplays",
"(",
")",
"{",
"_displays",
".",
"apply",
"(",
"new",
"ObserverList",
".",
"ObserverOp",
"<",
"ChatDisplay",
">",
"(",
")",
"{",
"public",
"boolean",
"apply",
"(",
"ChatDisplay",
"observer",
")",
"{",
"observer",
".",
"cl... | Requests that all chat displays clear their contents. | [
"Requests",
"that",
"all",
"chat",
"displays",
"clear",
"their",
"contents",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L304-L312 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayInfo | public void displayInfo (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.INFO, PLACE_CHAT_TYPE);
} | java | public void displayInfo (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.INFO, PLACE_CHAT_TYPE);
} | [
"public",
"void",
"displayInfo",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"INFO",
",",
"PLACE_CHAT_TYPE",
")",
";",
"}"
] | Display a system INFO message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Info messages are sent when something happens that was neither directly triggered by the
user, nor requires direct action. | [
"Display",
"a",
"system",
"INFO",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
".",
"The",
"localtype",
"of",
"the",
"message",
"will",
"be",
"PLACE_CHAT_TYPE",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L321-L324 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayInfo | public void displayInfo (String bundle, String message, String localtype)
{
displaySystem(bundle, message, SystemMessage.INFO, localtype);
} | java | public void displayInfo (String bundle, String message, String localtype)
{
displaySystem(bundle, message, SystemMessage.INFO, localtype);
} | [
"public",
"void",
"displayInfo",
"(",
"String",
"bundle",
",",
"String",
"message",
",",
"String",
"localtype",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"INFO",
",",
"localtype",
")",
";",
"}"
] | Display a system INFO message as if it had come from the server.
Info messages are sent when something happens that was neither directly triggered by the
user, nor requires direct action. | [
"Display",
"a",
"system",
"INFO",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L332-L335 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayFeedback | public void displayFeedback (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.FEEDBACK, PLACE_CHAT_TYPE);
} | java | public void displayFeedback (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.FEEDBACK, PLACE_CHAT_TYPE);
} | [
"public",
"void",
"displayFeedback",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"FEEDBACK",
",",
"PLACE_CHAT_TYPE",
")",
";",
"}"
] | Display a system FEEDBACK message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Feedback messages are sent in direct response to a user action, usually to indicate success
or failure of the user's action. | [
"Display",
"a",
"system",
"FEEDBACK",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
".",
"The",
"localtype",
"of",
"the",
"message",
"will",
"be",
"PLACE_CHAT_TYPE",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L344-L347 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displayAttention | public void displayAttention (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.ATTENTION, PLACE_CHAT_TYPE);
} | java | public void displayAttention (String bundle, String message)
{
displaySystem(bundle, message, SystemMessage.ATTENTION, PLACE_CHAT_TYPE);
} | [
"public",
"void",
"displayAttention",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"displaySystem",
"(",
"bundle",
",",
"message",
",",
"SystemMessage",
".",
"ATTENTION",
",",
"PLACE_CHAT_TYPE",
")",
";",
"}"
] | Display a system ATTENTION message as if it had come from the server. The localtype of the
message will be PLACE_CHAT_TYPE.
Attention messages are sent when something requires user action that did not result from
direct action by the user. | [
"Display",
"a",
"system",
"ATTENTION",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
".",
"The",
"localtype",
"of",
"the",
"message",
"will",
"be",
"PLACE_CHAT_TYPE",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L356-L359 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.dispatchMessage | public void dispatchMessage (ChatMessage message, String localType)
{
setClientInfo(message, localType);
dispatchPreparedMessage(message);
} | java | public void dispatchMessage (ChatMessage message, String localType)
{
setClientInfo(message, localType);
dispatchPreparedMessage(message);
} | [
"public",
"void",
"dispatchMessage",
"(",
"ChatMessage",
"message",
",",
"String",
"localType",
")",
"{",
"setClientInfo",
"(",
"message",
",",
"localType",
")",
";",
"dispatchPreparedMessage",
"(",
"message",
")",
";",
"}"
] | Dispatches the provided message to our chat displays. | [
"Dispatches",
"the",
"provided",
"message",
"to",
"our",
"chat",
"displays",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L364-L368 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.requestChat | public String requestChat (SpeakService speakSvc, String text, boolean record)
{
if (text.startsWith("/")) {
// split the text up into a command and arguments
String command = text.substring(1).toLowerCase();
String[] hist = new String[1];
String args = "";
... | java | public String requestChat (SpeakService speakSvc, String text, boolean record)
{
if (text.startsWith("/")) {
// split the text up into a command and arguments
String command = text.substring(1).toLowerCase();
String[] hist = new String[1];
String args = "";
... | [
"public",
"String",
"requestChat",
"(",
"SpeakService",
"speakSvc",
",",
"String",
"text",
",",
"boolean",
"record",
")",
"{",
"if",
"(",
"text",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"// split the text up into a command and arguments",
"String",
"comman... | Parses and delivers the supplied chat message. Slash command processing and mogrification
are performed and the message is added to the chat history if appropriate.
@param speakSvc the SpeakService representing the target dobj of the speak or null if we
should speak in the "default" way.
@param text the text to be par... | [
"Parses",
"and",
"delivers",
"the",
"supplied",
"chat",
"message",
".",
"Slash",
"command",
"processing",
"and",
"mogrification",
"are",
"performed",
"and",
"the",
"message",
"is",
"added",
"to",
"the",
"chat",
"history",
"if",
"appropriate",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L382-L439 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.requestBroadcast | public void requestBroadcast (String message)
{
message = filter(message, null, true);
if (message == null) {
displayFeedback(_bundle, MessageBundle.compose("m.broadcast_failed", "m.filtered"));
return;
}
_cservice.broadcast(message, new ChatService.Invocation... | java | public void requestBroadcast (String message)
{
message = filter(message, null, true);
if (message == null) {
displayFeedback(_bundle, MessageBundle.compose("m.broadcast_failed", "m.filtered"));
return;
}
_cservice.broadcast(message, new ChatService.Invocation... | [
"public",
"void",
"requestBroadcast",
"(",
"String",
"message",
")",
"{",
"message",
"=",
"filter",
"(",
"message",
",",
"null",
",",
"true",
")",
";",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"displayFeedback",
"(",
"_bundle",
",",
"MessageBundle",
... | Requests to send a site-wide broadcast message.
@param message the contents of the message. | [
"Requests",
"to",
"send",
"a",
"site",
"-",
"wide",
"broadcast",
"message",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L477-L490 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.requestTell | public <T extends Name> void requestTell (
final T target, String msg, final ResultListener<T> rl)
{
// make sure they can say what they want to say
final String message = filter(msg, target, true);
if (message == null) {
if (rl != null) {
rl.requestFailed... | java | public <T extends Name> void requestTell (
final T target, String msg, final ResultListener<T> rl)
{
// make sure they can say what they want to say
final String message = filter(msg, target, true);
if (message == null) {
if (rl != null) {
rl.requestFailed... | [
"public",
"<",
"T",
"extends",
"Name",
">",
"void",
"requestTell",
"(",
"final",
"T",
"target",
",",
"String",
"msg",
",",
"final",
"ResultListener",
"<",
"T",
">",
"rl",
")",
"{",
"// make sure they can say what they want to say",
"final",
"String",
"message",
... | Requests that a tell message be delivered to the specified target user.
@param target the username of the user to which the tell message should be delivered.
@param msg the contents of the tell message.
@param rl an optional result listener if you'd like to be notified of success or failure. | [
"Requests",
"that",
"a",
"tell",
"message",
"be",
"delivered",
"to",
"the",
"specified",
"target",
"user",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L499-L558 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.setAwayMessage | public void setAwayMessage (String message)
{
if (message != null) {
message = filter(message, null, true);
if (message == null) {
// they filtered away their own away message... change it to something
message = "...";
}
}
/... | java | public void setAwayMessage (String message)
{
if (message != null) {
message = filter(message, null, true);
if (message == null) {
// they filtered away their own away message... change it to something
message = "...";
}
}
/... | [
"public",
"void",
"setAwayMessage",
"(",
"String",
"message",
")",
"{",
"if",
"(",
"message",
"!=",
"null",
")",
"{",
"message",
"=",
"filter",
"(",
"message",
",",
"null",
",",
"true",
")",
";",
"if",
"(",
"message",
"==",
"null",
")",
"{",
"// they... | Configures a message that will be automatically reported to anyone that sends a tell message
to this client to indicate that we are busy or away from the keyboard. | [
"Configures",
"a",
"message",
"that",
"will",
"be",
"automatically",
"reported",
"to",
"anyone",
"that",
"sends",
"a",
"tell",
"message",
"to",
"this",
"client",
"to",
"indicate",
"that",
"we",
"are",
"busy",
"or",
"away",
"from",
"the",
"keyboard",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L564-L575 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.addAuxiliarySource | public void addAuxiliarySource (DObject source, String localtype)
{
source.addListener(this);
_auxes.put(source.getOid(), localtype);
} | java | public void addAuxiliarySource (DObject source, String localtype)
{
source.addListener(this);
_auxes.put(source.getOid(), localtype);
} | [
"public",
"void",
"addAuxiliarySource",
"(",
"DObject",
"source",
",",
"String",
"localtype",
")",
"{",
"source",
".",
"addListener",
"(",
"this",
")",
";",
"_auxes",
".",
"put",
"(",
"source",
".",
"getOid",
"(",
")",
",",
"localtype",
")",
";",
"}"
] | Adds an additional object via which chat messages may arrive. The chat director assumes the
caller will be managing the subscription to this object and will remain subscribed to it for
as long as it remains in effect as an auxiliary chat source.
@param localtype a type to be associated with all chat messages that arri... | [
"Adds",
"an",
"additional",
"object",
"via",
"which",
"chat",
"messages",
"may",
"arrive",
".",
"The",
"chat",
"director",
"assumes",
"the",
"caller",
"will",
"be",
"managing",
"the",
"subscription",
"to",
"this",
"object",
"and",
"will",
"remain",
"subscribed... | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L585-L589 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.filter | public String filter (String msg, Name otherUser, boolean outgoing)
{
_filterMessageOp.setMessage(msg, otherUser, outgoing);
_filters.apply(_filterMessageOp);
return _filterMessageOp.getMessage();
} | java | public String filter (String msg, Name otherUser, boolean outgoing)
{
_filterMessageOp.setMessage(msg, otherUser, outgoing);
_filters.apply(_filterMessageOp);
return _filterMessageOp.getMessage();
} | [
"public",
"String",
"filter",
"(",
"String",
"msg",
",",
"Name",
"otherUser",
",",
"boolean",
"outgoing",
")",
"{",
"_filterMessageOp",
".",
"setMessage",
"(",
"msg",
",",
"otherUser",
",",
"outgoing",
")",
";",
"_filters",
".",
"apply",
"(",
"_filterMessage... | Run a message through all the currently registered filters. | [
"Run",
"a",
"message",
"through",
"all",
"the",
"currently",
"registered",
"filters",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L618-L623 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.registerCommandHandlers | protected void registerCommandHandlers ()
{
MessageBundle msg = _ctx.getMessageManager().getBundle(_bundle);
registerCommandHandler(msg, "help", new HelpHandler());
registerCommandHandler(msg, "clear", new ClearHandler());
registerCommandHandler(msg, "speak", new SpeakHandler());
... | java | protected void registerCommandHandlers ()
{
MessageBundle msg = _ctx.getMessageManager().getBundle(_bundle);
registerCommandHandler(msg, "help", new HelpHandler());
registerCommandHandler(msg, "clear", new ClearHandler());
registerCommandHandler(msg, "speak", new SpeakHandler());
... | [
"protected",
"void",
"registerCommandHandlers",
"(",
")",
"{",
"MessageBundle",
"msg",
"=",
"_ctx",
".",
"getMessageManager",
"(",
")",
".",
"getBundle",
"(",
"_bundle",
")",
";",
"registerCommandHandler",
"(",
"msg",
",",
"\"help\"",
",",
"new",
"HelpHandler",
... | Registers all the chat-command handlers. | [
"Registers",
"all",
"the",
"chat",
"-",
"command",
"handlers",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L721-L731 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.processReceivedMessage | protected void processReceivedMessage (ChatMessage msg, String localtype)
{
String autoResponse = null;
Name speaker = null;
Name speakerDisplay = null;
byte mode = (byte)-1;
// figure out if the message was triggered by another user
if (msg instanceof UserMessage) {... | java | protected void processReceivedMessage (ChatMessage msg, String localtype)
{
String autoResponse = null;
Name speaker = null;
Name speakerDisplay = null;
byte mode = (byte)-1;
// figure out if the message was triggered by another user
if (msg instanceof UserMessage) {... | [
"protected",
"void",
"processReceivedMessage",
"(",
"ChatMessage",
"msg",
",",
"String",
"localtype",
")",
"{",
"String",
"autoResponse",
"=",
"null",
";",
"Name",
"speaker",
"=",
"null",
";",
"Name",
"speakerDisplay",
"=",
"null",
";",
"byte",
"mode",
"=",
... | Processes and dispatches the specified chat message. | [
"Processes",
"and",
"dispatches",
"the",
"specified",
"chat",
"message",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L736-L787 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.addToHistory | protected void addToHistory (String cmd)
{
// remove any previous instance of this command
_history.remove(cmd);
// append it to the end
_history.add(cmd);
// prune the history once it extends beyond max size
if (_history.size() > MAX_COMMAND_HISTORY) {
... | java | protected void addToHistory (String cmd)
{
// remove any previous instance of this command
_history.remove(cmd);
// append it to the end
_history.add(cmd);
// prune the history once it extends beyond max size
if (_history.size() > MAX_COMMAND_HISTORY) {
... | [
"protected",
"void",
"addToHistory",
"(",
"String",
"cmd",
")",
"{",
"// remove any previous instance of this command",
"_history",
".",
"remove",
"(",
"cmd",
")",
";",
"// append it to the end",
"_history",
".",
"add",
"(",
"cmd",
")",
";",
"// prune the history once... | Adds the specified command to the history. | [
"Adds",
"the",
"specified",
"command",
"to",
"the",
"history",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L853-L865 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.mogrifyChat | protected String mogrifyChat (
String text, byte mode, boolean transformsAllowed, boolean capFirst)
{
int tlen = text.length();
if (tlen == 0) {
return text;
// check to make sure there aren't too many caps
} else if (tlen > 7 && suppressTooManyCaps()) {
... | java | protected String mogrifyChat (
String text, byte mode, boolean transformsAllowed, boolean capFirst)
{
int tlen = text.length();
if (tlen == 0) {
return text;
// check to make sure there aren't too many caps
} else if (tlen > 7 && suppressTooManyCaps()) {
... | [
"protected",
"String",
"mogrifyChat",
"(",
"String",
"text",
",",
"byte",
"mode",
",",
"boolean",
"transformsAllowed",
",",
"boolean",
"capFirst",
")",
"{",
"int",
"tlen",
"=",
"text",
".",
"length",
"(",
")",
";",
"if",
"(",
"tlen",
"==",
"0",
")",
"{... | Mogrifies common literary crutches into more appealing chat or commands.
@param mode the chat mode, or -1 if unknown.
@param transformsAllowed if true, the chat may transformed into a different mode. (lol ->
/emote laughs)
@param capFirst if true, the first letter of the text is capitalized. This is not desired if
the... | [
"Mogrifies",
"common",
"literary",
"crutches",
"into",
"more",
"appealing",
"chat",
"or",
"commands",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L876-L902 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.addChatter | protected void addChatter (Name name)
{
// check to see if the chatter validator approves..
if ((_chatterValidator != null) && (!_chatterValidator.isChatterValid(name))) {
return;
}
boolean wasthere = _chatters.remove(name);
_chatters.addFirst(name);
if (... | java | protected void addChatter (Name name)
{
// check to see if the chatter validator approves..
if ((_chatterValidator != null) && (!_chatterValidator.isChatterValid(name))) {
return;
}
boolean wasthere = _chatters.remove(name);
_chatters.addFirst(name);
if (... | [
"protected",
"void",
"addChatter",
"(",
"Name",
"name",
")",
"{",
"// check to see if the chatter validator approves..",
"if",
"(",
"(",
"_chatterValidator",
"!=",
"null",
")",
"&&",
"(",
"!",
"_chatterValidator",
".",
"isChatterValid",
"(",
"name",
")",
")",
")",... | Adds a chatter to our list of recent chatters. | [
"Adds",
"a",
"chatter",
"to",
"our",
"list",
"of",
"recent",
"chatters",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1025-L1040 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.setClientInfo | protected void setClientInfo (ChatMessage msg, String localType)
{
if (msg.localtype == null) {
msg.setClientInfo(xlate(msg.bundle, msg.message), localType);
}
} | java | protected void setClientInfo (ChatMessage msg, String localType)
{
if (msg.localtype == null) {
msg.setClientInfo(xlate(msg.bundle, msg.message), localType);
}
} | [
"protected",
"void",
"setClientInfo",
"(",
"ChatMessage",
"msg",
",",
"String",
"localType",
")",
"{",
"if",
"(",
"msg",
".",
"localtype",
"==",
"null",
")",
"{",
"msg",
".",
"setClientInfo",
"(",
"xlate",
"(",
"msg",
".",
"bundle",
",",
"msg",
".",
"m... | Set the "client info" on the specified message, if not already set. | [
"Set",
"the",
"client",
"info",
"on",
"the",
"specified",
"message",
"if",
"not",
"already",
"set",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1058-L1063 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.xlate | protected String xlate (String bundle, String message)
{
if (bundle != null && _ctx.getMessageManager() != null) {
MessageBundle msgb = _ctx.getMessageManager().getBundle(bundle);
if (msgb == null) {
log.warning("No message bundle available to translate message", "bun... | java | protected String xlate (String bundle, String message)
{
if (bundle != null && _ctx.getMessageManager() != null) {
MessageBundle msgb = _ctx.getMessageManager().getBundle(bundle);
if (msgb == null) {
log.warning("No message bundle available to translate message", "bun... | [
"protected",
"String",
"xlate",
"(",
"String",
"bundle",
",",
"String",
"message",
")",
"{",
"if",
"(",
"bundle",
"!=",
"null",
"&&",
"_ctx",
".",
"getMessageManager",
"(",
")",
"!=",
"null",
")",
"{",
"MessageBundle",
"msgb",
"=",
"_ctx",
".",
"getMessa... | Translates the specified message using the specified bundle. | [
"Translates",
"the",
"specified",
"message",
"using",
"the",
"specified",
"bundle",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1068-L1080 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.displaySystem | protected void displaySystem (String bundle, String message, byte attLevel, String localtype)
{
// nothing should be untranslated, so pass the default bundle if need be.
if (bundle == null) {
bundle = _bundle;
}
SystemMessage msg = new SystemMessage(message, bundle, attLe... | java | protected void displaySystem (String bundle, String message, byte attLevel, String localtype)
{
// nothing should be untranslated, so pass the default bundle if need be.
if (bundle == null) {
bundle = _bundle;
}
SystemMessage msg = new SystemMessage(message, bundle, attLe... | [
"protected",
"void",
"displaySystem",
"(",
"String",
"bundle",
",",
"String",
"message",
",",
"byte",
"attLevel",
",",
"String",
"localtype",
")",
"{",
"// nothing should be untranslated, so pass the default bundle if need be.",
"if",
"(",
"bundle",
"==",
"null",
")",
... | Display the specified system message as if it had come from the server. | [
"Display",
"the",
"specified",
"system",
"message",
"as",
"if",
"it",
"had",
"come",
"from",
"the",
"server",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1085-L1093 | train |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.getLocalType | protected String getLocalType (int oid)
{
String type = _auxes.get(oid);
return (type == null) ? PLACE_CHAT_TYPE : type;
} | java | protected String getLocalType (int oid)
{
String type = _auxes.get(oid);
return (type == null) ? PLACE_CHAT_TYPE : type;
} | [
"protected",
"String",
"getLocalType",
"(",
"int",
"oid",
")",
"{",
"String",
"type",
"=",
"_auxes",
".",
"get",
"(",
"oid",
")",
";",
"return",
"(",
"type",
"==",
"null",
")",
"?",
"PLACE_CHAT_TYPE",
":",
"type",
";",
"}"
] | Looks up and returns the message type associated with the specified oid. | [
"Looks",
"up",
"and",
"returns",
"the",
"message",
"type",
"associated",
"with",
"the",
"specified",
"oid",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L1098-L1102 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-io/src/main/java/org/dkpro/argumentation/io/writer/ArgumentDumpWriter.java | ArgumentDumpWriter.dumpArguments | public static String dumpArguments(JCas jCas, boolean includeProperties, boolean includeRelations)
{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outputStream);
String documentId = DocumentMetaData.get(jCas).getDocumentId();
ou... | java | public static String dumpArguments(JCas jCas, boolean includeProperties, boolean includeRelations)
{
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream out = new PrintStream(outputStream);
String documentId = DocumentMetaData.get(jCas).getDocumentId();
ou... | [
"public",
"static",
"String",
"dumpArguments",
"(",
"JCas",
"jCas",
",",
"boolean",
"includeProperties",
",",
"boolean",
"includeRelations",
")",
"{",
"ByteArrayOutputStream",
"outputStream",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"PrintStream",
"out",
... | Dump argument components to String. Can be also used outside UIMA pipeline.
@param jCas jcas
@return string dump | [
"Dump",
"argument",
"components",
"to",
"String",
".",
"Can",
"be",
"also",
"used",
"outside",
"UIMA",
"pipeline",
"."
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-io/src/main/java/org/dkpro/argumentation/io/writer/ArgumentDumpWriter.java#L119-L179 | train |
dkpro/dkpro-argumentation | dkpro-argumentation-io/src/main/java/org/dkpro/argumentation/io/writer/ArgumentDumpWriter.java | ArgumentDumpWriter.argumentUnitToString | public static String argumentUnitToString(ArgumentUnit argumentUnit)
{
return String.format("%s [%d, %d] \"%s\"", argumentUnit.getType().getShortName(),
argumentUnit.getBegin(), argumentUnit.getEnd(), argumentUnit.getCoveredText());
} | java | public static String argumentUnitToString(ArgumentUnit argumentUnit)
{
return String.format("%s [%d, %d] \"%s\"", argumentUnit.getType().getShortName(),
argumentUnit.getBegin(), argumentUnit.getEnd(), argumentUnit.getCoveredText());
} | [
"public",
"static",
"String",
"argumentUnitToString",
"(",
"ArgumentUnit",
"argumentUnit",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s [%d, %d] \\\"%s\\\"\"",
",",
"argumentUnit",
".",
"getType",
"(",
")",
".",
"getShortName",
"(",
")",
",",
"argumentU... | Formats argument unit to string with type, position, and text content
@param argumentUnit argument unit
@return string | [
"Formats",
"argument",
"unit",
"to",
"string",
"with",
"type",
"position",
"and",
"text",
"content"
] | 57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb | https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-io/src/main/java/org/dkpro/argumentation/io/writer/ArgumentDumpWriter.java#L194-L198 | train |
threerings/narya | core/src/main/java/com/threerings/admin/server/persist/ConfigRepository.java | ConfigRepository.loadConfig | public HashMap<String, String> loadConfig (String node, String object)
{
HashMap<String, String> data = Maps.newHashMap();
for (ConfigRecord record : from(ConfigRecord.class).
where(ConfigRecord.OBJECT.eq(object), ConfigRecord.NODE.eq(node)).select()) {
data.put(record.f... | java | public HashMap<String, String> loadConfig (String node, String object)
{
HashMap<String, String> data = Maps.newHashMap();
for (ConfigRecord record : from(ConfigRecord.class).
where(ConfigRecord.OBJECT.eq(object), ConfigRecord.NODE.eq(node)).select()) {
data.put(record.f... | [
"public",
"HashMap",
"<",
"String",
",",
"String",
">",
"loadConfig",
"(",
"String",
"node",
",",
"String",
"object",
")",
"{",
"HashMap",
"<",
"String",
",",
"String",
">",
"data",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"for",
"(",
"ConfigReco... | Loads up the configuration data for the specified object.
@return a map containing field/value pairs for all stored configuration data. | [
"Loads",
"up",
"the",
"configuration",
"data",
"for",
"the",
"specified",
"object",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/server/persist/ConfigRepository.java#L51-L59 | train |
threerings/narya | core/src/main/java/com/threerings/admin/server/persist/ConfigRepository.java | ConfigRepository.updateConfig | public void updateConfig (String node, String object, String field, String value)
{
store(new ConfigRecord(node, object, field, value));
} | java | public void updateConfig (String node, String object, String field, String value)
{
store(new ConfigRecord(node, object, field, value));
} | [
"public",
"void",
"updateConfig",
"(",
"String",
"node",
",",
"String",
"object",
",",
"String",
"field",
",",
"String",
"value",
")",
"{",
"store",
"(",
"new",
"ConfigRecord",
"(",
"node",
",",
"object",
",",
"field",
",",
"value",
")",
")",
";",
"}"
... | Updates the specified configuration datum. | [
"Updates",
"the",
"specified",
"configuration",
"datum",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/server/persist/ConfigRepository.java#L64-L67 | train |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsSession.java | PresentsSession.getInetAddress | public InetAddress getInetAddress ()
{
Connection conn = getConnection();
return (conn == null) ? null : conn.getInetAddress();
} | java | public InetAddress getInetAddress ()
{
Connection conn = getConnection();
return (conn == null) ? null : conn.getInetAddress();
} | [
"public",
"InetAddress",
"getInetAddress",
"(",
")",
"{",
"Connection",
"conn",
"=",
"getConnection",
"(",
")",
";",
"return",
"(",
"conn",
"==",
"null",
")",
"?",
"null",
":",
"conn",
".",
"getInetAddress",
"(",
")",
";",
"}"
] | Returns the address of the connected client or null if this client is not connected. | [
"Returns",
"the",
"address",
"of",
"the",
"connected",
"client",
"or",
"null",
"if",
"this",
"client",
"is",
"not",
"connected",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L177-L181 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.