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
63,100
zeromq/jeromq
src/main/java/org/zeromq/ZSocket.java
ZSocket.sendFrame
public boolean sendFrame(ZFrame frame, int flags) { final byte[] data = frame.getData(); final Msg msg = new Msg(data); if (socketBase.send(msg, flags)) { return true; } mayRaise(); return false; }
java
public boolean sendFrame(ZFrame frame, int flags) { final byte[] data = frame.getData(); final Msg msg = new Msg(data); if (socketBase.send(msg, flags)) { return true; } mayRaise(); return false; }
[ "public", "boolean", "sendFrame", "(", "ZFrame", "frame", ",", "int", "flags", ")", "{", "final", "byte", "[", "]", "data", "=", "frame", ".", "getData", "(", ")", ";", "final", "Msg", "msg", "=", "new", "Msg", "(", "data", ")", ";", "if", "(", "...
Send a frame @param frame @param flags @return return true if successful
[ "Send", "a", "frame" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZSocket.java#L167-L176
63,101
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.pair
public static Pipe[] pair(ZObject[] parents, int[] hwms, boolean[] conflates) { Pipe[] pipes = new Pipe[2]; // Creates two pipe objects. These objects are connected by two ypipes, // each to pass messages in one direction. YPipeBase<Msg> upipe1 = conflates[0] ? new YPipeConflate...
java
public static Pipe[] pair(ZObject[] parents, int[] hwms, boolean[] conflates) { Pipe[] pipes = new Pipe[2]; // Creates two pipe objects. These objects are connected by two ypipes, // each to pass messages in one direction. YPipeBase<Msg> upipe1 = conflates[0] ? new YPipeConflate...
[ "public", "static", "Pipe", "[", "]", "pair", "(", "ZObject", "[", "]", "parents", ",", "int", "[", "]", "hwms", ",", "boolean", "[", "]", "conflates", ")", "{", "Pipe", "[", "]", "pipes", "=", "new", "Pipe", "[", "2", "]", ";", "// Creates two p...
terminates straight away.
[ "terminates", "straight", "away", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L121-L139
63,102
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.checkRead
public boolean checkRead() { if (!inActive) { return false; } if (state != State.ACTIVE && state != State.WAITING_FOR_DELIMITER) { return false; } // Check if there's an item in the pipe. if (!inpipe.checkRead()) { inActive = fal...
java
public boolean checkRead() { if (!inActive) { return false; } if (state != State.ACTIVE && state != State.WAITING_FOR_DELIMITER) { return false; } // Check if there's an item in the pipe. if (!inpipe.checkRead()) { inActive = fal...
[ "public", "boolean", "checkRead", "(", ")", "{", "if", "(", "!", "inActive", ")", "{", "return", "false", ";", "}", "if", "(", "state", "!=", "State", ".", "ACTIVE", "&&", "state", "!=", "State", ".", "WAITING_FOR_DELIMITER", ")", "{", "return", "false...
Returns true if there is at least one message to read in the pipe.
[ "Returns", "true", "if", "there", "is", "at", "least", "one", "message", "to", "read", "in", "the", "pipe", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L175-L201
63,103
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.read
public Msg read() { if (!inActive) { return null; } if (state != State.ACTIVE && state != State.WAITING_FOR_DELIMITER) { return null; } while (true) { Msg msg = inpipe.read(); if (msg == null) { inActive = fals...
java
public Msg read() { if (!inActive) { return null; } if (state != State.ACTIVE && state != State.WAITING_FOR_DELIMITER) { return null; } while (true) { Msg msg = inpipe.read(); if (msg == null) { inActive = fals...
[ "public", "Msg", "read", "(", ")", "{", "if", "(", "!", "inActive", ")", "{", "return", "null", ";", "}", "if", "(", "state", "!=", "State", ".", "ACTIVE", "&&", "state", "!=", "State", ".", "WAITING_FOR_DELIMITER", ")", "{", "return", "null", ";", ...
Reads a message to the underlying pipe.
[ "Reads", "a", "message", "to", "the", "underlying", "pipe", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L204-L242
63,104
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.checkWrite
public boolean checkWrite() { if (!outActive || state != State.ACTIVE) { return false; } // TODO DIFF V4 small change, it is done like this in 4.2.2 boolean full = !checkHwm(); if (full) { outActive = false; return false; } ...
java
public boolean checkWrite() { if (!outActive || state != State.ACTIVE) { return false; } // TODO DIFF V4 small change, it is done like this in 4.2.2 boolean full = !checkHwm(); if (full) { outActive = false; return false; } ...
[ "public", "boolean", "checkWrite", "(", ")", "{", "if", "(", "!", "outActive", "||", "state", "!=", "State", ".", "ACTIVE", ")", "{", "return", "false", ";", "}", "// TODO DIFF V4 small change, it is done like this in 4.2.2", "boolean", "full", "=", "!", "checkH...
the message would cause high watermark the function returns false.
[ "the", "message", "would", "cause", "high", "watermark", "the", "function", "returns", "false", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L246-L261
63,105
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.write
public boolean write(Msg msg) { if (!checkWrite()) { return false; } boolean more = msg.hasMore(); boolean identity = msg.isIdentity(); outpipe.write(msg, more); if (!more && !identity) { msgsWritten++; } return true; }
java
public boolean write(Msg msg) { if (!checkWrite()) { return false; } boolean more = msg.hasMore(); boolean identity = msg.isIdentity(); outpipe.write(msg, more); if (!more && !identity) { msgsWritten++; } return true; }
[ "public", "boolean", "write", "(", "Msg", "msg", ")", "{", "if", "(", "!", "checkWrite", "(", ")", ")", "{", "return", "false", ";", "}", "boolean", "more", "=", "msg", ".", "hasMore", "(", ")", ";", "boolean", "identity", "=", "msg", ".", "isIdent...
message cannot be written because high watermark was reached.
[ "message", "cannot", "be", "written", "because", "high", "watermark", "was", "reached", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L265-L280
63,106
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.rollback
public void rollback() { // Remove incomplete message from the outbound pipe. Msg msg; if (outpipe != null) { while ((msg = outpipe.unwrite()) != null) { assert (msg.hasMore()); } } }
java
public void rollback() { // Remove incomplete message from the outbound pipe. Msg msg; if (outpipe != null) { while ((msg = outpipe.unwrite()) != null) { assert (msg.hasMore()); } } }
[ "public", "void", "rollback", "(", ")", "{", "// Remove incomplete message from the outbound pipe.", "Msg", "msg", ";", "if", "(", "outpipe", "!=", "null", ")", "{", "while", "(", "(", "msg", "=", "outpipe", ".", "unwrite", "(", ")", ")", "!=", "null", ")...
Remove unfinished parts of the outbound message from the pipe.
[ "Remove", "unfinished", "parts", "of", "the", "outbound", "message", "from", "the", "pipe", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L283-L292
63,107
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.flush
public void flush() { // The peer does not exist anymore at this point. if (state == State.TERM_ACK_SENT) { return; } if (outpipe != null && !outpipe.flush()) { sendActivateRead(peer); } }
java
public void flush() { // The peer does not exist anymore at this point. if (state == State.TERM_ACK_SENT) { return; } if (outpipe != null && !outpipe.flush()) { sendActivateRead(peer); } }
[ "public", "void", "flush", "(", ")", "{", "// The peer does not exist anymore at this point.", "if", "(", "state", "==", "State", ".", "TERM_ACK_SENT", ")", "{", "return", ";", "}", "if", "(", "outpipe", "!=", "null", "&&", "!", "outpipe", ".", "flush", "("...
Flush the messages downstream.
[ "Flush", "the", "messages", "downstream", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L295-L305
63,108
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.terminate
public void terminate(boolean delay) { // Overload the value specified at pipe creation. this.delay = delay; // If terminate was already called, we can ignore the duplicit invocation. if (state == State.TERM_REQ_SENT_1 || state == State.TERM_REQ_SENT_2) { return; ...
java
public void terminate(boolean delay) { // Overload the value specified at pipe creation. this.delay = delay; // If terminate was already called, we can ignore the duplicit invocation. if (state == State.TERM_REQ_SENT_1 || state == State.TERM_REQ_SENT_2) { return; ...
[ "public", "void", "terminate", "(", "boolean", "delay", ")", "{", "// Overload the value specified at pipe creation.", "this", ".", "delay", "=", "delay", ";", "// If terminate was already called, we can ignore the duplicit invocation.", "if", "(", "state", "==", "State", ...
before actual shutdown.
[ "before", "actual", "shutdown", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L441-L499
63,109
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.processDelimiter
private void processDelimiter() { assert (state == State.ACTIVE || state == State.WAITING_FOR_DELIMITER); if (state == State.ACTIVE) { state = State.DELIMITER_RECEIVED; } else { outpipe = null; sendPipeTermAck(peer); state = State.TERM...
java
private void processDelimiter() { assert (state == State.ACTIVE || state == State.WAITING_FOR_DELIMITER); if (state == State.ACTIVE) { state = State.DELIMITER_RECEIVED; } else { outpipe = null; sendPipeTermAck(peer); state = State.TERM...
[ "private", "void", "processDelimiter", "(", ")", "{", "assert", "(", "state", "==", "State", ".", "ACTIVE", "||", "state", "==", "State", ".", "WAITING_FOR_DELIMITER", ")", ";", "if", "(", "state", "==", "State", ".", "ACTIVE", ")", "{", "state", "=", ...
Handler for delimiter read from the pipe.
[ "Handler", "for", "delimiter", "read", "from", "the", "pipe", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L535-L547
63,110
zeromq/jeromq
src/main/java/zmq/pipe/Pipe.java
Pipe.hiccup
public void hiccup() { // If termination is already under way do nothing. if (state != State.ACTIVE) { return; } // We'll drop the pointer to the inpipe. From now on, the peer is // responsible for deallocating it. inpipe = null; // Create ne...
java
public void hiccup() { // If termination is already under way do nothing. if (state != State.ACTIVE) { return; } // We'll drop the pointer to the inpipe. From now on, the peer is // responsible for deallocating it. inpipe = null; // Create ne...
[ "public", "void", "hiccup", "(", ")", "{", "// If termination is already under way do nothing.", "if", "(", "state", "!=", "State", ".", "ACTIVE", ")", "{", "return", ";", "}", "// We'll drop the pointer to the inpipe. From now on, the peer is", "// responsible for dealloc...
in the peer.
[ "in", "the", "peer", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/Pipe.java#L552-L574
63,111
zeromq/jeromq
src/main/java/zmq/socket/reqrep/Router.java
Router.rollback
protected boolean rollback() { if (currentOut != null) { currentOut.rollback(); currentOut = null; moreOut = false; } return true; }
java
protected boolean rollback() { if (currentOut != null) { currentOut.rollback(); currentOut = null; moreOut = false; } return true; }
[ "protected", "boolean", "rollback", "(", ")", "{", "if", "(", "currentOut", "!=", "null", ")", "{", "currentOut", ".", "rollback", "(", ")", ";", "currentOut", "=", "null", ";", "moreOut", "=", "false", ";", "}", "return", "true", ";", "}" ]
Rollback any message parts that were sent but not yet flushed.
[ "Rollback", "any", "message", "parts", "that", "were", "sent", "but", "not", "yet", "flushed", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/reqrep/Router.java#L345-L353
63,112
zeromq/jeromq
src/main/java/zmq/io/coder/EncoderBase.java
EncoderBase.encode
@Override public final int encode(ValueReference<ByteBuffer> data, int size) { int bufferSize = size; ByteBuffer buf = data.get(); if (buf == null) { buf = this.buffer; bufferSize = this.bufferSize; buffer.clear(); } if (inProgress == ...
java
@Override public final int encode(ValueReference<ByteBuffer> data, int size) { int bufferSize = size; ByteBuffer buf = data.get(); if (buf == null) { buf = this.buffer; bufferSize = this.bufferSize; buffer.clear(); } if (inProgress == ...
[ "@", "Override", "public", "final", "int", "encode", "(", "ValueReference", "<", "ByteBuffer", ">", "data", ",", "int", "size", ")", "{", "int", "bufferSize", "=", "size", ";", "ByteBuffer", "buf", "=", "data", ".", "get", "(", ")", ";", "if", "(", "...
is NULL) encoder will provide buffer of its own.
[ "is", "NULL", ")", "encoder", "will", "provide", "buffer", "of", "its", "own", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/coder/EncoderBase.java#L55-L119
63,113
zeromq/jeromq
src/main/java/zmq/io/coder/EncoderBase.java
EncoderBase.nextStep
private void nextStep(byte[] buf, int toWrite, Runnable next, boolean newMsgFlag) { if (buf != null) { writeBuf = ByteBuffer.wrap(buf); writeBuf.limit(toWrite); } else { writeBuf = null; } this.toWrite = toWrite; this.next = next; ...
java
private void nextStep(byte[] buf, int toWrite, Runnable next, boolean newMsgFlag) { if (buf != null) { writeBuf = ByteBuffer.wrap(buf); writeBuf.limit(toWrite); } else { writeBuf = null; } this.toWrite = toWrite; this.next = next; ...
[ "private", "void", "nextStep", "(", "byte", "[", "]", "buf", ",", "int", "toWrite", ",", "Runnable", "next", ",", "boolean", "newMsgFlag", ")", "{", "if", "(", "buf", "!=", "null", ")", "{", "writeBuf", "=", "ByteBuffer", ".", "wrap", "(", "buf", ")"...
to the buffer and schedule next state machine action.
[ "to", "the", "buffer", "and", "schedule", "next", "state", "machine", "action", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/coder/EncoderBase.java#L156-L168
63,114
zeromq/jeromq
src/main/java/zmq/poll/PollerBase.java
PollerBase.addTimer
public void addTimer(long timeout, IPollEvents sink, int id) { assert (Thread.currentThread() == worker); final long expiration = clock() + timeout; TimerInfo info = new TimerInfo(sink, id); timers.insert(expiration, info); changed = true; }
java
public void addTimer(long timeout, IPollEvents sink, int id) { assert (Thread.currentThread() == worker); final long expiration = clock() + timeout; TimerInfo info = new TimerInfo(sink, id); timers.insert(expiration, info); changed = true; }
[ "public", "void", "addTimer", "(", "long", "timeout", ",", "IPollEvents", "sink", ",", "int", "id", ")", "{", "assert", "(", "Thread", ".", "currentThread", "(", ")", "==", "worker", ")", ";", "final", "long", "expiration", "=", "clock", "(", ")", "+",...
argument set to id_.
[ "argument", "set", "to", "id_", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/poll/PollerBase.java#L111-L120
63,115
zeromq/jeromq
src/main/java/zmq/poll/PollerBase.java
PollerBase.cancelTimer
public void cancelTimer(IPollEvents sink, int id) { assert (Thread.currentThread() == worker); TimerInfo copy = new TimerInfo(sink, id); // Complexity of this operation is O(n). We assume it is rarely used. TimerInfo timerInfo = timers.find(copy); if (timerInfo != null) { ...
java
public void cancelTimer(IPollEvents sink, int id) { assert (Thread.currentThread() == worker); TimerInfo copy = new TimerInfo(sink, id); // Complexity of this operation is O(n). We assume it is rarely used. TimerInfo timerInfo = timers.find(copy); if (timerInfo != null) { ...
[ "public", "void", "cancelTimer", "(", "IPollEvents", "sink", ",", "int", "id", ")", "{", "assert", "(", "Thread", ".", "currentThread", "(", ")", "==", "worker", ")", ";", "TimerInfo", "copy", "=", "new", "TimerInfo", "(", "sink", ",", "id", ")", ";", ...
Cancel the timer created by sink_ object with ID equal to id_.
[ "Cancel", "the", "timer", "created", "by", "sink_", "object", "with", "ID", "equal", "to", "id_", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/poll/PollerBase.java#L123-L135
63,116
zeromq/jeromq
src/main/java/zmq/poll/PollerBase.java
PollerBase.executeTimers
protected long executeTimers() { assert (Thread.currentThread() == worker); changed = false; // Fast track. if (timers.isEmpty()) { return 0L; } // Get the current time. long current = clock(); // Execute the timers that are already...
java
protected long executeTimers() { assert (Thread.currentThread() == worker); changed = false; // Fast track. if (timers.isEmpty()) { return 0L; } // Get the current time. long current = clock(); // Execute the timers that are already...
[ "protected", "long", "executeTimers", "(", ")", "{", "assert", "(", "Thread", ".", "currentThread", "(", ")", "==", "worker", ")", ";", "changed", "=", "false", ";", "// Fast track.", "if", "(", "timers", ".", "isEmpty", "(", ")", ")", "{", "return", ...
to wait to match the next timer or 0 meaning "no timers".
[ "to", "wait", "to", "match", "the", "next", "timer", "or", "0", "meaning", "no", "timers", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/poll/PollerBase.java#L139-L192
63,117
zeromq/jeromq
src/main/java/zmq/Own.java
Own.processTerm
@Override protected void processTerm(int linger) { // Double termination should never happen. assert (!terminating); // Send termination request to all owned objects. for (Own it : owned) { sendTerm(it, linger); } registerTermAcks(owned.size()); ...
java
@Override protected void processTerm(int linger) { // Double termination should never happen. assert (!terminating); // Send termination request to all owned objects. for (Own it : owned) { sendTerm(it, linger); } registerTermAcks(owned.size()); ...
[ "@", "Override", "protected", "void", "processTerm", "(", "int", "linger", ")", "{", "// Double termination should never happen.", "assert", "(", "!", "terminating", ")", ";", "// Send termination request to all owned objects.", "for", "(", "Own", "it", ":", "owned", ...
steps to the beginning of the termination process.
[ "steps", "to", "the", "beginning", "of", "the", "termination", "process", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/Own.java#L197-L214
63,118
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Mtrie.java
Mtrie.rm
public boolean rm(Pipe pipe, IMtrieHandler func, XPub pub) { assert (pipe != null); assert (func != null); return rmHelper(pipe, new byte[0], 0, 0, func, pub); }
java
public boolean rm(Pipe pipe, IMtrieHandler func, XPub pub) { assert (pipe != null); assert (func != null); return rmHelper(pipe, new byte[0], 0, 0, func, pub); }
[ "public", "boolean", "rm", "(", "Pipe", "pipe", ",", "IMtrieHandler", "func", ",", "XPub", "pub", ")", "{", "assert", "(", "pipe", "!=", "null", ")", ";", "assert", "(", "func", "!=", "null", ")", ";", "return", "rmHelper", "(", "pipe", ",", "new", ...
supplied callback function.
[ "supplied", "callback", "function", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Mtrie.java#L122-L127
63,119
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Mtrie.java
Mtrie.rm
public boolean rm(Msg msg, Pipe pipe) { assert (msg != null); assert (pipe != null); return rmHelper(msg, 1, msg.size() - 1, pipe); }
java
public boolean rm(Msg msg, Pipe pipe) { assert (msg != null); assert (pipe != null); return rmHelper(msg, 1, msg.size() - 1, pipe); }
[ "public", "boolean", "rm", "(", "Msg", "msg", ",", "Pipe", "pipe", ")", "{", "assert", "(", "msg", "!=", "null", ")", ";", "assert", "(", "pipe", "!=", "null", ")", ";", "return", "rmHelper", "(", "msg", ",", "1", ",", "msg", ".", "size", "(", ...
actually removed rather than de-duplicated.
[ "actually", "removed", "rather", "than", "de", "-", "duplicated", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Mtrie.java#L243-L248
63,120
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Mtrie.java
Mtrie.match
public void match(ByteBuffer data, int size, IMtrieHandler func, XPub pub) { assert (data != null); assert (func != null); assert (pub != null); Mtrie current = this; int idx = 0; while (true) { // Signal the pipes attached to this node. if (...
java
public void match(ByteBuffer data, int size, IMtrieHandler func, XPub pub) { assert (data != null); assert (func != null); assert (pub != null); Mtrie current = this; int idx = 0; while (true) { // Signal the pipes attached to this node. if (...
[ "public", "void", "match", "(", "ByteBuffer", "data", ",", "int", "size", ",", "IMtrieHandler", "func", ",", "XPub", "pub", ")", "{", "assert", "(", "data", "!=", "null", ")", ";", "assert", "(", "func", "!=", "null", ")", ";", "assert", "(", "pub", ...
Signal all the matching pipes.
[ "Signal", "all", "the", "matching", "pipes", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Mtrie.java#L340-L389
63,121
zeromq/jeromq
src/main/java/zmq/io/net/tcp/TcpListener.java
TcpListener.close
private void close() { assert (fd != null); try { fd.close(); socket.eventClosed(endpoint, fd); } catch (IOException e) { socket.eventCloseFailed(endpoint, ZError.exccode(e)); } fd = null; }
java
private void close() { assert (fd != null); try { fd.close(); socket.eventClosed(endpoint, fd); } catch (IOException e) { socket.eventCloseFailed(endpoint, ZError.exccode(e)); } fd = null; }
[ "private", "void", "close", "(", ")", "{", "assert", "(", "fd", "!=", "null", ")", ";", "try", "{", "fd", ".", "close", "(", ")", ";", "socket", ".", "eventClosed", "(", "endpoint", ",", "fd", ")", ";", "}", "catch", "(", "IOException", "e", ")",...
Close the listening socket.
[ "Close", "the", "listening", "socket", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/net/tcp/TcpListener.java#L136-L148
63,122
zeromq/jeromq
src/main/java/zmq/io/net/tcp/TcpListener.java
TcpListener.accept
private SocketChannel accept() throws IOException { // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. // Accept one connection and deal with different failure modes. assert (fd != null)...
java
private SocketChannel accept() throws IOException { // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. // Accept one connection and deal with different failure modes. assert (fd != null)...
[ "private", "SocketChannel", "accept", "(", ")", "throws", "IOException", "{", "// The situation where connection cannot be accepted due to insufficient", "// resources is considered valid and treated by ignoring the connection.", "// Accept one connection and deal with different failure modes...
or was denied because of accept filters.
[ "or", "was", "denied", "because", "of", "accept", "filters", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/io/net/tcp/TcpListener.java#L217-L259
63,123
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.attach
public void attach(Pipe pipe) { // If we are in the middle of sending a message, we'll add new pipe // into the list of eligible pipes. Otherwise we add it to the list // of active pipes. if (more) { pipes.add(pipe); Collections.swap(pipes, eligible, pipes....
java
public void attach(Pipe pipe) { // If we are in the middle of sending a message, we'll add new pipe // into the list of eligible pipes. Otherwise we add it to the list // of active pipes. if (more) { pipes.add(pipe); Collections.swap(pipes, eligible, pipes....
[ "public", "void", "attach", "(", "Pipe", "pipe", ")", "{", "// If we are in the middle of sending a message, we'll add new pipe", "// into the list of eligible pipes. Otherwise we add it to the list", "// of active pipes.", "if", "(", "more", ")", "{", "pipes", ".", "add", "...
Adds the pipe to the distributor object.
[ "Adds", "the", "pipe", "to", "the", "distributor", "object", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L44-L60
63,124
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.match
public void match(Pipe pipe) { int idx = pipes.indexOf(pipe); // If pipe is already matching do nothing. if (idx < matching) { return; } // If the pipe isn't eligible, ignore it. if (idx >= eligible) { return; } // Mark the...
java
public void match(Pipe pipe) { int idx = pipes.indexOf(pipe); // If pipe is already matching do nothing. if (idx < matching) { return; } // If the pipe isn't eligible, ignore it. if (idx >= eligible) { return; } // Mark the...
[ "public", "void", "match", "(", "Pipe", "pipe", ")", "{", "int", "idx", "=", "pipes", ".", "indexOf", "(", "pipe", ")", ";", "// If pipe is already matching do nothing.", "if", "(", "idx", "<", "matching", ")", "{", "return", ";", "}", "// If the pipe isn'...
will send message also to this pipe.
[ "will", "send", "message", "also", "to", "this", "pipe", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L64-L80
63,125
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.terminated
public void terminated(Pipe pipe) { // Remove the pipe from the list; adjust number of matching, active and/or // eligible pipes accordingly. if (pipes.indexOf(pipe) < matching) { Collections.swap(pipes, pipes.indexOf(pipe), matching - 1); matching--; } ...
java
public void terminated(Pipe pipe) { // Remove the pipe from the list; adjust number of matching, active and/or // eligible pipes accordingly. if (pipes.indexOf(pipe) < matching) { Collections.swap(pipes, pipes.indexOf(pipe), matching - 1); matching--; } ...
[ "public", "void", "terminated", "(", "Pipe", "pipe", ")", "{", "// Remove the pipe from the list; adjust number of matching, active and/or", "// eligible pipes accordingly.", "if", "(", "pipes", ".", "indexOf", "(", "pipe", ")", "<", "matching", ")", "{", "Collections",...
Removes the pipe from the distributor object.
[ "Removes", "the", "pipe", "from", "the", "distributor", "object", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L89-L106
63,126
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.activated
public void activated(Pipe pipe) { // Move the pipe from passive to eligible state. Collections.swap(pipes, pipes.indexOf(pipe), eligible); eligible++; // If there's no message being sent at the moment, move it to // the active state. if (!more) { Coll...
java
public void activated(Pipe pipe) { // Move the pipe from passive to eligible state. Collections.swap(pipes, pipes.indexOf(pipe), eligible); eligible++; // If there's no message being sent at the moment, move it to // the active state. if (!more) { Coll...
[ "public", "void", "activated", "(", "Pipe", "pipe", ")", "{", "// Move the pipe from passive to eligible state.", "Collections", ".", "swap", "(", "pipes", ",", "pipes", ".", "indexOf", "(", "pipe", ")", ",", "eligible", ")", ";", "eligible", "++", ";", "// ...
Activates pipe that have previously reached high watermark.
[ "Activates", "pipe", "that", "have", "previously", "reached", "high", "watermark", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L109-L121
63,127
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.sendToMatching
public boolean sendToMatching(Msg msg) { // Is this end of a multipart message? boolean msgMore = msg.hasMore(); // Push the message to matching pipes. distribute(msg); // If mutlipart message is fully sent, activate all the eligible pipes. if (!msgMore) { ...
java
public boolean sendToMatching(Msg msg) { // Is this end of a multipart message? boolean msgMore = msg.hasMore(); // Push the message to matching pipes. distribute(msg); // If mutlipart message is fully sent, activate all the eligible pipes. if (!msgMore) { ...
[ "public", "boolean", "sendToMatching", "(", "Msg", "msg", ")", "{", "// Is this end of a multipart message?", "boolean", "msgMore", "=", "msg", ".", "hasMore", "(", ")", ";", "// Push the message to matching pipes.", "distribute", "(", "msg", ")", ";", "// If mutli...
Send the message to the matching outbound pipes.
[ "Send", "the", "message", "to", "the", "matching", "outbound", "pipes", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L131-L147
63,128
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.distribute
private void distribute(Msg msg) { // If there are no matching pipes available, simply drop the message. if (matching == 0) { return; } // TODO isVsm // Push copy of the message to each matching pipe. for (int idx = 0; idx < matching; ++idx) { ...
java
private void distribute(Msg msg) { // If there are no matching pipes available, simply drop the message. if (matching == 0) { return; } // TODO isVsm // Push copy of the message to each matching pipe. for (int idx = 0; idx < matching; ++idx) { ...
[ "private", "void", "distribute", "(", "Msg", "msg", ")", "{", "// If there are no matching pipes available, simply drop the message.", "if", "(", "matching", "==", "0", ")", "{", "return", ";", "}", "// TODO isVsm", "// Push copy of the message to each matching pipe.", "f...
Put the message to all active pipes.
[ "Put", "the", "message", "to", "all", "active", "pipes", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L150-L165
63,129
zeromq/jeromq
src/main/java/zmq/socket/pubsub/Dist.java
Dist.write
private boolean write(Pipe pipe, Msg msg) { if (!pipe.write(msg)) { Collections.swap(pipes, pipes.indexOf(pipe), matching - 1); matching--; Collections.swap(pipes, pipes.indexOf(pipe), active - 1); active--; Collections.swap(pipes, active, eligible...
java
private boolean write(Pipe pipe, Msg msg) { if (!pipe.write(msg)) { Collections.swap(pipes, pipes.indexOf(pipe), matching - 1); matching--; Collections.swap(pipes, pipes.indexOf(pipe), active - 1); active--; Collections.swap(pipes, active, eligible...
[ "private", "boolean", "write", "(", "Pipe", "pipe", ",", "Msg", "msg", ")", "{", "if", "(", "!", "pipe", ".", "write", "(", "msg", ")", ")", "{", "Collections", ".", "swap", "(", "pipes", ",", "pipes", ".", "indexOf", "(", "pipe", ")", ",", "matc...
fails. In such a case false is returned.
[ "fails", ".", "In", "such", "a", "case", "false", "is", "returned", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/socket/pubsub/Dist.java#L174-L189
63,130
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.register
public final boolean register(final SelectableChannel channel, final EventsHandler handler) { return register(channel, handler, IN | OUT | ERR); }
java
public final boolean register(final SelectableChannel channel, final EventsHandler handler) { return register(channel, handler, IN | OUT | ERR); }
[ "public", "final", "boolean", "register", "(", "final", "SelectableChannel", "channel", ",", "final", "EventsHandler", "handler", ")", "{", "return", "register", "(", "channel", ",", "handler", ",", "IN", "|", "OUT", "|", "ERR", ")", ";", "}" ]
Registers a SelectableChannel for polling on all events. @param channel the registering channel. @param handler the events handler for this channel @return true if registered, otherwise false
[ "Registers", "a", "SelectableChannel", "for", "polling", "on", "all", "events", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L589-L592
63,131
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.unregister
public final boolean unregister(final Object socketOrChannel) { if (socketOrChannel == null) { return false; } CompositePollItem items = this.items.remove(socketOrChannel); boolean rc = items != null; if (rc) { all.remove(items); } retu...
java
public final boolean unregister(final Object socketOrChannel) { if (socketOrChannel == null) { return false; } CompositePollItem items = this.items.remove(socketOrChannel); boolean rc = items != null; if (rc) { all.remove(items); } retu...
[ "public", "final", "boolean", "unregister", "(", "final", "Object", "socketOrChannel", ")", "{", "if", "(", "socketOrChannel", "==", "null", ")", "{", "return", "false", ";", "}", "CompositePollItem", "items", "=", "this", ".", "items", ".", "remove", "(", ...
Unregister a Socket or SelectableChannel for polling on the specified events. @param socketOrChannel the Socket or SelectableChannel to be unregistered @return true if unregistered, otherwise false TODO would it be useful to unregister only for specific events ?
[ "Unregister", "a", "Socket", "or", "SelectableChannel", "for", "polling", "on", "the", "specified", "events", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L624-L635
63,132
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.poll
protected int poll(final long timeout, final boolean dispatchEvents) { // get all the raw items final Set<PollItem> pollItems = new HashSet<>(); for (CompositePollItem it : all) { pollItems.add(it.item()); } // polling time final int rc = poll(selector, ti...
java
protected int poll(final long timeout, final boolean dispatchEvents) { // get all the raw items final Set<PollItem> pollItems = new HashSet<>(); for (CompositePollItem it : all) { pollItems.add(it.item()); } // polling time final int rc = poll(selector, ti...
[ "protected", "int", "poll", "(", "final", "long", "timeout", ",", "final", "boolean", "dispatchEvents", ")", "{", "// get all the raw items", "final", "Set", "<", "PollItem", ">", "pollItems", "=", "new", "HashSet", "<>", "(", ")", ";", "for", "(", "Composit...
Issue a poll call, using the specified timeout value. @param timeout the timeout, as per zmq_poll (); @param dispatchEvents true to dispatch events using items handler and the global one. @see "http://api.zeromq.org/3-0:zmq-poll" @return how many objects where signaled by poll ()
[ "Issue", "a", "poll", "call", "using", "the", "specified", "timeout", "value", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L668-L689
63,133
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.poll
protected int poll(final Selector selector, final long tout, final Collection<zmq.poll.PollItem> items) { final int size = items.size(); return zmq.ZMQ.poll(selector, items.toArray(new PollItem[size]), size, tout); }
java
protected int poll(final Selector selector, final long tout, final Collection<zmq.poll.PollItem> items) { final int size = items.size(); return zmq.ZMQ.poll(selector, items.toArray(new PollItem[size]), size, tout); }
[ "protected", "int", "poll", "(", "final", "Selector", "selector", ",", "final", "long", "tout", ",", "final", "Collection", "<", "zmq", ".", "poll", ".", "PollItem", ">", "items", ")", "{", "final", "int", "size", "=", "items", ".", "size", "(", ")", ...
does the effective polling
[ "does", "the", "effective", "polling" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L700-L704
63,134
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.dispatch
protected boolean dispatch(final Collection<? extends ItemHolder> all, int size) { ItemHolder[] array = all.toArray(new ItemHolder[all.size()]); // protected against handlers unregistering during this loop for (ItemHolder holder : array) { EventsHandler handler = holder.handler()...
java
protected boolean dispatch(final Collection<? extends ItemHolder> all, int size) { ItemHolder[] array = all.toArray(new ItemHolder[all.size()]); // protected against handlers unregistering during this loop for (ItemHolder holder : array) { EventsHandler handler = holder.handler()...
[ "protected", "boolean", "dispatch", "(", "final", "Collection", "<", "?", "extends", "ItemHolder", ">", "all", ",", "int", "size", ")", "{", "ItemHolder", "[", "]", "array", "=", "all", ".", "toArray", "(", "new", "ItemHolder", "[", "all", ".", "size", ...
Dispatches the polled events. @param all the items used for dispatching @param size the number of items to dispatch @return true if correctly dispatched, false in case of error
[ "Dispatches", "the", "polled", "events", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L713-L752
63,135
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.readable
public boolean readable(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, READABLE); if (it == null) { return false; } return it.isReadable(); }
java
public boolean readable(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, READABLE); if (it == null) { return false; } return it.isReadable(); }
[ "public", "boolean", "readable", "(", "final", "Object", "socketOrChannel", ")", "{", "final", "PollItem", "it", "=", "filter", "(", "socketOrChannel", ",", "READABLE", ")", ";", "if", "(", "it", "==", "null", ")", "{", "return", "false", ";", "}", "retu...
checks for read event
[ "checks", "for", "read", "event" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L797-L804
63,136
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.writable
public boolean writable(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, WRITABLE); if (it == null) { return false; } return it.isWritable(); }
java
public boolean writable(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, WRITABLE); if (it == null) { return false; } return it.isWritable(); }
[ "public", "boolean", "writable", "(", "final", "Object", "socketOrChannel", ")", "{", "final", "PollItem", "it", "=", "filter", "(", "socketOrChannel", ",", "WRITABLE", ")", ";", "if", "(", "it", "==", "null", ")", "{", "return", "false", ";", "}", "retu...
checks for write event
[ "checks", "for", "write", "event" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L849-L856
63,137
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.error
public boolean error(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, ERR); if (it == null) { return false; } return it.isError(); }
java
public boolean error(final Object socketOrChannel) { final PollItem it = filter(socketOrChannel, ERR); if (it == null) { return false; } return it.isError(); }
[ "public", "boolean", "error", "(", "final", "Object", "socketOrChannel", ")", "{", "final", "PollItem", "it", "=", "filter", "(", "socketOrChannel", ",", "ERR", ")", ";", "if", "(", "it", "==", "null", ")", "{", "return", "false", ";", "}", "return", "...
checks for error event
[ "checks", "for", "error", "event" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L901-L908
63,138
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.add
protected boolean add(Object socketOrChannel, final ItemHolder holder) { if (socketOrChannel == null) { Socket socket = holder.socket(); SelectableChannel ch = holder.item().getRawSocket(); if (ch == null) { // not a channel assert (socket ...
java
protected boolean add(Object socketOrChannel, final ItemHolder holder) { if (socketOrChannel == null) { Socket socket = holder.socket(); SelectableChannel ch = holder.item().getRawSocket(); if (ch == null) { // not a channel assert (socket ...
[ "protected", "boolean", "add", "(", "Object", "socketOrChannel", ",", "final", "ItemHolder", "holder", ")", "{", "if", "(", "socketOrChannel", "==", "null", ")", "{", "Socket", "socket", "=", "holder", ".", "socket", "(", ")", ";", "SelectableChannel", "ch",...
add an item to this poller
[ "add", "an", "item", "to", "this", "poller" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L968-L995
63,139
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.items
protected Collection<? extends ItemHolder> items() { for (CompositePollItem item : all) { item.handler(globalHandler); } return all; }
java
protected Collection<? extends ItemHolder> items() { for (CompositePollItem item : all) { item.handler(globalHandler); } return all; }
[ "protected", "Collection", "<", "?", "extends", "ItemHolder", ">", "items", "(", ")", "{", "for", "(", "CompositePollItem", "item", ":", "all", ")", "{", "item", ".", "handler", "(", "globalHandler", ")", ";", "}", "return", "all", ";", "}" ]
gets all the items of this poller
[ "gets", "all", "the", "items", "of", "this", "poller" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L1005-L1011
63,140
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.items
protected Iterable<ItemHolder> items(final Object socketOrChannel) { final CompositePollItem aggregate = items.get(socketOrChannel); if (aggregate == null) { return Collections.emptySet(); } return aggregate.holders; }
java
protected Iterable<ItemHolder> items(final Object socketOrChannel) { final CompositePollItem aggregate = items.get(socketOrChannel); if (aggregate == null) { return Collections.emptySet(); } return aggregate.holders; }
[ "protected", "Iterable", "<", "ItemHolder", ">", "items", "(", "final", "Object", "socketOrChannel", ")", "{", "final", "CompositePollItem", "aggregate", "=", "items", ".", "get", "(", "socketOrChannel", ")", ";", "if", "(", "aggregate", "==", "null", ")", "...
gets all the items of this poller regarding the given input
[ "gets", "all", "the", "items", "of", "this", "poller", "regarding", "the", "given", "input" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L1014-L1021
63,141
zeromq/jeromq
src/main/java/org/zeromq/ZPoller.java
ZPoller.filter
protected PollItem filter(final Object socketOrChannel, int events) { if (socketOrChannel == null) { return null; } CompositePollItem item = items.get(socketOrChannel); if (item == null) { return null; } PollItem pollItem = item.item(); ...
java
protected PollItem filter(final Object socketOrChannel, int events) { if (socketOrChannel == null) { return null; } CompositePollItem item = items.get(socketOrChannel); if (item == null) { return null; } PollItem pollItem = item.item(); ...
[ "protected", "PollItem", "filter", "(", "final", "Object", "socketOrChannel", ",", "int", "events", ")", "{", "if", "(", "socketOrChannel", "==", "null", ")", "{", "return", "null", ";", "}", "CompositePollItem", "item", "=", "items", ".", "get", "(", "soc...
filters items to get the first one matching the criteria, or null if none found
[ "filters", "items", "to", "get", "the", "first", "one", "matching", "the", "criteria", "or", "null", "if", "none", "found" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZPoller.java#L1024-L1041
63,142
zeromq/jeromq
src/main/java/org/zeromq/proto/ZNeedle.java
ZNeedle.getShortString
public String getShortString() { String value = Wire.getShortString(needle, needle.position()); forward(value.length() + 1); return value; }
java
public String getShortString() { String value = Wire.getShortString(needle, needle.position()); forward(value.length() + 1); return value; }
[ "public", "String", "getShortString", "(", ")", "{", "String", "value", "=", "Wire", ".", "getShortString", "(", "needle", ",", "needle", ".", "position", "(", ")", ")", ";", "forward", "(", "value", ".", "length", "(", ")", "+", "1", ")", ";", "retu...
Get a string from the frame
[ "Get", "a", "string", "from", "the", "frame" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZNeedle.java#L138-L143
63,143
zeromq/jeromq
src/main/java/org/zeromq/proto/ZNeedle.java
ZNeedle.getLongString
public String getLongString() { String value = Wire.getLongString(needle, needle.position()); forward(value.length() + 4); return value; }
java
public String getLongString() { String value = Wire.getLongString(needle, needle.position()); forward(value.length() + 4); return value; }
[ "public", "String", "getLongString", "(", ")", "{", "String", "value", "=", "Wire", ".", "getLongString", "(", "needle", ",", "needle", ".", "position", "(", ")", ")", ";", "forward", "(", "value", ".", "length", "(", ")", "+", "4", ")", ";", "return...
Get a long string from the frame
[ "Get", "a", "long", "string", "from", "the", "frame" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZNeedle.java#L152-L157
63,144
zeromq/jeromq
src/main/java/org/zeromq/proto/ZNeedle.java
ZNeedle.putList
public void putList(Collection<String> elements) { if (elements == null) { putNumber1(0); } else { Utils.checkArgument(elements.size() < 256, "Collection has to be smaller than 256 elements"); putNumber1(elements.size()); for (String string : e...
java
public void putList(Collection<String> elements) { if (elements == null) { putNumber1(0); } else { Utils.checkArgument(elements.size() < 256, "Collection has to be smaller than 256 elements"); putNumber1(elements.size()); for (String string : e...
[ "public", "void", "putList", "(", "Collection", "<", "String", ">", "elements", ")", "{", "if", "(", "elements", "==", "null", ")", "{", "putNumber1", "(", "0", ")", ";", "}", "else", "{", "Utils", ".", "checkArgument", "(", "elements", ".", "size", ...
Put a collection of strings to the frame
[ "Put", "a", "collection", "of", "strings", "to", "the", "frame" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZNeedle.java#L177-L189
63,145
zeromq/jeromq
src/main/java/org/zeromq/proto/ZNeedle.java
ZNeedle.putMap
public void putMap(Map<String, String> map) { if (map == null) { putNumber1(0); } else { Utils.checkArgument(map.size() < 256, "Map has to be smaller than 256 elements"); putNumber1(map.size()); for (Entry<String, String> entry : map.entrySet()...
java
public void putMap(Map<String, String> map) { if (map == null) { putNumber1(0); } else { Utils.checkArgument(map.size() < 256, "Map has to be smaller than 256 elements"); putNumber1(map.size()); for (Entry<String, String> entry : map.entrySet()...
[ "public", "void", "putMap", "(", "Map", "<", "String", ",", "String", ">", "map", ")", "{", "if", "(", "map", "==", "null", ")", "{", "putNumber1", "(", "0", ")", ";", "}", "else", "{", "Utils", ".", "checkArgument", "(", "map", ".", "size", "(",...
Put a map of strings to the frame
[ "Put", "a", "map", "of", "strings", "to", "the", "frame" ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/proto/ZNeedle.java#L202-L221
63,146
zeromq/jeromq
src/main/java/zmq/pipe/YQueue.java
YQueue.push
public void push(T val) { backChunk.values[backPos] = val; backChunk = endChunk; backPos = endPos; if (++endPos != size) { return; } Chunk<T> sc = spareChunk; if (sc != beginChunk) { spareChunk = spareChunk.next; endChunk....
java
public void push(T val) { backChunk.values[backPos] = val; backChunk = endChunk; backPos = endPos; if (++endPos != size) { return; } Chunk<T> sc = spareChunk; if (sc != beginChunk) { spareChunk = spareChunk.next; endChunk....
[ "public", "void", "push", "(", "T", "val", ")", "{", "backChunk", ".", "values", "[", "backPos", "]", "=", "val", ";", "backChunk", "=", "endChunk", ";", "backPos", "=", "endPos", ";", "if", "(", "++", "endPos", "!=", "size", ")", "{", "return", ";...
Adds an element to the back end of the queue.
[ "Adds", "an", "element", "to", "the", "back", "end", "of", "the", "queue", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YQueue.java#L82-L105
63,147
zeromq/jeromq
src/main/java/zmq/pipe/YQueue.java
YQueue.unpush
public void unpush() { // First, move 'back' one position backwards. if (backPos > 0) { --backPos; } else { backPos = size - 1; backChunk = backChunk.prev; } // Now, move 'end' position backwards. Note that obsolete end chunk ...
java
public void unpush() { // First, move 'back' one position backwards. if (backPos > 0) { --backPos; } else { backPos = size - 1; backChunk = backChunk.prev; } // Now, move 'end' position backwards. Note that obsolete end chunk ...
[ "public", "void", "unpush", "(", ")", "{", "// First, move 'back' one position backwards.", "if", "(", "backPos", ">", "0", ")", "{", "--", "backPos", ";", "}", "else", "{", "backPos", "=", "size", "-", "1", ";", "backChunk", "=", "backChunk", ".", "prev"...
unsynchronised thread.
[ "unsynchronised", "thread", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YQueue.java#L114-L137
63,148
zeromq/jeromq
src/main/java/zmq/pipe/YQueue.java
YQueue.pop
public T pop() { T val = beginChunk.values[beginPos]; beginChunk.values[beginPos] = null; beginPos++; if (beginPos == size) { beginChunk = beginChunk.next; beginChunk.prev = null; beginPos = 0; } return val; }
java
public T pop() { T val = beginChunk.values[beginPos]; beginChunk.values[beginPos] = null; beginPos++; if (beginPos == size) { beginChunk = beginChunk.next; beginChunk.prev = null; beginPos = 0; } return val; }
[ "public", "T", "pop", "(", ")", "{", "T", "val", "=", "beginChunk", ".", "values", "[", "beginPos", "]", ";", "beginChunk", ".", "values", "[", "beginPos", "]", "=", "null", ";", "beginPos", "++", ";", "if", "(", "beginPos", "==", "size", ")", "{",...
Removes an element from the front end of the queue.
[ "Removes", "an", "element", "from", "the", "front", "end", "of", "the", "queue", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/zmq/pipe/YQueue.java#L140-L151
63,149
zeromq/jeromq
src/main/java/org/zeromq/ZLoop.java
ZLoop.rebuild
private void rebuild() { pollact = null; pollSize = pollers.size(); if (pollset != null) { pollset.close(); } pollset = context.poller(pollSize); assert (pollset != null); pollact = new SPoller[pollSize]; int itemNbr = 0; for (SP...
java
private void rebuild() { pollact = null; pollSize = pollers.size(); if (pollset != null) { pollset.close(); } pollset = context.poller(pollSize); assert (pollset != null); pollact = new SPoller[pollSize]; int itemNbr = 0; for (SP...
[ "private", "void", "rebuild", "(", ")", "{", "pollact", "=", "null", ";", "pollSize", "=", "pollers", ".", "size", "(", ")", ";", "if", "(", "pollset", "!=", "null", ")", "{", "pollset", ".", "close", "(", ")", ";", "}", "pollset", "=", "context", ...
activity on pollers. Returns 0 on success, -1 on failure.
[ "activity", "on", "pollers", ".", "Returns", "0", "on", "success", "-", "1", "on", "failure", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZLoop.java#L103-L123
63,150
zeromq/jeromq
src/main/java/org/zeromq/ZLoop.java
ZLoop.addPoller
public int addPoller(PollItem pollItem, IZLoopHandler handler, Object arg) { if (pollItem.getRawSocket() == null && pollItem.getSocket() == null) { return -1; } SPoller poller = new SPoller(pollItem, handler, arg); pollers.add(poller); dirty = true; if (...
java
public int addPoller(PollItem pollItem, IZLoopHandler handler, Object arg) { if (pollItem.getRawSocket() == null && pollItem.getSocket() == null) { return -1; } SPoller poller = new SPoller(pollItem, handler, arg); pollers.add(poller); dirty = true; if (...
[ "public", "int", "addPoller", "(", "PollItem", "pollItem", ",", "IZLoopHandler", "handler", ",", "Object", "arg", ")", "{", "if", "(", "pollItem", ".", "getRawSocket", "(", ")", "==", "null", "&&", "pollItem", ".", "getSocket", "(", ")", "==", "null", ")...
corresponding handler.
[ "corresponding", "handler", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZLoop.java#L152-L170
63,151
zeromq/jeromq
src/main/java/org/zeromq/ZLoop.java
ZLoop.removeTimer
public int removeTimer(Object arg) { Objects.requireNonNull(arg, "Argument has to be supplied"); // We cannot touch self->timers because we may be executing that // from inside the poll loop. So, we hold the arg on the zombie // list, and process that list when we're done executi...
java
public int removeTimer(Object arg) { Objects.requireNonNull(arg, "Argument has to be supplied"); // We cannot touch self->timers because we may be executing that // from inside the poll loop. So, we hold the arg on the zombie // list, and process that list when we're done executi...
[ "public", "int", "removeTimer", "(", "Object", "arg", ")", "{", "Objects", ".", "requireNonNull", "(", "arg", ",", "\"Argument has to be supplied\"", ")", ";", "// We cannot touch self->timers because we may be executing that", "// from inside the poll loop. So, we hold the arg...
Returns 0 on success.
[ "Returns", "0", "on", "success", "." ]
8b4a2960b468d08b7aebb0d40bfb947e08fed040
https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZLoop.java#L222-L235
63,152
SalomonBrys/ANR-WatchDog
anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java
ANRWatchDog.setANRListener
public ANRWatchDog setANRListener(ANRListener listener) { if (listener == null) { _anrListener = DEFAULT_ANR_LISTENER; } else { _anrListener = listener; } return this; }
java
public ANRWatchDog setANRListener(ANRListener listener) { if (listener == null) { _anrListener = DEFAULT_ANR_LISTENER; } else { _anrListener = listener; } return this; }
[ "public", "ANRWatchDog", "setANRListener", "(", "ANRListener", "listener", ")", "{", "if", "(", "listener", "==", "null", ")", "{", "_anrListener", "=", "DEFAULT_ANR_LISTENER", ";", "}", "else", "{", "_anrListener", "=", "listener", ";", "}", "return", "this",...
Sets an interface for when an ANR is detected. If not set, the default behavior is to throw an error and crash the application. @param listener The new listener or null @return itself for chaining.
[ "Sets", "an", "interface", "for", "when", "an", "ANR", "is", "detected", ".", "If", "not", "set", "the", "default", "behavior", "is", "to", "throw", "an", "error", "and", "crash", "the", "application", "." ]
1969075f75f5980e9000eaffbaa13b0daf282dcb
https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java#L133-L140
63,153
SalomonBrys/ANR-WatchDog
anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java
ANRWatchDog.setANRInterceptor
public ANRWatchDog setANRInterceptor(ANRInterceptor interceptor) { if (interceptor == null) { _anrInterceptor = DEFAULT_ANR_INTERCEPTOR; } else { _anrInterceptor = interceptor; } return this; }
java
public ANRWatchDog setANRInterceptor(ANRInterceptor interceptor) { if (interceptor == null) { _anrInterceptor = DEFAULT_ANR_INTERCEPTOR; } else { _anrInterceptor = interceptor; } return this; }
[ "public", "ANRWatchDog", "setANRInterceptor", "(", "ANRInterceptor", "interceptor", ")", "{", "if", "(", "interceptor", "==", "null", ")", "{", "_anrInterceptor", "=", "DEFAULT_ANR_INTERCEPTOR", ";", "}", "else", "{", "_anrInterceptor", "=", "interceptor", ";", "}...
Sets an interface to intercept ANRs before they are reported. If set, you can define if, given the current duration of the detected ANR and external context, it is necessary to report the ANR. @param interceptor The new interceptor or null @return itself for chaining.
[ "Sets", "an", "interface", "to", "intercept", "ANRs", "before", "they", "are", "reported", ".", "If", "set", "you", "can", "define", "if", "given", "the", "current", "duration", "of", "the", "detected", "ANR", "and", "external", "context", "it", "is", "nec...
1969075f75f5980e9000eaffbaa13b0daf282dcb
https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java#L149-L156
63,154
SalomonBrys/ANR-WatchDog
anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java
ANRWatchDog.setInterruptionListener
public ANRWatchDog setInterruptionListener(InterruptionListener listener) { if (listener == null) { _interruptionListener = DEFAULT_INTERRUPTION_LISTENER; } else { _interruptionListener = listener; } return this; }
java
public ANRWatchDog setInterruptionListener(InterruptionListener listener) { if (listener == null) { _interruptionListener = DEFAULT_INTERRUPTION_LISTENER; } else { _interruptionListener = listener; } return this; }
[ "public", "ANRWatchDog", "setInterruptionListener", "(", "InterruptionListener", "listener", ")", "{", "if", "(", "listener", "==", "null", ")", "{", "_interruptionListener", "=", "DEFAULT_INTERRUPTION_LISTENER", ";", "}", "else", "{", "_interruptionListener", "=", "l...
Sets an interface for when the watchdog thread is interrupted. If not set, the default behavior is to just log the interruption message. @param listener The new listener or null. @return itself for chaining.
[ "Sets", "an", "interface", "for", "when", "the", "watchdog", "thread", "is", "interrupted", ".", "If", "not", "set", "the", "default", "behavior", "is", "to", "just", "log", "the", "interruption", "message", "." ]
1969075f75f5980e9000eaffbaa13b0daf282dcb
https://github.com/SalomonBrys/ANR-WatchDog/blob/1969075f75f5980e9000eaffbaa13b0daf282dcb/anr-watchdog/src/main/java/com/github/anrwatchdog/ANRWatchDog.java#L165-L172
63,155
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/compiler/ModelCompiler.java
ModelCompiler.processTypeForDescendantLookup
private static Type processTypeForDescendantLookup(Type type) { if (type instanceof ParameterizedType) { return ((ParameterizedType) type).getRawType(); } else { return type; } }
java
private static Type processTypeForDescendantLookup(Type type) { if (type instanceof ParameterizedType) { return ((ParameterizedType) type).getRawType(); } else { return type; } }
[ "private", "static", "Type", "processTypeForDescendantLookup", "(", "Type", "type", ")", "{", "if", "(", "type", "instanceof", "ParameterizedType", ")", "{", "return", "(", "(", "ParameterizedType", ")", "type", ")", ".", "getRawType", "(", ")", ";", "}", "e...
Given a type, returns the type that should be used for the purpose of looking up implementations of that type.
[ "Given", "a", "type", "returns", "the", "type", "that", "should", "be", "used", "for", "the", "purpose", "of", "looking", "up", "implementations", "of", "that", "type", "." ]
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/compiler/ModelCompiler.java#L287-L293
63,156
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/util/Utils.java
Utils.generateStream
private static <T> Stream<T> generateStream(T seed, Predicate<? super T> hasNext, UnaryOperator<T> next) { final Spliterator<T> spliterator = Spliterators.spliteratorUnknownSize(new Iterator<T>() { private T last = seed; @Override public boolean hasNext() { r...
java
private static <T> Stream<T> generateStream(T seed, Predicate<? super T> hasNext, UnaryOperator<T> next) { final Spliterator<T> spliterator = Spliterators.spliteratorUnknownSize(new Iterator<T>() { private T last = seed; @Override public boolean hasNext() { r...
[ "private", "static", "<", "T", ">", "Stream", "<", "T", ">", "generateStream", "(", "T", "seed", ",", "Predicate", "<", "?", "super", "T", ">", "hasNext", ",", "UnaryOperator", "<", "T", ">", "next", ")", "{", "final", "Spliterator", "<", "T", ">", ...
remove on Java 9 and replace with Stream.iterate
[ "remove", "on", "Java", "9", "and", "replace", "with", "Stream", ".", "iterate" ]
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/util/Utils.java#L125-L143
63,157
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java
BeanPropertyPathExtension.writeBeanAndParentsFieldSpecs
private static Set<TsBeanModel> writeBeanAndParentsFieldSpecs( Writer writer, Settings settings, TsModel model, Set<TsBeanModel> emittedSoFar, TsBeanModel bean) { if (emittedSoFar.contains(bean)) { return new HashSet<>(); } final TsBeanModel parentBean = getBeanModelByType(mo...
java
private static Set<TsBeanModel> writeBeanAndParentsFieldSpecs( Writer writer, Settings settings, TsModel model, Set<TsBeanModel> emittedSoFar, TsBeanModel bean) { if (emittedSoFar.contains(bean)) { return new HashSet<>(); } final TsBeanModel parentBean = getBeanModelByType(mo...
[ "private", "static", "Set", "<", "TsBeanModel", ">", "writeBeanAndParentsFieldSpecs", "(", "Writer", "writer", ",", "Settings", "settings", ",", "TsModel", "model", ",", "Set", "<", "TsBeanModel", ">", "emittedSoFar", ",", "TsBeanModel", "bean", ")", "{", "if", ...
Emits a bean and its parent beans before if needed. Returns the list of beans that were emitted.
[ "Emits", "a", "bean", "and", "its", "parent", "beans", "before", "if", "needed", ".", "Returns", "the", "list", "of", "beans", "that", "were", "emitted", "." ]
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java#L74-L98
63,158
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java
BeanPropertyPathExtension.isOriginalTsType
private static boolean isOriginalTsType(TsType type) { if (type instanceof TsType.BasicType) { TsType.BasicType basicType = (TsType.BasicType)type; return !(basicType.name.equals("null") || basicType.name.equals("undefined")); } return true; }
java
private static boolean isOriginalTsType(TsType type) { if (type instanceof TsType.BasicType) { TsType.BasicType basicType = (TsType.BasicType)type; return !(basicType.name.equals("null") || basicType.name.equals("undefined")); } return true; }
[ "private", "static", "boolean", "isOriginalTsType", "(", "TsType", "type", ")", "{", "if", "(", "type", "instanceof", "TsType", ".", "BasicType", ")", "{", "TsType", ".", "BasicType", "basicType", "=", "(", "TsType", ".", "BasicType", ")", "type", ";", "re...
is this type an 'original' TS type, or a contextual information? null, undefined and optional info are not original types, everything else is original
[ "is", "this", "type", "an", "original", "TS", "type", "or", "a", "contextual", "information?", "null", "undefined", "and", "optional", "info", "are", "not", "original", "types", "everything", "else", "is", "original" ]
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java#L105-L111
63,159
vojtechhabarta/typescript-generator
typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java
BeanPropertyPathExtension.extractOriginalTsType
private static TsType extractOriginalTsType(TsType type) { if (type instanceof TsType.OptionalType) { return extractOriginalTsType(((TsType.OptionalType)type).type); } if (type instanceof TsType.UnionType) { TsType.UnionType union = (TsType.UnionType)type; Lis...
java
private static TsType extractOriginalTsType(TsType type) { if (type instanceof TsType.OptionalType) { return extractOriginalTsType(((TsType.OptionalType)type).type); } if (type instanceof TsType.UnionType) { TsType.UnionType union = (TsType.UnionType)type; Lis...
[ "private", "static", "TsType", "extractOriginalTsType", "(", "TsType", "type", ")", "{", "if", "(", "type", "instanceof", "TsType", ".", "OptionalType", ")", "{", "return", "extractOriginalTsType", "(", "(", "(", "TsType", ".", "OptionalType", ")", "type", ")"...
If the type is optional of number|null|undefined, or list of of integer, we want to be able to recognize it as number to link the member to another class. => extract the original type while ignoring the |null|undefined and optional informations.
[ "If", "the", "type", "is", "optional", "of", "number|null|undefined", "or", "list", "of", "of", "integer", "we", "want", "to", "be", "able", "to", "recognize", "it", "as", "number", "to", "link", "the", "member", "to", "another", "class", ".", "=", ">", ...
23a43848f075360eefb15c5e233cfd71205b3e9f
https://github.com/vojtechhabarta/typescript-generator/blob/23a43848f075360eefb15c5e233cfd71205b3e9f/typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java#L120-L140
63,160
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/NNChain.java
NNChain.findUnlinked
public static int findUnlinked(int pos, int end, DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder) { while(pos < end) { if(!builder.isLinked(ix.seek(pos))) { return pos; } ++pos; } return -1; }
java
public static int findUnlinked(int pos, int end, DBIDArrayIter ix, PointerHierarchyRepresentationBuilder builder) { while(pos < end) { if(!builder.isLinked(ix.seek(pos))) { return pos; } ++pos; } return -1; }
[ "public", "static", "int", "findUnlinked", "(", "int", "pos", ",", "int", "end", ",", "DBIDArrayIter", "ix", ",", "PointerHierarchyRepresentationBuilder", "builder", ")", "{", "while", "(", "pos", "<", "end", ")", "{", "if", "(", "!", "builder", ".", "isLi...
Find an unlinked object. @param pos Starting position @param end End position @param ix Iterator to translate into DBIDs @param builder Linkage information @return Position
[ "Find", "an", "unlinked", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/NNChain.java#L199-L207
63,161
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/result/KMLOutputHandler.java
KMLOutputHandler.buildHullsRecursively
private DoubleObjPair<Polygon> buildHullsRecursively(Cluster<Model> clu, Hierarchy<Cluster<Model>> hier, Map<Object, DoubleObjPair<Polygon>> hulls, Relation<? extends NumberVector> coords) { final DBIDs ids = clu.getIDs(); FilteredConvexHull2D hull = new FilteredConvexHull2D(); for(DBIDIter iter = ids.iter...
java
private DoubleObjPair<Polygon> buildHullsRecursively(Cluster<Model> clu, Hierarchy<Cluster<Model>> hier, Map<Object, DoubleObjPair<Polygon>> hulls, Relation<? extends NumberVector> coords) { final DBIDs ids = clu.getIDs(); FilteredConvexHull2D hull = new FilteredConvexHull2D(); for(DBIDIter iter = ids.iter...
[ "private", "DoubleObjPair", "<", "Polygon", ">", "buildHullsRecursively", "(", "Cluster", "<", "Model", ">", "clu", ",", "Hierarchy", "<", "Cluster", "<", "Model", ">", ">", "hier", ",", "Map", "<", "Object", ",", "DoubleObjPair", "<", "Polygon", ">", ">",...
Recursively step through the clusters to build the hulls. @param clu Current cluster @param hier Clustering hierarchy @param hulls Hull map
[ "Recursively", "step", "through", "the", "clusters", "to", "build", "the", "hulls", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/KMLOutputHandler.java#L514-L542
63,162
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/result/KMLOutputHandler.java
KMLOutputHandler.getColorForValue
public static final Color getColorForValue(double val) { // Color positions double[] pos = new double[] { 0.0, 0.6, 0.8, 1.0 }; // Colors at these positions Color[] cols = new Color[] { new Color(0.0f, 0.0f, 0.0f, 0.6f), new Color(0.0f, 0.0f, 1.0f, 0.8f), new Color(1.0f, 0.0f, 0.0f, 0.9f), new Color(1.0...
java
public static final Color getColorForValue(double val) { // Color positions double[] pos = new double[] { 0.0, 0.6, 0.8, 1.0 }; // Colors at these positions Color[] cols = new Color[] { new Color(0.0f, 0.0f, 0.0f, 0.6f), new Color(0.0f, 0.0f, 1.0f, 0.8f), new Color(1.0f, 0.0f, 0.0f, 0.9f), new Color(1.0...
[ "public", "static", "final", "Color", "getColorForValue", "(", "double", "val", ")", "{", "// Color positions", "double", "[", "]", "pos", "=", "new", "double", "[", "]", "{", "0.0", ",", "0.6", ",", "0.8", ",", "1.0", "}", ";", "// Colors at these positio...
Get color from a simple heatmap. @param val Score value @return Color in heatmap
[ "Get", "color", "from", "a", "simple", "heatmap", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/result/KMLOutputHandler.java#L602-L626
63,163
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java
SVGSaveDialog.showSaveDialog
public static int showSaveDialog(SVGPlot plot, int width, int height) { JFileChooser fc = new JFileChooser(new File(".")); fc.setDialogTitle(DEFAULT_TITLE); // fc.setFileFilter(new ImageFilter()); SaveOptionsPanel optionsPanel = new SaveOptionsPanel(fc, width, height); fc.setAccessory(optionsPanel);...
java
public static int showSaveDialog(SVGPlot plot, int width, int height) { JFileChooser fc = new JFileChooser(new File(".")); fc.setDialogTitle(DEFAULT_TITLE); // fc.setFileFilter(new ImageFilter()); SaveOptionsPanel optionsPanel = new SaveOptionsPanel(fc, width, height); fc.setAccessory(optionsPanel);...
[ "public", "static", "int", "showSaveDialog", "(", "SVGPlot", "plot", ",", "int", "width", ",", "int", "height", ")", "{", "JFileChooser", "fc", "=", "new", "JFileChooser", "(", "new", "File", "(", "\".\"", ")", ")", ";", "fc", ".", "setDialogTitle", "(",...
Show a "Save as" dialog. @param plot The plot to be exported. @param width The width of the exported image (when export to JPEG/PNG). @param height The height of the exported image (when export to JPEG/PNG). @return Result from {@link JFileChooser#showSaveDialog}
[ "Show", "a", "Save", "as", "dialog", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java#L119-L181
63,164
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java
SVGSaveDialog.guessFormat
public static String guessFormat(String name) { String ext = FileUtil.getFilenameExtension(name); for(String format : FORMATS) { if(format.equalsIgnoreCase(ext)) { return ext; } } return null; }
java
public static String guessFormat(String name) { String ext = FileUtil.getFilenameExtension(name); for(String format : FORMATS) { if(format.equalsIgnoreCase(ext)) { return ext; } } return null; }
[ "public", "static", "String", "guessFormat", "(", "String", "name", ")", "{", "String", "ext", "=", "FileUtil", ".", "getFilenameExtension", "(", "name", ")", ";", "for", "(", "String", "format", ":", "FORMATS", ")", "{", "if", "(", "format", ".", "equal...
Guess a supported format from the file name. For "auto" format handling. @param name File name @return format or "null"
[ "Guess", "a", "supported", "format", "from", "the", "file", "name", ".", "For", "auto", "format", "handling", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/savedialog/SVGSaveDialog.java#L189-L197
63,165
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java
ArrayLikeUtil.featureVectorAdapter
@SuppressWarnings("unchecked") public static <F> FeatureVectorAdapter<F> featureVectorAdapter(FeatureVector<F> prototype) { return (FeatureVectorAdapter<F>) FEATUREVECTORADAPTER; }
java
@SuppressWarnings("unchecked") public static <F> FeatureVectorAdapter<F> featureVectorAdapter(FeatureVector<F> prototype) { return (FeatureVectorAdapter<F>) FEATUREVECTORADAPTER; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "F", ">", "FeatureVectorAdapter", "<", "F", ">", "featureVectorAdapter", "(", "FeatureVector", "<", "F", ">", "prototype", ")", "{", "return", "(", "FeatureVectorAdapter", "<", "F", "...
Get the static instance. @param prototype Prototype value, for type inference @return Instance
[ "Get", "the", "static", "instance", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java#L105-L108
63,166
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java
ArrayLikeUtil.getIndexOfMaximum
public static <A> int getIndexOfMaximum(A array, NumberArrayAdapter<?, A> adapter) throws IndexOutOfBoundsException { final int size = adapter.size(array); int index = 0; double max = adapter.getDouble(array, 0); for (int i = 1; i < size; i++) { double val = adapter.getDouble(array, i); if (...
java
public static <A> int getIndexOfMaximum(A array, NumberArrayAdapter<?, A> adapter) throws IndexOutOfBoundsException { final int size = adapter.size(array); int index = 0; double max = adapter.getDouble(array, 0); for (int i = 1; i < size; i++) { double val = adapter.getDouble(array, i); if (...
[ "public", "static", "<", "A", ">", "int", "getIndexOfMaximum", "(", "A", "array", ",", "NumberArrayAdapter", "<", "?", ",", "A", ">", "adapter", ")", "throws", "IndexOutOfBoundsException", "{", "final", "int", "size", "=", "adapter", ".", "size", "(", "arr...
Returns the index of the maximum of the given values. If no value is bigger than the first, the index of the first entry is returned. @param <A> array type @param array Array to inspect @param adapter API adapter class @return the index of the maximum in the given values @throws IndexOutOfBoundsException if the length...
[ "Returns", "the", "index", "of", "the", "maximum", "of", "the", "given", "values", ".", "If", "no", "value", "is", "bigger", "than", "the", "first", "the", "index", "of", "the", "first", "entry", "is", "returned", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arraylike/ArrayLikeUtil.java#L120-L132
63,167
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveTransformer.java
ZCurveTransformer.asByteArray
public byte[] asByteArray(NumberVector vector) { final long[] longValueList = new long[dimensionality]; for(int dim = 0; dim < dimensionality; ++dim) { final double minValue = minValues[dim]; final double maxValue = maxValues[dim]; double dimValue = vector.doubleValue(dim); dimValue = ...
java
public byte[] asByteArray(NumberVector vector) { final long[] longValueList = new long[dimensionality]; for(int dim = 0; dim < dimensionality; ++dim) { final double minValue = minValues[dim]; final double maxValue = maxValues[dim]; double dimValue = vector.doubleValue(dim); dimValue = ...
[ "public", "byte", "[", "]", "asByteArray", "(", "NumberVector", "vector", ")", "{", "final", "long", "[", "]", "longValueList", "=", "new", "long", "[", "dimensionality", "]", ";", "for", "(", "int", "dim", "=", "0", ";", "dim", "<", "dimensionality", ...
Transform a single vector. @param vector Vector to transform @return Z curve value as byte array
[ "Transform", "a", "single", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/ZCurveTransformer.java#L83-L108
63,168
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java
SOD.run
public OutlierResult run(Relation<V> relation) { SimilarityQuery<V> snnInstance = similarityFunction.instantiate(relation); FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Assigning Subspace Outlier Degree", relation.size(), LOG) : null; WritableDoubleDataStore sod_scores = DataStoreUtil.mak...
java
public OutlierResult run(Relation<V> relation) { SimilarityQuery<V> snnInstance = similarityFunction.instantiate(relation); FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("Assigning Subspace Outlier Degree", relation.size(), LOG) : null; WritableDoubleDataStore sod_scores = DataStoreUtil.mak...
[ "public", "OutlierResult", "run", "(", "Relation", "<", "V", ">", "relation", ")", "{", "SimilarityQuery", "<", "V", ">", "snnInstance", "=", "similarityFunction", ".", "instantiate", "(", "relation", ")", ";", "FiniteProgress", "progress", "=", "LOG", ".", ...
Performs the SOD algorithm on the given database. @param relation Data relation to process @return Outlier result
[ "Performs", "the", "SOD", "algorithm", "on", "the", "given", "database", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L143-L187
63,169
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java
SOD.getNearestNeighbors
private DBIDs getNearestNeighbors(Relation<V> relation, SimilarityQuery<V> simQ, DBIDRef queryObject) { Heap<DoubleDBIDPair> nearestNeighbors = new TiedTopBoundedHeap<>(knn); for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { if(DBIDUtil.equal(iter, queryObject)) { continue;...
java
private DBIDs getNearestNeighbors(Relation<V> relation, SimilarityQuery<V> simQ, DBIDRef queryObject) { Heap<DoubleDBIDPair> nearestNeighbors = new TiedTopBoundedHeap<>(knn); for(DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) { if(DBIDUtil.equal(iter, queryObject)) { continue;...
[ "private", "DBIDs", "getNearestNeighbors", "(", "Relation", "<", "V", ">", "relation", ",", "SimilarityQuery", "<", "V", ">", "simQ", ",", "DBIDRef", "queryObject", ")", "{", "Heap", "<", "DoubleDBIDPair", ">", "nearestNeighbors", "=", "new", "TiedTopBoundedHeap...
Get the k nearest neighbors in terms of the shared nearest neighbor distance. The query object is excluded from the knn list. FIXME: move this to the database layer. @param relation the database holding the objects @param simQ similarity function @param queryObject the query object for which the kNNs should be deter...
[ "Get", "the", "k", "nearest", "neighbors", "in", "terms", "of", "the", "shared", "nearest", "neighbor", "distance", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L203-L220
63,170
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java
SOD.computePerDimensionVariances
private static double[] computePerDimensionVariances(Relation<? extends NumberVector> relation, double[] center, DBIDs neighborhood) { final int dim = center.length; double[] variances = new double[dim]; for(DBIDIter iter = neighborhood.iter(); iter.valid(); iter.advance()) { NumberVector databaseObje...
java
private static double[] computePerDimensionVariances(Relation<? extends NumberVector> relation, double[] center, DBIDs neighborhood) { final int dim = center.length; double[] variances = new double[dim]; for(DBIDIter iter = neighborhood.iter(); iter.valid(); iter.advance()) { NumberVector databaseObje...
[ "private", "static", "double", "[", "]", "computePerDimensionVariances", "(", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ",", "double", "[", "]", "center", ",", "DBIDs", "neighborhood", ")", "{", "final", "int", "dim", "=", "center", "...
Compute the per-dimension variances for the given neighborhood and center. @param relation Data relation @param center Center vector @param neighborhood Neighbors @return Per-dimension variances.
[ "Compute", "the", "per", "-", "dimension", "variances", "for", "the", "given", "neighborhood", "and", "center", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L230-L241
63,171
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java
SOD.subspaceOutlierDegree
private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) { final int card = BitsUtil.cardinality(weightVector); if(card == 0) { return 0; } final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector); return df.distance(quer...
java
private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) { final int card = BitsUtil.cardinality(weightVector); if(card == 0) { return 0; } final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector); return df.distance(quer...
[ "private", "double", "subspaceOutlierDegree", "(", "V", "queryObject", ",", "double", "[", "]", "center", ",", "long", "[", "]", "weightVector", ")", "{", "final", "int", "card", "=", "BitsUtil", ".", "cardinality", "(", "weightVector", ")", ";", "if", "("...
Compute SOD score. @param queryObject Query object @param center Center vector @param weightVector Weight vector @return sod score
[ "Compute", "SOD", "score", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/subspace/SOD.java#L251-L258
63,172
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java
ParseUtil.parseLongBase10
public static long parseLongBase10(final CharSequence str, final int start, final int end) { // Current position and character. int pos = start; char cur = str.charAt(pos); // Match sign boolean isNegative = (cur == '-'); // Carefully consume the - character, update c and i: if((isNegative ...
java
public static long parseLongBase10(final CharSequence str, final int start, final int end) { // Current position and character. int pos = start; char cur = str.charAt(pos); // Match sign boolean isNegative = (cur == '-'); // Carefully consume the - character, update c and i: if((isNegative ...
[ "public", "static", "long", "parseLongBase10", "(", "final", "CharSequence", "str", ",", "final", "int", "start", ",", "final", "int", "end", ")", "{", "// Current position and character.", "int", "pos", "=", "start", ";", "char", "cur", "=", "str", ".", "ch...
Parse a long integer from a character sequence. @param str String @param start Begin @param end End @return Long value
[ "Parse", "a", "long", "integer", "from", "a", "character", "sequence", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java#L364-L407
63,173
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java
ParseUtil.matchInf
private static boolean matchInf(byte[] str, byte firstchar, int start, int end) { final int len = end - start; // The wonders of unicode. The infinity symbol \u221E is three bytes: if(len == 3 && firstchar == -0x1E && str[start + 1] == -0x78 && str[start + 2] == -0x62) { return true; } if((len...
java
private static boolean matchInf(byte[] str, byte firstchar, int start, int end) { final int len = end - start; // The wonders of unicode. The infinity symbol \u221E is three bytes: if(len == 3 && firstchar == -0x1E && str[start + 1] == -0x78 && str[start + 2] == -0x62) { return true; } if((len...
[ "private", "static", "boolean", "matchInf", "(", "byte", "[", "]", "str", ",", "byte", "firstchar", ",", "int", "start", ",", "int", "end", ")", "{", "final", "int", "len", "=", "end", "-", "start", ";", "// The wonders of unicode. The infinity symbol \\u221E ...
Match "inf", "infinity" in a number of different capitalizations. @param str String to match @param firstchar First character @param start Interval begin @param end Interval end @return {@code true} when infinity was recognized.
[ "Match", "inf", "infinity", "in", "a", "number", "of", "different", "capitalizations", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java#L481-L501
63,174
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java
ParseUtil.matchNaN
private static boolean matchNaN(byte[] str, byte firstchar, int start, int end) { final int len = end - start; if(len < 2 || len > 3 || (firstchar != 'N' && firstchar != 'n')) { return false; } final byte c1 = str[start + 1]; if(c1 != 'a' && c1 != 'A') { return false; } // Accept...
java
private static boolean matchNaN(byte[] str, byte firstchar, int start, int end) { final int len = end - start; if(len < 2 || len > 3 || (firstchar != 'N' && firstchar != 'n')) { return false; } final byte c1 = str[start + 1]; if(c1 != 'a' && c1 != 'A') { return false; } // Accept...
[ "private", "static", "boolean", "matchNaN", "(", "byte", "[", "]", "str", ",", "byte", "firstchar", ",", "int", "start", ",", "int", "end", ")", "{", "final", "int", "len", "=", "end", "-", "start", ";", "if", "(", "len", "<", "2", "||", "len", "...
Match "NaN" in a number of different capitalizations. @param str String to match @param firstchar First character @param start Interval begin @param end Interval end @return {@code true} when NaN was recognized.
[ "Match", "NaN", "in", "a", "number", "of", "different", "capitalizations", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ParseUtil.java#L543-L558
63,175
elki-project/elki
elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/GUIUtil.java
GUIUtil.setLookAndFeel
public static void setLookAndFeel() { try { if(PREFER_GTK) { LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels(); for(LookAndFeelInfo lf : lfs) { if(lf.getClassName().contains("GTK")) { UIManager.setLookAndFeel(lf.getClassName()); return; } ...
java
public static void setLookAndFeel() { try { if(PREFER_GTK) { LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels(); for(LookAndFeelInfo lf : lfs) { if(lf.getClassName().contains("GTK")) { UIManager.setLookAndFeel(lf.getClassName()); return; } ...
[ "public", "static", "void", "setLookAndFeel", "(", ")", "{", "try", "{", "if", "(", "PREFER_GTK", ")", "{", "LookAndFeelInfo", "[", "]", "lfs", "=", "UIManager", ".", "getInstalledLookAndFeels", "(", ")", ";", "for", "(", "LookAndFeelInfo", "lf", ":", "lfs...
Setup look at feel.
[ "Setup", "look", "at", "feel", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/GUIUtil.java#L50-L67
63,176
elki-project/elki
elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/GUIUtil.java
GUIUtil.logUncaughtExceptions
public static void logUncaughtExceptions(Logging logger) { try { Thread.setDefaultUncaughtExceptionHandler((t, e) -> logger.exception(e)); } catch(SecurityException e) { logger.warning("Could not set the Default Uncaught Exception Handler", e); } }
java
public static void logUncaughtExceptions(Logging logger) { try { Thread.setDefaultUncaughtExceptionHandler((t, e) -> logger.exception(e)); } catch(SecurityException e) { logger.warning("Could not set the Default Uncaught Exception Handler", e); } }
[ "public", "static", "void", "logUncaughtExceptions", "(", "Logging", "logger", ")", "{", "try", "{", "Thread", ".", "setDefaultUncaughtExceptionHandler", "(", "(", "t", ",", "e", ")", "->", "logger", ".", "exception", "(", "e", ")", ")", ";", "}", "catch",...
Setup logging of uncaught exceptions. @param logger logger
[ "Setup", "logging", "of", "uncaught", "exceptions", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/GUIUtil.java#L74-L81
63,177
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.buildFrequentOneItemsets
protected List<OneItemset> buildFrequentOneItemsets(final Relation<? extends SparseFeatureVector<?>> relation, final int dim, final int needed) { // TODO: use TIntList and prefill appropriately to avoid knowing "dim" // beforehand? int[] counts = new int[dim]; for(DBIDIter iditer = relation.iterDBIDs();...
java
protected List<OneItemset> buildFrequentOneItemsets(final Relation<? extends SparseFeatureVector<?>> relation, final int dim, final int needed) { // TODO: use TIntList and prefill appropriately to avoid knowing "dim" // beforehand? int[] counts = new int[dim]; for(DBIDIter iditer = relation.iterDBIDs();...
[ "protected", "List", "<", "OneItemset", ">", "buildFrequentOneItemsets", "(", "final", "Relation", "<", "?", "extends", "SparseFeatureVector", "<", "?", ">", ">", "relation", ",", "final", "int", "dim", ",", "final", "int", "needed", ")", "{", "// TODO: use TI...
Build the 1-itemsets. @param relation Data relation @param dim Maximum dimensionality @param needed Minimum support needed @return 1-itemsets
[ "Build", "the", "1", "-", "itemsets", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L198-L219
63,178
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.buildFrequentTwoItemsets
protected List<SparseItemset> buildFrequentTwoItemsets(List<OneItemset> oneitems, final Relation<BitVector> relation, final int dim, final int needed, DBIDs ids, ArrayModifiableDBIDs survivors) { int f1 = 0; long[] mask = BitsUtil.zero(dim); for(OneItemset supported : oneitems) { BitsUtil.setI(mask, s...
java
protected List<SparseItemset> buildFrequentTwoItemsets(List<OneItemset> oneitems, final Relation<BitVector> relation, final int dim, final int needed, DBIDs ids, ArrayModifiableDBIDs survivors) { int f1 = 0; long[] mask = BitsUtil.zero(dim); for(OneItemset supported : oneitems) { BitsUtil.setI(mask, s...
[ "protected", "List", "<", "SparseItemset", ">", "buildFrequentTwoItemsets", "(", "List", "<", "OneItemset", ">", "oneitems", ",", "final", "Relation", "<", "BitVector", ">", "relation", ",", "final", "int", "dim", ",", "final", "int", "needed", ",", "DBIDs", ...
Build the 2-itemsets. @param oneitems Frequent 1-itemsets @param relation Data relation @param dim Maximum dimensionality @param needed Minimum support needed @param ids Objects to process @param survivors Output: objects that had at least two 1-frequent items. @return Frequent 2-itemsets
[ "Build", "the", "2", "-", "itemsets", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L232-L278
63,179
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.frequentItemsets
protected List<? extends Itemset> frequentItemsets(List<? extends Itemset> candidates, Relation<BitVector> relation, int needed, DBIDs ids, ArrayModifiableDBIDs survivors, int length) { if(candidates.isEmpty()) { return Collections.emptyList(); } Itemset first = candidates.get(0); // We have an op...
java
protected List<? extends Itemset> frequentItemsets(List<? extends Itemset> candidates, Relation<BitVector> relation, int needed, DBIDs ids, ArrayModifiableDBIDs survivors, int length) { if(candidates.isEmpty()) { return Collections.emptyList(); } Itemset first = candidates.get(0); // We have an op...
[ "protected", "List", "<", "?", "extends", "Itemset", ">", "frequentItemsets", "(", "List", "<", "?", "extends", "Itemset", ">", "candidates", ",", "Relation", "<", "BitVector", ">", "relation", ",", "int", "needed", ",", "DBIDs", "ids", ",", "ArrayModifiable...
Returns the frequent BitSets out of the given BitSets with respect to the given database. @param candidates the candidates to be evaluated @param relation the database to evaluate the candidates on @param needed Minimum support needed @param ids Objects to process @param survivors Output: objects that had at least two...
[ "Returns", "the", "frequent", "BitSets", "out", "of", "the", "given", "BitSets", "with", "respect", "to", "the", "given", "database", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L394-L433
63,180
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.frequentItemsetsSparse
protected List<SparseItemset> frequentItemsetsSparse(List<SparseItemset> candidates, Relation<BitVector> relation, int needed, DBIDs ids, ArrayModifiableDBIDs survivors, int length) { // Current search interval: int begin = 0, end = candidates.size(); int[] scratchi = new int[length], iters = new int[length...
java
protected List<SparseItemset> frequentItemsetsSparse(List<SparseItemset> candidates, Relation<BitVector> relation, int needed, DBIDs ids, ArrayModifiableDBIDs survivors, int length) { // Current search interval: int begin = 0, end = candidates.size(); int[] scratchi = new int[length], iters = new int[length...
[ "protected", "List", "<", "SparseItemset", ">", "frequentItemsetsSparse", "(", "List", "<", "SparseItemset", ">", "candidates", ",", "Relation", "<", "BitVector", ">", "relation", ",", "int", "needed", ",", "DBIDs", "ids", ",", "ArrayModifiableDBIDs", "survivors",...
Returns the frequent BitSets out of the given BitSets with respect to the given database. Optimized implementation for SparseItemset. @param candidates the candidates to be evaluated @param relation the database to evaluate the candidates on @param needed Minimum support needed @param ids Objects to process @param sur...
[ "Returns", "the", "frequent", "BitSets", "out", "of", "the", "given", "BitSets", "with", "respect", "to", "the", "given", "database", ".", "Optimized", "implementation", "for", "SparseItemset", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L447-L490
63,181
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.initializeSearchItemset
private boolean initializeSearchItemset(BitVector bv, int[] scratchi, int[] iters) { for(int i = 0; i < scratchi.length; i++) { iters[i] = (i == 0) ? bv.iter() : bv.iterAdvance(iters[i - 1]); if(iters[i] < 0) { return false; } scratchi[i] = bv.iterDim(iters[i]); } return true...
java
private boolean initializeSearchItemset(BitVector bv, int[] scratchi, int[] iters) { for(int i = 0; i < scratchi.length; i++) { iters[i] = (i == 0) ? bv.iter() : bv.iterAdvance(iters[i - 1]); if(iters[i] < 0) { return false; } scratchi[i] = bv.iterDim(iters[i]); } return true...
[ "private", "boolean", "initializeSearchItemset", "(", "BitVector", "bv", ",", "int", "[", "]", "scratchi", ",", "int", "[", "]", "iters", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "scratchi", ".", "length", ";", "i", "++", ")", "{"...
Initialize the scratch itemset. @param bv Bit vector data source @param scratchi Scratch itemset @param iters Iterator array @return {@code true} if the itemset had minimum length
[ "Initialize", "the", "scratch", "itemset", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L500-L509
63,182
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.nextSearchItemset
private boolean nextSearchItemset(BitVector bv, int[] scratchi, int[] iters) { final int last = scratchi.length - 1; for(int j = last; j >= 0; j--) { int n = bv.iterAdvance(iters[j]); if(n >= 0 && (j == last || n != iters[j + 1])) { iters[j] = n; scratchi[j] = bv.iterDim(n); ...
java
private boolean nextSearchItemset(BitVector bv, int[] scratchi, int[] iters) { final int last = scratchi.length - 1; for(int j = last; j >= 0; j--) { int n = bv.iterAdvance(iters[j]); if(n >= 0 && (j == last || n != iters[j + 1])) { iters[j] = n; scratchi[j] = bv.iterDim(n); ...
[ "private", "boolean", "nextSearchItemset", "(", "BitVector", "bv", ",", "int", "[", "]", "scratchi", ",", "int", "[", "]", "iters", ")", "{", "final", "int", "last", "=", "scratchi", ".", "length", "-", "1", ";", "for", "(", "int", "j", "=", "last", ...
Advance scratch itemset to the next. @param bv Bit vector data source @param scratchi Scratch itemset @param iters Iterator array @return {@code true} if the itemset had minimum length
[ "Advance", "scratch", "itemset", "to", "the", "next", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L519-L530
63,183
elki-project/elki
elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java
APRIORI.binarySearch
private int binarySearch(List<SparseItemset> candidates, SparseItemset scratch, int begin, int end) { --end; while(begin < end) { final int mid = (begin + end) >>> 1; SparseItemset midVal = candidates.get(mid); int cmp = midVal.compareTo(scratch); if(cmp < 0) { begin = mid + 1; ...
java
private int binarySearch(List<SparseItemset> candidates, SparseItemset scratch, int begin, int end) { --end; while(begin < end) { final int mid = (begin + end) >>> 1; SparseItemset midVal = candidates.get(mid); int cmp = midVal.compareTo(scratch); if(cmp < 0) { begin = mid + 1; ...
[ "private", "int", "binarySearch", "(", "List", "<", "SparseItemset", ">", "candidates", ",", "SparseItemset", "scratch", ",", "int", "begin", ",", "int", "end", ")", "{", "--", "end", ";", "while", "(", "begin", "<", "end", ")", "{", "final", "int", "m...
Binary-search for the next-larger element. @param candidates Candidates to search for @param scratch Scratch space @param begin Search interval begin @param end Search interval end @return Position of first equal-or-larger element
[ "Binary", "-", "search", "for", "the", "next", "-", "larger", "element", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-itemsets/src/main/java/de/lmu/ifi/dbs/elki/algorithm/itemsetmining/APRIORI.java#L541-L559
63,184
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.buildPartitions
private <A> ArrayList<int[]> buildPartitions(NumberArrayAdapter<?, A> adapter1, A data1, int len, int depth) { final int[] idx = new int[len]; final double[] tmp = new double[len]; for(int i = 0; i < len; ++i) { idx[i] = i; tmp[i] = adapter1.getDouble(data1, i); } // Sort indexes: In...
java
private <A> ArrayList<int[]> buildPartitions(NumberArrayAdapter<?, A> adapter1, A data1, int len, int depth) { final int[] idx = new int[len]; final double[] tmp = new double[len]; for(int i = 0; i < len; ++i) { idx[i] = i; tmp[i] = adapter1.getDouble(data1, i); } // Sort indexes: In...
[ "private", "<", "A", ">", "ArrayList", "<", "int", "[", "]", ">", "buildPartitions", "(", "NumberArrayAdapter", "<", "?", ",", "A", ">", "adapter1", ",", "A", "data1", ",", "int", "len", ",", "int", "depth", ")", "{", "final", "int", "[", "]", "idx...
Partitions an attribute. @param adapter1 Data adapter @param data1 Data set @param len Length of data @param depth Splitting depth @return List of sorted objects
[ "Partitions", "an", "attribute", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L95-L109
63,185
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.divide
private void divide(int[] idx, double[] data, ArrayList<int[]> ret, int start, int end, int depth) { if(depth == 0) { int[] a = Arrays.copyOfRange(idx, start, end); Arrays.sort(a); ret.add(a); return; } final int count = end - start; if(count == 0) { // Corner case, that sh...
java
private void divide(int[] idx, double[] data, ArrayList<int[]> ret, int start, int end, int depth) { if(depth == 0) { int[] a = Arrays.copyOfRange(idx, start, end); Arrays.sort(a); ret.add(a); return; } final int count = end - start; if(count == 0) { // Corner case, that sh...
[ "private", "void", "divide", "(", "int", "[", "]", "idx", ",", "double", "[", "]", "data", ",", "ArrayList", "<", "int", "[", "]", ">", "ret", ",", "int", "start", ",", "int", "end", ",", "int", "depth", ")", "{", "if", "(", "depth", "==", "0",...
Recursive call to further subdivide the array. @param idx Object indexes. @param data 1D data, sorted @param ret Output index @param start Interval start @param end Interval end @param depth Depth
[ "Recursive", "call", "to", "further", "subdivide", "the", "array", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L121-L163
63,186
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.intersectionMatrix
private void intersectionMatrix(int[][] res, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int gridsize) { for(int x = 0; x < gridsize; x++) { final int[] px = partsx.get(x); final int[] rowx = res[x]; for(int y = 0; y < gridsize; y++) { int[] py = partsy.get(y); rowx[y] = inte...
java
private void intersectionMatrix(int[][] res, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int gridsize) { for(int x = 0; x < gridsize; x++) { final int[] px = partsx.get(x); final int[] rowx = res[x]; for(int y = 0; y < gridsize; y++) { int[] py = partsy.get(y); rowx[y] = inte...
[ "private", "void", "intersectionMatrix", "(", "int", "[", "]", "[", "]", "res", ",", "ArrayList", "<", "int", "[", "]", ">", "partsx", ",", "ArrayList", "<", "int", "[", "]", ">", "partsy", ",", "int", "gridsize", ")", "{", "for", "(", "int", "x", ...
Intersect the two 1d grid decompositions, to obtain a 2d matrix. @param res Output matrix to fill @param partsx Partitions in first component @param partsy Partitions in second component. @param gridsize Size of partition decomposition
[ "Intersect", "the", "two", "1d", "grid", "decompositions", "to", "obtain", "a", "2d", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L173-L182
63,187
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.intersectionSize
private int intersectionSize(int[] px, int[] py) { int i = 0, j = 0, c = 0; while(i < px.length && j < py.length) { final int vx = px[i], vy = py[j]; if(vx < vy) { ++i; } else if(vx > vy) { ++j; } else { ++c; ++i; ++j; } } ...
java
private int intersectionSize(int[] px, int[] py) { int i = 0, j = 0, c = 0; while(i < px.length && j < py.length) { final int vx = px[i], vy = py[j]; if(vx < vy) { ++i; } else if(vx > vy) { ++j; } else { ++c; ++i; ++j; } } ...
[ "private", "int", "intersectionSize", "(", "int", "[", "]", "px", ",", "int", "[", "]", "py", ")", "{", "int", "i", "=", "0", ",", "j", "=", "0", ",", "c", "=", "0", ";", "while", "(", "i", "<", "px", ".", "length", "&&", "j", "<", "py", ...
Compute the intersection of two sorted integer lists. @param px First list @param py Second list @return Intersection size.
[ "Compute", "the", "intersection", "of", "two", "sorted", "integer", "lists", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L191-L208
63,188
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java
MCEDependenceMeasure.getMCEntropy
private double getMCEntropy(int[][] mat, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int size, int gridsize, double loggrid) { // Margin entropies: double[] mx = new double[gridsize]; double[] my = new double[gridsize]; for(int i = 0; i < gridsize; i++) { // Note: indexes are a bit tricky h...
java
private double getMCEntropy(int[][] mat, ArrayList<int[]> partsx, ArrayList<int[]> partsy, int size, int gridsize, double loggrid) { // Margin entropies: double[] mx = new double[gridsize]; double[] my = new double[gridsize]; for(int i = 0; i < gridsize; i++) { // Note: indexes are a bit tricky h...
[ "private", "double", "getMCEntropy", "(", "int", "[", "]", "[", "]", "mat", ",", "ArrayList", "<", "int", "[", "]", ">", "partsx", ",", "ArrayList", "<", "int", "[", "]", ">", "partsy", ",", "int", "size", ",", "int", "gridsize", ",", "double", "lo...
Compute the MCE entropy value. @param mat Partition size matrix @param partsx Partitions on X @param partsy Partitions on Y @param size Data set size @param gridsize Size of grids @param loggrid Logarithm of grid sizes, for normalization @return MCE score.
[ "Compute", "the", "MCE", "entropy", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/MCEDependenceMeasure.java#L221-L253
63,189
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.add
public void add(E e) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } // final int pos = size; this.size += 1; heapifyUp(size - 1, e); heapModified(); }
java
public void add(E e) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } // final int pos = size; this.size += 1; heapifyUp(size - 1, e); heapModified(); }
[ "public", "void", "add", "(", "E", "e", ")", "{", "// resize when needed", "if", "(", "size", "+", "1", ">", "queue", ".", "length", ")", "{", "resize", "(", "size", "+", "1", ")", ";", "}", "// final int pos = size;", "this", ".", "size", "+=", "1",...
Add an element to the heap. @param e Element to add
[ "Add", "an", "element", "to", "the", "heap", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L113-L122
63,190
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.replaceTopElement
@SuppressWarnings("unchecked") public E replaceTopElement(E e) { E oldroot = (E) queue[0]; heapifyDown(0, e); heapModified(); return oldroot; }
java
@SuppressWarnings("unchecked") public E replaceTopElement(E e) { E oldroot = (E) queue[0]; heapifyDown(0, e); heapModified(); return oldroot; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "E", "replaceTopElement", "(", "E", "e", ")", "{", "E", "oldroot", "=", "(", "E", ")", "queue", "[", "0", "]", ";", "heapifyDown", "(", "0", ",", "e", ")", ";", "heapModified", "(", ")", ...
Combined operation that removes the top element, and inserts a new element instead. @param e New element to insert @return Previous top element of the heap
[ "Combined", "operation", "that", "removes", "the", "top", "element", "and", "inserts", "a", "new", "element", "instead", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L131-L137
63,191
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.removeAt
@SuppressWarnings("unchecked") protected E removeAt(int pos) { if(pos < 0 || pos >= size) { return null; } final E ret = (E) queue[pos]; // Replacement object: final Object reinsert = queue[size - 1]; queue[size - 1] = null; size--; heapifyDown(pos, reinsert); heapModified();...
java
@SuppressWarnings("unchecked") protected E removeAt(int pos) { if(pos < 0 || pos >= size) { return null; } final E ret = (E) queue[pos]; // Replacement object: final Object reinsert = queue[size - 1]; queue[size - 1] = null; size--; heapifyDown(pos, reinsert); heapModified();...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "E", "removeAt", "(", "int", "pos", ")", "{", "if", "(", "pos", "<", "0", "||", "pos", ">=", "size", ")", "{", "return", "null", ";", "}", "final", "E", "ret", "=", "(", "E", ")", "...
Remove the element at the given position. @param pos Element position. @return Element that was at this position.
[ "Remove", "the", "element", "at", "the", "given", "position", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L164-L177
63,192
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.resize
protected final void resize(int requiredSize) { // Double until 64, then increase by 50% each time. int newCapacity = ((queue.length < 64) ? ((queue.length + 1) << 1) : ((queue.length >> 1) + queue.length)); // overflow? if(newCapacity < 0) { throw new OutOfMemoryError(); } if(requiredSize...
java
protected final void resize(int requiredSize) { // Double until 64, then increase by 50% each time. int newCapacity = ((queue.length < 64) ? ((queue.length + 1) << 1) : ((queue.length >> 1) + queue.length)); // overflow? if(newCapacity < 0) { throw new OutOfMemoryError(); } if(requiredSize...
[ "protected", "final", "void", "resize", "(", "int", "requiredSize", ")", "{", "// Double until 64, then increase by 50% each time.", "int", "newCapacity", "=", "(", "(", "queue", ".", "length", "<", "64", ")", "?", "(", "(", "queue", ".", "length", "+", "1", ...
Test whether we need to resize to have the requested capacity. @param requiredSize required capacity
[ "Test", "whether", "we", "need", "to", "resize", "to", "have", "the", "requested", "capacity", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L262-L273
63,193
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.clear
public void clear() { // clean up references in the array for memory management for(int i = 0; i < size; i++) { queue[i] = null; } this.size = 0; heapModified(); }
java
public void clear() { // clean up references in the array for memory management for(int i = 0; i < size; i++) { queue[i] = null; } this.size = 0; heapModified(); }
[ "public", "void", "clear", "(", ")", "{", "// clean up references in the array for memory management", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "queue", "[", "i", "]", "=", "null", ";", "}", "this", ".", "size"...
Clear the heap.
[ "Clear", "the", "heap", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L278-L285
63,194
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java
Heap.checkHeap
protected String checkHeap() { for(int i = 1; i < size; i++) { final int parent = (i - 1) >>> 1; if(comparator.compare(queue[parent], queue[i]) > 0) { return "@" + parent + ": " + queue[parent] + " < @" + i + ": " + queue[i]; } } return null; }
java
protected String checkHeap() { for(int i = 1; i < size; i++) { final int parent = (i - 1) >>> 1; if(comparator.compare(queue[parent], queue[i]) > 0) { return "@" + parent + ": " + queue[parent] + " < @" + i + ": " + queue[i]; } } return null; }
[ "protected", "String", "checkHeap", "(", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "size", ";", "i", "++", ")", "{", "final", "int", "parent", "=", "(", "i", "-", "1", ")", ">>>", "1", ";", "if", "(", "comparator", ".", "comp...
Test whether the heap is still valid. Debug method. @return {@code null} when the heap is correct
[ "Test", "whether", "the", "heap", "is", "still", "valid", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/Heap.java#L310-L318
63,195
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/KDDTask.java
KDDTask.run
public void run() { // Input step Database db = inputStep.getDatabase(); hier = db.getHierarchy(); // Algorithms - Data Mining Step algorithmStep.runAlgorithms(db); // TODO: this could be nicer hier.add(db, new SettingsResult(settings)); // Evaluation evaluationStep.runEvaluators(...
java
public void run() { // Input step Database db = inputStep.getDatabase(); hier = db.getHierarchy(); // Algorithms - Data Mining Step algorithmStep.runAlgorithms(db); // TODO: this could be nicer hier.add(db, new SettingsResult(settings)); // Evaluation evaluationStep.runEvaluators(...
[ "public", "void", "run", "(", ")", "{", "// Input step", "Database", "db", "=", "inputStep", ".", "getDatabase", "(", ")", ";", "hier", "=", "db", ".", "getHierarchy", "(", ")", ";", "// Algorithms - Data Mining Step", "algorithmStep", ".", "runAlgorithms", "(...
Method to run the specified algorithm using the specified database connection.
[ "Method", "to", "run", "the", "specified", "algorithm", "using", "the", "specified", "database", "connection", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/KDDTask.java#L103-L119
63,196
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/ModifiableHyperBoundingBox.java
ModifiableHyperBoundingBox.set
public void set(SpatialComparable obj) { final int dim = min.length; assert (obj.getDimensionality() == dim); if(obj instanceof ModifiableHyperBoundingBox) { ModifiableHyperBoundingBox ho = (ModifiableHyperBoundingBox) obj; System.arraycopy(ho.getMinRef(), 0, min, 0, dim); System.arraycopy...
java
public void set(SpatialComparable obj) { final int dim = min.length; assert (obj.getDimensionality() == dim); if(obj instanceof ModifiableHyperBoundingBox) { ModifiableHyperBoundingBox ho = (ModifiableHyperBoundingBox) obj; System.arraycopy(ho.getMinRef(), 0, min, 0, dim); System.arraycopy...
[ "public", "void", "set", "(", "SpatialComparable", "obj", ")", "{", "final", "int", "dim", "=", "min", ".", "length", ";", "assert", "(", "obj", ".", "getDimensionality", "(", ")", "==", "dim", ")", ";", "if", "(", "obj", "instanceof", "ModifiableHyperBo...
Set the bounding box to the same as some other spatial object. @param obj Spatial object to set to.
[ "Set", "the", "bounding", "box", "to", "the", "same", "as", "some", "other", "spatial", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/ModifiableHyperBoundingBox.java#L134-L147
63,197
elki-project/elki
elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/ModifiableHyperBoundingBox.java
ModifiableHyperBoundingBox.extend
public boolean extend(SpatialComparable obj) { final int dim = min.length; assert (obj.getDimensionality() == dim); boolean extended = false; for(int i = 0; i < dim; i++) { final double omin = obj.getMin(i); final double omax = obj.getMax(i); if(omin < min[i]) { min[i] = omin; ...
java
public boolean extend(SpatialComparable obj) { final int dim = min.length; assert (obj.getDimensionality() == dim); boolean extended = false; for(int i = 0; i < dim; i++) { final double omin = obj.getMin(i); final double omax = obj.getMax(i); if(omin < min[i]) { min[i] = omin; ...
[ "public", "boolean", "extend", "(", "SpatialComparable", "obj", ")", "{", "final", "int", "dim", "=", "min", ".", "length", ";", "assert", "(", "obj", ".", "getDimensionality", "(", ")", "==", "dim", ")", ";", "boolean", "extended", "=", "false", ";", ...
Extend the bounding box by some other spatial object. @param obj Spatial object to extend with @return true when the MBR changed.
[ "Extend", "the", "bounding", "box", "by", "some", "other", "spatial", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-api/src/main/java/de/lmu/ifi/dbs/elki/data/ModifiableHyperBoundingBox.java#L155-L172
63,198
elki-project/elki
elki-classification/src/main/java/de/lmu/ifi/dbs/elki/evaluation/classification/holdout/AbstractHoldout.java
AbstractHoldout.findClassLabelColumn
public static int findClassLabelColumn(MultipleObjectsBundle bundle) { for(int i = 0, l = bundle.metaLength(); i < l; ++i) { if(TypeUtil.CLASSLABEL.isAssignableFromType(bundle.meta(i))) { return i; } } return -1; }
java
public static int findClassLabelColumn(MultipleObjectsBundle bundle) { for(int i = 0, l = bundle.metaLength(); i < l; ++i) { if(TypeUtil.CLASSLABEL.isAssignableFromType(bundle.meta(i))) { return i; } } return -1; }
[ "public", "static", "int", "findClassLabelColumn", "(", "MultipleObjectsBundle", "bundle", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "bundle", ".", "metaLength", "(", ")", ";", "i", "<", "l", ";", "++", "i", ")", "{", "if", "(", "T...
Find the class label column in the given data set. @param bundle Bundle @return Class label column
[ "Find", "the", "class", "label", "column", "in", "the", "given", "data", "set", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-classification/src/main/java/de/lmu/ifi/dbs/elki/evaluation/classification/holdout/AbstractHoldout.java#L72-L79
63,199
elki-project/elki
elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/HierarchicalClassLabel.java
HierarchicalClassLabel.compareTo
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public int compareTo(ClassLabel o) { HierarchicalClassLabel h = (HierarchicalClassLabel) o; for (int i = 0; i < this.levelwiseNames.length && i < h.levelwiseNames.length; i++) { int comp = 0; try { Comparable first = this.levelwise...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) @Override public int compareTo(ClassLabel o) { HierarchicalClassLabel h = (HierarchicalClassLabel) o; for (int i = 0; i < this.levelwiseNames.length && i < h.levelwiseNames.length; i++) { int comp = 0; try { Comparable first = this.levelwise...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "@", "Override", "public", "int", "compareTo", "(", "ClassLabel", "o", ")", "{", "HierarchicalClassLabel", "h", "=", "(", "HierarchicalClassLabel", ")", "o", ";", "for", "(", ...
Compares two HierarchicalClassLabels. Names at higher levels are compared first. Names at a lower level are compared only if their parent-names are equal. Names at a level are tried to be compared as integer values. If this does not succeed, both names are compared as Strings. {@inheritDoc}
[ "Compares", "two", "HierarchicalClassLabels", ".", "Names", "at", "higher", "levels", "are", "compared", "first", ".", "Names", "at", "a", "lower", "level", "are", "compared", "only", "if", "their", "parent", "-", "names", "are", "equal", ".", "Names", "at",...
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/HierarchicalClassLabel.java#L116-L136