id
int32
0
165k
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
41,200
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.removeStaleCacheObserver
public void removeStaleCacheObserver (String cache, StaleCacheObserver observer) { ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { return; } list.remove(observer); if (list.isEmpty()) { _cacheobs.remove(cache); ...
java
public void removeStaleCacheObserver (String cache, StaleCacheObserver observer) { ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { return; } list.remove(observer); if (list.isEmpty()) { _cacheobs.remove(cache); ...
[ "public", "void", "removeStaleCacheObserver", "(", "String", "cache", ",", "StaleCacheObserver", "observer", ")", "{", "ObserverList", "<", "StaleCacheObserver", ">", "list", "=", "_cacheobs", ".", "get", "(", "cache", ")", ";", "if", "(", "list", "==", "null"...
Removes a stale cache observer registration.
[ "Removes", "a", "stale", "cache", "observer", "registration", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L987-L997
41,201
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.broadcastStaleCacheData
public void broadcastStaleCacheData (String cache, Streamable data) { _nodeobj.setCacheData(new NodeObject.CacheData(cache, data)); }
java
public void broadcastStaleCacheData (String cache, Streamable data) { _nodeobj.setCacheData(new NodeObject.CacheData(cache, data)); }
[ "public", "void", "broadcastStaleCacheData", "(", "String", "cache", ",", "Streamable", "data", ")", "{", "_nodeobj", ".", "setCacheData", "(", "new", "NodeObject", ".", "CacheData", "(", "cache", ",", "data", ")", ")", ";", "}" ]
Called when cached data has changed on the local server and needs to inform our peers.
[ "Called", "when", "cached", "data", "has", "changed", "on", "the", "local", "server", "and", "needs", "to", "inform", "our", "peers", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1002-L1005
41,202
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.refreshPeer
protected void refreshPeer (NodeRecord record) { PeerNode peer = _peers.get(record.nodeName); if (peer == null) { peer = _injector.getInstance(getPeerNodeClass()); _peers.put(record.nodeName, peer); peer.init(record); } peer.refresh(record); }
java
protected void refreshPeer (NodeRecord record) { PeerNode peer = _peers.get(record.nodeName); if (peer == null) { peer = _injector.getInstance(getPeerNodeClass()); _peers.put(record.nodeName, peer); peer.init(record); } peer.refresh(record); }
[ "protected", "void", "refreshPeer", "(", "NodeRecord", "record", ")", "{", "PeerNode", "peer", "=", "_peers", ".", "get", "(", "record", ".", "nodeName", ")", ";", "if", "(", "peer", "==", "null", ")", "{", "peer", "=", "_injector", ".", "getInstance", ...
Ensures that we have a connection to the specified node if it has checked in since we last failed to connect.
[ "Ensures", "that", "we", "have", "a", "connection", "to", "the", "specified", "node", "if", "it", "has", "checked", "in", "since", "we", "last", "failed", "to", "connect", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1224-L1233
41,203
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.changedCacheData
protected void changedCacheData (String cache, final Streamable data) { // see if we have any observers ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { return; } // if so, notify them list.apply(new ObserverList.ObserverOp...
java
protected void changedCacheData (String cache, final Streamable data) { // see if we have any observers ObserverList<StaleCacheObserver> list = _cacheobs.get(cache); if (list == null) { return; } // if so, notify them list.apply(new ObserverList.ObserverOp...
[ "protected", "void", "changedCacheData", "(", "String", "cache", ",", "final", "Streamable", "data", ")", "{", "// see if we have any observers", "ObserverList", "<", "StaleCacheObserver", ">", "list", "=", "_cacheobs", ".", "get", "(", "cache", ")", ";", "if", ...
Called when possibly cached data has changed on one of our peer servers.
[ "Called", "when", "possibly", "cached", "data", "has", "changed", "on", "one", "of", "our", "peer", "servers", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1283-L1297
41,204
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.droppedLock
protected void droppedLock (final NodeObject.Lock lock) { _nodeobj.removeFromLocks(lock); _stats.locksHijacked++; _dropobs.apply(new ObserverList.ObserverOp<DroppedLockObserver>() { public boolean apply (DroppedLockObserver observer) { observer.droppedLock(lock); ...
java
protected void droppedLock (final NodeObject.Lock lock) { _nodeobj.removeFromLocks(lock); _stats.locksHijacked++; _dropobs.apply(new ObserverList.ObserverOp<DroppedLockObserver>() { public boolean apply (DroppedLockObserver observer) { observer.droppedLock(lock); ...
[ "protected", "void", "droppedLock", "(", "final", "NodeObject", ".", "Lock", "lock", ")", "{", "_nodeobj", ".", "removeFromLocks", "(", "lock", ")", ";", "_stats", ".", "locksHijacked", "++", ";", "_dropobs", ".", "apply", "(", "new", "ObserverList", ".", ...
Called when we have been forced to drop a lock.
[ "Called", "when", "we", "have", "been", "forced", "to", "drop", "a", "lock", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1302-L1312
41,205
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.clientLoggedOn
protected void clientLoggedOn (String nodeName, ClientInfo clinfo) { PresentsSession session = _clmgr.getClient(clinfo.username); if (session != null) { log.info("Booting user that has connected on another node", "username", clinfo.username, "otherNode", nodeName); ...
java
protected void clientLoggedOn (String nodeName, ClientInfo clinfo) { PresentsSession session = _clmgr.getClient(clinfo.username); if (session != null) { log.info("Booting user that has connected on another node", "username", clinfo.username, "otherNode", nodeName); ...
[ "protected", "void", "clientLoggedOn", "(", "String", "nodeName", ",", "ClientInfo", "clinfo", ")", "{", "PresentsSession", "session", "=", "_clmgr", ".", "getClient", "(", "clinfo", ".", "username", ")", ";", "if", "(", "session", "!=", "null", ")", "{", ...
Called when we hear about a client logging on to another node.
[ "Called", "when", "we", "hear", "about", "a", "client", "logging", "on", "to", "another", "node", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1357-L1365
41,206
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.peerAcquiringLock
protected void peerAcquiringLock (PeerNode peer, NodeObject.Lock lock) { // refuse to ratify if we believe someone else owns the lock String owner = queryLock(lock); if (owner != null) { log.warning("Refusing to ratify lock acquisition.", "lock", lock, "node", pee...
java
protected void peerAcquiringLock (PeerNode peer, NodeObject.Lock lock) { // refuse to ratify if we believe someone else owns the lock String owner = queryLock(lock); if (owner != null) { log.warning("Refusing to ratify lock acquisition.", "lock", lock, "node", pee...
[ "protected", "void", "peerAcquiringLock", "(", "PeerNode", "peer", ",", "NodeObject", ".", "Lock", "lock", ")", "{", "// refuse to ratify if we believe someone else owns the lock", "String", "owner", "=", "queryLock", "(", "lock", ")", ";", "if", "(", "owner", "!=",...
Called when a peer announces its intention to acquire a lock.
[ "Called", "when", "a", "peer", "announces", "its", "intention", "to", "acquire", "a", "lock", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1414-L1442
41,207
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.peerReleasingLock
protected void peerReleasingLock (PeerNode peer, NodeObject.Lock lock) { // refuse to ratify if we don't believe they own the lock String owner = queryLock(lock); if (!peer.getNodeName().equals(owner)) { log.warning("Refusing to ratify lock release.", "lock", lock, ...
java
protected void peerReleasingLock (PeerNode peer, NodeObject.Lock lock) { // refuse to ratify if we don't believe they own the lock String owner = queryLock(lock); if (!peer.getNodeName().equals(owner)) { log.warning("Refusing to ratify lock release.", "lock", lock, ...
[ "protected", "void", "peerReleasingLock", "(", "PeerNode", "peer", ",", "NodeObject", ".", "Lock", "lock", ")", "{", "// refuse to ratify if we don't believe they own the lock", "String", "owner", "=", "queryLock", "(", "lock", ")", ";", "if", "(", "!", "peer", "....
Called when a peer announces its intention to release a lock.
[ "Called", "when", "a", "peer", "announces", "its", "intention", "to", "release", "a", "lock", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1447-L1465
41,208
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.peerAddedLock
protected void peerAddedLock (String nodeName, NodeObject.Lock lock) { // check for hijacking if (_nodeobj.locks.contains(lock)) { log.warning("Client hijacked lock owned by this node", "lock", lock, "node", nodeName); droppedLock(lock); } // notify the handl...
java
protected void peerAddedLock (String nodeName, NodeObject.Lock lock) { // check for hijacking if (_nodeobj.locks.contains(lock)) { log.warning("Client hijacked lock owned by this node", "lock", lock, "node", nodeName); droppedLock(lock); } // notify the handl...
[ "protected", "void", "peerAddedLock", "(", "String", "nodeName", ",", "NodeObject", ".", "Lock", "lock", ")", "{", "// check for hijacking", "if", "(", "_nodeobj", ".", "locks", ".", "contains", "(", "lock", ")", ")", "{", "log", ".", "warning", "(", "\"Cl...
Called when a peer adds a lock.
[ "Called", "when", "a", "peer", "adds", "a", "lock", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1470-L1483
41,209
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.peerUpdatedLock
protected void peerUpdatedLock (String nodeName, NodeObject.Lock lock) { // notify the handler, if any LockHandler handler = _locks.get(lock); if (handler != null) { handler.peerUpdatedLock(nodeName); } }
java
protected void peerUpdatedLock (String nodeName, NodeObject.Lock lock) { // notify the handler, if any LockHandler handler = _locks.get(lock); if (handler != null) { handler.peerUpdatedLock(nodeName); } }
[ "protected", "void", "peerUpdatedLock", "(", "String", "nodeName", ",", "NodeObject", ".", "Lock", "lock", ")", "{", "// notify the handler, if any", "LockHandler", "handler", "=", "_locks", ".", "get", "(", "lock", ")", ";", "if", "(", "handler", "!=", "null"...
Called when a peer updates a lock.
[ "Called", "when", "a", "peer", "updates", "a", "lock", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1488-L1495
41,210
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.flattenAction
protected byte[] flattenAction (NodeAction action) { try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); oout.writeObject(action); return bout.toByteArray(); } catch (Exception e) { ...
java
protected byte[] flattenAction (NodeAction action) { try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); oout.writeObject(action); return bout.toByteArray(); } catch (Exception e) { ...
[ "protected", "byte", "[", "]", "flattenAction", "(", "NodeAction", "action", ")", "{", "try", "{", "ByteArrayOutputStream", "bout", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "ObjectOutputStream", "oout", "=", "new", "ObjectOutputStream", "(", "bout", "...
Flattens the supplied node action into bytes.
[ "Flattens", "the", "supplied", "node", "action", "into", "bytes", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1512-L1523
41,211
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerManager.java
PeerManager.flattenRequest
protected byte[] flattenRequest (NodeRequest request) { try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); oout.writeObject(request); return bout.toByteArray(); } catch (Exception e) ...
java
protected byte[] flattenRequest (NodeRequest request) { try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream oout = new ObjectOutputStream(bout); oout.writeObject(request); return bout.toByteArray(); } catch (Exception e) ...
[ "protected", "byte", "[", "]", "flattenRequest", "(", "NodeRequest", "request", ")", "{", "try", "{", "ByteArrayOutputStream", "bout", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "ObjectOutputStream", "oout", "=", "new", "ObjectOutputStream", "(", "bout", ...
Flattens the supplied node request into bytes.
[ "Flattens", "the", "supplied", "node", "request", "into", "bytes", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerManager.java#L1528-L1539
41,212
dkpro/dkpro-argumentation
dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java
ArgumentUnitUtils.propertiesToString
protected static String propertiesToString(Properties properties) { StringWriter stringWriter = new StringWriter(); String comments = Properties.class.getName(); try { properties.store(stringWriter, comments); } catch (IOException e) { throw new Runti...
java
protected static String propertiesToString(Properties properties) { StringWriter stringWriter = new StringWriter(); String comments = Properties.class.getName(); try { properties.store(stringWriter, comments); } catch (IOException e) { throw new Runti...
[ "protected", "static", "String", "propertiesToString", "(", "Properties", "properties", ")", "{", "StringWriter", "stringWriter", "=", "new", "StringWriter", "(", ")", ";", "String", "comments", "=", "Properties", ".", "class", ".", "getName", "(", ")", ";", "...
Serializes properties to String @param properties properties @return string
[ "Serializes", "properties", "to", "String" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-types/src/main/java/org/dkpro/argumentation/types/ArgumentUnitUtils.java#L79-L103
41,213
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
41,214
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
41,215
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
41,216
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
41,217
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
41,218
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
41,219
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
41,220
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
41,221
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
41,222
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
41,223
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
41,224
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
41,225
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
41,226
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
41,227
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
41,228
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
41,229
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
41,230
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
41,231
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
41,232
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
41,233
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
41,234
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
41,235
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
41,236
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
41,237
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
41,238
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
41,239
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
41,240
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
41,241
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
41,242
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
41,243
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
41,244
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
41,245
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
41,246
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
41,247
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
41,248
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
41,249
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
41,250
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
41,251
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
41,252
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
41,253
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
41,254
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
41,255
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
41,256
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
41,257
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
41,258
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
41,259
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
41,260
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
41,261
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
41,262
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
41,263
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
41,264
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
41,265
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
41,266
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
41,267
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
41,268
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
41,269
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
41,270
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
41,271
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
41,272
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
41,273
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
41,274
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
41,275
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
41,276
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
41,277
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
41,278
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
41,279
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
41,280
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
41,281
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
41,282
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
41,283
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
41,284
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
41,285
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
41,286
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
41,287
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
41,288
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
41,289
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
41,290
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
41,291
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
41,292
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
41,293
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
41,294
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
41,295
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
41,296
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
41,297
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
41,298
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
41,299
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