id
stringlengths
24
24
repo
stringlengths
7
59
path
stringlengths
11
234
func_name
stringlengths
3
140
url
stringlengths
102
339
split
stringclasses
3 values
language
stringclasses
1 value
docstring
stringlengths
1
34k
code
stringlengths
63
466k
text
stringlengths
101
467k
token_count
int32
22
125k
doc_chars
int32
1
34k
code_chars
int32
63
466k
license_basis
stringclasses
1 value
source
stringclasses
1 value
added
stringdate
2026-12-05 00:00:00
2026-12-05 00:00:00
record_sha256
stringlengths
64
64
license
stringclasses
18 values
license_class
stringclasses
4 values
license_source
stringlengths
45
101
99691ef2fd3bf4cb1c2a5ee7
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/DseSessionManager.java
DseSessionManager.getSession
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/DseSessionManager.java#L235-L239
test
java
Obtain a DSE session instance. @param hostsAndPorts @param username @param password @param authorizationId DSE allows a user to connect as another user or role, provide the name of the user/role you want to connect as via this parameter @param keyspace @param forceNew force create new session instance (the existing on...
public DseSession getSession(String hostsAndPorts, String username, String password, String authorizationId, String keyspace, boolean forceNew) { return getSession(SessionIdentifier.getInstance(hostsAndPorts, username, password, authorizationId, keyspace), forceNew); }
Obtain a DSE session instance. @param hostsAndPorts @param username @param password @param authorizationId DSE allows a user to connect as another user or role, provide the name of the user/role you want to connect as via this parameter @param keyspace @param forceNew force create new session instance (the existing on...
158
459
309
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5dd3286a133196b3addf74506939088e67857ece6628d00426b5d9e244380b5b
MIT
permissive
https://github.com/DDTH/ddth-cql-utils/blob/master/LICENSE.txt
ed2bfe9045442cc4503ef03b
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/DseSessionManager.java
DseSessionManager.getSession
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/DseSessionManager.java#L252-L255
test
java
{@inheritDoc}
public DseSession getSession(boolean forceNew) { return getSession(getDefaultHostsAndPorts(), getDefaultUsername(), getDefaultPassword(), defaultAuthorizationId, getDefaultKeyspace(), forceNew); }
{@inheritDoc} public DseSession getSession(boolean forceNew) { return getSession(getDefaultHostsAndPorts(), getDefaultUsername(), getDefaultPassword(), defaultAuthorizationId, getDefaultKeyspace(), forceNew); }
43
13
224
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
23db4e3764a5144aabfec5c8afdd914b36094f2621c9aee69fa786ac7ec52b01
MIT
permissive
https://github.com/DDTH/ddth-cql-utils/blob/master/LICENSE.txt
bbe385abd5cbb3f3709477f4
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.addConnectionListener
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L572-L579
test
java
Adds a connection listener to this connection that will be notified when the connection closes or fails. @param connectionListener a connection listener.
public void addConnectionListener(ConnectionListener connectionListener) { if (connectionListener == null) { return; } if (!connectionListeners.contains(connectionListener)) { connectionListeners.add(connectionListener); } }
Adds a connection listener to this connection that will be notified when the connection closes or fails. @param connectionListener a connection listener. public void addConnectionListener(ConnectionListener connectionListener) { if (connectionListener == null) { return; } if (!conn...
73
154
284
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2e2dda777a44bfa52875633379c43745ec2fffe92ac3777119e4c213117e99c4
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
4afe81665d4c7f7b4c564930
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.createPacketCollector
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L610-L615
test
java
Creates a new packet collector for this connection. A packet filter determines which packets will be accumulated by the collector. A PacketCollector is more suitable to use than a {@link PacketListener} when you need to wait for a specific result. @param packetFilter the packet filter to use. @return a new packet coll...
public PacketCollector createPacketCollector(PacketFilter packetFilter) { PacketCollector collector = new PacketCollector(this, packetFilter); // Add the collector to the list of active collectors. collectors.add(collector); return collector; }
Creates a new packet collector for this connection. A packet filter determines which packets will be accumulated by the collector. A PacketCollector is more suitable to use than a {@link PacketListener} when you need to wait for a specific result. @param packetFilter the packet filter to use. @return a new packet coll...
116
326
280
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2992dac0992e5c9c0ba5acff310eeb00f59e9b04ec5841eb871aae945666ce46
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
b70ba2c4ab765a4873190453
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.addPacketListener
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L652-L660
test
java
Registers a packet listener with this connection. A packet listener will be invoked only when an incoming packet is received. A packet filter determines which packets will be delivered to the listener. If the same packet listener is added again with a different filter, only the new filter will be used. <p> NOTE: If yo...
public void addPacketListener(PacketListener packetListener, PacketFilter packetFilter) { if (packetListener == null) { throw new NullPointerException("Packet listener is null."); } ListenerWrapper wrapper = new ListenerWrapper(packetListener, packetFilter...
Registers a packet listener with this connection. A packet listener will be invoked only when an incoming packet is received. A packet filter determines which packets will be delivered to the listener. If the same packet listener is added again with a different filter, only the new filter will be used. <p> NOTE: If yo...
180
563
380
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
afefe8fd79ca15be56f84e86c8921d8698536aed9fe22dc4770ecfd3f094ec7b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ee14c6569e6ff219dc8212f7
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.addPacketSendingListener
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L695-L703
test
java
Registers a packet listener with this connection. The listener will be notified of every packet that this connection sends. A packet filter determines which packets will be delivered to the listener. Note that the thread that writes packets will be used to invoke the listeners. Therefore, each packet listener should co...
public void addPacketSendingListener(PacketListener packetListener, PacketFilter packetFilter) { if (packetListener == null) { throw new NullPointerException("Packet listener is null."); } ListenerWrapper wrapper = new ListenerWrapper(packetListener, packe...
Registers a packet listener with this connection. The listener will be notified of every packet that this connection sends. A packet filter determines which packets will be delivered to the listener. Note that the thread that writes packets will be used to invoke the listeners. Therefore, each packet listener should co...
162
507
387
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
244d949fb193458480159c632f9a3973c6cc7faf0d2de59813126531181ca63b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
a7af3de93b45a39f0545fe1b
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.firePacketSendingListeners
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L730-L735
test
java
Process all packet listeners for sending packets. @param packet the packet to process.
protected void firePacketSendingListeners(Packet packet) { // Notify the listeners of the new sent packet for (ListenerWrapper listenerWrapper : sendListeners.values()) { listenerWrapper.notifyListener(packet); } }
Process all packet listeners for sending packets. @param packet the packet to process. protected void firePacketSendingListeners(Packet packet) { // Notify the listeners of the new sent packet for (ListenerWrapper listenerWrapper : sendListeners.values()) { listenerWrapper.notifyListener(p...
61
87
254
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
61d86f27f4c43ad27aedb41c9b0d3e4ee7cfe2dc5274522d7fb56b322c818b9c
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
82f2d97f0b7450e67a4e3446
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.addPacketInterceptor
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L752-L759
test
java
Registers a packet interceptor with this connection. The interceptor will be invoked every time a packet is about to be sent by this connection. Interceptors may modify the packet to be sent. A packet filter determines which packets will be delivered to the interceptor. <p> NOTE: For a similar functionality on incomin...
public void addPacketInterceptor(PacketInterceptor packetInterceptor, PacketFilter packetFilter) { if (packetInterceptor == null) { throw new NullPointerException("Packet interceptor is null."); } interceptors.put(packetInterceptor, new InterceptorWrapper( ...
Registers a packet interceptor with this connection. The interceptor will be invoked every time a packet is about to be sent by this connection. Interceptors may modify the packet to be sent. A packet filter determines which packets will be delivered to the interceptor. <p> NOTE: For a similar functionality on incomin...
163
526
361
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c948ef83d3e1dfb89730741d8e1e6bc8d487107ac5314630e8a8362eaf14f52d
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
3022c3857be89cdf1ade07f7
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.firePacketInterceptors
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L791-L797
test
java
Process interceptors. Interceptors may modify the packet that is about to be sent. Since the thread that requested to send the packet will invoke all interceptors, it is important that interceptors perform their work as soon as possible so that the thread does not remain blocked for a long period. @param packet the pa...
protected void firePacketInterceptors(Packet packet) { if (packet != null) { for (InterceptorWrapper interceptorWrapper : interceptors.values()) { interceptorWrapper.notifyListener(packet); } } }
Process interceptors. Interceptors may modify the packet that is about to be sent. Since the thread that requested to send the packet will invoke all interceptors, it is important that interceptors perform their work as soon as possible so that the thread does not remain blocked for a long period. @param packet the pa...
121
363
255
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0e1b77e7807a1ca3e4fcbdbcbe8fd3f941e5ff39f3cf64fa5c55118a26c00b9e
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ad8c463354d66a22420e6916
abmargb/jamppa
src/main/java/org/jivesoftware/smack/Connection.java
Connection.initDebugger
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/Connection.java#L809-L870
test
java
Initialize the {@link #debugger}. You can specify a customized {@link SmackDebugger} by setup the system property <code>smack.debuggerClass</code> to the implementation. @throws IllegalStateException if the reader or writer isn't yet initialized. @throws IllegalArgumentException if the SmackDebugger can't be loaded.
protected void initDebugger() { if (reader == null || writer == null) { throw new NullPointerException( "Reader or writer isn't initialized."); } // If debugging is enabled, we open a window and write out all network // traffic. if (config.isDebugg...
Initialize the {@link #debugger}. You can specify a customized {@link SmackDebugger} by setup the system property <code>smack.debuggerClass</code> to the implementation. @throws IllegalStateException if the reader or writer isn't yet initialized. @throws IllegalArgumentException if the SmackDebugger can't be loaded. ...
515
318
2,822
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
67cc0d702a94b7e5628f514724fb5769b1f39dbb4107b6f4a82a29cfcb5f6892
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
c748490f4af2c65d364d392a
abmargb/jamppa
src/main/java/org/jivesoftware/whack/ExternalComponent.java
ExternalComponent.connect
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/ExternalComponent.java#L156-L285
test
java
Generates a connection with the server and tries to authenticate. If an error occurs in any of the steps then a ComponentException is thrown. @param host the host to connect with. @param port the port to use. @param subdomain the subdomain that this component will be handling. @throws ComponentException if an error ha...
public void connect(String host, int port, String subdomain) throws ComponentException { try { // Open a socket to the server this.socket = new Socket(); socket.connect(new InetSocketAddress(host, port), manager.getConnectTimeout()); ...
Generates a connection with the server and tries to authenticate. If an error occurs in any of the steps then a ComponentException is thrown. @param host the host to connect with. @param port the port to use. @param subdomain the subdomain that this component will be handling. @throws ComponentException if an error ha...
941
373
5,374
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
29a2f87a83d4eb879ff5958f88086569cb71343c8ed6d665770f79dacc731e2a
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
b5d4d7ccec6f826984909ef5
abmargb/jamppa
src/main/java/org/jivesoftware/whack/ExternalComponent.java
ExternalComponent.connectionLost
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/ExternalComponent.java#L429-L473
test
java
Notification message that the connection with the server was lost unexpectedly. We will try to reestablish the connection for ever until the connection has been reestablished or this thread has been stopped.
public void connectionLost() { // Ensure that only one thread will try to reconnect. synchronized (this) { if (reconnecting) { return; } reconnecting = true; } readerThread = null; boolean isConnected = false; if (!shutd...
Notification message that the connection with the server was lost unexpectedly. We will try to reestablish the connection for ever until the connection has been reestablished or this thread has been stopped. public void connectionLost() { // Ensure that only one thread will try to reconnect. synchroniz...
329
207
1,661
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
138c3fca4744fcd545f404229421281437d21c1fa2a0622b30799818eceb1614
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
d0e331855c0ab708ce12953b
abmargb/jamppa
src/main/java/org/jivesoftware/whack/ExternalComponent.java
ExternalComponent.addIQResultListener
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/ExternalComponent.java#L495-L502
test
java
Adds an {@link IQResultListener} that will be invoked when an IQ result is sent to the server itself and is of type result or error. This is a nice way for the server to send IQ packets to other XMPP entities and be waked up when a response is received back. <p> Once an IQ result was received, the listener will be inv...
void addIQResultListener(String id, IQResultListener listener, long timeoutmillis) { // be generated by the server and simulate like the client sent it. This // will let listeners // react and be removed from the collection resultListeners.put(id, listener); resultTim...
Adds an {@link IQResultListener} that will be invoked when an IQ result is sent to the server itself and is of type result or error. This is a nice way for the server to send IQ packets to other XMPP entities and be waked up when a response is received back. <p> Once an IQ result was received, the listener will be inv...
221
632
383
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0c8e1f5120169285a9497d4d9b3f0f1007fdb32022f9429c0f552cc9a5c618ad
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
4078a30ce9605ee81bea82c6
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.rollback
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L312-L353
test
java
Rolls back the changes to the map.
public void rollback() { if (auto_commit) return; String id = getCurrentThreadId(); ArrayList<Entry<K,V>> list = new ArrayList<Entry<K,V>>(allEntrySet()); for (Iterator<Entry<K,V>> i = list.iterator(); i.hasNext(); ) { final Node<K,V> node = (N...
Rolls back the changes to the map. public void rollback() { if (auto_commit) return; String id = getCurrentThreadId(); ArrayList<Entry<K,V>> list = new ArrayList<Entry<K,V>>(allEntrySet()); for (Iterator<Entry<K,V>> i = list.iterator(); i.hasNext(); ) { ...
289
34
1,666
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1c540a81463e3d7b9046ce722816261fa27eeb5d3eb25710b5443b3db808a94a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
145c8ca8000a6e17e1edca0a
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getCurrentThreadId
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L407-L415
test
java
Retrieve the current thread id for use by the transaction code. @return the thread id of the current thread
protected String getCurrentThreadId() { String attach_id = (String)ThreadSession.getValue(getThreadSessionKey()); if (attach_id != null) return attach_id; Thread thread = Thread.currentThread(); return thread.toString() + "(" + thread.hashCode() + ")"; }
Retrieve the current thread id for use by the transaction code. @return the thread id of the current thread protected String getCurrentThreadId() { String attach_id = (String)ThreadSession.getValue(getThreadSessionKey()); if (attach_id != null) return attach_id; Thread thre...
80
108
312
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
66a54c971a4ce3fc635b2a02143c8e3be000651f7ea11ff219f5a0a66682413b
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
93f0c30a5525f1bd95bfb8c3
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.validNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L424-L430
test
java
Checks that this node is valid for the current thread @param node the node to be checked @return true if node is valid, otherwise false
private boolean validNode(final Node<K,V> node, final String thread_id) { if (auto_commit || node == null) return (node != null); return !((node.is(Node.DELETED, thread_id)) || (node.is(Node.ADDED, null) && node.is(Node.NO_CHANGE, thread_id))); }
Checks that this node is valid for the current thread @param node the node to be checked @return true if node is valid, otherwise false private boolean validNode(final Node<K,V> node, final String thread_id) { if (auto_commit || node == null) return (node != null); return !((node.is(...
99
137
304
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
43246d251aa80e0ea8808158efb9be240dfeec5f0a3b5e0b0caea63863dff655
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
8ce9f0e988512b61c66e3b9d
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getKeyForValue
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L445-L448
test
java
Returns the key to which this map maps the specified value. Returns null if the map contains no mapping for this value. @param value value whose associated key is to be returned. @return the key to which this map maps the specified value, or null if the map contains no mapping for this value. @throws ClassCastExcept...
public K getKeyForValue(final Object value) throws ClassCastException, NullPointerException { return (K)doGet(value, VALUE); }
Returns the key to which this map maps the specified value. Returns null if the map contains no mapping for this value. @param value value whose associated key is to be returned. @return the key to which this map maps the specified value, or null if the map contains no mapping for this value. @throws ClassCastExcept...
116
428
153
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8f4d38f81ee8a97e994d15b99cdfe56d3a324364c4d8b91fb42ae2f445e2c100
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
791ad1e543bd42fb2b7c1ea0
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.entrySetByValueDescending
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L579-L648
test
java
Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The...
public FilterableSet<Entry<K,V>> entrySetByValueDescending() { return new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { return new TransactionalBidiTreeMapDescendingIterator<Entry<K,V>>(VALUE) { @...
Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The...
556
849
2,264
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
15ca10709733a62303468cc87066bde8e5baff56169f0bb2324845ea2dddda82
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
c184048fd6e9af05e2143fd8
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.keySetByValue
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L668-L713
test
java
Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corr...
public FilterableSet<K> keySetByValue() { if (setOfKeysByValue == null) { setOfKeysByValue = new AbstractFilterableSet<K>() { @Override public Iterator<K> iterator() { return new TransactionalBidiTreeMapIterator<K>(VALUE) { ...
Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corr...
390
779
1,320
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2484584305e1163b812bc90fbbac9c0f6b03f73e587399ffaddfc0f2c3bae2cc
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
7239e3f36c4c9b3bd6f50657
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.valuesByValue
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L733-L793
test
java
Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress, the results of the iteration are undefined. The collection supports ele...
public FilterableCollection<V> valuesByValue() { if (collectionOfValuesByValue == null) { collectionOfValuesByValue = new AbstractFilterableCollection<V>() { @Override public Iterator<V> iterator() { return new TransactionalBidiTreeMapIt...
Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress, the results of the iteration are undefined. The collection supports ele...
440
834
1,809
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
55a252c3b64d858033f26d2fae7b3615da819efe71c1c23d4bec0a56064c3005
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
ce3f4672c55dd2757481039c
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.doRemove
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L885-L910
test
java
common remove logic (remove by key or remove by value) @param o the key, or value, that we're looking for @param index KEY or VALUE @return the key, if remove by value, or the value, if remove by key. null if the specified key or value could not be found @throws ConcurrentModificationException if the node has been r...
private Object doRemove(final Object o, final int index) throws ConcurrentModificationException { checkNonNullComparable(o, index); String thread_id = getCurrentThreadId(); Node<K,V> node = lookupValid(o, index, thread_id); Object rval = null; ...
common remove logic (remove by key or remove by value) @param o the key, or value, that we're looking for @param index KEY or VALUE @return the key, if remove by value, or the value, if remove by key. null if the specified key or value could not be found @throws ConcurrentModificationException if the node has been r...
237
344
817
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6dd5a3f4e22edfee6cc3189e95672abef18ce017a5b488671443aa54d69848ce
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
7d59a6aa201b5bbaaa33c22b
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.doGet
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L922-L931
test
java
common get logic, used to get by key or get by value @param o the key or value that we're looking for @param index KEY or VALUE @return the key (if the value was mapped) or the value (if the key was mapped); null if we couldn't find the specified object
private Object doGet(final Object o, final int index) { checkNonNullComparable(o, index); Node<K,V> node = lookupValid(o, index, getCurrentThreadId()); return (node==null) ? null : node.getData(oppositeIndex(index)); }
common get logic, used to get by key or get by value @param o the key or value that we're looking for @param index KEY or VALUE @return the key (if the value was mapped) or the value (if the key was mapped); null if we couldn't find the specified object private Object doGet(final Object o, final int index) { ...
122
255
290
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
441707bf7259bcec7684b58712a6cca63f749de4d8eb79f9815dee5d98880b14
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
3cf3363615fc9b04353adc4b
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.lookupValid
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L957-L959
test
java
do the actual lookup of a piece of valid data @param data the key or value to be looked up @param index KEY or VALUE @return the desired Node, or null if there is no mapping of the specified data
private Node<K,V> lookupValid(final Object data, final int index, final String thread_id) { return nextEqualValid(getFloorEqualNode(lookup(data, index), index), index, thread_id); }
do the actual lookup of a piece of valid data @param data the key or value to be looked up @param index KEY or VALUE @return the desired Node, or null if there is no mapping of the specified data private Node<K,V> lookupValid(final Object data, final int index, final String thread_id) { return nextEqualVali...
91
197
195
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
723f2fc0b3260e4506044ebc7fe3b4b403e0c24f97dd8ce9c94cc8b4bb06f458
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
1d3a04cd75e9e0aea61c6b82
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.lookup
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L970-L990
test
java
do the actual lookup of a piece of data @param data the key or value to be looked up @param index KEY or VALUE @return the desired Node, or null if there is no mapping of the specified data
private Node<K,V> lookup(final Object data, final int index) { Node<K,V> rval = null; Node<K,V> node = rootNode[index]; while (node != null) { int cmp = compare(Node.NO_CHANGE, data, node.getStatus(), node.getData(index), index); if (cmp == 0) { ...
do the actual lookup of a piece of data @param data the key or value to be looked up @param index KEY or VALUE @return the desired Node, or null if there is no mapping of the specified data private Node<K,V> lookup(final Object data, final int index) { Node<K,V> rval = null; Node<K,V> node = root...
159
191
567
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c429540d5a3a40c3cb8f92c2f5112cab9238152743594d524b8ab0f623600ffd
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
26abc6951d4bc7ed677d139f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.compare
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1001-L1010
test
java
Compare two objects @param o1 the first object @param o2 the second object @return negative value if o1 < o2; 0 if o1 == o2; positive value if o1 > o2
private int compare(final int o1_status, final Object o1, final int o2_status, final Object o2, final int index) { if (comparators[index]==null) { if (o1 instanceof TransactionalComparable) return ((TransactionalComparable)o1).compareTo(o1_status, o2, o2_status); else...
Compare two objects @param o1 the first object @param o2 the second object @return negative value if o1 < o2; 0 if o1 == o2; positive value if o1 > o2 private int compare(final int o1_status, final Object o1, final int o2_status, final Object o2, final int index) { if (comparators[index]==null) { ...
153
152
468
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e7129305a2a5a2d8d0821adb66b09506911b130babf4aa9ee904e1c9991c3b9e
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
48772b153dd52879494855bf
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.leastNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1022-L1033
test
java
find the least node from a given node. very useful for starting a sorting iterator ... @param node the node from which we will start searching @param index KEY or VALUE @return the smallest node, from the specified node, in the specified mapping
private Node<K,V> leastNode(final Node<K,V> node, final int index) { Node<K,V> lval = node; if (lval != null) { while (lval.getLeft(index) != null) { lval = lval.getLeft(index); } } return lval; }
find the least node from a given node. very useful for starting a sorting iterator ... @param node the node from which we will start searching @param index KEY or VALUE @return the smallest node, from the specified node, in the specified mapping private Node<K,V> leastNode(final Node<K,V> node, final int index) { ...
121
247
286
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4fae9168070f62b9753295c5679bc6a129d25001da86d82969d700be707f5374
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
5fec5c3addb7a7b93c2c6f1d
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.mostNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1044-L1055
test
java
find the most node from a given node. @param node the node from which we will start searching @param index KEY or VALUE @return the largest node, from the specified node, in the specified mapping
private Node<K,V> mostNode(final Node<K,V> node, final int index) { Node<K,V> rval = node; if (rval != null) { while (rval.getRight(index) != null) { rval = rval.getRight(index); } } return rval; }
find the most node from a given node. @param node the node from which we will start searching @param index KEY or VALUE @return the largest node, from the specified node, in the specified mapping private Node<K,V> mostNode(final Node<K,V> node, final int index) { Node<K,V> rval = node; if (rval...
108
197
287
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d3b822f0f5e7e5580419b6aaf15073f1aeb3b9648156dbdfd63aedfdca6d5be2
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
ade2535a598e096e6895f996
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.nextGreater
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1065-L1096
test
java
get the next larger node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node
private Node<K,V> nextGreater(final Node<K,V> node, final int index) { Node<K,V> rval; if (node == null) { rval = null; } else if (node.getRight(index) != null) { // everything to the node's right is larger. The least of // the right node's descend...
get the next larger node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node private Node<K,V> nextGreater(final Node<K,V> node, final int index) { Node<K,V> rval; if (node == null) { rval = null; } else if ...
277
144
1,192
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
491a43dd15a1c27f5ea5a659d69ceddab76055fb8631017f9b7c723a9e73f33d
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
d4ed2fcf36fc999c93a03c3c
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.nextSmaller
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1106-L1137
test
java
get the next smaller (previous) node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node
private Node<K,V> nextSmaller(final Node<K,V> node, final int index) { Node<K,V> lval; if (node == null) { lval = null; } else if (node.getLeft(index) != null) { // everything to the node's left is smaller. The most of // the right node's descendan...
get the next smaller (previous) node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node private Node<K,V> nextSmaller(final Node<K,V> node, final int index) { Node<K,V> lval; if (node == null) { lval = null; ...
286
156
1,192
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1317ee17212d5b73aa403a78ba104449a7f313a5baca3c9ed1156eb220244cbd
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
e84006a9cd6b3821c5be59a4
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.mostValidNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1147-L1154
test
java
get the most valid node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node
private Node<K,V> mostValidNode(final Node<K,V> node, final int index, final String thread_id) { Node<K,V> rval = node; while (rval != null && !validNode(rval, thread_id)) { rval = nextGreater(rval, index); } return rval; }
get the most valid node from the specified node @param node the node to be searched from @param index KEY or VALUE @return the specified node private Node<K,V> mostValidNode(final Node<K,V> node, final int index, final String thread_id) { Node<K,V> rval = node; while (rval != null && !validNode(r...
100
143
279
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
53d287dceb413a49b0f2dea2893852a8021c8cff439e676cf22be47c98e1b5b9
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
132dde1a944747d427e972cf
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.leastValidNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1166-L1173
test
java
find the least valid node from a given node. very useful for starting a sorting iterator ... @param node the node from which we will start searching @param index KEY or VALUE @return the smallest valid node, from the specified node, in the specified mapping
private Node<K,V> leastValidNode(final Node<K,V> node, final int index, final String thread_id) { Node<K,V> lval = node; while (lval != null && !validNode(lval, thread_id)) { lval = nextSmaller(lval, index); } return lval; }
find the least valid node from a given node. very useful for starting a sorting iterator ... @param node the node from which we will start searching @param index KEY or VALUE @return the smallest valid node, from the specified node, in the specified mapping private Node<K,V> leastValidNode(final Node<K,V> node, fina...
127
259
280
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4c0c241d0a5817a87065f5079231a90a9ff260f528fa8ef5825aa2e977c295d9
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
d6ed4c72603ce2d033779f3f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.copyColor
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1203-L1215
test
java
copy the color from one node to another, dealing with the fact that one or both nodes may, in fact, be null @param from the node whose color we're copying; may be null @param to the node whose color we're changing; may be null @param index KEY or VALUE
private static <K,V> void copyColor(final Node<K,V> from, final Node<K,V> to, final int index) { if (to != null) { if (from == null) { // by default, make it black to.setBlack(index); } else { to...
copy the color from one node to another, dealing with the fact that one or both nodes may, in fact, be null @param from the node whose color we're copying; may be null @param to the node whose color we're changing; may be null @param index KEY or VALUE private static <K,V> void copyColor(final Node<K,V> from, final N...
139
253
377
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5abf0c444705f95a4c9a6d17cfe90565e11815aafbee276563732e7bee8b1de7
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
bd2672a5da2c95806161fe1e
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.isRed
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1224-L1229
test
java
is the specified node red? if the node does not exist, no, it's black, thank you @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> boolean isRed(final Node<K,V> node, final int index) { return ((node == null) ? false : node.isRed(index)); }
is the specified node red? if the node does not exist, no, it's black, thank you @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> boolean isRed(final Node<K,V> node, final int index) { return ((node == null) ? false : node.isRed...
82
154
180
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3db52ded2706efe596c77cb8d418820c361fc2772a3ac90302ac551c67619f7d
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
23ffa313c6ade3beeb599892
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.isBlack
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1238-L1243
test
java
is the specified black red? if the node does not exist, sure, it's black, thank you @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> boolean isBlack(final Node<K,V> node, final int index) { return ((node == null) ? true : node.isBlack(index)); }
is the specified black red? if the node does not exist, sure, it's black, thank you @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> boolean isBlack(final Node<K,V> node, final int index) { return ((node == null) ? true : node.i...
81
157
183
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
624470287a2c5918970bc23fedd9b0254186d5473cbaba145dcdd51f0aa33b6f
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
8f1853970e3241ffadd7579f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.makeRed
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1251-L1256
test
java
force a node (if it exists) red @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> void makeRed(final Node<K,V> node, final int index) { if (node != null) { node.setRed(index); } }
force a node (if it exists) red @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> void makeRed(final Node<K,V> node, final int index) { if (node != null) { node.setRed(index); } }
67
105
156
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c4c711ea4e58a21c2cf6e05780a9809742cbdc2dfbe2b6cb6768135abffd2063
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
fee96acc9b0c6b2a3e351a59
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.makeBlack
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1264-L1269
test
java
force a node (if it exists) black @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> void makeBlack(final Node<K,V> node, final int index) { if (node != null) { node.setBlack(index); } }
force a node (if it exists) black @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> void makeBlack(final Node<K,V> node, final int index) { if (node != null) { node.setBlack(index); } }
67
107
160
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
edcba41617168611bc53cdd7268b7096ee5bb95ef979e337a4b8e8e70df9e82d
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
5b1d1e675680e28856f7d872
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getGrandParent
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1278-L1280
test
java
get a node's grandparent. mind you, the node, its parent, or its grandparent may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> Node<K,V> getGrandParent(final Node<K,V> node, final int index) { return getParent(getParent(node, index), index); }
get a node's grandparent. mind you, the node, its parent, or its grandparent may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> Node<K,V> getGrandParent(final Node<K,V> node, final int index) { return getParent(getParent(node, index), index...
84
176
151
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fa4de2d6ee834f30664759b2ea29ea46a13b98297a139344606c4b3dea2d52ca
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
98e9eb27377feb523653e259
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getParent
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1289-L1294
test
java
get a node's parent. mind you, the node, or its parent, may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> Node<K,V> getParent(final Node<K,V> node, final int index) { return ((node == null) ? null : node.getParent(index)); }
get a node's parent. mind you, the node, or its parent, may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> Node<K,V> getParent(final Node<K,V> node, final int index) { return ((node == null) ? null : node...
84
155
189
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3202d719c88e2d8e3f29821635f004c7e0310fe5dadfdafcd8af34949dec545a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
900cf775eb3669c7e196cab8
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getRightChild
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1303-L1308
test
java
get a node's right child. mind you, the node may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> Node<K,V> getRightChild(final Node<K,V> node, final int index) { return (node == null) ? null : node.getRight(index); }
get a node's right child. mind you, the node may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> Node<K,V> getRightChild(final Node<K,V> node, final int index) { return (node == null) ? null : node.getRight(...
82
144
188
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
635ab0be8b8f48e88962c4753c84b99454fe679b75def7878344f919dd1630be
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
2a32cf4765b333715358b129
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getLeftChild
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1317-L1322
test
java
get a node's left child. mind you, the node may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE
private static <K,V> Node<K,V> getLeftChild(final Node<K,V> node, final int index) { return (node == null) ? null : node.getLeft(index); }
get a node's left child. mind you, the node may not exist. no problem @param node the node (may be null) in question @param index KEY or VALUE private static <K,V> Node<K,V> getLeftChild(final Node<K,V> node, final int index) { return (node == null) ? null : node.getLeft(ind...
82
143
186
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cdb5a1365bc8d1bd72bb1791a796f1cb91a299c2d0612407774fb7abe93ebd06
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
0e1595b635ac84814d890120
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.isLeftChild
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1335-L1342
test
java
is this node its parent's left child? mind you, the node, or its parent, may not exist. no problem. if the node doesn't exist ... it's its non-existent parent's left child. If the node does exist but has no parent ... no, we're not the non-existent parent's left child. Otherwise (both the specified node AND its parent ...
private static <K,V> boolean isLeftChild(final Node<K,V> node, final int index) { return (node == null) ? true : ((node.getParent(index) == null) ? false : (node == node.getParent(index).getLeft(index))); }
is this node its parent's left child? mind you, the node, or its parent, may not exist. no problem. if the node doesn't exist ... it's its non-existent parent's left child. If the node does exist but has no parent ... no, we're not the non-existent parent's left child. Otherwise (both the specified node AND its parent ...
164
408
292
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
64e773c420938656ab3709fa7ada50403532ba733b30df57e4acaef560d50930
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
94d35e30e2b1b3ef9e30d798
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.isRightChild
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1355-L1362
test
java
is this node its parent's right child? mind you, the node, or its parent, may not exist. no problem. if the node doesn't exist ... it's its non-existent parent's right child. If the node does exist but has no parent ... no, we're not the non-existent parent's right child. Otherwise (both the specified node AND its pare...
private static <K,V> boolean isRightChild(final Node<K,V> node, final int index) { return (node == null) ? true : ((node.getParent(index) == null) ? false : (node == node.getParent(index).getRight(index))); }
is this node its parent's right child? mind you, the node, or its parent, may not exist. no problem. if the node doesn't exist ... it's its non-existent parent's right child. If the node does exist but has no parent ... no, we're not the non-existent parent's right child. Otherwise (both the specified node AND its pare...
164
411
294
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e907c2604f97ba089b6f43749b708a1d4a79eb0571036120a8be9b0057529616
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
2591ed1445ea869f12a0f25f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.rotateLeft
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1370-L1394
test
java
do a rotate left. standard fare in the world of balanced trees @param node the node to be rotated @param index KEY or VALUE
private void rotateLeft(final Node<K,V> node, final int index) { Node<K,V> rightChild = node.getRight(index); node.setRight(rightChild.getLeft(index), index); if (rightChild.getLeft(index) != null) { rightChild.getLeft(index).setParent(node, index); } ri...
do a rotate left. standard fare in the world of balanced trees @param node the node to be rotated @param index KEY or VALUE private void rotateLeft(final Node<K,V> node, final int index) { Node<K,V> rightChild = node.getRight(index); node.setRight(rightChild.getLeft(index), index); if...
203
124
851
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
649290a488d4d2237360a952ce0fe7cfde409559f88eeec40851aa3e64b401f0
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
635215af6a99252aa146117e
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.rotateRight
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1402-L1426
test
java
do a rotate right. standard fare in the world of balanced trees @param node the node to be rotated @param index KEY or VALUE
private void rotateRight(final Node<K,V> node, final int index) { Node<K,V> leftChild = node.getLeft(index); node.setLeft(leftChild.getRight(index), index); if (leftChild.getRight(index) != null) { leftChild.getRight(index).setParent(node, index); } left...
do a rotate right. standard fare in the world of balanced trees @param node the node to be rotated @param index KEY or VALUE private void rotateRight(final Node<K,V> node, final int index) { Node<K,V> leftChild = node.getLeft(index); node.setLeft(leftChild.getRight(index), index); if ...
203
125
844
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1c87956d820ae23da6b418a3c490008789486c98fa6da4da72267c692bf2d988
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
c60a1699b56137c99263a022
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.doRedBlackInsert
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1435-L1498
test
java
complicated red-black insert stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more @param insertedNode the node to be inserted @param index KEY or VALUE
private void doRedBlackInsert(final Node<K,V> insertedNode, final int index) { Node<K,V> currentNode = insertedNode; makeRed(currentNode, index); while ((currentNode != null) && (currentNode != rootNode[index]) && (isRed(currentNode.getParent(index), index))) { ...
complicated red-black insert stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more @param insertedNode the node to be inserted @param index KEY or VALUE private void doRedBlackInsert(final Node<K,V> insertedNode, final int index) { Node<K,V> currentNode = insertedNode; ...
485
186
2,607
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
43b843807c36ab2eaa1c6dff6518379395c7fcc96f5b0625dcf27fee2c1423b3
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
0f56f289d60cd8b0c5ce5b84
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.doRedBlackDelete
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1506-L1572
test
java
complicated red-black delete stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more @param deletedNode the node to be deleted
private void doRedBlackDelete(final Node<K,V> deletedNode) { for (int index = FIRST_INDEX; index < NUMBER_OF_INDICES; index++) { // if deleted node has both left and children, swap with // the next greater node if ((deletedNode.getLeft(index) != null) ...
complicated red-black delete stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more @param deletedNode the node to be deleted private void doRedBlackDelete(final Node<K,V> deletedNode) { for (int index = FIRST_INDEX; index < NUMBER_OF_INDICES; index++) { // if...
458
158
2,648
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3546732a1544e27739e279fa0695621b36840eae8ec9c39cf90b74435112431f
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
f2260ae1c6bec9508a0f81a0
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.doRedBlackDeleteFixup
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1583-L1664
test
java
complicated red-black delete stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more. This rebalances the tree (somewhat, as red-black trees are not perfectly balanced -- perfect balancing takes longer) @param replacementNode the node being replaced @param index KEY or VALUE
private void doRedBlackDeleteFixup(final Node<K,V> replacementNode, final int index) { Node<K,V> currentNode = replacementNode; while ((currentNode != rootNode[index]) && (isBlack(currentNode, index))) { if (isLeftChild(currentN...
complicated red-black delete stuff. Based on Sun's TreeMap implementation, though it's barely recognizable any more. This rebalances the tree (somewhat, as red-black trees are not perfectly balanced -- perfect balancing takes longer) @param replacementNode the node being replaced @param index KEY or VALUE private voi...
681
307
3,605
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c15048e8f92f7924b0238f1e46e8b652ef60f1aa155c4d44ad90655058df927a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
1d5b32eda4ad5283ea483957
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.swapPosition
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1675-L1767
test
java
swap two nodes (except for their content), taking care of special cases where one is the other's parent ... hey, it happens. @param x one node @param y another node @param index KEY or VALUE
private void swapPosition(final Node<K,V> x, final Node<K,V> y, final int index) { // Save initial values. Node<K,V> xFormerParent = x.getParent(index); Node<K,V> xFormerLeftChild = x.getLeft(index); Node<K,V> xFormerRightChild = x.getRight(index); Node<K,V> ...
swap two nodes (except for their content), taking care of special cases where one is the other's parent ... hey, it happens. @param x one node @param y another node @param index KEY or VALUE private void swapPosition(final Node<K,V> x, final Node<K,V> y, final int index) { // Save initial values. ...
728
191
3,104
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bceadbf5affa12a10ddb736be1a8ed2795e0f22f94ea015f60ced5fd6c082e2c
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
64a92351fb782cfcdd733ff8
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.checkNonNullComparable
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1781-L1793
test
java
check if an object is fit to be proper input ... has to be Comparable if the comparator has not been set and non-null @param o the object being checked @param index KEY or VALUE (used to put the right word in the exception message) @throws NullPointerException if o is null @throws ClassCastException if o is not Compa...
private void checkNonNullComparable(final Object o, final int index) { if (o == null) { throw new NullPointerException(dataName[index] + " cannot be null"); } if (comparators[index] ==...
check if an object is fit to be proper input ... has to be Comparable if the comparator has not been set and non-null @param o the object being checked @param index KEY or VALUE (used to put the right word in the exception message) @throws NullPointerException if o is null @throws ClassCastException if o is not Compa...
157
372
502
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ab7374d518a7112f4a978caec58c19e7763d5e64cde9f2ae2af738f65d70c793
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
2e6880f75c976668b61c448b
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.insertValue
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1871-L1927
test
java
insert a node by its value @param newNode the node to be inserted @throws IllegalArgumentException if the node already exists in the value mapping
private void insertValue(final Node<K,V> newNode, final String thread_id) throws IllegalArgumentException { Node<K,V> node = rootNode[VALUE]; while (true) { int cmp = compare(Node.ADDED, newNode.getData(VALUE), node.getStatus(), node.getData(VALUE), VALUE); ...
insert a node by its value @param newNode the node to be inserted @throws IllegalArgumentException if the node already exists in the value mapping private void insertValue(final Node<K,V> newNode, final String thread_id) throws IllegalArgumentException { Node<K,V> node = rootNode[VALUE]; ...
408
148
2,220
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
21c98215cd4fdb49b92dea864722afc788f62e884cf378762b841b0959cf95a2
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
046998a6df45e2cde89460dd
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.containsKey
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1977-L1984
test
java
Returns true if this map contains a mapping for the specified key. @param key key whose presence in this map is to be tested. @return true if this map contains a mapping for the specified key. @throws ClassCastException if the key is of an inappropriate type for this map. @throws NullPointerException if the key is n...
@Override public boolean containsKey(final Object key) throws ClassCastException, NullPointerException { checkKey(key); return lookupValid(key, KEY, getCurrentThreadId()) != null; }
Returns true if this map contains a mapping for the specified key. @param key key whose presence in this map is to be tested. @return true if this map contains a mapping for the specified key. @throws ClassCastException if the key is of an inappropriate type for this map. @throws NullPointerException if the key is n...
106
323
226
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8837a062804c1ed3d4e675758f895e18f7c679b542627a9fb9bcad30b7a2b943
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
c5325aca2a6298762bb69c1f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.containsValue
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1995-L2001
test
java
Returns true if this map maps one or more keys to the specified value. @param value value whose presence in this map is to be tested. @return true if this map maps one or more keys to the specified value.
@Override public boolean containsValue(final Object value) { checkValue(value); return lookupValid(value, VALUE, getCurrentThreadId()) != null; }
Returns true if this map maps one or more keys to the specified value. @param value value whose presence in this map is to be tested. @return true if this map maps one or more keys to the specified value. @Override public boolean containsValue(final Object value) { checkValue(value); retur...
78
206
177
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cb164fdee2fae4225452ca94fe7d6c0b9fa64bfed1d34a2e2ed613181dc26224
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
005bc99ab07bfc558c0c70f1
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.get
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2016-L2023
test
java
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. @param key key whose associated value is to be returned. @return the value to which this map maps the specified key, or null if the map contains no mapping for this key. @throws ClassCastException if...
@Override public V get(final Object key) throws ClassCastException, NullPointerException { checkKey(key); return (V)doGet(key, KEY); }
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. @param key key whose associated value is to be returned. @return the value to which this map maps the specified key, or null if the map contains no mapping for this key. @throws ClassCastException if...
122
418
179
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e9a3e3809336c9048e8143d874f5b67e9f2402d40d997a79eb314b6629092254
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
8160f65e927e8ea222850174
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.put
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2045-L2138
test
java
Associates the specified value with the specified key in this map. @param key key with which the specified value is to be associated. @param value value to be associated with the specified key. @return null @throws ClassCastException if the class of the specified key or value prevents it from being stored in this ma...
@Override public V put(final K key, final V value) throws ClassCastException, NullPointerException, IllegalArgumentException, ConcurrentModificationException { checkKeyAndValue(key, value); Node<K,V> node = rootNode[KEY]; String thread_id = getCurre...
Associates the specified value with the specified key in this map. @param key key with which the specified value is to be associated. @param value value to be associated with the specified key. @return null @throws ClassCastException if the class of the specified key or value prevents it from being stored in this ma...
687
506
3,531
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
942a99db135a3ac11fd24ad770ce224a6fc7fa6f0557cf2bc25db38c2fa66cc8
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
1afa274186ba710d5a61bfcf
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.remove
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2148-L2155
test
java
Removes the mapping for this key from this map if present @param key key whose mapping is to be removed from the map. @return previous value associated with specified key, or null if there was no mapping for key.
@Override public V remove(final Object key) throws ConcurrentModificationException { checkKey(key); return (V)doRemove(key, KEY); }
Removes the mapping for this key from this map if present @param key key whose mapping is to be removed from the map. @return previous value associated with specified key, or null if there was no mapping for key. @Override public V remove(final Object key) throws ConcurrentModificationException { c...
78
214
165
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b4a7f0ff6fbb548de0907070e8bc87f29c7e2e012060940211e377fa9236315c
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
f74a40f05605d1fb134f4909
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.clear
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2160-L2184
test
java
Removes all mappings from this map
@Override public void clear() { if (auto_commit) { modify(); nodeCount = 0; rootNode[KEY] = null; rootNode[VALUE] = null; } else { String thread_id = getCurrentThreadId(); ArrayList<En...
Removes all mappings from this map @Override public void clear() { if (auto_commit) { modify(); nodeCount = 0; rootNode[KEY] = null; rootNode[VALUE] = null; } else { String thread_id = getCurrentT...
157
34
743
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
97c7704003c91ed4c2c75458ffa6e3612b5e58b85587139bf949fbfcd972d3b4
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
cef84d797bb272b4ea853ff1
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.keySet
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2198-L2244
test
java
Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corr...
@Override public Set<K> keySet() { if (setOfKeysByKey == null) { setOfKeysByKey = new AbstractFilterableSet<K>() { @Override public Iterator<K> iterator() { return new TransactionalBidiTreeMapIterator<K>(KEY) { ...
Returns a set view of the keys contained in this map. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress, the results of the iteration are undefined. The set supports element removal, which removes the corr...
334
538
1,310
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b158695902fae1dac126826533e531d2a04878b47358c20c9e84a9af832d122b
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
2db7cfe75b29e18f81c7c0ac
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.values
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2259-L2320
test
java
Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress, the results of the iteration are undefined. The collection supports ele...
@Override public Collection<V> values() { if (collectionOfValuesByKey == null) { collectionOfValuesByKey = new AbstractFilterableCollection<V>() { @Override public Iterator<V> iterator() { return new TransactionalBidiTreeMapIterator...
Returns a collection view of the values contained in this map. The collection is backed by the map, so changes to the map are reflected in the collection, and vice-versa. If the map is modified while an iteration over the collection is in progress, the results of the iteration are undefined. The collection supports ele...
386
588
1,796
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6cdfc834099346d6ef6d9c7b20263814a90e599940c54556263dff894393b26a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
8182ca4f9feed5f5d60af178
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.allEntrySet
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2425-L2472
test
java
It is very rare that this method would be required. You probably want to use entrySet instead. This method returns all Entry's in this Map no matter what its transactional status. Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so...
public FilterableSet<Entry<K,V>> allEntrySet() { if (setOfAllEntries == null) { setOfAllEntries = new AbstractFilterableSet<Entry<K,V>>() { @Override public Iterator<Entry<K,V>> iterator() { return new TransactionalBidiTreeMapIterator<En...
It is very rare that this method would be required. You probably want to use entrySet instead. This method returns all Entry's in this Map no matter what its transactional status. Returns a set view of the mappings contained in this map. Each element in the returned set is a Map.Entry. The set is backed by the map, so...
445
775
1,666
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
47c1fd1fa0d0045ff62c17434cd4241460ee50214ffe1de4a5d456ce7792ed01
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
e27652d4e30b717dcb8a4fce
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.copyEntries
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2480-L2566
test
java
Copy all entries including transaction statuses from this map into the supplied map. Do not use this method unless you know exactly what you are doing. The auto commit flag of the supplied map may be changed as a result of calling this method, check that this is valid first.
public final void copyEntries(TransactionalBidiTreeMap<K,V> new_map) { K key; V val; int transaction_status; String transaction_id; new_map.setAutoCommit(isAutoCommit()); if (!isAutoCommit()) { // Do committed and deleted first ...
Copy all entries including transaction statuses from this map into the supplied map. Do not use this method unless you know exactly what you are doing. The auto commit flag of the supplied map may be changed as a result of calling this method, check that this is valid first. public final void copyEntries(Transactional...
662
275
3,528
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a77940d1564f81433d07bd8a6d7296c31a3546d16370e7a5e6a4ccdfd2bce8f3
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
5ef67985ff8b2519cb540003
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java
TransactionalBidiTreeMap.getCeilNode
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L2657-L2686
test
java
Gets the entry corresponding to the specified key; if no such entry exists, returns the entry for the least key greater than the specified key; if no such entry exists (i.e., the greatest key in the Tree is less than the specified key), returns <tt>null</tt>.
private Node<K,V> getCeilNode(Object lookup, int type) { Node<K,V> p = TransactionalBidiTreeMap.this.rootNode[type]; Object compareval; if (p==null) return null; while (true) { compareval = type == KEY ? p.getKey() : p.getValue(); int cmp = Tra...
Gets the entry corresponding to the specified key; if no such entry exists, returns the entry for the least key greater than the specified key; if no such entry exists (i.e., the greatest key in the Tree is less than the specified key), returns <tt>null</tt>. private Node<K,V> getCeilNode(Object lookup, int type) { ...
292
259
1,166
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
975e19411dc9d43f68d12755e2ae016e9c1eb4faa95bb297777db4917aad1dbc
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
cc2cb3585564f91a3a9f74f9
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/Cache.java
Cache.remove
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/Cache.java#L183-L198
test
java
/* Remove operation with a flag so we can tell coherence if the remove was caused by cache internal processing such as eviction or loading
public synchronized V remove(Object key, boolean internal) { // noinspection SuspiciousMethodCalls CacheObject<V> cacheObject = map.remove(key); // If the object is not in cache, stop trying to remove it. if (cacheObject == null) { return null; } // Remove fro...
/* Remove operation with a flag so we can tell coherence if the remove was caused by cache internal processing such as eviction or loading public synchronized V remove(Object key, boolean internal) { // noinspection SuspiciousMethodCalls CacheObject<V> cacheObject = map.remove(key); // If the o...
151
138
616
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d497138ab02c37af514d934cb430dc57c98e91e165fc91010bd9da8a10fc59be
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
b95a1776fdd8408f1e67a717
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/Cache.java
Cache.deleteExpiredEntries
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/Cache.java#L381-L417
test
java
Clears all entries out of cache where the entries are older than the maximum defined age.
protected synchronized void deleteExpiredEntries() { // Check if expiration is turned on. if (maxLifetime <= 0) { return; } // Remove all old entries. To do this, we remove objects from the end // of the linked list until they are no longer too old. We get to avoid ...
Clears all entries out of cache where the entries are older than the maximum defined age. protected synchronized void deleteExpiredEntries() { // Check if expiration is turned on. if (maxLifetime <= 0) { return; } // Remove all old entries. To do this, we remove objects fro...
313
89
1,431
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f192c4d8777aacd717eb2f37b216d8cd8c335f73d3b9d542e704a3a535d82acd
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
434950c75d3e302f5ee63870
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/Cache.java
Cache.cullCache
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/Cache.java#L424-L449
test
java
Removes the least recently used elements if the cache size is greater than or equal to the maximum allowed size until the cache is at least 10% empty.
protected synchronized void cullCache() { // Check if a max cache size is defined. if (maxCacheSize < 0) { return; } // See if the cache is too big. If so, clean out cache until it's 10% // free. if (map.size() > maxCacheSize) { // First, delete a...
Removes the least recently used elements if the cache size is greater than or equal to the maximum allowed size until the cache is at least 10% empty. protected synchronized void cullCache() { // Check if a max cache size is defined. if (maxCacheSize < 0) { return; } // See...
267
150
1,124
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f8b81698bb3049fb9c6637c0a45da662b02277b3acd5fb80faf53a9ff7ec9974
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
53acbef9a40938a5eb363563
abmargb/jamppa
src/main/java/org/jivesoftware/smack/DefaultRosterStore.java
DefaultRosterStore.init
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/DefaultRosterStore.java#L85-L92
test
java
Creates a new roster store on disk @param baseDir The directory to create the store in. The directory should be empty @return A {@link DefaultRosterStore} instance if successful, <code>null</code> else.
public static DefaultRosterStore init(final File baseDir) { DefaultRosterStore store = new DefaultRosterStore(baseDir); if (store.setRosterVersion("")) { return store; } else { return null; } }
Creates a new roster store on disk @param baseDir The directory to create the store in. The directory should be empty @return A {@link DefaultRosterStore} instance if successful, <code>null</code> else. public static DefaultRosterStore init(final File baseDir) { DefaultRosterStore store = new DefaultRosterSto...
102
203
253
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a1ca85819b42debfe792014c3c81531dd8a017f2d54c53ec25959f8bf911e3be
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
7ed034c430f162cc0e042230
abmargb/jamppa
src/main/java/org/jivesoftware/smack/DefaultRosterStore.java
DefaultRosterStore.open
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/DefaultRosterStore.java#L102-L110
test
java
Opens a roster store @param baseDir The directory containing the roster store. @return A {@link DefaultRosterStore} instance if successful, <code>null</code> else.
public static DefaultRosterStore open(final File baseDir) { DefaultRosterStore store = new DefaultRosterStore(baseDir); String s = store.readFile(store.getVersionFile()); if (s != null && s.startsWith(STORE_ID + "\n")) { return store; } else { return null; ...
Opens a roster store @param baseDir The directory containing the roster store. @return A {@link DefaultRosterStore} instance if successful, <code>null</code> else. public static DefaultRosterStore open(final File baseDir) { DefaultRosterStore store = new DefaultRosterStore(baseDir); String s = store.r...
108
164
328
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
52801fc264f4a9ae37f5520751d9e2f0915ad78db641672d6a8777801103fb24
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
69b60a3f825716449fda6621
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/HashMap2Template.java
HashMap2Template.getOrCreate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/HashMap2Template.java#L23-L33
test
java
Method to get existing [key1,key2] value or create new one if it's absent. Needs implementation of create(key1,key2) in order to work
public V getOrCreate(K1 key1, K2 key2) { // already got it? if (containsKey(key1,key2)) return get(key1,key2); // if not, create and add it V result = create(key1,key2); put(key1,key2,result); return result; }
Method to get existing [key1,key2] value or create new one if it's absent. Needs implementation of create(key1,key2) in order to work public V getOrCreate(K1 key1, K2 key2) { // already got it? if (containsKey(key1,key2)) return get(key1,key2); // if not, create a...
109
133
296
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b813fba6f4beb8e7a8dd1f29d57a3b1d7bac1b1a900e63bdd99157db6f9a15ed
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
c689978a5016d4ffddb2e180
firepick1/firerest-client
src/main/java/org/firepick/IPv4Scanner.java
IPv4Scanner.localhostNetworkAddresses
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L29-L59
test
java
Return list of InetAddress for localhost that are not loopback addresses (e.g., 127.0.0.1) @return address list with size() >= 1
public static List<InetAddress> localhostNetworkAddresses() throws UnknownHostException, SocketException { List<InetAddress> result = new ArrayList<InetAddress>(); InetAddress localhost = null; try { // localhost = InetAddress.getLocalHost(); throw new UnknownHostException(); } catch(...
Return list of InetAddress for localhost that are not loopback addresses (e.g., 127.0.0.1) @return address list with size() >= 1 public static List<InetAddress> localhostNetworkAddresses() throws UnknownHostException, SocketException { List<InetAddress> result = new ArrayList<InetAddress>(); InetAddre...
247
129
988
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d6bbaf9652609cf5fe467b584a396e8faf88bf82219926cdaf6cc6c93acc4f66
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
38256d90057b538d6f389c92
firepick1/firerest-client
src/main/java/org/firepick/IPv4Scanner.java
IPv4Scanner.scanRange
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L68-L89
test
java
Scan a range of InetAddresses starting with the given address @param start starting address of search; null implies subnetAddress0(null,24) @param count number of addresses in range @param msTimeout maximum time to wait for each host
public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) { Collection<InetAddress> addresses = new ArrayList<InetAddress>(); Collection<InetAddress> result = new ArrayList<InetAddress>(); if (addr == null) { try { addresses.addAll(localhostNetworkAddresses()); ...
Scan a range of InetAddresses starting with the given address @param start starting address of search; null implies subnetAddress0(null,24) @param count number of addresses in range @param msTimeout maximum time to wait for each host public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msT...
204
234
667
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9cb0c23e758da826c9038adb12478f73f78d1e19c077164403a556611687c0b9
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
6bb2ac1c38514f3295ede028
firepick1/firerest-client
src/main/java/org/firepick/IPv4Scanner.java
IPv4Scanner.subnetAddress0
https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L148-L163
test
java
Return first address on subnet containing given address @param addr any machine in subnet @param subnetBits the number of bits in subnet mask. Many small networks use 24. @return first address on subnet. E.g., subnetAddress(10.0.1.88, 25) -> 10.0.1.0
public static InetAddress subnetAddress0(InetAddress addr, int subnetBits) { if (subnetBits < 1 || 32 <= subnetBits) { throw new FireRESTException("Expected subnetBits 1..31"); } long mask = 1; for (int i = 0; i < 32; i++) { mask <<= 1; mask |= i < subnetBits ? 1 : 0; } long ho...
Return first address on subnet containing given address @param addr any machine in subnet @param subnetBits the number of bits in subnet mask. Many small networks use 24. @return first address on subnet. E.g., subnetAddress(10.0.1.88, 25) -> 10.0.1.0 public static InetAddress subnetAddress0(InetAddress addr, int subn...
206
251
485
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bf524819bef53cd95eea819fa7b9fdf6255b19d81a892b9dd22f8ec90daf7d14
MIT
permissive
https://github.com/firepick1/firerest-client/blob/master/LICENSE
7b2b16c73f2337bc39162037
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedSortedBidiMap.java
SynchronizedSortedBidiMap.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedSortedBidiMap.java#L41-L43
test
java
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null
public static <K,V> SortedBidiMap<K,V> decorate(SortedBidiMap<K,V> map) { return new SynchronizedSortedBidiMap<K,V>(map); }
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null public static <K,V> SortedBidiMap<K,V> decorate(SortedBidiMap<K,V> map) { return new SynchronizedSortedBidiMap<K,V>(map); }
70
143
137
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d360d40a18eccf334b8fe44dcdbf83612904d5ed79ba7b14acf243f2c14d3303
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
f6a9fc513d6a34f3e9f9e1ed
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedSortedBidiMap.java
SynchronizedSortedBidiMap.entrySet
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedSortedBidiMap.java#L73-L81
test
java
-----------------------------------------------------------------------
public Set<Map.Entry<K,V>> entrySet() { return SyncUtils.synchronizeRead(lock, new Callback<Set<Map.Entry<K,V>>>() { @Override protected void doAction() { FilterableSet<Map.Entry<K,V>> _set = (FilterableSet<Map.Entry<K,V>>)map.entrySet(); _return(new ...
----------------------------------------------------------------------- public Set<Map.Entry<K,V>> entrySet() { return SyncUtils.synchronizeRead(lock, new Callback<Set<Map.Entry<K,V>>>() { @Override protected void doAction() { FilterableSet<Map.Entry<K,V>> _set = (Fi...
93
71
410
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6395a48a3ac7aae76eec1411cb59fce5e33d0406ced5f00ea197bc00e69822b0
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
5c5ff67fd71607c31225d312
DDTH/ddth-cql-utils
src/main/java/com/github/ddth/cql/utils/RetryFutureCallbackResultSet.java
RetryFutureCallbackResultSet.onFailure
https://github.com/DDTH/ddth-cql-utils/blob/debd5d86f64fe06e43d6f0f58cb2f7f0f6a84489/src/main/java/com/github/ddth/cql/utils/RetryFutureCallbackResultSet.java#L51-L82
test
java
{@inheritDoc}
@Override public void onFailure(Throwable t) { if (t instanceof ExceedMaxAsyncJobsException) { try { if (stm != null) { sessionManager.executeAsync(this, permitTimeoutMs, stm, consistencyLevel); } else if (pstm != null) { if...
{@inheritDoc} @Override public void onFailure(Throwable t) { if (t instanceof ExceedMaxAsyncJobsException) { try { if (stm != null) { sessionManager.executeAsync(this, permitTimeoutMs, stm, consistencyLevel); } else if (pstm != null) { ...
242
13
1,396
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
efdd50a464b26c2a07c36b45a63a5d89f87d4855d5a6a58a73213a9326f33818
MIT
permissive
https://github.com/DDTH/ddth-cql-utils/blob/master/LICENSE.txt
85a4fe1da323ed4a774bd661
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L73-L77
test
java
<p> Reads a Document from the given <code>File</code> </p> @param file is the <code>File</code> to read from. @return the newly created Document instance @throws DocumentException if an error occurs during parsing. @throws java.net.MalformedURLException if a URL could not be made for the given File
public Document read(File file) throws DocumentException, IOException, XmlPullParserException { String systemID = file.getAbsolutePath(); return read(new BufferedReader(new FileReader(file)), systemID); }
<p> Reads a Document from the given <code>File</code> </p> @param file is the <code>File</code> to read from. @return the newly created Document instance @throws DocumentException if an error occurs during parsing. @throws java.net.MalformedURLException if a URL could not be made for the given File public Document re...
113
300
236
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bd8a430ec0d6e2aecfb3f416e1391ef117a2fc6f1e005efb9bcc3690462dfe79
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
e32897ff90c872903fc57644
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L90-L94
test
java
<p> Reads a Document from the given <code>URL</code> </p> @param url <code>URL</code> to read from. @return the newly created Document instance @throws DocumentException if an error occurs during parsing.
public Document read(URL url) throws DocumentException, IOException, XmlPullParserException { String systemID = url.toExternalForm(); return read(createReader(url.openStream()), systemID); }
<p> Reads a Document from the given <code>URL</code> </p> @param url <code>URL</code> to read from. @return the newly created Document instance @throws DocumentException if an error occurs during parsing. public Document read(URL url) throws DocumentException, IOException, XmlPullParserException { ...
93
205
222
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
aa51cd440588134c282803bed37dc0fe6f087559ac8f81944bcc328daad28f9b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
0cfdf4addaf73d735232a3b3
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L117-L126
test
java
<p> Reads a Document from the given URL or filename. </p> <p/> <p/> If the systemID contains a <code>':'</code> character then it is assumed to be a URL otherwise its assumed to be a file name. If you want finer grained control over this mechansim then please explicitly pass in either a {@link URL} or a {@link File} in...
public Document read(String systemID) throws DocumentException, IOException, XmlPullParserException { if (systemID.indexOf(':') >= 0) { // lets assume its a URL return read(new URL(systemID)); } else { // lets assume that we are given a file name ...
<p> Reads a Document from the given URL or filename. </p> <p/> <p/> If the systemID contains a <code>':'</code> character then it is assumed to be a URL otherwise its assumed to be a file name. If you want finer grained control over this mechansim then please explicitly pass in either a {@link URL} or a {@link File} in...
233
644
371
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bc39b3851c377c498352ac25caa280accc3eb097867c7d00e363946b1872a357
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
be31628ea0cdde24056bd7ca
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L155-L159
test
java
<p> Reads a Document from the given <code>Reader</code> </p> @param reader is the reader for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing.
public Document read(Reader reader) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(reader); return parseDocument(); }
<p> Reads a Document from the given <code>Reader</code> </p> @param reader is the reader for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing. public Document read(Reader reader) throws DocumentException, IOException, XmlPullParserException ...
82
208
190
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
33b2757c248597310f52156d2faba0712d976105363e262989956f2f2b176e5e
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
33957487f5dde9b7ad4dcc74
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L172-L176
test
java
<p> Reads a Document from the given array of characters </p> @param text is the text to parse @return the newly created Document instance @throws DocumentException if an error occurs during parsing.
public Document read(char[] text) throws DocumentException, IOException, XmlPullParserException { getXPPParser().setInput(new CharArrayReader(text)); return parseDocument(); }
<p> Reads a Document from the given array of characters </p> @param text is the text to parse @return the newly created Document instance @throws DocumentException if an error occurs during parsing. public Document read(char[] text) throws DocumentException, IOException, XmlPullParserException { g...
82
199
207
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ef5a87759de465e1df9d09f7487af24b9fafb0500e499e3d76013a9dcab1eb30
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
349d7b797c64e24d853481c5
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L191-L194
test
java
<p> Reads a Document from the given stream </p> @param in <code>InputStream</code> to read from. @param systemID is the URI for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing.
public Document read(InputStream in, String systemID) throws DocumentException, IOException, XmlPullParserException { return read(createReader(in), systemID); }
<p> Reads a Document from the given stream </p> @param in <code>InputStream</code> to read from. @param systemID is the URI for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing. public Document read(InputStream in, String systemID) throws Do...
91
243
184
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
02aaac37484b0c7099ab6d720758bb2dd08ae81d2162540d7766e1a0504bc39b
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
30bfb3ff4314c1ffde7ef43e
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.read
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L209-L214
test
java
<p> Reads a Document from the given <code>Reader</code> </p> @param reader is the reader for the input @param systemID is the URI for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing.
public Document read(Reader reader, String systemID) throws DocumentException, IOException, XmlPullParserException { Document document = read(reader); document.setName(systemID); return document; }
<p> Reads a Document from the given <code>Reader</code> </p> @param reader is the reader for the input @param systemID is the URI for the input @return the newly created Document instance @throws DocumentException if an error occurs during parsing. public Document read(Reader reader, String systemID) thro...
100
249
237
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f3dee74ec0cc20d0296ff77ea6a73310f04c53aa076f602e703c3e2e8e59bd85
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
1ef4554a3575a5bbb5441585
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.parseDocument
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L302-L427
test
java
-------------------------------------------------------------------------
public Document parseDocument() throws DocumentException, IOException, XmlPullParserException { DocumentFactory df = getDocumentFactory(); Document document = df.createDocument(); Element parent = null; XmlPullParser pp = getXPPParser(); int count = 0; while (...
------------------------------------------------------------------------- public Document parseDocument() throws DocumentException, IOException, XmlPullParserException { DocumentFactory df = getDocumentFactory(); Document document = df.createDocument(); Element parent = null; ...
895
73
5,202
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b81fe689c31629a67da99fd1e2079e8694ac767086850f27d1fc2aa197b444d3
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
94aa3260e8b9990a4a826d87
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableBidiMap.java
SynchronizedFilterableBidiMap.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableBidiMap.java#L37-L39
test
java
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null
public static <K,V> FilterableBidiMap<K,V> decorate(FilterableBidiMap<K,V> map) { return new SynchronizedFilterableBidiMap<K,V>(map); }
Factory method to create a synchronized map. @param map the map to decorate, must not be null @throws IllegalArgumentException if map is null public static <K,V> FilterableBidiMap<K,V> decorate(FilterableBidiMap<K,V> map) { return new SynchronizedFilterableBidiMap<K,V>(map); }
72
143
149
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c04e977ff71a1fc0032a15fb8b63873be90327db0c257ec49c1d31d9520b1dfd
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
1caa0f0cf1695a308312d8c6
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableBidiMap.java
SynchronizedFilterableBidiMap.filteredMap
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableBidiMap.java#L69-L77
test
java
-----------------------------------------------------------------------
public FilterableMap<K,V> filteredMap(final Filter<? super K> filter) { return SyncUtils.synchronizeRead(lock, new Callback<FilterableMap<K,V>>() { @Override protected void doAction() { FilterableMap<K,V> _map = getFilterableBidiMap().filteredMap(filter); ...
----------------------------------------------------------------------- public FilterableMap<K,V> filteredMap(final Filter<? super K> filter) { return SyncUtils.synchronizeRead(lock, new Callback<FilterableMap<K,V>>() { @Override protected void doAction() { Filterabl...
93
71
416
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
006877df405bdc805231823f0713927c70e87a9bb3f986cdd40ecca10e7bf950
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
97be636f1f2cd2cfce04866d
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/MapBuilder.java
MapBuilder.map
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/MapBuilder.java#L93-L96
test
java
a new map with just [key--&gt;value] maplet
public static<K,V> Map<K,V> map(K key, V value) { return new MapBuilder().put(key,value).toMap(); }
a new map with just [key--&gt;value] maplet public static<K,V> Map<K,V> map(K key, V value) { return new MapBuilder().put(key,value).toMap(); }
49
43
118
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
882b834d2a16af8c5cc49921210afef51466b1f4010d3ac40429ca471d4ecc4c
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
c4a6e6d292206ad8d0093127
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.setJarFilter
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L110-L112
test
java
Sets the jar filter for the executor. This filter can contain any name of a jar file that should be considered during search. If not set, no filter is applied. If the argument is null, no filter is used. Otherwise, all strings in the argument are used as jar files and only those jar files will be used in a search. Usin...
protected final void setJarFilter(String[] filter){ this.jarFilter = (filter==null)?null:Collections.unmodifiableList(Arrays.asList(filter)); }
Sets the jar filter for the executor. This filter can contain any name of a jar file that should be considered during search. If not set, no filter is applied. If the argument is null, no filter is used. Otherwise, all strings in the argument are used as jar files and only those jar files will be used in a search. Usin...
152
561
146
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
be8844ca9b4a41928e1652c34743c439ad7da0f12ad22d0e6f06c51258b8646a
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
24b8530d7df30a8bed7b460f
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.addApplication
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L130-L132
test
java
Adds a new application at runtime, with name (shortcut to start) and related class. @param name a unique name for the application @param clazz the class of the application for instantiation
protected final void addApplication(String name, Class<? extends ExecS_Application> clazz){ this.classmap.put(name, clazz); }
Adds a new application at runtime, with name (shortcut to start) and related class. @param name a unique name for the application @param clazz the class of the application for instantiation protected final void addApplication(String name, Class<? extends ExecS_Application> clazz){ this.classmap.put(name, clazz); }
65
189
128
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
04b87cab0a74f24bc82888a24ba4376c9041602ddc489800f8e2b08cf4e692ca
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
295c9a6f2a8d4706e47a7b18
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.addAllApplications
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L138-L146
test
java
Adds a set of application at runtime, as in all found applications that can be executed @param set a set of applications
protected final void addAllApplications(Set<Class<?>> set){ for(Class<?> cls:set){ if(!cls.isInterface() && !Modifier.isAbstract(cls.getModifiers())){ if(!this.classmap.containsValue(cls)){ this.classNames.add(cls.getName()); } } } }
Adds a set of application at runtime, as in all found applications that can be executed @param set a set of applications protected final void addAllApplications(Set<Class<?>> set){ for(Class<?> cls:set){ if(!cls.isInterface() && !Modifier.isAbstract(cls.getModifiers())){ if(!this.classmap.containsValue(cls)){...
88
120
257
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9788e9a28969ff4d77869aa65c1950bcfb41a6501d50a2096be6872d26df43e8
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
134e0d5a977debe59bfc8b0a
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.execute
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L153-L210
test
java
Main method @param args command line arguments @return 0 on success, -1 on error with message on STDERR
public final int execute(String[] args){ String arguments = StringUtils.join(args, ' '); StrTokenizer tokens = new StrTokenizer(arguments); String arg = tokens.nextToken(); int ret = 0; if(arg==null || "-?".equals(arg) || "-h".equals(arg) || "--help".equals(arg)){ //First help: no arguments or -? or --he...
Main method @param args command line arguments @return 0 on success, -1 on error with message on STDERR public final int execute(String[] args){ String arguments = StringUtils.join(args, ' '); StrTokenizer tokens = new StrTokenizer(arguments); String arg = tokens.nextToken(); int ret = 0; if(arg==null || "...
551
103
2,016
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f6fd93feb68f48cd78b1c4946ed6bb6aaf4c6dd01d18fb2708215d017634e8a0
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
b3072654f903465f74e84f87
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.executeApplication
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L219-L243
test
java
Executes an application. @param svc the application, must not be null @param args original command line arguments @param orig the original name or class for the application for error messages @return 0 on success, other than zero on failure (including failure of the executed application)
protected int executeApplication(Object svc, String[] args, String orig){ if(svc!=null && (svc instanceof ExecS_Application)){ if(svc instanceof Gen_RunScripts){ //hook for GenRunScripts to get current class map - registered applications ((Gen_RunScripts)svc).setClassMap(this.classmap); } if(svc inst...
Executes an application. @param svc the application, must not be null @param args original command line arguments @param orig the original name or class for the application for error messages @return 0 on success, other than zero on failure (including failure of the executed application) protected int executeApplicati...
317
288
1,040
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8a3197f0d90945c6fae819886a7f863a468d967456616f39589908a415303fbd
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
7678cd52efcca6fcfe4cce71
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.printList
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L248-L263
test
java
Prints a list of pre-registered and found applications.
protected final void printList(){ ST list = this.stg.getInstanceOf("list"); list.add("appName", this.appName); if(this.classmap.size()>0){ List<Map<String, String>> l = new ArrayList<>(); for(String key : this.classmap.keySet()){ Map<String, String> m = new HashMap<>(); m.put("key", key); m.put(...
Prints a list of pre-registered and found applications. protected final void printList(){ ST list = this.stg.getInstanceOf("list"); list.add("appName", this.appName); if(this.classmap.size()>0){ List<Map<String, String>> l = new ArrayList<>(); for(String key : this.classmap.keySet()){ Map<String, Strin...
143
55
494
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ec8ace29cebbdaa9160a08f052025f34ebda87f68154f667b944d73af1e73445
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
6f4b7000603fc565fe209322
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.printUsage
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L268-L275
test
java
Prints usage information to standard out.
protected final void printUsage(){ ST usage = this.stg.getInstanceOf("usage"); usage.add("appName", this.appName); usage.add("packageFilter", this.packageFilter); usage.add("jarFilter", this.jarFilter); usage.add("excludedNames", new TreeSet<>(Arrays.asList(new CF().excludedNames))); System.out.println(usag...
Prints usage information to standard out. protected final void printUsage(){ ST usage = this.stg.getInstanceOf("usage"); usage.add("appName", this.appName); usage.add("packageFilter", this.packageFilter); usage.add("jarFilter", this.jarFilter); usage.add("excludedNames", new TreeSet<>(Arrays.asList(new CF()....
88
41
335
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f333bc434b4518635d9c288408ec2f896e5b8f84965552754b8a0ef4dc818071
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
8726832f67da24e17c1f1153
vdmeer/execs
src/main/java/de/vandermeer/execs/ExecS.java
ExecS.main
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/ExecS.java#L290-L294
test
java
Public main to start the application executor. @param args command line arguments
public static void main(String[] args) { ExecS run = new ExecS(); int ret = run.execute(args); System.exit(ret); }
Public main to start the application executor. @param args command line arguments public static void main(String[] args) { ExecS run = new ExecS(); int ret = run.execute(args); System.exit(ret); }
48
81
121
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7c36cc449f27ddb4cbef26615be3a6889405b32343a22017eaa640b024234773
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
e28214fef3a3c1d775929c0a
vdmeer/execs
src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java
Gen_ExecJarScripts.writeFile
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L153-L171
test
java
Writes the given lines to the given file, if possible. @param file file to write to @param lines lines to write to the file @return true if lines where written to the file, false otherwise with errors printed
public boolean writeFile(File file, List<String> lines){ if(file.exists()){ file.delete(); } try { FileWriter out = new FileWriter(file); for(String s : lines){ out.write(s); out.write(System.getProperty("line.separator")); } out.close(); file.setExecutable(true); } catc...
Writes the given lines to the given file, if possible. @param file file to write to @param lines lines to write to the file @return true if lines where written to the file, false otherwise with errors printed public boolean writeFile(File file, List<String> lines){ if(file.exists()){ file.delete(); } try ...
167
208
516
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8b3754263fd530e71d57f22607c4d165cb6e5317c4c6ea2ba49355a0b12ece2f
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
5d8b317684faced9a27a4516
vdmeer/execs
src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java
Gen_ExecJarScripts.inExecJar
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L177-L201
test
java
Tests if the class is run from an executable JAR. @return true if run from an executable JAR (JAR with Main-Class in manifest), false otherwise with errors printed
protected boolean inExecJar(){ Class<Gen_ExecJarScripts> clazz = Gen_ExecJarScripts.class; String className = clazz.getSimpleName() + ".class"; String classPath = clazz.getResource(className).toString(); if (!classPath.startsWith("jar")) { System.err.println(this.getAppName() + ": not started in a jar, ...
Tests if the class is run from an executable JAR. @return true if run from an executable JAR (JAR with Main-Class in manifest), false otherwise with errors printed protected boolean inExecJar(){ Class<Gen_ExecJarScripts> clazz = Gen_ExecJarScripts.class; String className = clazz.getSimpleName() + ".class"; St...
268
163
1,001
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
28817a6e70b7ee3d116e49b8b442f0a70eb9aac77456762d40c1d29aaf9dea5a
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
038cec952bf22de9b17ec4be
vdmeer/execs
src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java
Gen_ExecJarScripts.addOption
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/Gen_ExecJarScripts.java#L207-L212
test
java
Adds a new option to CLI parser and option list. @param option new option, ignored if null
protected void addOption(ApplicationOption<?> option){ if(option!=null){ this.getCli().addOption(option); this.options.add(option); } }
Adds a new option to CLI parser and option list. @param option new option, ignored if null protected void addOption(ApplicationOption<?> option){ if(option!=null){ this.getCli().addOption(option); this.options.add(option); } }
55
90
151
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
dce490fd4a7b6a1943e201a594f35cbab3f2f698d43c870eaa680f630be57100
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
70d65a1b4120bb814dcf66ce
vdmeer/execs
src/main/java/de/vandermeer/execs/cf/CF_Utils.java
CF_Utils.getPkgName
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/cf/CF_Utils.java#L49-L67
test
java
Returns the package name for a jar entry. @param entry jar entry to extract package name from @return empty string on error (entry being null, or no name), package name otherwise
public final static String getPkgName(JarEntry entry){ if(entry==null){ return ""; } String s = entry.getName(); if(s==null){ return ""; } if(s.length()==0){ return s; } if(s.startsWith("/")){ s = s.substring(1, s.length()); } if(s.endsWith("/")){ s = s.substring(0, s.length()-1); }...
Returns the package name for a jar entry. @param entry jar entry to extract package name from @return empty string on error (entry being null, or no name), package name otherwise public final static String getPkgName(JarEntry entry){ if(entry==null){ return ""; } String s = entry.getName(); if(s==null){ ...
145
178
353
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d3b4c8e60d2b692806d0a82865b28dd3c8b00ba182b63890ce38488c8d5a8263
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
a08baba029348b998d35c279
gvlasov/collections-utils
src/main/java/org/tenidwa/collections/utils/ContentMap.java
ContentMap.mapContentToValues
https://github.com/gvlasov/collections-utils/blob/82f20efc8e53ea876896b779e35ed33633ec2e23/src/main/java/org/tenidwa/collections/utils/ContentMap.java#L166-L177
test
java
Maps the content of the base map to its values. @param base Base map @return Map from content of the base map to its values.
private ImmutableMap<C, V> mapContentToValues( final ImmutableMap<K, V> base ) { final ImmutableMap.Builder<C, V> builder = ImmutableMap.builder(); for (final Entry<K, V> entry : base.entrySet()) { builder.put( this.key(entry.getKey()), entry.getVa...
Maps the content of the base map to its values. @param base Base map @return Map from content of the base map to its values. private ImmutableMap<C, V> mapContentToValues( final ImmutableMap<K, V> base ) { final ImmutableMap.Builder<C, V> builder = ImmutableMap.builder(); for (final Entry<K...
108
124
388
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4bf70a800b4ba84d38c158f7bd0d9e4abbbcd77ddbaff151cb39acf2c5bb0cdf
MIT
permissive
https://github.com/gvlasov/collections-utils/blob/master/LICENSE.txt
b79fa2b2ec5e3a8f7d437aa5
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java
IterativeCallback.setState
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java#L69-L74
test
java
Sets the supplied state for this IterativeCallback. @return previous state
public IterativeState<T,R> setState(IterativeState<T,R> new_state) { IterativeState<T,R> old_state = this.state; this.state = new_state; return old_state; }
Sets the supplied state for this IterativeCallback. @return previous state public IterativeState<T,R> setState(IterativeState<T,R> new_state) { IterativeState<T,R> old_state = this.state; this.state = new_state; return old_state; }
61
75
193
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
196f9e0199af947f0aef4570b8fdf8d1eddda01fe4c94cf9a5ac71bc94913334
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
da4955c55ba0afeba24b3038
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java
IterativeCallback.iterate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java#L77-L95
test
java
public wrapper for the iteration
public R iterate(final FilterableCollection<? extends T> c) { initState(); checkUsed(); // If collection is decorated with a syncronized wrapper then synchronize the iteration if (c instanceof SynchronizedFilterableCollection) { return SyncUtils.synchro...
public wrapper for the iteration public R iterate(final FilterableCollection<? extends T> c) { initState(); checkUsed(); // If collection is decorated with a syncronized wrapper then synchronize the iteration if (c instanceof SynchronizedFilterableCollection) { ...
107
32
594
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b3122a6c572f8f6c089ca663782c44151156980d78f87a4fc65aa63eb37e8260
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
889d46c84b1ce9a21098259f
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java
IterativeCallback.doIteration
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/IterativeCallback.java#L112-L135
test
java
do the actual iteration
private R doIteration(Iterator<? extends T> it) { // save the iterator into member variable state.i = it; state.iterations = 0; if (state.do_break == true) return state.return_object; // do the iteration calling nextobject on each while...
do the actual iteration private R doIteration(Iterator<? extends T> it) { // save the iterator into member variable state.i = it; state.iterations = 0; if (state.do_break == true) return state.return_object; // do the iteration calling nextobje...
132
23
659
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
eaf6df8bdd26749e8bb5bc2aa833185eaed66976871fc6789b143403ca85b0da
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE