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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
145,100 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheEngines.java | CacheEngines.get | public static CacheEngine get(String name) {
if (!engines.containsKey(name)) {
throw new IllegalArgumentException(name + " is not a valid cache engine name.");
}
return engines.get(name);
} | java | public static CacheEngine get(String name) {
if (!engines.containsKey(name)) {
throw new IllegalArgumentException(name + " is not a valid cache engine name.");
}
return engines.get(name);
} | [
"public",
"static",
"CacheEngine",
"get",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"engines",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"name",
"+",
"\" is not a valid cache engine name.\"",
")",
"... | Gets the cache engine associated with the given name
@param name the name of the cache engine
@return the cache engine associated with the given name
@throws IllegalArgumentException If the name is not a valid cache engine name | [
"Gets",
"the",
"cache",
"engine",
"associated",
"with",
"the",
"given",
"name"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheEngines.java#L60-L65 |
145,101 | massimozappino/tagmycode-java-plugin-framework | src/main/java/com/tagmycode/plugin/gui/TextPrompt.java | TextPrompt.changeAlpha | public void changeAlpha(int alpha) {
alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;
Color foreground = getForeground();
int red = foreground.getRed();
int green = foreground.getGreen();
int blue = foreground.getBlue();
Color withAlpha = new Color(red, green, blue, a... | java | public void changeAlpha(int alpha) {
alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;
Color foreground = getForeground();
int red = foreground.getRed();
int green = foreground.getGreen();
int blue = foreground.getBlue();
Color withAlpha = new Color(red, green, blue, a... | [
"public",
"void",
"changeAlpha",
"(",
"int",
"alpha",
")",
"{",
"alpha",
"=",
"alpha",
">",
"255",
"?",
"255",
":",
"alpha",
"<",
"0",
"?",
"0",
":",
"alpha",
";",
"Color",
"foreground",
"=",
"getForeground",
"(",
")",
";",
"int",
"red",
"=",
"fore... | Convenience method to applyChanges the alpha value of the current foreground
Color to the specifice value.
@param alpha value in the range of 0 - 255. | [
"Convenience",
"method",
"to",
"applyChanges",
"the",
"alpha",
"value",
"of",
"the",
"current",
"foreground",
"Color",
"to",
"the",
"specifice",
"value",
"."
] | 06637e32bf737e3e0d318859c718815edac9d0f0 | https://github.com/massimozappino/tagmycode-java-plugin-framework/blob/06637e32bf737e3e0d318859c718815edac9d0f0/src/main/java/com/tagmycode/plugin/gui/TextPrompt.java#L68-L78 |
145,102 | massimozappino/tagmycode-java-plugin-framework | src/main/java/com/tagmycode/plugin/gui/TextPrompt.java | TextPrompt.checkForPrompt | private void checkForPrompt() {
// Text has been entered, remove the prompt
if (document.getLength() > 0) {
setVisible(false);
return;
}
// Prompt has already been shown once, remove it
if (showPromptOnce && focusLost > 0) {
setVisible(fal... | java | private void checkForPrompt() {
// Text has been entered, remove the prompt
if (document.getLength() > 0) {
setVisible(false);
return;
}
// Prompt has already been shown once, remove it
if (showPromptOnce && focusLost > 0) {
setVisible(fal... | [
"private",
"void",
"checkForPrompt",
"(",
")",
"{",
"// Text has been entered, remove the prompt",
"if",
"(",
"document",
".",
"getLength",
"(",
")",
">",
"0",
")",
"{",
"setVisible",
"(",
"false",
")",
";",
"return",
";",
"}",
"// Prompt has already been shown ... | Check whether the prompt should be visible or not. The visibility
will applyChanges on updates to the Document and on focus changes. | [
"Check",
"whether",
"the",
"prompt",
"should",
"be",
"visible",
"or",
"not",
".",
"The",
"visibility",
"will",
"applyChanges",
"on",
"updates",
"to",
"the",
"Document",
"and",
"on",
"focus",
"changes",
"."
] | 06637e32bf737e3e0d318859c718815edac9d0f0 | https://github.com/massimozappino/tagmycode-java-plugin-framework/blob/06637e32bf737e3e0d318859c718815edac9d0f0/src/main/java/com/tagmycode/plugin/gui/TextPrompt.java#L140-L171 |
145,103 | dbracewell/mango | src/main/java/com/davidbracewell/collection/Trie.java | Trie.trimToSize | public Trie<V> trimToSize() {
Queue<TrieNode<V>> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
TrieNode<V> node = queue.remove();
node.children.trimToSize();
queue.addAll(node.children);
}
return this;
} | java | public Trie<V> trimToSize() {
Queue<TrieNode<V>> queue = new LinkedList<>();
queue.add(root);
while (!queue.isEmpty()) {
TrieNode<V> node = queue.remove();
node.children.trimToSize();
queue.addAll(node.children);
}
return this;
} | [
"public",
"Trie",
"<",
"V",
">",
"trimToSize",
"(",
")",
"{",
"Queue",
"<",
"TrieNode",
"<",
"V",
">>",
"queue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"queue",
".",
"add",
"(",
"root",
")",
";",
"while",
"(",
"!",
"queue",
".",
"isEmpty"... | Compresses the memory of the individual trie nodes.
@return this trie | [
"Compresses",
"the",
"memory",
"of",
"the",
"individual",
"trie",
"nodes",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/collection/Trie.java#L367-L376 |
145,104 | wanglinsong/testharness | src/main/java/com/tascape/qa/th/libx/DefaultExecutor.java | DefaultExecutor.createThread | @Override
protected Thread createThread(final Runnable runnable, final String name) {
return new Thread(runnable, Thread.currentThread().getName() + "-exec");
} | java | @Override
protected Thread createThread(final Runnable runnable, final String name) {
return new Thread(runnable, Thread.currentThread().getName() + "-exec");
} | [
"@",
"Override",
"protected",
"Thread",
"createThread",
"(",
"final",
"Runnable",
"runnable",
",",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Thread",
"(",
"runnable",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getName",
"(",
")",
"+"... | Factory method to create a thread waiting for the result of an
asynchronous execution.
@param runnable the runnable passed to the thread
@param name the name of the thread
@return the thread | [
"Factory",
"method",
"to",
"create",
"a",
"thread",
"waiting",
"for",
"the",
"result",
"of",
"an",
"asynchronous",
"execution",
"."
] | 76f3e4546648e0720f6f87a58cb91a09cd36dfca | https://github.com/wanglinsong/testharness/blob/76f3e4546648e0720f6f87a58cb91a09cd36dfca/src/main/java/com/tascape/qa/th/libx/DefaultExecutor.java#L33-L36 |
145,105 | dbracewell/mango | src/main/java/com/davidbracewell/io/CSVReader.java | CSVReader.forEach | @Override
public void forEach(Consumer<? super List<String>> consumer) {
try (Stream<List<String>> stream = stream()) {
stream.forEach(consumer);
}
} | java | @Override
public void forEach(Consumer<? super List<String>> consumer) {
try (Stream<List<String>> stream = stream()) {
stream.forEach(consumer);
}
} | [
"@",
"Override",
"public",
"void",
"forEach",
"(",
"Consumer",
"<",
"?",
"super",
"List",
"<",
"String",
">",
">",
"consumer",
")",
"{",
"try",
"(",
"Stream",
"<",
"List",
"<",
"String",
">",
">",
"stream",
"=",
"stream",
"(",
")",
")",
"{",
"strea... | Convenience method for consuming all rows in the CSV file
@param consumer the consumer to use to process the rows | [
"Convenience",
"method",
"for",
"consuming",
"all",
"rows",
"in",
"the",
"CSV",
"file"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/CSVReader.java#L153-L158 |
145,106 | dbracewell/mango | src/main/java/com/davidbracewell/io/CSVReader.java | CSVReader.getHeader | public List<String> getHeader() {
if (header == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(header);
} | java | public List<String> getHeader() {
if (header == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(header);
} | [
"public",
"List",
"<",
"String",
">",
"getHeader",
"(",
")",
"{",
"if",
"(",
"header",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"return",
"Collections",
".",
"unmodifiableList",
"(",
"header",
")",
";",
"}"... | Gets the header read in from the csv file or specified via the CSV specification.
@return The header of the CSV file | [
"Gets",
"the",
"header",
"read",
"in",
"from",
"the",
"csv",
"file",
"or",
"specified",
"via",
"the",
"CSV",
"specification",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/CSVReader.java#L165-L170 |
145,107 | dbracewell/mango | src/main/java/com/davidbracewell/io/CSVReader.java | CSVReader.nextRow | public List<String> nextRow() throws IOException {
row = new ArrayList<>();
STATE = START;
int c;
int readCount = 0;
gobbleWhiteSpace();
while ((c = read()) != -1) {
if (c == '\r') {
if (bufferPeek() == '\n') {
continue;
} else {
... | java | public List<String> nextRow() throws IOException {
row = new ArrayList<>();
STATE = START;
int c;
int readCount = 0;
gobbleWhiteSpace();
while ((c = read()) != -1) {
if (c == '\r') {
if (bufferPeek() == '\n') {
continue;
} else {
... | [
"public",
"List",
"<",
"String",
">",
"nextRow",
"(",
")",
"throws",
"IOException",
"{",
"row",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"STATE",
"=",
"START",
";",
"int",
"c",
";",
"int",
"readCount",
"=",
"0",
";",
"gobbleWhiteSpace",
"(",
")"... | Reads the next row from the CSV file retuning null if there are not anymore
@return the row as a list of strings or null if there are not any more rows to read
@throws IOException Something went wrong reading the file | [
"Reads",
"the",
"next",
"row",
"from",
"the",
"CSV",
"file",
"retuning",
"null",
"if",
"there",
"are",
"not",
"anymore"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/CSVReader.java#L218-L261 |
145,108 | dbracewell/mango | src/main/java/com/davidbracewell/io/CSVReader.java | CSVReader.stream | public Stream<List<String>> stream() {
return Streams.asStream(new RowIterator()).onClose(Unchecked.runnable(this::close));
} | java | public Stream<List<String>> stream() {
return Streams.asStream(new RowIterator()).onClose(Unchecked.runnable(this::close));
} | [
"public",
"Stream",
"<",
"List",
"<",
"String",
">",
">",
"stream",
"(",
")",
"{",
"return",
"Streams",
".",
"asStream",
"(",
"new",
"RowIterator",
"(",
")",
")",
".",
"onClose",
"(",
"Unchecked",
".",
"runnable",
"(",
"this",
"::",
"close",
")",
")"... | Creates a new stream over the rows in the file that will close underlying reader on stream close.
@return the stream of rows in the file | [
"Creates",
"a",
"new",
"stream",
"over",
"the",
"rows",
"in",
"the",
"file",
"that",
"will",
"close",
"underlying",
"reader",
"on",
"stream",
"close",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/CSVReader.java#L326-L328 |
145,109 | vst/commons-math-extensions | src/main/java/com/vsthost/rnd/commons/math/ext/linear/IOUtils.java | IOUtils.readMatrix | public static RealMatrix readMatrix (Reader reader) throws IOException {
// Initialize the return value:
List<double[]> retval = new ArrayList<>();
// Parse and get the iterarable:
Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(reader);
// Iterate over the records and popu... | java | public static RealMatrix readMatrix (Reader reader) throws IOException {
// Initialize the return value:
List<double[]> retval = new ArrayList<>();
// Parse and get the iterarable:
Iterable<CSVRecord> records = CSVFormat.EXCEL.parse(reader);
// Iterate over the records and popu... | [
"public",
"static",
"RealMatrix",
"readMatrix",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"// Initialize the return value:",
"List",
"<",
"double",
"[",
"]",
">",
"retval",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Parse and get the itera... | Reads a matrix of double values from the reader provided.
@param reader The reader which the values to be read from.
@return A matrix
@throws IOException As thrown by the CSV parser. | [
"Reads",
"a",
"matrix",
"of",
"double",
"values",
"from",
"the",
"reader",
"provided",
"."
] | a11ee78ffe53ab7c016062be93c5af07aa8e1823 | https://github.com/vst/commons-math-extensions/blob/a11ee78ffe53ab7c016062be93c5af07aa8e1823/src/main/java/com/vsthost/rnd/commons/math/ext/linear/IOUtils.java#L54-L76 |
145,110 | rwl/JKLU | src/main/java/edu/ufl/cise/klu/tdouble/Dklu_analyze_given.java | Dklu_analyze_given.klu_alloc_symbolic | protected static KLU_symbolic klu_alloc_symbolic(int n, int[] Ap, int[] Ai, KLU_common Common)
{
KLU_symbolic Symbolic ;
int[] P, Q, R ;
double[] Lnz ;
int nz, i, j, p, pend ;
if (Common == null)
{
return (null) ;
}
Common.status = KLU_OK ;
/* A is n-by-n, with n > 0. Ap [0] = 0 and nz = Ap [n]... | java | protected static KLU_symbolic klu_alloc_symbolic(int n, int[] Ap, int[] Ai, KLU_common Common)
{
KLU_symbolic Symbolic ;
int[] P, Q, R ;
double[] Lnz ;
int nz, i, j, p, pend ;
if (Common == null)
{
return (null) ;
}
Common.status = KLU_OK ;
/* A is n-by-n, with n > 0. Ap [0] = 0 and nz = Ap [n]... | [
"protected",
"static",
"KLU_symbolic",
"klu_alloc_symbolic",
"(",
"int",
"n",
",",
"int",
"[",
"]",
"Ap",
",",
"int",
"[",
"]",
"Ai",
",",
"KLU_common",
"Common",
")",
"{",
"KLU_symbolic",
"Symbolic",
";",
"int",
"[",
"]",
"P",
",",
"Q",
",",
"R",
";... | Allocate Symbolic object, and check input matrix. Not user callable.
@param n
@param Ap
@param Ai
@param Common
@return | [
"Allocate",
"Symbolic",
"object",
"and",
"check",
"input",
"matrix",
".",
"Not",
"user",
"callable",
"."
] | 4e5fcdfb479040be72b4642ff1682670142b4892 | https://github.com/rwl/JKLU/blob/4e5fcdfb479040be72b4642ff1682670142b4892/src/main/java/edu/ufl/cise/klu/tdouble/Dklu_analyze_given.java#L54-L163 |
145,111 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java | Device.connectToLink | public void connectToLink(Link link) throws ShanksException {
if (!this.linksList.contains(link)) {
this.linksList.add(link);
logger.finer("Device " + this.getID()
+ " is now connected to Link " + link.getID());
link.connectDevice(this);
}
} | java | public void connectToLink(Link link) throws ShanksException {
if (!this.linksList.contains(link)) {
this.linksList.add(link);
logger.finer("Device " + this.getID()
+ " is now connected to Link " + link.getID());
link.connectDevice(this);
}
} | [
"public",
"void",
"connectToLink",
"(",
"Link",
"link",
")",
"throws",
"ShanksException",
"{",
"if",
"(",
"!",
"this",
".",
"linksList",
".",
"contains",
"(",
"link",
")",
")",
"{",
"this",
".",
"linksList",
".",
"add",
"(",
"link",
")",
";",
"logger",... | Connect the device to a link
@param link
@throws TooManyConnectionException | [
"Connect",
"the",
"device",
"to",
"a",
"link"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java#L88-L95 |
145,112 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java | Device.disconnectFromLink | public void disconnectFromLink(Link link) {
boolean disconnected = this.linksList.remove(link);
if (disconnected) {
link.disconnectDevice(this);
logger.fine("Device " + this.getID()
+ " is now disconnected from Link " + link.getID());
} else {
... | java | public void disconnectFromLink(Link link) {
boolean disconnected = this.linksList.remove(link);
if (disconnected) {
link.disconnectDevice(this);
logger.fine("Device " + this.getID()
+ " is now disconnected from Link " + link.getID());
} else {
... | [
"public",
"void",
"disconnectFromLink",
"(",
"Link",
"link",
")",
"{",
"boolean",
"disconnected",
"=",
"this",
".",
"linksList",
".",
"remove",
"(",
"link",
")",
";",
"if",
"(",
"disconnected",
")",
"{",
"link",
".",
"disconnectDevice",
"(",
"this",
")",
... | Disconnect the device From a link
@param link | [
"Disconnect",
"the",
"device",
"From",
"a",
"link"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java#L102-L113 |
145,113 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java | Device.connectToDeviceWithLink | public void connectToDeviceWithLink(Device device, Link link)
throws ShanksException {
this.connectToLink(link);
try {
device.connectToLink(link);
} catch (ShanksException e) {
this.disconnectFromLink(link);
throw e;
}
} | java | public void connectToDeviceWithLink(Device device, Link link)
throws ShanksException {
this.connectToLink(link);
try {
device.connectToLink(link);
} catch (ShanksException e) {
this.disconnectFromLink(link);
throw e;
}
} | [
"public",
"void",
"connectToDeviceWithLink",
"(",
"Device",
"device",
",",
"Link",
"link",
")",
"throws",
"ShanksException",
"{",
"this",
".",
"connectToLink",
"(",
"link",
")",
";",
"try",
"{",
"device",
".",
"connectToLink",
"(",
"link",
")",
";",
"}",
"... | Connect the device to other device with a link
@param device
@param link
@throws TooManyConnectionException | [
"Connect",
"the",
"device",
"to",
"other",
"device",
"with",
"a",
"link"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/element/device/Device.java#L122-L131 |
145,114 | dbracewell/mango | src/main/java/com/davidbracewell/io/JarUtils.java | JarUtils.getClasspathResources | public static List<Resource> getClasspathResources() {
synchronized (classpathResources) {
if (classpathResources.isEmpty()) {
for (String jar : SystemInfo.JAVA_CLASS_PATH.split(SystemInfo.PATH_SEPARATOR)) {
File file = new File(jar);
if (file.isDirectory()) {
... | java | public static List<Resource> getClasspathResources() {
synchronized (classpathResources) {
if (classpathResources.isEmpty()) {
for (String jar : SystemInfo.JAVA_CLASS_PATH.split(SystemInfo.PATH_SEPARATOR)) {
File file = new File(jar);
if (file.isDirectory()) {
... | [
"public",
"static",
"List",
"<",
"Resource",
">",
"getClasspathResources",
"(",
")",
"{",
"synchronized",
"(",
"classpathResources",
")",
"{",
"if",
"(",
"classpathResources",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"String",
"jar",
":",
"SystemInfo"... | Gets classpath resources.
@return A list of all resources on the classpath | [
"Gets",
"classpath",
"resources",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/JarUtils.java#L116-L130 |
145,115 | sangupta/jerry-services | src/main/java/com/sangupta/jerry/quartz/BaseQuartzJob.java | BaseQuartzJob.initializeApplicationContext | private void initializeApplicationContext(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
this.applicationContext = (ApplicationContext) jobExecutionContext.getScheduler().getContext().get("applicationContext");
if (this.applicationContext == null) {
... | java | private void initializeApplicationContext(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
this.applicationContext = (ApplicationContext) jobExecutionContext.getScheduler().getContext().get("applicationContext");
if (this.applicationContext == null) {
... | [
"private",
"void",
"initializeApplicationContext",
"(",
"JobExecutionContext",
"jobExecutionContext",
")",
"throws",
"JobExecutionException",
"{",
"try",
"{",
"this",
".",
"applicationContext",
"=",
"(",
"ApplicationContext",
")",
"jobExecutionContext",
".",
"getScheduler",... | Initialize Spring Application Context from Quartz SchedulerContext.
@param jobExecutionContext
the {@link JobExecutionContext} to use
@throws JobExecutionException
if something fails | [
"Initialize",
"Spring",
"Application",
"Context",
"from",
"Quartz",
"SchedulerContext",
"."
] | 25ff6577445850916425c72068d654c08eba9bcc | https://github.com/sangupta/jerry-services/blob/25ff6577445850916425c72068d654c08eba9bcc/src/main/java/com/sangupta/jerry/quartz/BaseQuartzJob.java#L91-L101 |
145,116 | dbracewell/mango | src/main/java/com/davidbracewell/tuple/Tuple4.java | Tuple4.of | public static <A, B, C, D> Tuple4<A, B, C, D> of(A a, B b, C c, D d) {
return new Tuple4<>(a, b, c, d);
} | java | public static <A, B, C, D> Tuple4<A, B, C, D> of(A a, B b, C c, D d) {
return new Tuple4<>(a, b, c, d);
} | [
"public",
"static",
"<",
"A",
",",
"B",
",",
"C",
",",
"D",
">",
"Tuple4",
"<",
"A",
",",
"B",
",",
"C",
",",
"D",
">",
"of",
"(",
"A",
"a",
",",
"B",
"b",
",",
"C",
"c",
",",
"D",
"d",
")",
"{",
"return",
"new",
"Tuple4",
"<>",
"(",
... | Of tuple 4.
@param <A> the type parameter
@param <B> the type parameter
@param <C> the type parameter
@param <D> the type parameter
@param a the a
@param b the b
@param c the c
@param d the d
@return the tuple 4 | [
"Of",
"tuple",
"4",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/tuple/Tuple4.java#L86-L88 |
145,117 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.registerDiscoveryClient | static void registerDiscoveryClient(UUID injectorId, ReadOnlyDiscoveryClient discoveryClient, DiscoveryJmsConfig config) {
DISCO_CLIENTS.put(injectorId, discoveryClient);
CONFIGS.put(injectorId, config);
LOG.info("Registered discovery client %s as %s", injectorId, discoveryClient);
} | java | static void registerDiscoveryClient(UUID injectorId, ReadOnlyDiscoveryClient discoveryClient, DiscoveryJmsConfig config) {
DISCO_CLIENTS.put(injectorId, discoveryClient);
CONFIGS.put(injectorId, config);
LOG.info("Registered discovery client %s as %s", injectorId, discoveryClient);
} | [
"static",
"void",
"registerDiscoveryClient",
"(",
"UUID",
"injectorId",
",",
"ReadOnlyDiscoveryClient",
"discoveryClient",
",",
"DiscoveryJmsConfig",
"config",
")",
"{",
"DISCO_CLIENTS",
".",
"put",
"(",
"injectorId",
",",
"discoveryClient",
")",
";",
"CONFIGS",
".",
... | Register a discoveryClient under a unique id. This works around the TransportFactory's inherent staticness
so that we may use the correct discovery client even in the presence of multiple injectors in the same JVM. | [
"Register",
"a",
"discoveryClient",
"under",
"a",
"unique",
"id",
".",
"This",
"works",
"around",
"the",
"TransportFactory",
"s",
"inherent",
"staticness",
"so",
"that",
"we",
"may",
"use",
"the",
"correct",
"discovery",
"client",
"even",
"in",
"the",
"presenc... | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L70-L74 |
145,118 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.findParameters | @SuppressWarnings("PMD.PreserveStackTrace")
private Map<String, String> findParameters(URI location) throws MalformedURLException {
final Map<String, String> params;
try {
params = URISupport.parseParameters(location);
} catch (final URISyntaxException e) {
throw new ... | java | @SuppressWarnings("PMD.PreserveStackTrace")
private Map<String, String> findParameters(URI location) throws MalformedURLException {
final Map<String, String> params;
try {
params = URISupport.parseParameters(location);
} catch (final URISyntaxException e) {
throw new ... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.PreserveStackTrace\"",
")",
"private",
"Map",
"<",
"String",
",",
"String",
">",
"findParameters",
"(",
"URI",
"location",
")",
"throws",
"MalformedURLException",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"param... | Extract the query string from a connection URI into a Map | [
"Extract",
"the",
"query",
"string",
"from",
"a",
"connection",
"URI",
"into",
"a",
"Map"
] | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L94-L103 |
145,119 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.getDiscoveryId | private UUID getDiscoveryId(final Map<String, String> params) throws IOException {
final String discoveryId = params.get("discoveryId");
if (discoveryId == null) {
throw new IOException("srvc transport did not get a discoveryId parameter. Refusing to create.");
}
return UUI... | java | private UUID getDiscoveryId(final Map<String, String> params) throws IOException {
final String discoveryId = params.get("discoveryId");
if (discoveryId == null) {
throw new IOException("srvc transport did not get a discoveryId parameter. Refusing to create.");
}
return UUI... | [
"private",
"UUID",
"getDiscoveryId",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"final",
"String",
"discoveryId",
"=",
"params",
".",
"get",
"(",
"\"discoveryId\"",
")",
";",
"if",
"(",
"discoveryId",... | Find and validate the discoveryId given in a connection string | [
"Find",
"and",
"validate",
"the",
"discoveryId",
"given",
"in",
"a",
"connection",
"string"
] | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L108-L115 |
145,120 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.getDiscoveryClient | private ReadOnlyDiscoveryClient getDiscoveryClient(Map<String, String> params) throws IOException {
final UUID discoveryId = getDiscoveryId(params);
final ReadOnlyDiscoveryClient discoveryClient = DISCO_CLIENTS.get(discoveryId);
if (discoveryClient == null) {
throw new IOException(... | java | private ReadOnlyDiscoveryClient getDiscoveryClient(Map<String, String> params) throws IOException {
final UUID discoveryId = getDiscoveryId(params);
final ReadOnlyDiscoveryClient discoveryClient = DISCO_CLIENTS.get(discoveryId);
if (discoveryClient == null) {
throw new IOException(... | [
"private",
"ReadOnlyDiscoveryClient",
"getDiscoveryClient",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"final",
"UUID",
"discoveryId",
"=",
"getDiscoveryId",
"(",
"params",
")",
";",
"final",
"ReadOnlyDiscoveryClient"... | Locate the appropriate DiscoveryClient for a given discoveryId | [
"Locate",
"the",
"appropriate",
"DiscoveryClient",
"for",
"a",
"given",
"discoveryId"
] | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L120-L129 |
145,121 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.getServiceInformations | private List<ServiceInformation> getServiceInformations(URI location, final Map<String, String> params)
throws IOException {
final ReadOnlyDiscoveryClient discoveryClient = getDiscoveryClient(params);
final String serviceType = params.get("serviceType");
final List<ServiceInformati... | java | private List<ServiceInformation> getServiceInformations(URI location, final Map<String, String> params)
throws IOException {
final ReadOnlyDiscoveryClient discoveryClient = getDiscoveryClient(params);
final String serviceType = params.get("serviceType");
final List<ServiceInformati... | [
"private",
"List",
"<",
"ServiceInformation",
">",
"getServiceInformations",
"(",
"URI",
"location",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"IOException",
"{",
"final",
"ReadOnlyDiscoveryClient",
"discoveryClient",
"=",
"g... | Find and return applicable services for a given connection | [
"Find",
"and",
"return",
"applicable",
"services",
"for",
"a",
"given",
"connection"
] | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L138-L152 |
145,122 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.buildTransport | private Transport buildTransport(Map<String, String> params, final List<ServiceInformation> services) throws IOException {
final String configPostfix = getConfig(params).getServiceConfigurationPostfix();
final StringBuilder uriBuilder = new StringBuilder();
uriBuilder.append("failover:(");
... | java | private Transport buildTransport(Map<String, String> params, final List<ServiceInformation> services) throws IOException {
final String configPostfix = getConfig(params).getServiceConfigurationPostfix();
final StringBuilder uriBuilder = new StringBuilder();
uriBuilder.append("failover:(");
... | [
"private",
"Transport",
"buildTransport",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"final",
"List",
"<",
"ServiceInformation",
">",
"services",
")",
"throws",
"IOException",
"{",
"final",
"String",
"configPostfix",
"=",
"getConfig",
"(",
"... | From a list of ServiceInformation, build a failover transport that balances between the brokers. | [
"From",
"a",
"list",
"of",
"ServiceInformation",
"build",
"a",
"failover",
"transport",
"that",
"balances",
"between",
"the",
"brokers",
"."
] | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L157-L175 |
145,123 | NessComputing/service-discovery | jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java | ServiceDiscoveryTransportFactory.interceptPropertySetters | private Transport interceptPropertySetters(Transport transport) {
final Enhancer e = new Enhancer();
e.setInterfaces(new Class<?>[] {Transport.class, ServiceTransportBeanSetters.class});
final TransportDelegationFilter filter = new TransportDelegationFilter(transport, ServiceTransportBeanSetters... | java | private Transport interceptPropertySetters(Transport transport) {
final Enhancer e = new Enhancer();
e.setInterfaces(new Class<?>[] {Transport.class, ServiceTransportBeanSetters.class});
final TransportDelegationFilter filter = new TransportDelegationFilter(transport, ServiceTransportBeanSetters... | [
"private",
"Transport",
"interceptPropertySetters",
"(",
"Transport",
"transport",
")",
"{",
"final",
"Enhancer",
"e",
"=",
"new",
"Enhancer",
"(",
")",
";",
"e",
".",
"setInterfaces",
"(",
"new",
"Class",
"<",
"?",
">",
"[",
"]",
"{",
"Transport",
".",
... | ActiveMQ expects to reflectively call setX for every property x specified in the connection string.
Since we are actually constructing a failover transport, these properties are obviously not expected
and ActiveMQ complains that we are specifying invalid parameters. So create a CGLIB proxy that
intercepts and ignores ... | [
"ActiveMQ",
"expects",
"to",
"reflectively",
"call",
"setX",
"for",
"every",
"property",
"x",
"specified",
"in",
"the",
"connection",
"string",
".",
"Since",
"we",
"are",
"actually",
"constructing",
"a",
"failover",
"transport",
"these",
"properties",
"are",
"ob... | 5091ffdb1de6b12d216d1c238f72858037c7b765 | https://github.com/NessComputing/service-discovery/blob/5091ffdb1de6b12d216d1c238f72858037c7b765/jms/src/main/java/com/nesscomputing/jms/activemq/ServiceDiscoveryTransportFactory.java#L183-L190 |
145,124 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.beginArray | public String beginArray() throws IOException {
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (currentValue.getKey() == BEGIN_ARRAY) {
consume();
} else if (readStack.peek() != BEGIN_ARRAY) {
... | java | public String beginArray() throws IOException {
String name = null;
if (currentValue.getKey() == NAME) {
name = currentValue.getValue().asString();
consume();
}
if (currentValue.getKey() == BEGIN_ARRAY) {
consume();
} else if (readStack.peek() != BEGIN_ARRAY) {
... | [
"public",
"String",
"beginArray",
"(",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"null",
";",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"==",
"NAME",
")",
"{",
"name",
"=",
"currentValue",
".",
"getValue",
"(",
")",
".",
"asSt... | Begins an Array
@return This array's name
@throws IOException Something went wrong reading | [
"Begins",
"an",
"Array"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L89-L101 |
145,125 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.beginArray | public JsonReader beginArray(String expectedName) throws IOException {
String name = beginArray();
if (!StringUtils.isNullOrBlank(expectedName) && (name == null || !name.equals(expectedName))) {
throw new IOException("Expected " + expectedName);
}
return this;
} | java | public JsonReader beginArray(String expectedName) throws IOException {
String name = beginArray();
if (!StringUtils.isNullOrBlank(expectedName) && (name == null || !name.equals(expectedName))) {
throw new IOException("Expected " + expectedName);
}
return this;
} | [
"public",
"JsonReader",
"beginArray",
"(",
"String",
"expectedName",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"beginArray",
"(",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrBlank",
"(",
"expectedName",
")",
"&&",
"(",
"name",
"=="... | Begins an array with an expected name.
@param expectedName The name that the next array should have
@return the structured reader
@throws IOException Something happened reading or the expected name was not found | [
"Begins",
"an",
"array",
"with",
"an",
"expected",
"name",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L110-L116 |
145,126 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.beginObject | public JsonReader beginObject(String expectedName) throws IOException {
String name = beginObject();
if (!StringUtils.isNullOrBlank(expectedName) && !name.equals(expectedName)) {
throw new IOException("Expected " + expectedName);
}
return this;
} | java | public JsonReader beginObject(String expectedName) throws IOException {
String name = beginObject();
if (!StringUtils.isNullOrBlank(expectedName) && !name.equals(expectedName)) {
throw new IOException("Expected " + expectedName);
}
return this;
} | [
"public",
"JsonReader",
"beginObject",
"(",
"String",
"expectedName",
")",
"throws",
"IOException",
"{",
"String",
"name",
"=",
"beginObject",
"(",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrBlank",
"(",
"expectedName",
")",
"&&",
"!",
"name",
".... | Begins an object with an expected name.
@param expectedName The name that the next object should have
@return the structured reader
@throws IOException Something happened reading or the expected name was not found | [
"Begins",
"an",
"object",
"with",
"an",
"expected",
"name",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L161-L167 |
145,127 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.endArray | public JsonReader endArray() throws IOException {
if (currentValue.getKey() != END_ARRAY) {
throw new IOException("Expecting END_ARRAY, but found " + jsonTokenToStructuredElement(null));
}
consume();
return this;
} | java | public JsonReader endArray() throws IOException {
if (currentValue.getKey() != END_ARRAY) {
throw new IOException("Expecting END_ARRAY, but found " + jsonTokenToStructuredElement(null));
}
consume();
return this;
} | [
"public",
"JsonReader",
"endArray",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"!=",
"END_ARRAY",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Expecting END_ARRAY, but found \"",
"+",
"jsonTokenToStructuredElement... | Ends an Array
@return the structured reader
@throws IOException Something went wrong reading | [
"Ends",
"an",
"Array"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L246-L252 |
145,128 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.endObject | public JsonReader endObject() throws IOException {
if (currentValue.getKey() != END_OBJECT) {
throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null));
}
consume();
return this;
} | java | public JsonReader endObject() throws IOException {
if (currentValue.getKey() != END_OBJECT) {
throw new IOException("Expecting END_OBJECT, but found " + jsonTokenToStructuredElement(null));
}
consume();
return this;
} | [
"public",
"JsonReader",
"endObject",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"!=",
"END_OBJECT",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Expecting END_OBJECT, but found \"",
"+",
"jsonTokenToStructuredElem... | Ends the document
@return the structured reader
@throws IOException Something went wrong reading | [
"Ends",
"the",
"document"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L272-L278 |
145,129 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextKeyValue | public Tuple2<String, Val> nextKeyValue() throws IOException {
if (currentValue.getKey() != NAME) {
throw new IOException("Expecting NAME, but found " + jsonTokenToStructuredElement(null));
}
String name = currentValue.getValue().asString();
consume();
return Tuple2.of(name, nextV... | java | public Tuple2<String, Val> nextKeyValue() throws IOException {
if (currentValue.getKey() != NAME) {
throw new IOException("Expecting NAME, but found " + jsonTokenToStructuredElement(null));
}
String name = currentValue.getValue().asString();
consume();
return Tuple2.of(name, nextV... | [
"public",
"Tuple2",
"<",
"String",
",",
"Val",
">",
"nextKeyValue",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"!=",
"NAME",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Expecting NAME, but found \"",
"+",... | Reads the next key-value pair
@return The next key value pair
@throws IOException Something went wrong reading | [
"Reads",
"the",
"next",
"key",
"-",
"value",
"pair"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L458-L465 |
145,130 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextKeyValue | public Val nextKeyValue(String expectedKey) throws IOException {
Tuple2<String, Val> Tuple2 = nextKeyValue();
if (expectedKey != null && (Tuple2 == null || !Tuple2.getKey().equals(expectedKey))) {
throw new IOException("Expected a Key-Value Tuple2 with named " + expectedKey);
}
return T... | java | public Val nextKeyValue(String expectedKey) throws IOException {
Tuple2<String, Val> Tuple2 = nextKeyValue();
if (expectedKey != null && (Tuple2 == null || !Tuple2.getKey().equals(expectedKey))) {
throw new IOException("Expected a Key-Value Tuple2 with named " + expectedKey);
}
return T... | [
"public",
"Val",
"nextKeyValue",
"(",
"String",
"expectedKey",
")",
"throws",
"IOException",
"{",
"Tuple2",
"<",
"String",
",",
"Val",
">",
"Tuple2",
"=",
"nextKeyValue",
"(",
")",
";",
"if",
"(",
"expectedKey",
"!=",
"null",
"&&",
"(",
"Tuple2",
"==",
"... | Reads in a key value with an expected key.
@param expectedKey The expected key
@return The next key value Tuple2
@throws IOException Something went wrong reading | [
"Reads",
"in",
"a",
"key",
"value",
"with",
"an",
"expected",
"key",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L474-L480 |
145,131 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextKeyValue | public <T> Tuple2<String, T> nextKeyValue(Class<T> clazz) throws IOException {
if (currentValue.getKey() != NAME) {
throw new IOException("Expecting NAME, but found " + jsonTokenToStructuredElement(null));
}
String name = currentValue.getValue().asString();
consume();
return Tuple... | java | public <T> Tuple2<String, T> nextKeyValue(Class<T> clazz) throws IOException {
if (currentValue.getKey() != NAME) {
throw new IOException("Expecting NAME, but found " + jsonTokenToStructuredElement(null));
}
String name = currentValue.getValue().asString();
consume();
return Tuple... | [
"public",
"<",
"T",
">",
"Tuple2",
"<",
"String",
",",
"T",
">",
"nextKeyValue",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currentValue",
".",
"getKey",
"(",
")",
"!=",
"NAME",
")",
"{",
"throw",
"new",
"I... | Reads the next key-value pair with the value being of the given type
@param <T> the value type parameter
@param clazz the clazz associated with the value type
@return the next key-value pair
@throws IOException Something went wrong reading | [
"Reads",
"the",
"next",
"key",
"-",
"value",
"pair",
"with",
"the",
"value",
"being",
"of",
"the",
"given",
"type"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L490-L497 |
145,132 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextMap | public Map<String, Val> nextMap(String expectedName) throws IOException {
boolean ignoreObject = peek() != JsonTokenType.BEGIN_OBJECT && StringUtils.isNullOrBlank(expectedName);
if (!ignoreObject) beginObject(expectedName);
Map<String, Val> map = new HashMap<>();
while (peek() != JsonTokenType.E... | java | public Map<String, Val> nextMap(String expectedName) throws IOException {
boolean ignoreObject = peek() != JsonTokenType.BEGIN_OBJECT && StringUtils.isNullOrBlank(expectedName);
if (!ignoreObject) beginObject(expectedName);
Map<String, Val> map = new HashMap<>();
while (peek() != JsonTokenType.E... | [
"public",
"Map",
"<",
"String",
",",
"Val",
">",
"nextMap",
"(",
"String",
"expectedName",
")",
"throws",
"IOException",
"{",
"boolean",
"ignoreObject",
"=",
"peek",
"(",
")",
"!=",
"JsonTokenType",
".",
"BEGIN_OBJECT",
"&&",
"StringUtils",
".",
"isNullOrBlank... | Reads in the next object as a map with an expected name
@param expectedName the expected name of the next object
@return the map
@throws IOException Something went wrong reading | [
"Reads",
"in",
"the",
"next",
"object",
"as",
"a",
"map",
"with",
"an",
"expected",
"name"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L516-L526 |
145,133 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextSimpleValue | protected Val nextSimpleValue() throws IOException {
switch (currentValue.getKey()) {
case NULL:
case STRING:
case BOOLEAN:
case NUMBER:
Val object = currentValue.v2;
consume();
return object;
default:
throw new IOExcepti... | java | protected Val nextSimpleValue() throws IOException {
switch (currentValue.getKey()) {
case NULL:
case STRING:
case BOOLEAN:
case NUMBER:
Val object = currentValue.v2;
consume();
return object;
default:
throw new IOExcepti... | [
"protected",
"Val",
"nextSimpleValue",
"(",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"currentValue",
".",
"getKey",
"(",
")",
")",
"{",
"case",
"NULL",
":",
"case",
"STRING",
":",
"case",
"BOOLEAN",
":",
"case",
"NUMBER",
":",
"Val",
"object",
"... | Next simple value val.
@return the val
@throws IOException the io exception | [
"Next",
"simple",
"value",
"val",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L567-L579 |
145,134 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.nextValue | public Val nextValue() throws IOException {
switch (peek()) {
case BEGIN_ARRAY:
return Val.of(nextCollection(ArrayList::new));
case BEGIN_OBJECT:
return Val.of(nextMap());
case NAME:
return nextKeyValue().getV2();
default:
return ... | java | public Val nextValue() throws IOException {
switch (peek()) {
case BEGIN_ARRAY:
return Val.of(nextCollection(ArrayList::new));
case BEGIN_OBJECT:
return Val.of(nextMap());
case NAME:
return nextKeyValue().getV2();
default:
return ... | [
"public",
"Val",
"nextValue",
"(",
")",
"throws",
"IOException",
"{",
"switch",
"(",
"peek",
"(",
")",
")",
"{",
"case",
"BEGIN_ARRAY",
":",
"return",
"Val",
".",
"of",
"(",
"nextCollection",
"(",
"ArrayList",
"::",
"new",
")",
")",
";",
"case",
"BEGIN... | Reads the next value
@return The next value
@throws IOException Something went wrong reading | [
"Reads",
"the",
"next",
"value"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L587-L598 |
145,135 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.readReadable | protected <T> T readReadable(Class<T> clazz) throws IOException {
try {
T object = Reflect.onClass(clazz).allowPrivilegedAccess().create().get();
JsonSerializable readable = Cast.as(object);
boolean isArray = JsonArraySerializable.class.isAssignableFrom(clazz);//(object instanceof Array... | java | protected <T> T readReadable(Class<T> clazz) throws IOException {
try {
T object = Reflect.onClass(clazz).allowPrivilegedAccess().create().get();
JsonSerializable readable = Cast.as(object);
boolean isArray = JsonArraySerializable.class.isAssignableFrom(clazz);//(object instanceof Array... | [
"protected",
"<",
"T",
">",
"T",
"readReadable",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
"{",
"try",
"{",
"T",
"object",
"=",
"Reflect",
".",
"onClass",
"(",
"clazz",
")",
".",
"allowPrivilegedAccess",
"(",
")",
".",
"create... | Reads a class implementing readable
@param <T> the type parameter
@param clazz the clazz
@return the t
@throws IOException the io exception | [
"Reads",
"a",
"class",
"implementing",
"readable"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L675-L695 |
145,136 | dbracewell/mango | src/main/java/com/davidbracewell/json/JsonReader.java | JsonReader.skip | public JsonTokenType skip() throws IOException {
try {
JsonTokenType element = jsonTokenToStructuredElement(reader.peek());
JsonToken token = currentValue.getKey();
if (token == NAME &&
(element == JsonTokenType.BEGIN_OBJECT || element == JsonTokenType.BEGIN_ARRAY)) {
... | java | public JsonTokenType skip() throws IOException {
try {
JsonTokenType element = jsonTokenToStructuredElement(reader.peek());
JsonToken token = currentValue.getKey();
if (token == NAME &&
(element == JsonTokenType.BEGIN_OBJECT || element == JsonTokenType.BEGIN_ARRAY)) {
... | [
"public",
"JsonTokenType",
"skip",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"JsonTokenType",
"element",
"=",
"jsonTokenToStructuredElement",
"(",
"reader",
".",
"peek",
"(",
")",
")",
";",
"JsonToken",
"token",
"=",
"currentValue",
".",
"getKey",
"(... | Skips the next element in the stream
@return The type of the element that was skipped
@throws IOException Something went wrong reading | [
"Skips",
"the",
"next",
"element",
"in",
"the",
"stream"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/json/JsonReader.java#L703-L716 |
145,137 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.addJar | public JarScanner addJar(Collection<URL> jars) {
this.jars.addAll(jars.stream().map(JarScanner::toUri).collect(Collectors.toList()));
return this;
} | java | public JarScanner addJar(Collection<URL> jars) {
this.jars.addAll(jars.stream().map(JarScanner::toUri).collect(Collectors.toList()));
return this;
} | [
"public",
"JarScanner",
"addJar",
"(",
"Collection",
"<",
"URL",
">",
"jars",
")",
"{",
"this",
".",
"jars",
".",
"addAll",
"(",
"jars",
".",
"stream",
"(",
")",
".",
"map",
"(",
"JarScanner",
"::",
"toUri",
")",
".",
"collect",
"(",
"Collectors",
".... | Adds a jar file to be scanned
@param jars
jars to be added to the scanner
@return this scanner | [
"Adds",
"a",
"jar",
"file",
"to",
"be",
"scanned"
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L111-L114 |
145,138 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.toUri | private static URI toUri(final URL u) {
try {
return u.toURI();
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Could not convert URL "+u+" to uri",e);
}
} | java | private static URI toUri(final URL u) {
try {
return u.toURI();
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Could not convert URL "+u+" to uri",e);
}
} | [
"private",
"static",
"URI",
"toUri",
"(",
"final",
"URL",
"u",
")",
"{",
"try",
"{",
"return",
"u",
".",
"toURI",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Could not convert U... | Converts a url to uri without throwing a checked exception. In case an URI syntax exception occurs, an
IllegalArgumentException is thrown.
@param u
the url to be converted
@return
the converted uri | [
"Converts",
"a",
"url",
"to",
"uri",
"without",
"throwing",
"a",
"checked",
"exception",
".",
"In",
"case",
"an",
"URI",
"syntax",
"exception",
"occurs",
"an",
"IllegalArgumentException",
"is",
"thrown",
"."
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L124-L131 |
145,139 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.scanJar | private Collection<String> scanJar(Predicate<Path> pathFilter) {
return jars.parallelStream()
.map(JarScanner::createJarUri)
.flatMap(u -> scanJar(u, pathFilter).stream())
.distinct()
.collect(Collectors.toList());
} | java | private Collection<String> scanJar(Predicate<Path> pathFilter) {
return jars.parallelStream()
.map(JarScanner::createJarUri)
.flatMap(u -> scanJar(u, pathFilter).stream())
.distinct()
.collect(Collectors.toList());
} | [
"private",
"Collection",
"<",
"String",
">",
"scanJar",
"(",
"Predicate",
"<",
"Path",
">",
"pathFilter",
")",
"{",
"return",
"jars",
".",
"parallelStream",
"(",
")",
".",
"map",
"(",
"JarScanner",
"::",
"createJarUri",
")",
".",
"flatMap",
"(",
"u",
"->... | Scans the jars of the JarScanner finding all items matching the path filter
@param pathFilter
the filter to find items in the jars
@return
Collections of items of the jars matching the filter | [
"Scans",
"the",
"jars",
"of",
"the",
"JarScanner",
"finding",
"all",
"items",
"matching",
"the",
"path",
"filter"
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L160-L166 |
145,140 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.scanJar | private Collection<String> scanJar(URI u, Predicate<Path> pathPredicate) {
try (FileSystem fs = FileSystems.newFileSystem(u, READY_ONLY_ENV)) {
return Files.walk(fs.getPath("/"))
.filter(pathPredicate)
.map(f -> toFQName(f.toAbsolutePath()))
... | java | private Collection<String> scanJar(URI u, Predicate<Path> pathPredicate) {
try (FileSystem fs = FileSystems.newFileSystem(u, READY_ONLY_ENV)) {
return Files.walk(fs.getPath("/"))
.filter(pathPredicate)
.map(f -> toFQName(f.toAbsolutePath()))
... | [
"private",
"Collection",
"<",
"String",
">",
"scanJar",
"(",
"URI",
"u",
",",
"Predicate",
"<",
"Path",
">",
"pathPredicate",
")",
"{",
"try",
"(",
"FileSystem",
"fs",
"=",
"FileSystems",
".",
"newFileSystem",
"(",
"u",
",",
"READY_ONLY_ENV",
")",
")",
"... | Scans the jar and filters all elements
@param u
the uri of the jar file to be scanned
@param pathPredicate
the matching predicate for collecting the entries
@return a stream of collected strings | [
"Scans",
"the",
"jar",
"and",
"filters",
"all",
"elements"
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L178-L188 |
145,141 | devcon5io/common | classutils/src/main/java/io/devcon5/classutils/JarScanner.java | JarScanner.isIgnored | private boolean isIgnored(Path p) {
final String path = toFQName(p);
return this.ignoredFolders.stream().anyMatch(path::startsWith);
} | java | private boolean isIgnored(Path p) {
final String path = toFQName(p);
return this.ignoredFolders.stream().anyMatch(path::startsWith);
} | [
"private",
"boolean",
"isIgnored",
"(",
"Path",
"p",
")",
"{",
"final",
"String",
"path",
"=",
"toFQName",
"(",
"p",
")",
";",
"return",
"this",
".",
"ignoredFolders",
".",
"stream",
"(",
")",
".",
"anyMatch",
"(",
"path",
"::",
"startsWith",
")",
";",... | Checks if the specified path is on the ignore list
@param p
the path to check
@return true if the path should be ignored | [
"Checks",
"if",
"the",
"specified",
"path",
"is",
"on",
"the",
"ignore",
"list"
] | 363688e0dc904d559682bf796bd6c836b4e0efc7 | https://github.com/devcon5io/common/blob/363688e0dc904d559682bf796bd6c836b4e0efc7/classutils/src/main/java/io/devcon5/classutils/JarScanner.java#L212-L215 |
145,142 | dbracewell/mango | src/main/java/com/davidbracewell/io/resource/BaseResource.java | BaseResource.createOutputStream | protected OutputStream createOutputStream() throws IOException {
if (asFile().isPresent()) {
return new FileOutputStream(asFile().orElse(null));
}
return null;
} | java | protected OutputStream createOutputStream() throws IOException {
if (asFile().isPresent()) {
return new FileOutputStream(asFile().orElse(null));
}
return null;
} | [
"protected",
"OutputStream",
"createOutputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"asFile",
"(",
")",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"new",
"FileOutputStream",
"(",
"asFile",
"(",
")",
".",
"orElse",
"(",
"null",
")",
... | Create output stream output stream.
@return the output stream
@throws IOException the io exception | [
"Create",
"output",
"stream",
"output",
"stream",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/resource/BaseResource.java#L109-L115 |
145,143 | dbracewell/mango | src/main/java/com/davidbracewell/io/resource/BaseResource.java | BaseResource.createInputStream | protected InputStream createInputStream() throws IOException {
if (asFile().isPresent()) {
return new FileInputStream(asFile().orElse(null));
}
return null;
} | java | protected InputStream createInputStream() throws IOException {
if (asFile().isPresent()) {
return new FileInputStream(asFile().orElse(null));
}
return null;
} | [
"protected",
"InputStream",
"createInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"asFile",
"(",
")",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"new",
"FileInputStream",
"(",
"asFile",
"(",
")",
".",
"orElse",
"(",
"null",
")",
")... | Create input stream input stream.
@return the input stream
@throws IOException the io exception | [
"Create",
"input",
"stream",
"input",
"stream",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/io/resource/BaseResource.java#L123-L128 |
145,144 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.uppercaseToUnderscore | public static String uppercaseToUnderscore(final String str) {
if (str == null) {
return null;
}
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
final char ch = str.charAt(i);
if (Character.isUpperCase(ch)) {... | java | public static String uppercaseToUnderscore(final String str) {
if (str == null) {
return null;
}
final StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
final char ch = str.charAt(i);
if (Character.isUpperCase(ch)) {... | [
"public",
"static",
"String",
"uppercaseToUnderscore",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
... | Inserts an underscore before every upper case character and returns an
all lower case string. If the first character is upper case an underscore
will not be inserted.
@param str
String to convert.
@return Lower case + underscored text. | [
"Inserts",
"an",
"underscore",
"before",
"every",
"upper",
"case",
"character",
"and",
"returns",
"an",
"all",
"lower",
"case",
"string",
".",
"If",
"the",
"first",
"character",
"is",
"upper",
"case",
"an",
"underscore",
"will",
"not",
"be",
"inserted",
"."
... | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L277-L294 |
145,145 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.concatPackages | public static String concatPackages(final String package1, final String package2) {
if ((package1 == null) || (package1.length() == 0)) {
if ((package2 == null) || (package2.length() == 0)) {
return "";
} else {
return package2;
}
... | java | public static String concatPackages(final String package1, final String package2) {
if ((package1 == null) || (package1.length() == 0)) {
if ((package2 == null) || (package2.length() == 0)) {
return "";
} else {
return package2;
}
... | [
"public",
"static",
"String",
"concatPackages",
"(",
"final",
"String",
"package1",
",",
"final",
"String",
"package2",
")",
"{",
"if",
"(",
"(",
"package1",
"==",
"null",
")",
"||",
"(",
"package1",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"{",
... | Merge two packages into one. If any package is null or empty no "." will
be added. If both packages are null an empty string will be returned.
@param package1
First package - Can also be null or empty.
@param package2
Second package - Can also be null or empty.
@return Both packages added with ".". | [
"Merge",
"two",
"packages",
"into",
"one",
".",
"If",
"any",
"package",
"is",
"null",
"or",
"empty",
"no",
".",
"will",
"be",
"added",
".",
"If",
"both",
"packages",
"are",
"null",
"an",
"empty",
"string",
"will",
"be",
"returned",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L329-L343 |
145,146 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.modifierMatrixToHtml | public static String modifierMatrixToHtml() {
final StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\">\n");
// Header
sb.append("<tr>");
sb.append("<th> </th>");
for (int type = FIELD; type <= INNER_INTERFACE; type++) {
sb.appe... | java | public static String modifierMatrixToHtml() {
final StringBuffer sb = new StringBuffer();
sb.append("<table border=\"1\">\n");
// Header
sb.append("<tr>");
sb.append("<th> </th>");
for (int type = FIELD; type <= INNER_INTERFACE; type++) {
sb.appe... | [
"public",
"static",
"String",
"modifierMatrixToHtml",
"(",
")",
"{",
"final",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"<table border=\\\"1\\\">\\n\"",
")",
";",
"// Header\r",
"sb",
".",
"append",
"(",
"\"<t... | Create a simple HTML table for the modifier matrix. This is helpful to
check if the matrix is valid.
@return Modifier matrix HTML table. | [
"Create",
"a",
"simple",
"HTML",
"table",
"for",
"the",
"modifier",
"matrix",
".",
"This",
"is",
"helpful",
"to",
"check",
"if",
"the",
"matrix",
"is",
"valid",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L379-L408 |
145,147 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.toModifiers | public static int toModifiers(final String modifiers) {
if (modifiers == null) {
return 0;
}
final String trimmedModifiers = modifiers.trim();
int modifier = 0;
final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
while (tok.hasMoreTo... | java | public static int toModifiers(final String modifiers) {
if (modifiers == null) {
return 0;
}
final String trimmedModifiers = modifiers.trim();
int modifier = 0;
final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
while (tok.hasMoreTo... | [
"public",
"static",
"int",
"toModifiers",
"(",
"final",
"String",
"modifiers",
")",
"{",
"if",
"(",
"modifiers",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"final",
"String",
"trimmedModifiers",
"=",
"modifiers",
".",
"trim",
"(",
")",
";",
"int",
... | Returns a Java "Modifier" value for a list of modifier names.
@param modifiers
Modifier names separated by spaces.
@return Modifiers. | [
"Returns",
"a",
"Java",
"Modifier",
"value",
"for",
"a",
"list",
"of",
"modifier",
"names",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L427-L439 |
145,148 | fuinorg/srcgen4javassist | src/main/java/org/fuin/srcgen4javassist/SgUtils.java | SgUtils.createAnnotations | public static List<SgAnnotation> createAnnotations(final Annotation[] ann) {
final List<SgAnnotation> list = new ArrayList<SgAnnotation>();
if ((ann != null) && (ann.length > 0)) {
for (int i = 0; i < ann.length; i++) {
final SgAnnotation annotation = new SgAnnotation(ann... | java | public static List<SgAnnotation> createAnnotations(final Annotation[] ann) {
final List<SgAnnotation> list = new ArrayList<SgAnnotation>();
if ((ann != null) && (ann.length > 0)) {
for (int i = 0; i < ann.length; i++) {
final SgAnnotation annotation = new SgAnnotation(ann... | [
"public",
"static",
"List",
"<",
"SgAnnotation",
">",
"createAnnotations",
"(",
"final",
"Annotation",
"[",
"]",
"ann",
")",
"{",
"final",
"List",
"<",
"SgAnnotation",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"SgAnnotation",
">",
"(",
")",
";",
"if",
"... | Create a list of annotations.
@param ann
Java annotation array.
@return List of annotations. | [
"Create",
"a",
"list",
"of",
"annotations",
"."
] | 355828113cfce3cdd3d69ba242c5bdfc7d899f2f | https://github.com/fuinorg/srcgen4javassist/blob/355828113cfce3cdd3d69ba242c5bdfc7d899f2f/src/main/java/org/fuin/srcgen4javassist/SgUtils.java#L569-L580 |
145,149 | chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java | FileTracer.open | @Override
public void open() {
try {
if (this.isOpened() == false) {
System.out.println(formatVersionInfo() + " Opening ...");
this.traceLogfile = FileSystems.getDefault().getPath(this.logDirPath.toString(), super.getName() + ".log").toFile();
this.fileOutputStream = new File... | java | @Override
public void open() {
try {
if (this.isOpened() == false) {
System.out.println(formatVersionInfo() + " Opening ...");
this.traceLogfile = FileSystems.getDefault().getPath(this.logDirPath.toString(), super.getName() + ".log").toFile();
this.fileOutputStream = new File... | [
"@",
"Override",
"public",
"void",
"open",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"isOpened",
"(",
")",
"==",
"false",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"formatVersionInfo",
"(",
")",
"+",
"\" Opening ...\"",
")",
";",
... | Creates the underlying trace file and opens the associated trace streams. The file name will be assembled by the path to
log directory and the name of the tracer. | [
"Creates",
"the",
"underlying",
"trace",
"file",
"and",
"opens",
"the",
"associated",
"trace",
"streams",
".",
"The",
"file",
"name",
"will",
"be",
"assembled",
"by",
"the",
"path",
"to",
"log",
"directory",
"and",
"the",
"name",
"of",
"the",
"tracer",
"."... | ad22452b20f8111ad4d367302c2b26a100a20200 | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java#L95-L119 |
145,150 | chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java | FileTracer.close | @Override
public void close() {
try {
if (this.isOpened() == true) {
this.getTracePrintStream().println();
this.getTracePrintStream().printf("--> TraceLog closing!%n");
this.getTracePrintStream().printf(" Time : %tc%n", new Date());
System.out.println(formatSt... | java | @Override
public void close() {
try {
if (this.isOpened() == true) {
this.getTracePrintStream().println();
this.getTracePrintStream().printf("--> TraceLog closing!%n");
this.getTracePrintStream().printf(" Time : %tc%n", new Date());
System.out.println(formatSt... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"isOpened",
"(",
")",
"==",
"true",
")",
"{",
"this",
".",
"getTracePrintStream",
"(",
")",
".",
"println",
"(",
")",
";",
"this",
".",
"getTracePrintStrea... | Closes the associated trace streams. | [
"Closes",
"the",
"associated",
"trace",
"streams",
"."
] | ad22452b20f8111ad4d367302c2b26a100a20200 | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java#L124-L146 |
145,151 | chr78rm/tracelogger | src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java | FileTracer.checkLimit | protected void checkLimit() {
synchronized (this.getSyncObject()) {
if (this.byteLimit != -1 && this.traceLogfile != null && this.traceLogfile.length() > this.byteLimit) {
close();
int pos = this.traceLogfile.getAbsolutePath().lastIndexOf('\u002e');
String splitFilename ... | java | protected void checkLimit() {
synchronized (this.getSyncObject()) {
if (this.byteLimit != -1 && this.traceLogfile != null && this.traceLogfile.length() > this.byteLimit) {
close();
int pos = this.traceLogfile.getAbsolutePath().lastIndexOf('\u002e');
String splitFilename ... | [
"protected",
"void",
"checkLimit",
"(",
")",
"{",
"synchronized",
"(",
"this",
".",
"getSyncObject",
"(",
")",
")",
"{",
"if",
"(",
"this",
".",
"byteLimit",
"!=",
"-",
"1",
"&&",
"this",
".",
"traceLogfile",
"!=",
"null",
"&&",
"this",
".",
"traceLogf... | Checks if the file size limit has been exceeded and splits the trace file if need be. | [
"Checks",
"if",
"the",
"file",
"size",
"limit",
"has",
"been",
"exceeded",
"and",
"splits",
"the",
"trace",
"file",
"if",
"need",
"be",
"."
] | ad22452b20f8111ad4d367302c2b26a100a20200 | https://github.com/chr78rm/tracelogger/blob/ad22452b20f8111ad4d367302c2b26a100a20200/src/main/java/de/christofreichardt/diagnosis/file/FileTracer.java#L172-L189 |
145,152 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/util/HalCuriAugmenter.java | HalCuriAugmenter.register | public HalCuriAugmenter register(String name, String href) {
Link link = new Link(href).setName(name);
return register(link);
} | java | public HalCuriAugmenter register(String name, String href) {
Link link = new Link(href).setName(name);
return register(link);
} | [
"public",
"HalCuriAugmenter",
"register",
"(",
"String",
"name",
",",
"String",
"href",
")",
"{",
"Link",
"link",
"=",
"new",
"Link",
"(",
"href",
")",
".",
"setName",
"(",
"name",
")",
";",
"return",
"register",
"(",
"link",
")",
";",
"}"
] | Registers a CURI link by the given name and HREF.
@param name CURI link name
@param href Link URI
@return This augmenter | [
"Registers",
"a",
"CURI",
"link",
"by",
"the",
"given",
"name",
"and",
"HREF",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/util/HalCuriAugmenter.java#L65-L68 |
145,153 | wcm-io-caravan/caravan-hal | resource/src/main/java/io/wcm/caravan/hal/resource/util/HalCuriAugmenter.java | HalCuriAugmenter.augment | public HalCuriAugmenter augment(HalResource hal) {
Set<String> existingCurieNames = getExistingCurieNames(hal);
Set<Link> curieLinks = getCuriLinks(hal, existingCurieNames);
hal.addLinks(LINK_RELATION_CURIES, curieLinks);
return this;
} | java | public HalCuriAugmenter augment(HalResource hal) {
Set<String> existingCurieNames = getExistingCurieNames(hal);
Set<Link> curieLinks = getCuriLinks(hal, existingCurieNames);
hal.addLinks(LINK_RELATION_CURIES, curieLinks);
return this;
} | [
"public",
"HalCuriAugmenter",
"augment",
"(",
"HalResource",
"hal",
")",
"{",
"Set",
"<",
"String",
">",
"existingCurieNames",
"=",
"getExistingCurieNames",
"(",
"hal",
")",
";",
"Set",
"<",
"Link",
">",
"curieLinks",
"=",
"getCuriLinks",
"(",
"hal",
",",
"e... | Augments a HAL resource by CURI links. Only adds CURIES being registered and referenced in the HAL resource. Will not override existing CURI links.
@param hal HAL resource to augment
@return This augmenter | [
"Augments",
"a",
"HAL",
"resource",
"by",
"CURI",
"links",
".",
"Only",
"adds",
"CURIES",
"being",
"registered",
"and",
"referenced",
"in",
"the",
"HAL",
"resource",
".",
"Will",
"not",
"override",
"existing",
"CURI",
"links",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/resource/src/main/java/io/wcm/caravan/hal/resource/util/HalCuriAugmenter.java#L112-L119 |
145,154 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java | LogWatchStorageManager.getAllMessages | protected synchronized List<Message> getAllMessages(final Follower follower) {
final int end = this.getEndingMessageId(follower);
/*
* If messages have been discarded, the original starting message ID
* will no longer be valid. Therefore, we check for the actual starting
* ID.... | java | protected synchronized List<Message> getAllMessages(final Follower follower) {
final int end = this.getEndingMessageId(follower);
/*
* If messages have been discarded, the original starting message ID
* will no longer be valid. Therefore, we check for the actual starting
* ID.... | [
"protected",
"synchronized",
"List",
"<",
"Message",
">",
"getAllMessages",
"(",
"final",
"Follower",
"follower",
")",
"{",
"final",
"int",
"end",
"=",
"this",
".",
"getEndingMessageId",
"(",
"follower",
")",
";",
"/*\n * If messages have been discarded, the o... | Return all messages that have been sent to the follower, from its start
until either its termination or to this moment, whichever is relevant.
This method is synchronized so that the modification of the underlying
message store in {@link #addLine(String)} and the reading of this store
is mutually excluded. Otherwise, ... | [
"Return",
"all",
"messages",
"that",
"have",
"been",
"sent",
"to",
"the",
"follower",
"from",
"its",
"start",
"until",
"either",
"its",
"termination",
"or",
"to",
"this",
"moment",
"whichever",
"is",
"relevant",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java#L89-L110 |
145,155 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java | LogWatchStorageManager.getEndingMessageId | private synchronized int getEndingMessageId(final Follower follower) {
if (this.isFollowerActive(follower)) {
return this.messages.getLatestPosition();
} else if (this.isFollowerTerminated(follower)) {
return this.terminatedFollowerRanges.get(follower)[1];
} else {
... | java | private synchronized int getEndingMessageId(final Follower follower) {
if (this.isFollowerActive(follower)) {
return this.messages.getLatestPosition();
} else if (this.isFollowerTerminated(follower)) {
return this.terminatedFollowerRanges.get(follower)[1];
} else {
... | [
"private",
"synchronized",
"int",
"getEndingMessageId",
"(",
"final",
"Follower",
"follower",
")",
"{",
"if",
"(",
"this",
".",
"isFollowerActive",
"(",
"follower",
")",
")",
"{",
"return",
"this",
".",
"messages",
".",
"getLatestPosition",
"(",
")",
";",
"}... | Get index of the last plus one message that the follower has access to.
@param follower
Follower in question.
@return Ending message ID after {@link #followerTerminated(Follower)}.
{@link MessageStore#getLatestPosition()} between
{@link #followerStarted(Follower)} and
{@link #followerTerminated(Follower)}. Will throw ... | [
"Get",
"index",
"of",
"the",
"last",
"plus",
"one",
"message",
"that",
"the",
"follower",
"has",
"access",
"to",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java#L123-L131 |
145,156 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java | LogWatchStorageManager.getFirstReachableMessageId | protected synchronized int getFirstReachableMessageId() {
final boolean followersRunning = !this.runningFollowerStartMarks.isEmpty();
if (!followersRunning && this.terminatedFollowerRanges.isEmpty()) {
// no followers present; no reachable messages
return -1;
}
fi... | java | protected synchronized int getFirstReachableMessageId() {
final boolean followersRunning = !this.runningFollowerStartMarks.isEmpty();
if (!followersRunning && this.terminatedFollowerRanges.isEmpty()) {
// no followers present; no reachable messages
return -1;
}
fi... | [
"protected",
"synchronized",
"int",
"getFirstReachableMessageId",
"(",
")",
"{",
"final",
"boolean",
"followersRunning",
"=",
"!",
"this",
".",
"runningFollowerStartMarks",
".",
"isEmpty",
"(",
")",
";",
"if",
"(",
"!",
"followersRunning",
"&&",
"this",
".",
"te... | Will crawl the weak hash maps and make sure we always have the latest
information on the availability of messages.
This method is only intended to be used from within
{@link LogWatchStorageSweeper}.
@return ID of the very first message that is reachable by any follower in
this logWatch. -1 when there are no reachable... | [
"Will",
"crawl",
"the",
"weak",
"hash",
"maps",
"and",
"make",
"sure",
"we",
"always",
"have",
"the",
"latest",
"information",
"on",
"the",
"availability",
"of",
"messages",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java#L143-L162 |
145,157 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java | LogWatchStorageManager.getStartingMessageId | private synchronized int getStartingMessageId(final Follower follower) {
if (this.isFollowerActive(follower)) {
return this.runningFollowerStartMarks.getInt(follower);
} else if (this.isFollowerTerminated(follower)) {
return this.terminatedFollowerRanges.get(follower)[0];
... | java | private synchronized int getStartingMessageId(final Follower follower) {
if (this.isFollowerActive(follower)) {
return this.runningFollowerStartMarks.getInt(follower);
} else if (this.isFollowerTerminated(follower)) {
return this.terminatedFollowerRanges.get(follower)[0];
... | [
"private",
"synchronized",
"int",
"getStartingMessageId",
"(",
"final",
"Follower",
"follower",
")",
"{",
"if",
"(",
"this",
".",
"isFollowerActive",
"(",
"follower",
")",
")",
"{",
"return",
"this",
".",
"runningFollowerStartMarks",
".",
"getInt",
"(",
"followe... | For a given follower, return the starting mark.
@param follower
Tailer in question.
@return Starting message ID, if after {@link #followerStarted(Follower)}.
Will throw an exception otherwise. | [
"For",
"a",
"given",
"follower",
"return",
"the",
"starting",
"mark",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java#L188-L196 |
145,158 | triceo/splitlog | splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java | LogWatchStorageManager.logWatchTerminated | public synchronized void logWatchTerminated() {
final Iterable<Follower> followersToTerminate = new ObjectLinkedOpenHashSet<>(this.runningFollowerStartMarks.keySet());
followersToTerminate.forEach(this::followerTerminated);
this.sweeping.stop();
} | java | public synchronized void logWatchTerminated() {
final Iterable<Follower> followersToTerminate = new ObjectLinkedOpenHashSet<>(this.runningFollowerStartMarks.keySet());
followersToTerminate.forEach(this::followerTerminated);
this.sweeping.stop();
} | [
"public",
"synchronized",
"void",
"logWatchTerminated",
"(",
")",
"{",
"final",
"Iterable",
"<",
"Follower",
">",
"followersToTerminate",
"=",
"new",
"ObjectLinkedOpenHashSet",
"<>",
"(",
"this",
".",
"runningFollowerStartMarks",
".",
"keySet",
"(",
")",
")",
";",... | Will mean the end of the storage, including the termination of sweeping. | [
"Will",
"mean",
"the",
"end",
"of",
"the",
"storage",
"including",
"the",
"termination",
"of",
"sweeping",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/com/github/triceo/splitlog/LogWatchStorageManager.java#L227-L231 |
145,159 | syphr42/prom | src/main/java/org/syphr/prom/PropertiesManagers.java | PropertiesManagers.getProperties | public static Properties getProperties(URL url) throws IOException
{
Properties properties = new Properties();
InputStream inputStream = url.openStream();
try
{
properties.load(inputStream);
}
finally
{
inputStream.close();
}
... | java | public static Properties getProperties(URL url) throws IOException
{
Properties properties = new Properties();
InputStream inputStream = url.openStream();
try
{
properties.load(inputStream);
}
finally
{
inputStream.close();
}
... | [
"public",
"static",
"Properties",
"getProperties",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"InputStream",
"inputStream",
"=",
"url",
".",
"openStream",
"(",
")",
";",
"try",
"... | Load values from a URL.
@param url
the URL containing default values
@return a new properties instance loaded with values from the given URL
@throws IOException
if there is an error while reading the given URL | [
"Load",
"values",
"from",
"a",
"URL",
"."
] | 074d67c4ebb3afb0b163fcb0bc4826ee577ac803 | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManagers.java#L374-L389 |
145,160 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java | Scenario3DPortrayal.drawLink | public void drawLink(Link link) {
List<Device> linkedDevices = link.getLinkedDevices();
for (int i = 0; i<linkedDevices.size(); i++) {
Device from = linkedDevices.get(i);
for (int j = i+1 ; j<linkedDevices.size(); j++) {
Device to = linkedDevices.get(j);
... | java | public void drawLink(Link link) {
List<Device> linkedDevices = link.getLinkedDevices();
for (int i = 0; i<linkedDevices.size(); i++) {
Device from = linkedDevices.get(i);
for (int j = i+1 ; j<linkedDevices.size(); j++) {
Device to = linkedDevices.get(j);
... | [
"public",
"void",
"drawLink",
"(",
"Link",
"link",
")",
"{",
"List",
"<",
"Device",
">",
"linkedDevices",
"=",
"link",
".",
"getLinkedDevices",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"linkedDevices",
".",
"size",
"(",
")",
... | To draw a link
@param link | [
"To",
"draw",
"a",
"link"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/Scenario3DPortrayal.java#L190-L200 |
145,161 | dbracewell/mango | src/main/java/com/davidbracewell/string/TableFormatter.java | TableFormatter.header | public <T> TableFormatter header(Collection<? extends T> collection) {
header.addAll(collection);
longestCell = (int) Math.max(longestCell, collection.stream()
.mapToDouble(o -> o.toString().length() + 2)
... | java | public <T> TableFormatter header(Collection<? extends T> collection) {
header.addAll(collection);
longestCell = (int) Math.max(longestCell, collection.stream()
.mapToDouble(o -> o.toString().length() + 2)
... | [
"public",
"<",
"T",
">",
"TableFormatter",
"header",
"(",
"Collection",
"<",
"?",
"extends",
"T",
">",
"collection",
")",
"{",
"header",
".",
"addAll",
"(",
"collection",
")",
";",
"longestCell",
"=",
"(",
"int",
")",
"Math",
".",
"max",
"(",
"longestC... | Header table formatter.
@param collection the collection
@return the table formatter | [
"Header",
"table",
"formatter",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/TableFormatter.java#L77-L84 |
145,162 | dbracewell/mango | src/main/java/com/davidbracewell/string/TableFormatter.java | TableFormatter.content | public TableFormatter content(Collection<?> collection) {
this.content.add(new ArrayList<>(collection));
longestCell = (int) Math.max(longestCell, collection.stream()
.mapToDouble(o -> {
... | java | public TableFormatter content(Collection<?> collection) {
this.content.add(new ArrayList<>(collection));
longestCell = (int) Math.max(longestCell, collection.stream()
.mapToDouble(o -> {
... | [
"public",
"TableFormatter",
"content",
"(",
"Collection",
"<",
"?",
">",
"collection",
")",
"{",
"this",
".",
"content",
".",
"add",
"(",
"new",
"ArrayList",
"<>",
"(",
"collection",
")",
")",
";",
"longestCell",
"=",
"(",
"int",
")",
"Math",
".",
"max... | Content table formatter.
@param collection the collection
@return the table formatter | [
"Content",
"table",
"formatter",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/string/TableFormatter.java#L101-L116 |
145,163 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java | SrcGen4J.execute | public final void execute() throws ParseException, GenerateException {
LOG.info("Executing full build");
enhanceClasspath();
cleanFolders();
// Parse models & generate
final Parsers parsers = config.getParsers();
if (parsers == null) {
LOG.warn(... | java | public final void execute() throws ParseException, GenerateException {
LOG.info("Executing full build");
enhanceClasspath();
cleanFolders();
// Parse models & generate
final Parsers parsers = config.getParsers();
if (parsers == null) {
LOG.warn(... | [
"public",
"final",
"void",
"execute",
"(",
")",
"throws",
"ParseException",
",",
"GenerateException",
"{",
"LOG",
".",
"info",
"(",
"\"Executing full build\"",
")",
";",
"enhanceClasspath",
"(",
")",
";",
"cleanFolders",
"(",
")",
";",
"// Parse models & generate\... | Parse and generate.
@throws ParseException
Error during parse process.
@throws GenerateException
Error during generation process. | [
"Parse",
"and",
"generate",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java#L181-L210 |
145,164 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java | SrcGen4J.getFileFilter | @NotNull
public FileFilter getFileFilter() {
if (fileFilter == null) {
final List<IOFileFilter> filters = new ArrayList<>();
final Parsers parsers = config.getParsers();
if (parsers != null) {
final List<ParserConfig> parserConfigs = parsers.getList(... | java | @NotNull
public FileFilter getFileFilter() {
if (fileFilter == null) {
final List<IOFileFilter> filters = new ArrayList<>();
final Parsers parsers = config.getParsers();
if (parsers != null) {
final List<ParserConfig> parserConfigs = parsers.getList(... | [
"@",
"NotNull",
"public",
"FileFilter",
"getFileFilter",
"(",
")",
"{",
"if",
"(",
"fileFilter",
"==",
"null",
")",
"{",
"final",
"List",
"<",
"IOFileFilter",
">",
"filters",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"final",
"Parsers",
"parsers",
"=... | Returns a file filter that combines all filters for all incremental parsers. It should be used for selecting the appropriate files.
@return File filter. | [
"Returns",
"a",
"file",
"filter",
"that",
"combines",
"all",
"filters",
"for",
"all",
"incremental",
"parsers",
".",
"It",
"should",
"be",
"used",
"for",
"selecting",
"the",
"appropriate",
"files",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java#L217-L237 |
145,165 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java | SrcGen4J.execute | public final void execute(@NotNull final Set<File> files) throws ParseException, GenerateException {
Contract.requireArgNotNull("files", files);
LOG.info("Executing incremental build ({} files)", files.size());
if (LOG.isDebugEnabled()) {
for (final File file : files) {
... | java | public final void execute(@NotNull final Set<File> files) throws ParseException, GenerateException {
Contract.requireArgNotNull("files", files);
LOG.info("Executing incremental build ({} files)", files.size());
if (LOG.isDebugEnabled()) {
for (final File file : files) {
... | [
"public",
"final",
"void",
"execute",
"(",
"@",
"NotNull",
"final",
"Set",
"<",
"File",
">",
"files",
")",
"throws",
"ParseException",
",",
"GenerateException",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"files\"",
",",
"files",
")",
";",
"LOG",
".",
... | Incremental parse and generate. The class loader of this class will be used.
@param files
Set of files to parse for the model.
@throws ParseException
Error during parse process.
@throws GenerateException
Error during generation process. | [
"Incremental",
"parse",
"and",
"generate",
".",
"The",
"class",
"loader",
"of",
"this",
"class",
"will",
"be",
"used",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/SrcGen4J.java#L250-L292 |
145,166 | EsfingeFramework/ClassMock | ClassMock/src/main/java/net/sf/esfinge/classmock/parse/ParseASM.java | ParseASM.parse | public byte[] parse() {
this.addEntity();
this.addClassDefaultConstructor();
this.addClassLevelAnnotations();
this.addFields();
this.addMethods();
this.cw.visitEnd();
return this.cw.toByteArray();
} | java | public byte[] parse() {
this.addEntity();
this.addClassDefaultConstructor();
this.addClassLevelAnnotations();
this.addFields();
this.addMethods();
this.cw.visitEnd();
return this.cw.toByteArray();
} | [
"public",
"byte",
"[",
"]",
"parse",
"(",
")",
"{",
"this",
".",
"addEntity",
"(",
")",
";",
"this",
".",
"addClassDefaultConstructor",
"(",
")",
";",
"this",
".",
"addClassLevelAnnotations",
"(",
")",
";",
"this",
".",
"addFields",
"(",
")",
";",
"thi... | Mount the class and generate it definition in byte array.
@return the data from the entity | [
"Mount",
"the",
"class",
"and",
"generate",
"it",
"definition",
"in",
"byte",
"array",
"."
] | a354c9dc68e8813fc4e995eef13e34796af58892 | https://github.com/EsfingeFramework/ClassMock/blob/a354c9dc68e8813fc4e995eef13e34796af58892/ClassMock/src/main/java/net/sf/esfinge/classmock/parse/ParseASM.java#L65-L76 |
145,167 | duraspace/fcrepo-cloudsync | fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/rest/URIMapper.java | URIMapper.getUri | public static URI getUri(UriInfo uriInfo,
HttpServletRequest req,
String path) {
String suffix = "";
if (req.getRequestURI().endsWith(".json")) {
suffix = ".json";
} else if (req.getRequestURI().endsWith(".xml")) {
... | java | public static URI getUri(UriInfo uriInfo,
HttpServletRequest req,
String path) {
String suffix = "";
if (req.getRequestURI().endsWith(".json")) {
suffix = ".json";
} else if (req.getRequestURI().endsWith(".xml")) {
... | [
"public",
"static",
"URI",
"getUri",
"(",
"UriInfo",
"uriInfo",
",",
"HttpServletRequest",
"req",
",",
"String",
"path",
")",
"{",
"String",
"suffix",
"=",
"\"\"",
";",
"if",
"(",
"req",
".",
"getRequestURI",
"(",
")",
".",
"endsWith",
"(",
"\".json\"",
... | Gets a full URI for the given path, based on the request URI. | [
"Gets",
"a",
"full",
"URI",
"for",
"the",
"given",
"path",
"based",
"on",
"the",
"request",
"URI",
"."
] | 2d90e2c9c84a827f2605607ff40e116c67eff9b9 | https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/rest/URIMapper.java#L15-L25 |
145,168 | duraspace/fcrepo-cloudsync | fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/rest/URIMapper.java | URIMapper.getId | public static String getId(URI uri) {
String s = uri.toString();
return s.substring(s.lastIndexOf("/") + 1);
} | java | public static String getId(URI uri) {
String s = uri.toString();
return s.substring(s.lastIndexOf("/") + 1);
} | [
"public",
"static",
"String",
"getId",
"(",
"URI",
"uri",
")",
"{",
"String",
"s",
"=",
"uri",
".",
"toString",
"(",
")",
";",
"return",
"s",
".",
"substring",
"(",
"s",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
"+",
"1",
")",
";",
"}"
] | Gets the id for the given task, set, store, user, or taskLog URI. | [
"Gets",
"the",
"id",
"for",
"the",
"given",
"task",
"set",
"store",
"user",
"or",
"taskLog",
"URI",
"."
] | 2d90e2c9c84a827f2605607ff40e116c67eff9b9 | https://github.com/duraspace/fcrepo-cloudsync/blob/2d90e2c9c84a827f2605607ff40e116c67eff9b9/fcrepo-cloudsync-service/src/main/java/org/duraspace/fcrepo/cloudsync/service/rest/URIMapper.java#L30-L33 |
145,169 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java | GeneratorConfig.addArtifact | public final void addArtifact(@NotNull final Artifact artifact) {
Contract.requireArgNotNull("artifact", artifact);
if (artifacts == null) {
artifacts = new ArrayList<>();
}
artifacts.add(artifact);
} | java | public final void addArtifact(@NotNull final Artifact artifact) {
Contract.requireArgNotNull("artifact", artifact);
if (artifacts == null) {
artifacts = new ArrayList<>();
}
artifacts.add(artifact);
} | [
"public",
"final",
"void",
"addArtifact",
"(",
"@",
"NotNull",
"final",
"Artifact",
"artifact",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"artifact\"",
",",
"artifact",
")",
";",
"if",
"(",
"artifacts",
"==",
"null",
")",
"{",
"artifacts",
"=",
... | Adds a artifact to the list. If the list does not exist it's created.
@param artifact
Artifact to add. | [
"Adds",
"a",
"artifact",
"to",
"the",
"list",
".",
"If",
"the",
"list",
"does",
"not",
"exist",
"it",
"s",
"created",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java#L169-L175 |
145,170 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java | GeneratorConfig.getDefProject | @Nullable
public final String getDefProject() {
if (getProject() == null) {
if (parent == null) {
return null;
}
return parent.getProject();
}
return getProject();
} | java | @Nullable
public final String getDefProject() {
if (getProject() == null) {
if (parent == null) {
return null;
}
return parent.getProject();
}
return getProject();
} | [
"@",
"Nullable",
"public",
"final",
"String",
"getDefProject",
"(",
")",
"{",
"if",
"(",
"getProject",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"parent",
".",
"getProject",
"... | Returns the defined project from this object or any of it's parents.
@return Project. | [
"Returns",
"the",
"defined",
"project",
"from",
"this",
"object",
"or",
"any",
"of",
"it",
"s",
"parents",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java#L222-L231 |
145,171 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java | GeneratorConfig.getDefFolder | @Nullable
public final String getDefFolder() {
if (getFolder() == null) {
if (parent == null) {
return null;
}
return parent.getFolder();
}
return getFolder();
} | java | @Nullable
public final String getDefFolder() {
if (getFolder() == null) {
if (parent == null) {
return null;
}
return parent.getFolder();
}
return getFolder();
} | [
"@",
"Nullable",
"public",
"final",
"String",
"getDefFolder",
"(",
")",
"{",
"if",
"(",
"getFolder",
"(",
")",
"==",
"null",
")",
"{",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"parent",
".",
"getFolder",
"(",... | Returns the defined folder from this object or any of it's parents.
@return Folder. | [
"Returns",
"the",
"defined",
"folder",
"from",
"this",
"object",
"or",
"any",
"of",
"it",
"s",
"parents",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java#L238-L247 |
145,172 | fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java | GeneratorConfig.getGenerator | @SuppressWarnings("unchecked")
public final Generator<Object> getGenerator() {
if (generator != null) {
return generator;
}
LOG.info("Creating generator: {}", className);
if (className == null) {
throw new IllegalStateException("Class name was not set: ... | java | @SuppressWarnings("unchecked")
public final Generator<Object> getGenerator() {
if (generator != null) {
return generator;
}
LOG.info("Creating generator: {}", className);
if (className == null) {
throw new IllegalStateException("Class name was not set: ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"final",
"Generator",
"<",
"Object",
">",
"getGenerator",
"(",
")",
"{",
"if",
"(",
"generator",
"!=",
"null",
")",
"{",
"return",
"generator",
";",
"}",
"LOG",
".",
"info",
"(",
"\"Creating gen... | Returns an existing generator instance or creates a new one if it's the first call to this method.
@return Generator of type {@link #className}. | [
"Returns",
"an",
"existing",
"generator",
"instance",
"or",
"creates",
"a",
"new",
"one",
"if",
"it",
"s",
"the",
"first",
"call",
"to",
"this",
"method",
"."
] | bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/GeneratorConfig.java#L273-L292 |
145,173 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.parse | protected static Module parse(final File moduleXml) throws Exception {
InputStream is = new FileInputStream(moduleXml);
try {
Document document = parseXml(is);
Element root = document.getDocumentElement();
ModuleIdentifier main = getModuleIdentifier(root);
... | java | protected static Module parse(final File moduleXml) throws Exception {
InputStream is = new FileInputStream(moduleXml);
try {
Document document = parseXml(is);
Element root = document.getDocumentElement();
ModuleIdentifier main = getModuleIdentifier(root);
... | [
"protected",
"static",
"Module",
"parse",
"(",
"final",
"File",
"moduleXml",
")",
"throws",
"Exception",
"{",
"InputStream",
"is",
"=",
"new",
"FileInputStream",
"(",
"moduleXml",
")",
";",
"try",
"{",
"Document",
"document",
"=",
"parseXml",
"(",
"is",
")",... | Parse the module.xml file.
@param moduleXml The file to parse
@return Module representation
@throws Exception In case of parsing error | [
"Parse",
"the",
"module",
".",
"xml",
"file",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L38-L55 |
145,174 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.getModuleIdentifier | protected static ModuleIdentifier getModuleIdentifier(final Element root) {
return new ModuleIdentifier(root.getAttribute("name"), root.getAttribute("slot"),
Boolean.parseBoolean(root.getAttribute("optional")), Boolean.parseBoolean(root.getAttribute("export")));
} | java | protected static ModuleIdentifier getModuleIdentifier(final Element root) {
return new ModuleIdentifier(root.getAttribute("name"), root.getAttribute("slot"),
Boolean.parseBoolean(root.getAttribute("optional")), Boolean.parseBoolean(root.getAttribute("export")));
} | [
"protected",
"static",
"ModuleIdentifier",
"getModuleIdentifier",
"(",
"final",
"Element",
"root",
")",
"{",
"return",
"new",
"ModuleIdentifier",
"(",
"root",
".",
"getAttribute",
"(",
"\"name\"",
")",
",",
"root",
".",
"getAttribute",
"(",
"\"slot\"",
")",
",",... | ModuleIdentifier from XML element.
@param root The root element
@return ModuleIdentifier The name/version of the module | [
"ModuleIdentifier",
"from",
"XML",
"element",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L62-L65 |
145,175 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.parseXml | protected static Document parseXml(final InputStream inputStream)
throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuil... | java | protected static Document parseXml(final InputStream inputStream)
throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuil... | [
"protected",
"static",
"Document",
"parseXml",
"(",
"final",
"InputStream",
"inputStream",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
",",
"IOException",
"{",
"DocumentBuilderFactory",
"dbFactory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
... | Parse module.xml from an input stream.
@param inputStream The InputStream to parse
@return Document the parsed DOM
@throws ParserConfigurationException In case of parser mis-configuration
@throws SAXException In case of SAX exception
@throws IOException In case of IO error | [
"Parse",
"module",
".",
"xml",
"from",
"an",
"input",
"stream",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L75-L82 |
145,176 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.getElements | protected static List<Element> getElements(final Element parent, final String tagName) {
List<Element> elements = new ArrayList<Element>();
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node node = nodes.item(i);
... | java | protected static List<Element> getElements(final Element parent, final String tagName) {
List<Element> elements = new ArrayList<Element>();
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node node = nodes.item(i);
... | [
"protected",
"static",
"List",
"<",
"Element",
">",
"getElements",
"(",
"final",
"Element",
"parent",
",",
"final",
"String",
"tagName",
")",
"{",
"List",
"<",
"Element",
">",
"elements",
"=",
"new",
"ArrayList",
"<",
"Element",
">",
"(",
")",
";",
"Node... | Finds child elements in DOM.
@param parent The Element to find in
@param tagName The element to find
@return List of elements | [
"Finds",
"child",
"elements",
"in",
"DOM",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L90-L100 |
145,177 | akberc/ceylon-maven-plugin | src/main/java/com/dgwave/car/common/ModuleXmlReader.java | ModuleXmlReader.getChildElement | protected static Element getChildElement(final Element parent, final String tagName) {
List<Element> elements = getElements(parent, tagName);
if (elements.size() > 0) {
return elements.get(0);
} else {
return null;
}
} | java | protected static Element getChildElement(final Element parent, final String tagName) {
List<Element> elements = getElements(parent, tagName);
if (elements.size() > 0) {
return elements.get(0);
} else {
return null;
}
} | [
"protected",
"static",
"Element",
"getChildElement",
"(",
"final",
"Element",
"parent",
",",
"final",
"String",
"tagName",
")",
"{",
"List",
"<",
"Element",
">",
"elements",
"=",
"getElements",
"(",
"parent",
",",
"tagName",
")",
";",
"if",
"(",
"elements",
... | Get a single child element.
@param parent The parent element
@param tagName The child element name
@return Element The first child element by that name | [
"Get",
"a",
"single",
"child",
"element",
"."
] | b7f6c4a2b24f2fa237350c9e715f4193e83415ef | https://github.com/akberc/ceylon-maven-plugin/blob/b7f6c4a2b24f2fa237350c9e715f4193e83415ef/src/main/java/com/dgwave/car/common/ModuleXmlReader.java#L108-L115 |
145,178 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java | ShanksSimulation2DGUI.addTimeChart | public void addTimeChart(String chartID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addTimeChart(chartID, xAxisLabel, yAxisLabel);... | java | public void addTimeChart(String chartID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addTimeChart(chartID, xAxisLabel, yAxisLabel);... | [
"public",
"void",
"addTimeChart",
"(",
"String",
"chartID",
",",
"String",
"xAxisLabel",
",",
"String",
"yAxisLabel",
")",
"throws",
"ShanksException",
"{",
"Scenario2DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario2DPortrayal",
")",
"this",
".",
"getSimulation",... | Add a time chart to the simulation
@param chartID
@param xAxisLabel
@param yAxisLabel
@throws ShanksException | [
"Add",
"a",
"time",
"chart",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java#L356-L361 |
145,179 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java | ShanksSimulation2DGUI.removeTimeChart | public void removeTimeChart(String chartID) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.removeTimeChart(chartID);
} | java | public void removeTimeChart(String chartID) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.removeTimeChart(chartID);
} | [
"public",
"void",
"removeTimeChart",
"(",
"String",
"chartID",
")",
"throws",
"ShanksException",
"{",
"Scenario2DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario2DPortrayal",
")",
"this",
".",
"getSimulation",
"(",
")",
".",
"getScenarioPortrayal",
"(",
")",
";"... | Remove a time chart to the simulation
@param chartID
@throws ScenarioNotFoundException
@throws DuplicatedPortrayalIDException | [
"Remove",
"a",
"time",
"chart",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java#L370-L374 |
145,180 | gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java | ShanksSimulation2DGUI.addHistogram | public void addHistogram(String histogramID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addHistogram(histogramID, xAxisLabel, yAxi... | java | public void addHistogram(String histogramID, String xAxisLabel,
String yAxisLabel) throws ShanksException {
Scenario2DPortrayal scenarioPortrayal = (Scenario2DPortrayal) this
.getSimulation().getScenarioPortrayal();
scenarioPortrayal.addHistogram(histogramID, xAxisLabel, yAxi... | [
"public",
"void",
"addHistogram",
"(",
"String",
"histogramID",
",",
"String",
"xAxisLabel",
",",
"String",
"yAxisLabel",
")",
"throws",
"ShanksException",
"{",
"Scenario2DPortrayal",
"scenarioPortrayal",
"=",
"(",
"Scenario2DPortrayal",
")",
"this",
".",
"getSimulati... | Add a Histogram to the simulation
@param histogramID
- The name of the Histogram
@param xAxisLabel
- The label for the x axis
@param yAxisLabel
- The label fot the y axis
@throws DuplicatedChartIDException
@throws DuplicatedPortrayalIDException
@throws ScenarioNotFoundException | [
"Add",
"a",
"Histogram",
"to",
"the",
"simulation"
] | 35d87a81c22731f4f83bbd0571c9c6d466bd16be | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/ShanksSimulation2DGUI.java#L423-L428 |
145,181 | LevelFourAB/commons | commons-serialization/src/main/java/se/l4/commons/serialization/AbstractSerializerCollection.java | AbstractSerializerCollection.registerIfNamed | protected void registerIfNamed(Class<?> from, Serializer<?> serializer)
{
if(from.isAnnotationPresent(Named.class))
{
Named named = from.getAnnotation(Named.class);
QualifiedName key = new QualifiedName(named.namespace(), named.name());
nameToSerializer.put(key, serializer);
serializerToName.put(serial... | java | protected void registerIfNamed(Class<?> from, Serializer<?> serializer)
{
if(from.isAnnotationPresent(Named.class))
{
Named named = from.getAnnotation(Named.class);
QualifiedName key = new QualifiedName(named.namespace(), named.name());
nameToSerializer.put(key, serializer);
serializerToName.put(serial... | [
"protected",
"void",
"registerIfNamed",
"(",
"Class",
"<",
"?",
">",
"from",
",",
"Serializer",
"<",
"?",
">",
"serializer",
")",
"{",
"if",
"(",
"from",
".",
"isAnnotationPresent",
"(",
"Named",
".",
"class",
")",
")",
"{",
"Named",
"named",
"=",
"fro... | Register the given serializer if it has a name.
@param from
@param serializer | [
"Register",
"the",
"given",
"serializer",
"if",
"it",
"has",
"a",
"name",
"."
] | aa121b3a5504b43d0c10450a1b984694fcd2b8ee | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-serialization/src/main/java/se/l4/commons/serialization/AbstractSerializerCollection.java#L248-L257 |
145,182 | dbracewell/mango | src/main/java/com/davidbracewell/parsing/ExpressionIterator.java | ExpressionIterator.next | public Expression next(int precedence) throws ParseException {
ParserToken token;
Expression result;
do {
token = tokenStream.consume();
if (token == null) {
return null;
}
result = grammar.parse(this, token);
} while (result == null);
//C... | java | public Expression next(int precedence) throws ParseException {
ParserToken token;
Expression result;
do {
token = tokenStream.consume();
if (token == null) {
return null;
}
result = grammar.parse(this, token);
} while (result == null);
//C... | [
"public",
"Expression",
"next",
"(",
"int",
"precedence",
")",
"throws",
"ParseException",
"{",
"ParserToken",
"token",
";",
"Expression",
"result",
";",
"do",
"{",
"token",
"=",
"tokenStream",
".",
"consume",
"(",
")",
";",
"if",
"(",
"token",
"==",
"null... | Parses the token stream to get the next expression
@param precedence The precedence of the next prefix expression
@return the next expression in the parse
@throws ParseException Something went wrong parsing | [
"Parses",
"the",
"token",
"stream",
"to",
"get",
"the",
"next",
"expression"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/parsing/ExpressionIterator.java#L64-L87 |
145,183 | triceo/splitlog | splitlog-core/src/main/java/org/apache/commons/io/input/fork/TailerRun.java | TailerRun.readLines | private long readLines(final RandomAccessFile reader) throws IOException {
final ByteArrayOutputStream lineBuf = new ByteArrayOutputStream(64);
long pos = reader.getFilePointer();
long rePos = pos; // position to re-read
int num;
boolean seenCR = false;
// FIXME replace -... | java | private long readLines(final RandomAccessFile reader) throws IOException {
final ByteArrayOutputStream lineBuf = new ByteArrayOutputStream(64);
long pos = reader.getFilePointer();
long rePos = pos; // position to re-read
int num;
boolean seenCR = false;
// FIXME replace -... | [
"private",
"long",
"readLines",
"(",
"final",
"RandomAccessFile",
"reader",
")",
"throws",
"IOException",
"{",
"final",
"ByteArrayOutputStream",
"lineBuf",
"=",
"new",
"ByteArrayOutputStream",
"(",
"64",
")",
";",
"long",
"pos",
"=",
"reader",
".",
"getFilePointer... | Read new lines.
@param reader
The file to read
@return The new position after the lines have been read
@throws java.io.IOException
if an I/O error occurs. | [
"Read",
"new",
"lines",
"."
] | 4e1b188e8c814119f5cf7343bbc53917843d68a2 | https://github.com/triceo/splitlog/blob/4e1b188e8c814119f5cf7343bbc53917843d68a2/splitlog-core/src/main/java/org/apache/commons/io/input/fork/TailerRun.java#L97-L135 |
145,184 | fnklabs/draenei | src/main/java/com/fnklabs/draenei/orm/EntityMetadata.java | EntityMetadata.getFieldMetaData | List<ColumnMetadata> getFieldMetaData() {
return columnsMetadata.entrySet()
.stream()
.map(entry -> entry.getValue())
.collect(Collectors.toList());
} | java | List<ColumnMetadata> getFieldMetaData() {
return columnsMetadata.entrySet()
.stream()
.map(entry -> entry.getValue())
.collect(Collectors.toList());
} | [
"List",
"<",
"ColumnMetadata",
">",
"getFieldMetaData",
"(",
")",
"{",
"return",
"columnsMetadata",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",
"map",
"(",
"entry",
"->",
"entry",
".",
"getValue",
"(",
")",
")",
".",
"collect",
"(",
"Colle... | Get field metadata
@return | [
"Get",
"field",
"metadata"
] | 0a8cac54f1f635be3e2950375a23291d38453ae8 | https://github.com/fnklabs/draenei/blob/0a8cac54f1f635be3e2950375a23291d38453ae8/src/main/java/com/fnklabs/draenei/orm/EntityMetadata.java#L140-L145 |
145,185 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.getServiceIdFromMavenBundlePlugin | private String getServiceIdFromMavenBundlePlugin() {
Plugin bundlePlugin = project.getBuildPlugins().stream()
.filter(plugin -> StringUtils.equals(plugin.getKey(), MAVEN_BUNDLE_PLUGIN_ID))
.findFirst().orElse(null);
if (bundlePlugin != null) {
Xpp3Dom configuration = (Xpp3Dom)bundlePlugin.... | java | private String getServiceIdFromMavenBundlePlugin() {
Plugin bundlePlugin = project.getBuildPlugins().stream()
.filter(plugin -> StringUtils.equals(plugin.getKey(), MAVEN_BUNDLE_PLUGIN_ID))
.findFirst().orElse(null);
if (bundlePlugin != null) {
Xpp3Dom configuration = (Xpp3Dom)bundlePlugin.... | [
"private",
"String",
"getServiceIdFromMavenBundlePlugin",
"(",
")",
"{",
"Plugin",
"bundlePlugin",
"=",
"project",
".",
"getBuildPlugins",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"plugin",
"->",
"StringUtils",
".",
"equals",
"(",
"plugin",
".",
... | Tries to detect the service id automatically from maven bundle plugin definition in same POM.
@return Service id or null | [
"Tries",
"to",
"detect",
"the",
"service",
"id",
"automatically",
"from",
"maven",
"bundle",
"plugin",
"definition",
"in",
"same",
"POM",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L135-L152 |
145,186 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.getServiceInfos | private Service getServiceInfos(ClassLoader compileClassLoader) {
Service service = new Service();
// get some service properties from pom
service.setServiceId(serviceId);
service.setName(project.getName());
// find @ServiceDoc annotated class in source folder
JavaProjectBuilder builder = new ... | java | private Service getServiceInfos(ClassLoader compileClassLoader) {
Service service = new Service();
// get some service properties from pom
service.setServiceId(serviceId);
service.setName(project.getName());
// find @ServiceDoc annotated class in source folder
JavaProjectBuilder builder = new ... | [
"private",
"Service",
"getServiceInfos",
"(",
"ClassLoader",
"compileClassLoader",
")",
"{",
"Service",
"service",
"=",
"new",
"Service",
"(",
")",
";",
"// get some service properties from pom",
"service",
".",
"setServiceId",
"(",
"serviceId",
")",
";",
"service",
... | Get service infos from current maven project.
@return Service | [
"Get",
"service",
"infos",
"from",
"current",
"maven",
"project",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L158-L187 |
145,187 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.buildJsonSchemaRefForModel | private String buildJsonSchemaRefForModel(Class<?> modelClass, File artifactFile) {
try {
ZipFile zipFile = new ZipFile(artifactFile);
String halDocsDomainPath = getHalDocsDomainPath(zipFile);
if (halDocsDomainPath != null && hasJsonSchemaFile(zipFile, modelClass)) {
return JsonSchemaBundl... | java | private String buildJsonSchemaRefForModel(Class<?> modelClass, File artifactFile) {
try {
ZipFile zipFile = new ZipFile(artifactFile);
String halDocsDomainPath = getHalDocsDomainPath(zipFile);
if (halDocsDomainPath != null && hasJsonSchemaFile(zipFile, modelClass)) {
return JsonSchemaBundl... | [
"private",
"String",
"buildJsonSchemaRefForModel",
"(",
"Class",
"<",
"?",
">",
"modelClass",
",",
"File",
"artifactFile",
")",
"{",
"try",
"{",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"(",
"artifactFile",
")",
";",
"String",
"halDocsDomainPath",
"=",
"ge... | Check if JAR file has a doc domain path and corresponding schema file and then builds a documenation path for it.
@param modelClass Model calss
@param artifactFile JAR artifact's file
@return JSON schema path or null | [
"Check",
"if",
"JAR",
"file",
"has",
"a",
"doc",
"domain",
"path",
"and",
"corresponding",
"schema",
"file",
"and",
"then",
"builds",
"a",
"documenation",
"path",
"for",
"it",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L266-L279 |
145,188 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.hasAnnotation | private boolean hasAnnotation(JavaAnnotatedElement clazz, Class<? extends Annotation> annotationClazz) {
return clazz.getAnnotations().stream()
.filter(item -> item.getType().isA(annotationClazz.getName()))
.count() > 0;
} | java | private boolean hasAnnotation(JavaAnnotatedElement clazz, Class<? extends Annotation> annotationClazz) {
return clazz.getAnnotations().stream()
.filter(item -> item.getType().isA(annotationClazz.getName()))
.count() > 0;
} | [
"private",
"boolean",
"hasAnnotation",
"(",
"JavaAnnotatedElement",
"clazz",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClazz",
")",
"{",
"return",
"clazz",
".",
"getAnnotations",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"... | Checks if the given element has an annotation set.
@param clazz QDox class
@param annotationClazz Annotation class
@return true if annotation is present | [
"Checks",
"if",
"the",
"given",
"element",
"has",
"an",
"annotation",
"set",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L315-L319 |
145,189 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.getStaticFieldValue | @SuppressWarnings("unchecked")
private <T> T getStaticFieldValue(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> fieldType) {
try {
Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName());
Field field = clazz.getField(javaField.getName());
... | java | @SuppressWarnings("unchecked")
private <T> T getStaticFieldValue(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> fieldType) {
try {
Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName());
Field field = clazz.getField(javaField.getName());
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"T",
"getStaticFieldValue",
"(",
"JavaClass",
"javaClazz",
",",
"JavaField",
"javaField",
",",
"ClassLoader",
"compileClassLoader",
",",
"Class",
"<",
"T",
">",
"fieldType",
")",
"{",
... | Get constant field value.
@param javaClazz QDox class
@param javaField QDox field
@param compileClassLoader Classloader for compile dependencies
@param fieldType Field type
@return Value | [
"Get",
"constant",
"field",
"value",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L329-L339 |
145,190 | wcm-io-caravan/caravan-hal | docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java | GenerateHalDocsJsonMojo.getAnnotation | private <T extends Annotation> T getAnnotation(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> annotationType) {
try {
Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName());
Field field = clazz.getField(javaField.getName());
return fiel... | java | private <T extends Annotation> T getAnnotation(JavaClass javaClazz, JavaField javaField, ClassLoader compileClassLoader, Class<T> annotationType) {
try {
Class<?> clazz = compileClassLoader.loadClass(javaClazz.getFullyQualifiedName());
Field field = clazz.getField(javaField.getName());
return fiel... | [
"private",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"JavaClass",
"javaClazz",
",",
"JavaField",
"javaField",
",",
"ClassLoader",
"compileClassLoader",
",",
"Class",
"<",
"T",
">",
"annotationType",
")",
"{",
"try",
"{",
"Class",
"<",
... | Get annotation for field.
@param javaClazz QDox class
@param javaField QDox field
@param compileClassLoader Classloader for compile dependencies
@param annotationType Annotation type
@return Annotation of null if not present | [
"Get",
"annotation",
"for",
"field",
"."
] | 25d58756b58c70c8c48a17fe781e673dd93d5085 | https://github.com/wcm-io-caravan/caravan-hal/blob/25d58756b58c70c8c48a17fe781e673dd93d5085/docs-maven-plugin/src/main/java/io/wcm/caravan/maven/plugins/haldocs/GenerateHalDocsJsonMojo.java#L349-L358 |
145,191 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheManager.java | CacheManager.getGlobalCache | @SuppressWarnings("unchecked")
public static <K, V> Cache<K, V> getGlobalCache() {
if (caches.containsKey(GLOBAL_CACHE)) {
return Cast.as(caches.get(GLOBAL_CACHE));
}
return register(getCacheSpec(GLOBAL_CACHE));
} | java | @SuppressWarnings("unchecked")
public static <K, V> Cache<K, V> getGlobalCache() {
if (caches.containsKey(GLOBAL_CACHE)) {
return Cast.as(caches.get(GLOBAL_CACHE));
}
return register(getCacheSpec(GLOBAL_CACHE));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"K",
",",
"V",
">",
"Cache",
"<",
"K",
",",
"V",
">",
"getGlobalCache",
"(",
")",
"{",
"if",
"(",
"caches",
".",
"containsKey",
"(",
"GLOBAL_CACHE",
")",
")",
"{",
"return",
... | Gets global cache.
@return The global cache | [
"Gets",
"global",
"cache",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheManager.java#L151-L157 |
145,192 | CubeEngine/LogScribe | core/src/main/java/org/cubeengine/logscribe/Filterable.java | Filterable.log | public void log(final LogEntry entry)
{
if (entry.getLevel().compareTo(this.level) < 0)
{
return;
}
if (!this.filters.isEmpty())
{
for (LogFilter filter : this.filters)
{
if (!filter.accept(entry))
{
... | java | public void log(final LogEntry entry)
{
if (entry.getLevel().compareTo(this.level) < 0)
{
return;
}
if (!this.filters.isEmpty())
{
for (LogFilter filter : this.filters)
{
if (!filter.accept(entry))
{
... | [
"public",
"void",
"log",
"(",
"final",
"LogEntry",
"entry",
")",
"{",
"if",
"(",
"entry",
".",
"getLevel",
"(",
")",
".",
"compareTo",
"(",
"this",
".",
"level",
")",
"<",
"0",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"this",
".",
"filters",... | Checks if the LogLevel is higher than the set LogLevel and all registered Filters pass and then publishes the LogEntry
@param entry the logEntry to log | [
"Checks",
"if",
"the",
"LogLevel",
"is",
"higher",
"than",
"the",
"set",
"LogLevel",
"and",
"all",
"registered",
"Filters",
"pass",
"and",
"then",
"publishes",
"the",
"LogEntry"
] | c3a449b82677d1d70c3efe77b68fdaaaf7525295 | https://github.com/CubeEngine/LogScribe/blob/c3a449b82677d1d70c3efe77b68fdaaaf7525295/core/src/main/java/org/cubeengine/logscribe/Filterable.java#L110-L127 |
145,193 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.from | public static <K, V> CacheSpec<K, V> from(String specification) {
return CacheSpec.<K, V>create().fromString(specification);
} | java | public static <K, V> CacheSpec<K, V> from(String specification) {
return CacheSpec.<K, V>create().fromString(specification);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"CacheSpec",
"<",
"K",
",",
"V",
">",
"from",
"(",
"String",
"specification",
")",
"{",
"return",
"CacheSpec",
".",
"<",
"K",
",",
"V",
">",
"create",
"(",
")",
".",
"fromString",
"(",
"specification",
"... | From cache spec.
@param <K> the type parameter
@param <V> the type parameter
@param specification the specification
@return the cache spec | [
"From",
"cache",
"spec",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L83-L85 |
145,194 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.loadingFunction | public CacheSpec<K, V> loadingFunction(Function<K, V> loadingFunction) {
this.cacheFunction = loadingFunction;
return this;
} | java | public CacheSpec<K, V> loadingFunction(Function<K, V> loadingFunction) {
this.cacheFunction = loadingFunction;
return this;
} | [
"public",
"CacheSpec",
"<",
"K",
",",
"V",
">",
"loadingFunction",
"(",
"Function",
"<",
"K",
",",
"V",
">",
"loadingFunction",
")",
"{",
"this",
".",
"cacheFunction",
"=",
"loadingFunction",
";",
"return",
"this",
";",
"}"
] | Loading function cache spec.
@param loadingFunction the loading function
@return the cache spec | [
"Loading",
"function",
"cache",
"spec",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L118-L121 |
145,195 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.getEngine | public CacheEngine getEngine() {
if (StringUtils.isNullOrBlank(cacheEngine)) {
return CacheEngines.get("Guava");
}
return CacheEngines.get(cacheEngine);
} | java | public CacheEngine getEngine() {
if (StringUtils.isNullOrBlank(cacheEngine)) {
return CacheEngines.get("Guava");
}
return CacheEngines.get(cacheEngine);
} | [
"public",
"CacheEngine",
"getEngine",
"(",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNullOrBlank",
"(",
"cacheEngine",
")",
")",
"{",
"return",
"CacheEngines",
".",
"get",
"(",
"\"Guava\"",
")",
";",
"}",
"return",
"CacheEngines",
".",
"get",
"(",
"cache... | Gets cache type.
@return the cache type | [
"Gets",
"cache",
"type",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L128-L133 |
145,196 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.concurrencyLevel | public <T extends CacheSpec<K, V>> T concurrencyLevel(int concurrencyLevel) {
checkArgument(concurrencyLevel > 0, "Concurrency Level must be > 0");
this.concurrencyLevel = concurrencyLevel;
return Cast.as(this);
} | java | public <T extends CacheSpec<K, V>> T concurrencyLevel(int concurrencyLevel) {
checkArgument(concurrencyLevel > 0, "Concurrency Level must be > 0");
this.concurrencyLevel = concurrencyLevel;
return Cast.as(this);
} | [
"public",
"<",
"T",
"extends",
"CacheSpec",
"<",
"K",
",",
"V",
">",
">",
"T",
"concurrencyLevel",
"(",
"int",
"concurrencyLevel",
")",
"{",
"checkArgument",
"(",
"concurrencyLevel",
">",
"0",
",",
"\"Concurrency Level must be > 0\"",
")",
";",
"this",
".",
... | Concurrency level t.
@param <T> the type parameter
@param concurrencyLevel the concurrency level
@return the t | [
"Concurrency",
"level",
"t",
"."
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L235-L239 |
145,197 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.initialCapacity | public <T extends CacheSpec<K, V>> T initialCapacity(int initialCapacity) {
checkArgument(initialCapacity > 0, "Capacity must be > 0");
this.initialCapacity = initialCapacity;
return Cast.as(this);
} | java | public <T extends CacheSpec<K, V>> T initialCapacity(int initialCapacity) {
checkArgument(initialCapacity > 0, "Capacity must be > 0");
this.initialCapacity = initialCapacity;
return Cast.as(this);
} | [
"public",
"<",
"T",
"extends",
"CacheSpec",
"<",
"K",
",",
"V",
">",
">",
"T",
"initialCapacity",
"(",
"int",
"initialCapacity",
")",
"{",
"checkArgument",
"(",
"initialCapacity",
">",
"0",
",",
"\"Capacity must be > 0\"",
")",
";",
"this",
".",
"initialCapa... | Sets the initial capacity
@param <T> the type parameter
@param initialCapacity The initial capacity
@return This Cache spec | [
"Sets",
"the",
"initial",
"capacity"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L248-L252 |
145,198 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.weakValues | public <T extends CacheSpec<K, V>> T weakValues() {
this.weakValues = true;
return Cast.as(this);
} | java | public <T extends CacheSpec<K, V>> T weakValues() {
this.weakValues = true;
return Cast.as(this);
} | [
"public",
"<",
"T",
"extends",
"CacheSpec",
"<",
"K",
",",
"V",
">",
">",
"T",
"weakValues",
"(",
")",
"{",
"this",
".",
"weakValues",
"=",
"true",
";",
"return",
"Cast",
".",
"as",
"(",
"this",
")",
";",
"}"
] | Sets to use weak values
@param <T> the type parameter
@return This cache spec | [
"Sets",
"to",
"use",
"weak",
"values"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L260-L263 |
145,199 | dbracewell/mango | src/main/java/com/davidbracewell/cache/CacheSpec.java | CacheSpec.weakKeys | public <T extends CacheSpec<K, V>> T weakKeys() {
this.weakKeys = true;
return Cast.as(this);
} | java | public <T extends CacheSpec<K, V>> T weakKeys() {
this.weakKeys = true;
return Cast.as(this);
} | [
"public",
"<",
"T",
"extends",
"CacheSpec",
"<",
"K",
",",
"V",
">",
">",
"T",
"weakKeys",
"(",
")",
"{",
"this",
".",
"weakKeys",
"=",
"true",
";",
"return",
"Cast",
".",
"as",
"(",
"this",
")",
";",
"}"
] | Sets to use weak keys
@param <T> the type parameter
@return This cache spec | [
"Sets",
"to",
"use",
"weak",
"keys"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/cache/CacheSpec.java#L271-L274 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.