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,500
threerings/narya
core/src/main/java/com/threerings/presents/server/InvocationManager.java
InvocationManager.clearDispatcher
public void clearDispatcher (InvocationMarshaller<?> marsh) { _omgr.requireEventThread(); // sanity check if (marsh == null) { log.warning("Refusing to unregister null marshaller.", new Exception()); return; } if (_dispatchers.remove(marsh.getInvocationCode(...
java
public void clearDispatcher (InvocationMarshaller<?> marsh) { _omgr.requireEventThread(); // sanity check if (marsh == null) { log.warning("Refusing to unregister null marshaller.", new Exception()); return; } if (_dispatchers.remove(marsh.getInvocationCode(...
[ "public", "void", "clearDispatcher", "(", "InvocationMarshaller", "<", "?", ">", "marsh", ")", "{", "_omgr", ".", "requireEventThread", "(", ")", ";", "// sanity check", "if", "(", "marsh", "==", "null", ")", "{", "log", ".", "warning", "(", "\"Refusing to u...
Clears out a dispatcher registration. This should be called to free up resources when an invocation service is no longer going to be used.
[ "Clears", "out", "a", "dispatcher", "registration", ".", "This", "should", "be", "called", "to", "free", "up", "resources", "when", "an", "invocation", "service", "is", "no", "longer", "going", "to", "be", "used", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/InvocationManager.java#L297-L310
41,501
threerings/narya
core/src/main/java/com/threerings/presents/server/InvocationManager.java
InvocationManager.getBootstrapServices
public List<InvocationMarshaller<?>> getBootstrapServices (String[] bootGroups) { List<InvocationMarshaller<?>> services = Lists.newArrayList(); for (String group : bootGroups) { services.addAll(_bootlists.get(group)); } return services; }
java
public List<InvocationMarshaller<?>> getBootstrapServices (String[] bootGroups) { List<InvocationMarshaller<?>> services = Lists.newArrayList(); for (String group : bootGroups) { services.addAll(_bootlists.get(group)); } return services; }
[ "public", "List", "<", "InvocationMarshaller", "<", "?", ">", ">", "getBootstrapServices", "(", "String", "[", "]", "bootGroups", ")", "{", "List", "<", "InvocationMarshaller", "<", "?", ">", ">", "services", "=", "Lists", ".", "newArrayList", "(", ")", ";...
Constructs a list of all bootstrap services registered in any of the supplied groups.
[ "Constructs", "a", "list", "of", "all", "bootstrap", "services", "registered", "in", "any", "of", "the", "supplied", "groups", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/InvocationManager.java#L315-L322
41,502
threerings/narya
core/src/main/java/com/threerings/presents/server/InvocationManager.java
InvocationManager.getDispatcherClass
public Class<?> getDispatcherClass (int invCode) { Object dispatcher = _dispatchers.get(invCode); return (dispatcher == null) ? null : dispatcher.getClass(); }
java
public Class<?> getDispatcherClass (int invCode) { Object dispatcher = _dispatchers.get(invCode); return (dispatcher == null) ? null : dispatcher.getClass(); }
[ "public", "Class", "<", "?", ">", "getDispatcherClass", "(", "int", "invCode", ")", "{", "Object", "dispatcher", "=", "_dispatchers", ".", "get", "(", "invCode", ")", ";", "return", "(", "dispatcher", "==", "null", ")", "?", "null", ":", "dispatcher", "....
Get the class that is being used to dispatch the specified invocation code, for informational purposes. @return the Class, or null if no dispatcher is registered with the specified code.
[ "Get", "the", "class", "that", "is", "being", "used", "to", "dispatch", "the", "specified", "invocation", "code", "for", "informational", "purposes", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/InvocationManager.java#L331-L335
41,503
threerings/narya
core/src/main/java/com/threerings/presents/server/InvocationManager.java
InvocationManager.dispatchRequest
protected void dispatchRequest ( int clientOid, int invCode, int methodId, Object[] args, Transport transport) { // make sure the client is still around ClientObject source = (ClientObject)_omgr.getObject(clientOid); if (source == null) { log.info("Client no longer around...
java
protected void dispatchRequest ( int clientOid, int invCode, int methodId, Object[] args, Transport transport) { // make sure the client is still around ClientObject source = (ClientObject)_omgr.getObject(clientOid); if (source == null) { log.info("Client no longer around...
[ "protected", "void", "dispatchRequest", "(", "int", "clientOid", ",", "int", "invCode", ",", "int", "methodId", ",", "Object", "[", "]", "args", ",", "Transport", "transport", ")", "{", "// make sure the client is still around", "ClientObject", "source", "=", "(",...
Called when we receive an invocation request message. Dispatches the request to the appropriate invocation provider via the registered invocation dispatcher.
[ "Called", "when", "we", "receive", "an", "invocation", "request", "message", ".", "Dispatches", "the", "request", "to", "the", "appropriate", "invocation", "provider", "via", "the", "registered", "invocation", "dispatcher", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/InvocationManager.java#L353-L422
41,504
threerings/narya
core/src/main/java/com/threerings/crowd/chat/data/ChatMessage.java
ChatMessage.setClientInfo
public void setClientInfo (String msg, String ltype) { message = msg; localtype = ltype; bundle = null; timestamp = System.currentTimeMillis(); }
java
public void setClientInfo (String msg, String ltype) { message = msg; localtype = ltype; bundle = null; timestamp = System.currentTimeMillis(); }
[ "public", "void", "setClientInfo", "(", "String", "msg", ",", "String", "ltype", ")", "{", "message", "=", "msg", ";", "localtype", "=", "ltype", ";", "bundle", "=", "null", ";", "timestamp", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}" ]
Once this message reaches the client, the information contained within is changed around a bit.
[ "Once", "this", "message", "reaches", "the", "client", "the", "information", "contained", "within", "is", "changed", "around", "a", "bit", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/data/ChatMessage.java#L63-L69
41,505
criccomini/ezdb
ezdb-api/src/main/java/ezdb/comparator/SerdeComparator.java
SerdeComparator.innerCompare
protected int innerCompare(Comparable<Object> co1, Comparable<Object> co2) { return co1.compareTo(co2); }
java
protected int innerCompare(Comparable<Object> co1, Comparable<Object> co2) { return co1.compareTo(co2); }
[ "protected", "int", "innerCompare", "(", "Comparable", "<", "Object", ">", "co1", ",", "Comparable", "<", "Object", ">", "co2", ")", "{", "return", "co1", ".", "compareTo", "(", "co2", ")", ";", "}" ]
Override this to customize the comparation itself. E.g. inversing it.
[ "Override", "this", "to", "customize", "the", "comparation", "itself", ".", "E", ".", "g", ".", "inversing", "it", "." ]
2adaccee179614f01e1c7e5af82a4f731e4e72cc
https://github.com/criccomini/ezdb/blob/2adaccee179614f01e1c7e5af82a4f731e4e72cc/ezdb-api/src/main/java/ezdb/comparator/SerdeComparator.java#L37-L39
41,506
threerings/narya
tools/src/main/java/com/threerings/presents/tools/InstrumentStreamableTask.java
InstrumentStreamableTask.processClass
protected void processClass (File source) { CtClass clazz; InputStream in = null; try { clazz = _pool.makeClass(in = new BufferedInputStream(new FileInputStream(source))); } catch (IOException ioe) { System.err.println("Failed to load " + source + ": " + ioe);...
java
protected void processClass (File source) { CtClass clazz; InputStream in = null; try { clazz = _pool.makeClass(in = new BufferedInputStream(new FileInputStream(source))); } catch (IOException ioe) { System.err.println("Failed to load " + source + ": " + ioe);...
[ "protected", "void", "processClass", "(", "File", "source", ")", "{", "CtClass", "clazz", ";", "InputStream", "in", "=", "null", ";", "try", "{", "clazz", "=", "_pool", ".", "makeClass", "(", "in", "=", "new", "BufferedInputStream", "(", "new", "FileInputS...
Processes a class file.
[ "Processes", "a", "class", "file", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/InstrumentStreamableTask.java#L122-L143
41,507
threerings/narya
core/src/main/java/com/threerings/bureau/client/BureauDirector.java
BureauDirector.createAgent
protected synchronized void createAgent (int agentId) { Subscriber<AgentObject> delegator = new Subscriber<AgentObject>() { public void objectAvailable (AgentObject agentObject) { BureauDirector.this.objectAvailable(agentObject); } public void requestFaile...
java
protected synchronized void createAgent (int agentId) { Subscriber<AgentObject> delegator = new Subscriber<AgentObject>() { public void objectAvailable (AgentObject agentObject) { BureauDirector.this.objectAvailable(agentObject); } public void requestFaile...
[ "protected", "synchronized", "void", "createAgent", "(", "int", "agentId", ")", "{", "Subscriber", "<", "AgentObject", ">", "delegator", "=", "new", "Subscriber", "<", "AgentObject", ">", "(", ")", "{", "public", "void", "objectAvailable", "(", "AgentObject", ...
Creates a new agent when the server requests it.
[ "Creates", "a", "new", "agent", "when", "the", "server", "requests", "it", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/client/BureauDirector.java#L65-L82
41,508
threerings/narya
core/src/main/java/com/threerings/bureau/client/BureauDirector.java
BureauDirector.destroyAgent
protected synchronized void destroyAgent (int agentId) { Agent agent = null; agent = _agents.remove(agentId); if (agent == null) { log.warning("Lost an agent, id " + agentId); } else { try { agent.stop(); } catch (Throwable t) { ...
java
protected synchronized void destroyAgent (int agentId) { Agent agent = null; agent = _agents.remove(agentId); if (agent == null) { log.warning("Lost an agent, id " + agentId); } else { try { agent.stop(); } catch (Throwable t) { ...
[ "protected", "synchronized", "void", "destroyAgent", "(", "int", "agentId", ")", "{", "Agent", "agent", "=", "null", ";", "agent", "=", "_agents", ".", "remove", "(", "agentId", ")", ";", "if", "(", "agent", "==", "null", ")", "{", "log", ".", "warning...
Destroys an agent at the server's request.
[ "Destroys", "an", "agent", "at", "the", "server", "s", "request", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/client/BureauDirector.java#L87-L108
41,509
threerings/narya
core/src/main/java/com/threerings/bureau/client/BureauDirector.java
BureauDirector.objectAvailable
protected synchronized void objectAvailable (AgentObject agentObject) { int oid = agentObject.getOid(); log.info("Object " + oid + " now available"); Agent agent; try { agent = createAgent(agentObject); agent.init(agentObject); agent.start(); ...
java
protected synchronized void objectAvailable (AgentObject agentObject) { int oid = agentObject.getOid(); log.info("Object " + oid + " now available"); Agent agent; try { agent = createAgent(agentObject); agent.init(agentObject); agent.start(); ...
[ "protected", "synchronized", "void", "objectAvailable", "(", "AgentObject", "agentObject", ")", "{", "int", "oid", "=", "agentObject", ".", "getOid", "(", ")", ";", "log", ".", "info", "(", "\"Object \"", "+", "oid", "+", "\" now available\"", ")", ";", "Age...
Callback for when the a request to subscribe to an object finishes and the object is available.
[ "Callback", "for", "when", "the", "a", "request", "to", "subscribe", "to", "an", "object", "finishes", "and", "the", "object", "is", "available", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/client/BureauDirector.java#L114-L133
41,510
threerings/narya
core/src/main/java/com/threerings/presents/util/PersistingUnit.java
PersistingUnit.handleSuccess
public void handleSuccess () { if (_listener instanceof InvocationService.ConfirmListener) { reportRequestProcessed(); } else if (_listener instanceof InvocationService.ResultListener && _resultSet) { reportRequestProcessed(_result); } }
java
public void handleSuccess () { if (_listener instanceof InvocationService.ConfirmListener) { reportRequestProcessed(); } else if (_listener instanceof InvocationService.ResultListener && _resultSet) { reportRequestProcessed(_result); } }
[ "public", "void", "handleSuccess", "(", ")", "{", "if", "(", "_listener", "instanceof", "InvocationService", ".", "ConfirmListener", ")", "{", "reportRequestProcessed", "(", ")", ";", "}", "else", "if", "(", "_listener", "instanceof", "InvocationService", ".", "...
Handles the success case, which by default posts a response to a ConfirmListener. If you need something else, or to repond to a ResultListener, you'll need to override this.
[ "Handles", "the", "success", "case", "which", "by", "default", "posts", "a", "response", "to", "a", "ConfirmListener", ".", "If", "you", "need", "something", "else", "or", "to", "repond", "to", "a", "ResultListener", "you", "ll", "need", "to", "override", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/PersistingUnit.java#L78-L85
41,511
threerings/narya
core/src/main/java/com/threerings/presents/util/PersistingUnit.java
PersistingUnit.handleFailure
public void handleFailure (Exception error) { if (error instanceof InvocationException) { _listener.requestFailed(error.getMessage()); } else { if (_args != null) { log.warning(getFailureMessage(), ArrayUtil.append(_args, error)); } else { ...
java
public void handleFailure (Exception error) { if (error instanceof InvocationException) { _listener.requestFailed(error.getMessage()); } else { if (_args != null) { log.warning(getFailureMessage(), ArrayUtil.append(_args, error)); } else { ...
[ "public", "void", "handleFailure", "(", "Exception", "error", ")", "{", "if", "(", "error", "instanceof", "InvocationException", ")", "{", "_listener", ".", "requestFailed", "(", "error", ".", "getMessage", "(", ")", ")", ";", "}", "else", "{", "if", "(", ...
Handles the failure case by logging the error and reporting an internal error to the listener.
[ "Handles", "the", "failure", "case", "by", "logging", "the", "error", "and", "reporting", "an", "internal", "error", "to", "the", "listener", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/PersistingUnit.java#L91-L103
41,512
threerings/narya
core/src/main/java/com/threerings/presents/server/ShutdownManager.java
ShutdownManager.addConstraint
public void addConstraint (Shutdowner lhs, Constraint constraint, Shutdowner rhs) { switch (constraint) { case RUNS_BEFORE: _cycle.addShutdownConstraint(lhs, Lifecycle.Constraint.RUNS_BEFORE, rhs); break; case RUNS_AFTER: _cycle.addShutdownConstraint(lhs, ...
java
public void addConstraint (Shutdowner lhs, Constraint constraint, Shutdowner rhs) { switch (constraint) { case RUNS_BEFORE: _cycle.addShutdownConstraint(lhs, Lifecycle.Constraint.RUNS_BEFORE, rhs); break; case RUNS_AFTER: _cycle.addShutdownConstraint(lhs, ...
[ "public", "void", "addConstraint", "(", "Shutdowner", "lhs", ",", "Constraint", "constraint", ",", "Shutdowner", "rhs", ")", "{", "switch", "(", "constraint", ")", "{", "case", "RUNS_BEFORE", ":", "_cycle", ".", "addShutdownConstraint", "(", "lhs", ",", "Lifec...
Adds a constraint that a certain shutdowner must be run before another.
[ "Adds", "a", "constraint", "that", "a", "certain", "shutdowner", "must", "be", "run", "before", "another", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ShutdownManager.java#L64-L74
41,513
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnection.java
PresentsConnection.handleDatagram
public void handleDatagram (InetSocketAddress source, DatagramChannel channel, ByteBuffer buf, long when) { // lazily create our various bits and bobs if (_digest == null) { try { _digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmExce...
java
public void handleDatagram (InetSocketAddress source, DatagramChannel channel, ByteBuffer buf, long when) { // lazily create our various bits and bobs if (_digest == null) { try { _digest = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmExce...
[ "public", "void", "handleDatagram", "(", "InetSocketAddress", "source", ",", "DatagramChannel", "channel", ",", "ByteBuffer", "buf", ",", "long", "when", ")", "{", "// lazily create our various bits and bobs", "if", "(", "_digest", "==", "null", ")", "{", "try", "...
Processes a datagram sent to this connection.
[ "Processes", "a", "datagram", "sent", "to", "this", "connection", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnection.java#L165-L210
41,514
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnection.java
PresentsConnection.inheritStreams
protected void inheritStreams (PresentsConnection other) { _fin = other._fin; _oin = other._oin; _oout = other._oout; if (_loader != null) { _oin.setClassLoader(_loader); } }
java
protected void inheritStreams (PresentsConnection other) { _fin = other._fin; _oin = other._oin; _oout = other._oout; if (_loader != null) { _oin.setClassLoader(_loader); } }
[ "protected", "void", "inheritStreams", "(", "PresentsConnection", "other", ")", "{", "_fin", "=", "other", ".", "_fin", ";", "_oin", "=", "other", ".", "_oin", ";", "_oout", "=", "other", ".", "_oout", ";", "if", "(", "_loader", "!=", "null", ")", "{",...
Instructs this connection to inherit its streams from the supplied connection object. This is called by the connection manager when the time comes to pass streams from the authing connection to the running connection.
[ "Instructs", "this", "connection", "to", "inherit", "its", "streams", "from", "the", "supplied", "connection", "object", ".", "This", "is", "called", "by", "the", "connection", "manager", "when", "the", "time", "comes", "to", "pass", "streams", "from", "the", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnection.java#L287-L295
41,515
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.setDefaultAccessController
public void setDefaultAccessController (AccessController controller) { AccessController oldDefault = _defaultController; _defaultController = controller; // switch all objects from the old default (null, usually) to the new default. for (DObject obj : _objects.values()) { ...
java
public void setDefaultAccessController (AccessController controller) { AccessController oldDefault = _defaultController; _defaultController = controller; // switch all objects from the old default (null, usually) to the new default. for (DObject obj : _objects.values()) { ...
[ "public", "void", "setDefaultAccessController", "(", "AccessController", "controller", ")", "{", "AccessController", "oldDefault", "=", "_defaultController", ";", "_defaultController", "=", "controller", ";", "// switch all objects from the old default (null, usually) to the new de...
Sets up an access controller that will be provided to any distributed objects created on the server. The controllers can subsequently be overridden if desired, but a default controller is useful for implementing basic access control policies.
[ "Sets", "up", "an", "access", "controller", "that", "will", "be", "provided", "to", "any", "distributed", "objects", "created", "on", "the", "server", ".", "The", "controllers", "can", "subsequently", "be", "overridden", "if", "desired", "but", "a", "default",...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L152-L163
41,516
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.clearProxyObject
public void clearProxyObject (int origObjectId, DObject object) { if (_proxies.remove(object.getOid()) == null) { log.warning("Missing proxy mapping for cleared proxy", "ooid", origObjectId); } _objects.remove(object.getOid()); }
java
public void clearProxyObject (int origObjectId, DObject object) { if (_proxies.remove(object.getOid()) == null) { log.warning("Missing proxy mapping for cleared proxy", "ooid", origObjectId); } _objects.remove(object.getOid()); }
[ "public", "void", "clearProxyObject", "(", "int", "origObjectId", ",", "DObject", "object", ")", "{", "if", "(", "_proxies", ".", "remove", "(", "object", ".", "getOid", "(", ")", ")", "==", "null", ")", "{", "log", ".", "warning", "(", "\"Missing proxy ...
Clears a proxy object reference from our local distributed object space. This merely removes it from our internal tables, the caller is responsible for coordinating the deregistration of the object with the proxying client.
[ "Clears", "a", "proxy", "object", "reference", "from", "our", "local", "distributed", "object", "space", ".", "This", "merely", "removes", "it", "from", "our", "internal", "tables", "the", "caller", "is", "responsible", "for", "coordinating", "the", "deregistrat...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L186-L192
41,517
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.getStats
public Stats getStats (boolean snapshot) { if (snapshot) { _recent = _current; _current = new Stats(); _current.maxQueueSize = _evqueue.size(); } return _recent; }
java
public Stats getStats (boolean snapshot) { if (snapshot) { _recent = _current; _current = new Stats(); _current.maxQueueSize = _evqueue.size(); } return _recent; }
[ "public", "Stats", "getStats", "(", "boolean", "snapshot", ")", "{", "if", "(", "snapshot", ")", "{", "_recent", "=", "_current", ";", "_current", "=", "new", "Stats", "(", ")", ";", "_current", ".", "maxQueueSize", "=", "_evqueue", ".", "size", "(", "...
Returns a recent snapshot of runtime statistics tracked by the distributed object manager. @param snapshot if true, the current stats will be snapshotted and reset and the new snapshot will be returned. If false, the previous snapshot will be returned. If no snapshot has ever been taken, the current stats that have be...
[ "Returns", "a", "recent", "snapshot", "of", "runtime", "statistics", "tracked", "by", "the", "distributed", "object", "manager", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L311-L319
41,518
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.run
public void run () { log.info("DOMGR running."); // make a note of the thread that's processing events synchronized (this) { _dobjThread = Thread.currentThread(); } while (isRunning()) { // pop the next unit off the queue and process it p...
java
public void run () { log.info("DOMGR running."); // make a note of the thread that's processing events synchronized (this) { _dobjThread = Thread.currentThread(); } while (isRunning()) { // pop the next unit off the queue and process it p...
[ "public", "void", "run", "(", ")", "{", "log", ".", "info", "(", "\"DOMGR running.\"", ")", ";", "// make a note of the thread that's processing events", "synchronized", "(", "this", ")", "{", "_dobjThread", "=", "Thread", ".", "currentThread", "(", ")", ";", "}...
Runs the dobjmgr event loop until it is requested to exit. This should be called from the main application thread.
[ "Runs", "the", "dobjmgr", "event", "loop", "until", "it", "is", "requested", "to", "exit", ".", "This", "should", "be", "called", "from", "the", "main", "application", "thread", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L388-L403
41,519
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.dumpUnitProfiles
public void dumpUnitProfiles () { for (Map.Entry<String, UnitProfile> entry : _profiles.entrySet()) { log.info("P: " + entry.getKey() + " => " + entry.getValue()); } }
java
public void dumpUnitProfiles () { for (Map.Entry<String, UnitProfile> entry : _profiles.entrySet()) { log.info("P: " + entry.getKey() + " => " + entry.getValue()); } }
[ "public", "void", "dumpUnitProfiles", "(", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "UnitProfile", ">", "entry", ":", "_profiles", ".", "entrySet", "(", ")", ")", "{", "log", ".", "info", "(", "\"P: \"", "+", "entry", ".", "getK...
Dumps collected profiling information to the system log.
[ "Dumps", "collected", "profiling", "information", "to", "the", "system", "log", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L438-L443
41,520
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.processUnit
protected void processUnit (Object unit) { long start = System.nanoTime(); // keep track of the largest queue size we've seen int queueSize = _evqueue.size(); if (queueSize > _current.maxQueueSize) { _current.maxQueueSize = queueSize; } try { ...
java
protected void processUnit (Object unit) { long start = System.nanoTime(); // keep track of the largest queue size we've seen int queueSize = _evqueue.size(); if (queueSize > _current.maxQueueSize) { _current.maxQueueSize = queueSize; } try { ...
[ "protected", "void", "processUnit", "(", "Object", "unit", ")", "{", "long", "start", "=", "System", ".", "nanoTime", "(", ")", ";", "// keep track of the largest queue size we've seen", "int", "queueSize", "=", "_evqueue", ".", "size", "(", ")", ";", "if", "(...
Processes a single unit from the queue.
[ "Processes", "a", "single", "unit", "from", "the", "queue", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L653-L725
41,521
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.processCompoundEvent
protected void processCompoundEvent (CompoundEvent event) { List<DEvent> events = event.getEvents(); int ecount = events.size(); // look up the target object DObject target = _objects.get(event.getTargetOid()); if (target == null) { log.debug("Compound event targ...
java
protected void processCompoundEvent (CompoundEvent event) { List<DEvent> events = event.getEvents(); int ecount = events.size(); // look up the target object DObject target = _objects.get(event.getTargetOid()); if (target == null) { log.debug("Compound event targ...
[ "protected", "void", "processCompoundEvent", "(", "CompoundEvent", "event", ")", "{", "List", "<", "DEvent", ">", "events", "=", "event", ".", "getEvents", "(", ")", ";", "int", "ecount", "=", "events", ".", "size", "(", ")", ";", "// look up the target obje...
Performs the processing associated with a compound event, notifying listeners and the like.
[ "Performs", "the", "processing", "associated", "with", "a", "compound", "event", "notifying", "listeners", "and", "the", "like", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L730-L758
41,522
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.processEvent
protected void processEvent (DEvent event) { // look up the target object DObject target = _objects.get(event.getTargetOid()); if (target == null) { log.debug("Event target no longer exists", "event", event); return; } // check the event's permissions...
java
protected void processEvent (DEvent event) { // look up the target object DObject target = _objects.get(event.getTargetOid()); if (target == null) { log.debug("Event target no longer exists", "event", event); return; } // check the event's permissions...
[ "protected", "void", "processEvent", "(", "DEvent", "event", ")", "{", "// look up the target object", "DObject", "target", "=", "_objects", ".", "get", "(", "event", ".", "getTargetOid", "(", ")", ")", ";", "if", "(", "target", "==", "null", ")", "{", "lo...
Performs the processing associated with an event, notifying listeners and the like.
[ "Performs", "the", "processing", "associated", "with", "an", "event", "notifying", "listeners", "and", "the", "like", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L763-L782
41,523
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.handleFatalError
protected void handleFatalError (Object causer, Error error) { if (_fatalThrottle.throttleOp()) { throw error; } log.warning("Fatal error caused by '" + causer + "': " + error, error); }
java
protected void handleFatalError (Object causer, Error error) { if (_fatalThrottle.throttleOp()) { throw error; } log.warning("Fatal error caused by '" + causer + "': " + error, error); }
[ "protected", "void", "handleFatalError", "(", "Object", "causer", ",", "Error", "error", ")", "{", "if", "(", "_fatalThrottle", ".", "throttleOp", "(", ")", ")", "{", "throw", "error", ";", "}", "log", ".", "warning", "(", "\"Fatal error caused by '\"", "+",...
Attempts to recover from fatal errors but rethrows if things are freaking out too frequently.
[ "Attempts", "to", "recover", "from", "fatal", "errors", "but", "rethrows", "if", "things", "are", "freaking", "out", "too", "frequently", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L829-L835
41,524
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java
PresentsDObjectMgr.registerEventHelpers
protected void registerEventHelpers () { try { _helpers.put(ObjectDestroyedEvent.class, new EventHelper () { public boolean invoke (DEvent event, DObject target) { return objectDestroyed(event, target); } }); _helpers.pu...
java
protected void registerEventHelpers () { try { _helpers.put(ObjectDestroyedEvent.class, new EventHelper () { public boolean invoke (DEvent event, DObject target) { return objectDestroyed(event, target); } }); _helpers.pu...
[ "protected", "void", "registerEventHelpers", "(", ")", "{", "try", "{", "_helpers", ".", "put", "(", "ObjectDestroyedEvent", ".", "class", ",", "new", "EventHelper", "(", ")", "{", "public", "boolean", "invoke", "(", "DEvent", "event", ",", "DObject", "targe...
Registers our event helper methods.
[ "Registers", "our", "event", "helper", "methods", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L884-L906
41,525
threerings/narya
tools/src/main/java/com/threerings/presents/tools/GenTask.java
GenTask.setHeader
public void setHeader (File header) { try { _header = StreamUtil.toString(new FileReader(header)); } catch (IOException ioe) { System.err.println("Unabled to load header '" + header + ": " + ioe.getMessage()); } }
java
public void setHeader (File header) { try { _header = StreamUtil.toString(new FileReader(header)); } catch (IOException ioe) { System.err.println("Unabled to load header '" + header + ": " + ioe.getMessage()); } }
[ "public", "void", "setHeader", "(", "File", "header", ")", "{", "try", "{", "_header", "=", "StreamUtil", ".", "toString", "(", "new", "FileReader", "(", "header", ")", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "System", ".", "err", ...
Configures us with a header file that we'll prepend to all generated source files.
[ "Configures", "us", "with", "a", "header", "file", "that", "we", "ll", "prepend", "to", "all", "generated", "source", "files", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L69-L77
41,526
threerings/narya
tools/src/main/java/com/threerings/presents/tools/GenTask.java
GenTask.wouldProduceSameFile
protected boolean wouldProduceSameFile (String generated, File existing) throws IOException { Iterator<String> generatedLines = Splitter.on(EOL).split(generated).iterator(); for (String prev : Files.readLines(existing, UTF_8)) { if (!generatedLines.hasNext()) { re...
java
protected boolean wouldProduceSameFile (String generated, File existing) throws IOException { Iterator<String> generatedLines = Splitter.on(EOL).split(generated).iterator(); for (String prev : Files.readLines(existing, UTF_8)) { if (!generatedLines.hasNext()) { re...
[ "protected", "boolean", "wouldProduceSameFile", "(", "String", "generated", ",", "File", "existing", ")", "throws", "IOException", "{", "Iterator", "<", "String", ">", "generatedLines", "=", "Splitter", ".", "on", "(", "EOL", ")", ".", "split", "(", "generated...
Returns true if the given string has the same content as the file, sans svn prop lines.
[ "Returns", "true", "if", "the", "given", "string", "has", "the", "same", "content", "as", "the", "file", "sans", "svn", "prop", "lines", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L178-L198
41,527
threerings/narya
tools/src/main/java/com/threerings/presents/tools/GenTask.java
GenTask.mergeTemplate
protected String mergeTemplate (String template, Object... data) throws IOException { return mergeTemplate(template, createMap(data)); }
java
protected String mergeTemplate (String template, Object... data) throws IOException { return mergeTemplate(template, createMap(data)); }
[ "protected", "String", "mergeTemplate", "(", "String", "template", ",", "Object", "...", "data", ")", "throws", "IOException", "{", "return", "mergeTemplate", "(", "template", ",", "createMap", "(", "data", ")", ")", ";", "}" ]
Merges the specified template using the supplied mapping of keys to objects. @param data a series of key, value pairs where the keys must be strings and the values can be any object.
[ "Merges", "the", "specified", "template", "using", "the", "supplied", "mapping", "of", "keys", "to", "objects", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L206-L210
41,528
threerings/narya
tools/src/main/java/com/threerings/presents/tools/GenTask.java
GenTask.mergeTemplate
protected String mergeTemplate (String template, Map<String, Object> data) throws IOException { Reader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(template), UTF_8); return convertEols(Mustache.compiler().escapeHTML(false).compile(reader).execut...
java
protected String mergeTemplate (String template, Map<String, Object> data) throws IOException { Reader reader = new InputStreamReader(getClass().getClassLoader().getResourceAsStream(template), UTF_8); return convertEols(Mustache.compiler().escapeHTML(false).compile(reader).execut...
[ "protected", "String", "mergeTemplate", "(", "String", "template", ",", "Map", "<", "String", ",", "Object", ">", "data", ")", "throws", "IOException", "{", "Reader", "reader", "=", "new", "InputStreamReader", "(", "getClass", "(", ")", ".", "getClassLoader", ...
Merges the specified template using the supplied mapping of string keys to objects. @return a string containing the merged text.
[ "Merges", "the", "specified", "template", "using", "the", "supplied", "mapping", "of", "string", "keys", "to", "objects", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenTask.java#L217-L223
41,529
threerings/narya
core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java
CurseFilter.comicChars
public static String comicChars (int length) { char[] chars = new char[length]; for (int ii=0; ii < length; ii++) { chars[ii] = RandomUtil.pickRandom(COMIC_CHARS); } return new String(chars); }
java
public static String comicChars (int length) { char[] chars = new char[length]; for (int ii=0; ii < length; ii++) { chars[ii] = RandomUtil.pickRandom(COMIC_CHARS); } return new String(chars); }
[ "public", "static", "String", "comicChars", "(", "int", "length", ")", "{", "char", "[", "]", "chars", "=", "new", "char", "[", "length", "]", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<", "length", ";", "ii", "++", ")", "{", "chars", ...
Return a comicy replacement of the specified length.
[ "Return", "a", "comicy", "replacement", "of", "the", "specified", "length", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java#L48-L55
41,530
threerings/narya
core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java
CurseFilter.filter
public String filter (String msg, Name otherUser, boolean outgoing) { // first, check against the drop-always list _stopMatcher.reset(msg); if (_stopMatcher.find()) { return null; } // then see what kind of curse filtering the user has configured Mode lev...
java
public String filter (String msg, Name otherUser, boolean outgoing) { // first, check against the drop-always list _stopMatcher.reset(msg); if (_stopMatcher.find()) { return null; } // then see what kind of curse filtering the user has configured Mode lev...
[ "public", "String", "filter", "(", "String", "msg", ",", "Name", "otherUser", ",", "boolean", "outgoing", ")", "{", "// first, check against the drop-always list", "_stopMatcher", ".", "reset", "(", "msg", ")", ";", "if", "(", "_stopMatcher", ".", "find", "(", ...
from interface ChatFilter
[ "from", "interface", "ChatFilter" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java#L89-L152
41,531
threerings/narya
core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java
CurseFilter.configureCurseWords
protected void configureCurseWords (String curseWords) { StringTokenizer st = new StringTokenizer(curseWords); int numWords = st.countTokens(); _matchers = new Matcher[numWords]; _replacements = new String[numWords]; _vernacular = new String[numWords]; _comicLength =...
java
protected void configureCurseWords (String curseWords) { StringTokenizer st = new StringTokenizer(curseWords); int numWords = st.countTokens(); _matchers = new Matcher[numWords]; _replacements = new String[numWords]; _vernacular = new String[numWords]; _comicLength =...
[ "protected", "void", "configureCurseWords", "(", "String", "curseWords", ")", "{", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "curseWords", ")", ";", "int", "numWords", "=", "st", ".", "countTokens", "(", ")", ";", "_matchers", "=", "new", ...
Configure the curse word portion of our filtering.
[ "Configure", "the", "curse", "word", "portion", "of", "our", "filtering", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java#L157-L201
41,532
threerings/narya
core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java
CurseFilter.configureStopWords
protected void configureStopWords (String stopWords) { List<String> patterns = Lists.newArrayList(); for (StringTokenizer st = new StringTokenizer(stopWords); st.hasMoreTokens(); ) { patterns.add(getStopWordRegexp(st.nextToken())); } String pattern = patterns.isEmpty() ...
java
protected void configureStopWords (String stopWords) { List<String> patterns = Lists.newArrayList(); for (StringTokenizer st = new StringTokenizer(stopWords); st.hasMoreTokens(); ) { patterns.add(getStopWordRegexp(st.nextToken())); } String pattern = patterns.isEmpty() ...
[ "protected", "void", "configureStopWords", "(", "String", "stopWords", ")", "{", "List", "<", "String", ">", "patterns", "=", "Lists", ".", "newArrayList", "(", ")", ";", "for", "(", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "stopWords", "...
Configure the words that will stop.
[ "Configure", "the", "words", "that", "will", "stop", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java#L206-L216
41,533
threerings/narya
core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java
CurseFilter.setStopPattern
protected void setStopPattern (String pattern) { _stopMatcher = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(""); }
java
protected void setStopPattern (String pattern) { _stopMatcher = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE).matcher(""); }
[ "protected", "void", "setStopPattern", "(", "String", "pattern", ")", "{", "_stopMatcher", "=", "Pattern", ".", "compile", "(", "pattern", ",", "Pattern", ".", "CASE_INSENSITIVE", ")", ".", "matcher", "(", "\"\"", ")", ";", "}" ]
Sets our stop word matcher to one for the given regular expression.
[ "Sets", "our", "stop", "word", "matcher", "to", "one", "for", "the", "given", "regular", "expression", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/CurseFilter.java#L221-L224
41,534
threerings/narya
core/src/main/java/com/threerings/web/server/ServletWaiter.java
ServletWaiter.queueAndWait
public static <T> T queueAndWait ( RunQueue runq, final String name, final Callable<T> action) throws ServiceException { final ServletWaiter<T> waiter = new ServletWaiter<T>(name); runq.postRunnable(new Runnable() { public void run () { try { ...
java
public static <T> T queueAndWait ( RunQueue runq, final String name, final Callable<T> action) throws ServiceException { final ServletWaiter<T> waiter = new ServletWaiter<T>(name); runq.postRunnable(new Runnable() { public void run () { try { ...
[ "public", "static", "<", "T", ">", "T", "queueAndWait", "(", "RunQueue", "runq", ",", "final", "String", "name", ",", "final", "Callable", "<", "T", ">", "action", ")", "throws", "ServiceException", "{", "final", "ServletWaiter", "<", "T", ">", "waiter", ...
Posts a result getter to be executed on the run queue thread and blocks waiting for the result.
[ "Posts", "a", "result", "getter", "to", "be", "executed", "on", "the", "run", "queue", "thread", "and", "blocks", "waiting", "for", "the", "result", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/web/server/ServletWaiter.java#L83-L98
41,535
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.count
public static <T extends TOP> int count(final Class<T> type, final JCas aJCas) { return JCasUtil.select(aJCas, type).size(); }
java
public static <T extends TOP> int count(final Class<T> type, final JCas aJCas) { return JCasUtil.select(aJCas, type).size(); }
[ "public", "static", "<", "T", "extends", "TOP", ">", "int", "count", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "JCas", "aJCas", ")", "{", "return", "JCasUtil", ".", "select", "(", "aJCas", ",", "type", ")", ".", "size", "(", ")", ...
Counts the number of features structures of the given type in the JCas @param type the type @param aJCas the JCas @return the number of occurrences
[ "Counts", "the", "number", "of", "features", "structures", "of", "the", "given", "type", "in", "the", "JCas" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L54-L57
41,536
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.hasAny
public static <T extends TOP> boolean hasAny(final Class<T> type, final JCas aJCas) { return count(type, aJCas) != 0; }
java
public static <T extends TOP> boolean hasAny(final Class<T> type, final JCas aJCas) { return count(type, aJCas) != 0; }
[ "public", "static", "<", "T", "extends", "TOP", ">", "boolean", "hasAny", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "JCas", "aJCas", ")", "{", "return", "count", "(", "type", ",", "aJCas", ")", "!=", "0", ";", "}" ]
Returns whether there is any feature structure of the given type @param type the type @param aJCas the JCas @return whether there is any feature structure of the given type
[ "Returns", "whether", "there", "is", "any", "feature", "structure", "of", "the", "given", "type" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L66-L69
41,537
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.hasNo
public static <T extends TOP> boolean hasNo(final Class<T> type, final JCas aJCas) { return !hasAny(type, aJCas); }
java
public static <T extends TOP> boolean hasNo(final Class<T> type, final JCas aJCas) { return !hasAny(type, aJCas); }
[ "public", "static", "<", "T", "extends", "TOP", ">", "boolean", "hasNo", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "JCas", "aJCas", ")", "{", "return", "!", "hasAny", "(", "type", ",", "aJCas", ")", ";", "}" ]
Returns whether there is no feature structure of the given type @param type the type @param aJCas the JCas @return whether there is no feature structure of the given type
[ "Returns", "whether", "there", "is", "no", "feature", "structure", "of", "the", "given", "type" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L78-L81
41,538
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.selectAsList
public static <T extends TOP> List<T> selectAsList(final JCas jCas, final Class<T> type) { return new ArrayList<>(JCasUtil.select(jCas, type)); }
java
public static <T extends TOP> List<T> selectAsList(final JCas jCas, final Class<T> type) { return new ArrayList<>(JCasUtil.select(jCas, type)); }
[ "public", "static", "<", "T", "extends", "TOP", ">", "List", "<", "T", ">", "selectAsList", "(", "final", "JCas", "jCas", ",", "final", "Class", "<", "T", ">", "type", ")", "{", "return", "new", "ArrayList", "<>", "(", "JCasUtil", ".", "select", "(",...
Convenience method that selects all feature structures of the given type and creates a list from them. @param jCas the JCas @return the list of all features structures of the given type in the JCas @see JCasUtil#select(JCas, Class)
[ "Convenience", "method", "that", "selects", "all", "feature", "structures", "of", "the", "given", "type", "and", "creates", "a", "list", "from", "them", "." ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L124-L127
41,539
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.doOverlap
public static <T extends Annotation> boolean doOverlap(final T anno1, final T anno2) { return anno1.getEnd() > anno2.getBegin() && anno1.getBegin() < anno2.getEnd(); }
java
public static <T extends Annotation> boolean doOverlap(final T anno1, final T anno2) { return anno1.getEnd() > anno2.getBegin() && anno1.getBegin() < anno2.getEnd(); }
[ "public", "static", "<", "T", "extends", "Annotation", ">", "boolean", "doOverlap", "(", "final", "T", "anno1", ",", "final", "T", "anno2", ")", "{", "return", "anno1", ".", "getEnd", "(", ")", ">", "anno2", ".", "getBegin", "(", ")", "&&", "anno1", ...
Returns whether the given annotations have a non-empty overlap. <p> Note that this method is symmetric. Two annotations overlap if they have at least one character position in common. Annotations that merely touch at the begin or end are not overlapping. </p> <ul> <li>anno1[0,1], anno2[1,2] =&gt; no overlap</li> <li>a...
[ "Returns", "whether", "the", "given", "annotations", "have", "a", "non", "-", "empty", "overlap", "." ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L182-L185
41,540
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.haveSameSpan
public static boolean haveSameSpan(final Annotation anno1, final Annotation anno2) { return anno1.getBegin() == anno2.getBegin() && anno1.getEnd() == anno2.getEnd(); }
java
public static boolean haveSameSpan(final Annotation anno1, final Annotation anno2) { return anno1.getBegin() == anno2.getBegin() && anno1.getEnd() == anno2.getEnd(); }
[ "public", "static", "boolean", "haveSameSpan", "(", "final", "Annotation", "anno1", ",", "final", "Annotation", "anno2", ")", "{", "return", "anno1", ".", "getBegin", "(", ")", "==", "anno2", ".", "getBegin", "(", ")", "&&", "anno1", ".", "getEnd", "(", ...
Returns whether two annotations share the same span <p> The method checks the spans based on the begin and end indices and not based on the covered text. </p> @param anno1 first annotation @param anno2 second annotation @return whether the spans are identical
[ "Returns", "whether", "two", "annotations", "share", "the", "same", "span" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L199-L202
41,541
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.getJCas
public static JCas getJCas(final Annotation annotation) { JCas result = null; try { result = annotation.getCAS().getJCas(); } catch (final CASException e) { throw new IllegalArgumentException(e); } return result; }
java
public static JCas getJCas(final Annotation annotation) { JCas result = null; try { result = annotation.getCAS().getJCas(); } catch (final CASException e) { throw new IllegalArgumentException(e); } return result; }
[ "public", "static", "JCas", "getJCas", "(", "final", "Annotation", "annotation", ")", "{", "JCas", "result", "=", "null", ";", "try", "{", "result", "=", "annotation", ".", "getCAS", "(", ")", ".", "getJCas", "(", ")", ";", "}", "catch", "(", "final", ...
Returns the JCas of this annotation. <p> The method converts the potentially thrown {@link CASException} to an unchecked {@link IllegalArgumentException}. </p> @param annotation the annotation @return the extracted JCas
[ "Returns", "the", "JCas", "of", "this", "annotation", "." ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L215-L227
41,542
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.isFirstCoveredToken
public static boolean isFirstCoveredToken(final Token token, final Annotation annotation) { final JCas jCas = getJCas(annotation); final List<Token> coveredTokens = JCasUtil.selectCovered(jCas, Token.class, annotation); if (coveredTokens.isEmpty()) { return false; } ...
java
public static boolean isFirstCoveredToken(final Token token, final Annotation annotation) { final JCas jCas = getJCas(annotation); final List<Token> coveredTokens = JCasUtil.selectCovered(jCas, Token.class, annotation); if (coveredTokens.isEmpty()) { return false; } ...
[ "public", "static", "boolean", "isFirstCoveredToken", "(", "final", "Token", "token", ",", "final", "Annotation", "annotation", ")", "{", "final", "JCas", "jCas", "=", "getJCas", "(", "annotation", ")", ";", "final", "List", "<", "Token", ">", "coveredTokens",...
Returns whether the given token is the first token covered by the given annotation. @param token the token @param annotation the annotation @return whether the token is the first covered token
[ "Returns", "whether", "the", "given", "token", "is", "the", "first", "token", "covered", "by", "the", "given", "annotation", "." ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L236-L248
41,543
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.updateEnd
public static void updateEnd(final Annotation annotation, final int end) { annotation.removeFromIndexes(); annotation.setEnd(end); annotation.addToIndexes(); }
java
public static void updateEnd(final Annotation annotation, final int end) { annotation.removeFromIndexes(); annotation.setEnd(end); annotation.addToIndexes(); }
[ "public", "static", "void", "updateEnd", "(", "final", "Annotation", "annotation", ",", "final", "int", "end", ")", "{", "annotation", ".", "removeFromIndexes", "(", ")", ";", "annotation", ".", "setEnd", "(", "end", ")", ";", "annotation", ".", "addToIndexe...
Sets the end value of the annotation, updating indexes appropriately @param annotation the annotation @param end the new end value
[ "Sets", "the", "end", "value", "of", "the", "annotation", "updating", "indexes", "appropriately" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L287-L292
41,544
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.updateBegin
public static void updateBegin(final Annotation annotation, final int begin) { annotation.removeFromIndexes(); annotation.setBegin(begin); annotation.addToIndexes(); }
java
public static void updateBegin(final Annotation annotation, final int begin) { annotation.removeFromIndexes(); annotation.setBegin(begin); annotation.addToIndexes(); }
[ "public", "static", "void", "updateBegin", "(", "final", "Annotation", "annotation", ",", "final", "int", "begin", ")", "{", "annotation", ".", "removeFromIndexes", "(", ")", ";", "annotation", ".", "setBegin", "(", "begin", ")", ";", "annotation", ".", "add...
Sets the begin value of the annotation, updating indexes appropriately @param annotation the annotation @param begin the new begin value
[ "Sets", "the", "begin", "value", "of", "the", "annotation", "updating", "indexes", "appropriately" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L300-L305
41,545
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.findTokenByBeginPosition
public static Token findTokenByBeginPosition(JCas jCas, int begin) { for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) { if (token.getBegin() == begin) { return token; } } return null; }
java
public static Token findTokenByBeginPosition(JCas jCas, int begin) { for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) { if (token.getBegin() == begin) { return token; } } return null; }
[ "public", "static", "Token", "findTokenByBeginPosition", "(", "JCas", "jCas", ",", "int", "begin", ")", "{", "for", "(", "Token", "token", ":", "JCasUtil", ".", "select", "(", "getInitialView", "(", "jCas", ")", ",", "Token", ".", "class", ")", ")", "{",...
Returns token at the given position @param jCas jCas @param begin token begin position @return Token or null
[ "Returns", "token", "at", "the", "given", "position" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L332-L341
41,546
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.findTokenByEndPosition
public static Token findTokenByEndPosition(JCas jCas, int end) { for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) { if (token.getEnd() == end) { return token; } } return null; }
java
public static Token findTokenByEndPosition(JCas jCas, int end) { for (Token token : JCasUtil.select(getInitialView(jCas), Token.class)) { if (token.getEnd() == end) { return token; } } return null; }
[ "public", "static", "Token", "findTokenByEndPosition", "(", "JCas", "jCas", ",", "int", "end", ")", "{", "for", "(", "Token", "token", ":", "JCasUtil", ".", "select", "(", "getInitialView", "(", "jCas", ")", ",", "Token", ".", "class", ")", ")", "{", "...
Returns token ending at the given position @param jCas jCas @param end end @return Token or null
[ "Returns", "token", "ending", "at", "the", "given", "position" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L350-L359
41,547
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.getPrecedingTokens
public static List<Token> getPrecedingTokens(JCas jCas, Token token) { List<Token> result = new ArrayList<Token>(); for (Token t : JCasUtil.select(getInitialView(jCas), Token.class)) { if (t.getBegin() < token.getBegin()) { result.add(t); } } ...
java
public static List<Token> getPrecedingTokens(JCas jCas, Token token) { List<Token> result = new ArrayList<Token>(); for (Token t : JCasUtil.select(getInitialView(jCas), Token.class)) { if (t.getBegin() < token.getBegin()) { result.add(t); } } ...
[ "public", "static", "List", "<", "Token", ">", "getPrecedingTokens", "(", "JCas", "jCas", ",", "Token", "token", ")", "{", "List", "<", "Token", ">", "result", "=", "new", "ArrayList", "<", "Token", ">", "(", ")", ";", "for", "(", "Token", "t", ":", ...
Returns a list of tokens preceding the given token @param jCas jCas @param token token @return list of tokens (may be empty if the token is the first one, but never null)
[ "Returns", "a", "list", "of", "tokens", "preceding", "the", "given", "token" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L368-L379
41,548
dkpro/dkpro-argumentation
dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java
JCasUtil2.getPrecedingSentences
public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation) { List<Sentence> result = new ArrayList<Sentence>(); for (Sentence sentence : JCasUtil.select(getInitialView(jCas), Sentence.class)) { if (sentence.getBegin() < annotation.getBegin()) { re...
java
public static List<Sentence> getPrecedingSentences(JCas jCas, Sentence annotation) { List<Sentence> result = new ArrayList<Sentence>(); for (Sentence sentence : JCasUtil.select(getInitialView(jCas), Sentence.class)) { if (sentence.getBegin() < annotation.getBegin()) { re...
[ "public", "static", "List", "<", "Sentence", ">", "getPrecedingSentences", "(", "JCas", "jCas", ",", "Sentence", "annotation", ")", "{", "List", "<", "Sentence", ">", "result", "=", "new", "ArrayList", "<", "Sentence", ">", "(", ")", ";", "for", "(", "Se...
Returns a list of annotations of the same type preceding the given annotation @param jCas jcas @param annotation sentence @return list of sentences sorted incrementally by position
[ "Returns", "a", "list", "of", "annotations", "of", "the", "same", "type", "preceding", "the", "given", "annotation" ]
57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb
https://github.com/dkpro/dkpro-argumentation/blob/57ce6f5e73d8075b7088aeeebb107c85b3d4bbcb/dkpro-argumentation-misc/src/main/java/org/dkpro/argumentation/misc/uima/JCasUtil2.java#L408-L427
41,549
threerings/narya
core/src/main/java/com/threerings/presents/net/PublicKeyCredentials.java
PublicKeyCredentials.getSecret
public byte[] getSecret (PrivateKey key) { if (_secret == null) { _secret = SecureUtil.decryptBytes(key, _encodedSecret, _salt); } return _secret; }
java
public byte[] getSecret (PrivateKey key) { if (_secret == null) { _secret = SecureUtil.decryptBytes(key, _encodedSecret, _salt); } return _secret; }
[ "public", "byte", "[", "]", "getSecret", "(", "PrivateKey", "key", ")", "{", "if", "(", "_secret", "==", "null", ")", "{", "_secret", "=", "SecureUtil", ".", "decryptBytes", "(", "key", ",", "_encodedSecret", ",", "_salt", ")", ";", "}", "return", "_se...
Decodes the secret.
[ "Decodes", "the", "secret", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/PublicKeyCredentials.java#L71-L77
41,550
threerings/narya
core/src/main/java/com/threerings/io/ObjectOutputStream.java
ObjectOutputStream.addTranslation
public void addTranslation (String className, String streamedName) { if (_translations == null) { _translations = Maps.newHashMap(); } _translations.put(className, streamedName); }
java
public void addTranslation (String className, String streamedName) { if (_translations == null) { _translations = Maps.newHashMap(); } _translations.put(className, streamedName); }
[ "public", "void", "addTranslation", "(", "String", "className", ",", "String", "streamedName", ")", "{", "if", "(", "_translations", "==", "null", ")", "{", "_translations", "=", "Maps", ".", "newHashMap", "(", ")", ";", "}", "_translations", ".", "put", "...
Configures this object output stream with a mapping from a classname to a streamed name.
[ "Configures", "this", "object", "output", "stream", "with", "a", "mapping", "from", "a", "classname", "to", "a", "streamed", "name", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectOutputStream.java#L54-L60
41,551
threerings/narya
core/src/main/java/com/threerings/io/ObjectOutputStream.java
ObjectOutputStream.writeIntern
public void writeIntern (String value) throws IOException { // if the value to be written is null, simply write a zero if (value == null) { writeShort(0); return; } // create our intern map if necessary if (_internmap == null) { _i...
java
public void writeIntern (String value) throws IOException { // if the value to be written is null, simply write a zero if (value == null) { writeShort(0); return; } // create our intern map if necessary if (_internmap == null) { _i...
[ "public", "void", "writeIntern", "(", "String", "value", ")", "throws", "IOException", "{", "// if the value to be written is null, simply write a zero", "if", "(", "value", "==", "null", ")", "{", "writeShort", "(", "0", ")", ";", "return", ";", "}", "// create o...
Writes a pooled string value to the output stream.
[ "Writes", "a", "pooled", "string", "value", "to", "the", "output", "stream", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectOutputStream.java#L84-L119
41,552
threerings/narya
core/src/main/java/com/threerings/io/ObjectOutputStream.java
ObjectOutputStream.writeClassMapping
protected ClassMapping writeClassMapping (Class<?> sclass) throws IOException { // create our classmap if necessary if (_classmap == null) { _classmap = Maps.newHashMap(); } // look up the class mapping record ClassMapping cmap = _classmap.get(sclass); ...
java
protected ClassMapping writeClassMapping (Class<?> sclass) throws IOException { // create our classmap if necessary if (_classmap == null) { _classmap = Maps.newHashMap(); } // look up the class mapping record ClassMapping cmap = _classmap.get(sclass); ...
[ "protected", "ClassMapping", "writeClassMapping", "(", "Class", "<", "?", ">", "sclass", ")", "throws", "IOException", "{", "// create our classmap if necessary", "if", "(", "_classmap", "==", "null", ")", "{", "_classmap", "=", "Maps", ".", "newHashMap", "(", "...
Retrieves or creates the class mapping for the supplied class, writes it out to the stream, and returns a reference to it.
[ "Retrieves", "or", "creates", "the", "class", "mapping", "for", "the", "supplied", "class", "writes", "it", "out", "to", "the", "stream", "and", "returns", "a", "reference", "to", "it", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectOutputStream.java#L162-L205
41,553
threerings/narya
core/src/main/java/com/threerings/io/ObjectOutputStream.java
ObjectOutputStream.writeClassMapping
protected void writeClassMapping (int code, Class<?> sclass) throws IOException { writeShort(code); String cname = sclass.getName(); if (_translations != null) { String tname = _translations.get(cname); if (tname != null) { cname = tname; ...
java
protected void writeClassMapping (int code, Class<?> sclass) throws IOException { writeShort(code); String cname = sclass.getName(); if (_translations != null) { String tname = _translations.get(cname); if (tname != null) { cname = tname; ...
[ "protected", "void", "writeClassMapping", "(", "int", "code", ",", "Class", "<", "?", ">", "sclass", ")", "throws", "IOException", "{", "writeShort", "(", "code", ")", ";", "String", "cname", "=", "sclass", ".", "getName", "(", ")", ";", "if", "(", "_t...
Writes out the mapping for a class.
[ "Writes", "out", "the", "mapping", "for", "a", "class", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/ObjectOutputStream.java#L237-L249
41,554
threerings/narya
core/src/main/java/com/threerings/presents/data/TimeBaseMarshaller.java
TimeBaseMarshaller.getTimeOid
public void getTimeOid (String arg1, TimeBaseService.GotTimeBaseListener arg2) { TimeBaseMarshaller.GotTimeBaseMarshaller listener2 = new TimeBaseMarshaller.GotTimeBaseMarshaller(); listener2.listener = arg2; sendRequest(GET_TIME_OID, new Object[] { arg1, listener2 }); ...
java
public void getTimeOid (String arg1, TimeBaseService.GotTimeBaseListener arg2) { TimeBaseMarshaller.GotTimeBaseMarshaller listener2 = new TimeBaseMarshaller.GotTimeBaseMarshaller(); listener2.listener = arg2; sendRequest(GET_TIME_OID, new Object[] { arg1, listener2 }); ...
[ "public", "void", "getTimeOid", "(", "String", "arg1", ",", "TimeBaseService", ".", "GotTimeBaseListener", "arg2", ")", "{", "TimeBaseMarshaller", ".", "GotTimeBaseMarshaller", "listener2", "=", "new", "TimeBaseMarshaller", ".", "GotTimeBaseMarshaller", "(", ")", ";",...
from interface TimeBaseService
[ "from", "interface", "TimeBaseService" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/data/TimeBaseMarshaller.java#L76-L83
41,555
threerings/narya
core/src/main/java/com/threerings/presents/util/DatagramSequencer.java
DatagramSequencer.writeDatagram
public synchronized void writeDatagram (Message datagram) throws IOException { // first write the sequence and acknowledge numbers _uout.writeInt(++_lastNumber); _uout.writeInt(_lastReceived); // make sure the mapped sets are clear Set<Class<?>> mappedClasses = _uout...
java
public synchronized void writeDatagram (Message datagram) throws IOException { // first write the sequence and acknowledge numbers _uout.writeInt(++_lastNumber); _uout.writeInt(_lastReceived); // make sure the mapped sets are clear Set<Class<?>> mappedClasses = _uout...
[ "public", "synchronized", "void", "writeDatagram", "(", "Message", "datagram", ")", "throws", "IOException", "{", "// first write the sequence and acknowledge numbers", "_uout", ".", "writeInt", "(", "++", "_lastNumber", ")", ";", "_uout", ".", "writeInt", "(", "_last...
Writes a datagram to the underlying stream.
[ "Writes", "a", "datagram", "to", "the", "underlying", "stream", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/DatagramSequencer.java#L55-L89
41,556
threerings/narya
core/src/main/java/com/threerings/presents/util/DatagramSequencer.java
DatagramSequencer.readDatagram
public synchronized Message readDatagram () throws IOException, ClassNotFoundException { // read in the sequence number and determine if it's out-of-order int number = _uin.readInt(); if (number <= _lastReceived) { return null; } _missedCount = number - _l...
java
public synchronized Message readDatagram () throws IOException, ClassNotFoundException { // read in the sequence number and determine if it's out-of-order int number = _uin.readInt(); if (number <= _lastReceived) { return null; } _missedCount = number - _l...
[ "public", "synchronized", "Message", "readDatagram", "(", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "// read in the sequence number and determine if it's out-of-order", "int", "number", "=", "_uin", ".", "readInt", "(", ")", ";", "if", "(", "numb...
Reads a datagram from the underlying stream. @return the contents of the datagram, or <code>null</code> if the datagram was received out-of-order.
[ "Reads", "a", "datagram", "from", "the", "underlying", "stream", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/DatagramSequencer.java#L97-L134
41,557
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java
PlaceManagerDelegate.addProvider
protected <T extends InvocationMarshaller<?>> T addProvider ( InvocationProvider prov, Class<T> mclass) { return _plmgr.addProvider(prov, mclass); }
java
protected <T extends InvocationMarshaller<?>> T addProvider ( InvocationProvider prov, Class<T> mclass) { return _plmgr.addProvider(prov, mclass); }
[ "protected", "<", "T", "extends", "InvocationMarshaller", "<", "?", ">", ">", "T", "addProvider", "(", "InvocationProvider", "prov", ",", "Class", "<", "T", ">", "mclass", ")", "{", "return", "_plmgr", ".", "addProvider", "(", "prov", ",", "mclass", ")", ...
Registers an invocation provider and notes the registration such that it will be automatically cleared when our parent manager shuts down.
[ "Registers", "an", "invocation", "provider", "and", "notes", "the", "registration", "such", "that", "it", "will", "be", "automatically", "cleared", "when", "our", "parent", "manager", "shuts", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java#L118-L122
41,558
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java
PlaceManagerDelegate.addDispatcher
protected <T extends InvocationMarshaller<?>> T addDispatcher (InvocationDispatcher<T> disp) { return _plmgr.addDispatcher(disp); }
java
protected <T extends InvocationMarshaller<?>> T addDispatcher (InvocationDispatcher<T> disp) { return _plmgr.addDispatcher(disp); }
[ "protected", "<", "T", "extends", "InvocationMarshaller", "<", "?", ">", ">", "T", "addDispatcher", "(", "InvocationDispatcher", "<", "T", ">", "disp", ")", "{", "return", "_plmgr", ".", "addDispatcher", "(", "disp", ")", ";", "}" ]
Registers an invocation dispatcher and notes the registration such that it will be automatically cleared when our parent manager shuts down.
[ "Registers", "an", "invocation", "dispatcher", "and", "notes", "the", "registration", "such", "that", "it", "will", "be", "automatically", "cleared", "when", "our", "parent", "manager", "shuts", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManagerDelegate.java#L128-L131
41,559
threerings/narya
core/src/main/java/com/threerings/presents/net/SecureResponse.java
SecureResponse.createSecret
public byte[] createSecret (PublicKeyCredentials pkcred, PrivateKey key, int length) { _data = new AuthResponseData(); byte[] clientSecret = pkcred.getSecret(key); if (clientSecret == null) { _data.code = FAILED_TO_SECURE; return null; } byte[] secret ...
java
public byte[] createSecret (PublicKeyCredentials pkcred, PrivateKey key, int length) { _data = new AuthResponseData(); byte[] clientSecret = pkcred.getSecret(key); if (clientSecret == null) { _data.code = FAILED_TO_SECURE; return null; } byte[] secret ...
[ "public", "byte", "[", "]", "createSecret", "(", "PublicKeyCredentials", "pkcred", ",", "PrivateKey", "key", ",", "int", "length", ")", "{", "_data", "=", "new", "AuthResponseData", "(", ")", ";", "byte", "[", "]", "clientSecret", "=", "pkcred", ".", "getS...
Encodes the server secret in the response data, or sets the failed state. @return the server secret if successfully encoded, or null.
[ "Encodes", "the", "server", "secret", "in", "the", "response", "data", "or", "sets", "the", "failed", "state", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/SecureResponse.java#L59-L70
41,560
threerings/narya
core/src/main/java/com/threerings/presents/net/SecureResponse.java
SecureResponse.getCodeBytes
public byte[] getCodeBytes (PublicKeyCredentials pkcreds) { return pkcreds == null || _data.code == null || _data.code.equals(FAILED_TO_SECURE) ? null : SecureUtil.xorBytes(StringUtil.unhexlate(_data.code), pkcreds.getSecret()); }
java
public byte[] getCodeBytes (PublicKeyCredentials pkcreds) { return pkcreds == null || _data.code == null || _data.code.equals(FAILED_TO_SECURE) ? null : SecureUtil.xorBytes(StringUtil.unhexlate(_data.code), pkcreds.getSecret()); }
[ "public", "byte", "[", "]", "getCodeBytes", "(", "PublicKeyCredentials", "pkcreds", ")", "{", "return", "pkcreds", "==", "null", "||", "_data", ".", "code", "==", "null", "||", "_data", ".", "code", ".", "equals", "(", "FAILED_TO_SECURE", ")", "?", "null",...
Returns the code bytes or null for a failed state.
[ "Returns", "the", "code", "bytes", "or", "null", "for", "a", "failed", "state", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/SecureResponse.java#L75-L79
41,561
threerings/narya
core/src/main/java/com/threerings/presents/server/ReportManager.java
ReportManager.activatePeriodicReport
public void activatePeriodicReport (RootDObjectManager omgr) { // queue up an interval which will generate reports as long as the omgr is alive omgr.newInterval(new Runnable() { public void run () { logReport(LOG_REPORT_HEADER + generateReport(DE...
java
public void activatePeriodicReport (RootDObjectManager omgr) { // queue up an interval which will generate reports as long as the omgr is alive omgr.newInterval(new Runnable() { public void run () { logReport(LOG_REPORT_HEADER + generateReport(DE...
[ "public", "void", "activatePeriodicReport", "(", "RootDObjectManager", "omgr", ")", "{", "// queue up an interval which will generate reports as long as the omgr is alive", "omgr", ".", "newInterval", "(", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")...
Starts up our periodic report generation task.
[ "Starts", "up", "our", "periodic", "report", "generation", "task", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ReportManager.java#L67-L76
41,562
threerings/narya
core/src/main/java/com/threerings/presents/server/ReportManager.java
ReportManager.generateReport
protected String generateReport (String type, long now, boolean reset) { long sinceLast = now - _lastReportStamp; long uptime = now - _serverStartTime; StringBuilder report = new StringBuilder(); // add standard bits to the default report if (DEFAULT_TYPE.equals(type)) { ...
java
protected String generateReport (String type, long now, boolean reset) { long sinceLast = now - _lastReportStamp; long uptime = now - _serverStartTime; StringBuilder report = new StringBuilder(); // add standard bits to the default report if (DEFAULT_TYPE.equals(type)) { ...
[ "protected", "String", "generateReport", "(", "String", "type", ",", "long", "now", ",", "boolean", "reset", ")", "{", "long", "sinceLast", "=", "now", "-", "_lastReportStamp", ";", "long", "uptime", "=", "now", "-", "_serverStartTime", ";", "StringBuilder", ...
Generates and logs a "state of server" report.
[ "Generates", "and", "logs", "a", "state", "of", "server", "report", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ReportManager.java#L113-L165
41,563
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerNode.java
PeerNode.init
public void init (NodeRecord record) { _record = record; _client = new Client(null, _omgr) { @Override protected void convertFromRemote (DObject target, DEvent event) { super.convertFromRemote(target, event); // rewrite the event's target oid using the oid...
java
public void init (NodeRecord record) { _record = record; _client = new Client(null, _omgr) { @Override protected void convertFromRemote (DObject target, DEvent event) { super.convertFromRemote(target, event); // rewrite the event's target oid using the oid...
[ "public", "void", "init", "(", "NodeRecord", "record", ")", "{", "_record", "=", "record", ";", "_client", "=", "new", "Client", "(", "null", ",", "_omgr", ")", "{", "@", "Override", "protected", "void", "convertFromRemote", "(", "DObject", "target", ",", ...
Initializes this peer node and creates its internal client.
[ "Initializes", "this", "peer", "node", "and", "creates", "its", "internal", "client", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerNode.java#L66-L90
41,564
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/PeerNode.java
PeerNode.objectAvailable
public void objectAvailable (NodeObject object) { // listen for lock and cache updates nodeobj = object; nodeobj.addListener(_listener = createListener()); _peermgr.connectedToPeer(this); String nodeName = getNodeName(); for (ClientInfo clinfo : nodeobj.clients) { ...
java
public void objectAvailable (NodeObject object) { // listen for lock and cache updates nodeobj = object; nodeobj.addListener(_listener = createListener()); _peermgr.connectedToPeer(this); String nodeName = getNodeName(); for (ClientInfo clinfo : nodeobj.clients) { ...
[ "public", "void", "objectAvailable", "(", "NodeObject", "object", ")", "{", "// listen for lock and cache updates", "nodeobj", "=", "object", ";", "nodeobj", ".", "addListener", "(", "_listener", "=", "createListener", "(", ")", ")", ";", "_peermgr", ".", "connect...
documentation inherited from interface Subscriber
[ "documentation", "inherited", "from", "interface", "Subscriber" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/PeerNode.java#L246-L261
41,565
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java
NodeRepository.loadNodes
public List<NodeRecord> loadNodes (String namespace, boolean includeShutdown) { // we specifically avoid caching this query because we want the servers to always see the // most up to date set of nodes Query<NodeRecord> query = from(NodeRecord.class).noCache(); List<SQLExpression<?>>...
java
public List<NodeRecord> loadNodes (String namespace, boolean includeShutdown) { // we specifically avoid caching this query because we want the servers to always see the // most up to date set of nodes Query<NodeRecord> query = from(NodeRecord.class).noCache(); List<SQLExpression<?>>...
[ "public", "List", "<", "NodeRecord", ">", "loadNodes", "(", "String", "namespace", ",", "boolean", "includeShutdown", ")", "{", "// we specifically avoid caching this query because we want the servers to always see the", "// most up to date set of nodes", "Query", "<", "NodeRecor...
Returns a list of all nodes registered in the repository with names starting with the given string, optionally including nodes that are explicitly shut down.
[ "Returns", "a", "list", "of", "all", "nodes", "registered", "in", "the", "repository", "with", "names", "starting", "with", "the", "given", "string", "optionally", "including", "nodes", "that", "are", "explicitly", "shut", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java#L78-L91
41,566
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java
NodeRepository.loadNodesFromRegion
public List<NodeRecord> loadNodesFromRegion (String region) { return from(NodeRecord.class) .noCache() .where(NodeRecord.REGION.eq(region), Ops.not(NodeRecord.SHUTDOWN)) .select(); }
java
public List<NodeRecord> loadNodesFromRegion (String region) { return from(NodeRecord.class) .noCache() .where(NodeRecord.REGION.eq(region), Ops.not(NodeRecord.SHUTDOWN)) .select(); }
[ "public", "List", "<", "NodeRecord", ">", "loadNodesFromRegion", "(", "String", "region", ")", "{", "return", "from", "(", "NodeRecord", ".", "class", ")", ".", "noCache", "(", ")", ".", "where", "(", "NodeRecord", ".", "REGION", ".", "eq", "(", "region"...
Returns a list of nodes registered in the repository with the specified region that are not explicitly shut down.
[ "Returns", "a", "list", "of", "nodes", "registered", "in", "the", "repository", "with", "the", "specified", "region", "that", "are", "not", "explicitly", "shut", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java#L97-L103
41,567
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java
NodeRepository.updateNode
public void updateNode (NodeRecord record) { record.lastUpdated = new Timestamp(System.currentTimeMillis()); store(record); }
java
public void updateNode (NodeRecord record) { record.lastUpdated = new Timestamp(System.currentTimeMillis()); store(record); }
[ "public", "void", "updateNode", "(", "NodeRecord", "record", ")", "{", "record", ".", "lastUpdated", "=", "new", "Timestamp", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "store", "(", "record", ")", ";", "}" ]
Updates the supplied node record, inserting it into the database if necessary.
[ "Updates", "the", "supplied", "node", "record", "inserting", "it", "into", "the", "database", "if", "necessary", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java#L108-L112
41,568
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java
NodeRepository.shutdownNode
public void shutdownNode (String nodeName) { updatePartial(NodeRecord.getKey(nodeName), NodeRecord.SHUTDOWN, true); }
java
public void shutdownNode (String nodeName) { updatePartial(NodeRecord.getKey(nodeName), NodeRecord.SHUTDOWN, true); }
[ "public", "void", "shutdownNode", "(", "String", "nodeName", ")", "{", "updatePartial", "(", "NodeRecord", ".", "getKey", "(", "nodeName", ")", ",", "NodeRecord", ".", "SHUTDOWN", ",", "true", ")", ";", "}" ]
Marks the identified node as shut down in its record.
[ "Marks", "the", "identified", "node", "as", "shut", "down", "in", "its", "record", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRepository.java#L127-L130
41,569
xbib/marc
src/main/java/org/xbib/marc/io/BytesArray.java
BytesArray.split
public List<byte[]> split(byte sep) { List<byte[]> l = new LinkedList<>(); int start = 0; for (int i = 0; i < bytes.length; i++) { if (sep == bytes[i]) { byte[] b = Arrays.copyOfRange(bytes, start, i); if (b.length > 0) { l.add(b); ...
java
public List<byte[]> split(byte sep) { List<byte[]> l = new LinkedList<>(); int start = 0; for (int i = 0; i < bytes.length; i++) { if (sep == bytes[i]) { byte[] b = Arrays.copyOfRange(bytes, start, i); if (b.length > 0) { l.add(b); ...
[ "public", "List", "<", "byte", "[", "]", ">", "split", "(", "byte", "sep", ")", "{", "List", "<", "byte", "[", "]", ">", "l", "=", "new", "LinkedList", "<>", "(", ")", ";", "int", "start", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";...
Split byte array by a separator byte. @param sep the separator @return a list of byte arrays
[ "Split", "byte", "array", "by", "a", "separator", "byte", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/io/BytesArray.java#L113-L128
41,570
threerings/narya
core/src/main/java/com/threerings/crowd/client/OccupantDirector.java
OccupantDirector.getOccupantInfo
public OccupantInfo getOccupantInfo (int bodyOid) { // make sure we're somewhere return (_place == null) ? null : _place.occupantInfo.get(Integer.valueOf(bodyOid)); }
java
public OccupantInfo getOccupantInfo (int bodyOid) { // make sure we're somewhere return (_place == null) ? null : _place.occupantInfo.get(Integer.valueOf(bodyOid)); }
[ "public", "OccupantInfo", "getOccupantInfo", "(", "int", "bodyOid", ")", "{", "// make sure we're somewhere", "return", "(", "_place", "==", "null", ")", "?", "null", ":", "_place", ".", "occupantInfo", ".", "get", "(", "Integer", ".", "valueOf", "(", "bodyOid...
Returns the occupant info for the user in question if it exists in the currently occupied place. Returns null if no occupant info exists for the specified body.
[ "Returns", "the", "occupant", "info", "for", "the", "user", "in", "question", "if", "it", "exists", "in", "the", "currently", "occupied", "place", ".", "Returns", "null", "if", "no", "occupant", "info", "exists", "for", "the", "specified", "body", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/OccupantDirector.java#L95-L99
41,571
threerings/narya
core/src/main/java/com/threerings/crowd/client/OccupantDirector.java
OccupantDirector.getOccupantInfo
public OccupantInfo getOccupantInfo (Name username) { return (_place == null) ? null : _place.getOccupantInfo(username); }
java
public OccupantInfo getOccupantInfo (Name username) { return (_place == null) ? null : _place.getOccupantInfo(username); }
[ "public", "OccupantInfo", "getOccupantInfo", "(", "Name", "username", ")", "{", "return", "(", "_place", "==", "null", ")", "?", "null", ":", "_place", ".", "getOccupantInfo", "(", "username", ")", ";", "}" ]
Returns the occupant info for the user in question if it exists in the currently occupied place. Returns null if no occupant info exists with the specified username.
[ "Returns", "the", "occupant", "info", "for", "the", "user", "in", "question", "if", "it", "exists", "in", "the", "currently", "occupied", "place", ".", "Returns", "null", "if", "no", "occupant", "info", "exists", "with", "the", "specified", "username", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/OccupantDirector.java#L106-L109
41,572
threerings/narya
core/src/main/java/com/threerings/crowd/client/OccupantDirector.java
OccupantDirector.entryAdded
public void entryAdded (EntryAddedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // now let the occupant observers know what's up final OccupantInfo info = event.g...
java
public void entryAdded (EntryAddedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // now let the occupant observers know what's up final OccupantInfo info = event.g...
[ "public", "void", "entryAdded", "(", "EntryAddedEvent", "<", "OccupantInfo", ">", "event", ")", "{", "// bail if this isn't for the OCCUPANT_INFO field", "if", "(", "!", "event", ".", "getName", "(", ")", ".", "equals", "(", "PlaceObject", ".", "OCCUPANT_INFO", ")...
Deals with all of the processing when an occupant shows up.
[ "Deals", "with", "all", "of", "the", "processing", "when", "an", "occupant", "shows", "up", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/OccupantDirector.java#L152-L167
41,573
threerings/narya
core/src/main/java/com/threerings/crowd/client/OccupantDirector.java
OccupantDirector.entryUpdated
public void entryUpdated (EntryUpdatedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // now let the occupant observers know what's up final OccupantInfo info = eve...
java
public void entryUpdated (EntryUpdatedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // now let the occupant observers know what's up final OccupantInfo info = eve...
[ "public", "void", "entryUpdated", "(", "EntryUpdatedEvent", "<", "OccupantInfo", ">", "event", ")", "{", "// bail if this isn't for the OCCUPANT_INFO field", "if", "(", "!", "event", ".", "getName", "(", ")", ".", "equals", "(", "PlaceObject", ".", "OCCUPANT_INFO", ...
Deals with all of the processing when an occupant is updated.
[ "Deals", "with", "all", "of", "the", "processing", "when", "an", "occupant", "is", "updated", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/OccupantDirector.java#L172-L188
41,574
threerings/narya
core/src/main/java/com/threerings/crowd/client/OccupantDirector.java
OccupantDirector.entryRemoved
public void entryRemoved (EntryRemovedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // let the occupant observers know what's up final OccupantInfo oinfo = event....
java
public void entryRemoved (EntryRemovedEvent<OccupantInfo> event) { // bail if this isn't for the OCCUPANT_INFO field if (!event.getName().equals(PlaceObject.OCCUPANT_INFO)) { return; } // let the occupant observers know what's up final OccupantInfo oinfo = event....
[ "public", "void", "entryRemoved", "(", "EntryRemovedEvent", "<", "OccupantInfo", ">", "event", ")", "{", "// bail if this isn't for the OCCUPANT_INFO field", "if", "(", "!", "event", ".", "getName", "(", ")", ".", "equals", "(", "PlaceObject", ".", "OCCUPANT_INFO", ...
Deals with all of the processing when an occupant leaves.
[ "Deals", "with", "all", "of", "the", "processing", "when", "an", "occupant", "leaves", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/OccupantDirector.java#L193-L208
41,575
Gperez88/CalculatorInputView
calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/CalculatorBuilder.java
CalculatorBuilder.start
public void start(Activity activity) { Intent i = new Intent(activity, CalculatorActivity.class); if (!TextUtils.isEmpty(activityTitle)) { i.putExtra(CalculatorActivity.TITLE_ACTIVITY, activityTitle); } if (!TextUtils.isEmpty(value)) { i.putExtra(CalculatorActivi...
java
public void start(Activity activity) { Intent i = new Intent(activity, CalculatorActivity.class); if (!TextUtils.isEmpty(activityTitle)) { i.putExtra(CalculatorActivity.TITLE_ACTIVITY, activityTitle); } if (!TextUtils.isEmpty(value)) { i.putExtra(CalculatorActivi...
[ "public", "void", "start", "(", "Activity", "activity", ")", "{", "Intent", "i", "=", "new", "Intent", "(", "activity", ",", "CalculatorActivity", ".", "class", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "activityTitle", ")", ")", "{", ...
Start the activity using the parent activity @param activity the current activity
[ "Start", "the", "activity", "using", "the", "parent", "activity" ]
735029095fbcbd32d25cde65529061903f522a89
https://github.com/Gperez88/CalculatorInputView/blob/735029095fbcbd32d25cde65529061903f522a89/calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/CalculatorBuilder.java#L44-L55
41,576
Gperez88/CalculatorInputView
calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/CalculatorBuilder.java
CalculatorBuilder.start
public void start(Fragment fragment) { Intent i = new Intent(fragment.getContext(), CalculatorActivity.class); if (!TextUtils.isEmpty(activityTitle)) { i.putExtra(CalculatorActivity.TITLE_ACTIVITY, activityTitle); } if (!TextUtils.isEmpty(value)) { i.putExtra(Cal...
java
public void start(Fragment fragment) { Intent i = new Intent(fragment.getContext(), CalculatorActivity.class); if (!TextUtils.isEmpty(activityTitle)) { i.putExtra(CalculatorActivity.TITLE_ACTIVITY, activityTitle); } if (!TextUtils.isEmpty(value)) { i.putExtra(Cal...
[ "public", "void", "start", "(", "Fragment", "fragment", ")", "{", "Intent", "i", "=", "new", "Intent", "(", "fragment", ".", "getContext", "(", ")", ",", "CalculatorActivity", ".", "class", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "a...
Start the activity using the parent fragment @param fragment the current fragment
[ "Start", "the", "activity", "using", "the", "parent", "fragment" ]
735029095fbcbd32d25cde65529061903f522a89
https://github.com/Gperez88/CalculatorInputView/blob/735029095fbcbd32d25cde65529061903f522a89/calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/CalculatorBuilder.java#L62-L73
41,577
twotoasters/SectionCursorAdapter
library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java
SectionCursorAdapter.getIndexWithinSections
public int getIndexWithinSections(int listPosition) { boolean isSection = false; int numPrecedingSections = 0; for (Integer sectionPosition : mSections.keySet()) { if (listPosition > sectionPosition) numPrecedingSections++; else if (listPosition == section...
java
public int getIndexWithinSections(int listPosition) { boolean isSection = false; int numPrecedingSections = 0; for (Integer sectionPosition : mSections.keySet()) { if (listPosition > sectionPosition) numPrecedingSections++; else if (listPosition == section...
[ "public", "int", "getIndexWithinSections", "(", "int", "listPosition", ")", "{", "boolean", "isSection", "=", "false", ";", "int", "numPrecedingSections", "=", "0", ";", "for", "(", "Integer", "sectionPosition", ":", "mSections", ".", "keySet", "(", ")", ")", ...
Finds the section index for a given list position. @param listPosition the position of the current item in the list with mSections included @return an index in an ordered list of section names
[ "Finds", "the", "section", "index", "for", "a", "given", "list", "position", "." ]
f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8
https://github.com/twotoasters/SectionCursorAdapter/blob/f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8/library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java#L226-L238
41,578
twotoasters/SectionCursorAdapter
library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java
SectionCursorAdapter.getPositionForSection
@Override public int getPositionForSection(int sectionIndex) { if (mSectionList.size() == 0) { for (Integer key : mSections.keySet()) { mSectionList.add(key); } } return sectionIndex < mSectionList.size() ? mSectionList.get(sectionIndex) : getCount(); ...
java
@Override public int getPositionForSection(int sectionIndex) { if (mSectionList.size() == 0) { for (Integer key : mSections.keySet()) { mSectionList.add(key); } } return sectionIndex < mSectionList.size() ? mSectionList.get(sectionIndex) : getCount(); ...
[ "@", "Override", "public", "int", "getPositionForSection", "(", "int", "sectionIndex", ")", "{", "if", "(", "mSectionList", ".", "size", "(", ")", "==", "0", ")", "{", "for", "(", "Integer", "key", ":", "mSections", ".", "keySet", "(", ")", ")", "{", ...
Given the index of a section within the array of section objects, returns the starting position of that section within the adapter. If the section's starting position is outside of the adapter bounds, the position must be clipped to fall within the size of the adapter. @param sectionIndex the index of the section wit...
[ "Given", "the", "index", "of", "a", "section", "within", "the", "array", "of", "section", "objects", "returns", "the", "starting", "position", "of", "that", "section", "within", "the", "adapter", "." ]
f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8
https://github.com/twotoasters/SectionCursorAdapter/blob/f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8/library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java#L357-L365
41,579
twotoasters/SectionCursorAdapter
library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java
SectionCursorAdapter.getSectionForPosition
@Override public int getSectionForPosition(int position) { Object[] objects = getSections(); // the fast scroll section objects int sectionIndex = getIndexWithinSections(position); return sectionIndex < objects.length ? sectionIndex : 0; }
java
@Override public int getSectionForPosition(int position) { Object[] objects = getSections(); // the fast scroll section objects int sectionIndex = getIndexWithinSections(position); return sectionIndex < objects.length ? sectionIndex : 0; }
[ "@", "Override", "public", "int", "getSectionForPosition", "(", "int", "position", ")", "{", "Object", "[", "]", "objects", "=", "getSections", "(", ")", ";", "// the fast scroll section objects", "int", "sectionIndex", "=", "getIndexWithinSections", "(", "position"...
Given a position within the adapter, returns the index of the corresponding section within the array of section objects. If the section index is outside of the section array bounds, the index must be clipped to fall within the size of the section array. For example, consider an indexer where the section at array inde...
[ "Given", "a", "position", "within", "the", "adapter", "returns", "the", "index", "of", "the", "corresponding", "section", "within", "the", "array", "of", "section", "objects", "." ]
f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8
https://github.com/twotoasters/SectionCursorAdapter/blob/f74a52894f0ad8b809ff1e0298cc5f9068c8dcb8/library/src/main/java/com/twotoasters/sectioncursoradapter/SectionCursorAdapter.java#L383-L389
41,580
Gperez88/CalculatorInputView
calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java
NumericEditText.getNumericValue
public double getNumericValue() { String original = getText().toString().replaceAll(mNumberFilterRegex, ""); if (hasCustomDecimalSeparator) { // swap custom decimal separator with locale one to allow parsing original = StringUtils.replace(original, String.valu...
java
public double getNumericValue() { String original = getText().toString().replaceAll(mNumberFilterRegex, ""); if (hasCustomDecimalSeparator) { // swap custom decimal separator with locale one to allow parsing original = StringUtils.replace(original, String.valu...
[ "public", "double", "getNumericValue", "(", ")", "{", "String", "original", "=", "getText", "(", ")", ".", "toString", "(", ")", ".", "replaceAll", "(", "mNumberFilterRegex", ",", "\"\"", ")", ";", "if", "(", "hasCustomDecimalSeparator", ")", "{", "// swap c...
Return numeric value represented by the text field @return numeric value
[ "Return", "numeric", "value", "represented", "by", "the", "text", "field" ]
735029095fbcbd32d25cde65529061903f522a89
https://github.com/Gperez88/CalculatorInputView/blob/735029095fbcbd32d25cde65529061903f522a89/calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java#L160-L173
41,581
Gperez88/CalculatorInputView
calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java
NumericEditText.format
private String format(final String original) { final String[] parts = original.split("\\" + mDecimalSeparator, -1); String number = parts[0] // since we split with limit -1 there will always be at least 1 part .replaceAll(mNumberFilterRegex, "") .replaceFirst(LEADING_ZERO...
java
private String format(final String original) { final String[] parts = original.split("\\" + mDecimalSeparator, -1); String number = parts[0] // since we split with limit -1 there will always be at least 1 part .replaceAll(mNumberFilterRegex, "") .replaceFirst(LEADING_ZERO...
[ "private", "String", "format", "(", "final", "String", "original", ")", "{", "final", "String", "[", "]", "parts", "=", "original", ".", "split", "(", "\"\\\\\"", "+", "mDecimalSeparator", ",", "-", "1", ")", ";", "String", "number", "=", "parts", "[", ...
Add grouping separators to string @param original original string, may already contains incorrect grouping separators @return string with correct grouping separators
[ "Add", "grouping", "separators", "to", "string" ]
735029095fbcbd32d25cde65529061903f522a89
https://github.com/Gperez88/CalculatorInputView/blob/735029095fbcbd32d25cde65529061903f522a89/calculatorInputView/src/main/java/com/gp89developers/calculatorinputview/widget/NumericEditText.java#L181-L207
41,582
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/XmlUtils.java
XmlUtils.createEmptyDocument
public static Document createEmptyDocument() { Document output = null; try { final DocumentBuilder db = FACTORY.newDocumentBuilder(); db.setErrorHandler(new ParserErrorHandler()); output = db.newDocument(); } catch (final Exception ex) { LOG...
java
public static Document createEmptyDocument() { Document output = null; try { final DocumentBuilder db = FACTORY.newDocumentBuilder(); db.setErrorHandler(new ParserErrorHandler()); output = db.newDocument(); } catch (final Exception ex) { LOG...
[ "public", "static", "Document", "createEmptyDocument", "(", ")", "{", "Document", "output", "=", "null", ";", "try", "{", "final", "DocumentBuilder", "db", "=", "FACTORY", ".", "newDocumentBuilder", "(", ")", ";", "db", ".", "setErrorHandler", "(", "new", "P...
Create an empty XML structure. @return An empty DOM tree.
[ "Create", "an", "empty", "XML", "structure", "." ]
5e133e2824aa38f316a2eb061123313a7276aba0
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/XmlUtils.java#L75-L86
41,583
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/XmlUtils.java
XmlUtils.validate
public static boolean validate(final Source input, final Source[] schemas) { boolean isValid = true; try { final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); factory.setResourceResolver(new SchemaLSResourceResolver()); fi...
java
public static boolean validate(final Source input, final Source[] schemas) { boolean isValid = true; try { final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); factory.setResourceResolver(new SchemaLSResourceResolver()); fi...
[ "public", "static", "boolean", "validate", "(", "final", "Source", "input", ",", "final", "Source", "[", "]", "schemas", ")", "{", "boolean", "isValid", "=", "true", ";", "try", "{", "final", "SchemaFactory", "factory", "=", "SchemaFactory", ".", "newInstanc...
Validate an XML document against an XML Schema definition. @param input The input XML document. @param schemas The XML Schema(s) against which the document must be validated. @return Whether the validation was successful.
[ "Validate", "an", "XML", "document", "against", "an", "XML", "Schema", "definition", "." ]
5e133e2824aa38f316a2eb061123313a7276aba0
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/XmlUtils.java#L165-L184
41,584
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/XmlUtils.java
XmlUtils.transform
public static void transform(final Source input, final Source sheet, final Result output) { try { final DOMResult intermediate = new DOMResult(createEmptyDocument()); // Transform. createTransformer(sheet).transform(input, intermediate); // Format. ...
java
public static void transform(final Source input, final Source sheet, final Result output) { try { final DOMResult intermediate = new DOMResult(createEmptyDocument()); // Transform. createTransformer(sheet).transform(input, intermediate); // Format. ...
[ "public", "static", "void", "transform", "(", "final", "Source", "input", ",", "final", "Source", "sheet", ",", "final", "Result", "output", ")", "{", "try", "{", "final", "DOMResult", "intermediate", "=", "new", "DOMResult", "(", "createEmptyDocument", "(", ...
Transform an XML document according to an XSL style sheet. @param input The input XML {@link Source}. @param sheet The XSL style sheet according to which the document must be transformed. @param output The {@link Result} in which the transformed XML is to be stored.
[ "Transform", "an", "XML", "document", "according", "to", "an", "XSL", "style", "sheet", "." ]
5e133e2824aa38f316a2eb061123313a7276aba0
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/XmlUtils.java#L196-L208
41,585
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/Validator.java
Validator.loadDefinition
static Document loadDefinition(final File def) { // Parse the jDPL definition into a DOM tree. final Document document = XmlUtils.parseFile(def); if (document == null) { return null; } // Log the jPDL version from the process definition (if applicable and avai...
java
static Document loadDefinition(final File def) { // Parse the jDPL definition into a DOM tree. final Document document = XmlUtils.parseFile(def); if (document == null) { return null; } // Log the jPDL version from the process definition (if applicable and avai...
[ "static", "Document", "loadDefinition", "(", "final", "File", "def", ")", "{", "// Parse the jDPL definition into a DOM tree.\r", "final", "Document", "document", "=", "XmlUtils", ".", "parseFile", "(", "def", ")", ";", "if", "(", "document", "==", "null", ")", ...
Load a process definition from file. @param def The {@link File} which contains a definition. @return The definition in {@link Document} format, or <code>null</code> if the file could not be found or didn't contain parseable XML.
[ "Load", "a", "process", "definition", "from", "file", "." ]
5e133e2824aa38f316a2eb061123313a7276aba0
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/Validator.java#L60-L75
41,586
kiegroup/jbpmmigration
src/main/java/org/jbpm/migration/JbpmMigration.java
JbpmMigration.transform
private static void transform(final String xmlFileName, final String xsltFileName, final String outputFileName) { Source xsltSource = null; if (StringUtils.isNotBlank(xsltFileName)) { // Use the given stylesheet. xsltSource = new StreamSource(new File(xsltFileName)); } el...
java
private static void transform(final String xmlFileName, final String xsltFileName, final String outputFileName) { Source xsltSource = null; if (StringUtils.isNotBlank(xsltFileName)) { // Use the given stylesheet. xsltSource = new StreamSource(new File(xsltFileName)); } el...
[ "private", "static", "void", "transform", "(", "final", "String", "xmlFileName", ",", "final", "String", "xsltFileName", ",", "final", "String", "outputFileName", ")", "{", "Source", "xsltSource", "=", "null", ";", "if", "(", "StringUtils", ".", "isNotBlank", ...
Perform the transformation called from the main method. @param xmlFileName The name of an XML input file. @param xsltFileName The name of an XSLT stylesheet. @param outputFileName The name of the file the result of the transformation is to be written to.
[ "Perform", "the", "transformation", "called", "from", "the", "main", "method", "." ]
5e133e2824aa38f316a2eb061123313a7276aba0
https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/JbpmMigration.java#L69-L84
41,587
mjeanroy/junit-runif
src/main/java/com/github/mjeanroy/junit4/runif/conditions/JavaUtils.java
JavaUtils.parseVersion
private static Version parseVersion(String version) { String[] parts = version.split("\\."); int nbParts = parts.length; int majorIndex = nbParts > 1 ? 1 : 0; int major = Integer.parseInt(parts[majorIndex]); return new Version(major); }
java
private static Version parseVersion(String version) { String[] parts = version.split("\\."); int nbParts = parts.length; int majorIndex = nbParts > 1 ? 1 : 0; int major = Integer.parseInt(parts[majorIndex]); return new Version(major); }
[ "private", "static", "Version", "parseVersion", "(", "String", "version", ")", "{", "String", "[", "]", "parts", "=", "version", ".", "split", "(", "\"\\\\.\"", ")", ";", "int", "nbParts", "=", "parts", ".", "length", ";", "int", "majorIndex", "=", "nbPa...
Parse Java version number. @param version The version number. @return The version.
[ "Parse", "Java", "version", "number", "." ]
6fcfe39196d3f51ee1a8db7316567f540063e255
https://github.com/mjeanroy/junit-runif/blob/6fcfe39196d3f51ee1a8db7316567f540063e255/src/main/java/com/github/mjeanroy/junit4/runif/conditions/JavaUtils.java#L57-L63
41,588
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.initialize
@Override public void initialize(URL location, ResourceBundle resources) { // Add an event handler to automatically close the stage in the event of // any exception encountered. addEventHandler(WindowEvent.ANY, new EventHandler<WindowEvent>() { @Override public void ...
java
@Override public void initialize(URL location, ResourceBundle resources) { // Add an event handler to automatically close the stage in the event of // any exception encountered. addEventHandler(WindowEvent.ANY, new EventHandler<WindowEvent>() { @Override public void ...
[ "@", "Override", "public", "void", "initialize", "(", "URL", "location", ",", "ResourceBundle", "resources", ")", "{", "// Add an event handler to automatically close the stage in the event of ", "// any exception encountered.", "addEventHandler", "(", "WindowEvent", ".", "ANY"...
Initializes the dialog. Sets default focus to OK button. Wraps the text for details message label and apply the user-defined header and details. Filter the behavior for the exception dialog for a null and non-null exception object given. Applies corresponding header background css style. @param location The location u...
[ "Initializes", "the", "dialog", ".", "Sets", "default", "focus", "to", "OK", "button", ".", "Wraps", "the", "text", "for", "details", "message", "label", "and", "apply", "the", "user", "-", "defined", "header", "and", "details", ".", "Filter", "the", "beha...
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L484-L593
41,589
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.setHeadlessPadding
private void setHeadlessPadding() { if (dialogType == DialogType.INPUT_TEXT) { bodyContainer.setStyle( PreDefinedStyle.INPUT_DIALOG_HEADLESS_PADDING.getStyle()); } else if (dialogType == DialogType.EXCEPTION) { bodyContainer.setStyle( PreD...
java
private void setHeadlessPadding() { if (dialogType == DialogType.INPUT_TEXT) { bodyContainer.setStyle( PreDefinedStyle.INPUT_DIALOG_HEADLESS_PADDING.getStyle()); } else if (dialogType == DialogType.EXCEPTION) { bodyContainer.setStyle( PreD...
[ "private", "void", "setHeadlessPadding", "(", ")", "{", "if", "(", "dialogType", "==", "DialogType", ".", "INPUT_TEXT", ")", "{", "bodyContainer", ".", "setStyle", "(", "PreDefinedStyle", ".", "INPUT_DIALOG_HEADLESS_PADDING", ".", "getStyle", "(", ")", ")", ";",...
Sets the padding for a headless dialog
[ "Sets", "the", "padding", "for", "a", "headless", "dialog" ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L598-L610
41,590
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.setHeaderColorStyle
public final void setHeaderColorStyle(HeaderColorStyle headerColorStyle) { this.headerColorStyle = headerColorStyle; if (!headerColorStyle.getColorStyle().isEmpty()) { this.getHeaderLabel().setStyle(headerColorStyle.getColorStyle()); // It's either DEFAULT or CUSTOM value (all ...
java
public final void setHeaderColorStyle(HeaderColorStyle headerColorStyle) { this.headerColorStyle = headerColorStyle; if (!headerColorStyle.getColorStyle().isEmpty()) { this.getHeaderLabel().setStyle(headerColorStyle.getColorStyle()); // It's either DEFAULT or CUSTOM value (all ...
[ "public", "final", "void", "setHeaderColorStyle", "(", "HeaderColorStyle", "headerColorStyle", ")", "{", "this", ".", "headerColorStyle", "=", "headerColorStyle", ";", "if", "(", "!", "headerColorStyle", ".", "getColorStyle", "(", ")", ".", "isEmpty", "(", ")", ...
Applies a predefined JavaFX CSS background color style for the header label @param headerColorStyle A <code>HeaderColorStyle</code> option containing a color scheme.
[ "Applies", "a", "predefined", "JavaFX", "CSS", "background", "color", "style", "for", "the", "header", "label" ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L619-L664
41,591
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.setFont
public void setFont(String header_font_family, int header_font_size, String details_font_family, int details_font_size) { this.headerLabel .setStyle("-fx-font-family: \"" + header_font_family + "\";" + "-fx-font-size:" + Integer.toString(header_font_size) + "p...
java
public void setFont(String header_font_family, int header_font_size, String details_font_family, int details_font_size) { this.headerLabel .setStyle("-fx-font-family: \"" + header_font_family + "\";" + "-fx-font-size:" + Integer.toString(header_font_size) + "p...
[ "public", "void", "setFont", "(", "String", "header_font_family", ",", "int", "header_font_size", ",", "String", "details_font_family", ",", "int", "details_font_size", ")", "{", "this", ".", "headerLabel", ".", "setStyle", "(", "\"-fx-font-family: \\\"\"", "+", "he...
Sets the font sizes and the font families for the header and details label. @param header_font_family The header font family in <code>Strings</code> @param header_font_size The header font size in pixels @param details_font_family The details font family in <code>Strings</code> @param details_font_size The details fon...
[ "Sets", "the", "font", "sizes", "and", "the", "font", "families", "for", "the", "header", "and", "details", "label", "." ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L842-L850
41,592
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.setHeaderFont
public void setHeaderFont(String font_family, int font_size) { this.headerLabel .setStyle("-fx-font-family: \"" + font_family + "\";" + "-fx-font-size:" + Integer.toString(font_size) + "px;"); }
java
public void setHeaderFont(String font_family, int font_size) { this.headerLabel .setStyle("-fx-font-family: \"" + font_family + "\";" + "-fx-font-size:" + Integer.toString(font_size) + "px;"); }
[ "public", "void", "setHeaderFont", "(", "String", "font_family", ",", "int", "font_size", ")", "{", "this", ".", "headerLabel", ".", "setStyle", "(", "\"-fx-font-family: \\\"\"", "+", "font_family", "+", "\"\\\";\"", "+", "\"-fx-font-size:\"", "+", "Integer", ".",...
Sets both header label's font family and size. @param font_family Font family in <code>Strings</code> @param font_size Font size in <code>integer</code> (pixels)
[ "Sets", "both", "header", "label", "s", "font", "family", "and", "size", "." ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L858-L862
41,593
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.setDetailsFont
public void setDetailsFont(String font_family, int font_size) { this.detailsLabel .setStyle("-fx-font-family: \"" + font_family + "\";" + "-fx-font-size:" + Integer.toString(font_size) + "px;"); }
java
public void setDetailsFont(String font_family, int font_size) { this.detailsLabel .setStyle("-fx-font-family: \"" + font_family + "\";" + "-fx-font-size:" + Integer.toString(font_size) + "px;"); }
[ "public", "void", "setDetailsFont", "(", "String", "font_family", ",", "int", "font_size", ")", "{", "this", ".", "detailsLabel", ".", "setStyle", "(", "\"-fx-font-family: \\\"\"", "+", "font_family", "+", "\"\\\";\"", "+", "\"-fx-font-size:\"", "+", "Integer", "....
Sets both details label's font family and size. @param font_family Font family in <code>Strings</code> @param font_size Font size in <code>integer</code> (pixels)
[ "Sets", "both", "details", "label", "s", "font", "family", "and", "size", "." ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L870-L874
41,594
Daytron/SimpleDialogFX
src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java
Dialog.send_btn_on_click
@FXML private void send_btn_on_click(ActionEvent event) { // Future proof for other uses of send event handler if (this.dialogType == DialogType.INPUT_TEXT) { this.textEntry = this.inputTextField.getText(); } setResponse(DialogResponse.SEND); close(); }
java
@FXML private void send_btn_on_click(ActionEvent event) { // Future proof for other uses of send event handler if (this.dialogType == DialogType.INPUT_TEXT) { this.textEntry = this.inputTextField.getText(); } setResponse(DialogResponse.SEND); close(); }
[ "@", "FXML", "private", "void", "send_btn_on_click", "(", "ActionEvent", "event", ")", "{", "// Future proof for other uses of send event handler", "if", "(", "this", ".", "dialogType", "==", "DialogType", ".", "INPUT_TEXT", ")", "{", "this", ".", "textEntry", "=", ...
Event handler when sendButton is pressed. Sets response to SEND and closes the dialog window. @param event Action event object
[ "Event", "handler", "when", "sendButton", "is", "pressed", ".", "Sets", "response", "to", "SEND", "and", "closes", "the", "dialog", "window", "." ]
54e813dbb0ebabad8e0a81b6b5f05e518747611e
https://github.com/Daytron/SimpleDialogFX/blob/54e813dbb0ebabad8e0a81b6b5f05e518747611e/src/main/java/com/github/daytron/simpledialogfx/dialog/Dialog.java#L993-L1002
41,595
probedock/probedock-java
src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java
FingerprintGenerator.fingerprint
public static String fingerprint(String str) { try { MessageDigest md = MessageDigest.getInstance("SHA-1"); return byteArrayToHexString(md.digest(str.getBytes())); } catch (NoSuchAlgorithmException nsae) { LOGGER.warning("Unable to calculate the fingerprint for string [" + str + "]."); return null; ...
java
public static String fingerprint(String str) { try { MessageDigest md = MessageDigest.getInstance("SHA-1"); return byteArrayToHexString(md.digest(str.getBytes())); } catch (NoSuchAlgorithmException nsae) { LOGGER.warning("Unable to calculate the fingerprint for string [" + str + "]."); return null; ...
[ "public", "static", "String", "fingerprint", "(", "String", "str", ")", "{", "try", "{", "MessageDigest", "md", "=", "MessageDigest", ".", "getInstance", "(", "\"SHA-1\"", ")", ";", "return", "byteArrayToHexString", "(", "md", ".", "digest", "(", "str", ".",...
Generate a fingerprint for a given string @param str The string to fingerprint @return The fingerprint generated
[ "Generate", "a", "fingerprint", "for", "a", "given", "string" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java#L22-L31
41,596
probedock/probedock-java
src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java
FingerprintGenerator.fingerprint
public static String fingerprint(Class cl, Method m) { return fingerprint(cl, m.getName()); }
java
public static String fingerprint(Class cl, Method m) { return fingerprint(cl, m.getName()); }
[ "public", "static", "String", "fingerprint", "(", "Class", "cl", ",", "Method", "m", ")", "{", "return", "fingerprint", "(", "cl", ",", "m", ".", "getName", "(", ")", ")", ";", "}" ]
Generate a fingerprint based on class and method @param cl The class @param m The method @return The fingerprint generated
[ "Generate", "a", "fingerprint", "based", "on", "class", "and", "method" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java#L40-L42
41,597
probedock/probedock-java
src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java
FingerprintGenerator.fingerprint
public static String fingerprint(Class cl, String methodName) { return fingerprint(cl.getCanonicalName() + "." + methodName); }
java
public static String fingerprint(Class cl, String methodName) { return fingerprint(cl.getCanonicalName() + "." + methodName); }
[ "public", "static", "String", "fingerprint", "(", "Class", "cl", ",", "String", "methodName", ")", "{", "return", "fingerprint", "(", "cl", ".", "getCanonicalName", "(", ")", "+", "\".\"", "+", "methodName", ")", ";", "}" ]
Generate a fingerprint based on class and method name @param cl The class @param methodName The method name @return The fingerprint generated
[ "Generate", "a", "fingerprint", "based", "on", "class", "and", "method", "name" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/common/utils/FingerprintGenerator.java#L51-L53
41,598
probedock/probedock-java
src/main/java/io/probedock/client/utils/CollectionHelper.java
CollectionHelper.getContributors
public static Set<String> getContributors(Set<String> baseContributors, ProbeTest methodAnnotation, ProbeTestClass classAnnotation) { Set<String> contributors; if (baseContributors == null) { contributors = new HashSet<>(); } else { contributors = populateContributors(baseContributors, new HashSet<String>...
java
public static Set<String> getContributors(Set<String> baseContributors, ProbeTest methodAnnotation, ProbeTestClass classAnnotation) { Set<String> contributors; if (baseContributors == null) { contributors = new HashSet<>(); } else { contributors = populateContributors(baseContributors, new HashSet<String>...
[ "public", "static", "Set", "<", "String", ">", "getContributors", "(", "Set", "<", "String", ">", "baseContributors", ",", "ProbeTest", "methodAnnotation", ",", "ProbeTestClass", "classAnnotation", ")", "{", "Set", "<", "String", ">", "contributors", ";", "if", ...
Retrieve the contributors and compile them from the different sources @param baseContributors a list of base contributors @param methodAnnotation The method annotation that could contain contributors @param classAnnotation The class annotation that could contain contributors @return The contributors from the different...
[ "Retrieve", "the", "contributors", "and", "compile", "them", "from", "the", "different", "sources" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/utils/CollectionHelper.java#L35-L53
41,599
probedock/probedock-java
src/main/java/io/probedock/client/utils/CollectionHelper.java
CollectionHelper.populateContributors
private static Set<String> populateContributors(Set<String> source, Set<String> destination) { for (String contributor : source) { if (!emailPattern.matcher(contributor).matches()) { LOGGER.warning("The contributor '" + contributor + "' does not respect the email pattern " + emailPattern.pattern() + " and is i...
java
private static Set<String> populateContributors(Set<String> source, Set<String> destination) { for (String contributor : source) { if (!emailPattern.matcher(contributor).matches()) { LOGGER.warning("The contributor '" + contributor + "' does not respect the email pattern " + emailPattern.pattern() + " and is i...
[ "private", "static", "Set", "<", "String", ">", "populateContributors", "(", "Set", "<", "String", ">", "source", ",", "Set", "<", "String", ">", "destination", ")", "{", "for", "(", "String", "contributor", ":", "source", ")", "{", "if", "(", "!", "em...
Populate the source with the destination contributors only if they match the pattern rules for the contributors @param source The source to check @param destination The destination to fill @return The destination updated
[ "Populate", "the", "source", "with", "the", "destination", "contributors", "only", "if", "they", "match", "the", "pattern", "rules", "for", "the", "contributors" ]
92ee6634ba4fe3fdffeb4e202f5372ef947a67c3
https://github.com/probedock/probedock-java/blob/92ee6634ba4fe3fdffeb4e202f5372ef947a67c3/src/main/java/io/probedock/client/utils/CollectionHelper.java#L62-L75