id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
38,100
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.sendSerialMessage
public void sendSerialMessage(String value) { Buffer buffer = new Buffer(); try { buffer.write(value.getBytes("UTF-8")); sendMessage(BeanMessageID.SERIAL_DATA, buffer); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
java
public void sendSerialMessage(String value) { Buffer buffer = new Buffer(); try { buffer.write(value.getBytes("UTF-8")); sendMessage(BeanMessageID.SERIAL_DATA, buffer); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
[ "public", "void", "sendSerialMessage", "(", "String", "value", ")", "{", "Buffer", "buffer", "=", "new", "Buffer", "(", ")", ";", "try", "{", "buffer", ".", "write", "(", "value", ".", "getBytes", "(", "\"UTF-8\"", ")", ")", ";", "sendMessage", "(", "B...
Send a UTF-8 string to the Bean as a serial message. @param value the message to send as UTF-8 bytes
[ "Send", "a", "UTF", "-", "8", "string", "to", "the", "Bean", "as", "a", "serial", "message", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L998-L1006
38,101
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.readFirmwareVersion
public void readFirmwareVersion(final Callback<String> callback) { gattClient.getDeviceProfile().getFirmwareVersion(new DeviceProfile.VersionCallback() { @Override public void onComplete(String version) { callback.onResult(version); } }); }
java
public void readFirmwareVersion(final Callback<String> callback) { gattClient.getDeviceProfile().getFirmwareVersion(new DeviceProfile.VersionCallback() { @Override public void onComplete(String version) { callback.onResult(version); } }); }
[ "public", "void", "readFirmwareVersion", "(", "final", "Callback", "<", "String", ">", "callback", ")", "{", "gattClient", ".", "getDeviceProfile", "(", ")", ".", "getFirmwareVersion", "(", "new", "DeviceProfile", ".", "VersionCallback", "(", ")", "{", "@", "O...
Read the Bean hardware version @param callback the callback for the version string
[ "Read", "the", "Bean", "hardware", "version" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1027-L1034
38,102
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.readHardwareVersion
public void readHardwareVersion(final Callback<String> callback) { gattClient.getDeviceProfile().getHardwareVersion(new DeviceProfile.VersionCallback() { @Override public void onComplete(String version) { callback.onResult(version); } }); }
java
public void readHardwareVersion(final Callback<String> callback) { gattClient.getDeviceProfile().getHardwareVersion(new DeviceProfile.VersionCallback() { @Override public void onComplete(String version) { callback.onResult(version); } }); }
[ "public", "void", "readHardwareVersion", "(", "final", "Callback", "<", "String", ">", "callback", ")", "{", "gattClient", ".", "getDeviceProfile", "(", ")", ".", "getHardwareVersion", "(", "new", "DeviceProfile", ".", "VersionCallback", "(", ")", "{", "@", "O...
Read Bean firmware version @param callback the callback for the version string
[ "Read", "Bean", "firmware", "version" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1041-L1048
38,103
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.setArduinoEnabled
public void setArduinoEnabled(boolean enable) { Buffer buffer = new Buffer(); buffer.writeByte(enable ? 1 : 0); sendMessage(BeanMessageID.CC_POWER_ARDUINO, buffer); }
java
public void setArduinoEnabled(boolean enable) { Buffer buffer = new Buffer(); buffer.writeByte(enable ? 1 : 0); sendMessage(BeanMessageID.CC_POWER_ARDUINO, buffer); }
[ "public", "void", "setArduinoEnabled", "(", "boolean", "enable", ")", "{", "Buffer", "buffer", "=", "new", "Buffer", "(", ")", ";", "buffer", ".", "writeByte", "(", "enable", "?", "1", ":", "0", ")", ";", "sendMessage", "(", "BeanMessageID", ".", "CC_POW...
Enable or disable the Arduino. @param enable true to enable, false to disable
[ "Enable", "or", "disable", "the", "Arduino", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1055-L1059
38,104
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.readArduinoPowerState
public void readArduinoPowerState(final Callback<Boolean> callback) { addCallback(BeanMessageID.CC_GET_AR_POWER, callback); sendMessageWithoutPayload(BeanMessageID.CC_GET_AR_POWER); }
java
public void readArduinoPowerState(final Callback<Boolean> callback) { addCallback(BeanMessageID.CC_GET_AR_POWER, callback); sendMessageWithoutPayload(BeanMessageID.CC_GET_AR_POWER); }
[ "public", "void", "readArduinoPowerState", "(", "final", "Callback", "<", "Boolean", ">", "callback", ")", "{", "addCallback", "(", "BeanMessageID", ".", "CC_GET_AR_POWER", ",", "callback", ")", ";", "sendMessageWithoutPayload", "(", "BeanMessageID", ".", "CC_GET_AR...
Read the Arduino power state. @param callback the callback for the power state result: true if the Arduino is on
[ "Read", "the", "Arduino", "power", "state", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1066-L1069
38,105
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.readBatteryLevel
public void readBatteryLevel(final Callback<BatteryLevel> callback) { gattClient.getBatteryProfile().getBatteryLevel(new BatteryLevelCallback() { @Override public void onBatteryLevel(int percentage) { callback.onResult(new BatteryLevel(percentage)); } ...
java
public void readBatteryLevel(final Callback<BatteryLevel> callback) { gattClient.getBatteryProfile().getBatteryLevel(new BatteryLevelCallback() { @Override public void onBatteryLevel(int percentage) { callback.onResult(new BatteryLevel(percentage)); } ...
[ "public", "void", "readBatteryLevel", "(", "final", "Callback", "<", "BatteryLevel", ">", "callback", ")", "{", "gattClient", ".", "getBatteryProfile", "(", ")", ".", "getBatteryLevel", "(", "new", "BatteryLevelCallback", "(", ")", "{", "@", "Override", "public"...
Read the battery level. @param callback the callback for the {@link com.punchthrough.bean.sdk.message.BatteryLevel} result
[ "Read", "the", "battery", "level", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1077-L1084
38,106
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java
Bean.programWithFirmware
public OADProfile.OADApproval programWithFirmware(FirmwareBundle bundle, OADProfile.OADListener listener) { return gattClient.getOADProfile().programWithFirmware(bundle, listener); }
java
public OADProfile.OADApproval programWithFirmware(FirmwareBundle bundle, OADProfile.OADListener listener) { return gattClient.getOADProfile().programWithFirmware(bundle, listener); }
[ "public", "OADProfile", ".", "OADApproval", "programWithFirmware", "(", "FirmwareBundle", "bundle", ",", "OADProfile", ".", "OADListener", "listener", ")", "{", "return", "gattClient", ".", "getOADProfile", "(", ")", ".", "programWithFirmware", "(", "bundle", ",", ...
Programs the Bean with new firmware images. @param bundle The firmware package holding A and B images to be sent to the Bean @param listener OADListener to alert the client of OAD state
[ "Programs", "the", "Bean", "with", "new", "firmware", "images", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/Bean.java#L1141-L1143
38,107
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/CacheItem.java
CacheItem.isTargetClassAndCurrentJvmTargetClassMatch
public boolean isTargetClassAndCurrentJvmTargetClassMatch() { Class<?> targetClassOnThisJVM; // JVM에 Class가 없는 상황 try { targetClassOnThisJVM = Class.forName(targetClassName); } catch (ClassNotFoundException e) { log.error("target class " + targetClassName + " doe...
java
public boolean isTargetClassAndCurrentJvmTargetClassMatch() { Class<?> targetClassOnThisJVM; // JVM에 Class가 없는 상황 try { targetClassOnThisJVM = Class.forName(targetClassName); } catch (ClassNotFoundException e) { log.error("target class " + targetClassName + " doe...
[ "public", "boolean", "isTargetClassAndCurrentJvmTargetClassMatch", "(", ")", "{", "Class", "<", "?", ">", "targetClassOnThisJVM", ";", "// JVM에 Class가 없는 상황", "try", "{", "targetClassOnThisJVM", "=", "Class", ".", "forName", "(", "targetClassName", ")", ";", "}", "c...
Compare targetClassSerialVersionUID and current JVM's targetClass serialVersionUID. If they are same return true else return false.
[ "Compare", "targetClassSerialVersionUID", "and", "current", "JVM", "s", "targetClass", "serialVersionUID", ".", "If", "they", "are", "same", "return", "true", "else", "return", "false", "." ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/CacheItem.java#L124-L142
38,108
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/CacheItem.java
CacheItem.checkIfClassVersionApplicable
public static boolean checkIfClassVersionApplicable(Object cacheEntry, boolean useStructuredCache) { if (!useStructuredCache && cacheEntry instanceof CacheEntry) { return true; } if (useStructuredCache && cacheEntry instanceof Map) { return true; } return...
java
public static boolean checkIfClassVersionApplicable(Object cacheEntry, boolean useStructuredCache) { if (!useStructuredCache && cacheEntry instanceof CacheEntry) { return true; } if (useStructuredCache && cacheEntry instanceof Map) { return true; } return...
[ "public", "static", "boolean", "checkIfClassVersionApplicable", "(", "Object", "cacheEntry", ",", "boolean", "useStructuredCache", ")", "{", "if", "(", "!", "useStructuredCache", "&&", "cacheEntry", "instanceof", "CacheEntry", ")", "{", "return", "true", ";", "}", ...
Check if class version comparable.
[ "Check", "if", "class", "version", "comparable", "." ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/CacheItem.java#L148-L157
38,109
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/GattClient.java
GattClient.refreshDeviceCache
private void refreshDeviceCache(BluetoothGatt gatt) { try { BluetoothGatt localBluetoothGatt = gatt; Method localMethod = localBluetoothGatt.getClass().getMethod("refresh", new Class[0]); if (localMethod != null) { localMethod.invoke(localBluetoothGatt, new Ob...
java
private void refreshDeviceCache(BluetoothGatt gatt) { try { BluetoothGatt localBluetoothGatt = gatt; Method localMethod = localBluetoothGatt.getClass().getMethod("refresh", new Class[0]); if (localMethod != null) { localMethod.invoke(localBluetoothGatt, new Ob...
[ "private", "void", "refreshDeviceCache", "(", "BluetoothGatt", "gatt", ")", "{", "try", "{", "BluetoothGatt", "localBluetoothGatt", "=", "gatt", ";", "Method", "localMethod", "=", "localBluetoothGatt", ".", "getClass", "(", ")", ".", "getMethod", "(", "\"refresh\"...
Attempt to invalidate Androids internal GATT table cache http://stackoverflow.com/a/22709467/5640435 @param gatt BluetoothGatt object
[ "Attempt", "to", "invalidate", "Androids", "internal", "GATT", "table", "cache" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/GattClient.java#L92-L105
38,110
kwon37xi/hibernate4-memcached
hibernate4-memcached-spymemcached-adapter/src/main/java/kr/pe/kwonnam/hibernate4memcached/spymemcached/SpyMemcachedAdapter.java
SpyMemcachedAdapter.createConnectionFactoryBuilder
protected ConnectionFactoryBuilder createConnectionFactoryBuilder(OverridableReadOnlyProperties properties) { ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder(); // BINARY Only!!! spymemcached incr/decr correctly supports only BINARY mode. builder.setProtocol(ConnectionFactoryBuil...
java
protected ConnectionFactoryBuilder createConnectionFactoryBuilder(OverridableReadOnlyProperties properties) { ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder(); // BINARY Only!!! spymemcached incr/decr correctly supports only BINARY mode. builder.setProtocol(ConnectionFactoryBuil...
[ "protected", "ConnectionFactoryBuilder", "createConnectionFactoryBuilder", "(", "OverridableReadOnlyProperties", "properties", ")", "{", "ConnectionFactoryBuilder", "builder", "=", "new", "ConnectionFactoryBuilder", "(", ")", ";", "// BINARY Only!!! spymemcached incr/decr correctly s...
creating ConnectionFactoryBuilder object. Override thid method if you need.
[ "creating", "ConnectionFactoryBuilder", "object", ".", "Override", "thid", "method", "if", "you", "need", "." ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-spymemcached-adapter/src/main/java/kr/pe/kwonnam/hibernate4memcached/spymemcached/SpyMemcachedAdapter.java#L71-L91
38,111
kwon37xi/hibernate4-memcached
hibernate4-memcached-spymemcached-adapter/src/main/java/kr/pe/kwonnam/hibernate4memcached/spymemcached/SpyMemcachedAdapter.java
SpyMemcachedAdapter.getNamespacedKey
String getNamespacedKey(CacheNamespace cacheNamespace, String key) { String namespaceIndicator = getNamespaceIndicator(cacheNamespace); if (cacheNamespace.isNamespaceExpirationRequired() == false) { return namespaceIndicator + ":" + key; } String namespaceIndicatorKey = nam...
java
String getNamespacedKey(CacheNamespace cacheNamespace, String key) { String namespaceIndicator = getNamespaceIndicator(cacheNamespace); if (cacheNamespace.isNamespaceExpirationRequired() == false) { return namespaceIndicator + ":" + key; } String namespaceIndicatorKey = nam...
[ "String", "getNamespacedKey", "(", "CacheNamespace", "cacheNamespace", ",", "String", "key", ")", "{", "String", "namespaceIndicator", "=", "getNamespaceIndicator", "(", "cacheNamespace", ")", ";", "if", "(", "cacheNamespace", ".", "isNamespaceExpirationRequired", "(", ...
Return cache namespace decorated key. @param cacheNamespace cache namespace @param key cache key @return namespace infomation prefixed cache key
[ "Return", "cache", "namespace", "decorated", "key", "." ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-spymemcached-adapter/src/main/java/kr/pe/kwonnam/hibernate4memcached/spymemcached/SpyMemcachedAdapter.java#L133-L145
38,112
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/upload/FirmwareImage.java
FirmwareImage.uint16FromData
private int uint16FromData(int offset) { return twoBytesToInt( Arrays.copyOfRange(data(), offset, offset + 2), Constants.CC2540_BYTE_ORDER ); }
java
private int uint16FromData(int offset) { return twoBytesToInt( Arrays.copyOfRange(data(), offset, offset + 2), Constants.CC2540_BYTE_ORDER ); }
[ "private", "int", "uint16FromData", "(", "int", "offset", ")", "{", "return", "twoBytesToInt", "(", "Arrays", ".", "copyOfRange", "(", "data", "(", ")", ",", "offset", ",", "offset", "+", "2", ")", ",", "Constants", ".", "CC2540_BYTE_ORDER", ")", ";", "}...
Parse a little-endian UInt16 from the data at the given offset. @param offset The offset at which to parse data @return The Java int representation of the parsed bytes
[ "Parse", "a", "little", "-", "endian", "UInt16", "from", "the", "data", "at", "the", "given", "offset", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/upload/FirmwareImage.java#L39-L44
38,113
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java
BeanManager.scan
private boolean scan() { if (btAdapter.startLeScan(mCallback)) { mScanning = true; Log.i(TAG, "BLE scan started successfully"); if (mHandler.postDelayed(scanTimeoutCallback, scanTimeout * 1000)) { Log.i(TAG, String.format("Cancelling discovery in %d seconds"...
java
private boolean scan() { if (btAdapter.startLeScan(mCallback)) { mScanning = true; Log.i(TAG, "BLE scan started successfully"); if (mHandler.postDelayed(scanTimeoutCallback, scanTimeout * 1000)) { Log.i(TAG, String.format("Cancelling discovery in %d seconds"...
[ "private", "boolean", "scan", "(", ")", "{", "if", "(", "btAdapter", ".", "startLeScan", "(", "mCallback", ")", ")", "{", "mScanning", "=", "true", ";", "Log", ".", "i", "(", "TAG", ",", "\"BLE scan started successfully\"", ")", ";", "if", "(", "mHandler...
Helper function for starting scan and scheduling the scan timeout @return boolean success flag
[ "Helper", "function", "for", "starting", "scan", "and", "scheduling", "the", "scan", "timeout" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java#L111-L128
38,114
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java
BeanManager.setScanTimeout
public void setScanTimeout(int timeout) { scanTimeout = timeout; Log.i(TAG, String.format("New scan timeout set: %d seconds", scanTimeout)); }
java
public void setScanTimeout(int timeout) { scanTimeout = timeout; Log.i(TAG, String.format("New scan timeout set: %d seconds", scanTimeout)); }
[ "public", "void", "setScanTimeout", "(", "int", "timeout", ")", "{", "scanTimeout", "=", "timeout", ";", "Log", ".", "i", "(", "TAG", ",", "String", ".", "format", "(", "\"New scan timeout set: %d seconds\"", ",", "scanTimeout", ")", ")", ";", "}" ]
Set the desired scan timeout in seconds @param timeout seconds
[ "Set", "the", "desired", "scan", "timeout", "in", "seconds" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java#L135-L138
38,115
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java
BeanManager.startDiscovery
public boolean startDiscovery() { if (mScanning) { Log.e(TAG, "Already discovering"); return true; } if (mListener == null) { throw new NullPointerException("Listener cannot be null"); } return scan(); }
java
public boolean startDiscovery() { if (mScanning) { Log.e(TAG, "Already discovering"); return true; } if (mListener == null) { throw new NullPointerException("Listener cannot be null"); } return scan(); }
[ "public", "boolean", "startDiscovery", "(", ")", "{", "if", "(", "mScanning", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"Already discovering\"", ")", ";", "return", "true", ";", "}", "if", "(", "mListener", "==", "null", ")", "{", "throw", "new", ...
Start discovering nearby Beans using an existing BeanListener. Currently this function is only used by OADProfile to start scanning after the Bean disconnects during the OAD process.
[ "Start", "discovering", "nearby", "Beans", "using", "an", "existing", "BeanListener", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java#L181-L192
38,116
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java
BeanManager.cancelDiscovery
public void cancelDiscovery() { mHandler.removeCallbacks(scanTimeoutCallback); if (mScanning) { Log.i(TAG, "Cancelling discovery process"); BluetoothAdapter.getDefaultAdapter().stopLeScan(mCallback); mScanning = false; boolean success = mHandler.post(new ...
java
public void cancelDiscovery() { mHandler.removeCallbacks(scanTimeoutCallback); if (mScanning) { Log.i(TAG, "Cancelling discovery process"); BluetoothAdapter.getDefaultAdapter().stopLeScan(mCallback); mScanning = false; boolean success = mHandler.post(new ...
[ "public", "void", "cancelDiscovery", "(", ")", "{", "mHandler", ".", "removeCallbacks", "(", "scanTimeoutCallback", ")", ";", "if", "(", "mScanning", ")", "{", "Log", ".", "i", "(", "TAG", ",", "\"Cancelling discovery process\"", ")", ";", "BluetoothAdapter", ...
Cancel a scan currently in progress. If no scan is in progress, this method does nothing.
[ "Cancel", "a", "scan", "currently", "in", "progress", ".", "If", "no", "scan", "is", "in", "progress", "this", "method", "does", "nothing", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/BeanManager.java#L197-L216
38,117
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/Lz4CompressUtils.java
Lz4CompressUtils.decompressSafe
public static byte[] decompressSafe(final byte[] src, int maxDecompressedSize) { if (src == null) { throw new IllegalArgumentException("src must not be null."); } if (maxDecompressedSize <= 0) { throw new IllegalArgumentException("maxDecompressedSize must be larger than ...
java
public static byte[] decompressSafe(final byte[] src, int maxDecompressedSize) { if (src == null) { throw new IllegalArgumentException("src must not be null."); } if (maxDecompressedSize <= 0) { throw new IllegalArgumentException("maxDecompressedSize must be larger than ...
[ "public", "static", "byte", "[", "]", "decompressSafe", "(", "final", "byte", "[", "]", "src", ",", "int", "maxDecompressedSize", ")", "{", "if", "(", "src", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"src must not be null.\"", ...
When the exact decompressed size is unknown. Decompress data size cannot be larger then maxDecompressedSize
[ "When", "the", "exact", "decompressed", "size", "is", "unknown", ".", "Decompress", "data", "size", "cannot", "be", "larger", "then", "maxDecompressedSize" ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/Lz4CompressUtils.java#L32-L44
38,118
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/Lz4CompressUtils.java
Lz4CompressUtils.decompressFast
public static byte[] decompressFast(byte[] src, int srcOffset, int exactDecompressedSize) { if (src == null) { throw new IllegalArgumentException("src must not be null."); } if (srcOffset < 0) { throw new IllegalArgumentException("srcOffset must equal to or larger than 0...
java
public static byte[] decompressFast(byte[] src, int srcOffset, int exactDecompressedSize) { if (src == null) { throw new IllegalArgumentException("src must not be null."); } if (srcOffset < 0) { throw new IllegalArgumentException("srcOffset must equal to or larger than 0...
[ "public", "static", "byte", "[", "]", "decompressFast", "(", "byte", "[", "]", "src", ",", "int", "srcOffset", ",", "int", "exactDecompressedSize", ")", "{", "if", "(", "src", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"src ...
When the exact decompressed size is known, use this method to decompress. It's faster. @see net.jpountz.lz4.LZ4FastDecompressor
[ "When", "the", "exact", "decompressed", "size", "is", "known", "use", "this", "method", "to", "decompress", ".", "It", "s", "faster", "." ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/Lz4CompressUtils.java#L51-L67
38,119
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/upload/SketchHex.java
SketchHex.create
public static SketchHex create(String sketchName, String hexString) throws HexParsingException { if (sketchName.length() > Constants.MAX_SKETCH_NAME_LENGTH) { sketchName = sketchName.substring(0, Constants.MAX_SKETCH_NAME_LENGTH); } List<Line> lines = parseHexStringToLines(hexStrin...
java
public static SketchHex create(String sketchName, String hexString) throws HexParsingException { if (sketchName.length() > Constants.MAX_SKETCH_NAME_LENGTH) { sketchName = sketchName.substring(0, Constants.MAX_SKETCH_NAME_LENGTH); } List<Line> lines = parseHexStringToLines(hexStrin...
[ "public", "static", "SketchHex", "create", "(", "String", "sketchName", ",", "String", "hexString", ")", "throws", "HexParsingException", "{", "if", "(", "sketchName", ".", "length", "(", ")", ">", "Constants", ".", "MAX_SKETCH_NAME_LENGTH", ")", "{", "sketchNam...
Initialize a SketchHex object with a string of Intel Hex data. @param sketchName The name of the sketch. @param hexString The Intel Hex data as a string @return The new SketchHex object @throws com.punchthrough.bean.sdk.internal.exception.HexParsingException if the string data being parsed is not valid Intel Hex
[ "Initialize", "a", "SketchHex", "object", "with", "a", "string", "of", "Intel", "Hex", "data", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/upload/SketchHex.java#L56-L65
38,120
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java
Chunk.bytesFrom
public static <T extends Chunkable> byte[] bytesFrom(T chunkable, int offset, int length) { byte[] data = chunkable.getChunkableData(); if ( offset + length > data.length ) { // Arrays.copyOfRange appends 0s when the array end is exceeded. // Trim length manually to avoid appen...
java
public static <T extends Chunkable> byte[] bytesFrom(T chunkable, int offset, int length) { byte[] data = chunkable.getChunkableData(); if ( offset + length > data.length ) { // Arrays.copyOfRange appends 0s when the array end is exceeded. // Trim length manually to avoid appen...
[ "public", "static", "<", "T", "extends", "Chunkable", ">", "byte", "[", "]", "bytesFrom", "(", "T", "chunkable", ",", "int", "offset", ",", "int", "length", ")", "{", "byte", "[", "]", "data", "=", "chunkable", ".", "getChunkableData", "(", ")", ";", ...
Retrieve a number of raw bytes at an offset. @param offset The byte at which to start, zero-indexed @param length The number of bytes to return. If this is greater than the number of bytes available after <code>offset</code>, it will return all available bytes, truncated at the end. @return The bytes, starting a...
[ "Retrieve", "a", "number", "of", "raw", "bytes", "at", "an", "offset", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java#L30-L43
38,121
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java
Chunk.chunkFrom
public static <T extends Chunkable> byte[] chunkFrom(T chunkable, int chunkLength, int chunkNum) { int start = chunkNum * chunkLength; return bytesFrom(chunkable, start, chunkLength); }
java
public static <T extends Chunkable> byte[] chunkFrom(T chunkable, int chunkLength, int chunkNum) { int start = chunkNum * chunkLength; return bytesFrom(chunkable, start, chunkLength); }
[ "public", "static", "<", "T", "extends", "Chunkable", ">", "byte", "[", "]", "chunkFrom", "(", "T", "chunkable", ",", "int", "chunkLength", ",", "int", "chunkNum", ")", "{", "int", "start", "=", "chunkNum", "*", "chunkLength", ";", "return", "bytesFrom", ...
Retrieve a chunk of raw bytes. Chunks are created by slicing the array at even intervals. The final chunk may be shorter than the other chunks if it's been truncated. @param chunkLength The length of each chunk @param chunkNum The chunk at which to start, zero-indexed @return The chunk (array of by...
[ "Retrieve", "a", "chunk", "of", "raw", "bytes", ".", "Chunks", "are", "created", "by", "slicing", "the", "array", "at", "even", "intervals", ".", "The", "final", "chunk", "may", "be", "shorter", "than", "the", "other", "chunks", "if", "it", "s", "been", ...
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java#L53-L57
38,122
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java
Chunk.chunkCountFrom
public static <T extends Chunkable> int chunkCountFrom(T chunkable, int chunkLength) { byte[] data = chunkable.getChunkableData(); return (int) Math.ceil(data.length * 1.0 / chunkLength); }
java
public static <T extends Chunkable> int chunkCountFrom(T chunkable, int chunkLength) { byte[] data = chunkable.getChunkableData(); return (int) Math.ceil(data.length * 1.0 / chunkLength); }
[ "public", "static", "<", "T", "extends", "Chunkable", ">", "int", "chunkCountFrom", "(", "T", "chunkable", ",", "int", "chunkLength", ")", "{", "byte", "[", "]", "data", "=", "chunkable", ".", "getChunkableData", "(", ")", ";", "return", "(", "int", ")",...
Retrieve the count of chunks for a given chunk length. @param chunkLength The length of each chunk @return The number of chunks generated for a given chunk length
[ "Retrieve", "the", "count", "of", "chunks", "for", "a", "given", "chunk", "length", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java#L65-L68
38,123
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java
Chunk.chunksFrom
public static <T extends Chunkable> List<byte[]> chunksFrom(T chunkable, int chunkLength) { List<byte[]> chunks = new ArrayList<>(); int chunkCount = chunkCountFrom(chunkable, chunkLength); for (int i = 0; i < chunkCount; i++) { byte[] chunk = chunkFrom(chunkable, chunkLength, i); ...
java
public static <T extends Chunkable> List<byte[]> chunksFrom(T chunkable, int chunkLength) { List<byte[]> chunks = new ArrayList<>(); int chunkCount = chunkCountFrom(chunkable, chunkLength); for (int i = 0; i < chunkCount; i++) { byte[] chunk = chunkFrom(chunkable, chunkLength, i); ...
[ "public", "static", "<", "T", "extends", "Chunkable", ">", "List", "<", "byte", "[", "]", ">", "chunksFrom", "(", "T", "chunkable", ",", "int", "chunkLength", ")", "{", "List", "<", "byte", "[", "]", ">", "chunks", "=", "new", "ArrayList", "<>", "(",...
Retrieve all chunks for a given chunk length. The final chunk may be shorter than the other chunks if it's been truncated. @param chunkLength The length of each chunk @return A list of chunks (byte arrays)
[ "Retrieve", "all", "chunks", "for", "a", "given", "chunk", "length", ".", "The", "final", "chunk", "may", "be", "shorter", "than", "the", "other", "chunks", "if", "it", "s", "been", "truncated", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Chunk.java#L77-L88
38,124
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java
Convert.twoBytesToInt
public static int twoBytesToInt(byte[] bytes, ByteOrder order) { if (order == ByteOrder.BIG_ENDIAN) { return bytesToInt(bytes[0], bytes[1]); } else if (order == ByteOrder.LITTLE_ENDIAN) { return bytesToInt(bytes[1], bytes[0]); } else { throw new IllegalArgu...
java
public static int twoBytesToInt(byte[] bytes, ByteOrder order) { if (order == ByteOrder.BIG_ENDIAN) { return bytesToInt(bytes[0], bytes[1]); } else if (order == ByteOrder.LITTLE_ENDIAN) { return bytesToInt(bytes[1], bytes[0]); } else { throw new IllegalArgu...
[ "public", "static", "int", "twoBytesToInt", "(", "byte", "[", "]", "bytes", ",", "ByteOrder", "order", ")", "{", "if", "(", "order", "==", "ByteOrder", ".", "BIG_ENDIAN", ")", "{", "return", "bytesToInt", "(", "bytes", "[", "0", "]", ",", "bytes", "[",...
Convert an array of two unsigned bytes with the given byte order to one signed int. @param bytes The bytes to be parsed @param order The byte order to be used @return An int representing the bytes in the given order
[ "Convert", "an", "array", "of", "two", "unsigned", "bytes", "with", "the", "given", "byte", "order", "to", "one", "signed", "int", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java#L61-L73
38,125
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java
Convert.intArrayToByteArray
public static byte[] intArrayToByteArray(int[] intArray) { byte[] byteArray = new byte[intArray.length]; for (int i = 0; i < intArray.length; i++) { byteArray[i] = intToByte(intArray[i]); } return byteArray; }
java
public static byte[] intArrayToByteArray(int[] intArray) { byte[] byteArray = new byte[intArray.length]; for (int i = 0; i < intArray.length; i++) { byteArray[i] = intToByte(intArray[i]); } return byteArray; }
[ "public", "static", "byte", "[", "]", "intArrayToByteArray", "(", "int", "[", "]", "intArray", ")", "{", "byte", "[", "]", "byteArray", "=", "new", "byte", "[", "intArray", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", ...
Convert an array of ints to an array of unsigned bytes. This is useful when you want to construct a literal array of unsigned bytes with values greater than 127. Only the lowest 8 bits of the int values are used. @param intArray The array of ints to be converted @return The corresponding array of unsigned by...
[ "Convert", "an", "array", "of", "ints", "to", "an", "array", "of", "unsigned", "bytes", ".", "This", "is", "useful", "when", "you", "want", "to", "construct", "a", "literal", "array", "of", "unsigned", "bytes", "with", "values", "greater", "than", "127", ...
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java#L109-L119
38,126
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java
Convert.intToUInt32
public static byte[] intToUInt32(int i, ByteOrder endian) { int truncated = (int) ( (long) i ); return ByteBuffer.allocate(4).order(endian).putInt(truncated).array(); }
java
public static byte[] intToUInt32(int i, ByteOrder endian) { int truncated = (int) ( (long) i ); return ByteBuffer.allocate(4).order(endian).putInt(truncated).array(); }
[ "public", "static", "byte", "[", "]", "intToUInt32", "(", "int", "i", ",", "ByteOrder", "endian", ")", "{", "int", "truncated", "=", "(", "int", ")", "(", "(", "long", ")", "i", ")", ";", "return", "ByteBuffer", ".", "allocate", "(", "4", ")", ".",...
Convert an int to a four-byte array of its representation as an unsigned byte. @param i The int to be converted @param endian The {@link java.nio.ByteOrder} endianness of the desired byte array @return The array of bytes representing the 32-bit unsigned integer
[ "Convert", "an", "int", "to", "a", "four", "-", "byte", "array", "of", "its", "representation", "as", "an", "unsigned", "byte", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/utility/Convert.java#L128-L131
38,127
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/serial/GattSerialMessage.java
GattSerialMessage.fromPayload
public static GattSerialMessage fromPayload(byte[] payload) { Buffer buffer = new Buffer(); byte[] header = new byte[2]; header[0] = (byte) (payload.length & 0xff); header[1] = 0; int crc = computeCRC16(header, 0, header.length); crc = computeCRC16(crc, payload, 0, payloa...
java
public static GattSerialMessage fromPayload(byte[] payload) { Buffer buffer = new Buffer(); byte[] header = new byte[2]; header[0] = (byte) (payload.length & 0xff); header[1] = 0; int crc = computeCRC16(header, 0, header.length); crc = computeCRC16(crc, payload, 0, payloa...
[ "public", "static", "GattSerialMessage", "fromPayload", "(", "byte", "[", "]", "payload", ")", "{", "Buffer", "buffer", "=", "new", "Buffer", "(", ")", ";", "byte", "[", "]", "header", "=", "new", "byte", "[", "2", "]", ";", "header", "[", "0", "]", ...
Create a GattSerialMessage from a byte array payload In this case, "payload" means the properly packed message ID and message payload. Example: For the message CC_LED_WRITE_ALL (0x2001) GattSerialMessage.fromPayload(new byte[] { 0x20, 0x01, <--- Message ID big endian 0x00, 0x00, 0x00, ...
[ "Create", "a", "GattSerialMessage", "from", "a", "byte", "array", "payload" ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/serial/GattSerialMessage.java#L54-L66
38,128
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/IntToBytesUtils.java
IntToBytesUtils.bytesToInt
public static int bytesToInt(byte[] bytes) { int value = ((int) bytes[0] & 0xFF) << 24; value += ((int) bytes[1] & 0xFF) << 16; value += ((int) bytes[2] & 0xFF) << 8; value += (int) bytes[3] & 0xFF; return value; }
java
public static int bytesToInt(byte[] bytes) { int value = ((int) bytes[0] & 0xFF) << 24; value += ((int) bytes[1] & 0xFF) << 16; value += ((int) bytes[2] & 0xFF) << 8; value += (int) bytes[3] & 0xFF; return value; }
[ "public", "static", "int", "bytesToInt", "(", "byte", "[", "]", "bytes", ")", "{", "int", "value", "=", "(", "(", "int", ")", "bytes", "[", "0", "]", "&", "0xFF", ")", "<<", "24", ";", "value", "+=", "(", "(", "int", ")", "bytes", "[", "1", "...
4 bytes array to int
[ "4", "bytes", "array", "to", "int" ]
e0b2839ab257b2602344f54ca53c564044f3585d
https://github.com/kwon37xi/hibernate4-memcached/blob/e0b2839ab257b2602344f54ca53c564044f3585d/hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/util/IntToBytesUtils.java#L20-L26
38,129
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/SendBuffer.java
SendBuffer.send
public void send(byte[] data, int id) { boolean isFirstPacket = (packets.size() == 0); packets.add(data); ids.add(id); if (isFirstPacket) { scheduleSendTask(true); } Log.d(TAG, "Added packet " + id + " to buffer; " + packets.size() + " packets in buffer"); ...
java
public void send(byte[] data, int id) { boolean isFirstPacket = (packets.size() == 0); packets.add(data); ids.add(id); if (isFirstPacket) { scheduleSendTask(true); } Log.d(TAG, "Added packet " + id + " to buffer; " + packets.size() + " packets in buffer"); ...
[ "public", "void", "send", "(", "byte", "[", "]", "data", ",", "int", "id", ")", "{", "boolean", "isFirstPacket", "=", "(", "packets", ".", "size", "(", ")", "==", "0", ")", ";", "packets", ".", "add", "(", "data", ")", ";", "ids", ".", "add", "...
Add a packet to the buffer to be sent. If no other packets are in the buffer, it will be sent immediately. @param data The packet to be sent @param id The ID of the packet to be used in debug messages and callbacks
[ "Add", "a", "packet", "to", "the", "buffer", "to", "be", "sent", ".", "If", "no", "other", "packets", "are", "in", "the", "buffer", "it", "will", "be", "sent", "immediately", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/SendBuffer.java#L49-L57
38,130
PunchThrough/bean-sdk-android
sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/SendBuffer.java
SendBuffer.scheduleSendTask
private void scheduleSendTask(boolean runNow) { TimerTask task = new TimerTask() { @Override public void run() { byte[] packet; try { packet = packets.get(0); } catch (IndexOutOfBoundsException e) { ...
java
private void scheduleSendTask(boolean runNow) { TimerTask task = new TimerTask() { @Override public void run() { byte[] packet; try { packet = packets.get(0); } catch (IndexOutOfBoundsException e) { ...
[ "private", "void", "scheduleSendTask", "(", "boolean", "runNow", ")", "{", "TimerTask", "task", "=", "new", "TimerTask", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "byte", "[", "]", "packet", ";", "try", "{", "packet", "=",...
Schedules the send task to run either immediately or at SEND_INTERVAL. @param runNow true runs the task immediately, false schedules it for SEND_INTERVAL ms from now
[ "Schedules", "the", "send", "task", "to", "run", "either", "immediately", "or", "at", "SEND_INTERVAL", "." ]
dc33e8cc9258d6e028e0788d74735c75b54d1133
https://github.com/PunchThrough/bean-sdk-android/blob/dc33e8cc9258d6e028e0788d74735c75b54d1133/sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/SendBuffer.java#L65-L110
38,131
RestComm/jain-slee.sip
examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java
SipUASExampleSbb.setSbbContext
public void setSbbContext(SbbContext context) { sbbContext = (SbbContextExt) context; sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactory) sbbContext .getActivityContextInterfaceFactory(sipRATypeID); sleeSipProvider = (SleeSipProvider) sbbContext .getResourceAdaptorInterface(sipRAType...
java
public void setSbbContext(SbbContext context) { sbbContext = (SbbContextExt) context; sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactory) sbbContext .getActivityContextInterfaceFactory(sipRATypeID); sleeSipProvider = (SleeSipProvider) sbbContext .getResourceAdaptorInterface(sipRAType...
[ "public", "void", "setSbbContext", "(", "SbbContext", "context", ")", "{", "sbbContext", "=", "(", "SbbContextExt", ")", "context", ";", "sipActivityContextInterfaceFactory", "=", "(", "SipActivityContextInterfaceFactory", ")", "sbbContext", ".", "getActivityContextInterf...
SbbObject lifecycle methods
[ "SbbObject", "lifecycle", "methods" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java#L75-L85
38,132
RestComm/jain-slee.sip
examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java
SipUASExampleSbb.getContactHeader
private ContactHeader getContactHeader() throws ParseException { if (contactHeader == null) { final ListeningPoint listeningPoint = sleeSipProvider .getListeningPoint("udp"); final javax.sip.address.SipURI sipURI = addressFactory .createSipURI(null, listeningPoint.getIPAddress()); sipURI.setPort(li...
java
private ContactHeader getContactHeader() throws ParseException { if (contactHeader == null) { final ListeningPoint listeningPoint = sleeSipProvider .getListeningPoint("udp"); final javax.sip.address.SipURI sipURI = addressFactory .createSipURI(null, listeningPoint.getIPAddress()); sipURI.setPort(li...
[ "private", "ContactHeader", "getContactHeader", "(", ")", "throws", "ParseException", "{", "if", "(", "contactHeader", "==", "null", ")", "{", "final", "ListeningPoint", "listeningPoint", "=", "sleeSipProvider", ".", "getListeningPoint", "(", "\"udp\"", ")", ";", ...
some helper methods to deal with lazy init of static fields
[ "some", "helper", "methods", "to", "deal", "with", "lazy", "init", "of", "static", "fields" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java#L121-L133
38,133
RestComm/jain-slee.sip
examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java
SipUASExampleSbb.onInviteEvent
public void onInviteEvent(javax.sip.RequestEvent requestEvent, ActivityContextInterface aci) { final ServerTransaction serverTransaction = requestEvent .getServerTransaction(); try { // send "trying" response Response response = messageFactory.createResponse(Response.TRYING, requestEvent.getRequ...
java
public void onInviteEvent(javax.sip.RequestEvent requestEvent, ActivityContextInterface aci) { final ServerTransaction serverTransaction = requestEvent .getServerTransaction(); try { // send "trying" response Response response = messageFactory.createResponse(Response.TRYING, requestEvent.getRequ...
[ "public", "void", "onInviteEvent", "(", "javax", ".", "sip", ".", "RequestEvent", "requestEvent", ",", "ActivityContextInterface", "aci", ")", "{", "final", "ServerTransaction", "serverTransaction", "=", "requestEvent", ".", "getServerTransaction", "(", ")", ";", "t...
Event handler method for the invite SIP message. @param requestEvent @param aci
[ "Event", "handler", "method", "for", "the", "invite", "SIP", "message", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java#L169-L197
38,134
RestComm/jain-slee.sip
examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java
SipUASExampleSbb.onTimerEvent
public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) { if (getFinalReplySent()) { aci.detach(sbbContext.getSbbLocalObject()); final DialogActivity dialog = (DialogActivity) aci.getActivity(); try { dialog.sendRequest(dialog.createRequest(Request.BYE)); } catch (Exception e) { ...
java
public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) { if (getFinalReplySent()) { aci.detach(sbbContext.getSbbLocalObject()); final DialogActivity dialog = (DialogActivity) aci.getActivity(); try { dialog.sendRequest(dialog.createRequest(Request.BYE)); } catch (Exception e) { ...
[ "public", "void", "onTimerEvent", "(", "TimerEvent", "event", ",", "ActivityContextInterface", "aci", ")", "{", "if", "(", "getFinalReplySent", "(", ")", ")", "{", "aci", ".", "detach", "(", "sbbContext", ".", "getSbbLocalObject", "(", ")", ")", ";", "final"...
Event handler method for the timer event. @param event @param aci
[ "Event", "handler", "method", "for", "the", "timer", "event", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-uas/sbb/src/main/java/org/mobicents/slee/example/sip/SipUASExampleSbb.java#L205-L246
38,135
RestComm/jain-slee.sip
examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java
SIPRegistrarSbb.getBindingsResult
@Override public void getBindingsResult(int resultCode, List<RegistrationBinding> bindings) { ServerTransaction serverTransaction = getRegisterTransactionToReply(); if (serverTransaction == null) { tracer.warning("failed to find SIP server tx to send response"); return; } try { if (resultCode < 300...
java
@Override public void getBindingsResult(int resultCode, List<RegistrationBinding> bindings) { ServerTransaction serverTransaction = getRegisterTransactionToReply(); if (serverTransaction == null) { tracer.warning("failed to find SIP server tx to send response"); return; } try { if (resultCode < 300...
[ "@", "Override", "public", "void", "getBindingsResult", "(", "int", "resultCode", ",", "List", "<", "RegistrationBinding", ">", "bindings", ")", "{", "ServerTransaction", "serverTransaction", "=", "getRegisterTransactionToReply", "(", ")", ";", "if", "(", "serverTra...
call backs from data source child sbb
[ "call", "backs", "from", "data", "source", "child", "sbb" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java#L371-L389
38,136
RestComm/jain-slee.sip
examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java
SIPRegistrarSbb.cancelTimers
private void cancelTimers( List<org.mobicents.slee.example.sjr.data.RegistrationBinding> removedContacts) { for (RegistrationBinding binding : removedContacts) { ActivityContextInterfaceExt aci = (ActivityContextInterfaceExt) this.activityContextNamingFacility .lookup(getACIName(binding.getContactAddress()...
java
private void cancelTimers( List<org.mobicents.slee.example.sjr.data.RegistrationBinding> removedContacts) { for (RegistrationBinding binding : removedContacts) { ActivityContextInterfaceExt aci = (ActivityContextInterfaceExt) this.activityContextNamingFacility .lookup(getACIName(binding.getContactAddress()...
[ "private", "void", "cancelTimers", "(", "List", "<", "org", ".", "mobicents", ".", "slee", ".", "example", ".", "sjr", ".", "data", ".", "RegistrationBinding", ">", "removedContacts", ")", "{", "for", "(", "RegistrationBinding", "binding", ":", "removedContact...
Simple method to cancel pending timers for contacts that have been removed @param removedContacts
[ "Simple", "method", "to", "cancel", "pending", "timers", "for", "contacts", "that", "have", "been", "removed" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java#L543-L555
38,137
RestComm/jain-slee.sip
examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java
SIPRegistrarSbb.updateTimers
private void updateTimers( List<org.mobicents.slee.example.sjr.data.RegistrationBinding> contacts) { String bindingAciName = null; ActivityContextInterface aci = null; for (RegistrationBinding binding : contacts) { bindingAciName = getACIName(binding.getContactAddress(), binding.getSipAddress()); ac...
java
private void updateTimers( List<org.mobicents.slee.example.sjr.data.RegistrationBinding> contacts) { String bindingAciName = null; ActivityContextInterface aci = null; for (RegistrationBinding binding : contacts) { bindingAciName = getACIName(binding.getContactAddress(), binding.getSipAddress()); ac...
[ "private", "void", "updateTimers", "(", "List", "<", "org", ".", "mobicents", ".", "slee", ".", "example", ".", "sjr", ".", "data", ".", "RegistrationBinding", ">", "contacts", ")", "{", "String", "bindingAciName", "=", "null", ";", "ActivityContextInterface",...
Simple method to update timers for passed contacts. If timer exists, it will be reset to new timeout. If it does not exist, it will be create along with NullActivity. @param contacts
[ "Simple", "method", "to", "update", "timers", "for", "passed", "contacts", ".", "If", "timer", "exists", "it", "will", "be", "reset", "to", "new", "timeout", ".", "If", "it", "does", "not", "exist", "it", "will", "be", "create", "along", "with", "NullAct...
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/sip/SIPRegistrarSbb.java#L564-L607
38,138
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java
SipResourceAdaptor.getDialogWrapper
public DialogWrapper getDialogWrapper(Dialog d) { if (d == null) { return null; } DialogWrapper dw = null; DialogWrapperAppData dwad = (DialogWrapperAppData) d.getApplicationData(); if (dwad != null) { dw = dwad.getDialogWrapper(d, this); } return dw; }
java
public DialogWrapper getDialogWrapper(Dialog d) { if (d == null) { return null; } DialogWrapper dw = null; DialogWrapperAppData dwad = (DialogWrapperAppData) d.getApplicationData(); if (dwad != null) { dw = dwad.getDialogWrapper(d, this); } return dw; }
[ "public", "DialogWrapper", "getDialogWrapper", "(", "Dialog", "d", ")", "{", "if", "(", "d", "==", "null", ")", "{", "return", "null", ";", "}", "DialogWrapper", "dw", "=", "null", ";", "DialogWrapperAppData", "dwad", "=", "(", "DialogWrapperAppData", ")", ...
Retrieves the wrapper associated with a dialog, recreating if needed in a cluster env. @param d @return
[ "Retrieves", "the", "wrapper", "associated", "with", "a", "dialog", "recreating", "if", "needed", "in", "a", "cluster", "env", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java#L393-L403
38,139
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java
SipResourceAdaptor.getTransactionWrapper
public TransactionWrapper getTransactionWrapper(Transaction t) { if (t == null) { return null; } final TransactionWrapperAppData twad = (TransactionWrapperAppData) t.getApplicationData(); return twad != null ? twad.getTransactionWrapper(t, this) : null; }
java
public TransactionWrapper getTransactionWrapper(Transaction t) { if (t == null) { return null; } final TransactionWrapperAppData twad = (TransactionWrapperAppData) t.getApplicationData(); return twad != null ? twad.getTransactionWrapper(t, this) : null; }
[ "public", "TransactionWrapper", "getTransactionWrapper", "(", "Transaction", "t", ")", "{", "if", "(", "t", "==", "null", ")", "{", "return", "null", ";", "}", "final", "TransactionWrapperAppData", "twad", "=", "(", "TransactionWrapperAppData", ")", "t", ".", ...
Retrieves the wrapper associated with a tx, recreating if needed in a cluster env. @param t @return
[ "Retrieves", "the", "wrapper", "associated", "with", "a", "tx", "recreating", "if", "needed", "in", "a", "cluster", "env", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SipResourceAdaptor.java#L410-L416
38,140
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java
Utils.getRouteList
public static List<RouteHeader> getRouteList(Response response, HeaderFactory headerFactory) throws ParseException { // we have record route set, as we are client, this is reversed final ArrayList<RouteHeader> routeList = new ArrayList<RouteHeader>(); final ListIterator<?> rrLit = response.getHeaders(RecordRouteH...
java
public static List<RouteHeader> getRouteList(Response response, HeaderFactory headerFactory) throws ParseException { // we have record route set, as we are client, this is reversed final ArrayList<RouteHeader> routeList = new ArrayList<RouteHeader>(); final ListIterator<?> rrLit = response.getHeaders(RecordRouteH...
[ "public", "static", "List", "<", "RouteHeader", ">", "getRouteList", "(", "Response", "response", ",", "HeaderFactory", "headerFactory", ")", "throws", "ParseException", "{", "// we have record route set, as we are client, this is reversed", "final", "ArrayList", "<", "Rout...
Generates route list the same way dialog does. @param response @return @throws ParseException
[ "Generates", "route", "list", "the", "same", "way", "dialog", "does", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java#L119-L134
38,141
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java
Utils.getRequestUri
public static URI getRequestUri(Response response, AddressFactory addressFactory) throws ParseException { final ContactHeader contact = ((ContactHeader) response.getHeader(ContactHeader.NAME)); return (contact != null) ? (URI) contact.getAddress().getURI().clone() : null; }
java
public static URI getRequestUri(Response response, AddressFactory addressFactory) throws ParseException { final ContactHeader contact = ((ContactHeader) response.getHeader(ContactHeader.NAME)); return (contact != null) ? (URI) contact.getAddress().getURI().clone() : null; }
[ "public", "static", "URI", "getRequestUri", "(", "Response", "response", ",", "AddressFactory", "addressFactory", ")", "throws", "ParseException", "{", "final", "ContactHeader", "contact", "=", "(", "(", "ContactHeader", ")", "response", ".", "getHeader", "(", "Co...
Forges Request-URI using contact and To name par to address URI, this is required on dialog fork, this is how target is determined @param response @return @throws ParseException
[ "Forges", "Request", "-", "URI", "using", "contact", "and", "To", "name", "par", "to", "address", "URI", "this", "is", "required", "on", "dialog", "fork", "this", "is", "how", "target", "is", "determined" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/Utils.java#L144-L147
38,142
RestComm/jain-slee.sip
examples/sip-wake-up/sbb/src/main/java/org/mobicents/slee/examples/wakeup/WakeUpSbb.java
WakeUpSbb.onMessageEvent
public void onMessageEvent(javax.sip.RequestEvent event, ActivityContextInterface aci) { final Request request = event.getRequest(); try { // message body should be *FIRST_TOKEN<timer value in // seconds>MIDDLE_TOKEN<msg to send back to UA>LAST_TOKEN* final String body = new String(request.getRawConten...
java
public void onMessageEvent(javax.sip.RequestEvent event, ActivityContextInterface aci) { final Request request = event.getRequest(); try { // message body should be *FIRST_TOKEN<timer value in // seconds>MIDDLE_TOKEN<msg to send back to UA>LAST_TOKEN* final String body = new String(request.getRawConten...
[ "public", "void", "onMessageEvent", "(", "javax", ".", "sip", ".", "RequestEvent", "event", ",", "ActivityContextInterface", "aci", ")", "{", "final", "Request", "request", "=", "event", ".", "getRequest", "(", ")", ";", "try", "{", "// message body should be *F...
Event handler for the SIP MESSAGE from the UA @param event @param aci
[ "Event", "handler", "for", "the", "SIP", "MESSAGE", "from", "the", "UA" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-wake-up/sbb/src/main/java/org/mobicents/slee/examples/wakeup/WakeUpSbb.java#L236-L301
38,143
RestComm/jain-slee.sip
examples/sip-wake-up/sbb/src/main/java/org/mobicents/slee/examples/wakeup/WakeUpSbb.java
WakeUpSbb.onTimerEvent
public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) { // detaching so the null AC is claimed after the event handling aci.detach(sbbContext.getSbbLocalObject()); try { DataSourceChildSbbLocalInterface child = (DataSourceChildSbbLocalInterface) getLocationChildRelation().create(); child....
java
public void onTimerEvent(TimerEvent event, ActivityContextInterface aci) { // detaching so the null AC is claimed after the event handling aci.detach(sbbContext.getSbbLocalObject()); try { DataSourceChildSbbLocalInterface child = (DataSourceChildSbbLocalInterface) getLocationChildRelation().create(); child....
[ "public", "void", "onTimerEvent", "(", "TimerEvent", "event", ",", "ActivityContextInterface", "aci", ")", "{", "// detaching so the null AC is claimed after the event handling", "aci", ".", "detach", "(", "sbbContext", ".", "getSbbLocalObject", "(", ")", ")", ";", "try...
Event handler from the timer event, which signals that a message must be sent back to the UA @param event @param aci
[ "Event", "handler", "from", "the", "timer", "event", "which", "signals", "that", "a", "message", "must", "be", "sent", "back", "to", "the", "UA" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-wake-up/sbb/src/main/java/org/mobicents/slee/examples/wakeup/WakeUpSbb.java#L310-L320
38,144
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDFilter.java
EventIDFilter.serviceActive
public void serviceActive(ReceivableService receivableService) { for (ReceivableEvent receivableEvent : receivableService.getReceivableEvents()) { Set<ServiceID> servicesReceivingEvent = eventID2serviceIDs.get(receivableEvent.getEventType()); if (servicesReceivingEvent == null) { servicesReceivingEvent = ne...
java
public void serviceActive(ReceivableService receivableService) { for (ReceivableEvent receivableEvent : receivableService.getReceivableEvents()) { Set<ServiceID> servicesReceivingEvent = eventID2serviceIDs.get(receivableEvent.getEventType()); if (servicesReceivingEvent == null) { servicesReceivingEvent = ne...
[ "public", "void", "serviceActive", "(", "ReceivableService", "receivableService", ")", "{", "for", "(", "ReceivableEvent", "receivableEvent", ":", "receivableService", ".", "getReceivableEvents", "(", ")", ")", "{", "Set", "<", "ServiceID", ">", "servicesReceivingEven...
Informs the filter that a receivable service is now active. For the events related with the service, and if there are no other services bound, then events of such event type should now not be filtered. @param receivableService
[ "Informs", "the", "filter", "that", "a", "receivable", "service", "is", "now", "active", ".", "For", "the", "events", "related", "with", "the", "service", "and", "if", "there", "are", "no", "other", "services", "bound", "then", "events", "of", "such", "eve...
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDFilter.java#L59-L73
38,145
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDFilter.java
EventIDFilter.serviceInactive
public void serviceInactive(ReceivableService receivableService) { for (ReceivableEvent receivableEvent : receivableService.getReceivableEvents()) { Set<ServiceID> servicesReceivingEvent = eventID2serviceIDs.get(receivableEvent.getEventType()); if (servicesReceivingEvent != null) { synchronized (servicesRec...
java
public void serviceInactive(ReceivableService receivableService) { for (ReceivableEvent receivableEvent : receivableService.getReceivableEvents()) { Set<ServiceID> servicesReceivingEvent = eventID2serviceIDs.get(receivableEvent.getEventType()); if (servicesReceivingEvent != null) { synchronized (servicesRec...
[ "public", "void", "serviceInactive", "(", "ReceivableService", "receivableService", ")", "{", "for", "(", "ReceivableEvent", "receivableEvent", ":", "receivableService", ".", "getReceivableEvents", "(", ")", ")", "{", "Set", "<", "ServiceID", ">", "servicesReceivingEv...
Informs the filter that a receivable service is now inactive. For the events related with the service, if there are no other services bound, then events of such event type should be filtered @param receivableService
[ "Informs", "the", "filter", "that", "a", "receivable", "service", "is", "now", "inactive", ".", "For", "the", "events", "related", "with", "the", "service", "if", "there", "are", "no", "other", "services", "bound", "then", "events", "of", "such", "event", ...
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDFilter.java#L82-L94
38,146
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDCache.java
EventIDCache.getEventId
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Request request, boolean inDialogActivity) { final String requestMethod = request.getMethod(); // Cancel is always the same. if (requestMethod.equals(Request.CANCEL)) inDialogActivity = false; FireableEventType eventID = nul...
java
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Request request, boolean inDialogActivity) { final String requestMethod = request.getMethod(); // Cancel is always the same. if (requestMethod.equals(Request.CANCEL)) inDialogActivity = false; FireableEventType eventID = nul...
[ "public", "FireableEventType", "getEventId", "(", "EventLookupFacility", "eventLookupFacility", ",", "Request", "request", ",", "boolean", "inDialogActivity", ")", "{", "final", "String", "requestMethod", "=", "request", ".", "getMethod", "(", ")", ";", "// Cancel is ...
Retrieves the event id for a SIP Request event. @param eventLookupFacility @param request @param inDialogActivity if the event occurred in a dialog activity or not @return
[ "Retrieves", "the", "event", "id", "for", "a", "SIP", "Request", "event", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDCache.java#L73-L99
38,147
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDCache.java
EventIDCache.getEventId
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Response response) { String statusCodeName = null; final int responseStatus = response.getStatusCode(); if (responseStatus == 100) { statusCodeName = "TRYING"; } else if (100 < responseStatus && responseStatus < 200) { status...
java
public FireableEventType getEventId(EventLookupFacility eventLookupFacility, Response response) { String statusCodeName = null; final int responseStatus = response.getStatusCode(); if (responseStatus == 100) { statusCodeName = "TRYING"; } else if (100 < responseStatus && responseStatus < 200) { status...
[ "public", "FireableEventType", "getEventId", "(", "EventLookupFacility", "eventLookupFacility", ",", "Response", "response", ")", "{", "String", "statusCodeName", "=", "null", ";", "final", "int", "responseStatus", "=", "response", ".", "getStatusCode", "(", ")", ";...
Retrieves the event id for a SIP Response event. @param eventLookupFacility @param response @return
[ "Retrieves", "the", "event", "id", "for", "a", "SIP", "Response", "event", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/EventIDCache.java#L108-L131
38,148
RestComm/jain-slee.sip
examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/data/jdbc/DataSourceChildSbb.java
DataSourceChildSbb.executeTask
private void executeTask(DataSourceJdbcTask jdbcTask) { JdbcActivity jdbcActivity = jdbcRA.createActivity(); ActivityContextInterface jdbcACI = jdbcACIF .getActivityContextInterface(jdbcActivity); jdbcACI.attach(sbbContextExt.getSbbLocalObject()); jdbcActivity.execute(jdbcTask); }
java
private void executeTask(DataSourceJdbcTask jdbcTask) { JdbcActivity jdbcActivity = jdbcRA.createActivity(); ActivityContextInterface jdbcACI = jdbcACIF .getActivityContextInterface(jdbcActivity); jdbcACI.attach(sbbContextExt.getSbbLocalObject()); jdbcActivity.execute(jdbcTask); }
[ "private", "void", "executeTask", "(", "DataSourceJdbcTask", "jdbcTask", ")", "{", "JdbcActivity", "jdbcActivity", "=", "jdbcRA", ".", "createActivity", "(", ")", ";", "ActivityContextInterface", "jdbcACI", "=", "jdbcACIF", ".", "getActivityContextInterface", "(", "jd...
Simple method to create JDBC activity and execute given task. @param queryJDBCTask
[ "Simple", "method", "to", "create", "JDBC", "activity", "and", "execute", "given", "task", "." ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/examples/sip-jdbc-registrar/sbb/src/main/java/org/mobicents/slee/example/sjr/data/jdbc/DataSourceChildSbb.java#L122-L128
38,149
derari/cthul
matchers/src/main/java/org/cthul/proc/ProcBase.java
ProcBase.args
protected final void args(Object... args) { if (args == null) args = NO_ARGS; this.args = args; retry(); }
java
protected final void args(Object... args) { if (args == null) args = NO_ARGS; this.args = args; retry(); }
[ "protected", "final", "void", "args", "(", "Object", "...", "args", ")", "{", "if", "(", "args", "==", "null", ")", "args", "=", "NO_ARGS", ";", "this", ".", "args", "=", "args", ";", "retry", "(", ")", ";", "}" ]
Sets the arguments, for internal use only. @param args
[ "Sets", "the", "arguments", "for", "internal", "use", "only", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/proc/ProcBase.java#L60-L64
38,150
derari/cthul
matchers/src/main/java/org/cthul/proc/ProcBase.java
ProcBase.ensureIsRun
private synchronized void ensureIsRun() { if (!isRun) { isRun = true; try { result = executeProc(args); exception = null; } catch (ProcError e) { throw e.asRuntimeException(); } catch (Throwable t) { ...
java
private synchronized void ensureIsRun() { if (!isRun) { isRun = true; try { result = executeProc(args); exception = null; } catch (ProcError e) { throw e.asRuntimeException(); } catch (Throwable t) { ...
[ "private", "synchronized", "void", "ensureIsRun", "(", ")", "{", "if", "(", "!", "isRun", ")", "{", "isRun", "=", "true", ";", "try", "{", "result", "=", "executeProc", "(", "args", ")", ";", "exception", "=", "null", ";", "}", "catch", "(", "ProcErr...
Execute the proc if not done so already.
[ "Execute", "the", "proc", "if", "not", "done", "so", "already", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/proc/ProcBase.java#L127-L140
38,151
derari/cthul
matchers/src/main/java/org/cthul/proc/ProcBase.java
ProcBase.describeArgsTo
protected int describeArgsTo(Description description) { for (int i = 0; i < args.length; i++) { if (i > 0) description.appendText(", "); description.appendValue(args[i]); } return args.length; }
java
protected int describeArgsTo(Description description) { for (int i = 0; i < args.length; i++) { if (i > 0) description.appendText(", "); description.appendValue(args[i]); } return args.length; }
[ "protected", "int", "describeArgsTo", "(", "Description", "description", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "args", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "description", ".", "appendText", "(...
Describes the arguments that are used for execution this asProc. @param description
[ "Describes", "the", "arguments", "that", "are", "used", "for", "execution", "this", "asProc", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/proc/ProcBase.java#L263-L269
38,152
derari/cthul
strings/src/main/java/org/cthul/strings/AlphaIndex.java
AlphaIndex.fromAlpha1
public static long fromAlpha1(String s) { s = s.trim(); if (s.isEmpty()) return 0; return fromAlpha(s) + 1; }
java
public static long fromAlpha1(String s) { s = s.trim(); if (s.isEmpty()) return 0; return fromAlpha(s) + 1; }
[ "public", "static", "long", "fromAlpha1", "(", "String", "s", ")", "{", "s", "=", "s", ".", "trim", "(", ")", ";", "if", "(", "s", ".", "isEmpty", "(", ")", ")", "return", "0", ";", "return", "fromAlpha", "(", "s", ")", "+", "1", ";", "}" ]
Parses a one-based alpha-index. An empty string will be parsed as zero. @see #fromAlpha(java.lang.String)
[ "Parses", "a", "one", "-", "based", "alpha", "-", "index", ".", "An", "empty", "string", "will", "be", "parsed", "as", "zero", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/AlphaIndex.java#L123-L127
38,153
derari/cthul
matchers/src/main/java/org/cthul/proc/P4.java
P4.run
protected Object run(A a, B b, C c, D d) throws Throwable { throw notImplemented("run(A, B, C, D)"); }
java
protected Object run(A a, B b, C c, D d) throws Throwable { throw notImplemented("run(A, B, C, D)"); }
[ "protected", "Object", "run", "(", "A", "a", ",", "B", "b", ",", "C", "c", ",", "D", "d", ")", "throws", "Throwable", "{", "throw", "notImplemented", "(", "\"run(A, B, C, D)\"", ")", ";", "}" ]
Executes the proc. @param a @param b @param c @param d @return result @throws Throwable
[ "Executes", "the", "proc", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/proc/P4.java#L54-L56
38,154
derari/cthul
objects/src/main/java/org/cthul/objects/Boxing.java
Boxing.boxAllAs
public static <T> T boxAllAs(Object src, Class<T> type) { return (T) boxAll(type, src, 0, -1); }
java
public static <T> T boxAllAs(Object src, Class<T> type) { return (T) boxAll(type, src, 0, -1); }
[ "public", "static", "<", "T", ">", "T", "boxAllAs", "(", "Object", "src", ",", "Class", "<", "T", ">", "type", ")", "{", "return", "(", "T", ")", "boxAll", "(", "type", ",", "src", ",", "0", ",", "-", "1", ")", ";", "}" ]
Transforms any array into an array of boxed values. @param <T> @param type target type @param src source array @return array
[ "Transforms", "any", "array", "into", "an", "array", "of", "boxed", "values", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Boxing.java#L491-L493
38,155
derari/cthul
log-cal10n/src/main/java/org/cthul/log/util/CLocMessageConveyor.java
CLocMessageConveyor.getMessage
@Override public <E extends Enum<?>> String getMessage(E key, Object... args) throws MessageConveyorException { String declararingClassName = key.getDeclaringClass().getName(); CAL10NResourceBundle rb = cache.get(declararingClassName); if (rb ==...
java
@Override public <E extends Enum<?>> String getMessage(E key, Object... args) throws MessageConveyorException { String declararingClassName = key.getDeclaringClass().getName(); CAL10NResourceBundle rb = cache.get(declararingClassName); if (rb ==...
[ "@", "Override", "public", "<", "E", "extends", "Enum", "<", "?", ">", ">", "String", "getMessage", "(", "E", "key", ",", "Object", "...", "args", ")", "throws", "MessageConveyorException", "{", "String", "declararingClassName", "=", "key", ".", "getDeclarin...
Given an enum as key, find the corresponding resource bundle and return the corresponding internationalized. <p> The name of the resource bundle is defined via the {@link BaseName} annotation whereas the locale is specified in this MessageConveyor instance's constructor. @param key an enum instance used as message ke...
[ "Given", "an", "enum", "as", "key", "find", "the", "corresponding", "resource", "bundle", "and", "return", "the", "corresponding", "internationalized", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/log-cal10n/src/main/java/org/cthul/log/util/CLocMessageConveyor.java#L85-L107
38,156
derari/cthul
parser/src/main/java/org/cthul/parser/util/IntMap.java
IntMap.findHighestKey
public int findHighestKey(int max) { int highest = Integer.MIN_VALUE; int index = index(hash(max)); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (!slotIsFree(index)) { int k = keys[index]; if (k == max) return max; ...
java
public int findHighestKey(int max) { int highest = Integer.MIN_VALUE; int index = index(hash(max)); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (!slotIsFree(index)) { int k = keys[index]; if (k == max) return max; ...
[ "public", "int", "findHighestKey", "(", "int", "max", ")", "{", "int", "highest", "=", "Integer", ".", "MIN_VALUE", ";", "int", "index", "=", "index", "(", "hash", "(", "max", ")", ")", ";", "final", "int", "maxTry", "=", "capacity", ";", "for", "(",...
Finds the highest key LE `max`, for which there is a value.
[ "Finds", "the", "highest", "key", "LE", "max", "for", "which", "there", "is", "a", "value", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/parser/src/main/java/org/cthul/parser/util/IntMap.java#L76-L89
38,157
derari/cthul
parser/src/main/java/org/cthul/parser/util/IntMap.java
IntMap.findLowestKey
public int findLowestKey(int min) { int lowest = Integer.MAX_VALUE; int index = index(hash(min)); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (!slotIsFree(index)) { int k = keys[index]; if (k == min) return min; ...
java
public int findLowestKey(int min) { int lowest = Integer.MAX_VALUE; int index = index(hash(min)); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (!slotIsFree(index)) { int k = keys[index]; if (k == min) return min; ...
[ "public", "int", "findLowestKey", "(", "int", "min", ")", "{", "int", "lowest", "=", "Integer", ".", "MAX_VALUE", ";", "int", "index", "=", "index", "(", "hash", "(", "min", ")", ")", ";", "final", "int", "maxTry", "=", "capacity", ";", "for", "(", ...
Finds the highest key GE `min`, for which there is a value.
[ "Finds", "the", "highest", "key", "GE", "min", "for", "which", "there", "is", "a", "value", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/parser/src/main/java/org/cthul/parser/util/IntMap.java#L95-L108
38,158
derari/cthul
parser/src/main/java/org/cthul/parser/util/IntMap.java
IntMap.find
private int find(int key, int hash) { int index = index(hash); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { Object slot = values[index]; if (slot == null) return -1; if (slot != GUARD) return keys[index] == key ? index : -1; ...
java
private int find(int key, int hash) { int index = index(hash); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { Object slot = values[index]; if (slot == null) return -1; if (slot != GUARD) return keys[index] == key ? index : -1; ...
[ "private", "int", "find", "(", "int", "key", ",", "int", "hash", ")", "{", "int", "index", "=", "index", "(", "hash", ")", ";", "final", "int", "maxTry", "=", "capacity", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "maxTry", ";", "i",...
Finds the slot of an existing value for `key`;
[ "Finds", "the", "slot", "of", "an", "existing", "value", "for", "key", ";" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/parser/src/main/java/org/cthul/parser/util/IntMap.java#L134-L144
38,159
derari/cthul
parser/src/main/java/org/cthul/parser/util/IntMap.java
IntMap.findInsertIndex
private int findInsertIndex(int key, int hash) { int index = index(hash); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (slotIsFree(index)) return index; index = nextIndex(index); } throw new IllegalStateException("Free slots ex...
java
private int findInsertIndex(int key, int hash) { int index = index(hash); final int maxTry = capacity; for (int i = 0; i < maxTry; i++) { if (slotIsFree(index)) return index; index = nextIndex(index); } throw new IllegalStateException("Free slots ex...
[ "private", "int", "findInsertIndex", "(", "int", "key", ",", "int", "hash", ")", "{", "int", "index", "=", "index", "(", "hash", ")", ";", "final", "int", "maxTry", "=", "capacity", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "maxTry", ...
Find slot to inser key-value
[ "Find", "slot", "to", "inser", "key", "-", "value" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/parser/src/main/java/org/cthul/parser/util/IntMap.java#L149-L157
38,160
derari/cthul
xml/src/main/java/org/cthul/resolve/UriMappingResolver.java
UriMappingResolver.addResource
public UriMappingResolver addResource(String uri, String resource) { uriMap.put(uri, resource); return this; }
java
public UriMappingResolver addResource(String uri, String resource) { uriMap.put(uri, resource); return this; }
[ "public", "UriMappingResolver", "addResource", "(", "String", "uri", ",", "String", "resource", ")", "{", "uriMap", ".", "put", "(", "uri", ",", "resource", ")", ";", "return", "this", ";", "}" ]
Adds a single resource that can be looked-up by its uri. @param uri @param resource @return this
[ "Adds", "a", "single", "resource", "that", "can", "be", "looked", "-", "up", "by", "its", "uri", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/UriMappingResolver.java#L86-L89
38,161
derari/cthul
xml/src/main/java/org/cthul/resolve/UriMappingResolver.java
UriMappingResolver.getMappingString
protected String getMappingString() { StringBuilder sb = new StringBuilder(); final int schemaSize = uriMap.size(); final int domainSize = patternMap.size(); int s = 0, d = 0; for (String schema: uriMap.keySet()) { if (s > 0) sb.append(", "); sb.app...
java
protected String getMappingString() { StringBuilder sb = new StringBuilder(); final int schemaSize = uriMap.size(); final int domainSize = patternMap.size(); int s = 0, d = 0; for (String schema: uriMap.keySet()) { if (s > 0) sb.append(", "); sb.app...
[ "protected", "String", "getMappingString", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "final", "int", "schemaSize", "=", "uriMap", ".", "size", "(", ")", ";", "final", "int", "domainSize", "=", "patternMap", ".", "siz...
string representation for debugging purposes
[ "string", "representation", "for", "debugging", "purposes" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/UriMappingResolver.java#L314-L343
38,162
derari/cthul
xml/src/main/java/org/cthul/resolve/RResult.java
RResult.expandSystemId
protected String expandSystemId(String baseId, String systemId) { return getRequest().expandSystemId(baseId, systemId); }
java
protected String expandSystemId(String baseId, String systemId) { return getRequest().expandSystemId(baseId, systemId); }
[ "protected", "String", "expandSystemId", "(", "String", "baseId", ",", "String", "systemId", ")", "{", "return", "getRequest", "(", ")", ".", "expandSystemId", "(", "baseId", ",", "systemId", ")", ";", "}" ]
Calculates the resource location. @param baseId @param systemId @return schema file path
[ "Calculates", "the", "resource", "location", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/RResult.java#L169-L171
38,163
derari/cthul
strings/src/main/java/org/cthul/strings/RegEx.java
RegEx.quoteSingle
private static int quoteSingle(final StringBuilder sb, final String string, final int start) { int i = start+1; if (needsBlockQuoting(string.charAt(start))) return -i; int unquoteLen = 0; int quotedMap = 1; for (int j = 1; i < string.length(); i++, j++) { char c...
java
private static int quoteSingle(final StringBuilder sb, final String string, final int start) { int i = start+1; if (needsBlockQuoting(string.charAt(start))) return -i; int unquoteLen = 0; int quotedMap = 1; for (int j = 1; i < string.length(); i++, j++) { char c...
[ "private", "static", "int", "quoteSingle", "(", "final", "StringBuilder", "sb", ",", "final", "String", "string", ",", "final", "int", "start", ")", "{", "int", "i", "=", "start", "+", "1", ";", "if", "(", "needsBlockQuoting", "(", "string", ".", "charAt...
Tries to quote each character with a backslash.
[ "Tries", "to", "quote", "each", "character", "with", "a", "backslash", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/RegEx.java#L67-L90
38,164
derari/cthul
matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java
Nested.useParentheses
public static boolean useParentheses(int pSelf, int pNested) { if (pSelf == PrecedencedSelfDescribing.P_NONE || pSelf == PrecedencedSelfDescribing.P_UNARY_NO_PAREN) { return false; } if (pNested < PrecedencedSelfDescribing.P_UNARY) { return pNested <...
java
public static boolean useParentheses(int pSelf, int pNested) { if (pSelf == PrecedencedSelfDescribing.P_NONE || pSelf == PrecedencedSelfDescribing.P_UNARY_NO_PAREN) { return false; } if (pNested < PrecedencedSelfDescribing.P_UNARY) { return pNested <...
[ "public", "static", "boolean", "useParentheses", "(", "int", "pSelf", ",", "int", "pNested", ")", "{", "if", "(", "pSelf", "==", "PrecedencedSelfDescribing", ".", "P_NONE", "||", "pSelf", "==", "PrecedencedSelfDescribing", ".", "P_UNARY_NO_PAREN", ")", "{", "ret...
Compares own precedence against nested and return @param pSelf @param pNested @return true iff parentheses should be used
[ "Compares", "own", "precedence", "against", "nested", "and", "return" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/nested/Nested.java#L133-L143
38,165
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/JavaSignatureComparator.java
JavaSignatureComparator.compareParameter
private int compareParameter(Class<?> a, Class<?> b) { final int a_preferred = -1; if (a.equals(b)) { return 0; } else if (b.isAssignableFrom(a)) { // a is more specific return a_preferred; } else if (a.isAssignableFrom(b)) { // b is more...
java
private int compareParameter(Class<?> a, Class<?> b) { final int a_preferred = -1; if (a.equals(b)) { return 0; } else if (b.isAssignableFrom(a)) { // a is more specific return a_preferred; } else if (a.isAssignableFrom(b)) { // b is more...
[ "private", "int", "compareParameter", "(", "Class", "<", "?", ">", "a", ",", "Class", "<", "?", ">", "b", ")", "{", "final", "int", "a_preferred", "=", "-", "1", ";", "if", "(", "a", ".", "equals", "(", "b", ")", ")", "{", "return", "0", ";", ...
Compares two parameter types. @param a @param b @return
[ "Compares", "two", "parameter", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/JavaSignatureComparator.java#L102-L115
38,166
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/JavaSignatureComparator.java
JavaSignatureComparator.applicability
public int applicability(final Class<?>[] paramTypes, boolean varArgs) { if (argTypes == null) { return MATCH_WILDCARD; } int level = MATCH; final int fixArgs = paramTypes.length - (varArgs ? 1 : 0); if (fixArgs > argTypes.length || (!varArgs && fixAr...
java
public int applicability(final Class<?>[] paramTypes, boolean varArgs) { if (argTypes == null) { return MATCH_WILDCARD; } int level = MATCH; final int fixArgs = paramTypes.length - (varArgs ? 1 : 0); if (fixArgs > argTypes.length || (!varArgs && fixAr...
[ "public", "int", "applicability", "(", "final", "Class", "<", "?", ">", "[", "]", "paramTypes", ",", "boolean", "varArgs", ")", "{", "if", "(", "argTypes", "==", "null", ")", "{", "return", "MATCH_WILDCARD", ";", "}", "int", "level", "=", "MATCH", ";",...
Returns the applicabilty of a signature. A signature with higher applicability is always preferred, even if the other is more specific. @param paramTypes @param varArgs @return applicability level
[ "Returns", "the", "applicabilty", "of", "a", "signature", ".", "A", "signature", "with", "higher", "applicability", "is", "always", "preferred", "even", "if", "the", "other", "is", "more", "specific", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/JavaSignatureComparator.java#L124-L158
38,167
derari/cthul
strings/src/main/java/org/cthul/strings/Romans.java
Romans.maxLetterValue
public static int maxLetterValue(final int numberOfLetters) { int v = 1; for (int i = 1; i < numberOfLetters; i++) { v *= i%2==0 ? 2 : 5; } return v; }
java
public static int maxLetterValue(final int numberOfLetters) { int v = 1; for (int i = 1; i < numberOfLetters; i++) { v *= i%2==0 ? 2 : 5; } return v; }
[ "public", "static", "int", "maxLetterValue", "(", "final", "int", "numberOfLetters", ")", "{", "int", "v", "=", "1", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "numberOfLetters", ";", "i", "++", ")", "{", "v", "*=", "i", "%", "2", "=="...
Given an array of letters, returns the value of the highest letter. @param numberOfLetters @return value of highest
[ "Given", "an", "array", "of", "letters", "returns", "the", "value", "of", "the", "highest", "letter", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/Romans.java#L82-L88
38,168
derari/cthul
strings/src/main/java/org/cthul/strings/Romans.java
Romans.toRoman
public static String toRoman(final int number, final int[][] digits, final String zero, final String[] letters) { int maxVal = maxLetterValue(letters); return toRoman(new StringBuilder(), number, digits, zero, letters, maxVal).toString(); }
java
public static String toRoman(final int number, final int[][] digits, final String zero, final String[] letters) { int maxVal = maxLetterValue(letters); return toRoman(new StringBuilder(), number, digits, zero, letters, maxVal).toString(); }
[ "public", "static", "String", "toRoman", "(", "final", "int", "number", ",", "final", "int", "[", "]", "[", "]", "digits", ",", "final", "String", "zero", ",", "final", "String", "[", "]", "letters", ")", "{", "int", "maxVal", "=", "maxLetterValue", "(...
Converts an integer into a roman number. @param number the value to convert @param digits digit codes, i.e. {@link Romans#DIGITS DIGITS} or {@link Romans#DIGITS_SIMPLE DIGITS_SIMPLE} @param zero representation of zero or {@code null} @param letters letters to use for roman number @throws IllegalArgumentEx...
[ "Converts", "an", "integer", "into", "a", "roman", "number", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/Romans.java#L130-L134
38,169
derari/cthul
strings/src/main/java/org/cthul/strings/FormatMatcher.java
FormatMatcher.match
public List<Object> match() { final IntMatchResults result = new IntMatchResults(); if (matches(result)) { return result.getIntResultList(); } else { return null; } }
java
public List<Object> match() { final IntMatchResults result = new IntMatchResults(); if (matches(result)) { return result.getIntResultList(); } else { return null; } }
[ "public", "List", "<", "Object", ">", "match", "(", ")", "{", "final", "IntMatchResults", "result", "=", "new", "IntMatchResults", "(", ")", ";", "if", "(", "matches", "(", "result", ")", ")", "{", "return", "result", ".", "getIntResultList", "(", ")", ...
Matches the entire input and returns a list of extracted values. @return list of values, or null if match failed
[ "Matches", "the", "entire", "input", "and", "returns", "a", "list", "of", "extracted", "values", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/FormatMatcher.java#L32-L39
38,170
derari/cthul
strings/src/main/java/org/cthul/strings/FormatMatcher.java
FormatMatcher.find
public boolean find(int start, MatchResults result) { if (!matcher.find(start)) return false; applyMatch(result); return true; }
java
public boolean find(int start, MatchResults result) { if (!matcher.find(start)) return false; applyMatch(result); return true; }
[ "public", "boolean", "find", "(", "int", "start", ",", "MatchResults", "result", ")", "{", "if", "(", "!", "matcher", ".", "find", "(", "start", ")", ")", "return", "false", ";", "applyMatch", "(", "result", ")", ";", "return", "true", ";", "}" ]
Finds the next match and fills the result @param start @param result @return true iff match was found
[ "Finds", "the", "next", "match", "and", "fills", "the", "result" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/FormatMatcher.java#L69-L73
38,171
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestConstructor
public static <T> Constructor<T> bestConstructor(Class<T> clazz, Object[] args) throws AmbiguousConstructorMatchException { return bestConstructor(collectConstructors(clazz), args); }
java
public static <T> Constructor<T> bestConstructor(Class<T> clazz, Object[] args) throws AmbiguousConstructorMatchException { return bestConstructor(collectConstructors(clazz), args); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "bestConstructor", "(", "Class", "<", "T", ">", "clazz", ",", "Object", "[", "]", "args", ")", "throws", "AmbiguousConstructorMatchException", "{", "return", "bestConstructor", "(", "collectConst...
Finds the best constructor for the given arguments. @param <T> @param clazz @param args @return constructor, or {@code null} @throws AmbiguousSignatureMatchException if multiple constructors match equally
[ "Finds", "the", "best", "constructor", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L31-L33
38,172
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestConstructor
public static <T> Constructor<T> bestConstructor(Class<T> clazz, Class<?>[] argTypes) throws AmbiguousConstructorMatchException { return bestConstructor(collectConstructors(clazz), argTypes); }
java
public static <T> Constructor<T> bestConstructor(Class<T> clazz, Class<?>[] argTypes) throws AmbiguousConstructorMatchException { return bestConstructor(collectConstructors(clazz), argTypes); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "bestConstructor", "(", "Class", "<", "T", ">", "clazz", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", "AmbiguousConstructorMatchException", "{", "return", "bestConstructor"...
Finds the best constructor for the given arguments types. @param <T> @param clazz @param argTypes @return constructor, or {@code null} @throws AmbiguousSignatureMatchException if multiple constructors match equally
[ "Finds", "the", "best", "constructor", "for", "the", "given", "arguments", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L43-L45
38,173
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestConstructor
public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args) throws AmbiguousConstructorMatchException { return bestConstructor(constructors, collectArgTypes(args)); }
java
public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Object[] args) throws AmbiguousConstructorMatchException { return bestConstructor(constructors, collectArgTypes(args)); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "bestConstructor", "(", "Constructor", "<", "T", ">", "[", "]", "constructors", ",", "Object", "[", "]", "args", ")", "throws", "AmbiguousConstructorMatchException", "{", "return", "bestConstruct...
Selects the best constructor for the given arguments. @param <T> @param constructors @param args @return constructor, or {@code null} @throws AmbiguousSignatureMatchException if multiple constructors match equally
[ "Selects", "the", "best", "constructor", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L55-L57
38,174
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestConstructor
public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Class<?>[] argTypes) throws AmbiguousConstructorMatchException { try { return best(constructors, collectSignatures(constructors), collectVarArgs(constructors), argTypes); } catch (AmbiguousSignatureMatchExcept...
java
public static <T> Constructor<T> bestConstructor(Constructor<T>[] constructors, Class<?>[] argTypes) throws AmbiguousConstructorMatchException { try { return best(constructors, collectSignatures(constructors), collectVarArgs(constructors), argTypes); } catch (AmbiguousSignatureMatchExcept...
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "bestConstructor", "(", "Constructor", "<", "T", ">", "[", "]", "constructors", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", "AmbiguousConstructorMatchException", "{", "t...
Selects the best constructor for the given argument types. @param <T> @param constructors @param argTypes @return constructor, or {@code null} @throws AmbiguousSignatureMatchException if multiple constructors match equally
[ "Selects", "the", "best", "constructor", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L67-L73
38,175
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateConstructors
public static <T> Constructor<T>[] candidateConstructors(Class<T> clazz, Object[] args) { return candidateConstructors(collectConstructors(clazz), args); }
java
public static <T> Constructor<T>[] candidateConstructors(Class<T> clazz, Object[] args) { return candidateConstructors(collectConstructors(clazz), args); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "[", "]", "candidateConstructors", "(", "Class", "<", "T", ">", "clazz", ",", "Object", "[", "]", "args", ")", "{", "return", "candidateConstructors", "(", "collectConstructors", "(", "clazz"...
Finds the best equally-matching constructors for the given arguments. @param <T> @param clazz @param args @return constructors
[ "Finds", "the", "best", "equally", "-", "matching", "constructors", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L82-L84
38,176
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateConstructors
public static <T> Constructor<T>[] candidateConstructors(Class<T> clazz, Class<?>[] argTypes) { return candidateConstructors(collectConstructors(clazz), argTypes); }
java
public static <T> Constructor<T>[] candidateConstructors(Class<T> clazz, Class<?>[] argTypes) { return candidateConstructors(collectConstructors(clazz), argTypes); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "[", "]", "candidateConstructors", "(", "Class", "<", "T", ">", "clazz", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidateConstructors", "(", "collectConstru...
Finds the best equally-matching constructors for the given argument types. @param <T> @param clazz @param argTypes @return constructors
[ "Finds", "the", "best", "equally", "-", "matching", "constructors", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L93-L95
38,177
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateConstructors
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) { return candidateConstructors(constructors, collectArgTypes(args)); }
java
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) { return candidateConstructors(constructors, collectArgTypes(args)); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "[", "]", "candidateConstructors", "(", "Constructor", "<", "T", ">", "[", "]", "constructors", ",", "Object", "[", "]", "args", ")", "{", "return", "candidateConstructors", "(", "constructor...
Selects the best equally-matching constructors for the given arguments. @param <T> @param constructors @param args @return constructors
[ "Selects", "the", "best", "equally", "-", "matching", "constructors", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L104-L106
38,178
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateConstructors
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Class<?>[] argTypes) { return candidates(constructors, collectSignatures(constructors), collectVarArgs(constructors), argTypes); }
java
public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Class<?>[] argTypes) { return candidates(constructors, collectSignatures(constructors), collectVarArgs(constructors), argTypes); }
[ "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "[", "]", "candidateConstructors", "(", "Constructor", "<", "T", ">", "[", "]", "constructors", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidates", "(", ...
Selects the best equally-matching constructors for the given argument types. @param <T> @param constructors @param argTypes @return constructors
[ "Selects", "the", "best", "equally", "-", "matching", "constructors", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L115-L117
38,179
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestMethod
public static Method bestMethod(Class<?> clazz, String name, Object[] args) throws AmbiguousMethodMatchException { return bestMethod(collectMethods(clazz, name), args); }
java
public static Method bestMethod(Class<?> clazz, String name, Object[] args) throws AmbiguousMethodMatchException { return bestMethod(collectMethods(clazz, name), args); }
[ "public", "static", "Method", "bestMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Object", "[", "]", "args", ")", "throws", "AmbiguousMethodMatchException", "{", "return", "bestMethod", "(", "collectMethods", "(", "clazz", ",", "...
Finds the best method for the given arguments. @param clazz @param name @param args @return method @throws AmbiguousSignatureMatchException if multiple methods match equally
[ "Finds", "the", "best", "method", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L127-L129
38,180
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestMethod
public static Method bestMethod(Class<?> clazz, String name, Class<?>[] argTypes) throws AmbiguousMethodMatchException { return bestMethod(collectMethods(clazz, name), argTypes); }
java
public static Method bestMethod(Class<?> clazz, String name, Class<?>[] argTypes) throws AmbiguousMethodMatchException { return bestMethod(collectMethods(clazz, name), argTypes); }
[ "public", "static", "Method", "bestMethod", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", "AmbiguousMethodMatchException", "{", "return", "bestMethod", "(", "collectMethods", "(...
Finds the best method for the given argument types. @param clazz @param name @param argTypes @return method @throws AmbiguousSignatureMatchException if multiple methods match equally
[ "Finds", "the", "best", "method", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L139-L141
38,181
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestMethod
public static Method bestMethod(Method[] methods, Object[] args) throws AmbiguousMethodMatchException { return bestMethod(methods, collectArgTypes(args)); }
java
public static Method bestMethod(Method[] methods, Object[] args) throws AmbiguousMethodMatchException { return bestMethod(methods, collectArgTypes(args)); }
[ "public", "static", "Method", "bestMethod", "(", "Method", "[", "]", "methods", ",", "Object", "[", "]", "args", ")", "throws", "AmbiguousMethodMatchException", "{", "return", "bestMethod", "(", "methods", ",", "collectArgTypes", "(", "args", ")", ")", ";", ...
Selects the best method for the given arguments. @param methods @param args @return method @throws AmbiguousSignatureMatchException if multiple methods match equally
[ "Selects", "the", "best", "method", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L150-L152
38,182
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestMethod
public static Method bestMethod(Method[] methods, Class<?>[] argTypes) throws AmbiguousMethodMatchException { try { return best(methods, collectSignatures(methods), collectVarArgs(methods), argTypes); } catch (AmbiguousSignatureMatchException e) { throw new AmbiguousMethodMat...
java
public static Method bestMethod(Method[] methods, Class<?>[] argTypes) throws AmbiguousMethodMatchException { try { return best(methods, collectSignatures(methods), collectVarArgs(methods), argTypes); } catch (AmbiguousSignatureMatchException e) { throw new AmbiguousMethodMat...
[ "public", "static", "Method", "bestMethod", "(", "Method", "[", "]", "methods", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", "AmbiguousMethodMatchException", "{", "try", "{", "return", "best", "(", "methods", ",", "collectSignatures", "(...
Selects the best method for the given argument types. @param methods @param argTypes @return method @throws AmbiguousSignatureMatchException if multiple methods match equally
[ "Selects", "the", "best", "method", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L161-L167
38,183
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMethods
public static Method[] candidateMethods(Class<?> clazz, String name, Object[] args) { return candidateMethods(collectMethods(clazz, name), args); }
java
public static Method[] candidateMethods(Class<?> clazz, String name, Object[] args) { return candidateMethods(collectMethods(clazz, name), args); }
[ "public", "static", "Method", "[", "]", "candidateMethods", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Object", "[", "]", "args", ")", "{", "return", "candidateMethods", "(", "collectMethods", "(", "clazz", ",", "name", ")", ",", ...
Finds the best equally-matching methods for the given arguments. @param clazz @param name @param args @return methods
[ "Finds", "the", "best", "equally", "-", "matching", "methods", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L176-L178
38,184
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMethods
public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) { return candidateMethods(collectMethods(clazz, name), argTypes); }
java
public static Method[] candidateMethods(Class<?> clazz, String name, Class<?>[] argTypes) { return candidateMethods(collectMethods(clazz, name), argTypes); }
[ "public", "static", "Method", "[", "]", "candidateMethods", "(", "Class", "<", "?", ">", "clazz", ",", "String", "name", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidateMethods", "(", "collectMethods", "(", "clazz", ",", ...
Finds the best equally-matching methods for the given argument types. @param clazz @param name @param argTypes @return methods
[ "Finds", "the", "best", "equally", "-", "matching", "methods", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L187-L189
38,185
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMethods
public static Method[] candidateMethods(Method[] methods, Object[] args) { return candidateMethods(methods, collectArgTypes(args)); }
java
public static Method[] candidateMethods(Method[] methods, Object[] args) { return candidateMethods(methods, collectArgTypes(args)); }
[ "public", "static", "Method", "[", "]", "candidateMethods", "(", "Method", "[", "]", "methods", ",", "Object", "[", "]", "args", ")", "{", "return", "candidateMethods", "(", "methods", ",", "collectArgTypes", "(", "args", ")", ")", ";", "}" ]
Selects the best equally-matching methods for the given arguments. @param methods @param args @return methods
[ "Selects", "the", "best", "equally", "-", "matching", "methods", "for", "the", "given", "arguments", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L197-L199
38,186
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMethods
public static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes) { return candidates(methods, collectSignatures(methods), collectVarArgs(methods), argTypes); }
java
public static Method[] candidateMethods(Method[] methods, Class<?>[] argTypes) { return candidates(methods, collectSignatures(methods), collectVarArgs(methods), argTypes); }
[ "public", "static", "Method", "[", "]", "candidateMethods", "(", "Method", "[", "]", "methods", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidates", "(", "methods", ",", "collectSignatures", "(", "methods", ")", ",", "coll...
Selects the best equally-matching methods for the given argument types. @param methods @param argTypes @return methods
[ "Selects", "the", "best", "equally", "-", "matching", "methods", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L207-L209
38,187
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.best
public static <T> T best(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException { int i = bestMatch(signatures, varArgs, argTypes); if (i < 0) return null; return items[i]; }
java
public static <T> T best(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException { int i = bestMatch(signatures, varArgs, argTypes); if (i < 0) return null; return items[i]; }
[ "public", "static", "<", "T", ">", "T", "best", "(", "T", "[", "]", "items", ",", "Class", "<", "?", ">", "[", "]", "[", "]", "signatures", ",", "boolean", "[", "]", "varArgs", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", ...
Selects the best item for the given argument types. @param <T> @param items @param signatures @param varArgs @param argTypes @return item @throws AmbiguousSignatureMatchException if multiple methods match equally
[ "Selects", "the", "best", "item", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L221-L225
38,188
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidates
public static <T> T[] candidates(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) { final int[] indices = candidateMatches(signatures, varArgs, argTypes); T[] result = newArray(items.getClass().getComponentType(), indices.length); for (int i = 0; i < indices.length;...
java
public static <T> T[] candidates(T[] items, Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) { final int[] indices = candidateMatches(signatures, varArgs, argTypes); T[] result = newArray(items.getClass().getComponentType(), indices.length); for (int i = 0; i < indices.length;...
[ "public", "static", "<", "T", ">", "T", "[", "]", "candidates", "(", "T", "[", "]", "items", ",", "Class", "<", "?", ">", "[", "]", "[", "]", "signatures", ",", "boolean", "[", "]", "varArgs", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ...
Selects the best equally-matching item for the given argument types. @param <T> @param items @param signatures @param varArgs @param argTypes @return item
[ "Selects", "the", "best", "equally", "-", "matching", "item", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L236-L243
38,189
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.bestMatch
public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException { return bestMatch(signatures, varArgs, new JavaSignatureComparator(argTypes)); }
java
public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException { return bestMatch(signatures, varArgs, new JavaSignatureComparator(argTypes)); }
[ "public", "static", "int", "bestMatch", "(", "Class", "<", "?", ">", "[", "]", "[", "]", "signatures", ",", "boolean", "[", "]", "varArgs", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "throws", "AmbiguousSignatureMatchException", "{", "return...
Selects the best match in signatures for the given argument types. @param signatures @param varArgs @param argTypes @return index of best signature, -1 if nothing matched @throws AmbiguousSignatureMatchException if two signatures matched equally
[ "Selects", "the", "best", "match", "in", "signatures", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L421-L423
38,190
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.candidateMatches
public static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) { return candidateMatches(signatures, varArgs, new JavaSignatureComparator(argTypes)); }
java
public static int[] candidateMatches(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) { return candidateMatches(signatures, varArgs, new JavaSignatureComparator(argTypes)); }
[ "public", "static", "int", "[", "]", "candidateMatches", "(", "Class", "<", "?", ">", "[", "]", "[", "]", "signatures", ",", "boolean", "[", "]", "varArgs", ",", "Class", "<", "?", ">", "[", "]", "argTypes", ")", "{", "return", "candidateMatches", "(...
Returns indices of all signatures that are a best match for the given argument types. @param signatures @param varArgs @param argTypes @return signature indices
[ "Returns", "indices", "of", "all", "signatures", "that", "are", "a", "best", "match", "for", "the", "given", "argument", "types", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L494-L496
38,191
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.fixVarArgs
public static Object[] fixVarArgs(Class<?>[] paramsWithVarArgs, Object[] arguments) { int n = paramsWithVarArgs.length; return fixVarArgs(n, paramsWithVarArgs[n-1], arguments); }
java
public static Object[] fixVarArgs(Class<?>[] paramsWithVarArgs, Object[] arguments) { int n = paramsWithVarArgs.length; return fixVarArgs(n, paramsWithVarArgs[n-1], arguments); }
[ "public", "static", "Object", "[", "]", "fixVarArgs", "(", "Class", "<", "?", ">", "[", "]", "paramsWithVarArgs", ",", "Object", "[", "]", "arguments", ")", "{", "int", "n", "=", "paramsWithVarArgs", ".", "length", ";", "return", "fixVarArgs", "(", "n", ...
Fixes an arguments array to fit parameter types, where the last parameter is an varargs array. @param paramsWithVarArgs @param arguments @return fixed arguments array
[ "Fixes", "an", "arguments", "array", "to", "fit", "parameter", "types", "where", "the", "last", "parameter", "is", "an", "varargs", "array", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L542-L545
38,192
derari/cthul
objects/src/main/java/org/cthul/objects/reflection/Signatures.java
Signatures.fixVarArgs
@SuppressWarnings("SuspiciousSystemArraycopy") public static Object[] fixVarArgs(int length, Class<?> varArgType, Object[] arguments) { final Object[] result; if (arguments.length == length && varArgType.isInstance(arguments[length-1])) { return arguments; } else { ...
java
@SuppressWarnings("SuspiciousSystemArraycopy") public static Object[] fixVarArgs(int length, Class<?> varArgType, Object[] arguments) { final Object[] result; if (arguments.length == length && varArgType.isInstance(arguments[length-1])) { return arguments; } else { ...
[ "@", "SuppressWarnings", "(", "\"SuspiciousSystemArraycopy\"", ")", "public", "static", "Object", "[", "]", "fixVarArgs", "(", "int", "length", ",", "Class", "<", "?", ">", "varArgType", ",", "Object", "[", "]", "arguments", ")", "{", "final", "Object", "[",...
Fixes an arguments array to fit a given length, the last value is an array filled with varargs. @param length @param varArgType @param arguments @return fixed arguments array
[ "Fixes", "an", "arguments", "array", "to", "fit", "a", "given", "length", "the", "last", "value", "is", "an", "array", "filled", "with", "varargs", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L555-L574
38,193
derari/cthul
strings/src/main/java/org/cthul/strings/plural/RulePluralizer.java
RulePluralizer.uncountable
protected void uncountable(String word) { Rule r = new UncountableRule(lower(word)); plural(r); singular(r); }
java
protected void uncountable(String word) { Rule r = new UncountableRule(lower(word)); plural(r); singular(r); }
[ "protected", "void", "uncountable", "(", "String", "word", ")", "{", "Rule", "r", "=", "new", "UncountableRule", "(", "lower", "(", "word", ")", ")", ";", "plural", "(", "r", ")", ";", "singular", "(", "r", ")", ";", "}" ]
Declares a word as uncountable, which means that singular and plural are identical. @param word
[ "Declares", "a", "word", "as", "uncountable", "which", "means", "that", "singular", "and", "plural", "are", "identical", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/plural/RulePluralizer.java#L102-L106
38,194
derari/cthul
strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java
PluralizerRegistry.register
public synchronized Pluralizer register(Locale l, Pluralizer p) { return pluralizers.put(l, p); }
java
public synchronized Pluralizer register(Locale l, Pluralizer p) { return pluralizers.put(l, p); }
[ "public", "synchronized", "Pluralizer", "register", "(", "Locale", "l", ",", "Pluralizer", "p", ")", "{", "return", "pluralizers", ".", "put", "(", "l", ",", "p", ")", ";", "}" ]
Registers a pluralizer @param l @param p @return the pluralizer previously registered for that locale, or {@code null}
[ "Registers", "a", "pluralizer" ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java#L52-L54
38,195
derari/cthul
strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java
PluralizerRegistry.find
public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p...
java
public synchronized Pluralizer find(Locale l) { while (l != null) { List<Locale> candidates = control .getCandidateLocales(PLURALIZER_CLASS, l); for (Locale c: candidates) { Pluralizer p = pluralizers.get(c); if (p...
[ "public", "synchronized", "Pluralizer", "find", "(", "Locale", "l", ")", "{", "while", "(", "l", "!=", "null", ")", "{", "List", "<", "Locale", ">", "candidates", "=", "control", ".", "getCandidateLocales", "(", "PLURALIZER_CLASS", ",", "l", ")", ";", "f...
Finds the best pluralizer for a locale. @param l @return a pluralizer @see #getRegistered(java.util.Locale)
[ "Finds", "the", "best", "pluralizer", "for", "a", "locale", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java#L62-L73
38,196
derari/cthul
strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java
PluralizerRegistry.copy
public synchronized PluralizerRegistry copy() { PluralizerRegistry r = new PluralizerRegistry(control); r.pluralizers.putAll(pluralizers); return r; }
java
public synchronized PluralizerRegistry copy() { PluralizerRegistry r = new PluralizerRegistry(control); r.pluralizers.putAll(pluralizers); return r; }
[ "public", "synchronized", "PluralizerRegistry", "copy", "(", ")", "{", "PluralizerRegistry", "r", "=", "new", "PluralizerRegistry", "(", "control", ")", ";", "r", ".", "pluralizers", ".", "putAll", "(", "pluralizers", ")", ";", "return", "r", ";", "}" ]
Creates a shallow copy of this registry. @return a new registry
[ "Creates", "a", "shallow", "copy", "of", "this", "registry", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/strings/src/main/java/org/cthul/strings/plural/PluralizerRegistry.java#L89-L93
38,197
derari/cthul
matchers/src/main/java/org/cthul/matchers/diagnose/result/MatchResultProxy.java
MatchResultProxy.match
protected Match<?> match() { Match<?> m = result().getMatch(); if (m == null) { throw new IllegalStateException("Match failed"); } return m; }
java
protected Match<?> match() { Match<?> m = result().getMatch(); if (m == null) { throw new IllegalStateException("Match failed"); } return m; }
[ "protected", "Match", "<", "?", ">", "match", "(", ")", "{", "Match", "<", "?", ">", "m", "=", "result", "(", ")", ".", "getMatch", "(", ")", ";", "if", "(", "m", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Match failed...
For internal use. Fails if this is a mismatch. @return this
[ "For", "internal", "use", ".", "Fails", "if", "this", "is", "a", "mismatch", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/result/MatchResultProxy.java#L39-L45
38,198
derari/cthul
matchers/src/main/java/org/cthul/matchers/diagnose/result/MatchResultProxy.java
MatchResultProxy.mismatch
protected Mismatch<?> mismatch() { Mismatch<?> m = result().getMismatch(); if (m == null) { throw new IllegalStateException("Match succeded"); } return m; }
java
protected Mismatch<?> mismatch() { Mismatch<?> m = result().getMismatch(); if (m == null) { throw new IllegalStateException("Match succeded"); } return m; }
[ "protected", "Mismatch", "<", "?", ">", "mismatch", "(", ")", "{", "Mismatch", "<", "?", ">", "m", "=", "result", "(", ")", ".", "getMismatch", "(", ")", ";", "if", "(", "m", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"...
For internal use. Fails if this is a match. @return this
[ "For", "internal", "use", ".", "Fails", "if", "this", "is", "a", "match", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/matchers/src/main/java/org/cthul/matchers/diagnose/result/MatchResultProxy.java#L51-L57
38,199
derari/cthul
xml/src/main/java/org/cthul/resolve/ResolvingException.java
ResolvingException.wrap
public static ResolvingException wrap(RRequest request, Exception e) { if (e instanceof ResolvingException) return (ResolvingException) e; return new ResolvingException(request, e); }
java
public static ResolvingException wrap(RRequest request, Exception e) { if (e instanceof ResolvingException) return (ResolvingException) e; return new ResolvingException(request, e); }
[ "public", "static", "ResolvingException", "wrap", "(", "RRequest", "request", ",", "Exception", "e", ")", "{", "if", "(", "e", "instanceof", "ResolvingException", ")", "return", "(", "ResolvingException", ")", "e", ";", "return", "new", "ResolvingException", "("...
Wraps e in an resolving exception, if it isn't one already. @param request @param e @return resolving exception
[ "Wraps", "e", "in", "an", "resolving", "exception", "if", "it", "isn", "t", "one", "already", "." ]
74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc
https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/xml/src/main/java/org/cthul/resolve/ResolvingException.java#L30-L33