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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
150,300 | hawkular/hawkular-bus | hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.createMessageWithBinaryData | protected Message createMessageWithBinaryData(ConnectionContext context, BasicMessage basicMessage,
InputStream inputStream, Map<String, String> headers) throws JMSException {
if (context == null) {
throw new IllegalArgumentException("The context is null");
}
if (basicMes... | java | protected Message createMessageWithBinaryData(ConnectionContext context, BasicMessage basicMessage,
InputStream inputStream, Map<String, String> headers) throws JMSException {
if (context == null) {
throw new IllegalArgumentException("The context is null");
}
if (basicMes... | [
"protected",
"Message",
"createMessageWithBinaryData",
"(",
"ConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"InputStream",
"inputStream",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"JMSException",
"{",
"if",
"(... | Creates a blob message that can be send via a producer that contains the given BasicMessage's JSON encoded data
along with binary data.
@param context the context whose session is used to create the message
@param basicMessage contains the data that will be JSON-encoded and encapsulated in the created message, with
op... | [
"Creates",
"a",
"blob",
"message",
"that",
"can",
"be",
"send",
"via",
"a",
"producer",
"that",
"contains",
"the",
"given",
"BasicMessage",
"s",
"JSON",
"encoded",
"data",
"along",
"with",
"binary",
"data",
"."
] | 28d6b58bec81a50f8344d39f309b6971271ae627 | https://github.com/hawkular/hawkular-bus/blob/28d6b58bec81a50f8344d39f309b6971271ae627/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L436-L464 |
150,301 | mytechia/mytechia_commons | mytechia_commons_library/src/main/java/com/mytechia/commons/util/io/file/Files.java | Files.deleteDirectory | public static boolean deleteDirectory(File dir)
{
if (dir.canWrite()) {
File [] subFiles = dir.listFiles();
for(int i=0; i<subFiles.length; i++) {
if (subFiles[i].isDirectory())
deleteDirectory(subFiles[i]);
else
... | java | public static boolean deleteDirectory(File dir)
{
if (dir.canWrite()) {
File [] subFiles = dir.listFiles();
for(int i=0; i<subFiles.length; i++) {
if (subFiles[i].isDirectory())
deleteDirectory(subFiles[i]);
else
... | [
"public",
"static",
"boolean",
"deleteDirectory",
"(",
"File",
"dir",
")",
"{",
"if",
"(",
"dir",
".",
"canWrite",
"(",
")",
")",
"{",
"File",
"[",
"]",
"subFiles",
"=",
"dir",
".",
"listFiles",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Deletes a directory and its contents. | [
"Deletes",
"a",
"directory",
"and",
"its",
"contents",
"."
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia_commons_library/src/main/java/com/mytechia/commons/util/io/file/Files.java#L49-L66 |
150,302 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java | IndexForHeaderIndexFile.getChunkId | public int getChunkId(byte[] key) {
int idx = Arrays.binarySearch(maxKeyPerChunk, 0, filledUpTo + 1, key, comparator);
idx = idx < 0 ? -idx - 1 : idx;
if (idx > filledUpTo) {
return -1;
} else {
return idx;
}
} | java | public int getChunkId(byte[] key) {
int idx = Arrays.binarySearch(maxKeyPerChunk, 0, filledUpTo + 1, key, comparator);
idx = idx < 0 ? -idx - 1 : idx;
if (idx > filledUpTo) {
return -1;
} else {
return idx;
}
} | [
"public",
"int",
"getChunkId",
"(",
"byte",
"[",
"]",
"key",
")",
"{",
"int",
"idx",
"=",
"Arrays",
".",
"binarySearch",
"(",
"maxKeyPerChunk",
",",
"0",
",",
"filledUpTo",
"+",
"1",
",",
"key",
",",
"comparator",
")",
";",
"idx",
"=",
"idx",
"<",
... | returns the index of the chunk, where the element could be found. If the element can't be in one of the
chunks the method will return -1.
@param key
the key to look for
@return the id of the chunk, where the key could be found. If there is no putative chunk, then -1 will returned. | [
"returns",
"the",
"index",
"of",
"the",
"chunk",
"where",
"the",
"element",
"could",
"be",
"found",
".",
"If",
"the",
"element",
"can",
"t",
"be",
"in",
"one",
"of",
"the",
"chunks",
"the",
"method",
"will",
"return",
"-",
"1",
"."
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java#L127-L135 |
150,303 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java | IndexForHeaderIndexFile.isConsistent | public boolean isConsistent() {
for (int i = 1; i < filledUpTo; i++) {
int comp1 = KeyUtils.compareKey(maxKeyPerChunk[i], maxKeyPerChunk[i - 1]);
if (comp1 <= 0) {
return false;
}
}
return true;
} | java | public boolean isConsistent() {
for (int i = 1; i < filledUpTo; i++) {
int comp1 = KeyUtils.compareKey(maxKeyPerChunk[i], maxKeyPerChunk[i - 1]);
if (comp1 <= 0) {
return false;
}
}
return true;
} | [
"public",
"boolean",
"isConsistent",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"filledUpTo",
";",
"i",
"++",
")",
"{",
"int",
"comp1",
"=",
"KeyUtils",
".",
"compareKey",
"(",
"maxKeyPerChunk",
"[",
"i",
"]",
",",
"maxKeyPerChun... | Checks, if this index is consistent. All inserted keys have to be inserted incrementally.
@return boolean | [
"Checks",
"if",
"this",
"index",
"is",
"consistent",
".",
"All",
"inserted",
"keys",
"have",
"to",
"be",
"inserted",
"incrementally",
"."
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java#L151-L159 |
150,304 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java | IndexForHeaderIndexFile.setLargestKey | public void setLargestKey(int chunkIdx, byte[] largestKeyInChunk) {
maxKeyPerChunk[chunkIdx] = largestKeyInChunk;
filledUpTo = Math.max(filledUpTo, chunkIdx);
indexBuffer.position(chunkIdx * keySize);
indexBuffer.put(largestKeyInChunk);
} | java | public void setLargestKey(int chunkIdx, byte[] largestKeyInChunk) {
maxKeyPerChunk[chunkIdx] = largestKeyInChunk;
filledUpTo = Math.max(filledUpTo, chunkIdx);
indexBuffer.position(chunkIdx * keySize);
indexBuffer.put(largestKeyInChunk);
} | [
"public",
"void",
"setLargestKey",
"(",
"int",
"chunkIdx",
",",
"byte",
"[",
"]",
"largestKeyInChunk",
")",
"{",
"maxKeyPerChunk",
"[",
"chunkIdx",
"]",
"=",
"largestKeyInChunk",
";",
"filledUpTo",
"=",
"Math",
".",
"max",
"(",
"filledUpTo",
",",
"chunkIdx",
... | Sets a new largest key in the chunk with the given index.
@param chunkIdx
@param largestKeyInChunk | [
"Sets",
"a",
"new",
"largest",
"key",
"in",
"the",
"chunk",
"with",
"the",
"given",
"index",
"."
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/file/IndexForHeaderIndexFile.java#L167-L172 |
150,305 | zmarko/jPasswordObfuscator | jPasswordObfuscator-lib/src/main/java/rs/in/zivanovic/obfuscator/JPasswordObfuscator.java | JPasswordObfuscator.obfuscate | public String obfuscate(char[] masterKey, byte[] data, int version) {
Objects.requireNonNull(masterKey);
Objects.requireNonNull(data);
switch (version) {
case 1:
return v1Obfuscator.obfuscate(masterKey, data).toString();
default:
throw new ... | java | public String obfuscate(char[] masterKey, byte[] data, int version) {
Objects.requireNonNull(masterKey);
Objects.requireNonNull(data);
switch (version) {
case 1:
return v1Obfuscator.obfuscate(masterKey, data).toString();
default:
throw new ... | [
"public",
"String",
"obfuscate",
"(",
"char",
"[",
"]",
"masterKey",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"version",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"masterKey",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"data",
")",
";",
... | Obfuscate data using supplied master key and algorithm version.
@param masterKey master key to use for obfuscation
@param data data to obfuscate
@param version obfuscation algorithm version to use
@return string containing obfuscated data; use {@link #unObfuscate} to get secret data from this string | [
"Obfuscate",
"data",
"using",
"supplied",
"master",
"key",
"and",
"algorithm",
"version",
"."
] | 40844a826bb4d6ccac0caa2480cd89c6362cfdd0 | https://github.com/zmarko/jPasswordObfuscator/blob/40844a826bb4d6ccac0caa2480cd89c6362cfdd0/jPasswordObfuscator-lib/src/main/java/rs/in/zivanovic/obfuscator/JPasswordObfuscator.java#L62-L71 |
150,306 | amlinv/amq-monitor | amq-monitor-web-impl/src/main/java/com/amlinv/activemq/stats/QueueStatisticsCollection.java | QueueStatisticsCollection.updateRates | protected void updateRates (QueueStatMeasurements rateMeasurements, long dequeueCountDelta, long enqueueCountDelta) {
double oldDequeueRateOneMinute = rateMeasurements.messageRates.getOneMinuteAverageDequeueRate();
double oldDequeueRateOneHour = rateMeasurements.messageRates.getOneHourAverageDequeueRate... | java | protected void updateRates (QueueStatMeasurements rateMeasurements, long dequeueCountDelta, long enqueueCountDelta) {
double oldDequeueRateOneMinute = rateMeasurements.messageRates.getOneMinuteAverageDequeueRate();
double oldDequeueRateOneHour = rateMeasurements.messageRates.getOneHourAverageDequeueRate... | [
"protected",
"void",
"updateRates",
"(",
"QueueStatMeasurements",
"rateMeasurements",
",",
"long",
"dequeueCountDelta",
",",
"long",
"enqueueCountDelta",
")",
"{",
"double",
"oldDequeueRateOneMinute",
"=",
"rateMeasurements",
".",
"messageRates",
".",
"getOneMinuteAverageDe... | Update message rates given the change in dequeue and enqueue counts for one broker queue.
@param rateMeasurements measurements for one broker queue.
@param dequeueCountDelta change in the dequeue count since the last measurement for the same broker queue.
@param enqueueCountDelta change in the enqueue count since the ... | [
"Update",
"message",
"rates",
"given",
"the",
"change",
"in",
"dequeue",
"and",
"enqueue",
"counts",
"for",
"one",
"broker",
"queue",
"."
] | 0ae0156f56d7d3edf98bca9c30b153b770fe5bfa | https://github.com/amlinv/amq-monitor/blob/0ae0156f56d7d3edf98bca9c30b153b770fe5bfa/amq-monitor-web-impl/src/main/java/com/amlinv/activemq/stats/QueueStatisticsCollection.java#L158-L208 |
150,307 | jtrfp/javamod | src/main/java/de/quippy/javamod/io/wav/WaveFile.java | WaveFile.openForWrite | public int openForWrite(String Filename, WaveFile OtherWave)
{
return openForWrite(Filename, OtherWave.getSamplingRate(), OtherWave.getBitsPerSample(), OtherWave.getNumChannels());
} | java | public int openForWrite(String Filename, WaveFile OtherWave)
{
return openForWrite(Filename, OtherWave.getSamplingRate(), OtherWave.getBitsPerSample(), OtherWave.getNumChannels());
} | [
"public",
"int",
"openForWrite",
"(",
"String",
"Filename",
",",
"WaveFile",
"OtherWave",
")",
"{",
"return",
"openForWrite",
"(",
"Filename",
",",
"OtherWave",
".",
"getSamplingRate",
"(",
")",
",",
"OtherWave",
".",
"getBitsPerSample",
"(",
")",
",",
"OtherW... | Open for write using another wave file's parameters... | [
"Open",
"for",
"write",
"using",
"another",
"wave",
"file",
"s",
"parameters",
"..."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/io/wav/WaveFile.java#L100-L103 |
150,308 | jtrfp/javamod | src/main/java/de/quippy/javamod/io/wav/WaveFile.java | WaveFile.writeSamples | public int writeSamples(short[] data, int numSamples)
{
int numBytes = numSamples<<1;
byte[] theData = new byte[numBytes];
for (int y = 0, yc=0; y<numBytes; y+=2)
{
theData[y] = (byte) (data[yc] & 0x00FF);
theData[y + 1] = (byte) ((data[yc++] >>> 8) & 0x00FF);
}
return write(theData, numBytes);
} | java | public int writeSamples(short[] data, int numSamples)
{
int numBytes = numSamples<<1;
byte[] theData = new byte[numBytes];
for (int y = 0, yc=0; y<numBytes; y+=2)
{
theData[y] = (byte) (data[yc] & 0x00FF);
theData[y + 1] = (byte) ((data[yc++] >>> 8) & 0x00FF);
}
return write(theData, numBytes);
} | [
"public",
"int",
"writeSamples",
"(",
"short",
"[",
"]",
"data",
",",
"int",
"numSamples",
")",
"{",
"int",
"numBytes",
"=",
"numSamples",
"<<",
"1",
";",
"byte",
"[",
"]",
"theData",
"=",
"new",
"byte",
"[",
"numBytes",
"]",
";",
"for",
"(",
"int",
... | Write 16-bit audio | [
"Write",
"16",
"-",
"bit",
"audio"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/io/wav/WaveFile.java#L175-L185 |
150,309 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/TinyPlugz.java | TinyPlugz.getInstance | public static TinyPlugz getInstance() {
final TinyPlugz plugz = instance;
Require.state(plugz != null, "TinyPlugz has not been initialized");
return plugz;
} | java | public static TinyPlugz getInstance() {
final TinyPlugz plugz = instance;
Require.state(plugz != null, "TinyPlugz has not been initialized");
return plugz;
} | [
"public",
"static",
"TinyPlugz",
"getInstance",
"(",
")",
"{",
"final",
"TinyPlugz",
"plugz",
"=",
"instance",
";",
"Require",
".",
"state",
"(",
"plugz",
"!=",
"null",
",",
"\"TinyPlugz has not been initialized\"",
")",
";",
"return",
"plugz",
";",
"}"
] | Gets the single TinyPlugz instance.
@return The TinyPlugz instance. | [
"Gets",
"the",
"single",
"TinyPlugz",
"instance",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/TinyPlugz.java#L70-L74 |
150,310 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/MemoryManager.java | MemoryManager.logMemory | public static void logMemory(long interval, Level level) {
Task<Void,NoException> task = new Task.Cpu<Void,NoException>("Logging memory", Task.PRIORITY_BACKGROUND) {
@Override
public Void run() {
logMemory(level);
return null;
}
};
task.executeEvery(interval, interval);
task.start();
... | java | public static void logMemory(long interval, Level level) {
Task<Void,NoException> task = new Task.Cpu<Void,NoException>("Logging memory", Task.PRIORITY_BACKGROUND) {
@Override
public Void run() {
logMemory(level);
return null;
}
};
task.executeEvery(interval, interval);
task.start();
... | [
"public",
"static",
"void",
"logMemory",
"(",
"long",
"interval",
",",
"Level",
"level",
")",
"{",
"Task",
"<",
"Void",
",",
"NoException",
">",
"task",
"=",
"new",
"Task",
".",
"Cpu",
"<",
"Void",
",",
"NoException",
">",
"(",
"\"Logging memory\"",
",",... | Log memory usage to the console at regular interval. | [
"Log",
"memory",
"usage",
"to",
"the",
"console",
"at",
"regular",
"interval",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/MemoryManager.java#L214-L224 |
150,311 | danidemi/jlubricant | jlubricant-spring-batch/src/main/java/org/springframework/jdbc/core/namedparam/ExposedParsedSql.java | ExposedParsedSql.addNamedParameter | public void addNamedParameter(String parameterName, int startIndex, int endIndex) {
delegate.addNamedParameter(parameterName, startIndex, endIndex);
} | java | public void addNamedParameter(String parameterName, int startIndex, int endIndex) {
delegate.addNamedParameter(parameterName, startIndex, endIndex);
} | [
"public",
"void",
"addNamedParameter",
"(",
"String",
"parameterName",
",",
"int",
"startIndex",
",",
"int",
"endIndex",
")",
"{",
"delegate",
".",
"addNamedParameter",
"(",
"parameterName",
",",
"startIndex",
",",
"endIndex",
")",
";",
"}"
] | Add a named parameter parsed from this SQL statement.
@param parameterName the name of the parameter
@param startIndex the start index in the original SQL String
@param endIndex the end index in the original SQL String | [
"Add",
"a",
"named",
"parameter",
"parsed",
"from",
"this",
"SQL",
"statement",
"."
] | a9937c141c69ec34b768bd603b8093e496329b3a | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-spring-batch/src/main/java/org/springframework/jdbc/core/namedparam/ExposedParsedSql.java#L41-L43 |
150,312 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.containsInstance | @Override
public boolean containsInstance(int value, T instance) {
if (root == null) return false;
if (value < first.value) return false;
if (value > last.value) return false;
if (value == first.value && instance == first.element) return true;
if (value == last.value && instance == la... | java | @Override
public boolean containsInstance(int value, T instance) {
if (root == null) return false;
if (value < first.value) return false;
if (value > last.value) return false;
if (value == first.value && instance == first.element) return true;
if (value == last.value && instance == la... | [
"@",
"Override",
"public",
"boolean",
"containsInstance",
"(",
"int",
"value",
",",
"T",
"instance",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"value",
"<",
"first",
".",
"value",
")",
"return",
"false",
";",
... | Returns true if the given key exists in the tree and its associated value is the given element.
Comparison of the element is using the == operator. | [
"Returns",
"true",
"if",
"the",
"given",
"key",
"exists",
"in",
"the",
"tree",
"and",
"its",
"associated",
"value",
"is",
"the",
"given",
"element",
".",
"Comparison",
"of",
"the",
"element",
"is",
"using",
"the",
"==",
"operator",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L247-L255 |
150,313 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.searchNearestLower | public Node<T> searchNearestLower(int value, boolean acceptEquals) {
if (root == null) return null;
return searchNearestLower(root, value, acceptEquals);
} | java | public Node<T> searchNearestLower(int value, boolean acceptEquals) {
if (root == null) return null;
return searchNearestLower(root, value, acceptEquals);
} | [
"public",
"Node",
"<",
"T",
">",
"searchNearestLower",
"(",
"int",
"value",
",",
"boolean",
"acceptEquals",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
"null",
";",
"return",
"searchNearestLower",
"(",
"root",
",",
"value",
",",
"acceptEquals... | Returns the node containing the highest value strictly lower than the given one. | [
"Returns",
"the",
"node",
"containing",
"the",
"highest",
"value",
"strictly",
"lower",
"than",
"the",
"given",
"one",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L275-L278 |
150,314 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.removeMin | public void removeMin() {
if (root == null) return;
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
root.red = true;
root = removeMin(root, true);
if (root != null) roo... | java | public void removeMin() {
if (root == null) return;
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
root.red = true;
root = removeMin(root, true);
if (root != null) roo... | [
"public",
"void",
"removeMin",
"(",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
";",
"// if both children of root are black, set root to red\r",
"if",
"(",
"(",
"root",
".",
"left",
"==",
"null",
"||",
"!",
"root",
".",
"left",
".",
"red",
")... | Remove the first element. | [
"Remove",
"the",
"first",
"element",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L380-L390 |
150,315 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.remove | public void remove(Node<T> node) {
if (first == node) {
removeMin();
return;
}
if (last == node) {
removeMax();
return;
}
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !root.right... | java | public void remove(Node<T> node) {
if (first == node) {
removeMin();
return;
}
if (last == node) {
removeMax();
return;
}
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !root.right... | [
"public",
"void",
"remove",
"(",
"Node",
"<",
"T",
">",
"node",
")",
"{",
"if",
"(",
"first",
"==",
"node",
")",
"{",
"removeMin",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"last",
"==",
"node",
")",
"{",
"removeMax",
"(",
")",
";",
"return... | Remove the given node. | [
"Remove",
"the",
"given",
"node",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L437-L453 |
150,316 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java | RedBlackTreeInteger.removeKey | public void removeKey(int key) {
if (key == first.value) {
removeMin();
return;
}
if (key == last.value) {
removeMax();
return;
}
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !r... | java | public void removeKey(int key) {
if (key == first.value) {
removeMin();
return;
}
if (key == last.value) {
removeMax();
return;
}
// if both children of root are black, set root to red
if ((root.left == null || !root.left.red) && (root.right == null || !r... | [
"public",
"void",
"removeKey",
"(",
"int",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"first",
".",
"value",
")",
"{",
"removeMin",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"key",
"==",
"last",
".",
"value",
")",
"{",
"removeMax",
"(",
")",
... | Remove the given key. The key MUST exists, else the tree won't be valid anymore. | [
"Remove",
"the",
"given",
"key",
".",
"The",
"key",
"MUST",
"exists",
"else",
"the",
"tree",
"won",
"t",
"be",
"valid",
"anymore",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeInteger.java#L526-L541 |
150,317 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/filters/Related.java | Related.with | public static Related with(CanonicalPath entityPath, String relationship) {
return new Related(entityPath, relationship, EntityRole.SOURCE);
} | java | public static Related with(CanonicalPath entityPath, String relationship) {
return new Related(entityPath, relationship, EntityRole.SOURCE);
} | [
"public",
"static",
"Related",
"with",
"(",
"CanonicalPath",
"entityPath",
",",
"String",
"relationship",
")",
"{",
"return",
"new",
"Related",
"(",
"entityPath",
",",
"relationship",
",",
"EntityRole",
".",
"SOURCE",
")",
";",
"}"
] | Specifies a filter for entities that are sources of a relationship with the specified entity.
@param entityPath the entity that is the target of the relationship
@param relationship the name of the relationship
@return a new "related" filter instance | [
"Specifies",
"a",
"filter",
"for",
"entities",
"that",
"are",
"sources",
"of",
"a",
"relationship",
"with",
"the",
"specified",
"entity",
"."
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/filters/Related.java#L44-L46 |
150,318 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/filters/Related.java | Related.asTargetWith | public static Related asTargetWith(CanonicalPath entityPath, String relationship) {
return new Related(entityPath, relationship, EntityRole.TARGET);
} | java | public static Related asTargetWith(CanonicalPath entityPath, String relationship) {
return new Related(entityPath, relationship, EntityRole.TARGET);
} | [
"public",
"static",
"Related",
"asTargetWith",
"(",
"CanonicalPath",
"entityPath",
",",
"String",
"relationship",
")",
"{",
"return",
"new",
"Related",
"(",
"entityPath",
",",
"relationship",
",",
"EntityRole",
".",
"TARGET",
")",
";",
"}"
] | Specifies a filter for entities that are targets of a relationship with the specified entity.
@param entityPath the entity that is the source of the relationship
@param relationship the name of the relationship
@return a new "related" filter instance | [
"Specifies",
"a",
"filter",
"for",
"entities",
"that",
"are",
"targets",
"of",
"a",
"relationship",
"with",
"the",
"specified",
"entity",
"."
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/filters/Related.java#L100-L102 |
150,319 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java | JoinPoint.addToJoinDoNotCancel | public synchronized void addToJoinDoNotCancel(ISynchronizationPoint<? extends TError> sp) {
nbToJoin++;
sp.listenInline(new Runnable() {
@Override
public void run() {
if (sp.hasError())
error(sp.getError());
else
joined();
}
});
if (Threading.debugSynchronization) Threading... | java | public synchronized void addToJoinDoNotCancel(ISynchronizationPoint<? extends TError> sp) {
nbToJoin++;
sp.listenInline(new Runnable() {
@Override
public void run() {
if (sp.hasError())
error(sp.getError());
else
joined();
}
});
if (Threading.debugSynchronization) Threading... | [
"public",
"synchronized",
"void",
"addToJoinDoNotCancel",
"(",
"ISynchronizationPoint",
"<",
"?",
"extends",
"TError",
">",
"sp",
")",
"{",
"nbToJoin",
"++",
";",
"sp",
".",
"listenInline",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"v... | Similar to addToJoin, but in case the synchronization point is cancelled,
it is simply consider as done, and do not cancel this JoinPoint. | [
"Similar",
"to",
"addToJoin",
"but",
"in",
"case",
"the",
"synchronization",
"point",
"is",
"cancelled",
"it",
"is",
"simply",
"consider",
"as",
"done",
"and",
"do",
"not",
"cancel",
"this",
"JoinPoint",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java#L97-L109 |
150,320 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java | JoinPoint.listenInline | public static void listenInline(Runnable listener, ISynchronizationPoint<?>... synchPoints) {
JoinPoint<Exception> jp = new JoinPoint<>();
for (int i = 0; i < synchPoints.length; ++i)
if (synchPoints[i] != null)
jp.addToJoin(synchPoints[i]);
jp.start();
jp.listenInline(listener);
} | java | public static void listenInline(Runnable listener, ISynchronizationPoint<?>... synchPoints) {
JoinPoint<Exception> jp = new JoinPoint<>();
for (int i = 0; i < synchPoints.length; ++i)
if (synchPoints[i] != null)
jp.addToJoin(synchPoints[i]);
jp.start();
jp.listenInline(listener);
} | [
"public",
"static",
"void",
"listenInline",
"(",
"Runnable",
"listener",
",",
"ISynchronizationPoint",
"<",
"?",
">",
"...",
"synchPoints",
")",
"{",
"JoinPoint",
"<",
"Exception",
">",
"jp",
"=",
"new",
"JoinPoint",
"<>",
"(",
")",
";",
"for",
"(",
"int",... | Shortcut method to create a JoinPoint waiting for the given synchronization points, start the JoinPoint,
and add the given listener to be called when the JoinPoint is unblocked.
If any synchronization point has an error or is cancelled, the JoinPoint is immediately unblocked.
If some given synchronization points are nu... | [
"Shortcut",
"method",
"to",
"create",
"a",
"JoinPoint",
"waiting",
"for",
"the",
"given",
"synchronization",
"points",
"start",
"the",
"JoinPoint",
"and",
"add",
"the",
"given",
"listener",
"to",
"be",
"called",
"when",
"the",
"JoinPoint",
"is",
"unblocked",
"... | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java#L275-L282 |
150,321 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java | JoinPoint.listenInlineOnAllDone | public static void listenInlineOnAllDone(Runnable listener, ISynchronizationPoint<?>... synchPoints) {
JoinPoint<NoException> jp = new JoinPoint<>();
jp.addToJoin(synchPoints.length);
Runnable jpr = new Runnable() {
@Override
public void run() {
jp.joined();
}
};
for (int i = 0; i < sync... | java | public static void listenInlineOnAllDone(Runnable listener, ISynchronizationPoint<?>... synchPoints) {
JoinPoint<NoException> jp = new JoinPoint<>();
jp.addToJoin(synchPoints.length);
Runnable jpr = new Runnable() {
@Override
public void run() {
jp.joined();
}
};
for (int i = 0; i < sync... | [
"public",
"static",
"void",
"listenInlineOnAllDone",
"(",
"Runnable",
"listener",
",",
"ISynchronizationPoint",
"<",
"?",
">",
"...",
"synchPoints",
")",
"{",
"JoinPoint",
"<",
"NoException",
">",
"jp",
"=",
"new",
"JoinPoint",
"<>",
"(",
")",
";",
"jp",
"."... | Shortcut method to create a JoinPoint waiting for the given synchronization points, start the JoinPoint,
and add the given listener to be called when the JoinPoint is unblocked.
The JoinPoint is not unblocked until all synchronization points are unblocked.
If any has error or is cancel, the error or cancellation reason... | [
"Shortcut",
"method",
"to",
"create",
"a",
"JoinPoint",
"waiting",
"for",
"the",
"given",
"synchronization",
"points",
"start",
"the",
"JoinPoint",
"and",
"add",
"the",
"given",
"listener",
"to",
"be",
"called",
"when",
"the",
"JoinPoint",
"is",
"unblocked",
"... | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/JoinPoint.java#L291-L304 |
150,322 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java | DirectoryAgentInfo.from | public static DirectoryAgentInfo from(DAAdvert daAdvert)
{
return new DirectoryAgentInfo(daAdvert.getURL(), daAdvert.getScopes(), daAdvert.getAttributes(), daAdvert.getLanguage(), daAdvert.getBootTime());
} | java | public static DirectoryAgentInfo from(DAAdvert daAdvert)
{
return new DirectoryAgentInfo(daAdvert.getURL(), daAdvert.getScopes(), daAdvert.getAttributes(), daAdvert.getLanguage(), daAdvert.getBootTime());
} | [
"public",
"static",
"DirectoryAgentInfo",
"from",
"(",
"DAAdvert",
"daAdvert",
")",
"{",
"return",
"new",
"DirectoryAgentInfo",
"(",
"daAdvert",
".",
"getURL",
"(",
")",
",",
"daAdvert",
".",
"getScopes",
"(",
")",
",",
"daAdvert",
".",
"getAttributes",
"(",
... | Creates a new DirectoryAgentInfo from the given DAAdvert message.
@param daAdvert the DAAdvert message from which create the DirectoryAgentInfo
@return a new DirectoryAgentInfo from the given DAAdvert message | [
"Creates",
"a",
"new",
"DirectoryAgentInfo",
"from",
"the",
"given",
"DAAdvert",
"message",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java#L54-L57 |
150,323 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java | DirectoryAgentInfo.from | public static DirectoryAgentInfo from(String address)
{
return from(address, Scopes.ANY, Attributes.NONE, null, -1);
} | java | public static DirectoryAgentInfo from(String address)
{
return from(address, Scopes.ANY, Attributes.NONE, null, -1);
} | [
"public",
"static",
"DirectoryAgentInfo",
"from",
"(",
"String",
"address",
")",
"{",
"return",
"from",
"(",
"address",
",",
"Scopes",
".",
"ANY",
",",
"Attributes",
".",
"NONE",
",",
"null",
",",
"-",
"1",
")",
";",
"}"
] | Creates a new DirectoryAgentInfo from the given IP address.
@param address the IP address of the DirectoryAgent
@return a new DirectoryAgentInfo with the given address, any scope, no attributes, no language and no boot time.
@see #from(String, Scopes, Attributes, String, int) | [
"Creates",
"a",
"new",
"DirectoryAgentInfo",
"from",
"the",
"given",
"IP",
"address",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java#L66-L69 |
150,324 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java | DirectoryAgentInfo.from | public static DirectoryAgentInfo from(String address, Scopes scopes, Attributes attributes, String language, int bootTime)
{
return new DirectoryAgentInfo(SERVICE_TYPE.asString() + "://" + address, scopes, attributes, language, bootTime);
} | java | public static DirectoryAgentInfo from(String address, Scopes scopes, Attributes attributes, String language, int bootTime)
{
return new DirectoryAgentInfo(SERVICE_TYPE.asString() + "://" + address, scopes, attributes, language, bootTime);
} | [
"public",
"static",
"DirectoryAgentInfo",
"from",
"(",
"String",
"address",
",",
"Scopes",
"scopes",
",",
"Attributes",
"attributes",
",",
"String",
"language",
",",
"int",
"bootTime",
")",
"{",
"return",
"new",
"DirectoryAgentInfo",
"(",
"SERVICE_TYPE",
".",
"a... | Creates a new DirectoryAgentInfo from the given arguments.
@param address the IP address of the DirectoryAgent
@param scopes the Scopes of the DirectoryAgent
@param attributes the Attributes of the DirectoryAgent
@param language the language of the DirectoryAgent
@param bootTime the boot time, in seconds, o... | [
"Creates",
"a",
"new",
"DirectoryAgentInfo",
"from",
"the",
"given",
"arguments",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/da/DirectoryAgentInfo.java#L82-L85 |
150,325 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java | Iterators.singleIterator | public static <T> Iterator<T> singleIterator(T t) {
Require.nonNull(t, "t");
return Collections.singleton(t).iterator();
} | java | public static <T> Iterator<T> singleIterator(T t) {
Require.nonNull(t, "t");
return Collections.singleton(t).iterator();
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"singleIterator",
"(",
"T",
"t",
")",
"{",
"Require",
".",
"nonNull",
"(",
"t",
",",
"\"t\"",
")",
";",
"return",
"Collections",
".",
"singleton",
"(",
"t",
")",
".",
"iterator",
"(",
")... | Creates an Iterator over the single given element.
@param t The element.
@return Iterator returning the single element. | [
"Creates",
"an",
"Iterator",
"over",
"the",
"single",
"given",
"element",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java#L26-L29 |
150,326 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java | Iterators.filter | public static <T> Iterator<T> filter(Iterator<T> it, Predicate<T> filter) {
return new Iterator<T>() {
private T cached = null;
@Override
public boolean hasNext() {
if (this.cached != null) {
return true;
}
... | java | public static <T> Iterator<T> filter(Iterator<T> it, Predicate<T> filter) {
return new Iterator<T>() {
private T cached = null;
@Override
public boolean hasNext() {
if (this.cached != null) {
return true;
}
... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"filter",
"(",
"Iterator",
"<",
"T",
">",
"it",
",",
"Predicate",
"<",
"T",
">",
"filter",
")",
"{",
"return",
"new",
"Iterator",
"<",
"T",
">",
"(",
")",
"{",
"private",
"T",
"cached"... | Creates an iterator that returns a filtered view of the input iterator.
@param it The source iterator.
@param filter The predicate to match elements that should occur in the result.
@return The filtered iterator. | [
"Creates",
"an",
"iterator",
"that",
"returns",
"a",
"filtered",
"view",
"of",
"the",
"input",
"iterator",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java#L38-L72 |
150,327 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java | Iterators.iterableOf | public static <T> Iterable<T> iterableOf(Iterator<T> it) {
final Iterator<T> theIt = Require.nonNull(it, "it");
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return theIt;
}
};
} | java | public static <T> Iterable<T> iterableOf(Iterator<T> it) {
final Iterator<T> theIt = Require.nonNull(it, "it");
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return theIt;
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"iterableOf",
"(",
"Iterator",
"<",
"T",
">",
"it",
")",
"{",
"final",
"Iterator",
"<",
"T",
">",
"theIt",
"=",
"Require",
".",
"nonNull",
"(",
"it",
",",
"\"it\"",
")",
";",
"return",
... | Wraps the given Iterator into an Iterable.
@param it The Iterator to wrap.
@return An {@link Iterable} which returns the given Iterator. | [
"Wraps",
"the",
"given",
"Iterator",
"into",
"an",
"Iterable",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java#L80-L89 |
150,328 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java | Iterators.compositeIterator | @SafeVarargs
public static <T> ElementIterator<T> compositeIterator(Iterator<T>... iterators) {
Require.nonNull(iterators, "iterators");
final Iterator<T> result;
if (iterators.length == 0) {
result = Collections.emptyIterator();
} else if (iterators.length == 1) {
... | java | @SafeVarargs
public static <T> ElementIterator<T> compositeIterator(Iterator<T>... iterators) {
Require.nonNull(iterators, "iterators");
final Iterator<T> result;
if (iterators.length == 0) {
result = Collections.emptyIterator();
} else if (iterators.length == 1) {
... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"ElementIterator",
"<",
"T",
">",
"compositeIterator",
"(",
"Iterator",
"<",
"T",
">",
"...",
"iterators",
")",
"{",
"Require",
".",
"nonNull",
"(",
"iterators",
",",
"\"iterators\"",
")",
";",
"final"... | Creates an iterator which subsequently iterates over all given iterators.
@param iterators An array of iterators.
@return A composite iterator iterating the values of all given iterators
in given order. | [
"Creates",
"an",
"iterator",
"which",
"subsequently",
"iterates",
"over",
"all",
"given",
"iterators",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java#L98-L114 |
150,329 | skuzzle/TinyPlugz | tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java | Iterators.compositeIterable | @SafeVarargs
@SuppressWarnings("unchecked")
public static <T> Iterable<T> compositeIterable(Iterable<T>...iterables) {
Require.nonNull(iterables, "iterables");
final Iterator<T> it;
if (iterables.length == 0) {
it = Collections.emptyIterator();
} else if (iterables.le... | java | @SafeVarargs
@SuppressWarnings("unchecked")
public static <T> Iterable<T> compositeIterable(Iterable<T>...iterables) {
Require.nonNull(iterables, "iterables");
final Iterator<T> it;
if (iterables.length == 0) {
it = Collections.emptyIterator();
} else if (iterables.le... | [
"@",
"SafeVarargs",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"compositeIterable",
"(",
"Iterable",
"<",
"T",
">",
"...",
"iterables",
")",
"{",
"Require",
".",
"nonNull",
"(",
"iterab... | Creates an iterable which returns a composite iterator over all iterators
of the given iterables.
@param iterables The Iterables to wrap.
@return A composite iterable. | [
"Creates",
"an",
"iterable",
"which",
"returns",
"a",
"composite",
"iterator",
"over",
"all",
"iterators",
"of",
"the",
"given",
"iterables",
"."
] | 739858ed0ba5a0c75b6ccf18df9a4d5612374a4b | https://github.com/skuzzle/TinyPlugz/blob/739858ed0ba5a0c75b6ccf18df9a4d5612374a4b/tiny-plugz/src/main/java/de/skuzzle/tinyplugz/util/Iterators.java#L123-L139 |
150,330 | rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_permute.java | DZcs_permute.cs_permute | public static DZcs cs_permute(DZcs A, int[] pinv, int[] q, boolean values)
{
int t, j, k, nz = 0, m, n, Ap[], Ai[], Cp[], Ci[] ;
DZcsa Cx = new DZcsa(), Ax = new DZcsa() ;
DZcs C ;
if (!CS_CSC(A)) return (null); /* check inputs */
m = A.m ; n = A.n ; Ap = A.p ; Ai = A.i ; Ax.x = A.x ;
C = cs_spallo... | java | public static DZcs cs_permute(DZcs A, int[] pinv, int[] q, boolean values)
{
int t, j, k, nz = 0, m, n, Ap[], Ai[], Cp[], Ci[] ;
DZcsa Cx = new DZcsa(), Ax = new DZcsa() ;
DZcs C ;
if (!CS_CSC(A)) return (null); /* check inputs */
m = A.m ; n = A.n ; Ap = A.p ; Ai = A.i ; Ax.x = A.x ;
C = cs_spallo... | [
"public",
"static",
"DZcs",
"cs_permute",
"(",
"DZcs",
"A",
",",
"int",
"[",
"]",
"pinv",
",",
"int",
"[",
"]",
"q",
",",
"boolean",
"values",
")",
"{",
"int",
"t",
",",
"j",
",",
"k",
",",
"nz",
"=",
"0",
",",
"m",
",",
"n",
",",
"Ap",
"["... | Permutes a sparse matrix, C = PAQ.
@param A
m-by-n, column-compressed matrix
@param pinv
a permutation vector of length m
@param q
a permutation vector of length n
@param values
allocate pattern only if false, values and pattern otherwise
@return C = PAQ, null on error | [
"Permutes",
"a",
"sparse",
"matrix",
"C",
"=",
"PAQ",
"."
] | 6a6f66bccce1558156a961494358952603b0ac84 | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_permute.java#L55-L77 |
150,331 | GerdHolz/TOVAL | src/de/invation/code/toval/types/Multiset.java | Multiset.size | public int size() {
int result = 0;
for (O o : multiplicities.keySet()) {
result += multiplicity(o);
}
return result;
} | java | public int size() {
int result = 0;
for (O o : multiplicities.keySet()) {
result += multiplicity(o);
}
return result;
} | [
"public",
"int",
"size",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"O",
"o",
":",
"multiplicities",
".",
"keySet",
"(",
")",
")",
"{",
"result",
"+=",
"multiplicity",
"(",
"o",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Returns the number of elements, i.e. the sum of all multiplicities.
@return The number of all elements. | [
"Returns",
"the",
"number",
"of",
"elements",
"i",
".",
"e",
".",
"the",
"sum",
"of",
"all",
"multiplicities",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/Multiset.java#L61-L67 |
150,332 | GerdHolz/TOVAL | src/de/invation/code/toval/types/Multiset.java | Multiset.addAll | public void addAll(O... objects) throws ParameterException {
Validate.notNull(objects);
for (O o : objects) {
incMultiplicity(o);
}
} | java | public void addAll(O... objects) throws ParameterException {
Validate.notNull(objects);
for (O o : objects) {
incMultiplicity(o);
}
} | [
"public",
"void",
"addAll",
"(",
"O",
"...",
"objects",
")",
"throws",
"ParameterException",
"{",
"Validate",
".",
"notNull",
"(",
"objects",
")",
";",
"for",
"(",
"O",
"o",
":",
"objects",
")",
"{",
"incMultiplicity",
"(",
"o",
")",
";",
"}",
"}"
] | Adds all given objects to this multiset.
@param objects The objects to be added.
@throws ParameterException | [
"Adds",
"all",
"given",
"objects",
"to",
"this",
"multiset",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/Multiset.java#L118-L123 |
150,333 | GerdHolz/TOVAL | src/de/invation/code/toval/types/Multiset.java | Multiset.remove | public boolean remove(O object) {
Integer multiplicity = multiplicities.get(object);
if (multiplicities.remove(object) == null) {
return false;
}
decMultiplicityCount(multiplicity);
return true;
} | java | public boolean remove(O object) {
Integer multiplicity = multiplicities.get(object);
if (multiplicities.remove(object) == null) {
return false;
}
decMultiplicityCount(multiplicity);
return true;
} | [
"public",
"boolean",
"remove",
"(",
"O",
"object",
")",
"{",
"Integer",
"multiplicity",
"=",
"multiplicities",
".",
"get",
"(",
"object",
")",
";",
"if",
"(",
"multiplicities",
".",
"remove",
"(",
"object",
")",
"==",
"null",
")",
"{",
"return",
"false",... | Removes the given object from this multiset.
@param object The object to remove.
@return <code>true</code> if the removal was successful;<br>
<code>false</code> if the multiset does not contain the given object. | [
"Removes",
"the",
"given",
"object",
"from",
"this",
"multiset",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/Multiset.java#L132-L139 |
150,334 | netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XmlValidationResult.java | XmlValidationResult.reset | public void reset() {
document = null;
systemId = null;
xsiNamespaces.clear();
schemas.clear();
bDtdUsed = false;
bXsdUsed = false;
bWellformed = false;
bValid = false;
} | java | public void reset() {
document = null;
systemId = null;
xsiNamespaces.clear();
schemas.clear();
bDtdUsed = false;
bXsdUsed = false;
bWellformed = false;
bValid = false;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"document",
"=",
"null",
";",
"systemId",
"=",
"null",
";",
"xsiNamespaces",
".",
"clear",
"(",
")",
";",
"schemas",
".",
"clear",
"(",
")",
";",
"bDtdUsed",
"=",
"false",
";",
"bXsdUsed",
"=",
"false",
";",
... | Reset fields. | [
"Reset",
"fields",
"."
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XmlValidationResult.java#L40-L49 |
150,335 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.startRead | public void startRead() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (!writer) {
// nobody is writing, we can read
readers++;
return;
}
// if someone is writing, we need to wait
if (readerWaiting == null)
readerWaiting = new SynchronizationPoint<NoException>();
sp ... | java | public void startRead() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (!writer) {
// nobody is writing, we can read
readers++;
return;
}
// if someone is writing, we need to wait
if (readerWaiting == null)
readerWaiting = new SynchronizationPoint<NoException>();
sp ... | [
"public",
"void",
"startRead",
"(",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"writer",
")",
"{",
"// nobody is writing, we can read",
"readers",
"++",
";",
"return",
";",
"}"... | To call when a thread wants to enter read mode.
If the lock point is used in write mode, this method will block until it is released. | [
"To",
"call",
"when",
"a",
"thread",
"wants",
"to",
"enter",
"read",
"mode",
".",
"If",
"the",
"lock",
"point",
"is",
"used",
"in",
"write",
"mode",
"this",
"method",
"will",
"block",
"until",
"it",
"is",
"released",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L25-L40 |
150,336 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.startReadAsync | public SynchronizationPoint<NoException> startReadAsync(boolean returnNullIfReady) {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (!writer) {
// nobody is writing, we can read
readers++;
return returnNullIfReady ? null : new SynchronizationPoint<>(true);
}
// if someone is wri... | java | public SynchronizationPoint<NoException> startReadAsync(boolean returnNullIfReady) {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (!writer) {
// nobody is writing, we can read
readers++;
return returnNullIfReady ? null : new SynchronizationPoint<>(true);
}
// if someone is wri... | [
"public",
"SynchronizationPoint",
"<",
"NoException",
">",
"startReadAsync",
"(",
"boolean",
"returnNullIfReady",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"writer",
")",
"{",
"... | To call when a thread wants to enter read mode.
If the lock point is used in write mode, this method will return a SynchronizationPoint unblocked when read can start. | [
"To",
"call",
"when",
"a",
"thread",
"wants",
"to",
"enter",
"read",
"mode",
".",
"If",
"the",
"lock",
"point",
"is",
"used",
"in",
"write",
"mode",
"this",
"method",
"will",
"return",
"a",
"SynchronizationPoint",
"unblocked",
"when",
"read",
"can",
"start... | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L53-L68 |
150,337 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.endRead | public void endRead() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if others are still reading, nothing to do
if (--readers > 0) return;
// if nobody is waiting to write, nothing to do
if (writersWaiting == null) return;
sp = writersWaiting.removeFirst();
if (writersWaiting.isE... | java | public void endRead() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if others are still reading, nothing to do
if (--readers > 0) return;
// if nobody is waiting to write, nothing to do
if (writersWaiting == null) return;
sp = writersWaiting.removeFirst();
if (writersWaiting.isE... | [
"public",
"void",
"endRead",
"(",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"// if others are still reading, nothing to do",
"if",
"(",
"--",
"readers",
">",
"0",
")",
"return",
";",
"// if nobod... | To call when the thread leaves the read mode and release this lock point. | [
"To",
"call",
"when",
"the",
"thread",
"leaves",
"the",
"read",
"mode",
"and",
"release",
"this",
"lock",
"point",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L71-L83 |
150,338 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.startWrite | public void startWrite() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if nobody is using the resource, we can start writing
if (readers == 0 && !writer) {
writer = true;
return;
}
// someone is doing something, we need to block
sp = new SynchronizationPoint<NoException>();... | java | public void startWrite() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if nobody is using the resource, we can start writing
if (readers == 0 && !writer) {
writer = true;
return;
}
// someone is doing something, we need to block
sp = new SynchronizationPoint<NoException>();... | [
"public",
"void",
"startWrite",
"(",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"// if nobody is using the resource, we can start writing",
"if",
"(",
"readers",
"==",
"0",
"&&",
"!",
"writer",
")",... | To call when a thread wants to enter write mode.
If the lock point is used in read mode, this method will block until it is released. | [
"To",
"call",
"when",
"a",
"thread",
"wants",
"to",
"enter",
"write",
"mode",
".",
"If",
"the",
"lock",
"point",
"is",
"used",
"in",
"read",
"mode",
"this",
"method",
"will",
"block",
"until",
"it",
"is",
"released",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L88-L102 |
150,339 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.startWriteAsync | public SynchronizationPoint<NoException> startWriteAsync(boolean returnNullIfReady) {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if nobody is using the resource, we can start writing
if (readers == 0 && !writer) {
writer = true;
return returnNullIfReady ? null : new Synchronization... | java | public SynchronizationPoint<NoException> startWriteAsync(boolean returnNullIfReady) {
SynchronizationPoint<NoException> sp;
synchronized (this) {
// if nobody is using the resource, we can start writing
if (readers == 0 && !writer) {
writer = true;
return returnNullIfReady ? null : new Synchronization... | [
"public",
"SynchronizationPoint",
"<",
"NoException",
">",
"startWriteAsync",
"(",
"boolean",
"returnNullIfReady",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"// if nobody is using the resource, we can star... | To call when a thread wants to enter write mode.
If write can start immediately, this method returns null.
If the lock point is used in read mode, this method will return a SynchronizationPoint unblocked when write can start. | [
"To",
"call",
"when",
"a",
"thread",
"wants",
"to",
"enter",
"write",
"mode",
".",
"If",
"write",
"can",
"start",
"immediately",
"this",
"method",
"returns",
"null",
".",
"If",
"the",
"lock",
"point",
"is",
"used",
"in",
"read",
"mode",
"this",
"method",... | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L116-L130 |
150,340 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java | ReadWriteLockPoint.endWrite | public void endWrite() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (readerWaiting != null) {
// some readers are waiting, we unblock them
sp = readerWaiting;
readerWaiting = null;
writer = false;
} else if (writersWaiting != null) {
sp = writersWaiting.removeFirst();
... | java | public void endWrite() {
SynchronizationPoint<NoException> sp;
synchronized (this) {
if (readerWaiting != null) {
// some readers are waiting, we unblock them
sp = readerWaiting;
readerWaiting = null;
writer = false;
} else if (writersWaiting != null) {
sp = writersWaiting.removeFirst();
... | [
"public",
"void",
"endWrite",
"(",
")",
"{",
"SynchronizationPoint",
"<",
"NoException",
">",
"sp",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"readerWaiting",
"!=",
"null",
")",
"{",
"// some readers are waiting, we unblock them",
"sp",
"=",
"reader... | To call when the thread leaves the write mode and release this lock point. | [
"To",
"call",
"when",
"the",
"thread",
"leaves",
"the",
"write",
"mode",
"and",
"release",
"this",
"lock",
"point",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/ReadWriteLockPoint.java#L133-L152 |
150,341 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/monitor/MonitorObserver.java | MonitorObserver.update | @Override
public void update(Observable o, Object arg) {
if (arg instanceof String) {
lines.add((String) arg);
}
if (arg instanceof List<?>) {
lines.addAll((List<String>) arg);
}
if (arg instanceof Exception) {
Exception e = (Exception) arg... | java | @Override
public void update(Observable o, Object arg) {
if (arg instanceof String) {
lines.add((String) arg);
}
if (arg instanceof List<?>) {
lines.addAll((List<String>) arg);
}
if (arg instanceof Exception) {
Exception e = (Exception) arg... | [
"@",
"Override",
"public",
"void",
"update",
"(",
"Observable",
"o",
",",
"Object",
"arg",
")",
"{",
"if",
"(",
"arg",
"instanceof",
"String",
")",
"{",
"lines",
".",
"add",
"(",
"(",
"String",
")",
"arg",
")",
";",
"}",
"if",
"(",
"arg",
"instance... | Inherited from Observer
@param o
@param arg | [
"Inherited",
"from",
"Observer"
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/monitor/MonitorObserver.java#L36-L49 |
150,342 | mytechia/mytechia_commons | mytechia_commons_library/src/main/java/com/mytechia/commons/util/net/IPUtil.java | IPUtil.isValidLocalIP | public static boolean isValidLocalIP(InetAddress ip) throws SocketException {
String ipStr = ip.getHostAddress();
Iterator ips = getAllIPAddresses().iterator();
while (ips.hasNext()) {
InetAddress ip2 = (InetAddress) ips.next();
if (ip2.getHostAddress().equals(... | java | public static boolean isValidLocalIP(InetAddress ip) throws SocketException {
String ipStr = ip.getHostAddress();
Iterator ips = getAllIPAddresses().iterator();
while (ips.hasNext()) {
InetAddress ip2 = (InetAddress) ips.next();
if (ip2.getHostAddress().equals(... | [
"public",
"static",
"boolean",
"isValidLocalIP",
"(",
"InetAddress",
"ip",
")",
"throws",
"SocketException",
"{",
"String",
"ipStr",
"=",
"ip",
".",
"getHostAddress",
"(",
")",
";",
"Iterator",
"ips",
"=",
"getAllIPAddresses",
"(",
")",
".",
"iterator",
"(",
... | Decides whether an IP is local or not | [
"Decides",
"whether",
"an",
"IP",
"is",
"local",
"or",
"not"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia_commons_library/src/main/java/com/mytechia/commons/util/net/IPUtil.java#L100-L112 |
150,343 | GerdHolz/TOVAL | src/de/invation/code/toval/reflect/ReflectionUtils.java | ReflectionUtils.getInterfaces | public static LinkedHashSet<Class<?>> getInterfaces(Class<?> clazz) throws ReflectionException {
Validate.notNull(clazz);
try {
LinkedHashSet<Class<?>> interfaces = new LinkedHashSet<>();
interfaces.addAll(Arrays.asList(clazz.getInterfaces()));
LinkedHashSet<Class<?>... | java | public static LinkedHashSet<Class<?>> getInterfaces(Class<?> clazz) throws ReflectionException {
Validate.notNull(clazz);
try {
LinkedHashSet<Class<?>> interfaces = new LinkedHashSet<>();
interfaces.addAll(Arrays.asList(clazz.getInterfaces()));
LinkedHashSet<Class<?>... | [
"public",
"static",
"LinkedHashSet",
"<",
"Class",
"<",
"?",
">",
">",
"getInterfaces",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"throws",
"ReflectionException",
"{",
"Validate",
".",
"notNull",
"(",
"clazz",
")",
";",
"try",
"{",
"LinkedHashSet",
"<",
... | Returns all implemented interfaces of the given class.
@param clazz Class to read interfaces from.
@return {@link LinkedHashSet} of interfaces.
@throws ReflectionException If interfaces can't be read. | [
"Returns",
"all",
"implemented",
"interfaces",
"of",
"the",
"given",
"class",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/reflect/ReflectionUtils.java#L267-L281 |
150,344 | xfcjscn/sudoor-server-lib | src/main/java/net/gplatform/sudoor/server/security/model/DefaultPermissionEvaluator.java | DefaultPermissionEvaluator.getExpressionString | public String getExpressionString(String name, Object permission) {
String expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name + "." + permission);
//Get generic permit
if (expression == null) {
expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name);
}
//Get parent permit
... | java | public String getExpressionString(String name, Object permission) {
String expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name + "." + permission);
//Get generic permit
if (expression == null) {
expression = properties.getProperty(CONFIG_EXPRESSION_PREFIX + name);
}
//Get parent permit
... | [
"public",
"String",
"getExpressionString",
"(",
"String",
"name",
",",
"Object",
"permission",
")",
"{",
"String",
"expression",
"=",
"properties",
".",
"getProperty",
"(",
"CONFIG_EXPRESSION_PREFIX",
"+",
"name",
"+",
"\".\"",
"+",
"permission",
")",
";",
"//Ge... | Find the expression string recursively from the config file
@param name
@param permission
@return | [
"Find",
"the",
"expression",
"string",
"recursively",
"from",
"the",
"config",
"file"
] | 37dc1996eaa9cad25c82abd1de315ba565e32097 | https://github.com/xfcjscn/sudoor-server-lib/blob/37dc1996eaa9cad25c82abd1de315ba565e32097/src/main/java/net/gplatform/sudoor/server/security/model/DefaultPermissionEvaluator.java#L75-L91 |
150,345 | ppi-ag/thymeleaf-mailto | src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java | MailAttrProcessor.createMailToLink | private String createMailToLink(String to, String bcc, String cc,
String subject, String body) {
Validate.notNull(to, "You must define a to-address");
final StringBuilder urlBuilder = new StringBuilder("mailto:");
addEncodedValue(urlBuilder, "to", to);
if (bcc != null || cc !... | java | private String createMailToLink(String to, String bcc, String cc,
String subject, String body) {
Validate.notNull(to, "You must define a to-address");
final StringBuilder urlBuilder = new StringBuilder("mailto:");
addEncodedValue(urlBuilder, "to", to);
if (bcc != null || cc !... | [
"private",
"String",
"createMailToLink",
"(",
"String",
"to",
",",
"String",
"bcc",
",",
"String",
"cc",
",",
"String",
"subject",
",",
"String",
"body",
")",
"{",
"Validate",
".",
"notNull",
"(",
"to",
",",
"\"You must define a to-address\"",
")",
";",
"fin... | Creates the mailto-link.
@param to the to-address
@param bcc optional a bcc
@param cc optional a cc
@param subject optional a subject
@param body optional a body
@return the link. | [
"Creates",
"the",
"mailto",
"-",
"link",
"."
] | e44330be1d6906c5d4626d961e95814581f0245f | https://github.com/ppi-ag/thymeleaf-mailto/blob/e44330be1d6906c5d4626d961e95814581f0245f/src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java#L89-L105 |
150,346 | ppi-ag/thymeleaf-mailto | src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java | MailAttrProcessor.addEncodedValue | private void addEncodedValue(final StringBuilder urlBuilder,
final String name, String value) {
if (value != null) {
String encodedValue;
if (!"to".equals(name) && !urlBuilder.toString().endsWith("?")) {
urlBuilder.append('&');
}
try {
... | java | private void addEncodedValue(final StringBuilder urlBuilder,
final String name, String value) {
if (value != null) {
String encodedValue;
if (!"to".equals(name) && !urlBuilder.toString().endsWith("?")) {
urlBuilder.append('&');
}
try {
... | [
"private",
"void",
"addEncodedValue",
"(",
"final",
"StringBuilder",
"urlBuilder",
",",
"final",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"String",
"encodedValue",
";",
"if",
"(",
"!",
"\"to\"",
".",
... | Added more information to the urlbuilder.
@param urlBuilder an urlbuilder.
@param name the name of the attribute.
@param value the value. | [
"Added",
"more",
"information",
"to",
"the",
"urlbuilder",
"."
] | e44330be1d6906c5d4626d961e95814581f0245f | https://github.com/ppi-ag/thymeleaf-mailto/blob/e44330be1d6906c5d4626d961e95814581f0245f/src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java#L114-L134 |
150,347 | ppi-ag/thymeleaf-mailto | src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java | MailAttrProcessor.extractAttribute | private String extractAttribute(Element element, Arguments arguments,
String attributeName) {
final String toExpr = element.getAttributeValue(attributeName);
if (toExpr == null) {
return null;
}
final String to;
if (toExpr.contains("#") || toExpr.contains(... | java | private String extractAttribute(Element element, Arguments arguments,
String attributeName) {
final String toExpr = element.getAttributeValue(attributeName);
if (toExpr == null) {
return null;
}
final String to;
if (toExpr.contains("#") || toExpr.contains(... | [
"private",
"String",
"extractAttribute",
"(",
"Element",
"element",
",",
"Arguments",
"arguments",
",",
"String",
"attributeName",
")",
"{",
"final",
"String",
"toExpr",
"=",
"element",
".",
"getAttributeValue",
"(",
"attributeName",
")",
";",
"if",
"(",
"toExpr... | Extract the attribute.
@param element the element where to search.
@param arguments thymeleaf arguments.
@param attributeName the name of the attribute.
@return the value of the attribute. | [
"Extract",
"the",
"attribute",
"."
] | e44330be1d6906c5d4626d961e95814581f0245f | https://github.com/ppi-ag/thymeleaf-mailto/blob/e44330be1d6906c5d4626d961e95814581f0245f/src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java#L144-L158 |
150,348 | ppi-ag/thymeleaf-mailto | src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java | MailAttrProcessor.parse | private String parse(final Arguments arguments, String input) {
final Configuration configuration = arguments.getConfiguration();
final IStandardExpressionParser parser =
StandardExpressions.getExpressionParser(configuration);
final IStandardExpression expression =
... | java | private String parse(final Arguments arguments, String input) {
final Configuration configuration = arguments.getConfiguration();
final IStandardExpressionParser parser =
StandardExpressions.getExpressionParser(configuration);
final IStandardExpression expression =
... | [
"private",
"String",
"parse",
"(",
"final",
"Arguments",
"arguments",
",",
"String",
"input",
")",
"{",
"final",
"Configuration",
"configuration",
"=",
"arguments",
".",
"getConfiguration",
"(",
")",
";",
"final",
"IStandardExpressionParser",
"parser",
"=",
"Stand... | Parse the expression of an value.
@param arguments thymeleaf arguments.
@param input the expression.
@return the eavluated valued. | [
"Parse",
"the",
"expression",
"of",
"an",
"value",
"."
] | e44330be1d6906c5d4626d961e95814581f0245f | https://github.com/ppi-ag/thymeleaf-mailto/blob/e44330be1d6906c5d4626d961e95814581f0245f/src/main/java/de/ppi/fuwesta/thymeleaf/mail/MailAttrProcessor.java#L175-L185 |
150,349 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java | ID3v2Header.checkHeader | private boolean checkHeader(RandomAccessInputStream raf) throws IOException
{
raf.seek(HEAD_LOCATION);
byte[] buf = new byte[HEAD_SIZE];
if (raf.read(buf) != HEAD_SIZE)
{
throw new IOException("Error encountered finding id3v2 header");
}
String result = new String(buf, ENC_TYPE);
if (result.substrin... | java | private boolean checkHeader(RandomAccessInputStream raf) throws IOException
{
raf.seek(HEAD_LOCATION);
byte[] buf = new byte[HEAD_SIZE];
if (raf.read(buf) != HEAD_SIZE)
{
throw new IOException("Error encountered finding id3v2 header");
}
String result = new String(buf, ENC_TYPE);
if (result.substrin... | [
"private",
"boolean",
"checkHeader",
"(",
"RandomAccessInputStream",
"raf",
")",
"throws",
"IOException",
"{",
"raf",
".",
"seek",
"(",
"HEAD_LOCATION",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"HEAD_SIZE",
"]",
";",
"if",
"(",
"raf",
... | Checks to see if there is an id3v2 header in the file provided to the
constructor.
@return true if an id3v2 header exists in the file
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Checks",
"to",
"see",
"if",
"there",
"is",
"an",
"id3v2",
"header",
"in",
"the",
"file",
"provided",
"to",
"the",
"constructor",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java#L80-L103 |
150,350 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java | ID3v2Header.readHeader | private void readHeader(RandomAccessInputStream raf) throws IOException
{
raf.seek(HEAD_LOCATION);
byte[] head = new byte[HEAD_SIZE];
if (raf.read(head) != HEAD_SIZE)
{
throw new IOException("Error encountered reading id3v2 header");
}
majorVersion = (int) head[3];
if (majorVersion <= NEW_MAJOR_VER... | java | private void readHeader(RandomAccessInputStream raf) throws IOException
{
raf.seek(HEAD_LOCATION);
byte[] head = new byte[HEAD_SIZE];
if (raf.read(head) != HEAD_SIZE)
{
throw new IOException("Error encountered reading id3v2 header");
}
majorVersion = (int) head[3];
if (majorVersion <= NEW_MAJOR_VER... | [
"private",
"void",
"readHeader",
"(",
"RandomAccessInputStream",
"raf",
")",
"throws",
"IOException",
"{",
"raf",
".",
"seek",
"(",
"HEAD_LOCATION",
")",
";",
"byte",
"[",
"]",
"head",
"=",
"new",
"byte",
"[",
"HEAD_SIZE",
"]",
";",
"if",
"(",
"raf",
"."... | Extracts the information from the header.
@exception FileNotFoundException if an error occurs
@exception IOException if an error occurs | [
"Extracts",
"the",
"information",
"from",
"the",
"header",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java#L111-L132 |
150,351 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java | ID3v2Header.getBytes | public byte[] getBytes()
{
byte[] b = new byte[HEAD_SIZE];
int bytesCopied = 0;
System.arraycopy(Helpers.getBytesFromString(TAG_START, TAG_START.length(), ENC_TYPE), 0, b, 0, TAG_START.length());
bytesCopied += TAG_START.length();
b[bytesCopied++] = (byte) majorVersion;
b[bytesCopied++] = (byte) minorVers... | java | public byte[] getBytes()
{
byte[] b = new byte[HEAD_SIZE];
int bytesCopied = 0;
System.arraycopy(Helpers.getBytesFromString(TAG_START, TAG_START.length(), ENC_TYPE), 0, b, 0, TAG_START.length());
bytesCopied += TAG_START.length();
b[bytesCopied++] = (byte) majorVersion;
b[bytesCopied++] = (byte) minorVers... | [
"public",
"byte",
"[",
"]",
"getBytes",
"(",
")",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"HEAD_SIZE",
"]",
";",
"int",
"bytesCopied",
"=",
"0",
";",
"System",
".",
"arraycopy",
"(",
"Helpers",
".",
"getBytesFromString",
"(",
"TAG_START",
... | Return an array of bytes representing the header. This can be used
to easily write the header to a file.
@return a binary representation of this header | [
"Return",
"an",
"array",
"of",
"bytes",
"representing",
"the",
"header",
".",
"This",
"can",
"be",
"used",
"to",
"easily",
"write",
"the",
"header",
"to",
"a",
"file",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java#L140-L154 |
150,352 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java | ID3v2Header.getFlagByte | private byte getFlagByte()
{
byte ret = 0;
if (unsynchronisation) ret |= 0x80;
if (extended) ret |= 0x40;
if (experimental) ret |= 0x20;
if (footer) ret |= 0x10;
return ret;
} | java | private byte getFlagByte()
{
byte ret = 0;
if (unsynchronisation) ret |= 0x80;
if (extended) ret |= 0x40;
if (experimental) ret |= 0x20;
if (footer) ret |= 0x10;
return ret;
} | [
"private",
"byte",
"getFlagByte",
"(",
")",
"{",
"byte",
"ret",
"=",
"0",
";",
"if",
"(",
"unsynchronisation",
")",
"ret",
"|=",
"0x80",
";",
"if",
"(",
"extended",
")",
"ret",
"|=",
"0x40",
";",
"if",
"(",
"experimental",
")",
"ret",
"|=",
"0x20",
... | A helper function for the getBytes function that returns a byte with
the proper flags set.
@return the flags byte of this header | [
"A",
"helper",
"function",
"for",
"the",
"getBytes",
"function",
"that",
"returns",
"a",
"byte",
"with",
"the",
"proper",
"flags",
"set",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v2Header.java#L162-L172 |
150,353 | mytechia/mytechia_commons | mytechia_commons_library/src/main/java/com/mytechia/commons/util/math/MyVector.java | MyVector.module | public double module()
{
double v = 0;
for(int i=0; i<vector.length; i++) {
v = Math.pow(vector[i], 2);
}
return Math.sqrt(v);
} | java | public double module()
{
double v = 0;
for(int i=0; i<vector.length; i++) {
v = Math.pow(vector[i], 2);
}
return Math.sqrt(v);
} | [
"public",
"double",
"module",
"(",
")",
"{",
"double",
"v",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"vector",
".",
"length",
";",
"i",
"++",
")",
"{",
"v",
"=",
"Math",
".",
"pow",
"(",
"vector",
"[",
"i",
"]",
",",
... | Calculates the module of this vector
@return the module of this vector | [
"Calculates",
"the",
"module",
"of",
"this",
"vector"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia_commons_library/src/main/java/com/mytechia/commons/util/math/MyVector.java#L87-L98 |
150,354 | mytechia/mytechia_commons | mytechia_commons_library/src/main/java/com/mytechia/commons/util/math/MyVector.java | MyVector.normalize | public MyVector normalize()
{
double vmodule = module();
double [] associatedVector = new double [vector.length];
for(int i=0; i<vector.length; i++) {
associatedVector[i] = (1/vmodule) * vector[i];
}
return new MyVector(associat... | java | public MyVector normalize()
{
double vmodule = module();
double [] associatedVector = new double [vector.length];
for(int i=0; i<vector.length; i++) {
associatedVector[i] = (1/vmodule) * vector[i];
}
return new MyVector(associat... | [
"public",
"MyVector",
"normalize",
"(",
")",
"{",
"double",
"vmodule",
"=",
"module",
"(",
")",
";",
"double",
"[",
"]",
"associatedVector",
"=",
"new",
"double",
"[",
"vector",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | Calculates the associated normalized Vector of this Vector
@return the associated normalized Vector of this Vector | [
"Calculates",
"the",
"associated",
"normalized",
"Vector",
"of",
"this",
"Vector"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia_commons_library/src/main/java/com/mytechia/commons/util/math/MyVector.java#L105-L118 |
150,355 | icode/ameba-utils | src/main/java/ameba/util/bean/BeanMap.java | BeanMap.valueIterator | public Iterator<Object> valueIterator() {
final Iterator<String> iter = keyIterator();
return new Iterator<Object>() {
public boolean hasNext() {
return iter.hasNext();
}
public Object next() {
String key = iter.next();
... | java | public Iterator<Object> valueIterator() {
final Iterator<String> iter = keyIterator();
return new Iterator<Object>() {
public boolean hasNext() {
return iter.hasNext();
}
public Object next() {
String key = iter.next();
... | [
"public",
"Iterator",
"<",
"Object",
">",
"valueIterator",
"(",
")",
"{",
"final",
"Iterator",
"<",
"String",
">",
"iter",
"=",
"keyIterator",
"(",
")",
";",
"return",
"new",
"Iterator",
"<",
"Object",
">",
"(",
")",
"{",
"public",
"boolean",
"hasNext",
... | Convenience method for getting an iterator over the values.
@return an iterator over the values | [
"Convenience",
"method",
"for",
"getting",
"an",
"iterator",
"over",
"the",
"values",
"."
] | 1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35 | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/bean/BeanMap.java#L398-L414 |
150,356 | icode/ameba-utils | src/main/java/ameba/util/bean/BeanMap.java | BeanMap.getReadInvoker | public BeanInvoker getReadInvoker(String name) {
BeanInvoker invoker;
if (readInvokers.containsKey(name)) {
invoker = readInvokers.get(name);
} else {
invoker = getInvoker(readHandleType.get(name), name);
readInvokers.put(name, invoker);
}
retu... | java | public BeanInvoker getReadInvoker(String name) {
BeanInvoker invoker;
if (readInvokers.containsKey(name)) {
invoker = readInvokers.get(name);
} else {
invoker = getInvoker(readHandleType.get(name), name);
readInvokers.put(name, invoker);
}
retu... | [
"public",
"BeanInvoker",
"getReadInvoker",
"(",
"String",
"name",
")",
"{",
"BeanInvoker",
"invoker",
";",
"if",
"(",
"readInvokers",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"invoker",
"=",
"readInvokers",
".",
"get",
"(",
"name",
")",
";",
"}",
... | Returns the accessor for the property with the given name.
@param name the name of the property
@return the accessor method for the property, or null | [
"Returns",
"the",
"accessor",
"for",
"the",
"property",
"with",
"the",
"given",
"name",
"."
] | 1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35 | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/bean/BeanMap.java#L471-L480 |
150,357 | icode/ameba-utils | src/main/java/ameba/util/bean/BeanMap.java | BeanMap.getWriteInvoker | public BeanInvoker getWriteInvoker(String name) {
BeanInvoker invoker;
if (writeInvokers.containsKey(name)) {
invoker = writeInvokers.get(name);
} else {
invoker = getInvoker(HandleType.SET, name);
writeInvokers.put(name, invoker);
}
return inv... | java | public BeanInvoker getWriteInvoker(String name) {
BeanInvoker invoker;
if (writeInvokers.containsKey(name)) {
invoker = writeInvokers.get(name);
} else {
invoker = getInvoker(HandleType.SET, name);
writeInvokers.put(name, invoker);
}
return inv... | [
"public",
"BeanInvoker",
"getWriteInvoker",
"(",
"String",
"name",
")",
"{",
"BeanInvoker",
"invoker",
";",
"if",
"(",
"writeInvokers",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"invoker",
"=",
"writeInvokers",
".",
"get",
"(",
"name",
")",
";",
"}",... | Returns the mutator for the property with the given name.
@param name the name of the property
@return the mutator method for the property, or null | [
"Returns",
"the",
"mutator",
"for",
"the",
"property",
"with",
"the",
"given",
"name",
"."
] | 1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35 | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/bean/BeanMap.java#L488-L497 |
150,358 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamReader.java | XMLStreamReader.start | public static AsyncWork<XMLStreamReader, Exception> start(IO.Readable.Buffered io, int charactersBufferSize, int maxBuffers) {
AsyncWork<XMLStreamReader, Exception> result = new AsyncWork<>();
new Task.Cpu.FromRunnable("Start reading XML " + io.getSourceDescription(), io.getPriority(), () -> {
XMLStreamReader... | java | public static AsyncWork<XMLStreamReader, Exception> start(IO.Readable.Buffered io, int charactersBufferSize, int maxBuffers) {
AsyncWork<XMLStreamReader, Exception> result = new AsyncWork<>();
new Task.Cpu.FromRunnable("Start reading XML " + io.getSourceDescription(), io.getPriority(), () -> {
XMLStreamReader... | [
"public",
"static",
"AsyncWork",
"<",
"XMLStreamReader",
",",
"Exception",
">",
"start",
"(",
"IO",
".",
"Readable",
".",
"Buffered",
"io",
",",
"int",
"charactersBufferSize",
",",
"int",
"maxBuffers",
")",
"{",
"AsyncWork",
"<",
"XMLStreamReader",
",",
"Excep... | Utility method that initialize a XMLStreamReader, initialize it, and
return an AsyncWork which is unblocked when characters are available to be read. | [
"Utility",
"method",
"that",
"initialize",
"a",
"XMLStreamReader",
"initialize",
"it",
"and",
"return",
"an",
"AsyncWork",
"which",
"is",
"unblocked",
"when",
"characters",
"are",
"available",
"to",
"be",
"read",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamReader.java#L61-L82 |
150,359 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamReader.java | XMLStreamReader.next | @Override
public void next() throws XMLException, IOException {
reset();
char c;
if ((c = stream.read()) == '<')
readTag();
else
readChars(c);
} | java | @Override
public void next() throws XMLException, IOException {
reset();
char c;
if ((c = stream.read()) == '<')
readTag();
else
readChars(c);
} | [
"@",
"Override",
"public",
"void",
"next",
"(",
")",
"throws",
"XMLException",
",",
"IOException",
"{",
"reset",
"(",
")",
";",
"char",
"c",
";",
"if",
"(",
"(",
"c",
"=",
"stream",
".",
"read",
"(",
")",
")",
"==",
"'",
"'",
")",
"readTag",
"(",... | Move forward to the next event. | [
"Move",
"forward",
"to",
"the",
"next",
"event",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamReader.java#L92-L100 |
150,360 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java | EvaluateBeanshell.evaluateCondition | protected boolean evaluateCondition( String script, Log log )
throws EnforcerRuleException
{
Boolean evaluation = Boolean.FALSE;
try
{
evaluation = (Boolean) bsh.eval( script );
log.debug( "Echo evaluating : " + evaluation );
}
catch ( EvalErro... | java | protected boolean evaluateCondition( String script, Log log )
throws EnforcerRuleException
{
Boolean evaluation = Boolean.FALSE;
try
{
evaluation = (Boolean) bsh.eval( script );
log.debug( "Echo evaluating : " + evaluation );
}
catch ( EvalErro... | [
"protected",
"boolean",
"evaluateCondition",
"(",
"String",
"script",
",",
"Log",
"log",
")",
"throws",
"EnforcerRuleException",
"{",
"Boolean",
"evaluation",
"=",
"Boolean",
".",
"FALSE",
";",
"try",
"{",
"evaluation",
"=",
"(",
"Boolean",
")",
"bsh",
".",
... | Evaluate expression using Beanshell.
@param script the expression to be evaluated
@param log the logger
@return boolean the evaluation of the expression
@throws EnforcerRuleException if the script could not be evaluated | [
"Evaluate",
"expression",
"using",
"Beanshell",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java#L103-L117 |
150,361 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/ModContainer.java | ModContainer.configurationSave | @Override
public void configurationSave(Properties props)
{
ModConfigPanel configPanel = (ModConfigPanel)getConfigPanel();
props.setProperty(PROPERTY_PLAYER_FREQUENCY, configPanel.getPlayerSetUp_SampleRate().getSelectedItem().toString());
props.setProperty(PROPERTY_PLAYER_MSBUFFERSIZE, configPanel.getPlayerSetU... | java | @Override
public void configurationSave(Properties props)
{
ModConfigPanel configPanel = (ModConfigPanel)getConfigPanel();
props.setProperty(PROPERTY_PLAYER_FREQUENCY, configPanel.getPlayerSetUp_SampleRate().getSelectedItem().toString());
props.setProperty(PROPERTY_PLAYER_MSBUFFERSIZE, configPanel.getPlayerSetU... | [
"@",
"Override",
"public",
"void",
"configurationSave",
"(",
"Properties",
"props",
")",
"{",
"ModConfigPanel",
"configPanel",
"=",
"(",
"ModConfigPanel",
")",
"getConfigPanel",
"(",
")",
";",
"props",
".",
"setProperty",
"(",
"PROPERTY_PLAYER_FREQUENCY",
",",
"co... | Get the values from the gui and store them into the main Propertys
@since 13.10.2007 | [
"Get",
"the",
"values",
"from",
"the",
"gui",
"and",
"store",
"them",
"into",
"the",
"main",
"Propertys"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/ModContainer.java#L248-L261 |
150,362 | jtrfp/javamod | src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java | WaveformGenerator.set_chip_model | public void set_chip_model(chip_model model) {
if (model == chip_model.MOS6581) {
wave__ST = Wave.wave6581__ST;
wave_P_T = Wave.wave6581_P_T;
wave_PS_ = Wave.wave6581_PS_;
wave_PST = Wave.wave6581_PST;
} else {
wave__ST = Wave.wave8580__ST;
wave_P_T = Wave.wave8580_P_T;
wave_PS_ = Wave.wave8580... | java | public void set_chip_model(chip_model model) {
if (model == chip_model.MOS6581) {
wave__ST = Wave.wave6581__ST;
wave_P_T = Wave.wave6581_P_T;
wave_PS_ = Wave.wave6581_PS_;
wave_PST = Wave.wave6581_PST;
} else {
wave__ST = Wave.wave8580__ST;
wave_P_T = Wave.wave8580_P_T;
wave_PS_ = Wave.wave8580... | [
"public",
"void",
"set_chip_model",
"(",
"chip_model",
"model",
")",
"{",
"if",
"(",
"model",
"==",
"chip_model",
".",
"MOS6581",
")",
"{",
"wave__ST",
"=",
"Wave",
".",
"wave6581__ST",
";",
"wave_P_T",
"=",
"Wave",
".",
"wave6581_P_T",
";",
"wave_PS_",
"=... | Set chip model.
@param model
chip model | [
"Set",
"chip",
"model",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java#L125-L137 |
150,363 | jtrfp/javamod | src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java | WaveformGenerator.writeCONTROL_REG | public void writeCONTROL_REG(int /* reg8 */control) {
waveform = (control >> 4) & 0x0f;
ring_mod = control & 0x04;
sync = control & 0x02;
int /* reg8 */test_next = control & 0x08;
if (ANTTI_LANKILA_PATCH) {
/*
* SounDemoN found out that test bit can be used to control the
* noise register. Hear t... | java | public void writeCONTROL_REG(int /* reg8 */control) {
waveform = (control >> 4) & 0x0f;
ring_mod = control & 0x04;
sync = control & 0x02;
int /* reg8 */test_next = control & 0x08;
if (ANTTI_LANKILA_PATCH) {
/*
* SounDemoN found out that test bit can be used to control the
* noise register. Hear t... | [
"public",
"void",
"writeCONTROL_REG",
"(",
"int",
"/* reg8 */",
"control",
")",
"{",
"waveform",
"=",
"(",
"control",
">>",
"4",
")",
"&",
"0x0f",
";",
"ring_mod",
"=",
"control",
"&",
"0x04",
";",
"sync",
"=",
"control",
"&",
"0x02",
";",
"int",
"/* r... | Register functions.
@param control | [
"Register",
"functions",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java#L180-L253 |
150,364 | jtrfp/javamod | src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java | WaveformGenerator.reset | public void reset() {
accumulator = 0;
if (ANTTI_LANKILA_PATCH)
shift_register = 0x7ffffc;
else
shift_register = 0x7ffff8;
freq = 0;
pw = 0;
test = 0;
ring_mod = 0;
sync = 0;
msb_rising = false;
} | java | public void reset() {
accumulator = 0;
if (ANTTI_LANKILA_PATCH)
shift_register = 0x7ffffc;
else
shift_register = 0x7ffff8;
freq = 0;
pw = 0;
test = 0;
ring_mod = 0;
sync = 0;
msb_rising = false;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"accumulator",
"=",
"0",
";",
"if",
"(",
"ANTTI_LANKILA_PATCH",
")",
"shift_register",
"=",
"0x7ffffc",
";",
"else",
"shift_register",
"=",
"0x7ffff8",
";",
"freq",
"=",
"0",
";",
"pw",
"=",
"0",
";",
"test",
"... | SID reset. | [
"SID",
"reset",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java#L262-L276 |
150,365 | jtrfp/javamod | src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java | WaveformGenerator.clock | public void clock() {
// No operation if test bit is set.
if (test != 0) {
return;
}
int /* reg24 */accumulator_prev = accumulator;
// Calculate new accumulator value;
accumulator += freq;
accumulator &= 0xffffff;
// Check whether the MSB is set high. This is used for synchronization.
msb_rising... | java | public void clock() {
// No operation if test bit is set.
if (test != 0) {
return;
}
int /* reg24 */accumulator_prev = accumulator;
// Calculate new accumulator value;
accumulator += freq;
accumulator &= 0xffffff;
// Check whether the MSB is set high. This is used for synchronization.
msb_rising... | [
"public",
"void",
"clock",
"(",
")",
"{",
"// No operation if test bit is set.",
"if",
"(",
"test",
"!=",
"0",
")",
"{",
"return",
";",
"}",
"int",
"/* reg24 */",
"accumulator_prev",
"=",
"accumulator",
";",
"// Calculate new accumulator value;",
"accumulator",
"+="... | SID clocking - 1 cycle. | [
"SID",
"clocking",
"-",
"1",
"cycle",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java#L287-L312 |
150,366 | jtrfp/javamod | src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java | WaveformGenerator.clock | public void clock(int/* cycle_count */delta_t) {
// No operation if test bit is set.
if (test != 0) {
return;
}
int /* reg24 */accumulator_prev = accumulator;
// Calculate new accumulator value;
int /* reg24 */delta_accumulator = delta_t * freq;
accumulator += delta_accumulator;
accumulator &= 0xff... | java | public void clock(int/* cycle_count */delta_t) {
// No operation if test bit is set.
if (test != 0) {
return;
}
int /* reg24 */accumulator_prev = accumulator;
// Calculate new accumulator value;
int /* reg24 */delta_accumulator = delta_t * freq;
accumulator += delta_accumulator;
accumulator &= 0xff... | [
"public",
"void",
"clock",
"(",
"int",
"/* cycle_count */",
"delta_t",
")",
"{",
"// No operation if test bit is set.",
"if",
"(",
"test",
"!=",
"0",
")",
"{",
"return",
";",
"}",
"int",
"/* reg24 */",
"accumulator_prev",
"=",
"accumulator",
";",
"// Calculate new... | SID clocking - delta_t cycles. | [
"SID",
"clocking",
"-",
"delta_t",
"cycles",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/sidplay/resid_builder/resid/WaveformGenerator.java#L317-L370 |
150,367 | mattprovis/fluentmatcher | fluentmatcher-core/src/main/java/com/mattprovis/fluentmatcher/FluentMatcherGenerator.java | FluentMatcherGenerator.filterRelevantFields | private void filterRelevantFields(List<Field> fields) {
Iterator<Field> fieldIterator = fields.iterator();
while (fieldIterator.hasNext()) {
Field field = fieldIterator.next();
if (Modifier.isStatic(field.getModifiers())) {
fieldIterator.remove();
}
... | java | private void filterRelevantFields(List<Field> fields) {
Iterator<Field> fieldIterator = fields.iterator();
while (fieldIterator.hasNext()) {
Field field = fieldIterator.next();
if (Modifier.isStatic(field.getModifiers())) {
fieldIterator.remove();
}
... | [
"private",
"void",
"filterRelevantFields",
"(",
"List",
"<",
"Field",
">",
"fields",
")",
"{",
"Iterator",
"<",
"Field",
">",
"fieldIterator",
"=",
"fields",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"fieldIterator",
".",
"hasNext",
"(",
")",
")",
"{... | Filters out fields for which we don't want matcher methods created.
This currently only excludes static fields.
@param fields | [
"Filters",
"out",
"fields",
"for",
"which",
"we",
"don",
"t",
"want",
"matcher",
"methods",
"created",
".",
"This",
"currently",
"only",
"excludes",
"static",
"fields",
"."
] | 49dbe5d995be1685483561f9f2b6b6cfe138a1f9 | https://github.com/mattprovis/fluentmatcher/blob/49dbe5d995be1685483561f9f2b6b6cfe138a1f9/fluentmatcher-core/src/main/java/com/mattprovis/fluentmatcher/FluentMatcherGenerator.java#L113-L122 |
150,368 | jtrfp/javamod | src/main/java/de/quippy/jflac/util/ByteData.java | ByteData.setLen | public void setLen(int len) {
if (len > data.length) {
len = data.length;
}
this.len = len;
} | java | public void setLen(int len) {
if (len > data.length) {
len = data.length;
}
this.len = len;
} | [
"public",
"void",
"setLen",
"(",
"int",
"len",
")",
"{",
"if",
"(",
"len",
">",
"data",
".",
"length",
")",
"{",
"len",
"=",
"data",
".",
"length",
";",
"}",
"this",
".",
"len",
"=",
"len",
";",
"}"
] | Set the length of this ByteData object without re-allocating the underlying array.
It is not possible to set the length larger than the underlying byte array. | [
"Set",
"the",
"length",
"of",
"this",
"ByteData",
"object",
"without",
"re",
"-",
"allocating",
"the",
"underlying",
"array",
".",
"It",
"is",
"not",
"possible",
"to",
"set",
"the",
"length",
"larger",
"than",
"the",
"underlying",
"byte",
"array",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/util/ByteData.java#L81-L86 |
150,369 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.initializeMixer | public void initializeMixer()
{
// to be a bit faster, we do some precalculations
calculateGlobalTuning();
// get Mod specific values
frequencyTableType = mod.getFrequencyTable();
currentTempo = mod.getTempo();
currentBPM = mod.getBPMSpeed();
globalVolume = mod.getBaseVolume();
globalVolumSlideValue... | java | public void initializeMixer()
{
// to be a bit faster, we do some precalculations
calculateGlobalTuning();
// get Mod specific values
frequencyTableType = mod.getFrequencyTable();
currentTempo = mod.getTempo();
currentBPM = mod.getBPMSpeed();
globalVolume = mod.getBaseVolume();
globalVolumSlideValue... | [
"public",
"void",
"initializeMixer",
"(",
")",
"{",
"// to be a bit faster, we do some precalculations",
"calculateGlobalTuning",
"(",
")",
";",
"// get Mod specific values",
"frequencyTableType",
"=",
"mod",
".",
"getFrequencyTable",
"(",
")",
";",
"currentTempo",
"=",
"... | Call this first! | [
"Call",
"this",
"first!"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L289-L338 |
150,370 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.cutOffToFrequency | protected long cutOffToFrequency(long cutOff, int flt_modifier, boolean isExFilterRange)
{
double fac = (isExFilterRange)?(20.0d*512.0d):(24.0d*512.0d);
double fc = 110.0d * Math.pow(2.0d, 0.25d + ((double)(cutOff*(flt_modifier+256))) / fac);
long freq = (long)fc;
if (freq<120) return 120;
if (freq>20000) re... | java | protected long cutOffToFrequency(long cutOff, int flt_modifier, boolean isExFilterRange)
{
double fac = (isExFilterRange)?(20.0d*512.0d):(24.0d*512.0d);
double fc = 110.0d * Math.pow(2.0d, 0.25d + ((double)(cutOff*(flt_modifier+256))) / fac);
long freq = (long)fc;
if (freq<120) return 120;
if (freq>20000) re... | [
"protected",
"long",
"cutOffToFrequency",
"(",
"long",
"cutOff",
",",
"int",
"flt_modifier",
",",
"boolean",
"isExFilterRange",
")",
"{",
"double",
"fac",
"=",
"(",
"isExFilterRange",
")",
"?",
"(",
"20.0d",
"*",
"512.0d",
")",
":",
"(",
"24.0d",
"*",
"512... | calc the cut off
@param cutOff
@param flt_modifier
@param isExFilterRange
@return | [
"calc",
"the",
"cut",
"off"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L495-L504 |
150,371 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.setupChannelFilter | protected void setupChannelFilter(ChannelMemory aktMemo, boolean bReset, int flt_modifier)
{
double cutOff = (double)((aktMemo.nCutOff + aktMemo.nCutSwing)&0x7F);
double resonance = (double)((aktMemo.nResonance + aktMemo.nResSwing)&0x7F);
double fc = cutOffToFrequency((long)cutOff, flt_modifier, (mod.getSongF... | java | protected void setupChannelFilter(ChannelMemory aktMemo, boolean bReset, int flt_modifier)
{
double cutOff = (double)((aktMemo.nCutOff + aktMemo.nCutSwing)&0x7F);
double resonance = (double)((aktMemo.nResonance + aktMemo.nResSwing)&0x7F);
double fc = cutOffToFrequency((long)cutOff, flt_modifier, (mod.getSongF... | [
"protected",
"void",
"setupChannelFilter",
"(",
"ChannelMemory",
"aktMemo",
",",
"boolean",
"bReset",
",",
"int",
"flt_modifier",
")",
"{",
"double",
"cutOff",
"=",
"(",
"double",
")",
"(",
"(",
"aktMemo",
".",
"nCutOff",
"+",
"aktMemo",
".",
"nCutSwing",
")... | Simple 2-poles resonant filter
@since 31.03.2010
@param aktMemo
@param bReset
@param flt_modifier | [
"Simple",
"2",
"-",
"poles",
"resonant",
"filter"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L512-L550 |
150,372 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.resetInstrument | protected void resetInstrument(ChannelMemory aktMemo)
{
aktMemo.autoVibratoTablePos =
aktMemo.autoVibratoAmplitude =
aktMemo.currentDirection =
aktMemo.currentTuningPos =
aktMemo.currentSamplePos = 0;
aktMemo.volEnvPos =
aktMemo.panEnvPos =
aktMemo.pitchEnvPos = -1;
aktMemo.filterOn =
aktMemo.... | java | protected void resetInstrument(ChannelMemory aktMemo)
{
aktMemo.autoVibratoTablePos =
aktMemo.autoVibratoAmplitude =
aktMemo.currentDirection =
aktMemo.currentTuningPos =
aktMemo.currentSamplePos = 0;
aktMemo.volEnvPos =
aktMemo.panEnvPos =
aktMemo.pitchEnvPos = -1;
aktMemo.filterOn =
aktMemo.... | [
"protected",
"void",
"resetInstrument",
"(",
"ChannelMemory",
"aktMemo",
")",
"{",
"aktMemo",
".",
"autoVibratoTablePos",
"=",
"aktMemo",
".",
"autoVibratoAmplitude",
"=",
"aktMemo",
".",
"currentDirection",
"=",
"aktMemo",
".",
"currentTuningPos",
"=",
"aktMemo",
"... | Set all index values back to zero!
@since 19.06.2006
@param aktMemo | [
"Set",
"all",
"index",
"values",
"back",
"to",
"zero!"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L789-L801 |
150,373 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.doRowEvent | protected void doRowEvent()
{
final PatternRow patternRow = currentPattern.getPatternRow(currentRow);
if (patternRow==null) return;
patternRow.setRowPlayed();
final int nChannels = mod.getNChannels();
for (int c=0; c<nChannels; c++)
{
// get pattern and channel memory data for current channel
fina... | java | protected void doRowEvent()
{
final PatternRow patternRow = currentPattern.getPatternRow(currentRow);
if (patternRow==null) return;
patternRow.setRowPlayed();
final int nChannels = mod.getNChannels();
for (int c=0; c<nChannels; c++)
{
// get pattern and channel memory data for current channel
fina... | [
"protected",
"void",
"doRowEvent",
"(",
")",
"{",
"final",
"PatternRow",
"patternRow",
"=",
"currentPattern",
".",
"getPatternRow",
"(",
"currentRow",
")",
";",
"if",
"(",
"patternRow",
"==",
"null",
")",
"return",
";",
"patternRow",
".",
"setRowPlayed",
"(",
... | Do the Events of a new Row!
@return true, if finished! | [
"Do",
"the",
"Events",
"of",
"a",
"new",
"Row!"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L997-L1045 |
150,374 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.doTickEvents | protected boolean doTickEvents()
{
// Global Fade Out
if (doFadeOut)
{
fadeOutValue-=fadeOutSub;
if (fadeOutValue <= 0) return true; // We did a fadeout and are finished now
}
final int nChannels = maxChannels;
if (patternTicksDelayCount>0)
{
for (int c=0; c<nChannels; c++)
{
final Channe... | java | protected boolean doTickEvents()
{
// Global Fade Out
if (doFadeOut)
{
fadeOutValue-=fadeOutSub;
if (fadeOutValue <= 0) return true; // We did a fadeout and are finished now
}
final int nChannels = maxChannels;
if (patternTicksDelayCount>0)
{
for (int c=0; c<nChannels; c++)
{
final Channe... | [
"protected",
"boolean",
"doTickEvents",
"(",
")",
"{",
"// Global Fade Out",
"if",
"(",
"doFadeOut",
")",
"{",
"fadeOutValue",
"-=",
"fadeOutSub",
";",
"if",
"(",
"fadeOutValue",
"<=",
"0",
")",
"return",
"true",
";",
"// We did a fadeout and are finished now",
"}... | Do the events during a Tick.
@return true, if finished! | [
"Do",
"the",
"events",
"during",
"a",
"Tick",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L1061-L1173 |
150,375 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.fitIntoLoops | protected void fitIntoLoops(final ChannelMemory actMemo)
{
final Sample ins = actMemo.currentSample;
// If Forward direction:
if (actMemo.currentDirection>=0)
{
actMemo.currentTuningPos += actMemo.currentTuning;
if (actMemo.currentTuningPos >= Helpers.SHIFT_ONE)
{
actMemo.currentSamplePos += (a... | java | protected void fitIntoLoops(final ChannelMemory actMemo)
{
final Sample ins = actMemo.currentSample;
// If Forward direction:
if (actMemo.currentDirection>=0)
{
actMemo.currentTuningPos += actMemo.currentTuning;
if (actMemo.currentTuningPos >= Helpers.SHIFT_ONE)
{
actMemo.currentSamplePos += (a... | [
"protected",
"void",
"fitIntoLoops",
"(",
"final",
"ChannelMemory",
"actMemo",
")",
"{",
"final",
"Sample",
"ins",
"=",
"actMemo",
".",
"currentSample",
";",
"// If Forward direction:",
"if",
"(",
"actMemo",
".",
"currentDirection",
">=",
"0",
")",
"{",
"actMemo... | Add current speed to samplepos and
fit currentSamplePos into loop values
or signal Sample finished
@since 18.06.2006
@param aktMemo | [
"Add",
"current",
"speed",
"to",
"samplepos",
"and",
"fit",
"currentSamplePos",
"into",
"loop",
"values",
"or",
"signal",
"Sample",
"finished"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L1181-L1230 |
150,376 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java | BasicModMixer.mixChannelIntoBuffers | private void mixChannelIntoBuffers(final int[] leftBuffer, final int[] rightBuffer, final int startIndex, final int endIndex, final ChannelMemory actMemo)
{
for (int i=startIndex; i<endIndex; i++)
{
// Retrieve the Sampledata for this point (interpolated, if necessary)
long sample = actMemo.currentSample.get... | java | private void mixChannelIntoBuffers(final int[] leftBuffer, final int[] rightBuffer, final int startIndex, final int endIndex, final ChannelMemory actMemo)
{
for (int i=startIndex; i<endIndex; i++)
{
// Retrieve the Sampledata for this point (interpolated, if necessary)
long sample = actMemo.currentSample.get... | [
"private",
"void",
"mixChannelIntoBuffers",
"(",
"final",
"int",
"[",
"]",
"leftBuffer",
",",
"final",
"int",
"[",
"]",
"rightBuffer",
",",
"final",
"int",
"startIndex",
",",
"final",
"int",
"endIndex",
",",
"final",
"ChannelMemory",
"actMemo",
")",
"{",
"fo... | Fill the buffers with channel data
@since 18.06.2006
@param leftBuffer
@param rightBuffer
@param startIndex
@param amount
@param actMemo | [
"Fill",
"the",
"buffers",
"with",
"channel",
"data"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/BasicModMixer.java#L1240-L1283 |
150,377 | netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java | XslTransformer.getTransformer | public static XslTransformer getTransformer(Source source) throws TransformerConfigurationException {
if (source == null) {
throw new IllegalArgumentException("source is null");
}
XslTransformer transformer = new XslTransformer();
transformer.transformerImpl = transformerFactory.newTrans... | java | public static XslTransformer getTransformer(Source source) throws TransformerConfigurationException {
if (source == null) {
throw new IllegalArgumentException("source is null");
}
XslTransformer transformer = new XslTransformer();
transformer.transformerImpl = transformerFactory.newTrans... | [
"public",
"static",
"XslTransformer",
"getTransformer",
"(",
"Source",
"source",
")",
"throws",
"TransformerConfigurationException",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"source is null\"",
")",
";",
"}... | Get a wrapped XSL transformer instance for supplied stylesheet source.
@param source XSL source
@return XSL transformer instance
@throws TransformerConfigurationException if an exception occurs while processing | [
"Get",
"a",
"wrapped",
"XSL",
"transformer",
"instance",
"for",
"supplied",
"stylesheet",
"source",
"."
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java#L41-L48 |
150,378 | netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java | XslTransformer.getTransformer | public static XslTransformer getTransformer(File xslFile) throws TransformerConfigurationException {
if (xslFile == null) {
throw new IllegalArgumentException("xslFile is null");
}
return getTransformer(new StreamSource(xslFile));
} | java | public static XslTransformer getTransformer(File xslFile) throws TransformerConfigurationException {
if (xslFile == null) {
throw new IllegalArgumentException("xslFile is null");
}
return getTransformer(new StreamSource(xslFile));
} | [
"public",
"static",
"XslTransformer",
"getTransformer",
"(",
"File",
"xslFile",
")",
"throws",
"TransformerConfigurationException",
"{",
"if",
"(",
"xslFile",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"xslFile is null\"",
")",
";",
"... | Get a wrapped XSL transformer instance for supplied stylesheet file.
@param xslFile XSL file
@return XSL transformer instance
@throws TransformerConfigurationException if an error occurs while processing | [
"Get",
"a",
"wrapped",
"XSL",
"transformer",
"instance",
"for",
"supplied",
"stylesheet",
"file",
"."
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java#L56-L61 |
150,379 | netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java | XslTransformer.transform | public void transform(Source xmlSource, URIResolver uriResolver, ErrorListener errorListener, Result outputTarget) throws TransformerException {
if (xmlSource == null) {
throw new IllegalArgumentException("xmlSource is null");
}
if (outputTarget == null) {
throw new IllegalArgumentException("... | java | public void transform(Source xmlSource, URIResolver uriResolver, ErrorListener errorListener, Result outputTarget) throws TransformerException {
if (xmlSource == null) {
throw new IllegalArgumentException("xmlSource is null");
}
if (outputTarget == null) {
throw new IllegalArgumentException("... | [
"public",
"void",
"transform",
"(",
"Source",
"xmlSource",
",",
"URIResolver",
"uriResolver",
",",
"ErrorListener",
"errorListener",
",",
"Result",
"outputTarget",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"xmlSource",
"==",
"null",
")",
"{",
"throw",... | Transform XML source using the wrapped XSL transformer of this instance and output to supplied target.
@param xmlSource source XML
@param uriResolver URI resolver or null
@param errorListener error listener or null
@param outputTarget output result target to use
@throws TransformerException if an exception occurs while... | [
"Transform",
"XML",
"source",
"using",
"the",
"wrapped",
"XSL",
"transformer",
"of",
"this",
"instance",
"and",
"output",
"to",
"supplied",
"target",
"."
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java#L79-L93 |
150,380 | netarchivesuite/heritrix3-wrapper | src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java | XslTransformer.transform | public byte[] transform(Source xmlSource, URIResolver uriResolver, ErrorListener errorListener) throws TransformerException {
if (xmlSource == null) {
throw new IllegalArgumentException("xmlSource is null");
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
StreamResult result =... | java | public byte[] transform(Source xmlSource, URIResolver uriResolver, ErrorListener errorListener) throws TransformerException {
if (xmlSource == null) {
throw new IllegalArgumentException("xmlSource is null");
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
StreamResult result =... | [
"public",
"byte",
"[",
"]",
"transform",
"(",
"Source",
"xmlSource",
",",
"URIResolver",
"uriResolver",
",",
"ErrorListener",
"errorListener",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"xmlSource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArg... | Transform XML source using the wrapped XSL transformer of this instance and return a byte array of the result.
@param xmlSource source XML
@param uriResolver URI resolver or null
@param errorListener error listener or null
@return byte array of the result
@throws TransformerException if an exception occurs while transf... | [
"Transform",
"XML",
"source",
"using",
"the",
"wrapped",
"XSL",
"transformer",
"of",
"this",
"instance",
"and",
"return",
"a",
"byte",
"array",
"of",
"the",
"result",
"."
] | e53ec5736cbac0bdd3925b5331737dc905871629 | https://github.com/netarchivesuite/heritrix3-wrapper/blob/e53ec5736cbac0bdd3925b5331737dc905871629/src/main/java/org/netarchivesuite/heritrix3wrapper/xmlutils/XslTransformer.java#L103-L111 |
150,381 | danidemi/jlubricant | jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java | DatasourceTemplate.execute | public void execute(String statement) throws SQLException {
if (logger.isDebugEnabled()) {
logger.debug("Executing SQL statement [" + statement + "]");
}
Connection connection = null;
Statement stm = null;
try{
connection = ds.getConnection();
stm = connection.createStatement();
stm.execu... | java | public void execute(String statement) throws SQLException {
if (logger.isDebugEnabled()) {
logger.debug("Executing SQL statement [" + statement + "]");
}
Connection connection = null;
Statement stm = null;
try{
connection = ds.getConnection();
stm = connection.createStatement();
stm.execu... | [
"public",
"void",
"execute",
"(",
"String",
"statement",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Executing SQL statement [\"",
"+",
"statement",
"+",
"\"]\"",
")",
";... | Execute a statement. | [
"Execute",
"a",
"statement",
"."
] | a9937c141c69ec34b768bd603b8093e496329b3a | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L39-L58 |
150,382 | danidemi/jlubricant | jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java | DatasourceTemplate.queryForInt | public int queryForInt(String sql) throws SQLException {
Number number = queryForObject(sql, Integer.class);
return (number != null ? number.intValue() : 0);
} | java | public int queryForInt(String sql) throws SQLException {
Number number = queryForObject(sql, Integer.class);
return (number != null ? number.intValue() : 0);
} | [
"public",
"int",
"queryForInt",
"(",
"String",
"sql",
")",
"throws",
"SQLException",
"{",
"Number",
"number",
"=",
"queryForObject",
"(",
"sql",
",",
"Integer",
".",
"class",
")",
";",
"return",
"(",
"number",
"!=",
"null",
"?",
"number",
".",
"intValue",
... | Execute a query that returns a single int field. | [
"Execute",
"a",
"query",
"that",
"returns",
"a",
"single",
"int",
"field",
"."
] | a9937c141c69ec34b768bd603b8093e496329b3a | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L63-L66 |
150,383 | danidemi/jlubricant | jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java | DatasourceTemplate.queryForObject | public <T> T queryForObject(String sql, Class<T> requiredType) throws SQLException {
return queryForObject(sql, getSingleColumnRowMapper(requiredType));
} | java | public <T> T queryForObject(String sql, Class<T> requiredType) throws SQLException {
return queryForObject(sql, getSingleColumnRowMapper(requiredType));
} | [
"public",
"<",
"T",
">",
"T",
"queryForObject",
"(",
"String",
"sql",
",",
"Class",
"<",
"T",
">",
"requiredType",
")",
"throws",
"SQLException",
"{",
"return",
"queryForObject",
"(",
"sql",
",",
"getSingleColumnRowMapper",
"(",
"requiredType",
")",
")",
";"... | Execute a query that returns a single value that can be cast to the given type. | [
"Execute",
"a",
"query",
"that",
"returns",
"a",
"single",
"value",
"that",
"can",
"be",
"cast",
"to",
"the",
"given",
"type",
"."
] | a9937c141c69ec34b768bd603b8093e496329b3a | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-embeddable-hsql/src/main/java/com/danidemi/jlubricant/embeddable/database/utils/DatasourceTemplate.java#L71-L73 |
150,384 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.skipBitsNoCRC | public void skipBitsNoCRC(int bits) throws IOException {
if (bits == 0) return;
int bitsToAlign = getBit & 7;
if (bitsToAlign != 0) {
int bitsToTake = Math.min(8 - bitsToAlign, bits);
readRawUInt(bitsToTake);
bits -= bitsToTake;
}
int bytesNeed... | java | public void skipBitsNoCRC(int bits) throws IOException {
if (bits == 0) return;
int bitsToAlign = getBit & 7;
if (bitsToAlign != 0) {
int bitsToTake = Math.min(8 - bitsToAlign, bits);
readRawUInt(bitsToTake);
bits -= bitsToTake;
}
int bytesNeed... | [
"public",
"void",
"skipBitsNoCRC",
"(",
"int",
"bits",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bits",
"==",
"0",
")",
"return",
";",
"int",
"bitsToAlign",
"=",
"getBit",
"&",
"7",
";",
"if",
"(",
"bitsToAlign",
"!=",
"0",
")",
"{",
"int",
"bit... | skip over bits in bit stream without updating CRC.
@param bits Number of bits to skip
@throws IOException Thrown if error reading from input stream | [
"skip",
"over",
"bits",
"in",
"bit",
"stream",
"without",
"updating",
"CRC",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L176-L192 |
150,385 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readBit | public int readBit() throws IOException {
while (true) {
if (availBits > 0) {
int val = ((buffer[getByte] & (0x80 >> getBit)) != 0) ? 1 : 0;
getBit++;
if (getBit == BITS_PER_BLURB) {
readCRC16 = CRC16.update(buffer[getByte], readCRC... | java | public int readBit() throws IOException {
while (true) {
if (availBits > 0) {
int val = ((buffer[getByte] & (0x80 >> getBit)) != 0) ? 1 : 0;
getBit++;
if (getBit == BITS_PER_BLURB) {
readCRC16 = CRC16.update(buffer[getByte], readCRC... | [
"public",
"int",
"readBit",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"availBits",
">",
"0",
")",
"{",
"int",
"val",
"=",
"(",
"(",
"buffer",
"[",
"getByte",
"]",
"&",
"(",
"0x80",
">>",
"getBit",
")",
")"... | read a single bit.
@return The bit
@throws IOException Thrown if error reading input stream | [
"read",
"a",
"single",
"bit",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L199-L216 |
150,386 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.peekBitToInt | public int peekBitToInt(int val, int bit) throws IOException {
while (true) {
if (bit < availBits) {
val <<= 1;
if ((getBit + bit) >= BITS_PER_BLURB) {
bit = (getBit + bit) % BITS_PER_BLURB;
val |= ((buffer[getByte + 1] & (0x80 ... | java | public int peekBitToInt(int val, int bit) throws IOException {
while (true) {
if (bit < availBits) {
val <<= 1;
if ((getBit + bit) >= BITS_PER_BLURB) {
bit = (getBit + bit) % BITS_PER_BLURB;
val |= ((buffer[getByte + 1] & (0x80 ... | [
"public",
"int",
"peekBitToInt",
"(",
"int",
"val",
",",
"int",
"bit",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"bit",
"<",
"availBits",
")",
"{",
"val",
"<<=",
"1",
";",
"if",
"(",
"(",
"getBit",
"+",
"bit",
... | peek at the next bit and add it to the input integer.
The bits of the input integer are shifted left and the
read bit is placed into bit 0.
@param val The input integer
@param bit The bit to peek at
@return The updated integer value
@throws IOException Thrown if error reading input stream | [
"peek",
"at",
"the",
"next",
"bit",
"and",
"add",
"it",
"to",
"the",
"input",
"integer",
".",
"The",
"bits",
"of",
"the",
"input",
"integer",
"are",
"shifted",
"left",
"and",
"the",
"read",
"bit",
"is",
"placed",
"into",
"bit",
"0",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L255-L270 |
150,387 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readRawUInt | public int readRawUInt(int bits) throws IOException {
int val = 0;
for (int i = 0; i < bits; i++) {
val = readBitToInt(val);
}
return val;
} | java | public int readRawUInt(int bits) throws IOException {
int val = 0;
for (int i = 0; i < bits; i++) {
val = readBitToInt(val);
}
return val;
} | [
"public",
"int",
"readRawUInt",
"(",
"int",
"bits",
")",
"throws",
"IOException",
"{",
"int",
"val",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bits",
";",
"i",
"++",
")",
"{",
"val",
"=",
"readBitToInt",
"(",
"val",
")",
... | read bits into an unsigned integer.
@param bits The number of bits to read
@return The bits as an unsigned integer
@throws IOException Thrown if error reading input stream | [
"read",
"bits",
"into",
"an",
"unsigned",
"integer",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L306-L312 |
150,388 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.peekRawUInt | public int peekRawUInt(int bits) throws IOException {
int val = 0;
for (int i = 0; i < bits; i++) {
val = peekBitToInt(val, i);
}
return val;
} | java | public int peekRawUInt(int bits) throws IOException {
int val = 0;
for (int i = 0; i < bits; i++) {
val = peekBitToInt(val, i);
}
return val;
} | [
"public",
"int",
"peekRawUInt",
"(",
"int",
"bits",
")",
"throws",
"IOException",
"{",
"int",
"val",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bits",
";",
"i",
"++",
")",
"{",
"val",
"=",
"peekBitToInt",
"(",
"val",
",",
... | peek at bits into an unsigned integer without advancing the input stream.
@param bits The number of bits to read
@return The bits as an unsigned integer
@throws IOException Thrown if error reading input stream | [
"peek",
"at",
"bits",
"into",
"an",
"unsigned",
"integer",
"without",
"advancing",
"the",
"input",
"stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L320-L326 |
150,389 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readRawInt | public int readRawInt(int bits) throws IOException {
if (bits == 0) { return 0; }
int uval = 0;
for (int i = 0; i < bits; i++) {
uval = readBitToInt(uval);
}
// fix the sign
int val;
int bitsToleft = 32 - bits;
if (bitsToleft != 0) {
... | java | public int readRawInt(int bits) throws IOException {
if (bits == 0) { return 0; }
int uval = 0;
for (int i = 0; i < bits; i++) {
uval = readBitToInt(uval);
}
// fix the sign
int val;
int bitsToleft = 32 - bits;
if (bitsToleft != 0) {
... | [
"public",
"int",
"readRawInt",
"(",
"int",
"bits",
")",
"throws",
"IOException",
"{",
"if",
"(",
"bits",
"==",
"0",
")",
"{",
"return",
"0",
";",
"}",
"int",
"uval",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bits",
";",
... | read bits into a signed integer.
@param bits The number of bits to read
@return The bits as a signed integer
@throws IOException Thrown if error reading input stream | [
"read",
"bits",
"into",
"a",
"signed",
"integer",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L334-L352 |
150,390 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readRawULong | public long readRawULong(int bits) throws IOException {
long val = 0;
for (int i = 0; i < bits; i++) {
val = readBitToLong(val);
}
return val;
} | java | public long readRawULong(int bits) throws IOException {
long val = 0;
for (int i = 0; i < bits; i++) {
val = readBitToLong(val);
}
return val;
} | [
"public",
"long",
"readRawULong",
"(",
"int",
"bits",
")",
"throws",
"IOException",
"{",
"long",
"val",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"bits",
";",
"i",
"++",
")",
"{",
"val",
"=",
"readBitToLong",
"(",
"val",
")"... | read bits into an unsigned long.
@param bits The number of bits to read
@return The bits as an unsigned long
@throws IOException Thrown if error reading input stream | [
"read",
"bits",
"into",
"an",
"unsigned",
"long",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L360-L366 |
150,391 | jtrfp/javamod | src/main/java/de/quippy/jflac/io/BitInputStream.java | BitInputStream.readRawIntLittleEndian | public int readRawIntLittleEndian() throws IOException {
int x32 = readRawUInt(8);
int x8 = readRawUInt(8);
x32 |= (x8 << 8);
x8 = readRawUInt(8);
x32 |= (x8 << 16);
x8 = readRawUInt(8);
x32 |= (x8 << 24);
return x32;
} | java | public int readRawIntLittleEndian() throws IOException {
int x32 = readRawUInt(8);
int x8 = readRawUInt(8);
x32 |= (x8 << 8);
x8 = readRawUInt(8);
x32 |= (x8 << 16);
x8 = readRawUInt(8);
x32 |= (x8 << 24);
return x32;
} | [
"public",
"int",
"readRawIntLittleEndian",
"(",
")",
"throws",
"IOException",
"{",
"int",
"x32",
"=",
"readRawUInt",
"(",
"8",
")",
";",
"int",
"x8",
"=",
"readRawUInt",
"(",
"8",
")",
";",
"x32",
"|=",
"(",
"x8",
"<<",
"8",
")",
";",
"x8",
"=",
"r... | read bits into an unsigned little endian integer.
@return The bits as an unsigned integer
@throws IOException Thrown if error reading input stream | [
"read",
"bits",
"into",
"an",
"unsigned",
"little",
"endian",
"integer",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jflac/io/BitInputStream.java#L373-L382 |
150,392 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/sync/synchronizer/UpdateOnlySynchronizer.java | UpdateOnlySynchronizer.updateElementInReadBuffer | private int updateElementInReadBuffer(Data data, int indexInChunk) {
workingBuffer.position(indexInChunk);
int minElement = indexInChunk / gp.getElementSize();
int numberOfEntries = workingBuffer.limit() / gp.getElementSize();
byte[] actualKey = data.getKey();
// binary sear... | java | private int updateElementInReadBuffer(Data data, int indexInChunk) {
workingBuffer.position(indexInChunk);
int minElement = indexInChunk / gp.getElementSize();
int numberOfEntries = workingBuffer.limit() / gp.getElementSize();
byte[] actualKey = data.getKey();
// binary sear... | [
"private",
"int",
"updateElementInReadBuffer",
"(",
"Data",
"data",
",",
"int",
"indexInChunk",
")",
"{",
"workingBuffer",
".",
"position",
"(",
"indexInChunk",
")",
";",
"int",
"minElement",
"=",
"indexInChunk",
"/",
"gp",
".",
"getElementSize",
"(",
")",
";"... | traverses the readBuffer | [
"traverses",
"the",
"readBuffer"
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/sync/synchronizer/UpdateOnlySynchronizer.java#L152-L187 |
150,393 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/GUIDUtil.java | GUIDUtil.toGUID | public static byte[] toGUID(long p1, int p2, int p3, int p4, long p5) {
byte[] guid = new byte[16];
guid[0] = (byte)(p1 & 0xFF);
guid[1] = (byte)((p1 >> 8) & 0xFF);
guid[2] = (byte)((p1 >> 16) & 0xFF);
guid[3] = (byte)((p1 >> 24) & 0xFF);
guid[4] = (byte)(p2 & 0xFF);
guid[5] = (byte)((p2 >> 8) & 0x... | java | public static byte[] toGUID(long p1, int p2, int p3, int p4, long p5) {
byte[] guid = new byte[16];
guid[0] = (byte)(p1 & 0xFF);
guid[1] = (byte)((p1 >> 8) & 0xFF);
guid[2] = (byte)((p1 >> 16) & 0xFF);
guid[3] = (byte)((p1 >> 24) & 0xFF);
guid[4] = (byte)(p2 & 0xFF);
guid[5] = (byte)((p2 >> 8) & 0x... | [
"public",
"static",
"byte",
"[",
"]",
"toGUID",
"(",
"long",
"p1",
",",
"int",
"p2",
",",
"int",
"p3",
",",
"int",
"p4",
",",
"long",
"p5",
")",
"{",
"byte",
"[",
"]",
"guid",
"=",
"new",
"byte",
"[",
"16",
"]",
";",
"guid",
"[",
"0",
"]",
... | Create a GUID. | [
"Create",
"a",
"GUID",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/GUIDUtil.java#L11-L30 |
150,394 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/info/StgFileSource.java | StgFileSource.init | protected void init(File file, String directory, String fileName, InfoLocationOptions option){
super.init(file, directory, fileName, option);
if(!this.errors.hasErrors()){
if(!"stg".equals(this.getFileExtension())){
this.errors.addError("file name must have '.stg' extension");
this.reset();
}
else{... | java | protected void init(File file, String directory, String fileName, InfoLocationOptions option){
super.init(file, directory, fileName, option);
if(!this.errors.hasErrors()){
if(!"stg".equals(this.getFileExtension())){
this.errors.addError("file name must have '.stg' extension");
this.reset();
}
else{... | [
"protected",
"void",
"init",
"(",
"File",
"file",
",",
"String",
"directory",
",",
"String",
"fileName",
",",
"InfoLocationOptions",
"option",
")",
"{",
"super",
".",
"init",
"(",
"file",
",",
"directory",
",",
"fileName",
",",
"option",
")",
";",
"if",
... | Initialize the file source with any parameters presented by the constructors.
@param file a file with all information
@param directory a directory to locate a file in
@param fileName a file name with or without path information
@param option an option on how to locate the file (not used if parameter file is set) | [
"Initialize",
"the",
"file",
"source",
"with",
"any",
"parameters",
"presented",
"by",
"the",
"constructors",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/StgFileSource.java#L99-L109 |
150,395 | danidemi/jlubricant | jlubricant-spring-batch/src/main/java/com/danidemi/jlubricant/springbatch/NamedJdbcCursorItemReader.java | NamedJdbcCursorItemReader.afterPropertiesSet | @Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(sql, "The SQL query must be provided");
Assert.notNull(rowMapper, "RowMapper must be provided");
} | java | @Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
Assert.notNull(sql, "The SQL query must be provided");
Assert.notNull(rowMapper, "RowMapper must be provided");
} | [
"@",
"Override",
"public",
"void",
"afterPropertiesSet",
"(",
")",
"throws",
"Exception",
"{",
"super",
".",
"afterPropertiesSet",
"(",
")",
";",
"Assert",
".",
"notNull",
"(",
"sql",
",",
"\"The SQL query must be provided\"",
")",
";",
"Assert",
".",
"notNull",... | Assert that mandatory properties are set.
@throws IllegalArgumentException if either data source or sql properties
not set. | [
"Assert",
"that",
"mandatory",
"properties",
"are",
"set",
"."
] | a9937c141c69ec34b768bd603b8093e496329b3a | https://github.com/danidemi/jlubricant/blob/a9937c141c69ec34b768bd603b8093e496329b3a/jlubricant-spring-batch/src/main/java/com/danidemi/jlubricant/springbatch/NamedJdbcCursorItemReader.java#L223-L228 |
150,396 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.getRandomItem | public static <T> T getRandomItem(T[] arr) {
return arr[rand.nextInt(arr.length)];
} | java | public static <T> T getRandomItem(T[] arr) {
return arr[rand.nextInt(arr.length)];
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getRandomItem",
"(",
"T",
"[",
"]",
"arr",
")",
"{",
"return",
"arr",
"[",
"rand",
".",
"nextInt",
"(",
"arr",
".",
"length",
")",
"]",
";",
"}"
] | Returns a random element of the given array.
@param <T>
Type of array elements
@param arr
Array
@return Random element of <code>arr</code> | [
"Returns",
"a",
"random",
"element",
"of",
"the",
"given",
"array",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L151-L153 |
150,397 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.reverseArray | public static <T> T[] reverseArray(T[] arr) {
for (int left = 0, right = arr.length - 1; left < right; left++, right--) {
T temp = arr[left];
arr[left] = arr[right];
arr[right] = temp;
}
return arr;
} | java | public static <T> T[] reverseArray(T[] arr) {
for (int left = 0, right = arr.length - 1; left < right; left++, right--) {
T temp = arr[left];
arr[left] = arr[right];
arr[right] = temp;
}
return arr;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"reverseArray",
"(",
"T",
"[",
"]",
"arr",
")",
"{",
"for",
"(",
"int",
"left",
"=",
"0",
",",
"right",
"=",
"arr",
".",
"length",
"-",
"1",
";",
"left",
"<",
"right",
";",
"left",
"++",
",",
... | Reverses the entries of a given array.
@param <T>
Type of array elements
@param arr
Array to reverse
@return The same array in reverse order | [
"Reverses",
"the",
"entries",
"of",
"a",
"given",
"array",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L164-L171 |
150,398 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.shuffleArray | public static <T> void shuffleArray(T[] arr) {
for (int i = arr.length; i > 1; i--)
swap(arr, i - 1, rand.nextInt(i));
} | java | public static <T> void shuffleArray(T[] arr) {
for (int i = arr.length; i > 1; i--)
swap(arr, i - 1, rand.nextInt(i));
} | [
"public",
"static",
"<",
"T",
">",
"void",
"shuffleArray",
"(",
"T",
"[",
"]",
"arr",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"arr",
".",
"length",
";",
"i",
">",
"1",
";",
"i",
"--",
")",
"swap",
"(",
"arr",
",",
"i",
"-",
"1",
",",
"rand",... | Permutes the elements of the given array.
@param <T>
Array-type
@param arr
Array to shuffle | [
"Permutes",
"the",
"elements",
"of",
"the",
"given",
"array",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L216-L219 |
150,399 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/ArrayUtils.java | ArrayUtils.getFormat | private static <T> String getFormat(T[] arr, int precision, char valueSeparation) {
StringBuilder builder = new StringBuilder();
builder.append('[');
for (int i = 0; i < arr.length - 1; i++) {
builder.append(FormatUtils.getFormat(arr[i], precision));
builder.append(valueSeparation);
}
builder.app... | java | private static <T> String getFormat(T[] arr, int precision, char valueSeparation) {
StringBuilder builder = new StringBuilder();
builder.append('[');
for (int i = 0; i < arr.length - 1; i++) {
builder.append(FormatUtils.getFormat(arr[i], precision));
builder.append(valueSeparation);
}
builder.app... | [
"private",
"static",
"<",
"T",
">",
"String",
"getFormat",
"(",
"T",
"[",
"]",
"arr",
",",
"int",
"precision",
",",
"char",
"valueSeparation",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"("... | Returns a format-String that can be used to generate a String
representation of an array using the String.format method.
@param arr
Array for which a String representation is desired
@param precision
Desired precision for <code>Float</code> and
<code>Double</code> elements
@return Format-String for <code>arr</code>
@s... | [
"Returns",
"a",
"format",
"-",
"String",
"that",
"can",
"be",
"used",
"to",
"generate",
"a",
"String",
"representation",
"of",
"an",
"array",
"using",
"the",
"String",
".",
"format",
"method",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ArrayUtils.java#L424-L434 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.