repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java | CoverageDataPng.setPixelValue | public void setPixelValue(ImageLineInt row, int x,
int unsignedPixelValue) {
short pixelValue = getPixelValue(unsignedPixelValue);
setPixelValue(row, x, pixelValue);
} | java | public void setPixelValue(ImageLineInt row, int x,
int unsignedPixelValue) {
short pixelValue = getPixelValue(unsignedPixelValue);
setPixelValue(row, x, pixelValue);
} | [
"public",
"void",
"setPixelValue",
"(",
"ImageLineInt",
"row",
",",
"int",
"x",
",",
"int",
"unsignedPixelValue",
")",
"{",
"short",
"pixelValue",
"=",
"getPixelValue",
"(",
"unsignedPixelValue",
")",
";",
"setPixelValue",
"(",
"row",
",",
"x",
",",
"pixelValu... | Set the pixel value
@param row image line row
@param x x coordinate
@param unsignedPixelValue unsigned pixel value | [
"Set",
"the",
"pixel",
"value"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L490-L494 | test | Sets the pixel value of the image line. | Of course, here is the Java code you requested:
```java
public void setPixelValue(ImageLineInt row, int x,
int unsignedPixelValue) {
short pixelValue = getPixelValue(unsignedPixelValue);
setPixelValue(row, x, pixelValue);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/FluidLicenseClient.java | FluidLicenseClient.applyLicense | public LicenseRequest applyLicense(String licenseToApplyParam)
{
LicenseRequest liceReq = new LicenseRequest();
liceReq.setLicenseCipherText(licenseToApplyParam);
if(this.serviceTicket != null)
{
liceReq.setServiceTicket(this.serviceTicket);
}
return new... | java | public LicenseRequest applyLicense(String licenseToApplyParam)
{
LicenseRequest liceReq = new LicenseRequest();
liceReq.setLicenseCipherText(licenseToApplyParam);
if(this.serviceTicket != null)
{
liceReq.setServiceTicket(this.serviceTicket);
}
return new... | [
"public",
"LicenseRequest",
"applyLicense",
"(",
"String",
"licenseToApplyParam",
")",
"{",
"LicenseRequest",
"liceReq",
"=",
"new",
"LicenseRequest",
"(",
")",
";",
"liceReq",
".",
"setLicenseCipherText",
"(",
"licenseToApplyParam",
")",
";",
"if",
"(",
"this",
"... | Applies a generated license for the server.
@param licenseToApplyParam The clear license to apply.
@return The applied license. | [
"Applies",
"a",
"generated",
"license",
"for",
"the",
"server",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/FluidLicenseClient.java#L86-L98 | test | Apply a license to a single resource. | Of course, here is the Java code you requested:
```java
public LicenseRequest applyLicense(String licenseToApplyParam)
{
LicenseRequest liceReq = new LicenseRequest();
liceReq.setLicenseCipherText(licenseToApplyParam);
if(this.serviceTicket != null)
{
liceReq.setService... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/ProxyTargetReplacement.java | ProxyTargetReplacement.targetMethodAnnotation | public static void targetMethodAnnotation(final MethodVisitor mv, final MethodInfo methodInfo, final String[] args) {
AnnotationInfo[] anns = methodInfo.getAnnotations();
if (anns != null) {
targetAnnotation(mv, anns, args);
}
} | java | public static void targetMethodAnnotation(final MethodVisitor mv, final MethodInfo methodInfo, final String[] args) {
AnnotationInfo[] anns = methodInfo.getAnnotations();
if (anns != null) {
targetAnnotation(mv, anns, args);
}
} | [
"public",
"static",
"void",
"targetMethodAnnotation",
"(",
"final",
"MethodVisitor",
"mv",
",",
"final",
"MethodInfo",
"methodInfo",
",",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"AnnotationInfo",
"[",
"]",
"anns",
"=",
"methodInfo",
".",
"getAnnotations",... | Visits replacement code for {@link ProxyTarget#targetMethodAnnotation(String, String)}. | [
"Visits",
"replacement",
"code",
"for",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/ProxyTargetReplacement.java#L206-L212 | test | Target method annotation. | Of course, here is the Java code you requested:
```java
public static void targetMethodAnnotation(final MethodVisitor mv, final MethodInfo methodInfo, final String[] args) {
AnnotationInfo[] anns = methodInfo.getAnnotations();
if (anns != null) {
targetAnnotation(mv, anns, args);
}
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/Str.java | Str.equalsOrDie | public static void equalsOrDie(CharSequence a, CharSequence b) {
char[] ac = FastStringUtils.toCharArray(a);
char[] bc = FastStringUtils.toCharArray(b);
Chr.equalsOrDie(ac, bc);
} | java | public static void equalsOrDie(CharSequence a, CharSequence b) {
char[] ac = FastStringUtils.toCharArray(a);
char[] bc = FastStringUtils.toCharArray(b);
Chr.equalsOrDie(ac, bc);
} | [
"public",
"static",
"void",
"equalsOrDie",
"(",
"CharSequence",
"a",
",",
"CharSequence",
"b",
")",
"{",
"char",
"[",
"]",
"ac",
"=",
"FastStringUtils",
".",
"toCharArray",
"(",
"a",
")",
";",
"char",
"[",
"]",
"bc",
"=",
"FastStringUtils",
".",
"toCharA... | See if they are equal or die
@param a a
@param b b | [
"See",
"if",
"they",
"are",
"equal",
"or",
"die"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Str.java#L548-L552 | test | EqualsOrDie This is a utility method that checks if two CharSequences are equal. | Of course, here is the Java code you requested:
```java
public static void equalsOrDie(CharSequence a, CharSequence b) {
char[] ac = FastStringUtils.toCharArray(a);
char[] bc = FastStringUtils.toCharArray(b);
Chr.equalsOrDie(ac, bc);
}
```
Hope this helps! |
sikuli/sikuli-slides | src/main/java/org/sikuli/slides/api/generators/GeneratedProgram.java | GeneratedProgram.step6 | public boolean step6() {
Target target = new ImageTarget(new File("image6.png"));
target.setMinScore(DEFAULT_MINSCORE);
ScreenRegion loc = screenRegion.find(target);
return loc == null;
} | java | public boolean step6() {
Target target = new ImageTarget(new File("image6.png"));
target.setMinScore(DEFAULT_MINSCORE);
ScreenRegion loc = screenRegion.find(target);
return loc == null;
} | [
"public",
"boolean",
"step6",
"(",
")",
"{",
"Target",
"target",
"=",
"new",
"ImageTarget",
"(",
"new",
"File",
"(",
"\"image6.png\"",
")",
")",
";",
"target",
".",
"setMinScore",
"(",
"DEFAULT_MINSCORE",
")",
";",
"ScreenRegion",
"loc",
"=",
"screenRegion",... | Argument: | [
"Argument",
":"
] | 1a4a82cd97f577e0d7abe4218bf702e053acf003 | https://github.com/sikuli/sikuli-slides/blob/1a4a82cd97f577e0d7abe4218bf702e053acf003/src/main/java/org/sikuli/slides/api/generators/GeneratedProgram.java#L107-L112 | test | Step 6. | Of course, here is the Java code you requested:
```java
public boolean step6() {
Target target = new ImageTarget(new File("image6.png"));
target.setMinScore(DEFAULT_MINSCORE);
ScreenRegion loc = screenRegion.find(target);
return loc == null;
}
```
Hope this helps! |
agentsoz/jill | jill/src/main/java/io/github/agentsoz/jill/util/ArgumentsLoader.java | ArgumentsLoader.parseArgumentWithOption | private static void parseArgumentWithOption(String arg, String opt) {
switch (arg) {
case "--config":
config = loadConfigFromString(opt);
break;
case "--configfile":
config = loadConfigFromFile(opt);
break;
case "--exit-on-idle":
GlobalConstant.EXIT_ON_IDLE ... | java | private static void parseArgumentWithOption(String arg, String opt) {
switch (arg) {
case "--config":
config = loadConfigFromString(opt);
break;
case "--configfile":
config = loadConfigFromFile(opt);
break;
case "--exit-on-idle":
GlobalConstant.EXIT_ON_IDLE ... | [
"private",
"static",
"void",
"parseArgumentWithOption",
"(",
"String",
"arg",
",",
"String",
"opt",
")",
"{",
"switch",
"(",
"arg",
")",
"{",
"case",
"\"--config\"",
":",
"config",
"=",
"loadConfigFromString",
"(",
"opt",
")",
";",
"break",
";",
"case",
"\... | Parses the given command line argument and associated option. Will abort if an unrecoverable
error occurs.
@param arg the argument to parse
@param opt the options to parse for that argument | [
"Parses",
"the",
"given",
"command",
"line",
"argument",
"and",
"associated",
"option",
".",
"Will",
"abort",
"if",
"an",
"unrecoverable",
"error",
"occurs",
"."
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/util/ArgumentsLoader.java#L101-L130 | test | Parse an argument with an option. | Of course, here is the Java code you requested:
```java
private static void parseArgumentWithOption(String arg, String opt) {
switch (arg) {
case "--config":
config = loadConfigFromString(opt);
break;
case "--configfile":
config = loadConfigFromFile(opt);
break;
ca... |
boonproject/boon | boon/src/main/java/org/boon/Maps.java | Maps.after | @Universal
public static <K, V> V after( NavigableMap<K, V> map, final K index ) {
return map.get( map.higherKey( index ) );
} | java | @Universal
public static <K, V> V after( NavigableMap<K, V> map, final K index ) {
return map.get( map.higherKey( index ) );
} | [
"@",
"Universal",
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"after",
"(",
"NavigableMap",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"K",
"index",
")",
"{",
"return",
"map",
".",
"get",
"(",
"map",
".",
"higherKey",
"(",
"index",
")",
... | Grabs the value after this key from a tree map (Navigable map). | [
"Grabs",
"the",
"value",
"after",
"this",
"key",
"from",
"a",
"tree",
"map",
"(",
"Navigable",
"map",
")",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Maps.java#L249-L252 | test | Gets the value after the given key. | Of course, here is the Java code you requested:
```java
@Universal
public static <K, V> V after( NavigableMap<K, V> map, final K index ) {
return map.get( map.higherKey( index ) );
}
```
Hope this helps! |
oblac/jodd | jodd-core/src/main/java/jodd/util/StringUtil.java | StringUtil.indexOfRegion | public static int[] indexOfRegion(final String string, final String leftBoundary, final String rightBoundary, final char escape, final int offset) {
int ndx = offset;
int[] res = new int[4];
while (true) {
ndx = string.indexOf(leftBoundary, ndx);
if (ndx == -1) {
return null;
}
int leftBoundaryLen... | java | public static int[] indexOfRegion(final String string, final String leftBoundary, final String rightBoundary, final char escape, final int offset) {
int ndx = offset;
int[] res = new int[4];
while (true) {
ndx = string.indexOf(leftBoundary, ndx);
if (ndx == -1) {
return null;
}
int leftBoundaryLen... | [
"public",
"static",
"int",
"[",
"]",
"indexOfRegion",
"(",
"final",
"String",
"string",
",",
"final",
"String",
"leftBoundary",
",",
"final",
"String",
"rightBoundary",
",",
"final",
"char",
"escape",
",",
"final",
"int",
"offset",
")",
"{",
"int",
"ndx",
... | Returns indexes of the first string region. Region is defined by its left and right boundary.
Return value is an array of the following indexes:
<ul>
<li>start of left boundary index</li>
<li>region start index, i.e. end of left boundary</li>
<li>region end index, i.e. start of right boundary</li>
<li>end of right boun... | [
"Returns",
"indexes",
"of",
"the",
"first",
"string",
"region",
".",
"Region",
"is",
"defined",
"by",
"its",
"left",
"and",
"right",
"boundary",
".",
"Return",
"value",
"is",
"an",
"array",
"of",
"the",
"following",
"indexes",
":",
"<ul",
">",
"<li",
">"... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L2086-L2131 | test | Gets the index of the first region of the given string starting at the given offset. | Of course, here is the Java code you requested:
```java
public static int[] indexOfRegion(final String string, final String leftBoundary, final String rightBoundary, final char escape, final int offset) {
int ndx = offset;
int[] res = new int[4];
while (true) {
ndx = string.indexOf(leftBoundary, ndx);
if (... |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.onAssembly | @NonNull
public static Completable onAssembly(@NonNull Completable source) {
Function<? super Completable, ? extends Completable> f = onCompletableAssembly;
if (f != null) {
return apply(f, source);
}
return source;
} | java | @NonNull
public static Completable onAssembly(@NonNull Completable source) {
Function<? super Completable, ? extends Completable> f = onCompletableAssembly;
if (f != null) {
return apply(f, source);
}
return source;
} | [
"@",
"NonNull",
"public",
"static",
"Completable",
"onAssembly",
"(",
"@",
"NonNull",
"Completable",
"source",
")",
"{",
"Function",
"<",
"?",
"super",
"Completable",
",",
"?",
"extends",
"Completable",
">",
"f",
"=",
"onCompletableAssembly",
";",
"if",
"(",
... | Calls the associated hook function.
@param source the hook's input value
@return the value returned by the hook | [
"Calls",
"the",
"associated",
"hook",
"function",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L1096-L1103 | test | On an assembly Completable. | Of course, here is the Java code you requested:
```java
@NonNull
public static Completable onAssembly(@NonNull Completable source) {
Function<? super Completable, ? extends Completable> f = onCompletableAssembly;
if (f != null) {
return apply(f, source);
}
return source;... |
oblac/jodd | jodd-core/src/main/java/jodd/util/ClassLoaderUtil.java | ClassLoaderUtil.getResourceAsStream | public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass) throws IOException {
URL url = getResourceUrl(resourceName, callingClass);
if (url != null) {
return url.openStream();
}
return null;
} | java | public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass) throws IOException {
URL url = getResourceUrl(resourceName, callingClass);
if (url != null) {
return url.openStream();
}
return null;
} | [
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"final",
"String",
"resourceName",
",",
"final",
"ClassLoader",
"callingClass",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"getResourceUrl",
"(",
"resourceName",
",",
"callingClass",
")",
";",... | Opens a resource of the specified name for reading.
@see #getResourceUrl(String, ClassLoader) | [
"Opens",
"a",
"resource",
"of",
"the",
"specified",
"name",
"for",
"reading",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ClassLoaderUtil.java#L346-L352 | test | Get the resource stream. | Of course, here is the Java code you requested:
```java
public static InputStream getResourceAsStream(final String resourceName, final ClassLoader callingClass) throws IOException {
URL url = getResourceUrl(resourceName, callingClass);
if (url != null) {
return url.openStream();
}
return null;
}
```
Hope ... |
redraiment/jactiverecord | src/main/java/me/zzp/ar/Table.java | Table.extend | public Table extend(Object bean) {
Class<?> type = bean.getClass();
for (Method method : type.getDeclaredMethods()) {
Class<?> returnType = method.getReturnType();
Class<?>[] params = method.getParameterTypes();
String key = method.getName();
if (params.length == 2
&& key.leng... | java | public Table extend(Object bean) {
Class<?> type = bean.getClass();
for (Method method : type.getDeclaredMethods()) {
Class<?> returnType = method.getReturnType();
Class<?>[] params = method.getParameterTypes();
String key = method.getName();
if (params.length == 2
&& key.leng... | [
"public",
"Table",
"extend",
"(",
"Object",
"bean",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"bean",
".",
"getClass",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"type",
".",
"getDeclaredMethods",
"(",
")",
")",
"{",
"Class",
"<",
"?"... | 继承给定的JavaBean,扩展Record对象的get和set方法。
@param bean 希望被继承的JavaBean
@return 返回Table自身
@since 2.3 | [
"继承给定的JavaBean,扩展Record对象的get和set方法。"
] | d051709c93204658e7f2cc96c9898201c7337269 | https://github.com/redraiment/jactiverecord/blob/d051709c93204658e7f2cc96c9898201c7337269/src/main/java/me/zzp/ar/Table.java#L55-L74 | test | Extend the table with a bean. | Of course, here is the Java code you requested:
```java
public Table extend(Object bean) {
Class<?> type = bean.getClass();
for (Method method : type.getDeclaredMethods()) {
Class<?> returnType = method.getReturnType();
Class<?>[] params = method.getParameterTypes();
String key = method.getNa... |
GojaFramework/goja | goja-web/src/main/java/goja/logging/Logger.java | Logger.getCallerInformations | static CallInfo getCallerInformations(int level) {
StackTraceElement[] callStack = Thread.currentThread().getStackTrace();
StackTraceElement caller = callStack[level];
return new CallInfo(caller.getClassName(), caller.getMethodName());
} | java | static CallInfo getCallerInformations(int level) {
StackTraceElement[] callStack = Thread.currentThread().getStackTrace();
StackTraceElement caller = callStack[level];
return new CallInfo(caller.getClassName(), caller.getMethodName());
} | [
"static",
"CallInfo",
"getCallerInformations",
"(",
"int",
"level",
")",
"{",
"StackTraceElement",
"[",
"]",
"callStack",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getStackTrace",
"(",
")",
";",
"StackTraceElement",
"caller",
"=",
"callStack",
"[",
... | Examine stack trace to get caller
@param level method stack depth
@return who called the logger | [
"Examine",
"stack",
"trace",
"to",
"get",
"caller"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/logging/Logger.java#L231-L235 | test | Get the caller information from the stack trace. | Of course, here is the Java code you requested:
```java
static CallInfo getCallerInformations(int level) {
StackTraceElement[] callStack = Thread.currentThread().getStackTrace();
StackTraceElement caller = callStack[level];
return new CallInfo(caller.getClassName(), caller.getMethodName());
... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/StructureTable.java | StructureTable.setStructureData | public void setStructureData(List<StructureData> structureData) throws IOException {
dataModel = new StructureDataModel(structureData);
initTable(dataModel);
} | java | public void setStructureData(List<StructureData> structureData) throws IOException {
dataModel = new StructureDataModel(structureData);
initTable(dataModel);
} | [
"public",
"void",
"setStructureData",
"(",
"List",
"<",
"StructureData",
">",
"structureData",
")",
"throws",
"IOException",
"{",
"dataModel",
"=",
"new",
"StructureDataModel",
"(",
"structureData",
")",
";",
"initTable",
"(",
"dataModel",
")",
";",
"}"
] | Set the data as a collection of StructureData.
@param structureData List of type StructureData
@throws IOException on io error | [
"Set",
"the",
"data",
"as",
"a",
"collection",
"of",
"StructureData",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/StructureTable.java#L139-L142 | test | Sets the structure data. | Of course, here is the Java code you requested:
```java
public void setStructureData(List<StructureData> structureData) throws IOException {
dataModel = new StructureDataModel(structureData);
initTable(dataModel);
}
```
Hope this helps! |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/ce/CECompiler.java | CECompiler.compilefilter | public void
compilefilter(DapVariable var, DapSequence seq, CEAST expr)
throws DapException
{
if(expr == null)
return;
if(expr.sort == CEAST.Sort.SEGMENT) {
// This must be a simple segment and it must appear in seq
if(expr.subnodes != null)
... | java | public void
compilefilter(DapVariable var, DapSequence seq, CEAST expr)
throws DapException
{
if(expr == null)
return;
if(expr.sort == CEAST.Sort.SEGMENT) {
// This must be a simple segment and it must appear in seq
if(expr.subnodes != null)
... | [
"public",
"void",
"compilefilter",
"(",
"DapVariable",
"var",
",",
"DapSequence",
"seq",
",",
"CEAST",
"expr",
")",
"throws",
"DapException",
"{",
"if",
"(",
"expr",
"==",
"null",
")",
"return",
";",
"if",
"(",
"expr",
".",
"sort",
"==",
"CEAST",
".",
... | Convert field references in a filter | [
"Convert",
"field",
"references",
"in",
"a",
"filter"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/ce/CECompiler.java#L154-L207 | test | Compile a single block of code to be used in a Sequence filter. | Of course, here is the Java code you requested:
```java
public void
compilefilter(DapVariable var, DapSequence seq, CEAST expr)
throws DapException
{
if(expr == null)
return;
if(expr.sort == CEAST.Sort.SEGMENT) {
// This must be a simple segment and it must a... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/chart/objects/LineChart.java | LineChart.getShapePropertiesFromCTSer | @Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTLineSer) {
return ((CTLineSer) ctObjSer).getSpPr();
}
return null;
} | java | @Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTLineSer) {
return ((CTLineSer) ctObjSer).getSpPr();
}
return null;
} | [
"@",
"Override",
"public",
"final",
"CTShapeProperties",
"getShapePropertiesFromCTSer",
"(",
"final",
"Object",
"ctObjSer",
")",
"{",
"if",
"(",
"ctObjSer",
"instanceof",
"CTLineSer",
")",
"{",
"return",
"(",
"(",
"CTLineSer",
")",
"ctObjSer",
")",
".",
"getSpPr... | /*
(non-Javadoc)
@see org.tiefaces.components.websheet.chart.objects.ChartObject#
getShapePropertiesFromCTSer(java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/chart/objects/LineChart.java#L99-L106 | test | Override the method to return the CTShapeProperties object from the CTSer. | Of course, here is the Java code you requested:
```java
@Override
public final CTShapeProperties getShapePropertiesFromCTSer(
final Object ctObjSer) {
if (ctObjSer instanceof CTLineSer) {
return ((CTLineSer) ctObjSer).getSpPr();
}
return null;
}
```
Hope this helps! |
chenlb/mmseg4j-from-googlecode | src/com/chenlb/mmseg4j/Seg.java | Seg.search | protected int search(char[] chs, int offset, int tailLen) {
if(tailLen == 0) {
return -1;
}
CharNode cn = dic.head(chs[offset]);
return search(cn, chs, offset, tailLen);
} | java | protected int search(char[] chs, int offset, int tailLen) {
if(tailLen == 0) {
return -1;
}
CharNode cn = dic.head(chs[offset]);
return search(cn, chs, offset, tailLen);
} | [
"protected",
"int",
"search",
"(",
"char",
"[",
"]",
"chs",
",",
"int",
"offset",
",",
"int",
"tailLen",
")",
"{",
"if",
"(",
"tailLen",
"==",
"0",
")",
"{",
"return",
"-",
"1",
";",
"}",
"CharNode",
"cn",
"=",
"dic",
".",
"head",
"(",
"chs",
"... | 查找chs[offset]后面的 tailLen个char是否为词.
@return 返回chs[offset]字符结点下的词尾索引号,没找到返回 -1. | [
"查找chs",
"[",
"offset",
"]",
"后面的",
"tailLen个char是否为词",
"."
] | 3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb | https://github.com/chenlb/mmseg4j-from-googlecode/blob/3053a70c29c1bc8e7c280a8098fb41b5ad9ec3cb/src/com/chenlb/mmseg4j/Seg.java#L40-L47 | test | Returns the number of times the specified offset is found in the specified char array. | Of course, here is the Java code you requested:
```java
protected int search(char[] chs, int offset, int tailLen) {
if(tailLen == 0) {
return -1;
}
CharNode cn = dic.head(chs[offset]);
return search(cn, chs, offset, tailLen);
}
```
Hope this helps! |
firepick1/firerest-client | src/main/java/org/firepick/IPv4Scanner.java | IPv4Scanner.scanRange | public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) {
Collection<InetAddress> addresses = new ArrayList<InetAddress>();
Collection<InetAddress> result = new ArrayList<InetAddress>();
if (addr == null) {
try {
addresses.addAll(localhostNetworkAddresses());
... | java | public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) {
Collection<InetAddress> addresses = new ArrayList<InetAddress>();
Collection<InetAddress> result = new ArrayList<InetAddress>();
if (addr == null) {
try {
addresses.addAll(localhostNetworkAddresses());
... | [
"public",
"static",
"Collection",
"<",
"InetAddress",
">",
"scanRange",
"(",
"InetAddress",
"addr",
",",
"int",
"count",
",",
"int",
"msTimeout",
")",
"{",
"Collection",
"<",
"InetAddress",
">",
"addresses",
"=",
"new",
"ArrayList",
"<",
"InetAddress",
">",
... | Scan a range of InetAddresses starting with the given address
@param start starting address of search; null implies subnetAddress0(null,24)
@param count number of addresses in range
@param msTimeout maximum time to wait for each host | [
"Scan",
"a",
"range",
"of",
"InetAddresses",
"starting",
"with",
"the",
"given",
"address"
] | f43c85ca093b1f9f62f0375f905adae9351de1e6 | https://github.com/firepick1/firerest-client/blob/f43c85ca093b1f9f62f0375f905adae9351de1e6/src/main/java/org/firepick/IPv4Scanner.java#L68-L89 | test | Scan range. | Of course, here is the Java code you requested:
```java
public static Collection<InetAddress> scanRange(InetAddress addr, int count, int msTimeout) {
Collection<InetAddress> addresses = new ArrayList<InetAddress>();
Collection<InetAddress> result = new ArrayList<InetAddress>();
if (addr == null) {
tr... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/wrapper/BufferResponseWrapper.java | BufferResponseWrapper.setIntHeader | @Override
public void setIntHeader(final String name, final int value) {
if (buffer == null || !name.equalsIgnoreCase(CONTENT_LENGTH)) {
super.setIntHeader(name, value);
}
} | java | @Override
public void setIntHeader(final String name, final int value) {
if (buffer == null || !name.equalsIgnoreCase(CONTENT_LENGTH)) {
super.setIntHeader(name, value);
}
} | [
"@",
"Override",
"public",
"void",
"setIntHeader",
"(",
"final",
"String",
"name",
",",
"final",
"int",
"value",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
"||",
"!",
"name",
".",
"equalsIgnoreCase",
"(",
"CONTENT_LENGTH",
")",
")",
"{",
"super",
".",
... | Prevents setting content-length if buffering enabled. | [
"Prevents",
"setting",
"content",
"-",
"length",
"if",
"buffering",
"enabled",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/wrapper/BufferResponseWrapper.java#L378-L383 | test | Sets the value of the specified header. | Of course, here is the Java code you requested:
```java
@Override
public void setIntHeader(final String name, final int value) {
if (buffer == null || !name.equalsIgnoreCase(CONTENT_LENGTH)) {
super.setIntHeader(name, value);
}
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/VerticalCT.java | VerticalCT.makeVerticalTransform | public VerticalTransform makeVerticalTransform(NetcdfDataset ds, Dimension timeDim) {
return builder.makeMathTransform(ds, timeDim, this);
} | java | public VerticalTransform makeVerticalTransform(NetcdfDataset ds, Dimension timeDim) {
return builder.makeMathTransform(ds, timeDim, this);
} | [
"public",
"VerticalTransform",
"makeVerticalTransform",
"(",
"NetcdfDataset",
"ds",
",",
"Dimension",
"timeDim",
")",
"{",
"return",
"builder",
".",
"makeMathTransform",
"(",
"ds",
",",
"timeDim",
",",
"this",
")",
";",
"}"
] | Use the builder to make the Vertical Transform function
@param ds containing dataset
@param timeDim time Dimension
@return VerticalTransform
@see VertTransformBuilderIF#makeMathTransform | [
"Use",
"the",
"builder",
"to",
"make",
"the",
"Vertical",
"Transform",
"function"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/VerticalCT.java#L70-L72 | test | Make a vertical transform for the given dataset. | Of course, here is the Java code you requested:
```java
public VerticalTransform makeVerticalTransform(NetcdfDataset ds, Dimension timeDim) {
return builder.makeMathTransform(ds, timeDim, this);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/WebSocketClient.java | WebSocketClient.onClose | @OnClose
public void onClose(Session userSessionParam, CloseReason reasonParam) {
this.userSession = null;
if (this.messageHandlers != null) {
this.messageHandlers.values().forEach(handle ->{
handle.connectionClosed();
});
}
} | java | @OnClose
public void onClose(Session userSessionParam, CloseReason reasonParam) {
this.userSession = null;
if (this.messageHandlers != null) {
this.messageHandlers.values().forEach(handle ->{
handle.connectionClosed();
});
}
} | [
"@",
"OnClose",
"public",
"void",
"onClose",
"(",
"Session",
"userSessionParam",
",",
"CloseReason",
"reasonParam",
")",
"{",
"this",
".",
"userSession",
"=",
"null",
";",
"if",
"(",
"this",
".",
"messageHandlers",
"!=",
"null",
")",
"{",
"this",
".",
"mes... | Callback hook for Connection close events.
@param userSessionParam The userSession which is getting closed.
@param reasonParam The reason for connection close. | [
"Callback",
"hook",
"for",
"Connection",
"close",
"events",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/WebSocketClient.java#L83-L93 | test | Called when the connection is closed. | Of course, here is the Java code you requested:
```java
@OnClose
public void onClose(Session userSessionParam, CloseReason reasonParam) {
this.userSession = null;
if (this.messageHandlers != null) {
this.messageHandlers.values().forEach(handle ->{
handle.connectionClosed();
});
}
}
```
Hope this h... |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/retrieval/AbstractQuery.java | AbstractQuery.getConcepts | public FSList getConcepts() {
if (AbstractQuery_Type.featOkTst && ((AbstractQuery_Type)jcasType).casFeat_concepts == null)
jcasType.jcas.throwFeatMissing("concepts", "edu.cmu.lti.oaqa.type.retrieval.AbstractQuery");
return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Abst... | java | public FSList getConcepts() {
if (AbstractQuery_Type.featOkTst && ((AbstractQuery_Type)jcasType).casFeat_concepts == null)
jcasType.jcas.throwFeatMissing("concepts", "edu.cmu.lti.oaqa.type.retrieval.AbstractQuery");
return (FSList)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefValue(addr, ((Abst... | [
"public",
"FSList",
"getConcepts",
"(",
")",
"{",
"if",
"(",
"AbstractQuery_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"AbstractQuery_Type",
")",
"jcasType",
")",
".",
"casFeat_concepts",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
... | getter for concepts - gets The list of query concepts that make up this abstract query. The list is ordered.
@generated
@return value of the feature | [
"getter",
"for",
"concepts",
"-",
"gets",
"The",
"list",
"of",
"query",
"concepts",
"that",
"make",
"up",
"this",
"abstract",
"query",
".",
"The",
"list",
"is",
"ordered",
"."
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/AbstractQuery.java#L75-L78 | test | getter for concepts - gets | Of course, here is the Java code you requested:
```java
public FSList getConcepts() {
if (AbstractQuery_Type.featOkTst && ((AbstractQuery_Type)jcasType).casFeat_concepts == null)
jcasType.jcas.throwFeatMissing("concepts", "edu.cmu.lti.oaqa.type.retrieval.AbstractQuery");
return (FSList)(jcasType.ll_cas.l... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/widget/FileManager.java | FileManager.chooseFilename | public String chooseFilename() {
if (!readOk) return null;
selectedFile = false;
//selectedURL = false;
w.setVisible(true); // modal, so blocks; listener calls hide(), which unblocks.
if (selectedFile) {
File file = chooser.getSelectedFile();
if (file == null) return null;
... | java | public String chooseFilename() {
if (!readOk) return null;
selectedFile = false;
//selectedURL = false;
w.setVisible(true); // modal, so blocks; listener calls hide(), which unblocks.
if (selectedFile) {
File file = chooser.getSelectedFile();
if (file == null) return null;
... | [
"public",
"String",
"chooseFilename",
"(",
")",
"{",
"if",
"(",
"!",
"readOk",
")",
"return",
"null",
";",
"selectedFile",
"=",
"false",
";",
"//selectedURL = false;\r",
"w",
".",
"setVisible",
"(",
"true",
")",
";",
"// modal, so blocks; listener calls hide(), wh... | Allow user to select file, then return the filename, in canonical form,
always using '/', never '\'
@return chosen filename in canonical form, or null if nothing chosen. | [
"Allow",
"user",
"to",
"select",
"file",
"then",
"return",
"the",
"filename",
"in",
"canonical",
"form",
"always",
"using",
"/",
"never",
"\\"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/widget/FileManager.java#L251-L271 | test | Choose the filename to use for a new file. | Of course, here is the Java code you requested:
```java
public String chooseFilename() {
if (!readOk) return null;
selectedFile = false;
//selectedURL = false;
w.setVisible(true); // modal, so blocks; listener calls hide(), which unblocks.
if (selectedFile) {
File file = chooser.getSe... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java | AbstractInterceptUrlConfigurer.createDefaultAccessDecisionManager | private AccessDecisionManager createDefaultAccessDecisionManager(H http) {
AffirmativeBased result = new AffirmativeBased(getDecisionVoters(http));
return postProcess(result);
} | java | private AccessDecisionManager createDefaultAccessDecisionManager(H http) {
AffirmativeBased result = new AffirmativeBased(getDecisionVoters(http));
return postProcess(result);
} | [
"private",
"AccessDecisionManager",
"createDefaultAccessDecisionManager",
"(",
"H",
"http",
")",
"{",
"AffirmativeBased",
"result",
"=",
"new",
"AffirmativeBased",
"(",
"getDecisionVoters",
"(",
"http",
")",
")",
";",
"return",
"postProcess",
"(",
"result",
")",
";"... | Creates the default {@code AccessDecisionManager}
@return the default {@code AccessDecisionManager} | [
"Creates",
"the",
"default",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/AbstractInterceptUrlConfigurer.java#L158-L161 | test | Create a default access decision manager. | Of course, here is the Java code you requested:
```java
private AccessDecisionManager createDefaultAccessDecisionManager(H http) {
AffirmativeBased result = new AffirmativeBased(getDecisionVoters(http));
return postProcess(result);
}
```
Hope this helps! |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/Cowry.java | Cowry.splitArray | public static <T> Tuple2<T[],T[]> splitArray(T[] orig, int splitIndex) { //, Class<T> tClass) {
// if (splitIndex < 1) {
// throw new IllegalArgumentException("Called split when splitIndex < 1");
// }
// if (splitIndex > orig.length - 1) {
// throw new IllegalArgumentException... | java | public static <T> Tuple2<T[],T[]> splitArray(T[] orig, int splitIndex) { //, Class<T> tClass) {
// if (splitIndex < 1) {
// throw new IllegalArgumentException("Called split when splitIndex < 1");
// }
// if (splitIndex > orig.length - 1) {
// throw new IllegalArgumentException... | [
"public",
"static",
"<",
"T",
">",
"Tuple2",
"<",
"T",
"[",
"]",
",",
"T",
"[",
"]",
">",
"splitArray",
"(",
"T",
"[",
"]",
"orig",
",",
"int",
"splitIndex",
")",
"{",
"//, Class<T> tClass) {",
"// if (splitIndex < 1) {",
"// throw new Illega... | Only call this if the array actually needs to be split (0 < splitPoint < orig.length).
@param orig array to split
@param splitIndex items less than this index go in the left, equal or greater in the right.
@return a 2D array of leftItems then rightItems | [
"Only",
"call",
"this",
"if",
"the",
"array",
"actually",
"needs",
"to",
"be",
"split",
"(",
"0",
"<",
";",
"splitPoint",
"<",
";",
"orig",
".",
"length",
")",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/Cowry.java#L207-L234 | test | Splits the array in two arrays of the specified type. | Of course, here is the Java code you requested:
```java
public static <T> Tuple2<T[],T[]> splitArray(T[] orig, int splitIndex) { //, Class<T> tClass) {
// if (splitIndex < 1) {
// throw new IllegalArgumentException("Called split when splitIndex < 1");
// }
// if (splitIndex > orig.lengt... |
oblac/jodd | jodd-core/src/main/java/jodd/buffer/FastIntBuffer.java | FastIntBuffer.append | public FastIntBuffer append(final FastIntBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
} | java | public FastIntBuffer append(final FastIntBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
} | [
"public",
"FastIntBuffer",
"append",
"(",
"final",
"FastIntBuffer",
"buff",
")",
"{",
"if",
"(",
"buff",
".",
"offset",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"append",
"(",
"buff",
".",
"buffer",
",",
"0",
",",
"buff",
".",
"offset",
")",
... | Appends another fast buffer to this one. | [
"Appends",
"another",
"fast",
"buffer",
"to",
"this",
"one",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/buffer/FastIntBuffer.java#L104-L110 | test | Append the contents of the specified buffer to this buffer. | Of course, here is the Java code you requested:
```java
public FastIntBuffer append(final FastIntBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
}
```
Hope this helps! |
Unidata/thredds | opendap/src/main/java/opendap/dap/DDS.java | DDS.ingestAttributeTable | private void ingestAttributeTable(AttributeTable at, BaseType bt) throws DASException
{
try {
String atName = at.getEncodedName();
String bName = bt.getEncodedName();
//LogStream.out.println("ingestATTbl: atName:"+atName+" bName: "+bName);
if (bName.equals... | java | private void ingestAttributeTable(AttributeTable at, BaseType bt) throws DASException
{
try {
String atName = at.getEncodedName();
String bName = bt.getEncodedName();
//LogStream.out.println("ingestATTbl: atName:"+atName+" bName: "+bName);
if (bName.equals... | [
"private",
"void",
"ingestAttributeTable",
"(",
"AttributeTable",
"at",
",",
"BaseType",
"bt",
")",
"throws",
"DASException",
"{",
"try",
"{",
"String",
"atName",
"=",
"at",
".",
"getEncodedName",
"(",
")",
";",
"String",
"bName",
"=",
"bt",
".",
"getEncoded... | A helper methods for ingestDAS().
@see #ingestDAS(DAS)
@see #ingestAttribute(Attribute, BaseType)
@see #ingestAttributeTable(AttributeTable, DConstructor) | [
"A",
"helper",
"methods",
"for",
"ingestDAS",
"()",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DDS.java#L2086-L2122 | test | ingestAttributeTable This method is called to ingest the attribute table. | Of course, here is the Java code you requested:
```java
private void ingestAttributeTable(AttributeTable at, BaseType bt) throws DASException
{
try {
String atName = at.getEncodedName();
String bName = bt.getEncodedName();
//LogStream.out.println("ingestATTbl: atName:... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.repeatWhen | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeatWhen(final Function<? super Observable<Object>, ? extends ObservableSource<?>> handler) {
ObjectHelper.requireNonNull(handler, "handler is null");
return RxJavaPlugins.onAssembly(new ObservableRepeatWhen<... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeatWhen(final Function<? super Observable<Object>, ? extends ObservableSource<?>> handler) {
ObjectHelper.requireNonNull(handler, "handler is null");
return RxJavaPlugins.onAssembly(new ObservableRepeatWhen<... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"repeatWhen",
"(",
"final",
"Function",
"<",
"?",
"super",
"Observable",
"<",
"Object",
">",
",",
"?",
"extends",
"Ob... | Returns an Observable that emits the same values as the source ObservableSource with the exception of an
{@code onComplete}. An {@code onComplete} notification from the source will result in the emission of
a {@code void} item to the ObservableSource provided as an argument to the {@code notificationHandler}
function. ... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"the",
"same",
"values",
"as",
"the",
"source",
"ObservableSource",
"with",
"the",
"exception",
"of",
"an",
"{",
"@code",
"onComplete",
"}",
".",
"An",
"{",
"@code",
"onComplete",
"}",
"notification",
"from",
"... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L10487-L10492 | test | Repeat when an observable is received from the source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeatWhen(final Function<? super Observable<Object>, ? extends ObservableSource<?>> handler) {
ObjectHelper.requireNonNull(handler, "handler is null");
... |
rupertlssmith/lojix | lojix/search/src/main/com/thesett/aima/search/util/backtracking/BacktrackingAlgorithm.java | BacktrackingAlgorithm.backtrack | protected void backtrack(SearchNode checkNode)
{
while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0))
{
Reversable undoState = (ReTraversable) checkNode.getState();
undoState.undoOperator();
checkNode = checkNode.getParent();
}
} | java | protected void backtrack(SearchNode checkNode)
{
while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0))
{
Reversable undoState = (ReTraversable) checkNode.getState();
undoState.undoOperator();
checkNode = checkNode.getParent();
}
} | [
"protected",
"void",
"backtrack",
"(",
"SearchNode",
"checkNode",
")",
"{",
"while",
"(",
"(",
"checkNode",
"!=",
"null",
")",
"&&",
"(",
"checkNode",
".",
"unexaminedSuccessorCount",
"==",
"0",
")",
")",
"{",
"Reversable",
"undoState",
"=",
"(",
"ReTraversa... | Back-tracks from the specified node, moving succesively upwards through the chain of parent nodes, until a node
is encountered that has unexamined successors. This method implements the backtracking searches reverse
direction. By checking for the presence of unexamined successors, this method only backtracks where nece... | [
"Back",
"-",
"tracks",
"from",
"the",
"specified",
"node",
"moving",
"succesively",
"upwards",
"through",
"the",
"chain",
"of",
"parent",
"nodes",
"until",
"a",
"node",
"is",
"encountered",
"that",
"has",
"unexamined",
"successors",
".",
"This",
"method",
"imp... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/search/src/main/com/thesett/aima/search/util/backtracking/BacktrackingAlgorithm.java#L197-L206 | test | Backtrack a search node. | Of course, here is the Java code you requested:
```java
protected void backtrack(SearchNode checkNode)
{
while ((checkNode != null) && (checkNode.unexaminedSuccessorCount == 0))
{
Reversable undoState = (ReTraversable) checkNode.getState();
undoState.undoOperator();
... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.switchIfEmpty | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> switchIfEmpty(Publisher<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new FlowableSwitchIf... | java | @CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> switchIfEmpty(Publisher<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
return RxJavaPlugins.onAssembly(new FlowableSwitchIf... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"switchIfEmpty",
"(",
"Publisher",
"... | Returns a Flowable that emits the items emitted by the source Publisher or the items of an alternate
Publisher if the source Publisher is empty.
<p>
<img width="640" height="255" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchifempty.png" alt="">
<dl>
<dt><b>Backpressure:</b></dt>
<dd>If th... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"the",
"items",
"emitted",
"by",
"the",
"source",
"Publisher",
"or",
"the",
"items",
"of",
"an",
"alternate",
"Publisher",
"if",
"the",
"source",
"Publisher",
"is",
"empty",
".",
"<p",
">",
"<img",
"width",
"=",... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14980-L14987 | test | Switches the source Publisher to an empty one. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> switchIfEmpty(Publisher<? extends T> other) {
ObjectHelper.requireNonNull(other, "other is null");
... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java | GempakFileReader.DM_RDTR | public RData DM_RDTR(int irow, int icol, String partName,
int decimalScale)
throws IOException {
int ipoint = -1;
if ((irow < 1) || (irow > dmLabel.krow) || (icol < 1)
|| (icol > dmLabel.kcol)) {
System.out.println("bad row/column number " + irow + "/" + icol)... | java | public RData DM_RDTR(int irow, int icol, String partName,
int decimalScale)
throws IOException {
int ipoint = -1;
if ((irow < 1) || (irow > dmLabel.krow) || (icol < 1)
|| (icol > dmLabel.kcol)) {
System.out.println("bad row/column number " + irow + "/" + icol)... | [
"public",
"RData",
"DM_RDTR",
"(",
"int",
"irow",
",",
"int",
"icol",
",",
"String",
"partName",
",",
"int",
"decimalScale",
")",
"throws",
"IOException",
"{",
"int",
"ipoint",
"=",
"-",
"1",
";",
"if",
"(",
"(",
"irow",
"<",
"1",
")",
"||",
"(",
"... | Read the real (float) data
@param irow row to read
@param icol column to read
@param partName part name
@param decimalScale scaling factor (power of 10);
@return the header and data array or null;
@throws IOException problem reading file | [
"Read",
"the",
"real",
"(",
"float",
")",
"data"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakFileReader.java#L1521-L1593 | test | Read a RData object from the file. | Of course, here is the Java code you requested:
```java
public RData DM_RDTR(int irow, int icol, String partName,
int decimalScale)
throws IOException {
int ipoint = -1;
if ((irow < 1) || (irow > dmLabel.krow) || (icol < 1)
|| (icol > dmLabel.kcol)) {
System.... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/MethodVisitor.java | MethodVisitor.visitJumpInsn | public void visitJumpInsn(final int opcode, final Label label) {
if (mv != null) {
mv.visitJumpInsn(opcode, label);
}
} | java | public void visitJumpInsn(final int opcode, final Label label) {
if (mv != null) {
mv.visitJumpInsn(opcode, label);
}
} | [
"public",
"void",
"visitJumpInsn",
"(",
"final",
"int",
"opcode",
",",
"final",
"Label",
"label",
")",
"{",
"if",
"(",
"mv",
"!=",
"null",
")",
"{",
"mv",
".",
"visitJumpInsn",
"(",
"opcode",
",",
"label",
")",
";",
"}",
"}"
] | Visits a jump instruction. A jump instruction is an instruction that may jump to another
instruction.
@param opcode the opcode of the type instruction to be visited. This opcode is either IFEQ,
IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT,
IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, J... | [
"Visits",
"a",
"jump",
"instruction",
".",
"A",
"jump",
"instruction",
"is",
"an",
"instruction",
"that",
"may",
"jump",
"to",
"another",
"instruction",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/MethodVisitor.java#L471-L475 | test | Visit a jump instruction. | Of course, here is the Java code you requested:
```java
public void visitJumpInsn(final int opcode, final Label label) {
if (mv != null) {
mv.visitJumpInsn(opcode, label);
}
}
```
Hope this helps! |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java | Reasoner.getSubClasses | public synchronized Set<? extends Node<ElkClass>> getSubClasses(
ElkClassExpression classExpression, boolean direct)
throws ElkInconsistentOntologyException, ElkException {
if (classExpression instanceof ElkClass) {
final TaxonomyNode<ElkClass> queryNode = getTaxonomyNode(
(ElkClass) classExpression);
... | java | public synchronized Set<? extends Node<ElkClass>> getSubClasses(
ElkClassExpression classExpression, boolean direct)
throws ElkInconsistentOntologyException, ElkException {
if (classExpression instanceof ElkClass) {
final TaxonomyNode<ElkClass> queryNode = getTaxonomyNode(
(ElkClass) classExpression);
... | [
"public",
"synchronized",
"Set",
"<",
"?",
"extends",
"Node",
"<",
"ElkClass",
">",
">",
"getSubClasses",
"(",
"ElkClassExpression",
"classExpression",
",",
"boolean",
"direct",
")",
"throws",
"ElkInconsistentOntologyException",
",",
"ElkException",
"{",
"if",
"(",
... | Return the (direct or indirect) subclasses of the given
{@link ElkClassExpression} as specified by the parameter. The method
returns a set of {@link Node}s, each of which representing an equivalent
class of subclasses. Calling of this method may trigger the computation
of the taxonomy, if it has not been done yet.
@pa... | [
"Return",
"the",
"(",
"direct",
"or",
"indirect",
")",
"subclasses",
"of",
"the",
"given",
"{",
"@link",
"ElkClassExpression",
"}",
"as",
"specified",
"by",
"the",
"parameter",
".",
"The",
"method",
"returns",
"a",
"set",
"of",
"{",
"@link",
"Node",
"}",
... | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/Reasoner.java#L418-L458 | test | Gets the sub - classes of the given class. | Of course, here is the Java code you requested:
```java
public synchronized Set<? extends Node<ElkClass>> getSubClasses(
ElkClassExpression classExpression, boolean direct)
throws ElkInconsistentOntologyException, ElkException {
if (classExpression instanceof ElkClass) {
final TaxonomyNode<ElkClass> queryNo... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java | OCommandExecutorSQLSelect.getTemporaryRIDCounter | public int getTemporaryRIDCounter(final OCommandContext iContext) {
final OTemporaryRidGenerator parentQuery = (OTemporaryRidGenerator) iContext.getVariable("parentQuery");
return parentQuery != null && parentQuery != this ?
parentQuery.getTemporaryRIDCounter(iContext) :
serialTempRID.getAnd... | java | public int getTemporaryRIDCounter(final OCommandContext iContext) {
final OTemporaryRidGenerator parentQuery = (OTemporaryRidGenerator) iContext.getVariable("parentQuery");
return parentQuery != null && parentQuery != this ?
parentQuery.getTemporaryRIDCounter(iContext) :
serialTempRID.getAnd... | [
"public",
"int",
"getTemporaryRIDCounter",
"(",
"final",
"OCommandContext",
"iContext",
")",
"{",
"final",
"OTemporaryRidGenerator",
"parentQuery",
"=",
"(",
"OTemporaryRidGenerator",
")",
"iContext",
".",
"getVariable",
"(",
"\"parentQuery\"",
")",
";",
"return",
"pa... | Returns the temporary RID counter assuring it's unique per query tree.
@return Serial as integer | [
"Returns",
"the",
"temporary",
"RID",
"counter",
"assuring",
"it",
"s",
"unique",
"per",
"query",
"tree",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLSelect.java#L682-L687 | test | Gets the temporary rid counter. | Of course, here is the Java code you requested:
```java
public int getTemporaryRIDCounter(final OCommandContext iContext) {
final OTemporaryRidGenerator parentQuery = (OTemporaryRidGenerator) iContext.getVariable("parentQuery");
return parentQuery != null && parentQuery != this ?
parentQuery.getTemp... |
objectify/objectify | src/main/java/com/googlecode/objectify/Key.java | Key.create | public static <T> Key<T> create(final Class<? extends T> kindClass, final String name) {
return new Key<>(kindClass, name);
} | java | public static <T> Key<T> create(final Class<? extends T> kindClass, final String name) {
return new Key<>(kindClass, name);
} | [
"public",
"static",
"<",
"T",
">",
"Key",
"<",
"T",
">",
"create",
"(",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"kindClass",
",",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Key",
"<>",
"(",
"kindClass",
",",
"name",
")",
";",
... | Key.create(Blah.class, name) is easier to type than new Key<Blah>(Blah.class, name) | [
"Key",
".",
"create",
"(",
"Blah",
".",
"class",
"name",
")",
"is",
"easier",
"to",
"type",
"than",
"new",
"Key<Blah",
">",
"(",
"Blah",
".",
"class",
"name",
")"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/Key.java#L39-L41 | test | Create a new instance of a key. | Of course, here is the Java code you requested:
```java
public static <T> Key<T> create(final Class<? extends T> kindClass, final String name) {
return new Key<>(kindClass, name);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java | ABaseESUtil.searchAndConvertHitsToFormWithAllFields | public final List<Form> searchAndConvertHitsToFormWithAllFields(
QueryBuilder qbParam,
String indexParam,
int offsetParam,
int limitParam,
Long ... formTypesParam
) {
SearchHits searchHits = this.searchWithHits(
qbParam,
indexParam,
false,
offsetParam,
limitParam,
formTypesPara... | java | public final List<Form> searchAndConvertHitsToFormWithAllFields(
QueryBuilder qbParam,
String indexParam,
int offsetParam,
int limitParam,
Long ... formTypesParam
) {
SearchHits searchHits = this.searchWithHits(
qbParam,
indexParam,
false,
offsetParam,
limitParam,
formTypesPara... | [
"public",
"final",
"List",
"<",
"Form",
">",
"searchAndConvertHitsToFormWithAllFields",
"(",
"QueryBuilder",
"qbParam",
",",
"String",
"indexParam",
",",
"int",
"offsetParam",
",",
"int",
"limitParam",
",",
"Long",
"...",
"formTypesParam",
")",
"{",
"SearchHits",
... | Performs a search against the Elasticsearch instance with the {@code qbParam}.
@param qbParam The @{code QueryBuilder} to search with.
@param indexParam The Elasticsearch Index to use {@code (document, folder or table_field)}.
@param offsetParam The offset for the results to return.
@param limitParam The max number of... | [
"Performs",
"a",
"search",
"against",
"the",
"Elasticsearch",
"instance",
"with",
"the",
"{",
"@code",
"qbParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/elasticsearch/ABaseESUtil.java#L379-L447 | test | Search and convert Hits to Forms with all fields. | Of course, here is the Java code you requested:
```java
public final List<Form> searchAndConvertHitsToFormWithAllFields(
QueryBuilder qbParam,
String indexParam,
int offsetParam,
int limitParam,
Long ... formTypesParam
) {
SearchHits searchHits = this.searchWithHits(
qbParam,
indexParam,
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/NetcdfFile.java | NetcdfFile.readArrays | public java.util.List<Array> readArrays(java.util.List<Variable> variables) throws IOException {
java.util.List<Array> result = new java.util.ArrayList<>();
for (Variable variable : variables)
result.add(variable.read());
return result;
} | java | public java.util.List<Array> readArrays(java.util.List<Variable> variables) throws IOException {
java.util.List<Array> result = new java.util.ArrayList<>();
for (Variable variable : variables)
result.add(variable.read());
return result;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"Array",
">",
"readArrays",
"(",
"java",
".",
"util",
".",
"List",
"<",
"Variable",
">",
"variables",
")",
"throws",
"IOException",
"{",
"java",
".",
"util",
".",
"List",
"<",
"Array",
">",
"result",
"... | Do a bulk read on a list of Variables and
return a corresponding list of Array that contains the results
of a full read on each Variable.
This is mostly here so DODSNetcdf can override it with one call to the server.
@param variables List of type Variable
@return List of Array, one for each Variable in the input.
@thr... | [
"Do",
"a",
"bulk",
"read",
"on",
"a",
"list",
"of",
"Variables",
"and",
"return",
"a",
"corresponding",
"list",
"of",
"Array",
"that",
"contains",
"the",
"results",
"of",
"a",
"full",
"read",
"on",
"each",
"Variable",
".",
"This",
"is",
"mostly",
"here",... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/NetcdfFile.java#L2205-L2210 | test | Reads a list of arrays from the input stream. | Of course, here is the Java code you requested:
```java
public java.util.List<Array> readArrays(java.util.List<Variable> variables) throws IOException {
java.util.List<Array> result = new java.util.ArrayList<>();
for (Variable variable : variables)
result.add(variable.read());
return result;
}
```
... |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/helper/ReflectHelper.java | ReflectHelper.getFieldValue | public static Object getFieldValue(Object obj, String fieldName) {
Object result = null;
Field field = getField(obj, fieldName);
if (field != null) {
field.setAccessible(true);
try {
result = field.get(obj);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessExce... | java | public static Object getFieldValue(Object obj, String fieldName) {
Object result = null;
Field field = getField(obj, fieldName);
if (field != null) {
field.setAccessible(true);
try {
result = field.get(obj);
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessExce... | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Object",
"obj",
",",
"String",
"fieldName",
")",
"{",
"Object",
"result",
"=",
"null",
";",
"Field",
"field",
"=",
"getField",
"(",
"obj",
",",
"fieldName",
")",
";",
"if",
"(",
"field",
"!=",
"null",
... | 利用反射获取指定对象的指定属性
@param obj 目标对象
@param fieldName 目标属性
@return 目标属性的值 | [
"利用反射获取指定对象的指定属性"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/helper/ReflectHelper.java#L36-L50 | test | Gets the value of the field with the given name from the given object. | Of course, here is the Java code you requested:
```java
public static Object getFieldValue(Object obj, String fieldName) {
Object result = null;
Field field = getField(obj, fieldName);
if (field != null) {
field.setAccessible(true);
try {
result = field.get(obj);
} catch (IllegalArgumentException e)... |
jcodec/jcodec | src/main/java/net/sourceforge/jaad/aac/SampleBuffer.java | SampleBuffer.setBigEndian | public void setBigEndian(boolean bigEndian) {
if(bigEndian!=this.bigEndian) {
byte tmp;
for(int i = 0; i<data.length; i += 2) {
tmp = data[i];
data[i] = data[i+1];
data[i+1] = tmp;
}
this.bigEndian = bigEndian;
}
} | java | public void setBigEndian(boolean bigEndian) {
if(bigEndian!=this.bigEndian) {
byte tmp;
for(int i = 0; i<data.length; i += 2) {
tmp = data[i];
data[i] = data[i+1];
data[i+1] = tmp;
}
this.bigEndian = bigEndian;
}
} | [
"public",
"void",
"setBigEndian",
"(",
"boolean",
"bigEndian",
")",
"{",
"if",
"(",
"bigEndian",
"!=",
"this",
".",
"bigEndian",
")",
"{",
"byte",
"tmp",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"+=",
... | Sets the endianness for the data.
@param bigEndian if true the data will be in big endian, else in little
endian | [
"Sets",
"the",
"endianness",
"for",
"the",
"data",
"."
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/SampleBuffer.java#L101-L111 | test | Sets the bigEndian flag. | Of course, here is the Java code you requested:
```java
public void setBigEndian(boolean bigEndian) {
if(bigEndian!=this.bigEndian) {
byte tmp;
for(int i = 0; i<data.length; i += 2) {
tmp = data[i];
data[i] = data[i+1];
data[i+1] = tmp;
}
this.bigEndian = bigEndian;
}
}
```
Hope this help... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.status | public static Result status(int status, Content content, String charset) {
if (content == null) {
throw new NullPointerException("Null content");
}
return new Result(status, HttpEntity.fromContent(content, charset));
} | java | public static Result status(int status, Content content, String charset) {
if (content == null) {
throw new NullPointerException("Null content");
}
return new Result(status, HttpEntity.fromContent(content, charset));
} | [
"public",
"static",
"Result",
"status",
"(",
"int",
"status",
",",
"Content",
"content",
",",
"String",
"charset",
")",
"{",
"if",
"(",
"content",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Null content\"",
")",
";",
"}",
"retu... | Generates a simple result.
@param status the HTTP status for this result e.g. 200 (OK), 404 (NOT_FOUND)
@param content the result's body content
@param charset the charset to encode the content with (e.g. "UTF-8")
@return the result | [
"Generates",
"a",
"simple",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L58-L63 | test | Create a new Result instance with a status code and content. | Of course, here is the Java code you requested:
```java
public static Result status(int status, Content content, String charset) {
if (content == null) {
throw new NullPointerException("Null content");
}
return new Result(status, HttpEntity.fromContent(content, charset));
}
```
Hope this helps! |
oblac/jodd | jodd-lagarto/src/main/java/jodd/lagarto/ParsedTag.java | ParsedTag.nameEquals | @Override
public boolean nameEquals(final CharSequence charSequence) {
return caseSensitive ? CharSequenceUtil.equals(name, charSequence) : CharSequenceUtil.equalsIgnoreCase(name, charSequence);
} | java | @Override
public boolean nameEquals(final CharSequence charSequence) {
return caseSensitive ? CharSequenceUtil.equals(name, charSequence) : CharSequenceUtil.equalsIgnoreCase(name, charSequence);
} | [
"@",
"Override",
"public",
"boolean",
"nameEquals",
"(",
"final",
"CharSequence",
"charSequence",
")",
"{",
"return",
"caseSensitive",
"?",
"CharSequenceUtil",
".",
"equals",
"(",
"name",
",",
"charSequence",
")",
":",
"CharSequenceUtil",
".",
"equalsIgnoreCase",
... | ---------------------------------------------------------------- match | [
"----------------------------------------------------------------",
"match"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/ParsedTag.java#L308-L311 | test | Checks if the name equals the specified char sequence. | Of course, here is the Java code you requested:
```java
@Override
public boolean nameEquals(final CharSequence charSequence) {
return caseSensitive ? CharSequenceUtil.equals(name, charSequence) : CharSequenceUtil.equalsIgnoreCase(name, charSequence);
}
```
Hope this helps! |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/SubPropertyExplorer.java | SubPropertyExplorer.getSubProperties | static Set<IndexedObjectProperty> getSubProperties(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, inferenceProducer, dispatcher)
.getSubProperties();
} | java | static Set<IndexedObjectProperty> getSubProperties(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, inferenceProducer, dispatcher)
.getSubProperties();
} | [
"static",
"Set",
"<",
"IndexedObjectProperty",
">",
"getSubProperties",
"(",
"IndexedPropertyChain",
"input",
",",
"Producer",
"<",
"?",
"super",
"SubPropertyChainInference",
">",
"inferenceProducer",
",",
"final",
"PropertyHierarchyCompositionState",
".",
"Dispatcher",
"... | Computes all sub-{@link IndexedObjectProperty}s of the given
{@link IndexedPropertyChain}, if not computing before, recording all
{@link ObjectPropertyInference}s using the provided {@link Producer}. It
is ensured that all {@link ObjectPropertyInference}s are applied only
once even if the method is called multiple time... | [
"Computes",
"all",
"sub",
"-",
"{",
"@link",
"IndexedObjectProperty",
"}",
"s",
"of",
"the",
"given",
"{",
"@link",
"IndexedPropertyChain",
"}",
"if",
"not",
"computing",
"before",
"recording",
"all",
"{",
"@link",
"ObjectPropertyInference",
"}",
"s",
"using",
... | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/SubPropertyExplorer.java#L220-L226 | test | Returns the sub - properties of the given chain. | Of course, here is the Java code you requested:
```java
static Set<IndexedObjectProperty> getSubProperties(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, inference... |
oblac/jodd | jodd-petite/src/main/java/jodd/petite/PetiteContainer.java | PetiteContainer.addBean | public void addBean(final String name, final Object bean, WiringMode wiringMode) {
wiringMode = petiteConfig.resolveWiringMode(wiringMode);
registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
BeanDefinition def = lookupExistingBeanDefinition(name);
registerBeanAndWireAndInj... | java | public void addBean(final String name, final Object bean, WiringMode wiringMode) {
wiringMode = petiteConfig.resolveWiringMode(wiringMode);
registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
BeanDefinition def = lookupExistingBeanDefinition(name);
registerBeanAndWireAndInj... | [
"public",
"void",
"addBean",
"(",
"final",
"String",
"name",
",",
"final",
"Object",
"bean",
",",
"WiringMode",
"wiringMode",
")",
"{",
"wiringMode",
"=",
"petiteConfig",
".",
"resolveWiringMode",
"(",
"wiringMode",
")",
";",
"registerPetiteBean",
"(",
"bean",
... | Adds object instance to the container as singleton bean. | [
"Adds",
"object",
"instance",
"to",
"the",
"container",
"as",
"singleton",
"bean",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/PetiteContainer.java#L347-L352 | test | Add a bean to the container. | Of course, here is the Java code you requested:
```java
public void addBean(final String name, final Object bean, WiringMode wiringMode) {
wiringMode = petiteConfig.resolveWiringMode(wiringMode);
registerPetiteBean(bean.getClass(), name, SingletonScope.class, wiringMode, false, null);
BeanDefinition def = lookup... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/scope/RequestScope.java | RequestScope.outject | @Override
public void outject(final ActionRequest actionRequest, final Targets targets) {
final HttpServletRequest servletRequest = actionRequest.getHttpServletRequest();
targets.forEachTargetAndOut(this, (target, out) -> {
final Object value = target.readValue(out);
servletRequest.setAttribute(out.name(), ... | java | @Override
public void outject(final ActionRequest actionRequest, final Targets targets) {
final HttpServletRequest servletRequest = actionRequest.getHttpServletRequest();
targets.forEachTargetAndOut(this, (target, out) -> {
final Object value = target.readValue(out);
servletRequest.setAttribute(out.name(), ... | [
"@",
"Override",
"public",
"void",
"outject",
"(",
"final",
"ActionRequest",
"actionRequest",
",",
"final",
"Targets",
"targets",
")",
"{",
"final",
"HttpServletRequest",
"servletRequest",
"=",
"actionRequest",
".",
"getHttpServletRequest",
"(",
")",
";",
"targets",... | ---------------------------------------------------------------- outject | [
"----------------------------------------------------------------",
"outject"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/scope/RequestScope.java#L181-L189 | test | Outject. | Of course, here is the Java code you requested:
```java
@Override
public void outject(final ActionRequest actionRequest, final Targets targets) {
final HttpServletRequest servletRequest = actionRequest.getHttpServletRequest();
targets.forEachTargetAndOut(this, (target, out) -> {
final Object value = target.re... |
algolia/algoliasearch-client-android | algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java | OfflineClient.parseSearchResults | static protected JSONObject parseSearchResults(Response searchResults) throws AlgoliaException {
try {
if (searchResults.getStatusCode() == 200) {
if (searchResults.getData() != null) {
String jsonString = new String(searchResults.getData(), "UTF-8");
... | java | static protected JSONObject parseSearchResults(Response searchResults) throws AlgoliaException {
try {
if (searchResults.getStatusCode() == 200) {
if (searchResults.getData() != null) {
String jsonString = new String(searchResults.getData(), "UTF-8");
... | [
"static",
"protected",
"JSONObject",
"parseSearchResults",
"(",
"Response",
"searchResults",
")",
"throws",
"AlgoliaException",
"{",
"try",
"{",
"if",
"(",
"searchResults",
".",
"getStatusCode",
"(",
")",
"==",
"200",
")",
"{",
"if",
"(",
"searchResults",
".",
... | ---------------------------------------------------------------------- | [
"----------------------------------------------------------------------"
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/OfflineClient.java#L427-L444 | test | Parses the response and returns a JSONObject with the results. | Of course, here is the Java code you requested:
```java
static protected JSONObject parseSearchResults(Response searchResults) throws AlgoliaException {
try {
if (searchResults.getStatusCode() == 200) {
if (searchResults.getData() != null) {
String jsonString = n... |
wildfly/wildfly | naming/src/main/java/org/jboss/as/naming/NamingEventCoordinator.java | NamingEventCoordinator.fireEvent | void fireEvent(final EventContext context, final Name name, final Binding existingBinding, final Binding newBinding, int type, final String changeInfo, final Integer... scopes) {
final String target = name.toString();
final Set<Integer> scopeSet = new HashSet<Integer>(Arrays.asList(scopes));
fin... | java | void fireEvent(final EventContext context, final Name name, final Binding existingBinding, final Binding newBinding, int type, final String changeInfo, final Integer... scopes) {
final String target = name.toString();
final Set<Integer> scopeSet = new HashSet<Integer>(Arrays.asList(scopes));
fin... | [
"void",
"fireEvent",
"(",
"final",
"EventContext",
"context",
",",
"final",
"Name",
"name",
",",
"final",
"Binding",
"existingBinding",
",",
"final",
"Binding",
"newBinding",
",",
"int",
"type",
",",
"final",
"String",
"changeInfo",
",",
"final",
"Integer",
".... | Fire a naming event. An event will be created with the provided information and sent to each listener that matches
the target and scope information.
@param context The event context generating the event.
@param name The target name the event represents
@param existingBinding The existing binding at the provided name
... | [
"Fire",
"a",
"naming",
"event",
".",
"An",
"event",
"will",
"be",
"created",
"with",
"the",
"provided",
"information",
"and",
"sent",
"to",
"each",
"listener",
"that",
"matches",
"the",
"target",
"and",
"scope",
"information",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/NamingEventCoordinator.java#L141-L185 | test | Fire an event. | Of course, here is the Java code you requested:
```java
void fireEvent(final EventContext context, final Name name, final Binding existingBinding, final Binding newBinding, int type, final String changeInfo, final Integer... scopes) {
final String target = name.toString();
final Set<Integer> scopeSet =... |
Unidata/thredds | opendap/src/main/java/opendap/dap/parsers/Dap2Lex.java | Dap2Lex.yylex | public int
yylex()
throws ParseException
{
int token;
int c;
token = 0;
yytext.setLength(0);
text.mark();
try {
token = -1;
while (token < 0 && (c = text.read()) > 0) {
if (c == '\n') {
lineno++;
} else if (c <= ' ' || c == '\177'... | java | public int
yylex()
throws ParseException
{
int token;
int c;
token = 0;
yytext.setLength(0);
text.mark();
try {
token = -1;
while (token < 0 && (c = text.read()) > 0) {
if (c == '\n') {
lineno++;
} else if (c <= ' ' || c == '\177'... | [
"public",
"int",
"yylex",
"(",
")",
"throws",
"ParseException",
"{",
"int",
"token",
";",
"int",
"c",
";",
"token",
"=",
"0",
";",
"yytext",
".",
"setLength",
"(",
"0",
")",
";",
"text",
".",
"mark",
"(",
")",
";",
"try",
"{",
"token",
"=",
"-",
... | Entry point for the scanner. Returns the token identifier corresponding
to the next token and prepares to return the semantic value
of the token.
@return the token identifier corresponding to the next token.
This is part of the Lexer interface | [
"Entry",
"point",
"for",
"the",
"scanner",
".",
"Returns",
"the",
"token",
"identifier",
"corresponding",
"to",
"the",
"next",
"token",
"and",
"prepares",
"to",
"return",
"the",
"semantic",
"value",
"of",
"the",
"token",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/parsers/Dap2Lex.java#L271-L406 | test | read a single token from the text. | Of course, here is the Java code you requested:
```java
public int
yylex()
throws ParseException
{
int token;
int c;
token = 0;
yytext.setLength(0);
text.mark();
try {
token = -1;
while (token < 0 && (c = text.read()) > 0) {
if (c == '\n') {
... |
pierre/goodwill-access | src/main/java/com/ning/metrics/goodwill/access/GoodwillAccessor.java | GoodwillAccessor.getSchema | public Future<GoodwillSchema> getSchema(final String schemaName)
{
try {
return client.prepareGet(String.format("%s/%s", url, schemaName)).addHeader("Accept", "application/json").execute(new AsyncCompletionHandler<GoodwillSchema>()
{
@Override
public G... | java | public Future<GoodwillSchema> getSchema(final String schemaName)
{
try {
return client.prepareGet(String.format("%s/%s", url, schemaName)).addHeader("Accept", "application/json").execute(new AsyncCompletionHandler<GoodwillSchema>()
{
@Override
public G... | [
"public",
"Future",
"<",
"GoodwillSchema",
">",
"getSchema",
"(",
"final",
"String",
"schemaName",
")",
"{",
"try",
"{",
"return",
"client",
".",
"prepareGet",
"(",
"String",
".",
"format",
"(",
"\"%s/%s\"",
",",
"url",
",",
"schemaName",
")",
")",
".",
... | Get the Goodwill schema associated to a schema name.
</p>
Typical invocation:
<pre>
try {
GoodwillSchema type = accessor.getSchema("test").get();
...
}
catch (Exception e) {
// Connection exception? Goodwill server down?
}
</pre>
@param schemaName schema name to lookup
@return a future on the Schema | [
"Get",
"the",
"Goodwill",
"schema",
"associated",
"to",
"a",
"schema",
"name",
".",
"<",
"/",
"p",
">",
"Typical",
"invocation",
":",
"<pre",
">",
"try",
"{",
"GoodwillSchema",
"type",
"=",
"accessor",
".",
"getSchema",
"(",
"test",
")",
".",
"get",
"(... | 2a9741a106599b417eb280404ed39bdfa046caef | https://github.com/pierre/goodwill-access/blob/2a9741a106599b417eb280404ed39bdfa046caef/src/main/java/com/ning/metrics/goodwill/access/GoodwillAccessor.java#L61-L93 | test | Gets a schema from the server. | Of course, here is the Java code you requested:
```java
public Future<GoodwillSchema> getSchema(final String schemaName)
{
try {
return client.prepareGet(String.format("%s/%s", url, schemaName)).addHeader("Accept", "application/json").execute(new AsyncCompletionHandler<GoodwillSchema>()
... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/wan/GetEntriesChecksumFunction.java | GetEntriesChecksumFunction.execute | @Override
public void execute(FunctionContext<Object> functionContext)
{
try
{
String[] args = (String[])functionContext.getArguments();
if(args == null || args.length == 0)
throw new IllegalArgumentException("region argument required");
String regionName = args[0];
if(regionName == null |... | java | @Override
public void execute(FunctionContext<Object> functionContext)
{
try
{
String[] args = (String[])functionContext.getArguments();
if(args == null || args.length == 0)
throw new IllegalArgumentException("region argument required");
String regionName = args[0];
if(regionName == null |... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"FunctionContext",
"<",
"Object",
">",
"functionContext",
")",
"{",
"try",
"{",
"String",
"[",
"]",
"args",
"=",
"(",
"String",
"[",
"]",
")",
"functionContext",
".",
"getArguments",
"(",
")",
";",
"if",... | This function gets HashMap key=Serializable value=BigInteger
@param functionContext contains an argument String[] where the first contains the regionName | [
"This",
"function",
"gets",
"HashMap",
"key",
"=",
"Serializable",
"value",
"=",
"BigInteger"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/wan/GetEntriesChecksumFunction.java#L45-L72 | test | Execute the function. | Of course, here is the Java code you requested:
```java
@Override
public void execute(FunctionContext<Object> functionContext)
{
try
{
String[] args = (String[])functionContext.getArguments();
if(args == null || args.length == 0)
throw new IllegalArgumentException("region argument required");
St... |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/builder/ResponseSpecBuilder.java | ResponseSpecBuilder.rootPath | public ResponseSpecBuilder rootPath(String rootPath, List<Argument> arguments) {
spec.root(rootPath, arguments);
return this;
} | java | public ResponseSpecBuilder rootPath(String rootPath, List<Argument> arguments) {
spec.root(rootPath, arguments);
return this;
} | [
"public",
"ResponseSpecBuilder",
"rootPath",
"(",
"String",
"rootPath",
",",
"List",
"<",
"Argument",
">",
"arguments",
")",
"{",
"spec",
".",
"root",
"(",
"rootPath",
",",
"arguments",
")",
";",
"return",
"this",
";",
"}"
] | Set the root path of the response body so that you don't need to write the entire path for each expectation. The same as {@link #rootPath(String)}
but also provides a way to defined arguments.
@param rootPath The root path to use.
@param arguments The arguments.
@see ResponseSpecification#root(String, java.util.List) | [
"Set",
"the",
"root",
"path",
"of",
"the",
"response",
"body",
"so",
"that",
"you",
"don",
"t",
"need",
"to",
"write",
"the",
"entire",
"path",
"for",
"each",
"expectation",
".",
"The",
"same",
"as",
"{",
"@link",
"#rootPath",
"(",
"String",
")",
"}",
... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/builder/ResponseSpecBuilder.java#L321-L324 | test | Sets the root path. | Of course, here is the Java code you requested:
```java
public ResponseSpecBuilder rootPath(String rootPath, List<Argument> arguments) {
spec.root(rootPath, arguments);
return this;
}
```
Hope this helps! |
streamsets/datacollector | crypto-lib/src/main/java/com/streamsets/pipeline/stage/processor/crypto/FieldEncrypter.java | FieldEncrypter.checkInputDecrypt | public Optional<Field> checkInputDecrypt(Record record, Field field) {
if (field.getType() != Field.Type.BYTE_ARRAY) {
getContext().toError(record, CRYPTO_02, field.getType());
return Optional.empty();
}
return Optional.of(field);
} | java | public Optional<Field> checkInputDecrypt(Record record, Field field) {
if (field.getType() != Field.Type.BYTE_ARRAY) {
getContext().toError(record, CRYPTO_02, field.getType());
return Optional.empty();
}
return Optional.of(field);
} | [
"public",
"Optional",
"<",
"Field",
">",
"checkInputDecrypt",
"(",
"Record",
"record",
",",
"Field",
"field",
")",
"{",
"if",
"(",
"field",
".",
"getType",
"(",
")",
"!=",
"Field",
".",
"Type",
".",
"BYTE_ARRAY",
")",
"{",
"getContext",
"(",
")",
".",
... | Checks that the decryption input is a valid type, otherwise sends the
record to error.
@param record {@link Record}
@param field {@link Field}
@return empty {@link Optional} if the record was sent to error | [
"Checks",
"that",
"the",
"decryption",
"input",
"is",
"a",
"valid",
"type",
"otherwise",
"sends",
"the",
"record",
"to",
"error",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/crypto-lib/src/main/java/com/streamsets/pipeline/stage/processor/crypto/FieldEncrypter.java#L225-L231 | test | checkInputDecrypt Method. | Of course, here is the Java code you requested:
```java
public Optional<Field> checkInputDecrypt(Record record, Field field) {
if (field.getType() != Field.Type.BYTE_ARRAY) {
getContext().toError(record, CRYPTO_02, field.getType());
return Optional.empty();
}
return Optional.of(field);
}
```
... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxettaWrapperClassBuilder.java | ProxettaWrapperClassBuilder.createEmptyCtor | protected void createEmptyCtor() {
final MethodVisitor mv = wd.dest.visitMethod(AsmUtil.ACC_PUBLIC, INIT, "()V", null, null);
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitMethodInsn(
Opcodes.INVOKESPECIAL,
AsmUtil.SIGNATURE_JAVA_LANG_OBJECT,
INIT, "()V",
false);
mv.visitInsn(Opcodes.... | java | protected void createEmptyCtor() {
final MethodVisitor mv = wd.dest.visitMethod(AsmUtil.ACC_PUBLIC, INIT, "()V", null, null);
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitMethodInsn(
Opcodes.INVOKESPECIAL,
AsmUtil.SIGNATURE_JAVA_LANG_OBJECT,
INIT, "()V",
false);
mv.visitInsn(Opcodes.... | [
"protected",
"void",
"createEmptyCtor",
"(",
")",
"{",
"final",
"MethodVisitor",
"mv",
"=",
"wd",
".",
"dest",
".",
"visitMethod",
"(",
"AsmUtil",
".",
"ACC_PUBLIC",
",",
"INIT",
",",
"\"()V\"",
",",
"null",
",",
"null",
")",
";",
"mv",
".",
"visitCode",... | Created empty default constructor. | [
"Created",
"empty",
"default",
"constructor",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/ProxettaWrapperClassBuilder.java#L142-L154 | test | Create empty constructor. | Of course, here is the Java code you requested:
```java
protected void createEmptyCtor() {
final MethodVisitor mv = wd.dest.visitMethod(AsmUtil.ACC_PUBLIC, INIT, "()V", null, null);
mv.visitCode();
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitMethodInsn(
Opcodes.INVOKESPECIAL,
AsmUtil.SIGNATURE_JAVA_LANG_O... |
rupertlssmith/lojix | lojix/prolog/src/main/com/thesett/aima/logic/fol/prolog/StackVariable.java | StackVariable.isBound | public boolean isBound()
{
VariableBindingContext<Variable> context = getBindingContext();
// The variable can only be bound if it has a binding context and is bound in that context.
return (context != null) && context.getStorageCell(this).isBound();
} | java | public boolean isBound()
{
VariableBindingContext<Variable> context = getBindingContext();
// The variable can only be bound if it has a binding context and is bound in that context.
return (context != null) && context.getStorageCell(this).isBound();
} | [
"public",
"boolean",
"isBound",
"(",
")",
"{",
"VariableBindingContext",
"<",
"Variable",
">",
"context",
"=",
"getBindingContext",
"(",
")",
";",
"// The variable can only be bound if it has a binding context and is bound in that context.",
"return",
"(",
"context",
"!=",
... | Reports whether or not this variable is bound to a value.
@return <tt>true</tt> if this variable has been assigned a value, <tt>false</tt> otherwise. | [
"Reports",
"whether",
"or",
"not",
"this",
"variable",
"is",
"bound",
"to",
"a",
"value",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/prolog/src/main/com/thesett/aima/logic/fol/prolog/StackVariable.java#L158-L164 | test | Returns true if the variable is bound in the context of the CID language. | Of course, here is the Java code you requested:
```java
public boolean isBound()
{
VariableBindingContext<Variable> context = getBindingContext();
// The variable can only be bound if it has a binding context and is bound in that context.
return (context != null) && context.getStorageCell(... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientGraphQuery.java | OrientGraphQuery.order | public Query order(final String props, final String dir) {
this.orderBy = props;
this.orderByDir = dir;
return this;
} | java | public Query order(final String props, final String dir) {
this.orderBy = props;
this.orderByDir = dir;
return this;
} | [
"public",
"Query",
"order",
"(",
"final",
"String",
"props",
",",
"final",
"String",
"dir",
")",
"{",
"this",
".",
"orderBy",
"=",
"props",
";",
"this",
".",
"orderByDir",
"=",
"dir",
";",
"return",
"this",
";",
"}"
] | (Blueprints Extension) Sets the order of results by a field in ascending (asc) or descending (desc) order based on dir
parameter. This is translated on ORDER BY in the underlying SQL query.
@param props Field to order by
@param dir Direction. Use "asc" for ascending and "desc" for descending
@return Current Query O... | [
"(",
"Blueprints",
"Extension",
")",
"Sets",
"the",
"order",
"of",
"results",
"by",
"a",
"field",
"in",
"ascending",
"(",
"asc",
")",
"or",
"descending",
"(",
"desc",
")",
"order",
"based",
"on",
"dir",
"parameter",
".",
"This",
"is",
"translated",
"on",... | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientGraphQuery.java#L138-L142 | test | Sets the order by properties and direction. | Of course, here is the Java code you requested:
```java
public Query order(final String props, final String dir) {
this.orderBy = props;
this.orderByDir = dir;
return this;
}
```
Hope this helps! |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/dmr/DapGroup.java | DapGroup.updateGroups | void
updateGroups(List<DapGroup> groups)
{
// Verify that the incoming groups are all and only in the list of groups.
assert (groups.size() == this.groups.size()) : "Update groups: not same size";
for(DapGroup g : groups) {
if(!this.groups.contains(g))
assert ... | java | void
updateGroups(List<DapGroup> groups)
{
// Verify that the incoming groups are all and only in the list of groups.
assert (groups.size() == this.groups.size()) : "Update groups: not same size";
for(DapGroup g : groups) {
if(!this.groups.contains(g))
assert ... | [
"void",
"updateGroups",
"(",
"List",
"<",
"DapGroup",
">",
"groups",
")",
"{",
"// Verify that the incoming groups are all and only in the list of groups.",
"assert",
"(",
"groups",
".",
"size",
"(",
")",
"==",
"this",
".",
"groups",
".",
"size",
"(",
")",
")",
... | We will need to re-order the groups | [
"We",
"will",
"need",
"to",
"re",
"-",
"order",
"the",
"groups"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/dmr/DapGroup.java#L140-L149 | test | Update the groups list. | Of course, here is the Java code you requested:
```java
void
updateGroups(List<DapGroup> groups)
{
// Verify that the incoming groups are all and only in the list of groups.
assert (groups.size() == this.groups.size()) : "Update groups: not same size";
for(DapGroup g : groups) {
... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/http/HttpConn.java | HttpConn.send | public static String send(String target, RequestMethod method) throws IOException {
return send(target, "", method);
} | java | public static String send(String target, RequestMethod method) throws IOException {
return send(target, "", method);
} | [
"public",
"static",
"String",
"send",
"(",
"String",
"target",
",",
"RequestMethod",
"method",
")",
"throws",
"IOException",
"{",
"return",
"send",
"(",
"target",
",",
"\"\"",
",",
"method",
")",
";",
"}"
] | Send a http request with explicit params
@param target target address
@param method {@link com.rockagen.commons.http.RequestMethod}
@return result String
@throws IOException if an I/O error occurs | [
"Send",
"a",
"http",
"request",
"with",
"explicit",
"params"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/http/HttpConn.java#L105-L107 | test | Send a request to a URL using the specified HTTP method. | Of course, here is the Java code you requested:
```java
public static String send(String target, RequestMethod method) throws IOException {
return send(target, "", method);
}
```
Hope this helps! |
streamsets/datacollector | hive-protolib/src/main/java/com/streamsets/pipeline/stage/processor/hive/HiveMetadataProcessor.java | HiveMetadataProcessor.updateRecordForHDFS | @VisibleForTesting
static void updateRecordForHDFS(
Record record,
boolean roll,
String avroSchema,
String location
){
if(roll){
record.getHeader().setAttribute(HDFS_HEADER_ROLL, "true");
}
record.getHeader().setAttribute(HDFS_HEADER_AVROSCHEMA, avroSchema);
record.getH... | java | @VisibleForTesting
static void updateRecordForHDFS(
Record record,
boolean roll,
String avroSchema,
String location
){
if(roll){
record.getHeader().setAttribute(HDFS_HEADER_ROLL, "true");
}
record.getHeader().setAttribute(HDFS_HEADER_AVROSCHEMA, avroSchema);
record.getH... | [
"@",
"VisibleForTesting",
"static",
"void",
"updateRecordForHDFS",
"(",
"Record",
"record",
",",
"boolean",
"roll",
",",
"String",
"avroSchema",
",",
"String",
"location",
")",
"{",
"if",
"(",
"roll",
")",
"{",
"record",
".",
"getHeader",
"(",
")",
".",
"s... | Add header information to send to HDFS | [
"Add",
"header",
"information",
"to",
"send",
"to",
"HDFS"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/hive-protolib/src/main/java/com/streamsets/pipeline/stage/processor/hive/HiveMetadataProcessor.java#L791-L804 | test | Update the record for HDFS. | Of course, here is the Java code you requested:
```java
@VisibleForTesting
static void updateRecordForHDFS(
Record record,
boolean roll,
String avroSchema,
String location
){
if(roll){
record.getHeader().setAttribute(HDFS_HEADER_ROLL, "true");
}
record.getHeader().setAttri... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/CoordSysBuilder.java | CoordSysBuilder.buildCoordinateSystems | @Override
public void buildCoordinateSystems(NetcdfDataset ncDataset) {
// put status info into parseInfo that can be shown to someone trying to debug this process
parseInfo.format("Parsing with Convention = %s%n", conventionName);
// Bookkeeping info for each variable is kept in the VarProcess inne... | java | @Override
public void buildCoordinateSystems(NetcdfDataset ncDataset) {
// put status info into parseInfo that can be shown to someone trying to debug this process
parseInfo.format("Parsing with Convention = %s%n", conventionName);
// Bookkeeping info for each variable is kept in the VarProcess inne... | [
"@",
"Override",
"public",
"void",
"buildCoordinateSystems",
"(",
"NetcdfDataset",
"ncDataset",
")",
"{",
"// put status info into parseInfo that can be shown to someone trying to debug this process\r",
"parseInfo",
".",
"format",
"(",
"\"Parsing with Convention = %s%n\"",
",",
"co... | Heres where the work is to identify coordinate axes and coordinate systems.
@param ncDataset modify this dataset | [
"Heres",
"where",
"the",
"work",
"is",
"to",
"identify",
"coordinate",
"axes",
"and",
"coordinate",
"systems",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/CoordSysBuilder.java#L518-L554 | test | Build the coordinate systems for the given dataset | Of course, here is the Java code you requested:
```java
@Override
public void buildCoordinateSystems(NetcdfDataset ncDataset) {
// put status info into parseInfo that can be shown to someone trying to debug this process
parseInfo.format("Parsing with Convention = %s%n", conventionName);
// Bookkeep... |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/coders/FSTMinBinEncoder.java | FSTMinBinEncoder.writePrimitiveArray | @Override
public void writePrimitiveArray(Object array, int start, int length) throws IOException {
out.writeArray(array, start, length);
} | java | @Override
public void writePrimitiveArray(Object array, int start, int length) throws IOException {
out.writeArray(array, start, length);
} | [
"@",
"Override",
"public",
"void",
"writePrimitiveArray",
"(",
"Object",
"array",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeArray",
"(",
"array",
",",
"start",
",",
"length",
")",
";",
"}"
] | does not write class tag and length
@param array
@param start
@param length @throws java.io.IOException | [
"does",
"not",
"write",
"class",
"tag",
"and",
"length"
] | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/coders/FSTMinBinEncoder.java#L59-L62 | test | Write a array of primitives. | Of course, here is the Java code you requested:
```java
@Override
public void writePrimitiveArray(Object array, int start, int length) throws IOException {
out.writeArray(array, start, length);
}
```
Hope this helps! |
spring-projects/spring-security | samples/xml/openid/src/main/java/org/springframework/security/samples/openid/CustomUserDetailsService.java | CustomUserDetailsService.loadUserDetails | public UserDetails loadUserDetails(OpenIDAuthenticationToken token) {
String id = token.getIdentityUrl();
CustomUserDetails user = registeredUsers.get(id);
if (user != null) {
return user;
}
String email = null;
String firstName = null;
String lastName = null;
String fullName = null;
List<OpenI... | java | public UserDetails loadUserDetails(OpenIDAuthenticationToken token) {
String id = token.getIdentityUrl();
CustomUserDetails user = registeredUsers.get(id);
if (user != null) {
return user;
}
String email = null;
String firstName = null;
String lastName = null;
String fullName = null;
List<OpenI... | [
"public",
"UserDetails",
"loadUserDetails",
"(",
"OpenIDAuthenticationToken",
"token",
")",
"{",
"String",
"id",
"=",
"token",
".",
"getIdentityUrl",
"(",
")",
";",
"CustomUserDetails",
"user",
"=",
"registeredUsers",
".",
"get",
"(",
"id",
")",
";",
"if",
"("... | Implementation of {@code AuthenticationUserDetailsService} which allows full access
to the submitted {@code Authentication} object. Used by the
OpenIDAuthenticationProvider. | [
"Implementation",
"of",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/samples/xml/openid/src/main/java/org/springframework/security/samples/openid/CustomUserDetailsService.java#L65-L124 | test | Load the user details for the given token. | Of course, here is the Java code you requested:
```java
public UserDetails loadUserDetails(OpenIDAuthenticationToken token) {
String id = token.getIdentityUrl();
CustomUserDetails user = registeredUsers.get(id);
if (user != null) {
return user;
}
String email = null;
String firstName = null;
String... |
Unidata/thredds | opendap/src/main/java/opendap/dap/DGrid.java | DGrid.addVariable | public void addVariable(BaseType v, int part) {
if (!(v instanceof DArray)) throw new IllegalArgumentException(
"Grid `" + getEncodedName() +
"'s' member `" + arrayVar.getEncodedName() +
"' must be an array");
v.setParent(this);
... | java | public void addVariable(BaseType v, int part) {
if (!(v instanceof DArray)) throw new IllegalArgumentException(
"Grid `" + getEncodedName() +
"'s' member `" + arrayVar.getEncodedName() +
"' must be an array");
v.setParent(this);
... | [
"public",
"void",
"addVariable",
"(",
"BaseType",
"v",
",",
"int",
"part",
")",
"{",
"if",
"(",
"!",
"(",
"v",
"instanceof",
"DArray",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Grid `\"",
"+",
"getEncodedName",
"(",
")",
"+",
"\"'s' mem... | Adds a variable to the container.
@param v the variable to add.
@param part the part of the <code>DGrid</code> to be modified. Allowed
values are <code>ARRAY</code> or <code>MAPS</code>.
@throws IllegalArgumentException if an invalid part was given. | [
"Adds",
"a",
"variable",
"to",
"the",
"container",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DGrid.java#L174-L196 | test | Adds the specified variable to the variable list. | Of course, here is the Java code you requested:
```java
public void addVariable(BaseType v, int part) {
if (!(v instanceof DArray)) throw new IllegalArgumentException(
"Grid `" + getEncodedName() +
"'s' member `" + arrayVar.getEncodedName() +
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createTeekueche | @XmlElementDecl(namespace = "", name = "teekueche")
public JAXBElement<Boolean> createTeekueche(Boolean value) {
return new JAXBElement<Boolean>(_Teekueche_QNAME, Boolean.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "teekueche")
public JAXBElement<Boolean> createTeekueche(Boolean value) {
return new JAXBElement<Boolean>(_Teekueche_QNAME, Boolean.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"teekueche\"",
")",
"public",
"JAXBElement",
"<",
"Boolean",
">",
"createTeekueche",
"(",
"Boolean",
"value",
")",
"{",
"return",
"new",
"JAXBElement",
"<",
"Boolean",
">",
"(",
"_Teek... | Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Boolean",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2832-L2835 | test | Create an instance of the Teekueche JAXBElement. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "teekueche")
public JAXBElement<Boolean> createTeekueche(Boolean value) {
return new JAXBElement<Boolean>(_Teekueche_QNAME, Boolean.class, null, value);
}
```
Hope this helps! |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/RestAssured.java | RestAssured.form | public static AuthenticationScheme form(String userName, String password, FormAuthConfig config) {
if (userName == null) {
throw new IllegalArgumentException("Username cannot be null");
}
if (password == null) {
throw new IllegalArgumentException("Password cannot be null"... | java | public static AuthenticationScheme form(String userName, String password, FormAuthConfig config) {
if (userName == null) {
throw new IllegalArgumentException("Username cannot be null");
}
if (password == null) {
throw new IllegalArgumentException("Password cannot be null"... | [
"public",
"static",
"AuthenticationScheme",
"form",
"(",
"String",
"userName",
",",
"String",
"password",
",",
"FormAuthConfig",
"config",
")",
"{",
"if",
"(",
"userName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Username cannot ... | Use form authentication with the supplied configuration.
@param userName The user name.
@param password The password.
@param config The form authentication config
@return The authentication scheme | [
"Use",
"form",
"authentication",
"with",
"the",
"supplied",
"configuration",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1227-L1239 | test | Create a form authentication scheme. | Of course, here is the Java code you requested:
```java
public static AuthenticationScheme form(String userName, String password, FormAuthConfig config) {
if (userName == null) {
throw new IllegalArgumentException("Username cannot be null");
}
if (password == null) {
thr... |
leanix/leanix-sdk-java | src/main/java/net/leanix/api/common/ApiClient.java | ApiClient.invokeAPI | public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
updateParamsForAuth(new String[]{"token", "apiKey"}/*authN... | java | public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
updateParamsForAuth(new String[]{"token", "apiKey"}/*authN... | [
"public",
"<",
"T",
">",
"T",
"invokeAPI",
"(",
"String",
"path",
",",
"String",
"method",
",",
"List",
"<",
"Pair",
">",
"queryParams",
",",
"Object",
"body",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headerParams",
",",
"Map",
"<",
"String",
... | Invoke API by sending HTTP request with the given options.
@param path The sub-path of the HTTP URL
@param method The request method, one of "GET", "POST", "PUT", and "DELETE"
@param queryParams The query parameters
@param body The request body object
@param headerParams The header parameters
@param formParams The for... | [
"Invoke",
"API",
"by",
"sending",
"HTTP",
"request",
"with",
"the",
"given",
"options",
"."
] | 9516ac593d6a8f73baccc516a45877b4e5920c47 | https://github.com/leanix/leanix-sdk-java/blob/9516ac593d6a8f73baccc516a45877b4e5920c47/src/main/java/net/leanix/api/common/ApiClient.java#L612-L688 | test | Invoke an API with the specified parameters and body. | Of course, here is the Java code you requested:
```java
public <T> T invokeAPI(String path, String method, List<Pair> queryParams, Object body, Map<String, String> headerParams, Map<String, Object> formParams, String accept, String contentType, String[] authNames, GenericType<T> returnType) throws ApiException {
u... |
oblac/jodd | jodd-bean/src/main/java/jodd/typeconverter/Converter.java | Converter.toByteValue | public byte toByteValue(final Object value, final byte defaultValue) {
final Byte result = toByte(value);
if (result == null) {
return defaultValue;
}
return result.byteValue();
} | java | public byte toByteValue(final Object value, final byte defaultValue) {
final Byte result = toByte(value);
if (result == null) {
return defaultValue;
}
return result.byteValue();
} | [
"public",
"byte",
"toByteValue",
"(",
"final",
"Object",
"value",
",",
"final",
"byte",
"defaultValue",
")",
"{",
"final",
"Byte",
"result",
"=",
"toByte",
"(",
"value",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";"... | Converts value to <code>byte</code>. Returns default value
when conversion result is <code>null</code>. | [
"Converts",
"value",
"to",
"<code",
">",
"byte<",
"/",
"code",
">",
".",
"Returns",
"default",
"value",
"when",
"conversion",
"result",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/Converter.java#L358-L364 | test | Converts value into byte. | Of course, here is the Java code you requested:
```java
public byte toByteValue(final Object value, final byte defaultValue) {
final Byte result = toByte(value);
if (result == null) {
return defaultValue;
}
return result.byteValue();
}
```
Hope this helps! |
orientechnologies/orientdb | object/src/main/java/com/orientechnologies/orient/object/metadata/schema/OSchemaProxyObject.java | OSchemaProxyObject.generateSchema | public synchronized void generateSchema(final Class<?> iClass, ODatabaseDocument database) {
if (iClass == null || iClass.isInterface() || iClass.isPrimitive() || iClass.isEnum() || iClass.isAnonymousClass())
return;
OObjectEntitySerializer.registerClass(iClass);
OClass schema = database.getMetadata()... | java | public synchronized void generateSchema(final Class<?> iClass, ODatabaseDocument database) {
if (iClass == null || iClass.isInterface() || iClass.isPrimitive() || iClass.isEnum() || iClass.isAnonymousClass())
return;
OObjectEntitySerializer.registerClass(iClass);
OClass schema = database.getMetadata()... | [
"public",
"synchronized",
"void",
"generateSchema",
"(",
"final",
"Class",
"<",
"?",
">",
"iClass",
",",
"ODatabaseDocument",
"database",
")",
"{",
"if",
"(",
"iClass",
"==",
"null",
"||",
"iClass",
".",
"isInterface",
"(",
")",
"||",
"iClass",
".",
"isPri... | Generate/updates the SchemaClass and properties from given Class<?>.
@param iClass :- the Class<?> to generate | [
"Generate",
"/",
"updates",
"the",
"SchemaClass",
"and",
"properties",
"from",
"given",
"Class<?",
">",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/object/src/main/java/com/orientechnologies/orient/object/metadata/schema/OSchemaProxyObject.java#L293-L378 | test | Generate the schema for the given class. | Of course, here is the Java code you requested:
```java
public synchronized void generateSchema(final Class<?> iClass, ODatabaseDocument database) {
if (iClass == null || iClass.isInterface() || iClass.isPrimitive() || iClass.isEnum() || iClass.isAnonymousClass())
return;
OObjectEntitySerializer.register... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java | CoverageData.getCoverageData | public static CoverageData<?> getCoverageData(GeoPackage geoPackage,
TileDao tileDao, Projection requestProjection) {
return getCoverageData(geoPackage, tileDao, null, null,
requestProjection);
} | java | public static CoverageData<?> getCoverageData(GeoPackage geoPackage,
TileDao tileDao, Projection requestProjection) {
return getCoverageData(geoPackage, tileDao, null, null,
requestProjection);
} | [
"public",
"static",
"CoverageData",
"<",
"?",
">",
"getCoverageData",
"(",
"GeoPackage",
"geoPackage",
",",
"TileDao",
"tileDao",
",",
"Projection",
"requestProjection",
")",
"{",
"return",
"getCoverageData",
"(",
"geoPackage",
",",
"tileDao",
",",
"null",
",",
... | Get a Tiled Gridded Coverage Data, use the coverage data pixel tile size
as the request size width and height, request as the specified projection
@param geoPackage GeoPackage
@param tileDao tile dao
@param requestProjection request projection
@return coverage data | [
"Get",
"a",
"Tiled",
"Gridded",
"Coverage",
"Data",
"use",
"the",
"coverage",
"data",
"pixel",
"tile",
"size",
"as",
"the",
"request",
"size",
"width",
"and",
"height",
"request",
"as",
"the",
"specified",
"projection"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageData.java#L106-L110 | test | Get the coverage data for a single page | Of course, here is the Java code you requested:
```java
public static CoverageData<?> getCoverageData(GeoPackage geoPackage,
TileDao tileDao, Projection requestProjection) {
return getCoverageData(geoPackage, tileDao, null, null,
requestProjecti... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_0.java | OpenImmo_1_2_0.removeAusstattungChildElements | protected void removeAusstattungChildElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dvbt | " +
"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:breitband_zugang | " +
... | java | protected void removeAusstattungChildElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dvbt | " +
"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:breitband_zugang | " +
... | [
"protected",
"void",
"removeAusstattungChildElements",
"(",
"Document",
"doc",
")",
"throws",
"JaxenException",
"{",
"List",
"nodes",
"=",
"XmlUtils",
".",
"newXPath",
"(",
"\"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dvbt | \"",
"+",
"\"/io:openimmo/io:anbieter/i... | Remove unsupported children from all <ausstattung> elements.
<p>
OpenImmo 1.1 does not support the following children for
<ausstattung> elements: <dvbt>, <breitband_zugang>,
<umts_empfang>, <abstellraum>, <fahrradraum>,
<rolladen>
<p>
These elements are removed by this fu... | [
"Remove",
"unsupported",
"children",
"from",
"all",
"<",
";",
"ausstattung>",
";",
"elements",
".",
"<p",
">",
"OpenImmo",
"1",
".",
"1",
"does",
"not",
"support",
"the",
"following",
"children",
"for",
"<",
";",
"ausstattung>",
";",
"elements",
":",... | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_0.java#L326-L340 | test | Remove ausstattung child elements. | Of course, here is the Java code you requested:
```java
protected void removeAusstattungChildElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:ausstattung/io:dvbt | " +
"/io:openimmo/io:anbieter/io:im... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/common/util/OClassLoaderHelper.java | OClassLoaderHelper.lookupProviderWithOrientClassLoader | public static synchronized <T extends Object> Iterator<T> lookupProviderWithOrientClassLoader(Class<T> clazz) {
return lookupProviderWithOrientClassLoader(clazz, OClassLoaderHelper.class.getClassLoader());
} | java | public static synchronized <T extends Object> Iterator<T> lookupProviderWithOrientClassLoader(Class<T> clazz) {
return lookupProviderWithOrientClassLoader(clazz, OClassLoaderHelper.class.getClassLoader());
} | [
"public",
"static",
"synchronized",
"<",
"T",
"extends",
"Object",
">",
"Iterator",
"<",
"T",
">",
"lookupProviderWithOrientClassLoader",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"lookupProviderWithOrientClassLoader",
"(",
"clazz",
",",
"OClassLoa... | Switch to the OrientDb classloader before lookups on ServiceRegistry for implementation of the given Class. Useful under OSGI
and generally under applications where jars are loaded by another class loader
@param clazz
the class to lookup foor
@return an Iterator on the class implementation | [
"Switch",
"to",
"the",
"OrientDb",
"classloader",
"before",
"lookups",
"on",
"ServiceRegistry",
"for",
"implementation",
"of",
"the",
"given",
"Class",
".",
"Useful",
"under",
"OSGI",
"and",
"generally",
"under",
"applications",
"where",
"jars",
"are",
"loaded",
... | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/util/OClassLoaderHelper.java#L40-L43 | test | Lookup provider with orient class loader iterator. | Of course, here is the Java code you requested:
```java
public static synchronized <T extends Object> Iterator<T> lookupProviderWithOrientClassLoader(Class<T> clazz) {
return lookupProviderWithOrientClassLoader(clazz, OClassLoaderHelper.class.getClassLoader());
}
```
Hope this helps! |
50onRed/mock-jedis | src/main/java/com/fiftyonred/mock_jedis/MockJedis.java | MockJedis.scan | @Override
public ScanResult<String> scan(String cursor, ScanParams params) {
// We need to extract the MATCH argument from the scan params
Collection<byte[]> rawParams = params.getParams();
// Raw collection is a list of byte[], made of: key1, value1, key2, value2, etc.
boolean isKey = true;
String match ... | java | @Override
public ScanResult<String> scan(String cursor, ScanParams params) {
// We need to extract the MATCH argument from the scan params
Collection<byte[]> rawParams = params.getParams();
// Raw collection is a list of byte[], made of: key1, value1, key2, value2, etc.
boolean isKey = true;
String match ... | [
"@",
"Override",
"public",
"ScanResult",
"<",
"String",
">",
"scan",
"(",
"String",
"cursor",
",",
"ScanParams",
"params",
")",
"{",
"// We need to extract the MATCH argument from the scan params",
"Collection",
"<",
"byte",
"[",
"]",
">",
"rawParams",
"=",
"params"... | In this simple proposal, we're not testing complex iterations
of scan cursor. SCAN is simply a wrapper for KEYS, and the result
is given in one single response, no matter the COUNT argument. | [
"In",
"this",
"simple",
"proposal",
"we",
"re",
"not",
"testing",
"complex",
"iterations",
"of",
"scan",
"cursor",
".",
"SCAN",
"is",
"simply",
"a",
"wrapper",
"for",
"KEYS",
"and",
"the",
"result",
"is",
"given",
"in",
"one",
"single",
"response",
"no",
... | f593d90282772c5820a576c77f28bf0cec6e3be4 | https://github.com/50onRed/mock-jedis/blob/f593d90282772c5820a576c77f28bf0cec6e3be4/src/main/java/com/fiftyonred/mock_jedis/MockJedis.java#L1335-L1365 | test | Scan the cursor. | Of course, here is the Java code you requested:
```java
@Override
public ScanResult<String> scan(String cursor, ScanParams params) {
// We need to extract the MATCH argument from the scan params
Collection<byte[]> rawParams = params.getParams();
// Raw collection is a list of byte[], made of: key1, value1, k... |
wildfly/wildfly | mail/src/main/java/org/jboss/as/mail/extension/MailSubsystemParser.java | MailSubsystemParser.readElement | public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
final PathAddress address = PathAddress.pathAddress(MailExtension.SUBSYSTEM_PATH);
list.add(Util.createAddOperation(address));
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
... | java | public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
final PathAddress address = PathAddress.pathAddress(MailExtension.SUBSYSTEM_PATH);
list.add(Util.createAddOperation(address));
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
... | [
"public",
"void",
"readElement",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"List",
"<",
"ModelNode",
">",
"list",
")",
"throws",
"XMLStreamException",
"{",
"final",
"PathAddress",
"address",
"=",
"PathAddress",
".",
"pathAddress",
"(",
"MailExtension",
".",
"... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/mail/src/main/java/org/jboss/as/mail/extension/MailSubsystemParser.java#L73-L100 | test | Read the mail_session element. | Of course, here is the Java code you requested:
```java
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
final PathAddress address = PathAddress.pathAddress(MailExtension.SUBSYSTEM_PATH);
list.add(Util.createAddOperation(address));
while... |
flow/noise | src/main/java/com/flowpowered/noise/Noise.java | Noise.intValueNoise3D | public static int intValueNoise3D(int x, int y, int z, int seed) {
// All constants are primes and must remain prime in order for this noise
// function to work correctly.
int n = (X_NOISE_GEN * x + Y_NOISE_GEN * y + Z_NOISE_GEN * z + SEED_NOISE_GEN * seed) & 0x7fffffff;
n = (n >> 13) ^ ... | java | public static int intValueNoise3D(int x, int y, int z, int seed) {
// All constants are primes and must remain prime in order for this noise
// function to work correctly.
int n = (X_NOISE_GEN * x + Y_NOISE_GEN * y + Z_NOISE_GEN * z + SEED_NOISE_GEN * seed) & 0x7fffffff;
n = (n >> 13) ^ ... | [
"public",
"static",
"int",
"intValueNoise3D",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
",",
"int",
"seed",
")",
"{",
"// All constants are primes and must remain prime in order for this noise",
"// function to work correctly.",
"int",
"n",
"=",
"(",
"X_NOISE... | Generates an integer-noise value from the coordinates of a three-dimensional input value.
@param x The integer @a x coordinate of the input value.
@param y The integer @a y coordinate of the input value.
@param z The integer @a z coordinate of the input value.
@param seed A random number seed.
@return The generated in... | [
"Generates",
"an",
"integer",
"-",
"noise",
"value",
"from",
"the",
"coordinates",
"of",
"a",
"three",
"-",
"dimensional",
"input",
"value",
"."
] | fe880dbbb09731ade59d9b4c0da6720b70f17509 | https://github.com/flow/noise/blob/fe880dbbb09731ade59d9b4c0da6720b70f17509/src/main/java/com/flowpowered/noise/Noise.java#L171-L177 | test | This function is used to compute the 3D noise value of a 2D noise set. | Of course, here is the Java code you requested:
```java
public static int intValueNoise3D(int x, int y, int z, int seed) {
// All constants are primes and must remain prime in order for this noise
// function to work correctly.
int n = (X_NOISE_GEN * x + Y_NOISE_GEN * y + Z_NOISE_GEN * z + SEED... |
Unidata/thredds | waterml/src/main/java/ucar/nc2/ogc/gml/NcTimeInstantType.java | NcTimeInstantType.initTimeInstant | public static TimeInstantType initTimeInstant(TimeInstantType timeInstant) {
// @gml:id
String id = MarshallingUtil.createIdForType(TimeInstantType.class);
timeInstant.setId(id);
// gml:timePosition
NcTimePositionType.initTimePosition(timeInstant.addNewTimePosition());
... | java | public static TimeInstantType initTimeInstant(TimeInstantType timeInstant) {
// @gml:id
String id = MarshallingUtil.createIdForType(TimeInstantType.class);
timeInstant.setId(id);
// gml:timePosition
NcTimePositionType.initTimePosition(timeInstant.addNewTimePosition());
... | [
"public",
"static",
"TimeInstantType",
"initTimeInstant",
"(",
"TimeInstantType",
"timeInstant",
")",
"{",
"// @gml:id",
"String",
"id",
"=",
"MarshallingUtil",
".",
"createIdForType",
"(",
"TimeInstantType",
".",
"class",
")",
";",
"timeInstant",
".",
"setId",
"(",... | wml2:Collection/wml2:observationMember/om:OM_Observation/om:resultTime/gml:TimeInstant | [
"wml2",
":",
"Collection",
"/",
"wml2",
":",
"observationMember",
"/",
"om",
":",
"OM_Observation",
"/",
"om",
":",
"resultTime",
"/",
"gml",
":",
"TimeInstant"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/gml/NcTimeInstantType.java#L11-L20 | test | Initialize a time instant. | Of course, here is the Java code you requested:
```java
public static TimeInstantType initTimeInstant(TimeInstantType timeInstant) {
// @gml:id
String id = MarshallingUtil.createIdForType(TimeInstantType.class);
timeInstant.setId(id);
// gml:timePosition
NcTimePositionType.init... |
RestComm/jain-slee | container/congestion/src/main/java/org/mobicents/slee/container/management/jmx/CongestionControlConfiguration.java | CongestionControlConfiguration.setMinFreeMemoryToTurnOff | public void setMinFreeMemoryToTurnOff(int minFreeMemoryToTurnOff) throws IllegalArgumentException {
if (minFreeMemoryToTurnOff < 0 || minFreeMemoryToTurnOff > 100) {
throw new IllegalArgumentException("param value must be within 0 - 100%");
}
this.minFreeMemoryToTurnOff = minFreeMemoryToTurnOff;
if (congestu... | java | public void setMinFreeMemoryToTurnOff(int minFreeMemoryToTurnOff) throws IllegalArgumentException {
if (minFreeMemoryToTurnOff < 0 || minFreeMemoryToTurnOff > 100) {
throw new IllegalArgumentException("param value must be within 0 - 100%");
}
this.minFreeMemoryToTurnOff = minFreeMemoryToTurnOff;
if (congestu... | [
"public",
"void",
"setMinFreeMemoryToTurnOff",
"(",
"int",
"minFreeMemoryToTurnOff",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"minFreeMemoryToTurnOff",
"<",
"0",
"||",
"minFreeMemoryToTurnOff",
">",
"100",
")",
"{",
"throw",
"new",
"IllegalArgumentExce... | /*
(non-Javadoc)
@see org.mobicents.slee.container.management.jmx.CongestionControlConfigurationMBean#setMinFreeMemoryToTurnOff(int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/congestion/src/main/java/org/mobicents/slee/container/management/jmx/CongestionControlConfiguration.java#L96-L104 | test | Sets the minimum free memory to turn off. | Of course, here is the Java code you requested:
```java
public void setMinFreeMemoryToTurnOff(int minFreeMemoryToTurnOff) throws IllegalArgumentException {
if (minFreeMemoryToTurnOff < 0 || minFreeMemoryToTurnOff > 100) {
throw new IllegalArgumentException("param value must be within 0 - 100%");
}
this.minFre... |
wildfly/wildfly | clustering/common/src/main/java/org/jboss/as/clustering/dmr/ModelNodes.java | ModelNodes.optionalEnum | public static <E extends Enum<E>> Optional<E> optionalEnum(ModelNode value, Class<E> targetClass) {
return value.isDefined() ? Optional.of(asEnum(value, targetClass)) : Optional.empty();
} | java | public static <E extends Enum<E>> Optional<E> optionalEnum(ModelNode value, Class<E> targetClass) {
return value.isDefined() ? Optional.of(asEnum(value, targetClass)) : Optional.empty();
} | [
"public",
"static",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"Optional",
"<",
"E",
">",
"optionalEnum",
"(",
"ModelNode",
"value",
",",
"Class",
"<",
"E",
">",
"targetClass",
")",
"{",
"return",
"value",
".",
"isDefined",
"(",
")",
"?",
"Opti... | Returns the optional enum value of the specified {@link ModelNode}.
@param value the model node
@return an optional value | [
"Returns",
"the",
"optional",
"enum",
"value",
"of",
"the",
"specified",
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/clustering/common/src/main/java/org/jboss/as/clustering/dmr/ModelNodes.java#L144-L146 | test | Returns an optional enum value. | Of course, here is the Java code you requested:
```java
public static <E extends Enum<E>> Optional<E> optionalEnum(ModelNode value, Class<E> targetClass) {
return value.isDefined() ? Optional.of(asEnum(value, targetClass)) : Optional.empty();
}
```
Hope this helps! |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/config/MultiPartConfig.java | MultiPartConfig.defaultCharset | public MultiPartConfig defaultCharset(String defaultCharset) {
return new MultiPartConfig(defaultControlName, defaultFileName, defaultSubtype, defaultBoundary, defaultCharset, true);
} | java | public MultiPartConfig defaultCharset(String defaultCharset) {
return new MultiPartConfig(defaultControlName, defaultFileName, defaultSubtype, defaultBoundary, defaultCharset, true);
} | [
"public",
"MultiPartConfig",
"defaultCharset",
"(",
"String",
"defaultCharset",
")",
"{",
"return",
"new",
"MultiPartConfig",
"(",
"defaultControlName",
",",
"defaultFileName",
",",
"defaultSubtype",
",",
"defaultBoundary",
",",
"defaultCharset",
",",
"true",
")",
";"... | Specify a default charset to use for multi-parts (default is US-ASCII). This affects the encoding of the multipart body (such as the
control name) but <i>not</i> the actual <i>content</i> (such as the a JSON or String document).
<p>
<b>NOTE:</b> This setting is <i>only</i> taken into account if {@link HttpClientConfig#... | [
"Specify",
"a",
"default",
"charset",
"to",
"use",
"for",
"multi",
"-",
"parts",
"(",
"default",
"is",
"US",
"-",
"ASCII",
")",
".",
"This",
"affects",
"the",
"encoding",
"of",
"the",
"multipart",
"body",
"(",
"such",
"as",
"the",
"control",
"name",
")... | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/config/MultiPartConfig.java#L171-L173 | test | Sets the default charset. | Of course, here is the Java code you requested:
```java
public MultiPartConfig defaultCharset(String defaultCharset) {
return new MultiPartConfig(defaultControlName, defaultFileName, defaultSubtype, defaultBoundary, defaultCharset, true);
}
```
Hope this helps! |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java | CNCtx.rename | public void rename(Name oldName, Name newName)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(oldName.toString());
if (oldName.size() == 0 || newName.size() == 0)
throw IIOPLogger.ROOT_LOGGER.invalidEmptyName();
java.l... | java | public void rename(Name oldName, Name newName)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(oldName.toString());
if (oldName.size() == 0 || newName.size() == 0)
throw IIOPLogger.ROOT_LOGGER.invalidEmptyName();
java.l... | [
"public",
"void",
"rename",
"(",
"Name",
"oldName",
",",
"Name",
"newName",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"_nc",
"==",
"null",
")",
"throw",
"IIOPLogger",
".",
"ROOT_LOGGER",
".",
"notANamingContext",
"(",
"oldName",
".",
"toString",
"(",... | Renames an object. Since COS Naming does not support a rename
api, this method unbinds the object with the "oldName" and
creates a new binding.
@param oldName JNDI Name, existing name for the binding.
@param newName JNDI Name, name used to replace.
@throws NamingException See bind | [
"Renames",
"an",
"object",
".",
"Since",
"COS",
"Naming",
"does",
"not",
"support",
"a",
"rename",
"api",
"this",
"method",
"unbinds",
"the",
"object",
"with",
"the",
"oldName",
"and",
"creates",
"a",
"new",
"binding",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNCtx.java#L765-L774 | test | Renames an object in the context. | Of course, here is the Java code you requested:
```java
public void rename(Name oldName, Name newName)
throws NamingException {
if (_nc == null)
throw IIOPLogger.ROOT_LOGGER.notANamingContext(oldName.toString());
if (oldName.size() == 0 || newName.size() == 0)
throw ... |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/FSTObjectRegistry.java | FSTObjectRegistry.registerObjectForWrite | public int registerObjectForWrite(Object o, int streamPosition, FSTClazzInfo clzInfo, int reUseType[]) {
if (disabled) {
return Integer.MIN_VALUE;
}
// System.out.println("REGISTER AT WRITE:"+streamPosition+" "+o.getClass().getSimpleName());
// final Class clazz = o.getClass();... | java | public int registerObjectForWrite(Object o, int streamPosition, FSTClazzInfo clzInfo, int reUseType[]) {
if (disabled) {
return Integer.MIN_VALUE;
}
// System.out.println("REGISTER AT WRITE:"+streamPosition+" "+o.getClass().getSimpleName());
// final Class clazz = o.getClass();... | [
"public",
"int",
"registerObjectForWrite",
"(",
"Object",
"o",
",",
"int",
"streamPosition",
",",
"FSTClazzInfo",
"clzInfo",
",",
"int",
"reUseType",
"[",
"]",
")",
"{",
"if",
"(",
"disabled",
")",
"{",
"return",
"Integer",
".",
"MIN_VALUE",
";",
"}",
"// ... | add an object to the register, return handle if already present. Called during write only
@param o
@param streamPosition
@return 0 if added, handle if already present | [
"add",
"an",
"object",
"to",
"the",
"register",
"return",
"handle",
"if",
"already",
"present",
".",
"Called",
"during",
"write",
"only"
] | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/FSTObjectRegistry.java#L131-L152 | test | Register a object for writing. | Of course, here is the Java code you requested:
```java
public int registerObjectForWrite(Object o, int streamPosition, FSTClazzInfo clzInfo, int reUseType[]) {
if (disabled) {
return Integer.MIN_VALUE;
}
// System.out.println("REGISTER AT WRITE:"+streamPosition+" "+o.getClass().getS... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.clearIndex | public JSONObject clearIndex(@Nullable RequestOptions requestOptions) throws AlgoliaException {
return client.postRequest("/1/indexes/" + encodedIndexName + "/clear", /* urlParameters: */ null, "", false, requestOptions);
} | java | public JSONObject clearIndex(@Nullable RequestOptions requestOptions) throws AlgoliaException {
return client.postRequest("/1/indexes/" + encodedIndexName + "/clear", /* urlParameters: */ null, "", false, requestOptions);
} | [
"public",
"JSONObject",
"clearIndex",
"(",
"@",
"Nullable",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"return",
"client",
".",
"postRequest",
"(",
"\"/1/indexes/\"",
"+",
"encodedIndexName",
"+",
"\"/clear\"",
",",
"/* urlParameters: */... | Deletes the index content without removing settings and index specific API keys.
@param requestOptions Request-specific options.
@throws AlgoliaException | [
"Deletes",
"the",
"index",
"content",
"without",
"removing",
"settings",
"and",
"index",
"specific",
"API",
"keys",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L1491-L1493 | test | Clear the index | Of course, here is the Java code you requested:
```java
public JSONObject clearIndex(@Nullable RequestOptions requestOptions) throws AlgoliaException {
return client.postRequest("/1/indexes/" + encodedIndexName + "/clear", /* urlParameters: */ null, "", false, requestOptions);
}
```
Hope this helps! |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java | SymbolTable.addConstantMethodHandle | Symbol addConstantMethodHandle(
final int referenceKind,
final String owner,
final String name,
final String descriptor,
final boolean isInterface) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
// Note that we don't need to include isInterface in the hash computation, becaus... | java | Symbol addConstantMethodHandle(
final int referenceKind,
final String owner,
final String name,
final String descriptor,
final boolean isInterface) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
// Note that we don't need to include isInterface in the hash computation, becaus... | [
"Symbol",
"addConstantMethodHandle",
"(",
"final",
"int",
"referenceKind",
",",
"final",
"String",
"owner",
",",
"final",
"String",
"name",
",",
"final",
"String",
"descriptor",
",",
"final",
"boolean",
"isInterface",
")",
"{",
"final",
"int",
"tag",
"=",
"Sym... | Adds a CONSTANT_MethodHandle_info to the constant pool of this symbol table. Does nothing if
the constant pool already contains a similar item.
@param referenceKind one of {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link
Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, ... | [
"Adds",
"a",
"CONSTANT_MethodHandle_info",
"to",
"the",
"constant",
"pool",
"of",
"this",
"symbol",
"table",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java#L802-L832 | test | Add a constant method handle to the constant pool. | Of course, here is the Java code you requested:
```java
Symbol addConstantMethodHandle(
final int referenceKind,
final String owner,
final String name,
final String descriptor,
final boolean isInterface) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
// Note that we don't ne... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas.java | JCublas.cublasZgemm | public static void cublasZgemm(char transa, char transb, int m, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc)
{
cublasZgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | java | public static void cublasZgemm(char transa, char transb, int m, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc)
{
cublasZgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc);
checkResultBLAS();
} | [
"public",
"static",
"void",
"cublasZgemm",
"(",
"char",
"transa",
",",
"char",
"transb",
",",
"int",
"m",
",",
"int",
"n",
",",
"int",
"k",
",",
"cuDoubleComplex",
"alpha",
",",
"Pointer",
"A",
",",
"int",
"lda",
",",
"Pointer",
"B",
",",
"int",
"ldb... | <pre>
void cublasZgemm (char transa, char transb, int m, int n, int k,
cuDoubleComplex alpha, const cuDoubleComplex *A, int lda,
const cuDoubleComplex *B, int ldb, cuDoubleComplex beta,
cuDoubleComplex *C, int ldc)
zgemm performs one of the matrix-matrix operations
C = alpha * op(A) * op(B) + beta*C,
where op(X) is ... | [
"<pre",
">",
"void",
"cublasZgemm",
"(",
"char",
"transa",
"char",
"transb",
"int",
"m",
"int",
"n",
"int",
"k",
"cuDoubleComplex",
"alpha",
"const",
"cuDoubleComplex",
"*",
"A",
"int",
"lda",
"const",
"cuDoubleComplex",
"*",
"B",
"int",
"ldb",
"cuDoubleComp... | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L9951-L9955 | test | Cublas z - Galaxy. | Of course, here is the Java code you requested:
```java
public static void cublasZgemm(char transa, char transb, int m, int n, int k, cuDoubleComplex alpha, Pointer A, int lda, Pointer B, int ldb, cuDoubleComplex beta, Pointer C, int ldc)
{
cublasZgemmNative(transa, transb, m, n, k, alpha, A, lda, B, ldb... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/MD5Crypt.java | MD5Crypt.to64 | static private final String to64(long v, int size) {
StringBuffer result = new StringBuffer();
while (--size >= 0) {
result.append(itoa64.charAt((int) (v & 0x3f)));
v >>>= 6;
}
return result.toString();
} | java | static private final String to64(long v, int size) {
StringBuffer result = new StringBuffer();
while (--size >= 0) {
result.append(itoa64.charAt((int) (v & 0x3f)));
v >>>= 6;
}
return result.toString();
} | [
"static",
"private",
"final",
"String",
"to64",
"(",
"long",
"v",
",",
"int",
"size",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"while",
"(",
"--",
"size",
">=",
"0",
")",
"{",
"result",
".",
"append",
"(",
"itoa6... | Function to return a string from the set: A-Za-z0-9./
@param size Length of the string
@param v value to be converted
@return A string of size (size) from the set A-Za-z0-9./ | [
"Function",
"to",
"return",
"a",
"string",
"from",
"the",
"set",
":",
"A",
"-",
"Za",
"-",
"z0",
"-",
"9",
".",
"/"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/MD5Crypt.java#L31-L40 | test | to64 - returns a string of length size from a long value. | Of course, here is the Java code you requested:
```java
static private final String to64(long v, int size) {
StringBuffer result = new StringBuffer();
while (--size >= 0) {
result.append(itoa64.charAt((int) (v & 0x3f)));
v >>>= 6;
}
return result.toString();
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Objekt.java | Objekt.getInteressent | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Interessent> getInteressent() {
if (interessent == null) {
interessent = new ArrayList<Interessent>();
}
return this.interessent;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Interessent> getInteressent() {
if (interessent == null) {
interessent = new ArrayList<Interessent>();
}
return this.interessent;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:54:50+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"List",
"<",
"Interessent",
">",
"getInteressent",
"(",
")",
"{",
"if",
"(",
"intere... | Gets the value of the interessent property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the interessent property.
<p>
For example, ... | [
"Gets",
"the",
"value",
"of",
"the",
"interessent",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/Objekt.java#L634-L640 | test | Gets the value of the interessent property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:54:50+02:00", comments = "JAXB RI v2.2.11")
public List<Interessent> getInteressent() {
if (interessent == null) {
interessent = new ArrayList<Interessent>();
}
... |
jcodec/jcodec | src/main/java/org/jcodec/containers/mp4/QTTimeUtil.java | QTTimeUtil.formatTimecode | public static String formatTimecode(TrakBox timecodeTrack, int counter) {
TimecodeSampleEntry tmcd = NodeBox.findFirstPath(timecodeTrack, TimecodeSampleEntry.class, Box.path("mdia.minf.stbl.stsd.tmcd"));
byte nf = tmcd.getNumFrames();
String tc = String.format("%02d", counter % nf);
cou... | java | public static String formatTimecode(TrakBox timecodeTrack, int counter) {
TimecodeSampleEntry tmcd = NodeBox.findFirstPath(timecodeTrack, TimecodeSampleEntry.class, Box.path("mdia.minf.stbl.stsd.tmcd"));
byte nf = tmcd.getNumFrames();
String tc = String.format("%02d", counter % nf);
cou... | [
"public",
"static",
"String",
"formatTimecode",
"(",
"TrakBox",
"timecodeTrack",
",",
"int",
"counter",
")",
"{",
"TimecodeSampleEntry",
"tmcd",
"=",
"NodeBox",
".",
"findFirstPath",
"(",
"timecodeTrack",
",",
"TimecodeSampleEntry",
".",
"class",
",",
"Box",
".",
... | Formats tape timecode based on frame counter
@param timecodeTrack
@param counter
@return | [
"Formats",
"tape",
"timecode",
"based",
"on",
"frame",
"counter"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/containers/mp4/QTTimeUtil.java#L247-L260 | test | Format a timecode in the trakbox | Of course, here is the Java code you requested:
```java
public static String formatTimecode(TrakBox timecodeTrack, int counter) {
TimecodeSampleEntry tmcd = NodeBox.findFirstPath(timecodeTrack, TimecodeSampleEntry.class, Box.path("mdia.minf.stbl.stsd.tmcd"));
byte nf = tmcd.getNumFrames();
Str... |
oblac/jodd | jodd-lagarto/src/main/java/jodd/csselly/CSSellyLexer.java | CSSellyLexer.zzUnpackCMap | private static char [] zzUnpackCMap(final String packed) {
char [] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 128) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; whil... | java | private static char [] zzUnpackCMap(final String packed) {
char [] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 128) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value; whil... | [
"private",
"static",
"char",
"[",
"]",
"zzUnpackCMap",
"(",
"final",
"String",
"packed",
")",
"{",
"char",
"[",
"]",
"map",
"=",
"new",
"char",
"[",
"0x110000",
"]",
";",
"int",
"i",
"=",
"0",
";",
"/* index in packed string */",
"int",
"j",
"=",
"0",... | Unpacks the compressed character translation table.
@param packed the packed character translation table
@return the unpacked character translation table | [
"Unpacks",
"the",
"compressed",
"character",
"translation",
"table",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/csselly/CSSellyLexer.java#L493-L503 | test | Unpack CMap from packed string. | Of course, here is the Java code you requested:
```java
private static char [] zzUnpackCMap(final String packed) {
char [] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 128) {
int count = packed.charAt(i++);
char va... |
Unidata/thredds | grib/src/main/java/ucar/nc2/grib/grib2/table/CfsrLocalTables.java | CfsrLocalTables.initLocalTable | private void initLocalTable() {
String tableName = config.getPath();
ClassLoader cl = this.getClass().getClassLoader();
try (InputStream is = cl.getResourceAsStream(tableName)) {
if (is == null) {
throw new IllegalStateException("Cant find " + tableName);
}
try (BufferedReader br =... | java | private void initLocalTable() {
String tableName = config.getPath();
ClassLoader cl = this.getClass().getClassLoader();
try (InputStream is = cl.getResourceAsStream(tableName)) {
if (is == null) {
throw new IllegalStateException("Cant find " + tableName);
}
try (BufferedReader br =... | [
"private",
"void",
"initLocalTable",
"(",
")",
"{",
"String",
"tableName",
"=",
"config",
".",
"getPath",
"(",
")",
";",
"ClassLoader",
"cl",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
";",
"try",
"(",
"InputStream",
"is",
... | see http://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc.shtml | [
"see",
"http",
":",
"//",
"www",
".",
"nco",
".",
"ncep",
".",
"noaa",
".",
"gov",
"/",
"pmb",
"/",
"docs",
"/",
"grib2",
"/",
"grib2_doc",
".",
"shtml"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/table/CfsrLocalTables.java#L225-L276 | test | Initialize the local table. | Of course, here is the Java code you requested:
```java
private void initLocalTable() {
String tableName = config.getPath();
ClassLoader cl = this.getClass().getClassLoader();
try (InputStream is = cl.getResourceAsStream(tableName)) {
if (is == null) {
throw new IllegalStateException("Cant fi... |
VanRoy/spring-data-jest | spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/MappingBuilder.java | MappingBuilder.addSingleFieldMapping | private static void addSingleFieldMapping(XContentBuilder builder, java.lang.reflect.Field field, Field annotation, boolean nestedOrObjectField) throws IOException {
builder.startObject(field.getName());
addFieldMappingParameters(builder, annotation, nestedOrObjectField);
builder.endObject();
} | java | private static void addSingleFieldMapping(XContentBuilder builder, java.lang.reflect.Field field, Field annotation, boolean nestedOrObjectField) throws IOException {
builder.startObject(field.getName());
addFieldMappingParameters(builder, annotation, nestedOrObjectField);
builder.endObject();
} | [
"private",
"static",
"void",
"addSingleFieldMapping",
"(",
"XContentBuilder",
"builder",
",",
"java",
".",
"lang",
".",
"reflect",
".",
"Field",
"field",
",",
"Field",
"annotation",
",",
"boolean",
"nestedOrObjectField",
")",
"throws",
"IOException",
"{",
"builder... | Add mapping for @Field annotation
@throws IOException | [
"Add",
"mapping",
"for",
"@Field",
"annotation"
] | e6bcce1a49696aba34b02244bde74f85575c2c12 | https://github.com/VanRoy/spring-data-jest/blob/e6bcce1a49696aba34b02244bde74f85575c2c12/spring-data-jest/src/main/java/com/github/vanroy/springdata/jest/MappingBuilder.java#L222-L226 | test | Adds a single field mapping to the given XContentBuilder. | Of course, here is the Java code you requested:
```java
private static void addSingleFieldMapping(XContentBuilder builder, java.lang.reflect.Field field, Field annotation, boolean nestedOrObjectField) throws IOException {
builder.startObject(field.getName());
addFieldMappingParameters(builder, annotation, nestedOr... |
wildfly/wildfly | batch-jberet/src/main/java/org/wildfly/extension/batch/jberet/deployment/WildFlyJobXmlResolver.java | WildFlyJobXmlResolver.init | private void init(final ClassLoader classLoader) {
// Load the user defined resolvers
for (JobXmlResolver resolver : ServiceLoader.load(JobXmlResolver.class, classLoader)) {
jobXmlResolvers.add(resolver);
for (String jobXml : resolver.getJobXmlNames(classLoader)) {
... | java | private void init(final ClassLoader classLoader) {
// Load the user defined resolvers
for (JobXmlResolver resolver : ServiceLoader.load(JobXmlResolver.class, classLoader)) {
jobXmlResolvers.add(resolver);
for (String jobXml : resolver.getJobXmlNames(classLoader)) {
... | [
"private",
"void",
"init",
"(",
"final",
"ClassLoader",
"classLoader",
")",
"{",
"// Load the user defined resolvers",
"for",
"(",
"JobXmlResolver",
"resolver",
":",
"ServiceLoader",
".",
"load",
"(",
"JobXmlResolver",
".",
"class",
",",
"classLoader",
")",
")",
"... | Initializes the state of an instance | [
"Initializes",
"the",
"state",
"of",
"an",
"instance"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/batch-jberet/src/main/java/org/wildfly/extension/batch/jberet/deployment/WildFlyJobXmlResolver.java#L267-L299 | test | Initialize the application. | Of course, here is the Java code you requested:
```java
private void init(final ClassLoader classLoader) {
// Load the user defined resolvers
for (JobXmlResolver resolver : ServiceLoader.load(JobXmlResolver.class, classLoader)) {
jobXmlResolvers.add(resolver);
for (String jobXml... |
lessthanoptimal/GeoRegression | main/src/georegression/transform/affine/AffinePointOps_F64.java | AffinePointOps_F64.transform | public static Vector2D_F64 transform( Affine2D_F64 se, Vector2D_F64 orig, Vector2D_F64 result ) {
if( result == null ) {
result = new Vector2D_F64();
}
// copy the values so that no errors happen if orig and result are the same instance
double x = orig.x;
double y = orig.y;
result.x = se.a11 * x + se.... | java | public static Vector2D_F64 transform( Affine2D_F64 se, Vector2D_F64 orig, Vector2D_F64 result ) {
if( result == null ) {
result = new Vector2D_F64();
}
// copy the values so that no errors happen if orig and result are the same instance
double x = orig.x;
double y = orig.y;
result.x = se.a11 * x + se.... | [
"public",
"static",
"Vector2D_F64",
"transform",
"(",
"Affine2D_F64",
"se",
",",
"Vector2D_F64",
"orig",
",",
"Vector2D_F64",
"result",
")",
"{",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"new",
"Vector2D_F64",
"(",
")",
";",
"}",
"// cop... | Applies a 2D affine transform to the point and stores the results in another
variable.
@param se The transform.
@param orig Original point being transformed. Not modified.
@param result Where the results are stored. Can be the same as orig. If null a new
instance is created. Modified.
@return Transformed point. | [
"Applies",
"a",
"2D",
"affine",
"transform",
"to",
"the",
"point",
"and",
"stores",
"the",
"results",
"in",
"another",
"variable",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/transform/affine/AffinePointOps_F64.java#L41-L55 | test | Transforms the two vectors using the Affine2D transformation. | Of course, here is the Java code you requested:
```java
public static Vector2D_F64 transform( Affine2D_F64 se, Vector2D_F64 orig, Vector2D_F64 result ) {
if( result == null ) {
result = new Vector2D_F64();
}
// copy the values so that no errors happen if orig and result are the same instance
double x = or... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/MultithreadedTableProvider.java | MultithreadedTableProvider.nextTable | public TableRuntimeContext nextTable(int threadNumber) throws InterruptedException {
synchronized (partitionStateLock) {
acquireTableAsNeeded(threadNumber);
final TableRuntimeContext partition = getOwnedTablesQueue().pollFirst();
if (partition != null) {
offerToOwnedTablesQueue(partition,... | java | public TableRuntimeContext nextTable(int threadNumber) throws InterruptedException {
synchronized (partitionStateLock) {
acquireTableAsNeeded(threadNumber);
final TableRuntimeContext partition = getOwnedTablesQueue().pollFirst();
if (partition != null) {
offerToOwnedTablesQueue(partition,... | [
"public",
"TableRuntimeContext",
"nextTable",
"(",
"int",
"threadNumber",
")",
"throws",
"InterruptedException",
"{",
"synchronized",
"(",
"partitionStateLock",
")",
"{",
"acquireTableAsNeeded",
"(",
"threadNumber",
")",
";",
"final",
"TableRuntimeContext",
"partition",
... | Return the next table to work on for the current thread (Will not return null)
Deque the current element from head of the queue and put it back at the tail to queue. | [
"Return",
"the",
"next",
"table",
"to",
"work",
"on",
"for",
"the",
"current",
"thread",
"(",
"Will",
"not",
"return",
"null",
")",
"Deque",
"the",
"current",
"element",
"from",
"head",
"of",
"the",
"queue",
"and",
"put",
"it",
"back",
"at",
"the",
"ta... | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/MultithreadedTableProvider.java#L606-L616 | test | Get the next table in the queue. | Of course, here is the Java code you requested:
```java
public TableRuntimeContext nextTable(int threadNumber) throws InterruptedException {
synchronized (partitionStateLock) {
acquireTableAsNeeded(threadNumber);
final TableRuntimeContext partition = getOwnedTablesQueue().pollFirst();
if (partit... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java | OrientVertex.remove | @Override
public void remove() {
checkClass();
final OrientBaseGraph graph = checkIfAttached();
graph.setCurrentGraphInThreadLocal();
graph.autoStartTransaction();
final ODocument doc = getRecord();
if (doc == null)
throw ExceptionFactory.vertexWithIdDoesNotExist(this.getId());
M... | java | @Override
public void remove() {
checkClass();
final OrientBaseGraph graph = checkIfAttached();
graph.setCurrentGraphInThreadLocal();
graph.autoStartTransaction();
final ODocument doc = getRecord();
if (doc == null)
throw ExceptionFactory.vertexWithIdDoesNotExist(this.getId());
M... | [
"@",
"Override",
"public",
"void",
"remove",
"(",
")",
"{",
"checkClass",
"(",
")",
";",
"final",
"OrientBaseGraph",
"graph",
"=",
"checkIfAttached",
"(",
")",
";",
"graph",
".",
"setCurrentGraphInThreadLocal",
"(",
")",
";",
"graph",
".",
"autoStartTransactio... | Removes the current Vertex from the Graph. all the incoming and outgoing edges are automatically removed too. | [
"Removes",
"the",
"current",
"Vertex",
"from",
"the",
"Graph",
".",
"all",
"the",
"incoming",
"and",
"outgoing",
"edges",
"are",
"automatically",
"removed",
"too",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientVertex.java#L472-L539 | test | Removes the entire document from the database. | Of course, here is the Java code you requested:
```java
@Override
public void remove() {
checkClass();
final OrientBaseGraph graph = checkIfAttached();
graph.setCurrentGraphInThreadLocal();
graph.autoStartTransaction();
final ODocument doc = getRecord();
if (doc == null)
throw Except... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Grundstueck.java | Grundstueck.setGrundstTyp | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setGrundstTyp(Grundstueck.GrundstTyp value) {
this.grundstTyp = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setGrundstTyp(Grundstueck.GrundstTyp value) {
this.grundstTyp = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:50:55+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setGrundstTyp",
"(",
"Grundstueck",
".",
"GrundstTyp",
"value",
")",
"{",
"th... | Sets the value of the grundstTyp property.
@param value
allowed object is
{@link Grundstueck.GrundstTyp } | [
"Sets",
"the",
"value",
"of",
"the",
"grundstTyp",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Grundstueck.java#L63-L66 | test | Sets the value of the grundstTyp property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11")
public void setGrundstTyp(Grundstueck.GrundstTyp value) {
this.grundstTyp = value;
}
```
Hope this helps! |
real-logic/aeron | aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java | AeronCluster.close | public void close()
{
if (null != publication && publication.isConnected())
{
closeSession();
}
if (!ctx.ownsAeronClient())
{
CloseHelper.close(subscription);
CloseHelper.close(publication);
}
ctx.close();
} | java | public void close()
{
if (null != publication && publication.isConnected())
{
closeSession();
}
if (!ctx.ownsAeronClient())
{
CloseHelper.close(subscription);
CloseHelper.close(publication);
}
ctx.close();
} | [
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"publication",
"&&",
"publication",
".",
"isConnected",
"(",
")",
")",
"{",
"closeSession",
"(",
")",
";",
"}",
"if",
"(",
"!",
"ctx",
".",
"ownsAeronClient",
"(",
")",
")",
"{",
"C... | Close session and release associated resources. | [
"Close",
"session",
"and",
"release",
"associated",
"resources",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java#L224-L238 | test | Close the AERON client. | Of course, here is the Java code you requested:
```java
public void close()
{
if (null != publication && publication.isConnected())
{
closeSession();
}
if (!ctx.ownsAeronClient())
{
CloseHelper.close(subscription);
CloseHelper.close(publi... |
RestComm/jain-slee | container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextImpl.java | ActivityContextImpl.updateLastAccessTime | private void updateLastAccessTime(boolean creation) {
if (creation) {
cacheData.putObject(NODE_MAP_KEY_LAST_ACCESS,
Long.valueOf(System.currentTimeMillis()));
} else {
ActivityManagementConfiguration configuration = factory
.getConfiguration();
Long lastUpdate = (Long) cacheData
.getObject(N... | java | private void updateLastAccessTime(boolean creation) {
if (creation) {
cacheData.putObject(NODE_MAP_KEY_LAST_ACCESS,
Long.valueOf(System.currentTimeMillis()));
} else {
ActivityManagementConfiguration configuration = factory
.getConfiguration();
Long lastUpdate = (Long) cacheData
.getObject(N... | [
"private",
"void",
"updateLastAccessTime",
"(",
"boolean",
"creation",
")",
"{",
"if",
"(",
"creation",
")",
"{",
"cacheData",
".",
"putObject",
"(",
"NODE_MAP_KEY_LAST_ACCESS",
",",
"Long",
".",
"valueOf",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
")... | --- private helpers | [
"---",
"private",
"helpers"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextImpl.java#L427-L462 | test | Update the last access time of the activity management activity management activity management. | Of course, here is the Java code you requested:
```java
private void updateLastAccessTime(boolean creation) {
if (creation) {
cacheData.putObject(NODE_MAP_KEY_LAST_ACCESS,
Long.valueOf(System.currentTimeMillis()));
} else {
ActivityManagementConfiguration configuration = factory
.getConfiguration()... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java | ClassWriter.visit | @Override
public final void visit(
final int version,
final int access,
final String name,
final String signature,
final String superName,
final String[] interfaces) {
this.version = version;
this.accessFlags = access;
this.thisClass = symbolTable.setMajorVersionAndClas... | java | @Override
public final void visit(
final int version,
final int access,
final String name,
final String signature,
final String superName,
final String[] interfaces) {
this.version = version;
this.accessFlags = access;
this.thisClass = symbolTable.setMajorVersionAndClas... | [
"@",
"Override",
"public",
"final",
"void",
"visit",
"(",
"final",
"int",
"version",
",",
"final",
"int",
"access",
",",
"final",
"String",
"name",
",",
"final",
"String",
"signature",
",",
"final",
"String",
"superName",
",",
"final",
"String",
"[",
"]",
... | ----------------------------------------------------------------------------------------------- | [
"-----------------------------------------------------------------------------------------------"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/ClassWriter.java#L252-L277 | test | implements the visitor to add the information to the block. | Of course, here is the Java code you requested:
```java
@Override
public final void visit(
final int version,
final int access,
final String name,
final String signature,
final String superName,
final String[] interfaces) {
this.version = version;
this.accessFlags = access... |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/core/schema/HollowSchemaSorter.java | HollowSchemaSorter.dependencyOrderedSchemaList | public static List<HollowSchema> dependencyOrderedSchemaList(Collection<HollowSchema> schemas) {
DependencyIndex idx = new DependencyIndex();
Map<String, HollowSchema> schemaMap = new HashMap<String, HollowSchema>();
for(HollowSchema schema : schemas) {
schemaMap.put(schema.getName()... | java | public static List<HollowSchema> dependencyOrderedSchemaList(Collection<HollowSchema> schemas) {
DependencyIndex idx = new DependencyIndex();
Map<String, HollowSchema> schemaMap = new HashMap<String, HollowSchema>();
for(HollowSchema schema : schemas) {
schemaMap.put(schema.getName()... | [
"public",
"static",
"List",
"<",
"HollowSchema",
">",
"dependencyOrderedSchemaList",
"(",
"Collection",
"<",
"HollowSchema",
">",
"schemas",
")",
"{",
"DependencyIndex",
"idx",
"=",
"new",
"DependencyIndex",
"(",
")",
";",
"Map",
"<",
"String",
",",
"HollowSchem... | Dependency types come before dependent types
@param schemas the schema
@return the dependent schema | [
"Dependency",
"types",
"come",
"before",
"dependent",
"types"
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/schema/HollowSchemaSorter.java#L48-L62 | test | Get a list of schemas that are ordered in a collection of HollowSchema objects. | Of course, here is the Java code you requested:
```java
public static List<HollowSchema> dependencyOrderedSchemaList(Collection<HollowSchema> schemas) {
DependencyIndex idx = new DependencyIndex();
Map<String, HollowSchema> schemaMap = new HashMap<String, HollowSchema>();
for(HollowSchema schem... |
FitLayout/api | src/main/java/org/fit/layout/model/Rectangular.java | Rectangular.hsplit | public Rectangular hsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.x2 > other.x1 - 1) a.x2 = other.x1 - 1;
if (b.x1 < other.x2 + 1) b.x1 = other.x2 + 1;
... | java | public Rectangular hsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.x2 > other.x1 - 1) a.x2 = other.x1 - 1;
if (b.x1 < other.x2 + 1) b.x1 = other.x2 + 1;
... | [
"public",
"Rectangular",
"hsplit",
"(",
"Rectangular",
"other",
")",
"{",
"if",
"(",
"this",
".",
"intersects",
"(",
"other",
")",
")",
"{",
"Rectangular",
"a",
"=",
"new",
"Rectangular",
"(",
"this",
")",
";",
"Rectangular",
"b",
"=",
"new",
"Rectangula... | If this rectangle intersets with the other one, splits this rectangle horizontally so that it does not intersect with the other one anymore.
@param other the rectangle used to split this one
@return if this rectangle had to be split in two parts, the second one is returned. Otherwise, null is returned. | [
"If",
"this",
"rectangle",
"intersets",
"with",
"the",
"other",
"one",
"splits",
"this",
"rectangle",
"horizontally",
"so",
"that",
"it",
"does",
"not",
"intersect",
"with",
"the",
"other",
"one",
"anymore",
"."
] | fcfa67ce2a7485fbd722576413191fff5d68bae8 | https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/model/Rectangular.java#L340-L364 | test | HSplit this image into two. | Of course, here is the Java code you requested:
```java
public Rectangular hsplit(Rectangular other)
{
if (this.intersects(other))
{
Rectangular a = new Rectangular(this);
Rectangular b = new Rectangular(this);
if (a.x2 > other.x1 - 1) a.x2 = other.x1 - 1;
... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java | GeoPackageManagerImpl.databaseSet | @Override
public Set<String> databaseSet() {
Set<String> databases = new HashSet<String>();
addDatabases(databases);
return databases;
} | java | @Override
public Set<String> databaseSet() {
Set<String> databases = new HashSet<String>();
addDatabases(databases);
return databases;
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"databaseSet",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"databases",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"addDatabases",
"(",
"databases",
")",
";",
"return",
"databases",
";"... | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/factory/GeoPackageManagerImpl.java#L214-L219 | test | Get a set of databases that are available in this class. | Of course, here is the Java code you requested:
```java
@Override
public Set<String> databaseSet() {
Set<String> databases = new HashSet<String>();
addDatabases(databases);
return databases;
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/OWALSegmentCache.java | OWALSegmentCache.open | public void open() throws IOException {
synchronized (lockObject) {
lastAccessTime = System.nanoTime();
initFile();
long pagesCount = segChannel.size() / OWALPage.PAGE_SIZE;
if (segChannel.size() % OWALPage.PAGE_SIZE > 0) {
OLogManager.instance().error(this, "Last WAL page was writ... | java | public void open() throws IOException {
synchronized (lockObject) {
lastAccessTime = System.nanoTime();
initFile();
long pagesCount = segChannel.size() / OWALPage.PAGE_SIZE;
if (segChannel.size() % OWALPage.PAGE_SIZE > 0) {
OLogManager.instance().error(this, "Last WAL page was writ... | [
"public",
"void",
"open",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"lockObject",
")",
"{",
"lastAccessTime",
"=",
"System",
".",
"nanoTime",
"(",
")",
";",
"initFile",
"(",
")",
";",
"long",
"pagesCount",
"=",
"segChannel",
".",
"size",... | Initializes cache and opens underlying file. | [
"Initializes",
"cache",
"and",
"opens",
"underlying",
"file",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/paginated/wal/OWALSegmentCache.java#L336-L355 | test | Open the file. | Of course, here is the Java code you requested:
```java
public void open() throws IOException {
synchronized (lockObject) {
lastAccessTime = System.nanoTime();
initFile();
long pagesCount = segChannel.size() / OWALPage.PAGE_SIZE;
if (segChannel.size() % OWALPage.PAGE_SIZE > 0) {
O... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/CommitAction.java | CommitAction.selectionChanged | public void selectionChanged(IAction action, ISelection selection) {
boolean validResourceSet = ActionUtils.checkResourceSet(selection, true)
&& ActionUtils.areFilesDirty(selection);
if (validResourceSet) {
action.setEnabled(true);
selectedItems... | java | public void selectionChanged(IAction action, ISelection selection) {
boolean validResourceSet = ActionUtils.checkResourceSet(selection, true)
&& ActionUtils.areFilesDirty(selection);
if (validResourceSet) {
action.setEnabled(true);
selectedItems... | [
"public",
"void",
"selectionChanged",
"(",
"IAction",
"action",
",",
"ISelection",
"selection",
")",
"{",
"boolean",
"validResourceSet",
"=",
"ActionUtils",
".",
"checkResourceSet",
"(",
"selection",
",",
"true",
")",
"&&",
"ActionUtils",
".",
"areFilesDirty",
"("... | /*
(non-Javadoc)
@see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/actions/CommitAction.java#L68-L78 | test | Change the selection of an action. | Of course, here is the Java code you requested:
```java
public void selectionChanged(IAction action, ISelection selection) {
boolean validResourceSet = ActionUtils.checkResourceSet(selection, true)
&& ActionUtils.areFilesDirty(selection);
if (validResourceSet) {
... |
agentsoz/jill | jill/src/main/java/io/github/agentsoz/jill/struct/AObject.java | AObject.isNameEqual | public static boolean isNameEqual(AObject obj1, AObject obj2) {
// Not equal if the names are null, or empty, or not the same size
if (obj1.name == null || obj2.name == null || obj1.name.length != obj2.name.length
|| obj1.name.length == 0) {
return false;
}
// Not equal if any name charact... | java | public static boolean isNameEqual(AObject obj1, AObject obj2) {
// Not equal if the names are null, or empty, or not the same size
if (obj1.name == null || obj2.name == null || obj1.name.length != obj2.name.length
|| obj1.name.length == 0) {
return false;
}
// Not equal if any name charact... | [
"public",
"static",
"boolean",
"isNameEqual",
"(",
"AObject",
"obj1",
",",
"AObject",
"obj2",
")",
"{",
"// Not equal if the names are null, or empty, or not the same size",
"if",
"(",
"obj1",
".",
"name",
"==",
"null",
"||",
"obj2",
".",
"name",
"==",
"null",
"||... | Checks if two objects have the same name. The check is case sensitive.
@param obj1 the first object
@param obj2 the second object
@return true if the objects have the same non-null non-empty name, and false otherwise | [
"Checks",
"if",
"two",
"objects",
"have",
"the",
"same",
"name",
".",
"The",
"check",
"is",
"case",
"sensitive",
"."
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/struct/AObject.java#L104-L118 | test | Is the name equal. | Of course, here is the Java code you requested:
```java
public static boolean isNameEqual(AObject obj1, AObject obj2) {
// Not equal if the names are null, or empty, or not the same size
if (obj1.name == null || obj2.name == null || obj1.name.length != obj2.name.length
|| obj1.name.length == 0) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.