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
f851ae5ea5b282d3dd363f96
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/bytecode/BaseByteArrayCodeMachine.java
BaseByteArrayCodeMachine.getCodeBuffer
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/bytecode/BaseByteArrayCodeMachine.java#L64-L70
test
java
{@inheritDoc}
public ByteBuffer getCodeBuffer(CallPoint callPoint) { ByteBuffer buffer = ByteBuffer.wrap(code, callPoint.entryPoint, callPoint.length); buffer.order(ByteOrder.LITTLE_ENDIAN); return buffer; }
{@inheritDoc} public ByteBuffer getCodeBuffer(CallPoint callPoint) { ByteBuffer buffer = ByteBuffer.wrap(code, callPoint.entryPoint, callPoint.length); buffer.order(ByteOrder.LITTLE_ENDIAN); return buffer; }
46
13
226
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0c732e279002717f135093220482b4ba13822ddaf7fd223eee0d6020aa1250ef
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
4dac536bcad3a76909785b30
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/Call.java
Call.compileBodyArguments
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/Call.java#L49-L54
test
java
{@inheritDoc}
public SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor expression, boolean isFirstBody, FunctorName clauseName, int bodyNumber) { // Build the argument to call in the usual way. return defaultBuiltIn.compileBodyArguments(expression, isFirstBody, clauseName, bodyNumber); }
{@inheritDoc} public SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor expression, boolean isFirstBody, FunctorName clauseName, int bodyNumber) { // Build the argument to call in the usual way. return defaultBuiltIn.compileBodyArguments(expression, isFirstBody, clauseName, bod...
68
13
320
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6c89f320ecca702801b4155b39d2268f218b6afecd0ee8e22a42a972cfef2d1d
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
bcbbdb182e2b91332068d903
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/Call.java
Call.compileBodyCall
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/Call.java#L57-L85
test
java
{@inheritDoc}
public SizeableLinkedList<WAMInstruction> compileBodyCall(Functor expression, boolean isFirstBody, boolean isLastBody, boolean chainRule, int permVarsRemaining) { // Used to build up the results in. SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMInstruction>(); ...
{@inheritDoc} public SizeableLinkedList<WAMInstruction> compileBodyCall(Functor expression, boolean isFirstBody, boolean isLastBody, boolean chainRule, int permVarsRemaining) { // Used to build up the results in. SizeableLinkedList<WAMInstruction> instructions = new SizeableLinkedList<WAMIn...
270
13
1,301
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
89511a6c5b9dfd44cefc336744ed9b50aeb88f917a7d12c08ca12eda9debc489
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
6c51534789ebf76b5f714ef1
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/BeanMemento.java
BeanMemento.restoreValues
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L86-L186
test
java
Restores the properties currently in this memento to the specified object. @param ob The object to which the values from this memento should be restored. @param values The map of values to restore. @throws NoSuchFieldException If a setter method could not be found for a property.
public static void restoreValues(Object ob, Map<String, Object> values) throws NoSuchFieldException { /*log.fine("public void restore(Object ob): called");*/ /*log.fine("Object to restore to has the type: " + ob.getClass());*/ // Get the class of th object to restore to. Class obCla...
Restores the properties currently in this memento to the specified object. @param ob The object to which the values from this memento should be restored. @param values The map of values to restore. @throws NoSuchFieldException If a setter method could not be found for a property. public static void restoreValu...
922
288
4,539
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
dbfa8b7a66787c03757881380d56bffe6c3def3cee7b46d35ef96d3b9d079c15
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
c3003b7d91f66da5148b7990
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/BeanMemento.java
BeanMemento.get
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L225-L235
test
java
Gets the value of the named property of the specified class. @param cls The class in which the property to get is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritence chain can be overriden. @param property The name of the proper...
public Object get(Class cls, String property) throws NoSuchFieldException { // Check that the field exists. if (!values.containsKey(property)) { throw new NoSuchFieldException("The property, " + property + ", does not exist on the underlying class."); } // Try to...
Gets the value of the named property of the specified class. @param cls The class in which the property to get is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritence chain can be overriden. @param property The name of the proper...
174
444
412
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8ba0e0590b46068052928e7fd9d2cbc61014347ababc774ecf64ed036f8aa7eb
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
9a28879003a016e06bdc81d6
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/BeanMemento.java
BeanMemento.put
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L245-L253
test
java
Sets the value of the named property as a multi type object. @param cls The class in which the property is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritance chain can be overriden. @param property The name of the property to set...
public void put(Class cls, String property, TypeConverter.MultiTypeData value) { /*log.fine("public void put(String property, TypeConverter.MultiTypeData value): called");*/ /*log.fine("property = " + property);*/ /*log.fine("value = " + value);*/ // Store the multi typed data unde...
Sets the value of the named property as a multi type object. @param cls The class in which the property is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritance chain can be overriden. @param property The name of the property to set...
168
383
393
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cd01f829e9baeb1d1577ace0820962b2131185d6402ed66f6fb302c6f72ce759
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
585ad09cc1e3f98e6cdf19ae
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/BeanMemento.java
BeanMemento.put
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L263-L267
test
java
Places the specified value into the memento based on the property's declaring class and name. @param cls The class in which the property is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritance chain can be overriden. @param propert...
public void put(Class cls, String property, Object value) { // Store the new data under the specified property name. values.put(property, value); }
Places the specified value into the memento based on the property's declaring class and name. @param cls The class in which the property is declared. This is ignored as only properties of the top-level bean class are used by this memento. Properties higher up the inheritance chain can be overriden. @param propert...
117
401
171
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6c84de4468f3f458e850484c072efeac88a087ec5434fe09e705990be958e899
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
5fff1aff696bfcf9844e3d16
rupertlssmith/lojix
base/common/src/main/com/thesett/common/reflect/BeanMemento.java
BeanMemento.capture
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/reflect/BeanMemento.java#L288-L337
test
java
Captures the fields of the associated object. @param ignoreNull <tt>true</tt> iff null fields should be ignored, <tt>false</tt> if null fields should be captured as nulls.
private void capture(boolean ignoreNull) { // Get the class of the object to build a memento for. Class cls = ob.getClass(); // Iterate through all the public methods of the class including all super-interfaces and super-classes. Method[] methods = cls.getMethods(); for (Me...
Captures the fields of the associated object. @param ignoreNull <tt>true</tt> iff null fields should be ignored, <tt>false</tt> if null fields should be captured as nulls. private void capture(boolean ignoreNull) { // Get the class of the object to build a memento for. Class cls = ob.getClass(); ...
459
172
2,330
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1ed0f1ec470e91416372deaa5a4c5659acef99a7445fbcf36bc91fed777bb937
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
7c3cf0887b1add44585251c6
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/interpreter/WAMNativeInterpreter.java
WAMNativeInterpreter.main
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/interpreter/WAMNativeInterpreter.java#L59-L88
test
java
Creates the interpreter and launches its top-level run loop. @param args The command line arguments.
public static void main(String[] args) { try { SymbolTableImpl<Integer, String, Object> symbolTable = new SymbolTableImpl<Integer, String, Object>(); WAMResolvingMachine machine = new WAMResolvingNativeMachine(symbolTable); Parser<Clause, Token> parser = new Sen...
Creates the interpreter and launches its top-level run loop. @param args The command line arguments. public static void main(String[] args) { try { SymbolTableImpl<Integer, String, Object> symbolTable = new SymbolTableImpl<Integer, String, Object>(); WAMResolvingMachine ma...
246
101
1,205
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1b5221427e7cd8eafca8c5aef5f031c046a71eac680229a80fa798a4d779a39a
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
89f4adbd834a556ae9fa4b7c
rupertlssmith/lojix
debugger/swing_utils/src/main/com/thesett/aima/logic/fol/wam/debugger/swing/GripComponentMouseMover.java
GripComponentMouseMover.mousePressed
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/swing_utils/src/main/com/thesett/aima/logic/fol/wam/debugger/swing/GripComponentMouseMover.java#L83-L89
test
java
{@inheritDoc} <p/>Changes the cursor to the move variant, and records that the mouse is pressed.
public void mousePressed(MouseEvent e) { gripComponent.setCursor(moveCursor); pressed = true; lastY = e.getYOnScreen(); lastX = e.getXOnScreen(); }
{@inheritDoc} <p/>Changes the cursor to the move variant, and records that the mouse is pressed. public void mousePressed(MouseEvent e) { gripComponent.setCursor(moveCursor); pressed = true; lastY = e.getYOnScreen(); lastX = e.getXOnScreen(); }
62
97
187
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0aec05f3f8fce171891ed6db0b477d35b557f9f4d1f7f89cb316dfd97fe73cb7
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
3c224dc540367f16ac247961
rupertlssmith/lojix
debugger/swing_utils/src/main/com/thesett/aima/logic/fol/wam/debugger/swing/GripComponentMouseMover.java
GripComponentMouseMover.mouseDragged
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/swing_utils/src/main/com/thesett/aima/logic/fol/wam/debugger/swing/GripComponentMouseMover.java#L117-L152
test
java
{@inheritDoc} <p/>Applies mouse dragging as a resizing delta to the re-sizer.
public void mouseDragged(MouseEvent e) { if (pressed) { int deltaY = e.getYOnScreen() - lastY; lastY = e.getYOnScreen(); int deltaX = e.getXOnScreen() - lastX; lastX = e.getXOnScreen(); boolean revalidate = false; if (deltaY ...
{@inheritDoc} <p/>Applies mouse dragging as a resizing delta to the re-sizer. public void mouseDragged(MouseEvent e) { if (pressed) { int deltaY = e.getYOnScreen() - lastY; lastY = e.getYOnScreen(); int deltaX = e.getXOnScreen() - lastX; lastX = e.g...
185
78
908
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
11ce76e30a2b0e9175c8e2dfd0a71951ab9320ce096072a89d25de32723a26a7
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
fd69505905ecb0cf1995c612
markhobson/microbrowser
tck/src/main/java/org/hobsoft/microbrowser/tck/MicrobrowserTck.java
MicrobrowserTck.getRequestsPath
https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/tck/src/main/java/org/hobsoft/microbrowser/tck/MicrobrowserTck.java#L37-L45
test
java
----------------------------------------------------------------------------------------------------------------
@Test public void getRequestsPath() throws InterruptedException { server().enqueue(new MockResponse()); newBrowser().get(url(server(), "/x")); assertThat("request path", server().takeRequest().getPath(), is("/x")); }
---------------------------------------------------------------------------------------------------------------- @Test public void getRequestsPath() throws InterruptedException { server().enqueue(new MockResponse()); newBrowser().get(url(server(), "/x")); assertThat("request path", server().takeRequest()...
56
112
231
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a5ceeb667fe9b6918e54f7e5b895cfe3b21bfb3725c13937004c0af581e86630
Apache-2.0
permissive
https://github.com/markhobson/microbrowser/blob/master/LICENSE
7d1840ada27bdbc72af7ec6b
markhobson/microbrowser
spi/src/main/java/org/hobsoft/microbrowser/spi/AbstractHypermedia.java
AbstractHypermedia.getLink
https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/spi/src/main/java/org/hobsoft/microbrowser/spi/AbstractHypermedia.java#L31-L41
test
java
----------------------------------------------------------------------------------------------------------------
public final Link getLink(String rel) { List<Link> links = getLinks(rel); if (links.isEmpty()) { throw new LinkNotFoundException(rel); } return links.get(0); }
---------------------------------------------------------------------------------------------------------------- public final Link getLink(String rel) { List<Link> links = getLinks(rel); if (links.isEmpty()) { throw new LinkNotFoundException(rel); } return links.get(0); }
53
112
180
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4def8a4fc90fa2a5217a6bcbbfa8354bc9048273edb3efea135fb2e0f2a28323
Apache-2.0
permissive
https://github.com/markhobson/microbrowser/blob/master/LICENSE
2e1f15816ff2e7e2f94e1f8d
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/FifoStack.java
FifoStack.pop
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/FifoStack.java#L82-L95
test
java
Pops the first object placed on the stack off of it and returns it. @return The first object placed on the stack.
public E pop() { E ob; if (size() == 0) { return null; } ob = get(0); remove(0); return ob; }
Pops the first object placed on the stack off of it and returns it. @return The first object placed on the stack. public E pop() { E ob; if (size() == 0) { return null; } ob = get(0); remove(0); return ob; }
70
114
172
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
59042299f7b15cba033addd7cf3933dcfedcf69fcb490ed670a8c0f5623c1f1d
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
e45e283f88d61c5f7ea02e5e
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/Matcher.java
Matcher.nextInSequence
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/Matcher.java#L69-L116
test
java
{@inheritDoc}
public T nextInSequence() { T result = null; // Poll results from the buffer until no more are available, but only once the state machine has flushed // the buffer. if (flushMode) { result = buffer.poll(); if (result != null) { ...
{@inheritDoc} public T nextInSequence() { T result = null; // Poll results from the buffer until no more are available, but only once the state machine has flushed // the buffer. if (flushMode) { result = buffer.poll(); if (result != null) ...
217
13
1,138
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f9589cba2bcc27bff75add0276f4c3bd6c0c95489c8c3f38542e5b8ee2272a61
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
b4a31af57c0edf37fdb90835
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java
SimpleMonitor.onReset
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java#L54-L66
test
java
{@inheritDoc}
public void onReset(WAMResolvingMachineDPI dpi) { System.out.println("reset"); tableModel = new TextTableImpl(); layoutRegisters = new InternalMemoryLayoutBean(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); layoutRegisters.addPropertyChangeListener(this); layoutRegisters.updateRegisters(lay...
{@inheritDoc} public void onReset(WAMResolvingMachineDPI dpi) { System.out.println("reset"); tableModel = new TextTableImpl(); layoutRegisters = new InternalMemoryLayoutBean(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); layoutRegisters.addPropertyChangeListener(this); layoutRegisters.upda...
145
13
559
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e4193dd7a93bd0c63e4edfb96de8d864db440c9950449897dfa92c66fe933829
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
3506c207ea24469fb2c0e098
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java
SimpleMonitor.onCodeUpdate
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java#L69-L93
test
java
{@inheritDoc}
public void onCodeUpdate(WAMResolvingMachineDPI dpi, int start, int length) { System.out.println("Code updated, " + length + " bytes at " + start + "."); tableModel = new TextTableImpl(); ByteBuffer code = dpi.getCodeBuffer(start, length); SizeableList<WAMInstruction> instructions ...
{@inheritDoc} public void onCodeUpdate(WAMResolvingMachineDPI dpi, int start, int length) { System.out.println("Code updated, " + length + " bytes at " + start + "."); tableModel = new TextTableImpl(); ByteBuffer code = dpi.getCodeBuffer(start, length); SizeableList<WAMInstruction...
171
13
799
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4fa5333ba79bf9733659f242eef87a16e5b62cb2bdf9ef05189a151dd076479f
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
c2d3882555ed4d18b8c25c14
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java
SimpleMonitor.printTable
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/debugger/SimpleMonitor.java#L118-L145
test
java
Renders the table.
protected void printTable(TextTableModel printTable) { for (int i = 0; i < printTable.getRowCount(); i++) { StringBuffer result = new StringBuffer(); for (int j = 0; j < printTable.getColumnCount(); j++) { String valueToPrint = printTable.get(j, i...
Renders the table. protected void printTable(TextTableModel printTable) { for (int i = 0; i < printTable.getRowCount(); i++) { StringBuffer result = new StringBuffer(); for (int j = 0; j < printTable.getColumnCount(); j++) { String valueToPrint =...
203
18
939
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1ac657514e9304106cb24103bc9ed92c0391dc9d2aa954c3055202cdb7564123
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
dd951ced8b3036f0ba573081
rupertlssmith/lojix
debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java
SwingKeyCombinationBuilder.withKey
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java#L80-L89
test
java
{@inheritDoc}
public KeyStroke withKey(String key) { // Extract the modifiers as a specification string. String keyString = modifiersToString(modifiers); // Reset the modifiers so the builder can be used again. modifiers = 0; return KeyStroke.getKeyStroke(keyString + key); }
{@inheritDoc} public KeyStroke withKey(String key) { // Extract the modifiers as a specification string. String keyString = modifiersToString(modifiers); // Reset the modifiers so the builder can be used again. modifiers = 0; return KeyStroke.getKeyStroke(keyString + key);...
65
13
311
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4e6c4a7ddd7ce48a43b9573393ba775da6596fcbf6c8a692c08edaf656066c2b
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
aa5ccceea2afcceb5387f1be
rupertlssmith/lojix
debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java
SwingKeyCombinationBuilder.modifiersToString
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/debug_ui_tools_swing/src/main/com/thesett/aima/logic/fol/wam/debugger/uifactory/impl/SwingKeyCombinationBuilder.java#L98-L128
test
java
Converts the modifiers to a specification string for KeyStroke. @param modifiers The modifiers. @return A fragment of the key specification string used by KeyStroke.
private String modifiersToString(int modifiers) { String result = ""; if ((modifiers & InputEvent.SHIFT_MASK) != 0) { result += "shift "; } if ((modifiers & InputEvent.CTRL_MASK) != 0) { result += "ctrl "; } if ((modifiers & ...
Converts the modifiers to a specification string for KeyStroke. @param modifiers The modifiers. @return A fragment of the key specification string used by KeyStroke. private String modifiersToString(int modifiers) { String result = ""; if ((modifiers & InputEvent.SHIFT_MASK) != 0) { ...
178
168
645
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7fde8c32a4d2bf6ba45260d6c2664415a5814d77b9cc3bc3e57bd93dd554ef67
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
a86c21319c71e75676b02a5a
rupertlssmith/lojix
debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java
EnhancedTextTableImpl.insertAttribute
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java#L45-L49
test
java
{@inheritDoc}
public void insertAttribute(AttributeSet attributes, int c, int r) { attributeGrid.insertAttribute(attributes, c, r); updateListenersOnAttributeChange(c, r); }
{@inheritDoc} public void insertAttribute(AttributeSet attributes, int c, int r) { attributeGrid.insertAttribute(attributes, c, r); updateListenersOnAttributeChange(c, r); }
42
13
183
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d31c624bab0bf7bc49203ab6c225aba9579474ce2fd88a372200887bb62bb0ae
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
1ccba9b7c40e639619de9fce
rupertlssmith/lojix
debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java
EnhancedTextTableImpl.insertColumnAttribute
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java#L52-L56
test
java
{@inheritDoc}
public void insertColumnAttribute(AttributeSet attributes, int c) { attributeGrid.insertColumnAttribute(attributes, c); updateListenersOnAttributeChange(c, -1); }
{@inheritDoc} public void insertColumnAttribute(AttributeSet attributes, int c) { attributeGrid.insertColumnAttribute(attributes, c); updateListenersOnAttributeChange(c, -1); }
40
13
186
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2eaf1f62f99a06c3ec8e09b07cac2e1b8c47aa34a97db016c69d567011550a39
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
a85a35a4699639eea752b5a4
rupertlssmith/lojix
debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java
EnhancedTextTableImpl.insertRowAttribute
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java#L59-L63
test
java
{@inheritDoc}
public void insertRowAttribute(AttributeSet attributes, int r) { attributeGrid.insertRowAttribute(attributes, r); updateListenersOnAttributeChange(-1, r); }
{@inheritDoc} public void insertRowAttribute(AttributeSet attributes, int r) { attributeGrid.insertRowAttribute(attributes, r); updateListenersOnAttributeChange(-1, r); }
40
13
180
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e624b27de99d9ed4f7bc9634e5f16bcb070a69d15c4cbecf84bab139f0cf8f77
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
8a95d223b98d9bb99fd0b378
rupertlssmith/lojix
debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java
EnhancedTextTableImpl.updateListenersOnAttributeChange
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableImpl.java#L113-L121
test
java
Notifies all interested listeners of an update to this model. @param col The column that changed, or <tt>-1</tt> if change not applicable to columns. @param row The row that changed, or <tt>-1</tt> if change not applicable to rows.
protected void updateListenersOnAttributeChange(int col, int row) { TextTableEvent event = new TextTableEvent(this, row, col, true); for (TextTableListener listener : listeners) { listener.changedUpdate(event); } }
Notifies all interested listeners of an update to this model. @param col The column that changed, or <tt>-1</tt> if change not applicable to columns. @param row The row that changed, or <tt>-1</tt> if change not applicable to rows. protected void updateListenersOnAttributeChange(int col, int row) { TextTa...
111
232
267
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8a1409094b6c60dbabb7ecdb25da2f7364c3babdb3e747480980c903f0905f75
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
3adbe1d65fd0a4a6bd2a978b
rupertlssmith/lojix
base/common/src/main/com/thesett/common/validate/Validation.java
Validation.toInteger
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/validate/Validation.java#L82-L95
test
java
Converts a string to an integer. The string must be a valid integer or the result will be zero. @param s The string to convert. @return The string as an integer, or 0 if it is not a valid integer.
public static int toInteger(String s) { try { return Integer.parseInt(s); } catch (NumberFormatException e) { // Exception noted so can be ignored. e = null; return 0; } }
Converts a string to an integer. The string must be a valid integer or the result will be zero. @param s The string to convert. @return The string as an integer, or 0 if it is not a valid integer. public static int toInteger(String s) { try { return Integer.parseInt(s); } ...
102
199
276
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a5528912dc1ffcf2d79ba354e1bf8cf3af669f915aec663ec9cd57376b628499
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
6fca55ade577a793858d6674
rupertlssmith/lojix
base/common/src/main/com/thesett/common/validate/Validation.java
Validation.toDate
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/validate/Validation.java#L104-L120
test
java
Converts a string to a date. The string must be a date in the correct format or this method will return null. @param s The string to convert. @return The string as a date or null if it is not a valid date.
public static Date toDate(String s) { // Build a date formatter using the format specified by dateFormat DateFormat dateFormatter = new SimpleDateFormat(dateFormat); try { return dateFormatter.parse(s); } catch (ParseException e) { // ...
Converts a string to a date. The string must be a date in the correct format or this method will return null. @param s The string to convert. @return The string as a date or null if it is not a valid date. public static Date toDate(String s) { // Build a date formatter using the format specified by date...
123
208
418
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a2e1597d3d925f25934df9437afb81b5804a601cae02b8f7276742267bd5ce9e
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
edb80ec1247a22f63ef23bca
rupertlssmith/lojix
base/common/src/main/com/thesett/common/validate/Validation.java
Validation.isDate
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/validate/Validation.java#L153-L171
test
java
Check that a string is a date in the format specified by dateFormat. @param s The string to check for being a date. @return True if the string is a date.
public static boolean isDate(String s) { // Build a date formatter using the format specified by dateFormat DateFormat dateFormatter = new SimpleDateFormat(dateFormat); try { dateFormatter.parse(s); return true; } catch (ParseException e) ...
Check that a string is a date in the format specified by dateFormat. @param s The string to check for being a date. @return True if the string is a date. public static boolean isDate(String s) { // Build a date formatter using the format specified by dateFormat DateFormat dateFormatter = new Sim...
113
156
441
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
837b43ad6ec8796e7ffe93698cde0f04b496e96ef48e395c94870ebfd39ef442
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
2635f728130935268e2cedb7
rupertlssmith/lojix
base/common/src/main/com/thesett/common/validate/Validation.java
Validation.isTime
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/validate/Validation.java#L180-L198
test
java
Checks that a string is a time in the format specified by timeFormat. @param s The string to check for being a time. @return True if the string is a time.
public static boolean isTime(String s) { // Build a time formatter using the format specified by timeFormat DateFormat dateFormatter = new SimpleDateFormat(timeFormat); try { dateFormatter.parse(s); return true; } catch (ParseException e) ...
Checks that a string is a time in the format specified by timeFormat. @param s The string to check for being a time. @return True if the string is a time. public static boolean isTime(String s) { // Build a time formatter using the format specified by timeFormat DateFormat dateFormatter = new Si...
115
157
441
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
500aa9d0cdfe997ce8a073f12fc3c81f2d09b236f9ab2ed8303220413d78313e
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
3e4bffdefcd9ecd32797552a
rupertlssmith/lojix
base/common/src/main/com/thesett/common/validate/Validation.java
Validation.isDateTime
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/validate/Validation.java#L207-L224
test
java
Checks that a string is a datetime in the format specified by dateTimeFormat. @param s The string to check for being a timestamp. @return True if the string is a timestamp.
public static boolean isDateTime(String s) { DateFormat dateFormatter = new SimpleDateFormat(dateTimeFormat); try { dateFormatter.parse(s); return true; } catch (ParseException e) { // Exception noted so can be ignored. ...
Checks that a string is a datetime in the format specified by dateTimeFormat. @param s The string to check for being a timestamp. @return True if the string is a timestamp. public static boolean isDateTime(String s) { DateFormat dateFormatter = new SimpleDateFormat(dateTimeFormat); try ...
101
175
374
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
06253cf708a93f67049b5173eeae8a2191abde186d64faa4e84ac6636b7f4cd0
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
8ceae70481383d8862351c62
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java
TokenSource.getTokenSourceForString
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java#L67-L73
test
java
Creates a token source on a string. @param stringToTokenize The string to tokenize. @return A token source.
public static TokenSource getTokenSourceForString(String stringToTokenize) { SimpleCharStream inputStream = new SimpleCharStream(new StringReader(stringToTokenize), 1, 1); PrologParserTokenManager tokenManager = new PrologParserTokenManager(inputStream); return new TokenSource(tokenManager)...
Creates a token source on a string. @param stringToTokenize The string to tokenize. @return A token source. public static TokenSource getTokenSourceForString(String stringToTokenize) { SimpleCharStream inputStream = new SimpleCharStream(new StringReader(stringToTokenize), 1, 1); PrologParserToke...
91
110
327
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
54e9f6080e52af6841afec11b4b7799687a096d53786ddab43b1b6af9d2faa83
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
e0b0db6ef1f19f61f39ff73e
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java
TokenSource.getTokenSourceForFile
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java#L84-L92
test
java
Creates a token source on a file. @param file The file to tokenize. @return A token source. @throws FileNotFoundException If the file cannot be found.
public static TokenSource getTokenSourceForFile(File file) throws FileNotFoundException { // Create a token source to load the model rules from. Reader ins = new FileReader(file); SimpleCharStream inputStream = new SimpleCharStream(ins, 1, 1); PrologParserTokenManager tokenManager = ...
Creates a token source on a file. @param file The file to tokenize. @return A token source. @throws FileNotFoundException If the file cannot be found. public static TokenSource getTokenSourceForFile(File file) throws FileNotFoundException { // Create a token source to load the model rules from. ...
113
154
415
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
46d53baa045fdb8490c650ff70f79b6cae4876d808f26bb21dda02d0600d5711
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
87c9daab90f794aa21550947
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java
TokenSource.getTokenSourceForInputStream
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java#L101-L107
test
java
Creates a token source on an input stream. @param in The input stream to tokenize. @return A token source.
public static Source getTokenSourceForInputStream(InputStream in) { SimpleCharStream inputStream = new SimpleCharStream(in, 1, 1); PrologParserTokenManager tokenManager = new PrologParserTokenManager(inputStream); return new TokenSource(tokenManager); }
Creates a token source on an input stream. @param in The input stream to tokenize. @return A token source. public static Source getTokenSourceForInputStream(InputStream in) { SimpleCharStream inputStream = new SimpleCharStream(in, 1, 1); PrologParserTokenManager tokenManager = new PrologParserTo...
80
109
286
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
907d22a999f2e852577290c3fff9f640cb3d5b730994bc986798164dd3bc5a19
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
3326154e0ac026c8172c385a
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java
TokenSource.poll
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java#L114-L124
test
java
Retrieves and removes the head token, or <tt>null</tt> if there are no more tokens. @return The head token, or <tt>null</tt> if there are no more tokens.
public Token poll() { if (token.next == null) { token.next = tokenManager.getNextToken(); } token = token.next; return token; }
Retrieves and removes the head token, or <tt>null</tt> if there are no more tokens. @return The head token, or <tt>null</tt> if there are no more tokens. public Token poll() { if (token.next == null) { token.next = tokenManager.getNextToken(); } token = token.next; ...
81
154
189
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
885cd3f01d1e27e9fc4cf579b47c30f26b3291fdea99c84adeb6eb8256f1d460
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
b73b92e628c85856092ad232
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java
TokenSource.peek
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/isoprologparser/TokenSource.java#L131-L139
test
java
Retrieves, but does not remove, the head token, returning <tt>null</tt> if there are no more tokens. @return The head token, returning <tt>null</tt> if there are no more tokens.
public Token peek() { if (token.next == null) { token.next = tokenManager.getNextToken(); } return token.next; }
Retrieves, but does not remove, the head token, returning <tt>null</tt> if there are no more tokens. @return The head token, returning <tt>null</tt> if there are no more tokens. public Token peek() { if (token.next == null) { token.next = tokenManager.getNextToken(); } ...
80
178
165
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
97235d743e348a12fb09b0131fa30ad616c1cdc1e0125996f0bc245e5897e8cb
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
55851fd8de762ccc996286ce
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java
OptimizeInstructions.apply
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L103-L239
test
java
{@inheritDoc}
public void apply(WAMInstruction next) { shift(next); // Anonymous or singleton variable optimizations. if ((UnifyVar == next.getMnemonic()) && isVoidVariable(next)) { if (state != State.UVE) { voidCount = 0; } discard...
{@inheritDoc} public void apply(WAMInstruction next) { shift(next); // Anonymous or singleton variable optimizations. if ((UnifyVar == next.getMnemonic()) && isVoidVariable(next)) { if (state != State.UVE) { voidCount = 0; } ...
1,025
13
4,389
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6c7e793f61a09d0783edf02559e3cc74a8aba3f888cfdddc3fa8ffa2495996ae
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
62238583cbe774d355d89b73
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java
OptimizeInstructions.isConstant
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L261-L276
test
java
Checks if the term argument to an instruction was a constant. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to an instruction was a constant. <tt>false</tt> will be returned if this information was not recorded, and cannot be determined.
public boolean isConstant(WAMInstruction instruction) { Integer name = instruction.getFunctorNameReg1(); if (name != null) { FunctorName functorName = interner.getDeinternedFunctorName(name); if (functorName.getArity() == 0) { return true...
Checks if the term argument to an instruction was a constant. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to an instruction was a constant. <tt>false</tt> will be returned if this information was not recorded, and cannot be determined. public boolean isConstant(WAMInstruc...
139
282
374
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
bf9ee39ccb88ebe39597796bd81b1dcfbecdd79495c3392ed75973c2f6ef43aa
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
ea5c48f544eab6d979cd84ad
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java
OptimizeInstructions.isVoidVariable
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L286-L308
test
java
Checks if the term argument to an instruction was a singleton, non-argument position variable. The variable must also be non-permanent to ensure that singleton variables in queries are created. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to the instruction was a singleton,...
private boolean isVoidVariable(WAMInstruction instruction) { SymbolKey symbolKey = instruction.getSymbolKeyReg1(); if (symbolKey != null) { Integer count = (Integer) symbolTable.get(symbolKey, SymbolTableKeys.SYMKEY_VAR_OCCURRENCE_COUNT); Boolean nonArgPositionOnly =...
Checks if the term argument to an instruction was a singleton, non-argument position variable. The variable must also be non-permanent to ensure that singleton variables in queries are created. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to the instruction was a singleton,...
277
352
967
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
96bd68748a971f8f4efee7d422bd55d3921fc6b633f3462cbccd9518d850e26f
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
061efe98cc355014ce52639d
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java
OptimizeInstructions.isNonArg
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L318-L333
test
java
Checks if the term argument to an instruction was in a non-argument position. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to an instruction was in a non-argument position. <tt>false</tt> will be returned if this information was not recorded, and cannot be determined.
private boolean isNonArg(WAMInstruction instruction) { SymbolKey symbolKey = instruction.getSymbolKeyReg1(); if (symbolKey != null) { Boolean nonArgPositionOnly = (Boolean) symbolTable.get(symbolKey, SymbolTableKeys.SYMKEY_FUNCTOR_NON_ARG); if (TRUE.equals(nonArgPos...
Checks if the term argument to an instruction was in a non-argument position. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to an instruction was in a non-argument position. <tt>false</tt> will be returned if this information was not recorded, and cannot be determined. priv...
156
314
427
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
315124e6235a09375894336c22c0fbb0b8483a53e309d1b74ba78e1f0435a9bd
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
d9bf3600a5ad3766a29ac752
rupertlssmith/lojix
lojix/jpc.lojix/src/main/com/thesett/aima/logic/fol/jpc/salt/LojixTermWriter.java
LojixTermWriter.createCompoundBuilder
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/jpc.lojix/src/main/com/thesett/aima/logic/fol/jpc/salt/LojixTermWriter.java#L78-L81
test
java
{@inheritDoc}
protected TermBuilder<com.thesett.aima.logic.fol.Term> createCompoundBuilder() { return new LojixTermBuilder(interner); }
{@inheritDoc} protected TermBuilder<com.thesett.aima.logic.fol.Term> createCompoundBuilder() { return new LojixTermBuilder(interner); }
38
13
137
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1ef76f81cf3aabf44b29e91346dfdb81d40d1b0de7664d8b1247b2c52a7ad171
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
0f6fe41627d2677645e8f00a
rupertlssmith/lojix
debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableGridRenderer.java
EnhancedTextTableGridRenderer.renderTable
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/enhanced_text_model/src/main/com/thesett/aima/logic/fol/wam/debugger/text/EnhancedTextTableGridRenderer.java#L56-L91
test
java
Renders the table.
public void renderTable() { for (int i = 0; i < tableModel.getRowCount(); i++) { int colOffset = 0; for (int j = 0; j < tableModel.getColumnCount(); j++) { String valueToPrint = tableModel.get(j, i); valueToPrint = (valueToPrint ==...
Renders the table. public void renderTable() { for (int i = 0; i < tableModel.getRowCount(); i++) { int colOffset = 0; for (int j = 0; j < tableModel.getColumnCount(); j++) { String valueToPrint = tableModel.get(j, i); valueToPrin...
257
18
1,242
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
1d3b758e19786b7b81e34665d005472afdc07ee26a585fb7317446b7ba17bcd5
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
51e0d3e4a6991fbeec680549
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java
Clause.getChildren
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java#L127-L161
test
java
Provides an iterator over the child terms, if there are any. Only functors and clauses are compound, and build across a list of child arguments. @param reverse Set, if the children should be presented in reverse order. @return The sub-terms of a compound term.
public Iterator<Operator<Term>> getChildren(boolean reverse) { if ((traverser != null) && (traverser instanceof ClauseTraverser)) { return ((ClauseTraverser) traverser).traverse(this, reverse); } else { LinkedList<Operator<Term>> resultList = null; ...
Provides an iterator over the child terms, if there are any. Only functors and clauses are compound, and build across a list of child arguments. @param reverse Set, if the children should be presented in reverse order. @return The sub-terms of a compound term. public Iterator<Operator<Term>> getChildren(boolean rev...
220
263
882
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5d6f29425bb6576d6e4122cdef4108d8b1f492b2269465f3a907898ba278df02
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
7764c271b184a7dd36171cfe
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java
Clause.queryConversion
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java#L168-L188
test
java
Makes a clone of the term, converting its variables to refer directly to their storage cells. @return A copy of this term, with entirely independent variables to the term it was copied from.
public Clause queryConversion() { Clause copy = (Clause) super.queryConversion(); if (head != null) { copy.head = head.queryConversion(); } if (body != null) { copy.body = new Functor[body.length]; for (int i = 0; i < body.length...
Makes a clone of the term, converting its variables to refer directly to their storage cells. @return A copy of this term, with entirely independent variables to the term it was copied from. public Clause queryConversion() { Clause copy = (Clause) super.queryConversion(); if (head != null) ...
133
191
450
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
8da085b175fa69235e4be2e632baaef98196f6a73fdf7a1c12ab1bdf7cd7a910
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
9f06426c389d7cc9747aadbd
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java
Clause.accept
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java#L191-L201
test
java
{@inheritDoc}
public void accept(TermVisitor visitor) { if (visitor instanceof ClauseVisitor) { ((ClauseVisitor) visitor).visit(this); } else { super.accept(visitor); } }
{@inheritDoc} public void accept(TermVisitor visitor) { if (visitor instanceof ClauseVisitor) { ((ClauseVisitor) visitor).visit(this); } else { super.accept(visitor); } }
49
13
236
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
20e095549b7185f3824ee09eada2e81d21574203815e119764fc72d016650f2e
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
65e3b2ac91fd5ee51304ce61
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java
Clause.acceptTransformer
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Clause.java#L204-L231
test
java
{@inheritDoc}
public Clause acceptTransformer(TermTransformer transformer) { Clause result; if (transformer instanceof ClauseTransformer) { result = ((ClauseTransformer) transformer).transform(this); } else { result = (Clause) super.acceptTransformer(transf...
{@inheritDoc} public Clause acceptTransformer(TermTransformer transformer) { Clause result; if (transformer instanceof ClauseTransformer) { result = ((ClauseTransformer) transformer).transform(this); } else { result = (Clause) super.acceptTra...
142
13
695
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9036e94c994212ae27e8a47cd758f116a22cdbf86b74683ada2f5735899a9652
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
b9e82a720568e8d1744c7af9
rupertlssmith/lojix
lojix/search/src/main/com/thesett/aima/search/TraversableState.java
TraversableState.successors
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/TraversableState.java#L51-L61
test
java
Works out all the possible successors by applying all the operators returned by the {@link Traversable#validOperators} method. @param reverse When set, indicates that the successors should be presented in reverse order. @return An iterator over all the {@link Successor}s that can be reached by applying valid operato...
public Iterator<Successor<O>> successors(boolean reverse) { return new Filterator<Operator<O>, Successor<O>>(validOperators(reverse), new Function<Operator<O>, Successor<O>>() { public Successor<O> apply(Operator operator) { return ...
Works out all the possible successors by applying all the operators returned by the {@link Traversable#validOperators} method. @param reverse When set, indicates that the successors should be presented in reverse order. @return An iterator over all the {@link Successor}s that can be reached by applying valid operato...
148
337
441
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
da8ee92b1d576e742344f925ab6010de6cfb6e98a6b32bb75821e370ee42cdef
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
0b8ee7aa02d1db417a16b41a
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.isGround
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L130-L141
test
java
Reports whether or not this term is a ground term. Constants (functors of arity zero) and numbers are ground terms, as are functors all of the arguments of which are ground term. @return <tt>true</tt> if this functor is a ground term, <tt>false</tt> othewise.
public boolean isGround() { for (int i = 0; i < arity; i++) { if (!arguments[i].isGround()) { return false; } } return true; }
Reports whether or not this term is a ground term. Constants (functors of arity zero) and numbers are ground terms, as are functors all of the arguments of which are ground term. @return <tt>true</tt> if this functor is a ground term, <tt>false</tt> othewise. public boolean isGround() { for (int i = 0; i ...
114
260
219
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c7e4d58fb50c04d27edbe16e1c65a394b4abc2c182d2297bd926c67539c6df51
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
769d38847e2adb0e4e585a03
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.getArgument
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L177-L187
test
java
Gets the argument within the functor with the specified index. @param index The index to get the argument for. @return The argument.
public Term getArgument(int index) { if ((arguments == null) || (index > (arguments.length - 1))) { return null; } else { return arguments[index]; } }
Gets the argument within the functor with the specified index. @param index The index to get the argument for. @return The argument. public Term getArgument(int index) { if ((arguments == null) || (index > (arguments.length - 1))) { return null; } else { ...
75
135
230
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
01519a241bd1f55cff5c32214e3a84ec0c96cd443c9b363ee74eacfe2959850e
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
108bf85860152ca6493a6287
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.structuralEquals
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L240-L281
test
java
Compares this term for structural equality with another. Two terms are structurally equal if they are the same functor with the same arguments, or are the same unbound variable, or the bound values of the left or right variable operands are structurally equal. Structural equality is a stronger equality than unification...
public boolean structuralEquals(Term term) { Term comparator = term.getValue(); if (this == comparator) { return true; } if ((comparator == null) || !(getClass().isAssignableFrom(comparator.getClass()))) { return false; } Fun...
Compares this term for structural equality with another. Two terms are structurally equal if they are the same functor with the same arguments, or are the same unbound variable, or the bound values of the left or right variable operands are structurally equal. Structural equality is a stronger equality than unification...
321
602
1,036
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
54f48c00a2433c668bc3a0ad862b7246d1ceb7010d4d187361989ea0b73510d8
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
f51562abc6786dc9872c6c7e
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.getChildren
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L337-L365
test
java
Provides an iterator over the child terms, if there are any. Only functors are compound, and built across a list of child arguments. @param reverse Set, if the children should be presented in reverse order. @return The sub-terms of a compound term.
public Iterator<Operator<Term>> getChildren(boolean reverse) { if ((traverser != null) && (traverser instanceof FunctorTraverser)) { return ((FunctorTraverser) traverser).traverse(this, reverse); } else { if (arguments == null) { ...
Provides an iterator over the child terms, if there are any. Only functors are compound, and built across a list of child arguments. @param reverse Set, if the children should be presented in reverse order. @return The sub-terms of a compound term. public Iterator<Operator<Term>> getChildren(boolean reverse) { ...
225
251
852
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c06d0a6a6a9ae50ac4ba540b422ede672664dcdfbf7d9092fdecc6a707009a01
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
18cbed84e3bff329168a4de7
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.queryConversion
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L372-L389
test
java
Makes a clone of the term, converting its variables to refer directly to their storage cells. @return A copy of this term, with entirely independent variables to the term it was copied from.
public Functor queryConversion() { /*log.fine("public Functor queryConversion(): called)");*/ Functor copy = (Functor) super.queryConversion(); if (arguments != null) { copy.arguments = new Term[arguments.length]; for (int i = 0; i < arguments.length; i++) ...
Makes a clone of the term, converting its variables to refer directly to their storage cells. @return A copy of this term, with entirely independent variables to the term it was copied from. public Functor queryConversion() { /*log.fine("public Functor queryConversion(): called)");*/ Functor copy...
130
191
453
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d9833e47b5f97f688f8c586c2f38a8a235f0794e80287ac74de5b22eb0eb9972
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
6ab6f221ca1a4bd38fba6357
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.accept
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L402-L412
test
java
{@inheritDoc}
public void accept(TermVisitor visitor) { if (visitor instanceof FunctorVisitor) { ((FunctorVisitor) visitor).visit(this); } else { super.accept(visitor); } }
{@inheritDoc} public void accept(TermVisitor visitor) { if (visitor instanceof FunctorVisitor) { ((FunctorVisitor) visitor).visit(this); } else { super.accept(visitor); } }
50
13
238
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f705a774b1a2e2b983b13ef25e6fb49960407c429163f51e6e7d370eb05ccf7a
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
121c30a36dfff343f3c3a6ea
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.acceptTransformer
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L415-L437
test
java
{@inheritDoc}
public Functor acceptTransformer(TermTransformer transformer) { Functor result; if (transformer instanceof FunctorTransformer) { result = ((FunctorTransformer) transformer).transform(this); } else { result = (Functor) super.acceptTransformer(t...
{@inheritDoc} public Functor acceptTransformer(TermTransformer transformer) { Functor result; if (transformer instanceof FunctorTransformer) { result = ((FunctorTransformer) transformer).transform(this); } else { result = (Functor) super.acce...
115
13
590
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
35128076b413c9f3cda7e7af72db4c74080ee5c2d483783d45765eb13ae2619f
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
6b693ffbd18e8685166da23a
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java
Functor.toStringArguments
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/Functor.java#L470-L488
test
java
Creates a string representation of this functors arguments, mostly used for debugging purposes. @return A string reprenestation of this functors arguments.
protected String toStringArguments() { String result = ""; if (arity > 0) { result += "[ "; for (int i = 0; i < arity; i++) { Term nextArg = arguments[i]; result += ((nextArg != null) ? nextArg.toString() : "<null>") + ((i...
Creates a string representation of this functors arguments, mostly used for debugging purposes. @return A string reprenestation of this functors arguments. protected String toStringArguments() { String result = ""; if (arity > 0) { result += "[ "; for (int i = 0; ...
130
156
433
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b3b942d5bcbff2d6bf1da8c919741c70d1d66267227e569f80de1341ff33c7d6
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
d7523d9a99383288605c0adf
rupertlssmith/lojix
debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java
MachineMonitor.onReset
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java#L80-L90
test
java
{@inheritDoc}
public void onReset(WAMResolvingMachineDPI dpi) { internalRegisters = new InternalRegisterBean(0, 0, 0, 0, 0, 0, 0, 0, 0, false); internalRegisters.addPropertyChangeListener(registerSetMonitor); internalRegisters.addPropertyChangeListener(breakpointMonitor); internalRegisters.updateR...
{@inheritDoc} public void onReset(WAMResolvingMachineDPI dpi) { internalRegisters = new InternalRegisterBean(0, 0, 0, 0, 0, 0, 0, 0, 0, false); internalRegisters.addPropertyChangeListener(registerSetMonitor); internalRegisters.addPropertyChangeListener(breakpointMonitor); internalRe...
145
13
580
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9c9386207835da3d769371edaae94eae4e97736156aba3abea59aa3c8b56988c
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
35104bbdbf424463eb2146c6
rupertlssmith/lojix
debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java
MachineMonitor.onCodeUpdate
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java#L93-L97
test
java
{@inheritDoc}
public void onCodeUpdate(WAMResolvingMachineDPI dpi, int start, int length) { ByteBuffer codeBuffer = dpi.getCodeBuffer(start, length); byteCodeMonitor.onCodeUpdate(codeBuffer, start, length, dpi.getVariableAndFunctorInterner(), dpi); }
{@inheritDoc} public void onCodeUpdate(WAMResolvingMachineDPI dpi, int start, int length) { ByteBuffer codeBuffer = dpi.getCodeBuffer(start, length); byteCodeMonitor.onCodeUpdate(codeBuffer, start, length, dpi.getVariableAndFunctorInterner(), dpi); }
64
13
260
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f4136edf193bd79909f18ccf336ba985efb62f6536a363f23341a09bae94ce0d
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
97cfb7d00320adc969d74195
rupertlssmith/lojix
debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java
MachineMonitor.onExecute
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java#L100-L104
test
java
{@inheritDoc}
public void onExecute(WAMResolvingMachineDPI dpi) { internalRegisters.updateRegisters(dpi.getInternalRegisters()); layoutRegisters.updateRegisters(dpi.getMemoryLayout()); }
{@inheritDoc} public void onExecute(WAMResolvingMachineDPI dpi) { internalRegisters.updateRegisters(dpi.getInternalRegisters()); layoutRegisters.updateRegisters(dpi.getMemoryLayout()); }
42
13
196
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
9f36f9d1370217a915acb82d44c0fa323e999c9e8e8aa75408bb85431b611f22
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
5c42c48ca26719929a17750d
rupertlssmith/lojix
debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java
MachineMonitor.onStep
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/debugger/wam_debugger/src/main/com/thesett/aima/logic/fol/wam/debugger/monitor/MachineMonitor.java#L107-L113
test
java
{@inheritDoc}
public void onStep(WAMResolvingMachineDPI dpi) { internalRegisters.updateRegisters(dpi.getInternalRegisters()); layoutRegisters.updateRegisters(dpi.getMemoryLayout()); breakpointMonitor.pause(); }
{@inheritDoc} public void onStep(WAMResolvingMachineDPI dpi) { internalRegisters.updateRegisters(dpi.getInternalRegisters()); layoutRegisters.updateRegisters(dpi.getMemoryLayout()); breakpointMonitor.pause(); }
47
13
229
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
d4931d81a19e108587146193525af8642d211f87f3acb28d928b2734cefc5fa1
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
2f2b8473fab7587e739117ec
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java
WAMInstruction.disassemble
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java#L1821-L1854
test
java
Disassembles the instructions from the specified byte buffer, starting at a given location (ip). An interner for the functor names encountered in the instruction buffer must also be supplied, in order to look up the functor names by encoded value. @param start The start offset into the buffer to disassemble. @para...
public static SizeableList<WAMInstruction> disassemble(int start, int length, ByteBuffer codeBuf, VariableAndFunctorInterner interner, WAMCodeView codeView) { SizeableList<WAMInstruction> result = new SizeableLinkedList<WAMInstruction>(); int ip = start; while (ip < (start + length)...
Disassembles the instructions from the specified byte buffer, starting at a given location (ip). An interner for the functor names encountered in the instruction buffer must also be supplied, in order to look up the functor names by encoded value. @param start The start offset into the buffer to disassemble. @para...
345
598
1,109
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
57242f64e46b6520e96e9074e6f3cf0ec59517a8f3a8b034ba75c1e9321190dc
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
0cec77af7c8341c9370ac036
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java
WAMInstruction.emmitCode
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/WAMInstruction.java#L1984-L1987
test
java
Writes out the instruction plus arguments in the byte code format to the specified location within a code buffer. @param codeBuffer The code buffer to write to. @param machine The binary machine to write the code into. @throws LinkageException If required symbols to link to cannot be found in the binary machine.
public void emmitCode(ByteBuffer codeBuffer, WAMMachine machine) throws LinkageException { mnemonic.emmitCode(this, codeBuffer, machine); }
Writes out the instruction plus arguments in the byte code format to the specified location within a code buffer. @param codeBuffer The code buffer to write to. @param machine The binary machine to write the code into. @throws LinkageException If required symbols to link to cannot be found in the binary machine....
99
320
155
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c554437a57222bcf4176e1f26e1eb17ad8b6d5b15a8658787222310d0bbccace
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
6379b7bbfb9149d93ae788d4
rupertlssmith/lojix
lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java
JavaType.getDefaultInstance
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java#L198-L257
test
java
{@inheritDoc}
public T getDefaultInstance() { Object result; // For basic Java types return the standard default value. For others, try the default constructor. switch (type) { case BOOLEAN: result = DEFAULT_BOOLEAN; break; case CHARACTER: resu...
{@inheritDoc} public T getDefaultInstance() { Object result; // For basic Java types return the standard default value. For others, try the default constructor. switch (type) { case BOOLEAN: result = DEFAULT_BOOLEAN; break; case CHARACTER: ...
212
13
1,273
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a164486e3113961840f0cd09c14b42538691df41895c32226740d7bf807edae0
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
4a1b7739e55976d5cfd4a33c
rupertlssmith/lojix
lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java
JavaType.getRandomInstance
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java#L260-L321
test
java
{@inheritDoc}
public T getRandomInstance() throws RandomInstanceNotSupportedException { Object result = null; // For basic Java types return the standard default value. For others, try the default constructor. switch (type) { case BOOLEAN: result = RANDOM.nextBoolean(); ...
{@inheritDoc} public T getRandomInstance() throws RandomInstanceNotSupportedException { Object result = null; // For basic Java types return the standard default value. For others, try the default constructor. switch (type) { case BOOLEAN: result = RANDOM.nextBo...
258
13
1,434
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
46ad07a41561bbc6e766ab88caa55c38b013685ac02b63a5ff6b4158375998ff
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
7977040c076bbfb8ca99f92b
rupertlssmith/lojix
lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java
JavaType.setBasicType
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/state/src/main/com/thesett/aima/state/impl/JavaType.java#L394-L432
test
java
Sets the basic type of this type depending on the class. @param c The underlying class.
private void setBasicType(Class c) { if (Boolean.class.equals(c)) { type = BasicTypes.BOOLEAN; } else if (Character.class.equals(c)) { type = BasicTypes.CHARACTER; } else if (Byte.class.equals(c)) { type = BasicTypes...
Sets the basic type of this type depending on the class. @param c The underlying class. private void setBasicType(Class c) { if (Boolean.class.equals(c)) { type = BasicTypes.BOOLEAN; } else if (Character.class.equals(c)) { type = BasicTypes.CHARACTER...
211
88
901
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a87117be572c6d32f9d29b38719c5b6827113ddbc812f58538af41ef2b21ec48
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
143b56efe1cc09013e98ac78
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.consultInputStream
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L159-L177
test
java
Consults an input stream, reading first order logic clauses from it, and inserting them into the resolvers knowledge base. @param stream The input stream to consult. @throws SourceCodeException If any code read from the input stream fails to parse, compile or link.
public void consultInputStream(InputStream stream) throws SourceCodeException { // Create a token source to read from the specified input stream. Source<Token> tokenSource = TokenSource.getTokenSourceForInputStream(stream); getParser().setTokenSource(tokenSource); // Consult the typ...
Consults an input stream, reading first order logic clauses from it, and inserting them into the resolvers knowledge base. @param stream The input stream to consult. @throws SourceCodeException If any code read from the input stream fails to parse, compile or link. public void consultInputStream(InputStream stream)...
166
268
607
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ff22bf4da3a45b4cd750a3490f6b8293802a3dc384ad76493ed003efc068eb04
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
a58fde21a9bfea290d1a6c58
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.printSolution
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L186-L196
test
java
Prints all of the logic variables in the results of a query. @param solution An iterable over the variables in the solution. @return All the variables printed as a string, one per line.
public String printSolution(Iterable<Variable> solution) { String result = ""; for (Variable var : solution) { result += printVariableBinding(var) + "\n"; } return result; }
Prints all of the logic variables in the results of a query. @param solution An iterable over the variables in the solution. @return All the variables printed as a string, one per line. public String printSolution(Iterable<Variable> solution) { String result = ""; for (Variable var : solution) ...
87
188
235
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b7c403ecc6a55fd4279c494ab8de4a9f54f552e93ae883501c32a77bed199cb6
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
28828745d2f0a5e1cde48797
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.printSolution
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L205-L215
test
java
Prints all of the logic variables in the results of a query. @param variables An iterable over the variables in the solution. @return All the variables printed as a string, one per line.
public String printSolution(Map<String, Variable> variables) { String result = ""; for (Map.Entry<String, Variable> entry : variables.entrySet()) { result += printVariableBinding(entry.getValue()) + "\n"; } return result; }
Prints all of the logic variables in the results of a query. @param variables An iterable over the variables in the solution. @return All the variables printed as a string, one per line. public String printSolution(Map<String, Variable> variables) { String result = ""; for (Map.Entry<String, Va...
94
189
285
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2be2325a77e4fd716dfe4953c566f9904fe354c8fc00dcd112ce4f4050cdab35
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
ef1464878e04352037696419
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.printVariableBinding
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L224-L227
test
java
Prints a variable binding in the form 'Var = value'. @param var The variable to print. @return The variable binding in the form 'Var = value'.
public String printVariableBinding(Term var) { return var.toString(getInterner(), true, false) + " = " + var.getValue().toString(getInterner(), false, true); }
Prints a variable binding in the form 'Var = value'. @param var The variable to print. @return The variable binding in the form 'Var = value'. public String printVariableBinding(Term var) { return var.toString(getInterner(), true, false) + " = " + var.getValue().toString(getInterner(), false, true); ...
75
145
175
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
176e93fc075472e37b1d0f3eeb9784e1a8e3956c3737fc9dbeff6c0d059deecd
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
e2d1f68253ca0fe6b3cc4d55
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.expandResultSetToMap
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L237-L255
test
java
Transforms an iterator over sets of variable bindings, resulting from a query, to an iterator over a map from the string name of variables to their bindings, for the same sequence of query solutions. @param solutions The resolution solutions to convert to map form. @return An iterator over a map from the string name...
public Iterable<Map<String, Variable>> expandResultSetToMap(Iterator<Set<Variable>> solutions) { return new Filterator<Set<Variable>, Map<String, Variable>>(solutions, new Function<Set<Variable>, Map<String, Variable>>() { public Map<String, Variable> apply(Set<Variab...
Transforms an iterator over sets of variable bindings, resulting from a query, to an iterator over a map from the string name of variables to their bindings, for the same sequence of query solutions. @param solutions The resolution solutions to convert to map form. @return An iterator over a map from the string name...
202
371
748
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7ab006ad6a31670a8e598194e12715bbb8077e98efb33553535620b787f57240
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
beed2e21a77a8a04fe983be7
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java
ResolutionEngine.setOperator
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/interpreter/ResolutionEngine.java#L348-L351
test
java
{@inheritDoc}
public void setOperator(String operatorName, int priority, OpSymbol.Associativity associativity) { parser.setOperator(operatorName, priority, associativity); }
{@inheritDoc} public void setOperator(String operatorName, int priority, OpSymbol.Associativity associativity) { parser.setOperator(operatorName, priority, associativity); }
38
13
175
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
aa465c53773385f24ae70b60e4f936730893290cb41828094b81433b2e205953
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
5016361701ff64fc025693d8
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/BaseBuiltIn.java
BaseBuiltIn.compileBodyArguments
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/builtins/BaseBuiltIn.java#L52-L56
test
java
{@inheritDoc}
public SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor expression, boolean isFirstBody, FunctorName clauseName, int bodyNumber) { return null; }
{@inheritDoc} public SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor expression, boolean isFirstBody, FunctorName clauseName, int bodyNumber) { return null; }
41
13
184
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0cb499922e38d15e8209e82ed921df6bd55dc0913d87f0e03959ee721d5f4a64
Apache-2.0
permissive
https://github.com/rupertlssmith/lojix/blob/master/LICENSE
e620b095e2646d66e97642ca
abmargb/jamppa
src/main/java/org/jivesoftware/whack/SocketReadThread.java
SocketReadThread.run
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/SocketReadThread.java#L62-L80
test
java
A dedicated thread loop for reading the stream and sending incoming packets to the appropriate router.
public void run() { try { readStream(); } catch (EOFException eof) { // Normal disconnect } catch (SocketException se) { // Do nothing if the exception occured while shutting down the // component otherwise // log the error and try to e...
A dedicated thread loop for reading the stream and sending incoming packets to the appropriate router. public void run() { try { readStream(); } catch (EOFException eof) { // Normal disconnect } catch (SocketException se) { // Do nothing if the exception occu...
154
102
693
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fe4d77a60a1602d59cd12ba5df3ce267fa95e90bb51f7262d4438215ed33a6dd
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
5e2ff05f0d9b7740f99cdb8f
abmargb/jamppa
src/main/java/org/jivesoftware/whack/SocketReadThread.java
SocketReadThread.readStream
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/SocketReadThread.java#L85-L111
test
java
Read the incoming stream until it ends.
private void readStream() throws Exception { while (!shutdown) { Element doc = reader.parseDocument().getRootElement(); if (doc == null) { // Stop reading the stream since the server has sent an end of // stream element and // probably clo...
Read the incoming stream until it ends. private void readStream() throws Exception { while (!shutdown) { Element doc = reader.parseDocument().getRootElement(); if (doc == null) { // Stop reading the stream since the server has sent an end of // stream el...
183
39
980
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
2e37c5b0a0042c4abfa94b421ba89bc3eb674a9f1bb9908dc4385e041cae21fa
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
bb484191587e29d150ed0008
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.init
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L85-L115
test
java
Initializes the reader in order to be used. The reader is initialized during the first connection and when reconnecting due to an abruptly disconnection.
protected void init() { done = false; connectionID = null; readerThread = new Thread() { public void run() { parsePackets(this); } }; readerThread.setName("Smack Packet Reader (" + connection.connectionCounterValue + ")"); ...
Initializes the reader in order to be used. The reader is initialized during the first connection and when reconnecting due to an abruptly disconnection. protected void init() { done = false; connectionID = null; readerThread = new Thread() { public void run() { par...
201
153
1,074
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4c2eb001f2c0da17007e927e21f51adc91aae9e56c73bafb569d0de756952b32
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
8d80769ca0c2bab8e2780a1e
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.startup
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L126-L161
test
java
Starts the packet reader thread and returns once a connection to the server has been established. A connection will be attempted for a maximum of five seconds. An XMPPException will be thrown if the connection fails. @throws XMPPException if the server fails to send an opening stream back for more than five seconds.
synchronized public void startup() throws XMPPException { final List<Exception> errors = new LinkedList<Exception>(); AbstractConnectionListener connectionErrorListener = new AbstractConnectionListener() { @Override public void connectionClosedOnError(Exception e) { ...
Starts the packet reader thread and returns once a connection to the server has been established. A connection will be attempted for a maximum of five seconds. An XMPPException will be thrown if the connection fails. @throws XMPPException if the server fails to send an opening stream back for more than five seconds. ...
344
318
1,494
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
b679c9f65bebd87cbefd8862b3854e1aaab3f817988d5ed0bb3dd1e989b3e7f4
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
c1bf52950e2e3601d1377a47
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.shutdown
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L166-L186
test
java
Shuts the packet reader down.
public void shutdown() { // Notify connection listeners of the connection closing if done hasn't // already been set. if (!done) { for (ConnectionListener listener : connection .getConnectionListeners()) { try { listener.connect...
Shuts the packet reader down. public void shutdown() { // Notify connection listeners of the connection closing if done hasn't // already been set. if (!done) { for (ConnectionListener listener : connection .getConnectionListeners()) { try { ...
136
29
794
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
3a3d4c9cb1ca2019f390ac07374267d23a7f0af7ac9491ffed85192babc6f220
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ea9c02e7f97957e298c04fab
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.resetParser
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L193-L202
test
java
Resets the parser using the latest connection's reader. Reseting the parser is necessary when the plain connection has been secured or when a new opening stream element is going to be sent by the server.
private void resetParser() { try { innerReader = new XPPPacketReader(); innerReader.setXPPFactory(XmlPullParserFactory.newInstance()); innerReader.getXPPParser().setInput(connection.reader); reset = true; } catch (Exception xppe) { LOGGER.log(L...
Resets the parser using the latest connection's reader. Reseting the parser is necessary when the plain connection has been secured or when a new opening stream element is going to be sent by the server. private void resetParser() { try { innerReader = new XPPPacketReader(); innerReader...
118
203
385
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a4b5b137b5bccf6f0850cd669bd6c55add155047057eacfd25d2325f0f918983
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
52da5984ea36cb81aa0a19ea
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.parsePackets
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L235-L268
test
java
Parse top-level packets in order to process them further. @param thread the thread that is being used by the reader to parse incoming packets.
private void parsePackets(Thread thread) { try { while (!done) { if (reset) { startStream(); LOGGER.debug("Started xmlstream..."); reset = false; continue; } Element doc = ...
Parse top-level packets in order to process them further. @param thread the thread that is being used by the reader to parse incoming packets. private void parsePackets(Thread thread) { try { while (!done) { if (reset) { startStream(); LOGGER...
225
143
1,212
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
70856b954eef01abca607d5e7eba67f71c6ce182cf014411e6c4309533f8e873
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
8790892bccb88af9662ab477
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketReader.java
PacketReader.processPacket
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketReader.java#L390-L402
test
java
Processes a packet after it's been fully parsed by looping through the installed packet collectors and listeners and letting them examine the packet to see if they are a match with the filter. @param packet the packet to process.
private void processPacket(Packet packet) { if (packet == null) { return; } // Loop through all collectors and notify the appropriate ones. for (PacketCollector collector : connection.getPacketCollectors()) { collector.processPacket(packet); } //...
Processes a packet after it's been fully parsed by looping through the installed packet collectors and listeners and letting them examine the packet to see if they are a match with the filter. @param packet the packet to process. private void processPacket(Packet packet) { if (packet == null) { re...
120
230
435
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5f1292e3de10fc4f2035c15930efcb71a7abf4772e8953ab7d35dd339187481c
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
d4c9289cae89ecc1c1223af6
vdmeer/execs
src/main/java/de/vandermeer/execs/options/AbstractApplicationOption.java
AbstractApplicationOption.setCliOption
https://github.com/vdmeer/execs/blob/ac73170bfd449de1f460248d56ece57ff3b0c761/src/main/java/de/vandermeer/execs/options/AbstractApplicationOption.java#L146-L156
test
java
Sets the CLI option. @param option CLI option, only used if not null
protected final void setCliOption(Option option){ if(option!=null){ this.cliOption = option; } if(this.cliOption.getDescription()!=null){ this.descr = this.cliOption.getDescription(); } else{ this.cliOption.setDescription(this.descr); } }
Sets the CLI option. @param option CLI option, only used if not null protected final void setCliOption(Option option){ if(option!=null){ this.cliOption = option; } if(this.cliOption.getDescription()!=null){ this.descr = this.cliOption.getDescription(); } else{ this.cliOption.setDescription(this.desc...
81
68
260
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
fc4cfb159a65b46d0aa118fa1c07537b96b972e4d5f8455b75c2739bbe0eb9ac
Apache-2.0
permissive
https://github.com/vdmeer/execs/blob/master/LICENSE
6cacdcce4080e7bea2185a87
abmargb/jamppa
src/main/java/org/jivesoftware/smack/ChatManager.java
ChatManager.createChat
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/ChatManager.java#L205-L207
test
java
Creates a new chat and returns it. @param userJID the user this chat is with. @param listener the listener which will listen for new messages from this chat. @return the created chat.
public Chat createChat(String userJID, MessageListener listener) { return createChat(userJID, null, listener); }
Creates a new chat and returns it. @param userJID the user this chat is with. @param listener the listener which will listen for new messages from this chat. @return the created chat. public Chat createChat(String userJID, MessageListener listener) { return createChat(userJID, null, listener); }
69
184
124
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
46e831efc1cb35a70c66de5eef1bb160b3de2026aa5aa1a4ba2f23d50cf15904
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
239919f4987b3ce2cb85a071
abmargb/jamppa
src/main/java/org/jivesoftware/smack/ChatManager.java
ChatManager.getUserChat
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/ChatManager.java#L268-L279
test
java
Try to get a matching chat for the given user JID, based on the {@link MatchMode}. <li>NONE - return null <li>SUPPLIED_JID - match the jid in the from field of the message exactly. <li>BARE_JID - if not match for from field, try the bare jid. @param userJID jid in the from field of message. @return Matching chat, or n...
private Chat getUserChat(String userJID) { if (matchMode == MatchMode.NONE) { return null; } Chat match = jidChats.get(userJID); if (match == null && (matchMode == MatchMode.BARE_JID)) { match = baseJidChats.get(StringUtils.parseBareAddress(userJID)); } ...
Try to get a matching chat for the given user JID, based on the {@link MatchMode}. <li>NONE - return null <li>SUPPLIED_JID - match the jid in the from field of the message exactly. <li>BARE_JID - if not match for from field, try the bare jid. @param userJID jid in the from field of message. @return Matching chat, or n...
180
342
347
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6c09a743e045ce413fca63d3dab1e2fc104f405bbcc15b49593f52f8d1f03c28
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
949b4c7c88385c289255bc05
abmargb/jamppa
src/main/java/org/jivesoftware/smack/util/DNSUtil.java
DNSUtil.resolveXMPPServerDomain
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/DNSUtil.java#L115-L122
test
java
Returns a list of HostAddresses under which the specified XMPP server can be reached at for server-to-server communication. A DNS lookup for a SRV record in the form "_xmpp-server._tcp.example.com" is attempted, according to section 14.4 of RFC 3920. If that lookup fails, a lookup in the older form of "_jabber._tcp.exa...
public static List<HostAddress> resolveXMPPServerDomain(final String domain) { if (dnsResolver == null) { List<HostAddress> addresses = new ArrayList<HostAddress>(1); addresses.add(new HostAddress(domain, 5269)); return addresses; } return resolveDomain(domain...
Returns a list of HostAddresses under which the specified XMPP server can be reached at for server-to-server communication. A DNS lookup for a SRV record in the form "_xmpp-server._tcp.example.com" is attempted, according to section 14.4 of RFC 3920. If that lookup fails, a lookup in the older form of "_jabber._tcp.exa...
271
841
333
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
434ffdd2ef042ec694f848b40251b0b8dfb7d56e9f269bde21eabd58b1a322cb
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
b8d0172daeadd951b240f822
abmargb/jamppa
src/main/java/org/jivesoftware/smack/filter/OrFilter.java
OrFilter.addFilter
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/filter/OrFilter.java#L74-L89
test
java
Adds a filter to the filter list for the OR operation. A packet will pass the filter if any filter in the list accepts it. @param filter a filter to add to the filter list.
public void addFilter(PacketFilter filter) { if (filter == null) { throw new IllegalArgumentException("Parameter cannot be null."); } // If there is no more room left in the filters array, expand it. if (size == filters.length) { PacketFilter[] newFilters = new Pa...
Adds a filter to the filter list for the OR operation. A packet will pass the filter if any filter in the list accepts it. @param filter a filter to add to the filter list. public void addFilter(PacketFilter filter) { if (filter == null) { throw new IllegalArgumentException("Parameter cannot be nu...
170
173
606
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
839121a9eeb35fdfb44c93f27b06f1b62a150abe63812c3c38e7243094706863
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
6877daddceaff931d93eeba0
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedTransactionalSortedBidiMap.java
SynchronizedTransactionalSortedBidiMap.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedTransactionalSortedBidiMap.java#L35-L37
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> TransactionalSortedBidiMap<K,V> decorate(TransactionalSortedBidiMap<K,V> map) { return new SynchronizedTransactionalSortedBidiMap<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> TransactionalSortedBidiMap<K,V> decorate(TransactionalSortedBidiMap<K,V> map) { return new SynchronizedTransactionalSortedBidiMap<K,V>(map); ...
74
143
176
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
0dfda336ecff81e72f76f9a64fd2026a3597fb7369d022900333d59c54de40a6
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
29aaf5733d74b10c7121e3e0
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedTransactionalSortedBidiMap.java
SynchronizedTransactionalSortedBidiMap.commit
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedTransactionalSortedBidiMap.java#L66-L73
test
java
-----------------------------------------------------------------------
public void commit() { SyncUtils.synchronizeWrite(lock, new Callback<Object>() { @Override protected void doAction() { getTransactionalSortedBidiMap().commit(); } }); }
----------------------------------------------------------------------- public void commit() { SyncUtils.synchronizeWrite(lock, new Callback<Object>() { @Override protected void doAction() { getTransactionalSortedBidiMap().commit(); } }); }
47
71
247
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
6fe5487f267e9e2805a05eebb5b34cda41932d22687f191eef1036ab57500edd
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
48f272a8bff6573a4961c46d
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketWriter.java
PacketWriter.init
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketWriter.java#L68-L80
test
java
Initializes the writer in order to be used. It is called at the first connection and also is invoked if the connection is disconnected by an error.
protected void init() { this.writer = connection.writer; done = false; writerThread = new Thread() { public void run() { writePackets(this); } }; writerThread.setName("Smack Packet Writer (" + connection.connectionCounterVa...
Initializes the writer in order to be used. It is called at the first connection and also is invoked if the connection is disconnected by an error. protected void init() { this.writer = connection.writer; done = false; writerThread = new Thread() { public void run() { ...
101
147
375
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
a1f024d8fb0ad16559fa85a2bd08adf7039936ae503f0c5f6749fb81412a200e
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ee5c0971ba6b050a4b9a42c8
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketWriter.java
PacketWriter.sendPacket
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketWriter.java#L88-L113
test
java
Sends the specified packet to the server. @param packet the packet to send.
public void sendPacket(Packet packet) { if (!done) { // Invoke interceptors for the new packet that is about to be sent. // Interceptors // may modify the content of the packet. connection.firePacketInterceptors(packet); try { queue.pu...
Sends the specified packet to the server. @param packet the packet to send. public void sendPacket(Packet packet) { if (!done) { // Invoke interceptors for the new packet that is about to be sent. // Interceptors // may modify the content of the packet. connecti...
173
76
929
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
de0c0d3266c89e81dcc42f9bdc14fc96a76c85eac07e07a890a85cb6301b6704
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
c9ef299f502da43eb76df365
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketWriter.java
PacketWriter.nextPacket
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketWriter.java#L144-L157
test
java
Returns the next available packet from the queue for writing. @return the next packet for writing.
private Packet nextPacket() { Packet packet = null; // Wait until there's a packet or we're done. while (!done && (packet = queue.poll()) == null) { try { synchronized (queue) { queue.wait(); } } catch (InterruptedExcept...
Returns the next available packet from the queue for writing. @return the next packet for writing. private Packet nextPacket() { Packet packet = null; // Wait until there's a packet or we're done. while (!done && (packet = queue.poll()) == null) { try { synchronized...
96
99
412
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
7dedccd71b4b811cf99855cc621d3738669b93e5e04e44790d69cbe4a081c267
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
fe5a681865522b795f19ea45
abmargb/jamppa
src/main/java/org/jivesoftware/smack/PacketWriter.java
PacketWriter.openStream
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/PacketWriter.java#L229-L239
test
java
Sends to the server a new stream element. This operation may be requested several times so we need to encapsulate the logic in one place. This message will be sent while doing TLS, SASL and resource binding. @throws IOException If an error occurs while sending the stanza to the server.
void openStream() throws IOException { StringBuilder stream = new StringBuilder(); stream.append("<stream:stream"); stream.append(" to=\"").append(connection.getServiceName()) .append("\""); stream.append(" xmlns=\"jabber:client\""); stream.append(" xmlns:stream=\...
Sends to the server a new stream element. This operation may be requested several times so we need to encapsulate the logic in one place. This message will be sent while doing TLS, SASL and resource binding. @throws IOException If an error occurs while sending the stanza to the server. void openStream() throws IOExce...
155
287
473
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
e7e5295cf8b1728df8977888128c6425a995a1505c4f03dee251a6d0746639c9
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
372b7ca2d13506ad7b014cff
abmargb/jamppa
src/main/java/org/jivesoftware/whack/util/TaskEngine.java
TaskEngine.shutdown
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/whack/util/TaskEngine.java#L319-L329
test
java
Shuts down the task engine service.
public void shutdown() { if (executor != null) { executor.shutdownNow(); executor = null; } if (timer != null) { timer.cancel(); timer = null; } }
Shuts down the task engine service. public void shutdown() { if (executor != null) { executor.shutdownNow(); executor = null; } if (timer != null) { timer.cancel(); timer = null; } }
54
35
231
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
28c873bf0b6e976a1e3b4ad60dbe790394e7cffa05f0b6a211208833f81a4586
Apache-2.0
permissive
https://github.com/abmargb/jamppa/blob/master/LICENSE
ab520b5cfe7f782257fe8db7
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableCollection.java
SynchronizedFilterableCollection.decorate
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableCollection.java#L35-L37
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 <E> FilterableCollection<E> decorate(FilterableCollection<E> collection) { return new SynchronizedFilterableCollection<E>(collection); }
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 <E> FilterableCollection<E> decorate(FilterableCollection<E> collection) { return new SynchronizedFilterableCollection<E>(collection); }
62
143
164
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
f64da83bfe574479b7d4caf509f9849825f8dcfb993deaf9dc214d2a62e9bf8d
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
cb4a225f61b72692a16ba49a
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableCollection.java
SynchronizedFilterableCollection.filteredCollection
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/decorators/SynchronizedFilterableCollection.java#L67-L75
test
java
-----------------------------------------------------------------------
public FilterableCollection<E> filteredCollection(final Filter<? super E> filter) { return SyncUtils.synchronizeRead(lock, new Callback<FilterableCollection<E>>() { @Override protected void doAction() { FilterableCollection<E> _col = getFilterableCollection().filtered...
----------------------------------------------------------------------- public FilterableCollection<E> filteredCollection(final Filter<? super E> filter) { return SyncUtils.synchronizeRead(lock, new Callback<FilterableCollection<E>>() { @Override protected void doAction() { ...
87
71
453
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
06fc732aa0437323a77c46fc0d0c846ccf5100d01aaf56bc2c0196b7c58c034f
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
bf61a1cc5964dee61171a9bc
kolotyluk/java-file-utilities
src/main/java/net/kolotyluk/java/files/Files.java
Files.contentEquals
https://github.com/kolotyluk/java-file-utilities/blob/58838ddb759f7ded8d54e55abfc67b3ba1561c58/src/main/java/net/kolotyluk/java/files/Files.java#L66-L138
test
java
Identical File Contents <p>Uses <a href="http://en.wikipedia.org/wiki/Memory-mapped_file">Memory Mapped Files</a> for fast comparison of large files. This is about 4 times faster than calling</p><pre> <a href="http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#contentEquals%28java...
public static Boolean contentEquals(Path file1, Path file2) throws IOException { if (!java.nio.file.Files.isRegularFile(file1)) throw new IllegalArgumentException(file1 + "is not a regular file"); if (!java.nio.file.Files.isRegularFile(file2)) throw new IllegalArgumentException(file2 + "is not a ...
Identical File Contents <p>Uses <a href="http://en.wikipedia.org/wiki/Memory-mapped_file">Memory Mapped Files</a> for fast comparison of large files. This is about 4 times faster than calling</p><pre> <a href="http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#contentEquals%28java...
906
1,417
2,274
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
c70ffb87192afbae0fa9b66325021739f37821c2935b4366c618ca94a995019f
Apache-2.0
permissive
https://github.com/kolotyluk/java-file-utilities/blob/master/LICENSE
9427e333b430e7aabd5ad5de
kolotyluk/java-file-utilities
src/main/java/net/kolotyluk/java/files/Files.java
Files.cleanDirectByteBuffer
https://github.com/kolotyluk/java-file-utilities/blob/58838ddb759f7ded8d54e55abfc67b3ba1561c58/src/main/java/net/kolotyluk/java/files/Files.java#L162-L190
test
java
Clean or unmap a direct ByteBuffer <p>DirectByteBuffers are garbage collected by using a phantom reference and a reference queue. Every once a while, the JVM checks the reference queue and cleans the DirectByteBuffers. However, as this doesn't happen immediately after discarding all references to a DirectByteBuffer, i...
public static void cleanDirectByteBuffer(final ByteBuffer byteBuffer) { if (byteBuffer == null) return; if (!byteBuffer.isDirect()) throw new IllegalArgumentException("byteBuffer isn't direct!"); AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { ...
Clean or unmap a direct ByteBuffer <p>DirectByteBuffers are garbage collected by using a phantom reference and a reference queue. Every once a while, the JVM checks the reference queue and cleans the DirectByteBuffers. However, as this doesn't happen immediately after discarding all references to a DirectByteBuffer, i...
402
1,008
1,030
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
4a28e9ef6a055414ee2b84ba0eca24aa0db8ae60fdeab74b46656c2de6d95a87
Apache-2.0
permissive
https://github.com/kolotyluk/java-file-utilities/blob/master/LICENSE
b13e7a2de291b52f2cc7ce33
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.rollback
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L252-L285
test
java
Rolls back the changes to the map.
public void rollback() { if (auto_commit) return; String id = getCurrentThreadId(); Entry<K,V> tab[] = table; for (int i = 0; i < tab.length ; i++) { Entry<K,V> prev = table[i]; Entry<K,V> e = prev; ...
Rolls back the changes to the map. public void rollback() { if (auto_commit) return; String id = getCurrentThreadId(); Entry<K,V> tab[] = table; for (int i = 0; i < tab.length ; i++) { Entry<K,V> prev = table[i]; ...
187
34
924
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
5de42f47d8e72358f964a6dd4d6e21a016533b5d2ebe919ef507ffc3651040a9
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
d647ada1a1bdc0743e789e8d
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.validEntry
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L347-L355
test
java
Checks that this entry is valid for the current thread @param entry the entry to be checked @return true if entry is valid, otherwise false
private boolean validEntry(final Entry<K,V> entry) { if (auto_commit || entry == null) return (entry != null); String id = getCurrentThreadId(); return !((entry.is(Entry.DELETED, id)) || (entry.is(Entry.ADDED, null) && entry.is(Entry.NO_CHANGE, id)...
Checks that this entry is valid for the current thread @param entry the entry to be checked @return true if entry is valid, otherwise false private boolean validEntry(final Entry<K,V> entry) { if (auto_commit || entry == null) return (entry != null); String id = getCurre...
104
141
330
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ce9706d840bada59e8ebf5c679529c0359bde8e7d57e8ef289f6d53cc373514c
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
fdf611476c2548c04629bbbe
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.maskNull
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L365-L369
test
java
Returns internal representation for key. Use NULL_KEY if key is null.
@SuppressWarnings("unchecked") static <T> T maskNull(T key) { return (key == null ? (T)NULL_KEY : key); }
Returns internal representation for key. Use NULL_KEY if key is null. @SuppressWarnings("unchecked") static <T> T maskNull(T key) { return (key == null ? (T)NULL_KEY : key); }
47
69
129
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
cd31b5bd3ce48fc705e153c1421f3a2d7f7d67999d8f28b1c3b660b5ea46c5fa
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
6826fffd31a6e5912d81b6d1
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.hash
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L389-L398
test
java
Returns a hash value for the specified object. In addition to the object's own hashCode, this method applies a "supplemental hash function," which defends against poor quality hash functions. This is critical because HashMap uses power-of two length hash tables.<p> The shift distances in this function were chosen as ...
static int hash(Object x) { int h = x.hashCode(); h += ~(h << 9); h ^= (h >>> 14); h += (h << 4); h ^= (h >>> 10); return h; }
Returns a hash value for the specified object. In addition to the object's own hashCode, this method applies a "supplemental hash function," which defends against poor quality hash functions. This is critical because HashMap uses power-of two length hash tables.<p> The shift distances in this function were chosen as ...
141
400
203
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
deccdafbe7a2078a4ec1496c8a1ddd09d21b6c7476dab94e001f4b60bb38c283
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
fbe0305ab9915d1e8c6ad87a
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.eq
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L403-L406
test
java
Check for equality of non-null reference x and possibly-null y.
static boolean eq(Object x, Object y) { return x == y || x.equals(y); }
Check for equality of non-null reference x and possibly-null y. static boolean eq(Object x, Object y) { return x == y || x.equals(y); }
36
63
90
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
ec3a66ec645e77366096da646cf718aacdc49da8bcf1c97960a36680c7a4c55a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
9b6a4d74fa4ca4a15da88851
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.get
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L453-L468
test
java
Returns the value to which the specified key is mapped in this identity hash map, or <tt>null</tt> if the map contains no mapping for this key. A return value of <tt>null</tt> does not <i>necessarily</i> indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to <...
@Override public V get(Object key) { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> e = table[i]; while (true) { if (e == null) return null; if (e.hash == hash && va...
Returns the value to which the specified key is mapped in this identity hash map, or <tt>null</tt> if the map contains no mapping for this key. A return value of <tt>null</tt> does not <i>necessarily</i> indicate that the map contains no mapping for the key; it is also possible that the map explicitly maps the key to <...
255
622
424
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
45a0ef2ace53a8b791ceb5e795420b866af02139c134618f6bcca9812a7b595a
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE
51c7df76b4b9b0c0a32848fd
workplacesystems/utilsj
src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java
TransactionalHashMap.getEntry
https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalHashMap.java#L499-L508
test
java
Returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key.
Entry<K,V> getEntry(Object key) { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> e = table[i]; while (e != null && !(e.hash == hash && validEntry(e) && eq(k, e.key))) e = e.next; return e; }
Returns the entry associated with the specified key in the HashMap. Returns null if the HashMap contains no mapping for this key. Entry<K,V> getEntry(Object key) { Object k = maskNull(key); int hash = hash(k); int i = indexFor(hash, table.length); Entry<K,V> e = table[i]; ...
110
130
315
CodeSearchNet permissive-repo filter (dataset-level; per-row license absent)
code_search_net
2026-12-05
96a0ca27f63e41774fa60a3c525955bc457a509db6478b40ef41903209d01896
Apache-2.0
permissive
https://github.com/workplacesystems/utilsj/blob/master/LICENSE