repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
structlogging/structlogger | structlogger/src/main/java/com/github/structlogging/processor/service/POJOService.java | POJOService.addPojoField | private void addPojoField(final TypeSpec.Builder classBuilder,
final MethodSpec.Builder constructorBuilder,
final String fieldName,
final TypeName fieldClass) {
classBuilder.addField(fieldClass, fieldName, Modifier.PRIVATE... | java | private void addPojoField(final TypeSpec.Builder classBuilder,
final MethodSpec.Builder constructorBuilder,
final String fieldName,
final TypeName fieldClass) {
classBuilder.addField(fieldClass, fieldName, Modifier.PRIVATE... | [
"private",
"void",
"addPojoField",
"(",
"final",
"TypeSpec",
".",
"Builder",
"classBuilder",
",",
"final",
"MethodSpec",
".",
"Builder",
"constructorBuilder",
",",
"final",
"String",
"fieldName",
",",
"final",
"TypeName",
"fieldClass",
")",
"{",
"classBuilder",
".... | adds field to POJO, adds getter and adds parameter to constructor
@param classBuilder class to modify
@param constructorBuilder constructor to modify
@param fieldName field name to add
@param fieldClass class of field to be added | [
"adds",
"field",
"to",
"POJO",
"adds",
"getter",
"and",
"adds",
"parameter",
"to",
"constructor"
] | 1fcca4e962ef53cbdb94bd72cb556de7f5f9469f | https://github.com/structlogging/structlogger/blob/1fcca4e962ef53cbdb94bd72cb556de7f5f9469f/structlogger/src/main/java/com/github/structlogging/processor/service/POJOService.java#L177-L184 | train | Add a POJO field to the class. | Create a Java method that does the following: "Add a POJO field to the class.". | Of course, here is the Java code you requested:
```java
private void addPojoField(final TypeSpec.Builder classBuilder,
final MethodSpec.Builder constructorBuilder,
final String fieldName,
final TypeName fieldClass) {
clas... | |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/factory/FctConvertersToFromString.java | FctConvertersToFromString.lazyGetCnvTfsObject | protected final CnvTfsObject
lazyGetCnvTfsObject(final Class pClass) throws Exception {
String beanName = getCnvTfsObjectName(pClass);
@SuppressWarnings("unchecked")
CnvTfsObject<Object> convrt = (CnvTfsObject<Object>)
this.convertersMap.get(beanName);
if (convrt == null) {
convrt = new ... | java | protected final CnvTfsObject
lazyGetCnvTfsObject(final Class pClass) throws Exception {
String beanName = getCnvTfsObjectName(pClass);
@SuppressWarnings("unchecked")
CnvTfsObject<Object> convrt = (CnvTfsObject<Object>)
this.convertersMap.get(beanName);
if (convrt == null) {
convrt = new ... | [
"protected",
"final",
"CnvTfsObject",
"lazyGetCnvTfsObject",
"(",
"final",
"Class",
"pClass",
")",
"throws",
"Exception",
"{",
"String",
"beanName",
"=",
"getCnvTfsObjectName",
"(",
"pClass",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"CnvTfsObjec... | <p>Lazy get put CnvTfsObject([Composite class]).</p>
@param pClass - composite class
@return requested CnvTfsObject([cc])
@throws Exception - an exception | [
"<p",
">",
"Lazy",
"get",
"put",
"CnvTfsObject",
"(",
"[",
"Composite",
"class",
"]",
")",
".",
"<",
"/",
"p",
">"
] | bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/factory/FctConvertersToFromString.java#L495-L512 | train | Get the CnvTfsObject from the map. | Create a Java method that does the following: "Get the CnvTfsObject from the map.". | Of course, here is the Java code you requested:
```java
protected final CnvTfsObject
lazyGetCnvTfsObject(final Class pClass) throws Exception {
String beanName = getCnvTfsObjectName(pClass);
@SuppressWarnings("unchecked")
CnvTfsObject<Object> convrt = (CnvTfsObject<Object>)
this.convertersMap.get... | |
orbisgis/poly2tri.java | poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/DelaunayTriangle.java | DelaunayTriangle.markNeighbor | private void markNeighbor( TriangulationPoint p1,
TriangulationPoint p2,
DelaunayTriangle t )
{
if( ( p1 == points[2] && p2 == points[1] ) || ( p1 == points[1] && p2 == points[2] ) )
{
neighbors[0] = t;
}
els... | java | private void markNeighbor( TriangulationPoint p1,
TriangulationPoint p2,
DelaunayTriangle t )
{
if( ( p1 == points[2] && p2 == points[1] ) || ( p1 == points[1] && p2 == points[2] ) )
{
neighbors[0] = t;
}
els... | [
"private",
"void",
"markNeighbor",
"(",
"TriangulationPoint",
"p1",
",",
"TriangulationPoint",
"p2",
",",
"DelaunayTriangle",
"t",
")",
"{",
"if",
"(",
"(",
"p1",
"==",
"points",
"[",
"2",
"]",
"&&",
"p2",
"==",
"points",
"[",
"1",
"]",
")",
"||",
"(",... | Update neighbor pointers | [
"Update",
"neighbor",
"pointers"
] | 8b312c8d5fc23c52ffbacb3a7b66afae328fa827 | https://github.com/orbisgis/poly2tri.java/blob/8b312c8d5fc23c52ffbacb3a7b66afae328fa827/poly2tri-core/src/main/java/org/poly2tri/triangulation/delaunay/DelaunayTriangle.java#L120-L141 | train | Mark the neighbor of two points. | Create a Java method that does the following: "Mark the neighbor of two points.". | Of course, here is the Java code you requested:
```java
private void markNeighbor( TriangulationPoint p1,
TriangulationPoint p2,
DelaunayTriangle t )
{
if( ( p1 == points[2] && p2 == points[1] ) || ( p1 == points[1] && p2 == points[2] ) )
... | |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/RoomInfoImpl.java | RoomInfoImpl.getUserList | @Override
public <T extends ApiUser> List<T> getUserList() {
return CommandUtil.getApiUserList(room.getUserList());
} | java | @Override
public <T extends ApiUser> List<T> getUserList() {
return CommandUtil.getApiUserList(room.getUserList());
} | [
"@",
"Override",
"public",
"<",
"T",
"extends",
"ApiUser",
">",
"List",
"<",
"T",
">",
"getUserList",
"(",
")",
"{",
"return",
"CommandUtil",
".",
"getApiUserList",
"(",
"room",
".",
"getUserList",
"(",
")",
")",
";",
"}"
] | /* (non-Javadoc)
@see com.tvd12.ezyfox.core.command.FetchRoomInfo#getUserList() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 7e004033a3b551c3ae970a0c8f45db7b1ec144de | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/RoomInfoImpl.java#L108-L111 | train | Get the user list. | Create a Java method that does the following: "Get the user list.". | Of course, here is the Java code you requested:
```java
@Override
public <T extends ApiUser> List<T> getUserList() {
return CommandUtil.getApiUserList(room.getUserList());
}
```
Hope this helps! | |
jxnet/Jxnet | jxnet-context/src/main/java/com/ardikars/jxnet/Application.java | Application.getApplicationContext | public static Context getApplicationContext() {
com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
return new ApplicationContext(context);
} | java | public static Context getApplicationContext() {
com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
return new ApplicationContext(context);
} | [
"public",
"static",
"Context",
"getApplicationContext",
"(",
")",
"{",
"com",
".",
"ardikars",
".",
"jxnet",
".",
"context",
".",
"Context",
"context",
"=",
"com",
".",
"ardikars",
".",
"jxnet",
".",
"context",
".",
"Application",
".",
"getApplicationContext",... | Get application context.
@return application context. | [
"Get",
"application",
"context",
"."
] | 3ef28eb83c149ff134df1841d12bcbea3d8fe163 | https://github.com/jxnet/Jxnet/blob/3ef28eb83c149ff134df1841d12bcbea3d8fe163/jxnet-context/src/main/java/com/ardikars/jxnet/Application.java#L50-L53 | train | Get the application context. | Create a Java method that does the following: "Get the application context.". | Of course, here is the Java code you requested:
```java
public static Context getApplicationContext() {
com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
return new ApplicationContext(context);
}
```
Hope this helps! | |
sahan/DroidBallet | droidballet/src/main/java/com/lonepulse/droidballet/resolver/AbstractMotionEventResolver.java | AbstractMotionEventResolver.resolve | public void resolve(SensorEvent sensorEvent, Set<MotionListener> motionListeners) {
Set<L> filteredMotionListeners = filterMotionListeners(motionListeners);
E motionEvent = generateMotionEvent(sensorEvent);
if(motionEvent != null) {
fireMotionEvent(motionEvent, filteredMotionListeners);
}
} | java | public void resolve(SensorEvent sensorEvent, Set<MotionListener> motionListeners) {
Set<L> filteredMotionListeners = filterMotionListeners(motionListeners);
E motionEvent = generateMotionEvent(sensorEvent);
if(motionEvent != null) {
fireMotionEvent(motionEvent, filteredMotionListeners);
}
} | [
"public",
"void",
"resolve",
"(",
"SensorEvent",
"sensorEvent",
",",
"Set",
"<",
"MotionListener",
">",
"motionListeners",
")",
"{",
"Set",
"<",
"L",
">",
"filteredMotionListeners",
"=",
"filterMotionListeners",
"(",
"motionListeners",
")",
";",
"E",
"motionEvent"... | {@inheritDoc} | [
"{"
] | c6001c9e933cb2c8dbcabe1ae561678b31b10b62 | https://github.com/sahan/DroidBallet/blob/c6001c9e933cb2c8dbcabe1ae561678b31b10b62/droidballet/src/main/java/com/lonepulse/droidballet/resolver/AbstractMotionEventResolver.java#L89-L99 | train | Resolve the motion event. | Create a Java method that does the following: "Resolve the motion event.". | Of course, here is the Java code you requested:
```java
public void resolve(SensorEvent sensorEvent, Set<MotionListener> motionListeners) {
Set<L> filteredMotionListeners = filterMotionListeners(motionListeners);
E motionEvent = generateMotionEvent(sensorEvent);
if(motionEvent != null) {
fireMotio... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/helper/Filter.java | Filter.matches | @Override
public boolean matches(String name, Metric metric) {
// TODO Auto-generated method stub
Matcher m = p.matcher(name);
return m.matches();
} | java | @Override
public boolean matches(String name, Metric metric) {
// TODO Auto-generated method stub
Matcher m = p.matcher(name);
return m.matches();
} | [
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"String",
"name",
",",
"Metric",
"metric",
")",
"{",
"// TODO Auto-generated method stub",
"Matcher",
"m",
"=",
"p",
".",
"matcher",
"(",
"name",
")",
";",
"return",
"m",
".",
"matches",
"(",
")",
";",
... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics/src/com/ibm/ws/microprofile/metrics/helper/Filter.java#L30-L35 | train | Override this method to check if a name matches a CIDCTYPE. | Create a Java method that does the following: "Override this method to check if a name matches a CIDCTYPE.". | Of course, here is the Java code you requested:
```java
@Override
public boolean matches(String name, Metric metric) {
// TODO Auto-generated method stub
Matcher m = p.matcher(name);
return m.matches();
}
```
Hope this helps! | |
ontop/ontop | core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/SubstitutionImpl.java | SubstitutionImpl.composeTerms | @Override
public boolean composeTerms(Term term1, Term term2) {
/**
* Special case: unification of two functional terms (possibly recursive)
*/
if ((term1 instanceof Function) && (term2 instanceof Function)) {
return composeFunctions((Function) term1, (Function) term2)... | java | @Override
public boolean composeTerms(Term term1, Term term2) {
/**
* Special case: unification of two functional terms (possibly recursive)
*/
if ((term1 instanceof Function) && (term2 instanceof Function)) {
return composeFunctions((Function) term1, (Function) term2)... | [
"@",
"Override",
"public",
"boolean",
"composeTerms",
"(",
"Term",
"term1",
",",
"Term",
"term2",
")",
"{",
"/**\n * Special case: unification of two functional terms (possibly recursive)\n */",
"if",
"(",
"(",
"term1",
"instanceof",
"Function",
")",
"&&",
... | *
Creates a unifier (singleton substitution) out of term1 and term2.
Then, composes the current substitution with this unifier.
(remind that composition is not commutative).
Note that this Substitution object will be modified in this process.
The operation is as follows
{x/y, m/y} composed with (y,z) is equal to {... | [
"*",
"Creates",
"a",
"unifier",
"(",
"singleton",
"substitution",
")",
"out",
"of",
"term1",
"and",
"term2",
"."
] | ddf78b26981b6129ee9a1a59310016830f5352e4 | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/core/model/src/main/java/it/unibz/inf/ontop/substitution/impl/SubstitutionImpl.java#L122-L170 | train | Composes two terms. | Create a Java method that does the following: "Composes two terms.". | Of course, here is the Java code you requested:
```java
@Override
public boolean composeTerms(Term term1, Term term2) {
/**
* Special case: unification of two functional terms (possibly recursive)
*/
if ((term1 instanceof Function) && (term2 instanceof Function)) {
re... | |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ClassUtils.java | _ClassUtils.getContextClassLoader | protected static ClassLoader getContextClassLoader()
{
if (System.getSecurityManager() != null)
{
try
{
Object cl = AccessController.doPrivileged(new PrivilegedExceptionAction()
{
public Object run() throws Privilege... | java | protected static ClassLoader getContextClassLoader()
{
if (System.getSecurityManager() != null)
{
try
{
Object cl = AccessController.doPrivileged(new PrivilegedExceptionAction()
{
public Object run() throws Privilege... | [
"protected",
"static",
"ClassLoader",
"getContextClassLoader",
"(",
")",
"{",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"null",
")",
"{",
"try",
"{",
"Object",
"cl",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExc... | Gets the ClassLoader associated with the current thread. Returns the class loader associated with the specified
default object if no context loader is associated with the current thread.
@return ClassLoader | [
"Gets",
"the",
"ClassLoader",
"associated",
"with",
"the",
"current",
"thread",
".",
"Returns",
"the",
"class",
"loader",
"associated",
"with",
"the",
"specified",
"default",
"object",
"if",
"no",
"context",
"loader",
"is",
"associated",
"with",
"the",
"current"... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ClassUtils.java#L389-L413 | train | Get the context class loader. | Create a Java method that does the following: "Get the context class loader.". | Of course, here is the Java code you requested:
```java
protected static ClassLoader getContextClassLoader()
{
if (System.getSecurityManager() != null)
{
try
{
Object cl = AccessController.doPrivileged(new PrivilegedExceptionAction()
{
... | |
airlift/airline | src/main/java/io/airlift/airline/GlobalUsage.java | GlobalUsage.usage | public void usage(GlobalMetadata global)
{
StringBuilder stringBuilder = new StringBuilder();
usage(global, stringBuilder);
System.out.println(stringBuilder.toString());
} | java | public void usage(GlobalMetadata global)
{
StringBuilder stringBuilder = new StringBuilder();
usage(global, stringBuilder);
System.out.println(stringBuilder.toString());
} | [
"public",
"void",
"usage",
"(",
"GlobalMetadata",
"global",
")",
"{",
"StringBuilder",
"stringBuilder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"usage",
"(",
"global",
",",
"stringBuilder",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"stringBuil... | Display the help on System.out. | [
"Display",
"the",
"help",
"on",
"System",
".",
"out",
"."
] | fc7a55e34b6361cb97235de5a1b21cba9b508f4b | https://github.com/airlift/airline/blob/fc7a55e34b6361cb97235de5a1b21cba9b508f4b/src/main/java/io/airlift/airline/GlobalUsage.java#L43-L48 | train | Print usage of a single segment. | Create a Java method that does the following: "Print usage of a single segment.". | Of course, here is the Java code you requested:
```java
public void usage(GlobalMetadata global)
{
StringBuilder stringBuilder = new StringBuilder();
usage(global, stringBuilder);
System.out.println(stringBuilder.toString());
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java | StreamSet.setDestUuid | protected void setDestUuid(SIBUuid12 destID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setDestUuid", destID);
this.destID = destID;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setDestUuid");
} | java | protected void setDestUuid(SIBUuid12 destID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setDestUuid", destID);
this.destID = destID;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setDestUuid");
} | [
"protected",
"void",
"setDestUuid",
"(",
"SIBUuid12",
"destID",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setDestUuid\"",
",",
"d... | Set the destination Uuid
@return The destination Uuid | [
"Set",
"the",
"destination",
"Uuid"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L767-L776 | train | Set the destinationUuid field in the AOH file. | Create a Java method that does the following: "Set the destinationUuid field in the AOH file.". | Of course, here is the Java code you requested:
```java
protected void setDestUuid(SIBUuid12 destID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setDestUuid", destID);
this.destID = destID;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()... | |
Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/retry/ExtendedRetryTemplate.java | ExtendedRetryTemplate.execute | public <T> T execute(final Callable<T> callable) throws Exception, ExhaustedRetryException {
return execute(new RetryCallback<T, Exception>() {
public T doWithRetry(RetryContext retryContext) throws Exception {
return callable.call();
}
});
} | java | public <T> T execute(final Callable<T> callable) throws Exception, ExhaustedRetryException {
return execute(new RetryCallback<T, Exception>() {
public T doWithRetry(RetryContext retryContext) throws Exception {
return callable.call();
}
});
} | [
"public",
"<",
"T",
">",
"T",
"execute",
"(",
"final",
"Callable",
"<",
"T",
">",
"callable",
")",
"throws",
"Exception",
",",
"ExhaustedRetryException",
"{",
"return",
"execute",
"(",
"new",
"RetryCallback",
"<",
"T",
",",
"Exception",
">",
"(",
")",
"{... | *
Execute a given {@link Callable} with retry logic.
@param callable The callable to execute
@param <T> The return type of the callable
@return The result of the callable
@throws Exception in the event that the callable throws
@throws ExhaustedRetryException If all retry attempts have been exhausted | [
"*",
"Execute",
"a",
"given",
"{",
"@link",
"Callable",
"}",
"with",
"retry",
"logic",
"."
] | b6a5147c68ee733faf5616d49800abcbba67afe9 | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/retry/ExtendedRetryTemplate.java#L88-L94 | train | Execute a Callable with a retry context. | Create a Java method that does the following: "Execute a Callable with a retry context.". | Of course, here is the Java code you requested:
```java
public <T> T execute(final Callable<T> callable) throws Exception, ExhaustedRetryException {
return execute(new RetryCallback<T, Exception>() {
public T doWithRetry(RetryContext retryContext) throws Exception {
return callable.... | |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java | DynamicReportBuilder.setProperty | public DynamicReportBuilder setProperty(String name, String value) {
this.report.setProperty(name, value);
return this;
} | java | public DynamicReportBuilder setProperty(String name, String value) {
this.report.setProperty(name, value);
return this;
} | [
"public",
"DynamicReportBuilder",
"setProperty",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"report",
".",
"setProperty",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Adds a property to report design, this properties are mostly used by
exporters to know if any specific configuration is needed
@param name
@param value
@return A Dynamic Report Builder | [
"Adds",
"a",
"property",
"to",
"report",
"design",
"this",
"properties",
"are",
"mostly",
"used",
"by",
"exporters",
"to",
"know",
"if",
"any",
"specific",
"configuration",
"is",
"needed"
] | 63919574cc401ae40574d13129f628e66d1682a3 | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/builders/DynamicReportBuilder.java#L1581-L1584 | train | Sets a property to the report. | Create a Java method that does the following: "Sets a property to the report.". | Of course, here is the Java code you requested:
```java
public DynamicReportBuilder setProperty(String name, String value) {
this.report.setProperty(name, value);
return this;
}
```
Hope this helps! | |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.repeat | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeat(long times) {
if (times < 0) {
throw new IllegalArgumentException("times >= 0 required but it was " + times);
}
if (times == 0) {
return empty();
}
return ... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeat(long times) {
if (times < 0) {
throw new IllegalArgumentException("times >= 0 required but it was " + times);
}
if (times == 0) {
return empty();
}
return ... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"repeat",
"(",
"long",
"times",
")",
"{",
"if",
"(",
"times",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentE... | Returns an Observable that repeats the sequence of items emitted by the source ObservableSource at most
{@code count} times.
<p>
<img width="640" height="336" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeatCount.o.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code repeat} does not oper... | [
"Returns",
"an",
"Observable",
"that",
"repeats",
"the",
"sequence",
"of",
"items",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"at",
"most",
"{",
"@code",
"count",
"}",
"times",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"336",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L10430-L10440 | test | Repeat the sequence of items in the source Observable. | Create a Java method that does the following: "Repeat the sequence of items in the source Observable.". | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> repeat(long times) {
if (times < 0) {
throw new IllegalArgumentException("times >= 0 required but it was " + times);
}
if (times == 0... | |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.partFromTo | public ObjectArrayList partFromTo(int from, int to) {
if (size==0) return new ObjectArrayList(0);
checkRangeFromTo(from, to, size);
Object[] part = new Object[to-from+1];
System.arraycopy(elements, from, part, 0, to-from+1);
return new ObjectArrayList(part);
} | java | public ObjectArrayList partFromTo(int from, int to) {
if (size==0) return new ObjectArrayList(0);
checkRangeFromTo(from, to, size);
Object[] part = new Object[to-from+1];
System.arraycopy(elements, from, part, 0, to-from+1);
return new ObjectArrayList(part);
} | [
"public",
"ObjectArrayList",
"partFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"size",
"==",
"0",
")",
"return",
"new",
"ObjectArrayList",
"(",
"0",
")",
";",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"size",
")",
";",
"... | Returns a new list of the part of the receiver between <code>from</code>, inclusive, and <code>to</code>, inclusive.
@param from the index of the first element (inclusive).
@param to the index of the last element (inclusive).
@return a new list
@exception IndexOutOfBoundsException index is out of range (<tt>size()>0... | [
"Returns",
"a",
"new",
"list",
"of",
"the",
"part",
"of",
"the",
"receiver",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"inclusive",
"and",
"<code",
">",
"to<",
"/",
"code",
">",
"inclusive",
"."
] | ab8b0a83dbf600fe80c27711815c90bd3055b217 | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L596-L604 | train | Returns an array of objects that are part of this array from to to. | Create a Java method that does the following: "Returns an array of objects that are part of this array from to to.". | Of course, here is the Java code you requested:
```java
public ObjectArrayList partFromTo(int from, int to) {
if (size==0) return new ObjectArrayList(0);
checkRangeFromTo(from, to, size);
Object[] part = new Object[to-from+1];
System.arraycopy(elements, from, part, 0, to-from+1);
return new ObjectArrayLi... | |
ISOBlue/isoblue-android | libISOBlue-example/src/org/isoblue/ISOBlueDemo/BluetoothService.java | BluetoothService.connect | public synchronized void connect(BluetoothDevice device, boolean past)
throws IOException, InterruptedException {
// Cancel any thread attempting to make a connection
if (mState == STATE_CONNECTING) {
if (mConnectThread != null) {
mConnectThread.cancel();
... | java | public synchronized void connect(BluetoothDevice device, boolean past)
throws IOException, InterruptedException {
// Cancel any thread attempting to make a connection
if (mState == STATE_CONNECTING) {
if (mConnectThread != null) {
mConnectThread.cancel();
... | [
"public",
"synchronized",
"void",
"connect",
"(",
"BluetoothDevice",
"device",
",",
"boolean",
"past",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"// Cancel any thread attempting to make a connection",
"if",
"(",
"mState",
"==",
"STATE_CONNECTING",
")... | Start the ConnectThread to initiate a connection to a remote device.
@param device
The BluetoothDevice to connect
@param past
@param secure
Socket Security type - Secure (true) , Insecure (false)
@throws InterruptedException
@throws IOException | [
"Start",
"the",
"ConnectThread",
"to",
"initiate",
"a",
"connection",
"to",
"a",
"remote",
"device",
"."
] | 7eab6447f1ffb4d2ad4b7b0b60373d02f9646fcb | https://github.com/ISOBlue/isoblue-android/blob/7eab6447f1ffb4d2ad4b7b0b60373d02f9646fcb/libISOBlue-example/src/org/isoblue/ISOBlueDemo/BluetoothService.java#L133-L165 | train | Connect to a device. | Create a Java method that does the following: "Connect to a device.". | Of course, here is the Java code you requested:
```java
public synchronized void connect(BluetoothDevice device, boolean past)
throws IOException, InterruptedException {
// Cancel any thread attempting to make a connection
if (mState == STATE_CONNECTING) {
if (mConnectThread != ... | |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java | DocTreePath.getPath | public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target) {
return getPath(new DocTreePath(treePath, doc), target);
} | java | public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target) {
return getPath(new DocTreePath(treePath, doc), target);
} | [
"public",
"static",
"DocTreePath",
"getPath",
"(",
"TreePath",
"treePath",
",",
"DocCommentTree",
"doc",
",",
"DocTree",
"target",
")",
"{",
"return",
"getPath",
"(",
"new",
"DocTreePath",
"(",
"treePath",
",",
"doc",
")",
",",
"target",
")",
";",
"}"
] | Returns a documentation tree path for a tree node within a compilation unit,
or {@code null} if the node is not found.
@param treePath the path for the node with which the doc comment is associated
@param doc the doc comment associated with the node
@param target a node within the doc comment
@return a path identifying... | [
"Returns",
"a",
"documentation",
"tree",
"path",
"for",
"a",
"tree",
"node",
"within",
"a",
"compilation",
"unit",
"or",
"{"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreePath.java#L49-L51 | train | Get the path for a class or a class specification. | Create a Java method that does the following: "Get the path for a class or a class specification.". | Of course, here is the Java code you requested:
```java
public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target) {
return getPath(new DocTreePath(treePath, doc), target);
}
```
Hope this helps! | |
googleapis/api-client-staging | generated/java/proto-google-appengine-v1/src/main/java/com/google/appengine/v1/Deployment.java | Deployment.getContainer | public com.google.appengine.v1.ContainerInfo getContainer() {
return container_ == null ? com.google.appengine.v1.ContainerInfo.getDefaultInstance() : container_;
} | java | public com.google.appengine.v1.ContainerInfo getContainer() {
return container_ == null ? com.google.appengine.v1.ContainerInfo.getDefaultInstance() : container_;
} | [
"public",
"com",
".",
"google",
".",
"appengine",
".",
"v1",
".",
"ContainerInfo",
"getContainer",
"(",
")",
"{",
"return",
"container_",
"==",
"null",
"?",
"com",
".",
"google",
".",
"appengine",
".",
"v1",
".",
"ContainerInfo",
".",
"getDefaultInstance",
... | <pre>
A Docker image that App Engine uses to run the version.
Only applicable for instances in App Engine flexible environment.
</pre>
<code>.google.appengine.v1.ContainerInfo container = 2;</code> | [
"<pre",
">",
"A",
"Docker",
"image",
"that",
"App",
"Engine",
"uses",
"to",
"run",
"the",
"version",
".",
"Only",
"applicable",
"for",
"instances",
"in",
"App",
"Engine",
"flexible",
"environment",
".",
"<",
"/",
"pre",
">"
] | 126aee68401977b5dc2b1b4be48decd0e9759db7 | https://github.com/googleapis/api-client-staging/blob/126aee68401977b5dc2b1b4be48decd0e9759db7/generated/java/proto-google-appengine-v1/src/main/java/com/google/appengine/v1/Deployment.java#L252-L254 | train | Gets the value of the container property. | Create a Java method that does the following: "Gets the value of the container property.". | Of course, here is the Java code you requested:
```java
public com.google.appengine.v1.ContainerInfo getContainer() {
return container_ == null ? com.google.appengine.v1.ContainerInfo.getDefaultInstance() : container_;
}
```
Hope this helps! | |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java | BaseBigtableTableAdminClient.snapshotTableAsync | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Snapshot, SnapshotTableMetadata> snapshotTableAsync(
String name, String cluster, String snapshotId, String description) {
SnapshotTableRequest request =
SnapshotT... | java | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Snapshot, SnapshotTableMetadata> snapshotTableAsync(
String name, String cluster, String snapshotId, String description) {
SnapshotTableRequest request =
SnapshotT... | [
"@",
"BetaApi",
"(",
"\"The surface for long-running operations is not stable yet and may change in the future.\"",
")",
"public",
"final",
"OperationFuture",
"<",
"Snapshot",
",",
"SnapshotTableMetadata",
">",
"snapshotTableAsync",
"(",
"String",
"name",
",",
"String",
"cluste... | Creates a new snapshot in the specified cluster from the specified source table. The cluster
and the table must be in the same instance.
<p>Note: This is a private alpha release of Cloud Bigtable snapshots. This feature is not
currently available to most Cloud Bigtable customers. This feature might be changed in
backw... | [
"Creates",
"a",
"new",
"snapshot",
"in",
"the",
"specified",
"cluster",
"from",
"the",
"specified",
"source",
"table",
".",
"The",
"cluster",
"and",
"the",
"table",
"must",
"be",
"in",
"the",
"same",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java#L1229-L1242 | train | Asynchronously snapshots a table. | Create a Java method that does the following: "Asynchronously snapshots a table.". | Of course, here is the Java code you requested:
```java
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Snapshot, SnapshotTableMetadata> snapshotTableAsync(
String name, String cluster, String snapshotId, String description... | |
aws/aws-sdk-java | aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/BatchScheduleActionCreateResult.java | BatchScheduleActionCreateResult.withScheduleActions | public BatchScheduleActionCreateResult withScheduleActions(ScheduleAction... scheduleActions) {
if (this.scheduleActions == null) {
setScheduleActions(new java.util.ArrayList<ScheduleAction>(scheduleActions.length));
}
for (ScheduleAction ele : scheduleActions) {
this.sch... | java | public BatchScheduleActionCreateResult withScheduleActions(ScheduleAction... scheduleActions) {
if (this.scheduleActions == null) {
setScheduleActions(new java.util.ArrayList<ScheduleAction>(scheduleActions.length));
}
for (ScheduleAction ele : scheduleActions) {
this.sch... | [
"public",
"BatchScheduleActionCreateResult",
"withScheduleActions",
"(",
"ScheduleAction",
"...",
"scheduleActions",
")",
"{",
"if",
"(",
"this",
".",
"scheduleActions",
"==",
"null",
")",
"{",
"setScheduleActions",
"(",
"new",
"java",
".",
"util",
".",
"ArrayList",... | List of actions that have been created in the schedule.
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setScheduleActions(java.util.Collection)} or {@link #withScheduleActions(java.util.Collection)} if you
want to override the existing values.
</p>
@param scheduleActions
Lis... | [
"List",
"of",
"actions",
"that",
"have",
"been",
"created",
"in",
"the",
"schedule",
".",
"<p",
">",
"<b",
">",
"NOTE",
":",
"<",
"/",
"b",
">",
"This",
"method",
"appends",
"the",
"values",
"to",
"the",
"existing",
"list",
"(",
"if",
"any",
")",
"... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-medialive/src/main/java/com/amazonaws/services/medialive/model/BatchScheduleActionCreateResult.java#L71-L79 | train | A list of schedule actions to be created. | Create a Java method that does the following: "A list of schedule actions to be created.". | Of course, here is the Java code you requested:
```java
public BatchScheduleActionCreateResult withScheduleActions(ScheduleAction... scheduleActions) {
if (this.scheduleActions == null) {
setScheduleActions(new java.util.ArrayList<ScheduleAction>(scheduleActions.length));
}
for (Sch... | |
wildfly/wildfly | web-common/src/main/java/org/jboss/as/web/common/ConcurrentReferenceHashMap.java | ConcurrentReferenceHashMap.put | public V put(K key, V value) {
if (value == null)
throw new NullPointerException();
int hash = hashOf(key);
return segmentFor(hash).put(key, hash, value, false);
} | java | public V put(K key, V value) {
if (value == null)
throw new NullPointerException();
int hash = hashOf(key);
return segmentFor(hash).put(key, hash, value, false);
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"int",
"hash",
"=",
"hashOf",
"(",
"key",
")",
";",
"return",
"segmentFor",
"(",
"hash... | Maps the specified key to the specified value in this table.
Neither the key nor the value can be null.
<p> The value can be retrieved by calling the <tt>get</tt> method
with a key that is equal to the original key.
@param key key with which the specified value is to be associated
@param value value to be associated ... | [
"Maps",
"the",
"specified",
"key",
"to",
"the",
"specified",
"value",
"in",
"this",
"table",
".",
"Neither",
"the",
"key",
"nor",
"the",
"value",
"can",
"be",
"null",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/web-common/src/main/java/org/jboss/as/web/common/ConcurrentReferenceHashMap.java#L1219-L1224 | test | Put a value into the cache. | Create a Java method that does the following: "Put a value into the cache.". | Of course, here is the Java code you requested:
```java
public V put(K key, V value) {
if (value == null)
throw new NullPointerException();
int hash = hashOf(key);
return segmentFor(hash).put(key, hash, value, false);
}
```
Hope this helps! | |
kuali/kc-s2sgen | coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudget10V1_1Generator.java | RRBudget10V1_1Generator.getKeyPersons | private KeyPersons getKeyPersons(BudgetPeriodDto periodInfo) {
KeyPersons keyPersons = KeyPersons.Factory.newInstance();
ScaleTwoDecimal extraFunds = ScaleTwoDecimal.ZERO;
ScaleTwoDecimal baseSalaryByPeriod;
if (periodInfo != null) {
if (periodInfo.getKeyPersons() != null) ... | java | private KeyPersons getKeyPersons(BudgetPeriodDto periodInfo) {
KeyPersons keyPersons = KeyPersons.Factory.newInstance();
ScaleTwoDecimal extraFunds = ScaleTwoDecimal.ZERO;
ScaleTwoDecimal baseSalaryByPeriod;
if (periodInfo != null) {
if (periodInfo.getKeyPersons() != null) ... | [
"private",
"KeyPersons",
"getKeyPersons",
"(",
"BudgetPeriodDto",
"periodInfo",
")",
"{",
"KeyPersons",
"keyPersons",
"=",
"KeyPersons",
".",
"Factory",
".",
"newInstance",
"(",
")",
";",
"ScaleTwoDecimal",
"extraFunds",
"=",
"ScaleTwoDecimal",
".",
"ZERO",
";",
"... | This method gets KeyPersons details such as
Name,ProjectRole,Compensation,TotalFundForAttachedKeyPersons
TotalFundForKeyPersons and AttachedKeyPersons based on BudgetPeriodInfo
for the RRBudget10.
@param periodInfo
(BudgetPeriodInfo) budget period entry.
@return KeyPersons details corresponding to the BudgetPeriodInfo... | [
"This",
"method",
"gets",
"KeyPersons",
"details",
"such",
"as",
"Name",
"ProjectRole",
"Compensation",
"TotalFundForAttachedKeyPersons",
"TotalFundForKeyPersons",
"and",
"AttachedKeyPersons",
"based",
"on",
"BudgetPeriodInfo",
"for",
"the",
"RRBudget10",
"."
] | 2886380e1e3cb8bdd732ba99b2afa6ffc630bb37 | https://github.com/kuali/kc-s2sgen/blob/2886380e1e3cb8bdd732ba99b2afa6ffc630bb37/coeus-s2sgen-impl/src/main/java/org/kuali/coeus/s2sgen/impl/generate/support/RRBudget10V1_1Generator.java#L782-L885 | train | Method to get KeyPersons from BudgetPeriodInfo for a RRBudget. | Create a Java method that does the following: "Method to get KeyPersons from BudgetPeriodInfo for a RRBudget.". | Of course, here is the Java code you requested:
```java
private KeyPersons getKeyPersons(BudgetPeriodDto periodInfo) {
KeyPersons keyPersons = KeyPersons.Factory.newInstance();
ScaleTwoDecimal extraFunds = ScaleTwoDecimal.ZERO;
ScaleTwoDecimal baseSalaryByPeriod;
if (periodInfo != nul... | |
astrapi69/jaulp-wicket | jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/application/ApplicationExtensions.java | ApplicationExtensions.setDeploymentModeConfiguration | public static void setDeploymentModeConfiguration(final Application application)
{
application.getMarkupSettings().setStripComments(true);
// The resources are never polled. This are properties, html,
// css, js files.
application.getResourceSettings().setResourcePollFrequency(null);
application.getResourceS... | java | public static void setDeploymentModeConfiguration(final Application application)
{
application.getMarkupSettings().setStripComments(true);
// The resources are never polled. This are properties, html,
// css, js files.
application.getResourceSettings().setResourcePollFrequency(null);
application.getResourceS... | [
"public",
"static",
"void",
"setDeploymentModeConfiguration",
"(",
"final",
"Application",
"application",
")",
"{",
"application",
".",
"getMarkupSettings",
"(",
")",
".",
"setStripComments",
"(",
"true",
")",
";",
"// The resources are never polled. This are properties, ht... | Sets the deployment settings for deployment mode for the given application.
@param application
the application to set the settings | [
"Sets",
"the",
"deployment",
"settings",
"for",
"deployment",
"mode",
"for",
"the",
"given",
"application",
"."
] | 85d74368d00abd9bb97659b5794e38c0f8a013d4 | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-base/src/main/java/de/alpharogroup/wicket/base/util/application/ApplicationExtensions.java#L359-L377 | train | Sets the deployment mode configuration. | Create a Java method that does the following: "Sets the deployment mode configuration.". | Of course, here is the Java code you requested:
```java
public static void setDeploymentModeConfiguration(final Application application)
{
application.getMarkupSettings().setStripComments(true);
// The resources are never polled. This are properties, html,
// css, js files.
application.getResourceSettings().s... | |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/jackson/helper/ThreadJacksonMixInHolder.java | ThreadJacksonMixInHolder.addMixIns | public static void addMixIns(Set<Map.Entry<Class<?>, Class<?>>> toAddMixIns) {
ThreadJacksonMixInHolder holder = holderThreadLocal.get();
if (holder == null) {
holder = new ThreadJacksonMixInHolder();
holderThreadLocal.set(holder);
}
if (holder.mixIns == null) {
... | java | public static void addMixIns(Set<Map.Entry<Class<?>, Class<?>>> toAddMixIns) {
ThreadJacksonMixInHolder holder = holderThreadLocal.get();
if (holder == null) {
holder = new ThreadJacksonMixInHolder();
holderThreadLocal.set(holder);
}
if (holder.mixIns == null) {
... | [
"public",
"static",
"void",
"addMixIns",
"(",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"Class",
"<",
"?",
">",
",",
"Class",
"<",
"?",
">",
">",
">",
"toAddMixIns",
")",
"{",
"ThreadJacksonMixInHolder",
"holder",
"=",
"holderThreadLocal",
".",
"get",
"(",
... | 不同于setMixIns,addMixIns为增加MixIn集合到线程内,即不会清除已经保存的数据
<br>2014年4月4日 下午12:08:15
@param toAddMixIns | [
"不同于setMixIns,addMixIns为增加MixIn集合到线程内,即不会清除已经保存的数据",
"<br",
">",
"2014年4月4日",
"下午12",
":",
"08",
":",
"15"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/jackson/helper/ThreadJacksonMixInHolder.java#L84-L94 | test | Add a set of mixins to the ThreadLocal. | Create a Java method that does the following: "Add a set of mixins to the ThreadLocal.". | Of course, here is the Java code you requested:
```java
public static void addMixIns(Set<Map.Entry<Class<?>, Class<?>>> toAddMixIns) {
ThreadJacksonMixInHolder holder = holderThreadLocal.get();
if (holder == null) {
holder = new ThreadJacksonMixInHolder();
holderThreadLocal.set(... | |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/autodiff/VTensor.java | VTensor.getStrides | private static int[] getStrides(int[] dims) {
int rightmost = dims.length - 1;
int[] strides = new int[dims.length];
if (dims.length > 0) {
strides[rightmost] = 1;
for (int i=rightmost-1; i >= 0; i--) {
strides[i] = dims[i+1]*strides[i+1];
... | java | private static int[] getStrides(int[] dims) {
int rightmost = dims.length - 1;
int[] strides = new int[dims.length];
if (dims.length > 0) {
strides[rightmost] = 1;
for (int i=rightmost-1; i >= 0; i--) {
strides[i] = dims[i+1]*strides[i+1];
... | [
"private",
"static",
"int",
"[",
"]",
"getStrides",
"(",
"int",
"[",
"]",
"dims",
")",
"{",
"int",
"rightmost",
"=",
"dims",
".",
"length",
"-",
"1",
";",
"int",
"[",
"]",
"strides",
"=",
"new",
"int",
"[",
"dims",
".",
"length",
"]",
";",
"if",
... | Gets the strides for the given dimensions. The stride for dimension i
(stride[i]) denotes the step forward in values array necessary to
increase the index for that dimension by 1. | [
"Gets",
"the",
"strides",
"for",
"the",
"given",
"dimensions",
".",
"The",
"stride",
"for",
"dimension",
"i",
"(",
"stride",
"[",
"i",
"]",
")",
"denotes",
"the",
"step",
"forward",
"in",
"values",
"array",
"necessary",
"to",
"increase",
"the",
"index",
... | 786294cbac7cc65dbc32210c10acc32ed0c69233 | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/autodiff/VTensor.java#L183-L193 | train | get strides for a set of image dimensions | Create a Java method that does the following: "get strides for a set of image dimensions". | Of course, here is the Java code you requested:
```java
private static int[] getStrides(int[] dims) {
int rightmost = dims.length - 1;
int[] strides = new int[dims.length];
if (dims.length > 0) {
strides[rightmost] = 1;
for (int i=rightmost-1; i >= 0; i--) {
... | |
airlift/slice | src/main/java/io/airlift/slice/Slices.java | Slices.wrappedFloatArray | public static Slice wrappedFloatArray(float[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | java | public static Slice wrappedFloatArray(float[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
} | [
"public",
"static",
"Slice",
"wrappedFloatArray",
"(",
"float",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"EMPTY_SLICE",
";",
"}",
"return",
"new",
"Slice",
"(",
"array"... | Creates a slice over the specified array range.
@param offset the array position at which the slice begins
@param length the number of array positions to include in the slice | [
"Creates",
"a",
"slice",
"over",
"the",
"specified",
"array",
"range",
"."
] | 7166cb0319e3655f8ba15f5a7ccf3d2f721c1242 | https://github.com/airlift/slice/blob/7166cb0319e3655f8ba15f5a7ccf3d2f721c1242/src/main/java/io/airlift/slice/Slices.java#L259-L265 | train | Gets a slice that wraps a float array. | Create a Java method that does the following: "Gets a slice that wraps a float array.". | Of course, here is the Java code you requested:
```java
public static Slice wrappedFloatArray(float[] array, int offset, int length)
{
if (length == 0) {
return EMPTY_SLICE;
}
return new Slice(array, offset, length);
}
```
Hope this helps! | |
cologneintelligence/FitGoodies | fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/Fixture.java | Fixture.copyParamsToFixture | public void copyParamsToFixture() {
for (final String fieldName : getArgNames()) {
ValueReceiver valueReceiver;
try {
valueReceiver = valueReceiverFactory.createReceiver(this, fieldName);
} catch (NoSuchMethodException | NoSuchFieldException e) {
... | java | public void copyParamsToFixture() {
for (final String fieldName : getArgNames()) {
ValueReceiver valueReceiver;
try {
valueReceiver = valueReceiverFactory.createReceiver(this, fieldName);
} catch (NoSuchMethodException | NoSuchFieldException e) {
... | [
"public",
"void",
"copyParamsToFixture",
"(",
")",
"{",
"for",
"(",
"final",
"String",
"fieldName",
":",
"getArgNames",
"(",
")",
")",
"{",
"ValueReceiver",
"valueReceiver",
";",
"try",
"{",
"valueReceiver",
"=",
"valueReceiverFactory",
".",
"createReceiver",
"(... | Reads the argument list and copies all values in public members
with the same name.
<p>
If these members do not exist, the argument is skipped. You can still
read the values using {@link #getArg(String, String)}.
@see #getArg(String, String) getArg | [
"Reads",
"the",
"argument",
"list",
"and",
"copies",
"all",
"values",
"in",
"public",
"members",
"with",
"the",
"same",
"name",
".",
"<p",
">",
"If",
"these",
"members",
"do",
"not",
"exist",
"the",
"argument",
"is",
"skipped",
".",
"You",
"can",
"still"... | 834e42d1f41b4b9226060b1e83a80cc69ea88c7b | https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-core/src/main/java/de/cologneintelligence/fitgoodies/Fixture.java#L198-L216 | test | Copy params to fixture. | Create a Java method that does the following: "Copy params to fixture.". | Of course, here is the Java code you requested:
```java
public void copyParamsToFixture() {
for (final String fieldName : getArgNames()) {
ValueReceiver valueReceiver;
try {
valueReceiver = valueReceiverFactory.createReceiver(this, fieldName);
} catch (NoSuch... | |
akquinet/androlog | androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java | Report.buildBaseReport | private void buildBaseReport() throws JSONException {
report = new JSONObject();
JSONObject dates = new JSONObject();
dates.put("date.system", created);
dates.put("date", new Date(created).toString());
dates.put("locale", Locale.getDefault());
report.put("dates", dates);
... | java | private void buildBaseReport() throws JSONException {
report = new JSONObject();
JSONObject dates = new JSONObject();
dates.put("date.system", created);
dates.put("date", new Date(created).toString());
dates.put("locale", Locale.getDefault());
report.put("dates", dates);
... | [
"private",
"void",
"buildBaseReport",
"(",
")",
"throws",
"JSONException",
"{",
"report",
"=",
"new",
"JSONObject",
"(",
")",
";",
"JSONObject",
"dates",
"=",
"new",
"JSONObject",
"(",
")",
";",
"dates",
".",
"put",
"(",
"\"date.system\"",
",",
"created",
... | Adds the report header to the report (dates, locale, message, errors
...).
@param report the report
@throws JSONException if the data cannot be added | [
"Adds",
"the",
"report",
"header",
"to",
"the",
"report",
"(",
"dates",
"locale",
"message",
"errors",
"...",
")",
"."
] | 82fa81354c01c9b1d1928062b634ba21f14be560 | https://github.com/akquinet/androlog/blob/82fa81354c01c9b1d1928062b634ba21f14be560/androlog/src/main/java/de/akquinet/android/androlog/reporter/Report.java#L200-L219 | train | Build the base report. | Create a Java method that does the following: "Build the base report.". | Of course, here is the Java code you requested:
```java
private void buildBaseReport() throws JSONException {
report = new JSONObject();
JSONObject dates = new JSONObject();
dates.put("date.system", created);
dates.put("date", new Date(created).toString());
dates.put("locale", L... | |
dyu/protostuff-1.0.x | protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/ProtoParser.java | ProtoParser.header_syntax | public final ProtoParser.header_syntax_return header_syntax(Proto proto) throws RecognitionException {
ProtoParser.header_syntax_return retval = new ProtoParser.header_syntax_return();
retval.start = input.LT(1);
Object root_0 = null;
Token SYNTAX32=null;
Token ASSIGN33=null;
... | java | public final ProtoParser.header_syntax_return header_syntax(Proto proto) throws RecognitionException {
ProtoParser.header_syntax_return retval = new ProtoParser.header_syntax_return();
retval.start = input.LT(1);
Object root_0 = null;
Token SYNTAX32=null;
Token ASSIGN33=null;
... | [
"public",
"final",
"ProtoParser",
".",
"header_syntax_return",
"header_syntax",
"(",
"Proto",
"proto",
")",
"throws",
"RecognitionException",
"{",
"ProtoParser",
".",
"header_syntax_return",
"retval",
"=",
"new",
"ProtoParser",
".",
"header_syntax_return",
"(",
")",
"... | com/dyuproject/protostuff/parser/ProtoParser.g:116:1: header_syntax[Proto proto] : SYNTAX ASSIGN STRING_LITERAL SEMICOLON ; | [
"com",
"/",
"dyuproject",
"/",
"protostuff",
"/",
"parser",
"/",
"ProtoParser",
".",
"g",
":",
"116",
":",
"1",
":",
"header_syntax",
"[",
"Proto",
"proto",
"]",
":",
"SYNTAX",
"ASSIGN",
"STRING_LITERAL",
"SEMICOLON",
";"
] | d7c964ec20da3fe44699d86ee95c2677ddffde96 | https://github.com/dyu/protostuff-1.0.x/blob/d7c964ec20da3fe44699d86ee95c2677ddffde96/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/ProtoParser.java#L1215-L1284 | train | Parses the input of a header_syntax request. | Create a Java method that does the following: "Parses the input of a header_syntax request.". | Of course, here is the Java code you requested:
```java
public final ProtoParser.header_syntax_return header_syntax(Proto proto) throws RecognitionException {
ProtoParser.header_syntax_return retval = new ProtoParser.header_syntax_return();
retval.start = input.LT(1);
Object root_0 = null;
... | |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java | EntityGroupImpl.getMemberGroups | private Iterator<IEntityGroup> getMemberGroups() throws GroupsException {
Set<IEntityGroup> rslt = new HashSet<>();
for (IGroupMember child : getChildren()) {
if (child.isGroup()) {
rslt.add((IEntityGroup) child);
}
}
return rslt.iterator();
... | java | private Iterator<IEntityGroup> getMemberGroups() throws GroupsException {
Set<IEntityGroup> rslt = new HashSet<>();
for (IGroupMember child : getChildren()) {
if (child.isGroup()) {
rslt.add((IEntityGroup) child);
}
}
return rslt.iterator();
... | [
"private",
"Iterator",
"<",
"IEntityGroup",
">",
"getMemberGroups",
"(",
")",
"throws",
"GroupsException",
"{",
"Set",
"<",
"IEntityGroup",
">",
"rslt",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"IGroupMember",
"child",
":",
"getChildren",
"(",... | Returns an <code>Iterator</code> over the groups in our member <code>Collection</code>.
Reflects pending changes.
@return Iterator | [
"Returns",
"an",
"<code",
">",
"Iterator<",
"/",
"code",
">",
"over",
"the",
"groups",
"in",
"our",
"member",
"<code",
">",
"Collection<",
"/",
"code",
">",
".",
"Reflects",
"pending",
"changes",
"."
] | c1986542abb9acd214268f2df21c6305ad2f262b | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/EntityGroupImpl.java#L277-L287 | train | Get the members of this group. | Create a Java method that does the following: "Get the members of this group.". | Of course, here is the Java code you requested:
```java
private Iterator<IEntityGroup> getMemberGroups() throws GroupsException {
Set<IEntityGroup> rslt = new HashSet<>();
for (IGroupMember child : getChildren()) {
if (child.isGroup()) {
rslt.add((IEntityGroup) child);
... | |
redkale/redkale | src/org/redkale/util/SelectColumn.java | SelectColumn.createExcludes | @Deprecated
public static SelectColumn createExcludes(String[] cols, String... columns) {
return new SelectColumn(Utility.append(cols, columns), true);
} | java | @Deprecated
public static SelectColumn createExcludes(String[] cols, String... columns) {
return new SelectColumn(Utility.append(cols, columns), true);
} | [
"@",
"Deprecated",
"public",
"static",
"SelectColumn",
"createExcludes",
"(",
"String",
"[",
"]",
"cols",
",",
"String",
"...",
"columns",
")",
"{",
"return",
"new",
"SelectColumn",
"(",
"Utility",
".",
"append",
"(",
"cols",
",",
"columns",
")",
",",
"tru... | @deprecated
class中的字段名
@param cols 排除的字段名集合
@param columns 排除的字段名集合
@return SelectColumn | [
"@deprecated",
"class中的字段名"
] | ea5169b5c5ea7412fd762331c0c497165832e901 | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/SelectColumn.java#L156-L159 | train | Creates a exclude column from the given columns. | Create a Java method that does the following: "Creates a exclude column from the given columns.". | Of course, here is the Java code you requested:
```java
@Deprecated
public static SelectColumn createExcludes(String[] cols, String... columns) {
return new SelectColumn(Utility.append(cols, columns), true);
}
```
Hope this helps! | |
oblac/jodd | jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerBundlesManager.java | HtmlStaplerBundlesManager.createBundle | protected void createBundle(final String contextPath, final String actionPath, final String bundleId, final List<String>sources) throws IOException {
final File bundleFile = createBundleFile(bundleId);
if (bundleFile.exists()) {
return;
}
StringBand sb = new StringBand(sources.size() * 2);
for (String src... | java | protected void createBundle(final String contextPath, final String actionPath, final String bundleId, final List<String>sources) throws IOException {
final File bundleFile = createBundleFile(bundleId);
if (bundleFile.exists()) {
return;
}
StringBand sb = new StringBand(sources.size() * 2);
for (String src... | [
"protected",
"void",
"createBundle",
"(",
"final",
"String",
"contextPath",
",",
"final",
"String",
"actionPath",
",",
"final",
"String",
"bundleId",
",",
"final",
"List",
"<",
"String",
">",
"sources",
")",
"throws",
"IOException",
"{",
"final",
"File",
"bund... | Creates bundle file by loading resource files content. If bundle file already
exist it will not be recreated! | [
"Creates",
"bundle",
"file",
"by",
"loading",
"resource",
"files",
"content",
".",
"If",
"bundle",
"file",
"already",
"exist",
"it",
"will",
"not",
"be",
"recreated!"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-htmlstapler/src/main/java/jodd/htmlstapler/HtmlStaplerBundlesManager.java#L417-L496 | test | Creates a bundle from the list of sources. | Create a Java method that does the following: "Creates a bundle from the list of sources.". | Of course, here is the Java code you requested:
```java
protected void createBundle(final String contextPath, final String actionPath, final String bundleId, final List<String>sources) throws IOException {
final File bundleFile = createBundleFile(bundleId);
if (bundleFile.exists()) {
return;
}
StringBand s... | |
DiUS/pact-jvm | pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java | LambdaDslObject.date | public LambdaDslObject date(String name, String format) {
object.date(name, format);
return this;
} | java | public LambdaDslObject date(String name, String format) {
object.date(name, format);
return this;
} | [
"public",
"LambdaDslObject",
"date",
"(",
"String",
"name",
",",
"String",
"format",
")",
"{",
"object",
".",
"date",
"(",
"name",
",",
"format",
")",
";",
"return",
"this",
";",
"}"
] | Attribute that must match the provided date format
@param name attribute date
@param format date format to match | [
"Attribute",
"that",
"must",
"match",
"the",
"provided",
"date",
"format"
] | 2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer-java8/src/main/java/io/pactfoundation/consumer/dsl/LambdaDslObject.java#L148-L151 | train | Sets the date field of the object. | Create a Java method that does the following: "Sets the date field of the object.". | Of course, here is the Java code you requested:
```java
public LambdaDslObject date(String name, String format) {
object.date(name, format);
return this;
}
```
Hope this helps! | |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java | TrafficUtils.start | public static long start(Context context, String tag) {
final int uid = getUid(context);
if (uid > 0) {
long appRxValue = TrafficStats.getUidRxBytes(uid);
long appTxValue = TrafficStats.getUidTxBytes(uid);
sReceivedBytes.put(tag, appRxValue);
sSendBytes.pu... | java | public static long start(Context context, String tag) {
final int uid = getUid(context);
if (uid > 0) {
long appRxValue = TrafficStats.getUidRxBytes(uid);
long appTxValue = TrafficStats.getUidTxBytes(uid);
sReceivedBytes.put(tag, appRxValue);
sSendBytes.pu... | [
"public",
"static",
"long",
"start",
"(",
"Context",
"context",
",",
"String",
"tag",
")",
"{",
"final",
"int",
"uid",
"=",
"getUid",
"(",
"context",
")",
";",
"if",
"(",
"uid",
">",
"0",
")",
"{",
"long",
"appRxValue",
"=",
"TrafficStats",
".",
"get... | 开始流量统计
@param context Context
@param tag traffic tag
@return received bytes | [
"开始流量统计"
] | 1bfdf99d0b81a849aa0fa6697c53ed673151ca39 | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/TrafficUtils.java#L37-L50 | train | Start Traffic Stats. | Create a Java method that does the following: "Start Traffic Stats.". | Of course, here is the Java code you requested:
```java
public static long start(Context context, String tag) {
final int uid = getUid(context);
if (uid > 0) {
long appRxValue = TrafficStats.getUidRxBytes(uid);
long appTxValue = TrafficStats.getUidTxBytes(uid);
sRece... | |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/function/MonetaryOperators.java | MonetaryOperators.rounding | public static MonetaryOperator rounding(RoundingMode roundingMode, int scale) {
return new RoudingMonetaryAmountOperator(Objects.requireNonNull(roundingMode), scale);
} | java | public static MonetaryOperator rounding(RoundingMode roundingMode, int scale) {
return new RoudingMonetaryAmountOperator(Objects.requireNonNull(roundingMode), scale);
} | [
"public",
"static",
"MonetaryOperator",
"rounding",
"(",
"RoundingMode",
"roundingMode",
",",
"int",
"scale",
")",
"{",
"return",
"new",
"RoudingMonetaryAmountOperator",
"(",
"Objects",
".",
"requireNonNull",
"(",
"roundingMode",
")",
",",
"scale",
")",
";",
"}"
] | Rounding the {@link MonetaryAmount} using {@link CurrencyUnit#getDefaultFractionDigits()}
and {@link RoundingMode}.
For example, 'EUR 2.3523' will return 'EUR 2.35',
and 'BHD -1.34534432' will return 'BHD -1.345'.
<pre>
{@code
MonetaryAmount money = Money.parse("EUR 2.355432");
MonetaryAmount result = ConversionOpera... | [
"Rounding",
"the",
"{",
"@link",
"MonetaryAmount",
"}",
"using",
"{",
"@link",
"CurrencyUnit#getDefaultFractionDigits",
"()",
"}",
"and",
"{",
"@link",
"RoundingMode",
"}",
"."
] | 9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2 | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/function/MonetaryOperators.java#L251-L253 | train | Create a new instance of this class with the specified rounding mode and scale. | Create a Java method that does the following: "Create a new instance of this class with the specified rounding mode and scale.". | Of course, here is the Java code you requested:
```java
public static MonetaryOperator rounding(RoundingMode roundingMode, int scale) {
return new RoudingMonetaryAmountOperator(Objects.requireNonNull(roundingMode), scale);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/CreateDeploymentGroupRequest.java | CreateDeploymentGroupRequest.setEcsServices | public void setEcsServices(java.util.Collection<ECSService> ecsServices) {
if (ecsServices == null) {
this.ecsServices = null;
return;
}
this.ecsServices = new com.amazonaws.internal.SdkInternalList<ECSService>(ecsServices);
} | java | public void setEcsServices(java.util.Collection<ECSService> ecsServices) {
if (ecsServices == null) {
this.ecsServices = null;
return;
}
this.ecsServices = new com.amazonaws.internal.SdkInternalList<ECSService>(ecsServices);
} | [
"public",
"void",
"setEcsServices",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"ECSService",
">",
"ecsServices",
")",
"{",
"if",
"(",
"ecsServices",
"==",
"null",
")",
"{",
"this",
".",
"ecsServices",
"=",
"null",
";",
"return",
";",
"}",
"this",
... | <p>
The target Amazon ECS services in the deployment group. This applies only to deployment groups that use the
Amazon ECS compute platform. A target Amazon ECS service is specified as an Amazon ECS cluster and service name
pair using the format <code><clustername>:<servicename></code>.
</p>
@param ecsServ... | [
"<p",
">",
"The",
"target",
"Amazon",
"ECS",
"services",
"in",
"the",
"deployment",
"group",
".",
"This",
"applies",
"only",
"to",
"deployment",
"groups",
"that",
"use",
"the",
"Amazon",
"ECS",
"compute",
"platform",
".",
"A",
"target",
"Amazon",
"ECS",
"s... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/CreateDeploymentGroupRequest.java#L982-L989 | train | Sets the value of the ecsServices property. | Create a Java method that does the following: "Sets the value of the ecsServices property.". | Of course, here is the Java code you requested:
```java
public void setEcsServices(java.util.Collection<ECSService> ecsServices) {
if (ecsServices == null) {
this.ecsServices = null;
return;
}
this.ecsServices = new com.amazonaws.internal.SdkInternalList<ECSService>(ecs... | |
Alluxio/alluxio | core/transport/src/main/java/alluxio/grpc/GetConfigurationPResponse.java | GetConfigurationPResponse.getPathConfigs | @java.lang.Deprecated
public java.util.Map<java.lang.String, alluxio.grpc.ConfigProperties> getPathConfigs() {
return getPathConfigsMap();
} | java | @java.lang.Deprecated
public java.util.Map<java.lang.String, alluxio.grpc.ConfigProperties> getPathConfigs() {
return getPathConfigsMap();
} | [
"@",
"java",
".",
"lang",
".",
"Deprecated",
"public",
"java",
".",
"util",
".",
"Map",
"<",
"java",
".",
"lang",
".",
"String",
",",
"alluxio",
".",
"grpc",
".",
"ConfigProperties",
">",
"getPathConfigs",
"(",
")",
"{",
"return",
"getPathConfigsMap",
"(... | Use {@link #getPathConfigsMap()} instead. | [
"Use",
"{"
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/transport/src/main/java/alluxio/grpc/GetConfigurationPResponse.java#L186-L189 | train | Gets the value of the pathConfigs property. | Create a Java method that does the following: "Gets the value of the pathConfigs property.". | Of course, here is the Java code you requested:
```java
@java.lang.Deprecated
public java.util.Map<java.lang.String, alluxio.grpc.ConfigProperties> getPathConfigs() {
return getPathConfigsMap();
}
```
Hope this helps! | |
alkacon/opencms-core | src/org/opencms/ui/components/CmsDateField.java | CmsDateField.dateToLocalDateTime | public static LocalDateTime dateToLocalDateTime(Date date) {
if (date == null) {
return null;
}
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
} | java | public static LocalDateTime dateToLocalDateTime(Date date) {
if (date == null) {
return null;
}
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
} | [
"public",
"static",
"LocalDateTime",
"dateToLocalDateTime",
"(",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"LocalDateTime",
".",
"ofInstant",
"(",
"date",
".",
"toInstant",
"(",
")",
",",
"... | Converts a {@link Date} object to a {@link LocalDateTime} object.<p>
@param date the date
@return the local date time | [
"Converts",
"a",
"{",
"@link",
"Date",
"}",
"object",
"to",
"a",
"{",
"@link",
"LocalDateTime",
"}",
"object",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsDateField.java#L67-L73 | train | Convert a Date object to a LocalDateTime object. | Create a Java method that does the following: "Convert a Date object to a LocalDateTime object.". | Of course, here is the Java code you requested:
```java
public static LocalDateTime dateToLocalDateTime(Date date) {
if (date == null) {
return null;
}
return LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
}
```
Hope this helps! | |
virjar/sipsoup | src/main/java/com/virjar/sipsoup/parse/TokenQueue.java | TokenQueue.chompBalanced | public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
boolean inQuote = false;
do {
if (isEmpty())
break;
Character c = consume();
if (last == 0 || last != ESC)... | java | public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
boolean inQuote = false;
do {
if (isEmpty())
break;
Character c = consume();
if (last == 0 || last != ESC)... | [
"public",
"String",
"chompBalanced",
"(",
"char",
"open",
",",
"char",
"close",
")",
"{",
"int",
"start",
"=",
"-",
"1",
";",
"int",
"end",
"=",
"-",
"1",
";",
"int",
"depth",
"=",
"0",
";",
"char",
"last",
"=",
"0",
";",
"boolean",
"inQuote",
"=... | Pulls a balanced string off the queue. E.g. if queue is "(one (two) three) four", (,) will return
"one (two) three", and leave " four" on the queue. Unbalanced openers and closers can quoted (with ' or ") or
escaped (with \). Those escapes will be left in the returned string, which is suitable for regexes (where we nee... | [
"Pulls",
"a",
"balanced",
"string",
"off",
"the",
"queue",
".",
"E",
".",
"g",
".",
"if",
"queue",
"is",
"(",
"one",
"(",
"two",
")",
"three",
")",
"four",
"(",
")",
"will",
"return",
"one",
"(",
"two",
")",
"three",
"and",
"leave",
"four",
"on",... | 992ffcc1f05f5385557f8bef7c1ee3d6a02f54cf | https://github.com/virjar/sipsoup/blob/992ffcc1f05f5385557f8bef7c1ee3d6a02f54cf/src/main/java/com/virjar/sipsoup/parse/TokenQueue.java#L353-L401 | train | chompBalanced Method. | Create a Java method that does the following: "chompBalanced Method.". | Of course, here is the Java code you requested:
```java
public String chompBalanced(char open, char close) {
int start = -1;
int end = -1;
int depth = 0;
char last = 0;
boolean inQuote = false;
do {
if (isEmpty())
break;
Character... | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java | DataSourceTask.initInputFormat | private void initInputFormat() {
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
// obtain task configuration (including stub parameters)
Configuration taskConf = getTaskConfiguration();
this.config = new TaskConfig(taskConf);
try {
this.format = config.<InputFormat<OT, InputSplit>>getStubWrap... | java | private void initInputFormat() {
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
// obtain task configuration (including stub parameters)
Configuration taskConf = getTaskConfiguration();
this.config = new TaskConfig(taskConf);
try {
this.format = config.<InputFormat<OT, InputSplit>>getStubWrap... | [
"private",
"void",
"initInputFormat",
"(",
")",
"{",
"ClassLoader",
"userCodeClassLoader",
"=",
"getUserCodeClassLoader",
"(",
")",
";",
"// obtain task configuration (including stub parameters)",
"Configuration",
"taskConf",
"=",
"getTaskConfiguration",
"(",
")",
";",
"thi... | Initializes the InputFormat implementation and configuration.
@throws RuntimeException
Throws if instance of InputFormat implementation can not be
obtained. | [
"Initializes",
"the",
"InputFormat",
"implementation",
"and",
"configuration",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/operators/DataSourceTask.java#L265-L302 | train | Initialize the input format. | Create a Java method that does the following: "Initialize the input format.". | Of course, here is the Java code you requested:
```java
private void initInputFormat() {
ClassLoader userCodeClassLoader = getUserCodeClassLoader();
// obtain task configuration (including stub parameters)
Configuration taskConf = getTaskConfiguration();
this.config = new TaskConfig(taskConf);
try {
this... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/WrapperProxyState.java | WrapperProxyState.reconnect | final WrapperProxyState reconnect()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "reconnect: " + this);
HomeOfHomes homeOfHomes = EJSContainer.homeOfHomes;
J2EEName j2eeName;
if (ivUnversion... | java | final WrapperProxyState reconnect()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "reconnect: " + this);
HomeOfHomes homeOfHomes = EJSContainer.homeOfHomes;
J2EEName j2eeName;
if (ivUnversion... | [
"final",
"WrapperProxyState",
"reconnect",
"(",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
... | Reconnects to an actual wrapper. This method must only be called if {@link #ivWrapper} is null. This method either reconnects this state
object, returns a new state object, or throws an EJBException to indicate
that the state could not be reconnected. Note that a returned state
object might be disconnected by another t... | [
"Reconnects",
"to",
"an",
"actual",
"wrapper",
".",
"This",
"method",
"must",
"only",
"be",
"called",
"if",
"{",
"@link",
"#ivWrapper",
"}",
"is",
"null",
".",
"This",
"method",
"either",
"reconnects",
"this",
"state",
"object",
"returns",
"a",
"new",
"sta... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/WrapperProxyState.java#L171-L220 | train | Reconnect the managed wrapper proxy state. | Create a Java method that does the following: "Reconnect the managed wrapper proxy state.". | Of course, here is the Java code you requested:
```java
final WrapperProxyState reconnect()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "reconnect: " + this);
HomeOfHomes homeOfHomes = EJSContainer.homeOfH... | |
threerings/narya | core/src/main/java/com/threerings/presents/net/AESAuthRequest.java | AESAuthRequest.createAuthRequest | public static AuthRequest createAuthRequest (
Credentials creds, String version, String[] bootGroups, boolean requireSecureAuth)
{
return createAuthRequest(creds, version, bootGroups, requireSecureAuth, null, null);
} | java | public static AuthRequest createAuthRequest (
Credentials creds, String version, String[] bootGroups, boolean requireSecureAuth)
{
return createAuthRequest(creds, version, bootGroups, requireSecureAuth, null, null);
} | [
"public",
"static",
"AuthRequest",
"createAuthRequest",
"(",
"Credentials",
"creds",
",",
"String",
"version",
",",
"String",
"[",
"]",
"bootGroups",
",",
"boolean",
"requireSecureAuth",
")",
"{",
"return",
"createAuthRequest",
"(",
"creds",
",",
"version",
",",
... | Creates an auth request, secured if able, unsecured if not. | [
"Creates",
"an",
"auth",
"request",
"secured",
"if",
"able",
"unsecured",
"if",
"not",
"."
] | 5b01edc8850ed0c32d004b4049e1ac4a02027ede | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/AESAuthRequest.java#L46-L50 | train | Create an auth request from the passed in credentials. | Create a Java method that does the following: "Create an auth request from the passed in credentials.". | Of course, here is the Java code you requested:
```java
public static AuthRequest createAuthRequest (
Credentials creds, String version, String[] bootGroups, boolean requireSecureAuth)
{
return createAuthRequest(creds, version, bootGroups, requireSecureAuth, null, null);
}
```
Hope this he... | |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentDefinition.java | CmsXmlContentDefinition.unmarshal | public static CmsXmlContentDefinition unmarshal(InputSource source, String schemaLocation, EntityResolver resolver)
throws CmsXmlException {
schemaLocation = translateSchema(schemaLocation);
CmsXmlContentDefinition result = getCachedContentDefinition(schemaLocation, resolver);
if (result ==... | java | public static CmsXmlContentDefinition unmarshal(InputSource source, String schemaLocation, EntityResolver resolver)
throws CmsXmlException {
schemaLocation = translateSchema(schemaLocation);
CmsXmlContentDefinition result = getCachedContentDefinition(schemaLocation, resolver);
if (result ==... | [
"public",
"static",
"CmsXmlContentDefinition",
"unmarshal",
"(",
"InputSource",
"source",
",",
"String",
"schemaLocation",
",",
"EntityResolver",
"resolver",
")",
"throws",
"CmsXmlException",
"{",
"schemaLocation",
"=",
"translateSchema",
"(",
"schemaLocation",
")",
";"... | Factory method to unmarshal (read) a XML content definition instance from a XML InputSource.<p>
@param source the XML InputSource to use
@param schemaLocation the location from which the XML schema was read (system id)
@param resolver the XML entity resolver to use
@return a XML content definition instance unmarshall... | [
"Factory",
"method",
"to",
"unmarshal",
"(",
"read",
")",
"a",
"XML",
"content",
"definition",
"instance",
"from",
"a",
"XML",
"InputSource",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentDefinition.java#L440-L457 | train | Unmarshals the XML content definition from the given InputSource using the given schema location. | Create a Java method that does the following: "Unmarshals the XML content definition from the given InputSource using the given schema location.". | Of course, here is the Java code you requested:
```java
public static CmsXmlContentDefinition unmarshal(InputSource source, String schemaLocation, EntityResolver resolver)
throws CmsXmlException {
schemaLocation = translateSchema(schemaLocation);
CmsXmlContentDefinition result = getCachedContentDe... | |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java | CoverageUtilities.createSubCoverageFromTemplate | public static GridCoverage2D createSubCoverageFromTemplate( GridCoverage2D template, Envelope2D subregion, Double value,
WritableRaster[] writableRasterHolder ) {
RegionMap regionMap = getRegionParamsFromGridCoverage(template);
double xRes = regionMap.getXres();
double yRes = regionM... | java | public static GridCoverage2D createSubCoverageFromTemplate( GridCoverage2D template, Envelope2D subregion, Double value,
WritableRaster[] writableRasterHolder ) {
RegionMap regionMap = getRegionParamsFromGridCoverage(template);
double xRes = regionMap.getXres();
double yRes = regionM... | [
"public",
"static",
"GridCoverage2D",
"createSubCoverageFromTemplate",
"(",
"GridCoverage2D",
"template",
",",
"Envelope2D",
"subregion",
",",
"Double",
"value",
",",
"WritableRaster",
"[",
"]",
"writableRasterHolder",
")",
"{",
"RegionMap",
"regionMap",
"=",
"getRegion... | Create a subcoverage given a template coverage and an envelope.
@param template the template coverage used for the resolution.
@param subregion the envelope to extract to the new coverage. This should
be snapped on the resolution of the coverage, in order to avoid
shifts.
@param value the value to set the new raster t... | [
"Create",
"a",
"subcoverage",
"given",
"a",
"template",
"coverage",
"and",
"an",
"envelope",
"."
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/coverage/CoverageUtilities.java#L344-L376 | train | Create a subcoverage from a template | Create a Java method that does the following: "Create a subcoverage from a template". | Of course, here is the Java code you requested:
```java
public static GridCoverage2D createSubCoverageFromTemplate( GridCoverage2D template, Envelope2D subregion, Double value,
WritableRaster[] writableRasterHolder ) {
RegionMap regionMap = getRegionParamsFromGridCoverage(template);
double ... | |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/mediatype/JacksonHelper.java | JacksonHelper.findRootType | public static JavaType findRootType(JavaType contentType) {
if (contentType.hasGenericTypes()) {
return findRootType(contentType.containedType(0));
} else {
return contentType;
}
} | java | public static JavaType findRootType(JavaType contentType) {
if (contentType.hasGenericTypes()) {
return findRootType(contentType.containedType(0));
} else {
return contentType;
}
} | [
"public",
"static",
"JavaType",
"findRootType",
"(",
"JavaType",
"contentType",
")",
"{",
"if",
"(",
"contentType",
".",
"hasGenericTypes",
"(",
")",
")",
"{",
"return",
"findRootType",
"(",
"contentType",
".",
"containedType",
"(",
"0",
")",
")",
";",
"}",
... | Navigate a chain of parametric types (e.g. Resources<Resource<String>>) until you find the innermost type (String).
@param contentType
@return | [
"Navigate",
"a",
"chain",
"of",
"parametric",
"types",
"(",
"e",
".",
"g",
".",
"Resources<",
";",
"Resource<",
";",
"String>",
";",
">",
";",
")",
"until",
"you",
"find",
"the",
"innermost",
"type",
"(",
"String",
")",
"."
] | 70ebff9309f086cd8d6a97daf67e0dc215c87d9c | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/mediatype/JacksonHelper.java#L34-L41 | train | Find the root type of a JavaType. | Create a Java method that does the following: "Find the root type of a JavaType.". | Of course, here is the Java code you requested:
```java
public static JavaType findRootType(JavaType contentType) {
if (contentType.hasGenericTypes()) {
return findRootType(contentType.containedType(0));
} else {
return contentType;
}
}
```
Hope this helps! | |
jbundle/jbundle | thin/main/src/main/java/org/jbundle/thin/main/calendar/db/CalendarControl.java | CalendarControl.setupFields | public void setupFields()
{
FieldInfo field = null;
field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field.setHidden(true);
field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
... | java | public void setupFields()
{
FieldInfo field = null;
field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field.setHidden(true);
field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
... | [
"public",
"void",
"setupFields",
"(",
")",
"{",
"FieldInfo",
"field",
"=",
"null",
";",
"field",
"=",
"new",
"FieldInfo",
"(",
"this",
",",
"ID",
",",
"Constants",
".",
"DEFAULT_FIELD_LENGTH",
",",
"null",
",",
"null",
")",
";",
"field",
".",
"setDataCla... | Set up the screen input fields. | [
"Set",
"up",
"the",
"screen",
"input",
"fields",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/main/src/main/java/org/jbundle/thin/main/calendar/db/CalendarControl.java#L55-L86 | train | Setup the fields for the NCSA Specifications. | Create a Java method that does the following: "Setup the fields for the NCSA Specifications.". | Of course, here is the Java code you requested:
```java
public void setupFields()
{
FieldInfo field = null;
field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
field.setDataClass(Integer.class);
field.setHidden(true);
field = new FieldInfo(this, LAST... | |
lennartj/nazgul_tools | visualization/visualization-spi-doclet/src/main/java/se/jguru/nazgul/tools/visualization/spi/doclet/VisualizationDoclet.java | VisualizationDoclet.start | @Override
public boolean start(final RootDoc root) {
// Check sanity
if (this.dotFacade == null) {
throw new IllegalStateException("The DotFacade cannot be null.");
}
// Wrap the received RootDoc instance.
final VisualizationWrappedRootDoc rootDoc = new Visualiz... | java | @Override
public boolean start(final RootDoc root) {
// Check sanity
if (this.dotFacade == null) {
throw new IllegalStateException("The DotFacade cannot be null.");
}
// Wrap the received RootDoc instance.
final VisualizationWrappedRootDoc rootDoc = new Visualiz... | [
"@",
"Override",
"public",
"boolean",
"start",
"(",
"final",
"RootDoc",
"root",
")",
"{",
"// Check sanity",
"if",
"(",
"this",
".",
"dotFacade",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The DotFacade cannot be null.\"",
")",
";",... | {@inheritDoc} | [
"{"
] | 27425742629a49f7e0834127002083ff1e180564 | https://github.com/lennartj/nazgul_tools/blob/27425742629a49f7e0834127002083ff1e180564/visualization/visualization-spi-doclet/src/main/java/se/jguru/nazgul/tools/visualization/spi/doclet/VisualizationDoclet.java#L81-L120 | valid | Override start to start the Doclet. | Create a Java method that does the following: "Override start to start the Doclet.". | Of course, here is the Java code you requested:
```java
@Override
public boolean start(final RootDoc root) {
// Check sanity
if (this.dotFacade == null) {
throw new IllegalStateException("The DotFacade cannot be null.");
}
// Wrap the received RootDoc instance.
... | |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/PathImpl.java | PathImpl.writeToStream | public void writeToStream(OutputStreamWithBuffer os)
throws IOException
{
StreamImpl is = openReadImpl();
try {
byte []buffer = os.buffer();
int offset = os.offset();
int length = buffer.length;
while (! os.isClosed()) {
int sublen = length - offset;
if (sublen <... | java | public void writeToStream(OutputStreamWithBuffer os)
throws IOException
{
StreamImpl is = openReadImpl();
try {
byte []buffer = os.buffer();
int offset = os.offset();
int length = buffer.length;
while (! os.isClosed()) {
int sublen = length - offset;
if (sublen <... | [
"public",
"void",
"writeToStream",
"(",
"OutputStreamWithBuffer",
"os",
")",
"throws",
"IOException",
"{",
"StreamImpl",
"is",
"=",
"openReadImpl",
"(",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"os",
".",
"buffer",
"(",
")",
";",
"int",
"of... | Utility to write the contents of this path to the destination stream.
@param os destination stream. | [
"Utility",
"to",
"write",
"the",
"contents",
"of",
"this",
"path",
"to",
"the",
"destination",
"stream",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/PathImpl.java#L1431-L1462 | train | Write to stream with buffer. | Create a Java method that does the following: "Write to stream with buffer.". | Of course, here is the Java code you requested:
```java
public void writeToStream(OutputStreamWithBuffer os)
throws IOException
{
StreamImpl is = openReadImpl();
try {
byte []buffer = os.buffer();
int offset = os.offset();
int length = buffer.length;
while (! os.isClosed()) {
... | |
geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java | SliderBar.stopSliding | private void stopSliding(boolean unhighlight, boolean fireEvent) {
if (unhighlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB);
}
} | java | private void stopSliding(boolean unhighlight, boolean fireEvent) {
if (unhighlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB);
}
} | [
"private",
"void",
"stopSliding",
"(",
"boolean",
"unhighlight",
",",
"boolean",
"fireEvent",
")",
"{",
"if",
"(",
"unhighlight",
")",
"{",
"DOM",
".",
"setElementProperty",
"(",
"lineElement",
",",
"\"className\"",
",",
"SLIDER_LINE",
")",
";",
"DOM",
".",
... | Stop sliding the knob.
@param unhighlight
true to change the style
@param fireEvent
true to fire the event | [
"Stop",
"sliding",
"the",
"knob",
"."
] | 1104196640e0ba455b8a619e774352a8e1e319ba | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L945-L951 | train | Stop sliding the image. | Create a Java method that does the following: "Stop sliding the image.". | Of course, here is the Java code you requested:
```java
private void stopSliding(boolean unhighlight, boolean fireEvent) {
if (unhighlight) {
DOM.setElementProperty(lineElement, "className", SLIDER_LINE);
DOM.setElementProperty(knobImage.getElement(), "className", SLIDER_KNOB);
}
}
```
Hope this hel... | |
sundrio/sundrio | codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java | JavaGeneratingProcessor.generateFromResources | public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException {
if (classExists(model)) {
System.err.println("Skipping: " + model.getFullyQualifiedName()+ ". Class already exists.");
return;
}
System.err.println("Gener... | java | public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException {
if (classExists(model)) {
System.err.println("Skipping: " + model.getFullyQualifiedName()+ ". Class already exists.");
return;
}
System.err.println("Gener... | [
"public",
"void",
"generateFromResources",
"(",
"TypeDef",
"model",
",",
"JavaFileObject",
"fileObject",
",",
"String",
"resourceName",
")",
"throws",
"IOException",
"{",
"if",
"(",
"classExists",
"(",
"model",
")",
")",
"{",
"System",
".",
"err",
".",
"printl... | Generates a source file from the specified {@link io.sundr.codegen.model.TypeDef}.
@param model The model of the class to generate.
@param fileObject Where to save the generated class.
@param resourceName The template to use.
@throws IOException If it fails to create the source file. | [
"Generates",
"a",
"source",
"file",
"from",
"the",
"specified",
"{",
"@link",
"io",
".",
"sundr",
".",
"codegen",
".",
"model",
".",
"TypeDef",
"}",
"."
] | 4e38368f4db0d950f7c41a8c75e15b0baff1f69a | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/codegen/src/main/java/io/sundr/codegen/processor/JavaGeneratingProcessor.java#L64-L77 | train | Generate a class from a resource. | Create a Java method that does the following: "Generate a class from a resource.". | Of course, here is the Java code you requested:
```java
public void generateFromResources(TypeDef model, JavaFileObject fileObject, String resourceName) throws IOException {
if (classExists(model)) {
System.err.println("Skipping: " + model.getFullyQualifiedName()+ ". Class already exists.");
... | |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java | StencilInterpreter.bindBlocks | private Map<String, Object> bindBlocks(PrepareSignatureContext sig, PrepareInvocationContext inv) {
if(inv == null) {
return Collections.emptyMap();
}
BlockDeclContext allDecl = null;
BlockDeclContext unnamedDecl = null;
List<NamedOutputBlockContext> namedBlocks = new ArrayList<>(in... | java | private Map<String, Object> bindBlocks(PrepareSignatureContext sig, PrepareInvocationContext inv) {
if(inv == null) {
return Collections.emptyMap();
}
BlockDeclContext allDecl = null;
BlockDeclContext unnamedDecl = null;
List<NamedOutputBlockContext> namedBlocks = new ArrayList<>(in... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"bindBlocks",
"(",
"PrepareSignatureContext",
"sig",
",",
"PrepareInvocationContext",
"inv",
")",
"{",
"if",
"(",
"inv",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyMap",
"(",
")",
";",
"... | Bind block values to names based on prepare signature
@param sig Signature of output block preparation
@param inv Invocation of output block
@return Map of Name => BoundParamBlocks representing Macro blocks | [
"Bind",
"block",
"values",
"to",
"names",
"based",
"on",
"prepare",
"signature"
] | 4aac1be605542b4248be95bf8916be4e2f755d1c | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java#L2637-L2730 | train | Binds the blocks of the given prepare signature and invocation context. | Create a Java method that does the following: "Binds the blocks of the given prepare signature and invocation context.". | Of course, here is the Java code you requested:
```java
private Map<String, Object> bindBlocks(PrepareSignatureContext sig, PrepareInvocationContext inv) {
if(inv == null) {
return Collections.emptyMap();
}
BlockDeclContext allDecl = null;
BlockDeclContext unnamedDecl = null;
List<... | |
kiswanij/jk-util | src/main/java/com/jk/util/JKObjectUtil.java | JKObjectUtil.isPrimitive | public static boolean isPrimitive(Class<?> type) {
if (type.isPrimitive()) {
return true;
}
// check if wrapper;
if (PRIMITIVES_TO_WRAPPERS.values().contains(type)) {
return true;
}
return false;
} | java | public static boolean isPrimitive(Class<?> type) {
if (type.isPrimitive()) {
return true;
}
// check if wrapper;
if (PRIMITIVES_TO_WRAPPERS.values().contains(type)) {
return true;
}
return false;
} | [
"public",
"static",
"boolean",
"isPrimitive",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"// check if wrapper;\r",
"if",
"(",
"PRIMITIVES_TO_WRAPPERS",
".",
"values"... | Checks if is primitive.
@param type the type
@return true, if is primitive | [
"Checks",
"if",
"is",
"primitive",
"."
] | 8e0c85818423406f769444c76194a748e0a0fc0a | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKObjectUtil.java#L768-L777 | train | Checks if the given class is a primitive type. | Create a Java method that does the following: "Checks if the given class is a primitive type.". | Of course, here is the Java code you requested:
```java
public static boolean isPrimitive(Class<?> type) {
if (type.isPrimitive()) {
return true;
}
// check if wrapper;
if (PRIMITIVES_TO_WRAPPERS.values().contains(type)) {
return true;
}
return false;
}
```
Hope this helps! | |
belaban/JGroups | src/org/jgroups/blocks/ReplicatedHashMap.java | ReplicatedHashMap.synchronizedMap | public static <K, V> ReplicatedMap<K,V> synchronizedMap(ReplicatedMap<K,V> map) {
return new SynchronizedReplicatedMap<>(map);
} | java | public static <K, V> ReplicatedMap<K,V> synchronizedMap(ReplicatedMap<K,V> map) {
return new SynchronizedReplicatedMap<>(map);
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"ReplicatedMap",
"<",
"K",
",",
"V",
">",
"synchronizedMap",
"(",
"ReplicatedMap",
"<",
"K",
",",
"V",
">",
"map",
")",
"{",
"return",
"new",
"SynchronizedReplicatedMap",
"<>",
"(",
"map",
")",
";",
"}"
] | Creates a synchronized facade for a ReplicatedMap. All methods which
change state are invoked through a monitor. This is similar to
{@link java.util.Collections.SynchronizedMap#synchronizedMap(Map)}, but also includes the replication
methods (starting with an underscore).
@param map
@return | [
"Creates",
"a",
"synchronized",
"facade",
"for",
"a",
"ReplicatedMap",
".",
"All",
"methods",
"which",
"change",
"state",
"are",
"invoked",
"through",
"a",
"monitor",
".",
"This",
"is",
"similar",
"to",
"{",
"@link",
"java",
".",
"util",
".",
"Collections",
... | bd3ca786aa57fed41dfbc10a94b1281e388be03b | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/blocks/ReplicatedHashMap.java#L511-L513 | train | Synchronized version of the given replicated map. | Create a Java method that does the following: "Synchronized version of the given replicated map.". | Of course, here is the Java code you requested:
```java
public static <K, V> ReplicatedMap<K,V> synchronizedMap(ReplicatedMap<K,V> map) {
return new SynchronizedReplicatedMap<>(map);
}
```
Hope this helps! | |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java | AbstractResourceHandle.unlock | public void unlock(LockToken token) throws DAVException {
// Send the lock token in the header of the request.
IContext context = newContext();
context.setLockToken("<" + token.getToken() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
IResponse response = null;
try {
response =... | java | public void unlock(LockToken token) throws DAVException {
// Send the lock token in the header of the request.
IContext context = newContext();
context.setLockToken("<" + token.getToken() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
IResponse response = null;
try {
response =... | [
"public",
"void",
"unlock",
"(",
"LockToken",
"token",
")",
"throws",
"DAVException",
"{",
"// Send the lock token in the header of the request.",
"IContext",
"context",
"=",
"newContext",
"(",
")",
";",
"context",
".",
"setLockToken",
"(",
"\"<\"",
"+",
"token",
".... | Unlock this resource with the given lock token.
@param token the lock token to remove from this resource
@exception DAVException if there was a problem unlocking this resource
@see IServer#unlock(Locator, Context) | [
"Unlock",
"this",
"resource",
"with",
"the",
"given",
"lock",
"token",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java#L1246-L1260 | test | Unlock the current user s application. | Create a Java method that does the following: "Unlock the current user s application.". | Of course, here is the Java code you requested:
```java
public void unlock(LockToken token) throws DAVException {
// Send the lock token in the header of the request.
IContext context = newContext();
context.setLockToken("<" + token.getToken() + ">"); //$NON-NLS-1$ //$NON-NLS-2$
IRespo... | |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/reflect/SimpleMethodInvoker.java | SimpleMethodInvoker.invokeMethod | private static Object invokeMethod( final Object obj,
final String methodName,
final Object[] args,
final Class<?>[] parameterTypes )
throws
UtilException
... | java | private static Object invokeMethod( final Object obj,
final String methodName,
final Object[] args,
final Class<?>[] parameterTypes )
throws
UtilException
... | [
"private",
"static",
"Object",
"invokeMethod",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"methodName",
",",
"final",
"Object",
"[",
"]",
"args",
",",
"final",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
")",
"throws",
"UtilException",
... | We have an object and a method name, but in order to invoke
a method on an object, we need the object's Class (type).
Given this Class we can then check that such a method exists
and throw an exception if it doesn't.
@param obj to invoke method on
@param methodName to invoke
@param args to use
@param parameterTypes t... | [
"We",
"have",
"an",
"object",
"and",
"a",
"method",
"name",
"but",
"in",
"order",
"to",
"invoke",
"a",
"method",
"on",
"an",
"object",
"we",
"need",
"the",
"object",
"s",
"Class",
"(",
"type",
")",
"."
] | 0f9969bc0809e8a617501fa57c135e9b3984fae0 | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/reflect/SimpleMethodInvoker.java#L301-L309 | train | Invoke a method on a class. | Create a Java method that does the following: "Invoke a method on a class.". | Of course, here is the Java code you requested:
```java
private static Object invokeMethod( final Object obj,
final String methodName,
final Object[] args,
final Class<?>[] para... | |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Stream.java | Stream.zip | public static <R> Stream<R> zip(final double[] a, final double[] b, final double[] c, final double valueForNoneA, final double valueForNoneB,
final double valueForNoneC, final DoubleTriFunction<R> zipFunction) {
return zip(DoubleIteratorEx.of(a), DoubleIteratorEx.of(b), DoubleIteratorEx.of(c), val... | java | public static <R> Stream<R> zip(final double[] a, final double[] b, final double[] c, final double valueForNoneA, final double valueForNoneB,
final double valueForNoneC, final DoubleTriFunction<R> zipFunction) {
return zip(DoubleIteratorEx.of(a), DoubleIteratorEx.of(b), DoubleIteratorEx.of(c), val... | [
"public",
"static",
"<",
"R",
">",
"Stream",
"<",
"R",
">",
"zip",
"(",
"final",
"double",
"[",
"]",
"a",
",",
"final",
"double",
"[",
"]",
"b",
",",
"final",
"double",
"[",
"]",
"c",
",",
"final",
"double",
"valueForNoneA",
",",
"final",
"double",... | Zip together the "a", "b" and "c" iterators until all of them runs out of values.
Each triple of values is combined into a single value using the supplied zipFunction function.
@param a
@param b
@param c
@param valueForNoneA value to fill if "a" runs out of values.
@param valueForNoneB value to fill if "b" runs out of... | [
"Zip",
"together",
"the",
"a",
"b",
"and",
"c",
"iterators",
"until",
"all",
"of",
"them",
"runs",
"out",
"of",
"values",
".",
"Each",
"triple",
"of",
"values",
"is",
"combined",
"into",
"a",
"single",
"value",
"using",
"the",
"supplied",
"zipFunction",
... | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Stream.java#L6724-L6727 | train | Creates a stream of tuples containing all the elements of the two arrays of type T using the supplied zipFunction function. | Create a Java method that does the following: "Creates a stream of tuples containing all the elements of the two arrays of type T using the supplied zipFunction function.". | Of course, here is the Java code you requested:
```java
public static <R> Stream<R> zip(final double[] a, final double[] b, final double[] c, final double valueForNoneA, final double valueForNoneB,
final double valueForNoneC, final DoubleTriFunction<R> zipFunction) {
return zip(DoubleIteratorEx.o... | |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java | SessionPool.releaseSession | private void releaseSession(PooledSession session) {
Preconditions.checkNotNull(session);
synchronized (lock) {
if (closureFuture != null) {
return;
}
if (readWaiters.size() == 0 && numSessionsBeingPrepared >= readWriteWaiters.size()) {
// No pending waiters
if (shouldP... | java | private void releaseSession(PooledSession session) {
Preconditions.checkNotNull(session);
synchronized (lock) {
if (closureFuture != null) {
return;
}
if (readWaiters.size() == 0 && numSessionsBeingPrepared >= readWriteWaiters.size()) {
// No pending waiters
if (shouldP... | [
"private",
"void",
"releaseSession",
"(",
"PooledSession",
"session",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"session",
")",
";",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"closureFuture",
"!=",
"null",
")",
"{",
"return",
";",
"}",
"... | Releases a session back to the pool. This might cause one of the waiters to be unblocked.
<p>Implementation note:
<ol>
<li>If there are no pending waiters, either add to the read sessions queue or start preparing
for write depending on what fraction of sessions are already prepared for writes.
<li>Otherwise either un... | [
"Releases",
"a",
"session",
"back",
"to",
"the",
"pool",
".",
"This",
"might",
"cause",
"one",
"of",
"the",
"waiters",
"to",
"be",
"unblocked",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java#L968-L987 | train | Release a session. | Create a Java method that does the following: "Release a session.". | Of course, here is the Java code you requested:
```java
private void releaseSession(PooledSession session) {
Preconditions.checkNotNull(session);
synchronized (lock) {
if (closureFuture != null) {
return;
}
if (readWaiters.size() == 0 && numSessionsBeingPrepared >= readWriteWaiters.si... | |
alkacon/opencms-core | src/org/opencms/configuration/CmsConfigurationManager.java | CmsConfigurationManager.generateXml | public Document generateXml(I_CmsXmlConfiguration configuration) {
// create a new document
Document result = DocumentHelper.createDocument();
// set the document type
DOMDocumentType docType = new DOMDocumentType();
docType.setElementName(N_ROOT);
docType.setSystemID(c... | java | public Document generateXml(I_CmsXmlConfiguration configuration) {
// create a new document
Document result = DocumentHelper.createDocument();
// set the document type
DOMDocumentType docType = new DOMDocumentType();
docType.setElementName(N_ROOT);
docType.setSystemID(c... | [
"public",
"Document",
"generateXml",
"(",
"I_CmsXmlConfiguration",
"configuration",
")",
"{",
"// create a new document",
"Document",
"result",
"=",
"DocumentHelper",
".",
"createDocument",
"(",
")",
";",
"// set the document type",
"DOMDocumentType",
"docType",
"=",
"new... | Creates the XML document build from the provided configuration.<p>
@param configuration the configuration to build the XML for
@return the XML document build from the provided configuration | [
"Creates",
"the",
"XML",
"document",
"build",
"from",
"the",
"provided",
"configuration",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/configuration/CmsConfigurationManager.java#L236-L253 | train | Generates the XML document for the CRAs. | Create a Java method that does the following: "Generates the XML document for the CRAs.". | Of course, here is the Java code you requested:
```java
public Document generateXml(I_CmsXmlConfiguration configuration) {
// create a new document
Document result = DocumentHelper.createDocument();
// set the document type
DOMDocumentType docType = new DOMDocumentType();
docT... | |
1gravity/Android-RTEditor | RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Parser.java | Parser.setup | private void setup() {
if (theSchema == null) theSchema = new HTMLSchema();
if (theScanner == null) theScanner = new HTMLScanner();
if (theAutoDetector == null) {
theAutoDetector = new AutoDetector() {
public Reader autoDetectingReader(InputStream i) {
... | java | private void setup() {
if (theSchema == null) theSchema = new HTMLSchema();
if (theScanner == null) theScanner = new HTMLScanner();
if (theAutoDetector == null) {
theAutoDetector = new AutoDetector() {
public Reader autoDetectingReader(InputStream i) {
... | [
"private",
"void",
"setup",
"(",
")",
"{",
"if",
"(",
"theSchema",
"==",
"null",
")",
"theSchema",
"=",
"new",
"HTMLSchema",
"(",
")",
";",
"if",
"(",
"theScanner",
"==",
"null",
")",
"theScanner",
"=",
"new",
"HTMLScanner",
"(",
")",
";",
"if",
"(",... | Sets up instance variables that haven't been set by setFeature | [
"Sets",
"up",
"instance",
"variables",
"that",
"haven",
"t",
"been",
"set",
"by",
"setFeature"
] | 9d8fb4bb865b3b3d011e7633afedcdfb8d21754f | https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/Parser.java#L451-L470 | test | Setup the XML schema scanner and stack elements | Create a Java method that does the following: "Setup the XML schema scanner and stack elements". | Of course, here is the Java code you requested:
```java
private void setup() {
if (theSchema == null) theSchema = new HTMLSchema();
if (theScanner == null) theScanner = new HTMLScanner();
if (theAutoDetector == null) {
theAutoDetector = new AutoDetector() {
public Re... | |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java | WTable.getPrevRenderedRows | protected Set<?> getPrevRenderedRows() {
Set<?> keys = getComponentModel().prevRenderedRows;
if (keys == null) {
return Collections.emptySet();
} else {
return Collections.unmodifiableSet(keys);
}
} | java | protected Set<?> getPrevRenderedRows() {
Set<?> keys = getComponentModel().prevRenderedRows;
if (keys == null) {
return Collections.emptySet();
} else {
return Collections.unmodifiableSet(keys);
}
} | [
"protected",
"Set",
"<",
"?",
">",
"getPrevRenderedRows",
"(",
")",
"{",
"Set",
"<",
"?",
">",
"keys",
"=",
"getComponentModel",
"(",
")",
".",
"prevRenderedRows",
";",
"if",
"(",
"keys",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptySet",
... | Return the row keys that have been rendered.
<p>
Note - Only used for when the table is editable.
</p>
@return the previously rendered row keys. | [
"Return",
"the",
"row",
"keys",
"that",
"have",
"been",
"rendered",
".",
"<p",
">",
"Note",
"-",
"Only",
"used",
"for",
"when",
"the",
"table",
"is",
"editable",
".",
"<",
"/",
"p",
">"
] | d1a2b2243270067db030feb36ca74255aaa94436 | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTable.java#L1095-L1102 | train | Returns the previous rendered rows. | Create a Java method that does the following: "Returns the previous rendered rows.". | Of course, here is the Java code you requested:
```java
protected Set<?> getPrevRenderedRows() {
Set<?> keys = getComponentModel().prevRenderedRows;
if (keys == null) {
return Collections.emptySet();
} else {
return Collections.unmodifiableSet(keys);
}
}
```
Hope this helps! | |
joniles/mpxj | src/main/java/net/sf/mpxj/asta/AstaDatabaseFileReader.java | AstaDatabaseFileReader.createWorkPatternAssignmentRowList | private List<Row> createWorkPatternAssignmentRowList(String workPatterns) throws ParseException
{
List<Row> list = new ArrayList<Row>();
String[] patterns = workPatterns.split(",|:");
int index = 1;
while (index < patterns.length)
{
Integer workPattern = Integer.valueOf(pattern... | java | private List<Row> createWorkPatternAssignmentRowList(String workPatterns) throws ParseException
{
List<Row> list = new ArrayList<Row>();
String[] patterns = workPatterns.split(",|:");
int index = 1;
while (index < patterns.length)
{
Integer workPattern = Integer.valueOf(pattern... | [
"private",
"List",
"<",
"Row",
">",
"createWorkPatternAssignmentRowList",
"(",
"String",
"workPatterns",
")",
"throws",
"ParseException",
"{",
"List",
"<",
"Row",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"Row",
">",
"(",
")",
";",
"String",
"[",
"]",
"pa... | Extract a list of work pattern assignments.
@param workPatterns string representation of work pattern assignments
@return list of work pattern assignment rows | [
"Extract",
"a",
"list",
"of",
"work",
"pattern",
"assignments",
"."
] | 143ea0e195da59cd108f13b3b06328e9542337e8 | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/asta/AstaDatabaseFileReader.java#L402-L424 | train | Create work pattern assignment row list. | Create a Java method that does the following: "Create work pattern assignment row list.". | Of course, here is the Java code you requested:
```java
private List<Row> createWorkPatternAssignmentRowList(String workPatterns) throws ParseException
{
List<Row> list = new ArrayList<Row>();
String[] patterns = workPatterns.split(",|:");
int index = 1;
while (index < patterns.length)
... | |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/MemoryLogger.java | MemoryLogger.getMemoryUsageStatsAsString | public static String getMemoryUsageStatsAsString(MemoryMXBean memoryMXBean) {
MemoryUsage heap = memoryMXBean.getHeapMemoryUsage();
MemoryUsage nonHeap = memoryMXBean.getNonHeapMemoryUsage();
long heapUsed = heap.getUsed() >> 20;
long heapCommitted = heap.getCommitted() >> 20;
long heapMax = heap.getMax() >>... | java | public static String getMemoryUsageStatsAsString(MemoryMXBean memoryMXBean) {
MemoryUsage heap = memoryMXBean.getHeapMemoryUsage();
MemoryUsage nonHeap = memoryMXBean.getNonHeapMemoryUsage();
long heapUsed = heap.getUsed() >> 20;
long heapCommitted = heap.getCommitted() >> 20;
long heapMax = heap.getMax() >>... | [
"public",
"static",
"String",
"getMemoryUsageStatsAsString",
"(",
"MemoryMXBean",
"memoryMXBean",
")",
"{",
"MemoryUsage",
"heap",
"=",
"memoryMXBean",
".",
"getHeapMemoryUsage",
"(",
")",
";",
"MemoryUsage",
"nonHeap",
"=",
"memoryMXBean",
".",
"getNonHeapMemoryUsage",... | Gets the memory footprint of the JVM in a string representation.
@return A string describing how much heap memory and direct memory are allocated and used. | [
"Gets",
"the",
"memory",
"footprint",
"of",
"the",
"JVM",
"in",
"a",
"string",
"representation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/taskmanager/MemoryLogger.java#L156-L171 | train | Get the memory usage statistics as a string. | Create a Java method that does the following: "Get the memory usage statistics as a string.". | Of course, here is the Java code you requested:
```java
public static String getMemoryUsageStatsAsString(MemoryMXBean memoryMXBean) {
MemoryUsage heap = memoryMXBean.getHeapMemoryUsage();
MemoryUsage nonHeap = memoryMXBean.getNonHeapMemoryUsage();
long heapUsed = heap.getUsed() >> 20;
long heapCommitted = hea... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.common.encoder/src/com/ibm/ws/common/internal/encoder/Base64Coder.java | Base64Coder.getBytes | public static final byte[] getBytes(String input) {
byte output[] = null;
try {
if (input != null) {
output = input.getBytes("UTF-8");
}
} catch (UnsupportedEncodingException e) {
// This should not happen.
// If it happens, it woul... | java | public static final byte[] getBytes(String input) {
byte output[] = null;
try {
if (input != null) {
output = input.getBytes("UTF-8");
}
} catch (UnsupportedEncodingException e) {
// This should not happen.
// If it happens, it woul... | [
"public",
"static",
"final",
"byte",
"[",
"]",
"getBytes",
"(",
"String",
"input",
")",
"{",
"byte",
"output",
"[",
"]",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"input",
"!=",
"null",
")",
"{",
"output",
"=",
"input",
".",
"getBytes",
"(",
"\"UTF-... | Converts a String to a byte array by using UTF-8 character sets.
This code is needed even converting US-ASCII characters since there are some character sets which are not compatible with US-ASCII code area.
For example, CP-1399, which is z/OS Japanese EBCDIC character sets, is one.
@param input String, may be {@code nu... | [
"Converts",
"a",
"String",
"to",
"a",
"byte",
"array",
"by",
"using",
"UTF",
"-",
"8",
"character",
"sets",
".",
"This",
"code",
"is",
"needed",
"even",
"converting",
"US",
"-",
"ASCII",
"characters",
"since",
"there",
"are",
"some",
"character",
"sets",
... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.common.encoder/src/com/ibm/ws/common/internal/encoder/Base64Coder.java#L325-L337 | train | Get the bytes from a String. | Create a Java method that does the following: "Get the bytes from a String.". | Of course, here is the Java code you requested:
```java
public static final byte[] getBytes(String input) {
byte output[] = null;
try {
if (input != null) {
output = input.getBytes("UTF-8");
}
} catch (UnsupportedEncodingException e) {
// This... | |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java | ConstructorWriterImpl.getConstructorDetailsTreeHeader | @Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMemberTreeHeader();
constructorDetailsTree.addConten... | java | @Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMemberTreeHeader();
constructorDetailsTree.addConten... | [
"@",
"Override",
"public",
"Content",
"getConstructorDetailsTreeHeader",
"(",
"TypeElement",
"typeElement",
",",
"Content",
"memberDetailsTree",
")",
"{",
"memberDetailsTree",
".",
"addContent",
"(",
"HtmlConstants",
".",
"START_OF_CONSTRUCTOR_DETAILS",
")",
";",
"Content... | {@inheritDoc} | [
"{"
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java#L114-L125 | train | Get the constructor details tree header. | Create a Java method that does the following: "Get the constructor details tree header.". | Of course, here is the Java code you requested:
```java
@Override
public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
Content memberDetailsTree) {
memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
Content constructorDetailsTree = writer.getMem... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java | EJBJavaColonNamingHelper.listRemoteInstances | @Override
public Collection<? extends NameClassPair> listRemoteInstances(JavaColonNamespace namespace, String nameInContext) throws NamingException {
return listInstances(namespace, nameInContext);
} | java | @Override
public Collection<? extends NameClassPair> listRemoteInstances(JavaColonNamespace namespace, String nameInContext) throws NamingException {
return listInstances(namespace, nameInContext);
} | [
"@",
"Override",
"public",
"Collection",
"<",
"?",
"extends",
"NameClassPair",
">",
"listRemoteInstances",
"(",
"JavaColonNamespace",
"namespace",
",",
"String",
"nameInContext",
")",
"throws",
"NamingException",
"{",
"return",
"listInstances",
"(",
"namespace",
",",
... | /*
(non-Javadoc)
@see com.ibm.ws.container.service.naming.remote.RemoteJavaColonNamingHelper#listRemoteInstances(com.ibm.ws.container.service.naming.NamingConstants.JavaColonNamespace,
java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/naming/EJBJavaColonNamingHelper.java#L663-L666 | train | List all the remote instances of the specified namespace. | Create a Java method that does the following: "List all the remote instances of the specified namespace.". | Of course, here is the Java code you requested:
```java
@Override
public Collection<? extends NameClassPair> listRemoteInstances(JavaColonNamespace namespace, String nameInContext) throws NamingException {
return listInstances(namespace, nameInContext);
}
```
Hope this helps! | |
derari/cthul | objects/src/main/java/org/cthul/objects/Types.java | Types.superclasses | public static Set<Class<?>> superclasses(Class<?> clazz) {
final Queue<Class<?>> queue = new ArrayDeque<>();
if (clazz.isInterface()) {
queue.add(Object.class);
}
while (clazz != null) {
queue.add(clazz);
clazz = clazz.getSuperclass();
... | java | public static Set<Class<?>> superclasses(Class<?> clazz) {
final Queue<Class<?>> queue = new ArrayDeque<>();
if (clazz.isInterface()) {
queue.add(Object.class);
}
while (clazz != null) {
queue.add(clazz);
clazz = clazz.getSuperclass();
... | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"superclasses",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"final",
"Queue",
"<",
"Class",
"<",
"?",
">",
">",
"queue",
"=",
"new",
"ArrayDeque",
"<>",
"(",
")",
";",
"if",
"(",
... | Returns an ordered set of superclasses of {@code clazz}.
If {@code clazz} is a class, it begins with {@code clazz}, followed by
its superclasses and then its interfaces in breadth-first order;
if {@code clazz} is an interface, it begins with {@code Object.class},
followed by {@code clazz} and its super interfaces.
@par... | [
"Returns",
"an",
"ordered",
"set",
"of",
"superclasses",
"of",
"{"
] | 74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/Types.java#L28-L45 | train | Returns a set of all superclasses of the specified class. | Create a Java method that does the following: "Returns a set of all superclasses of the specified class.". | Of course, here is the Java code you requested:
```java
public static Set<Class<?>> superclasses(Class<?> clazz) {
final Queue<Class<?>> queue = new ArrayDeque<>();
if (clazz.isInterface()) {
queue.add(Object.class);
}
while (clazz != null) {
queue.add(claz... | |
Grasia/phatsim | phat-agents/src/main/java/phat/agents/automaton/Automaton.java | Automaton.nextState | public void nextState(PHATInterface phatInterface) {
switch (state) {
case NOT_INIT:
//System.out.println(getAgent().getId()+":"+getName()+"(NOT_INIT)");
/*currentState = null;
if(pendingTransitions != null) {
pendingTransitions.cle... | java | public void nextState(PHATInterface phatInterface) {
switch (state) {
case NOT_INIT:
//System.out.println(getAgent().getId()+":"+getName()+"(NOT_INIT)");
/*currentState = null;
if(pendingTransitions != null) {
pendingTransitions.cle... | [
"public",
"void",
"nextState",
"(",
"PHATInterface",
"phatInterface",
")",
"{",
"switch",
"(",
"state",
")",
"{",
"case",
"NOT_INIT",
":",
"//System.out.println(getAgent().getId()+\":\"+getName()+\"(NOT_INIT)\");",
"/*currentState = null;\n if(pendingTransitions != n... | Este método lleva le control del autómata. En esencia, se delega en el
nextState del estado/autómata hijo actual. Utiliza dos métodos abstractos
que dependen de la persona, y por tanto, del tipo de estado concreto. Un
estado que no tenga autómata redefine este método (extendiendo
SimpleState). Vease comentarios en códi... | [
"Este",
"método",
"lleva",
"le",
"control",
"del",
"autómata",
".",
"En",
"esencia",
"se",
"delega",
"en",
"el",
"nextState",
"del",
"estado",
"/",
"autómata",
"hijo",
"actual",
".",
"Utiliza",
"dos",
"métodos",
"abstractos",
"que",
"dependen",
"de",
"la",
... | 2d4fc8189be9730b34c8e3e1a08fb4800e01c5df | https://github.com/Grasia/phatsim/blob/2d4fc8189be9730b34c8e3e1a08fb4800e01c5df/phat-agents/src/main/java/phat/agents/automaton/Automaton.java#L311-L365 | train | This method is called to transition the state machine to the next state of the agent. | Create a Java method that does the following: "This method is called to transition the state machine to the next state of the agent.". | Of course, here is the Java code you requested:
```java
public void nextState(PHATInterface phatInterface) {
switch (state) {
case NOT_INIT:
//System.out.println(getAgent().getId()+":"+getName()+"(NOT_INIT)");
/*currentState = null;
if(pendingTransiti... | |
reactor/reactor-core | reactor-core/src/main/java/reactor/core/publisher/OperatorDisposables.java | OperatorDisposables.trySet | public static <T> boolean trySet(AtomicReferenceFieldUpdater<T, Disposable> updater, T holder, Disposable newValue) {
if (!updater.compareAndSet(holder, null, newValue)) {
if (updater.get(holder) == DISPOSED) {
newValue.dispose();
}
return false;
}
return true;
} | java | public static <T> boolean trySet(AtomicReferenceFieldUpdater<T, Disposable> updater, T holder, Disposable newValue) {
if (!updater.compareAndSet(holder, null, newValue)) {
if (updater.get(holder) == DISPOSED) {
newValue.dispose();
}
return false;
}
return true;
} | [
"public",
"static",
"<",
"T",
">",
"boolean",
"trySet",
"(",
"AtomicReferenceFieldUpdater",
"<",
"T",
",",
"Disposable",
">",
"updater",
",",
"T",
"holder",
",",
"Disposable",
"newValue",
")",
"{",
"if",
"(",
"!",
"updater",
".",
"compareAndSet",
"(",
"hol... | Atomically try to set the given {@link Disposable} on the field if it is null or
disposes it if the field contains {@link #DISPOSED}.
@param updater the target field updater
@param holder the target instance holding the field
@param newValue the disposable to set
@return true if successful, false otherwise | [
"Atomically",
"try",
"to",
"set",
"the",
"given",
"{",
"@link",
"Disposable",
"}",
"on",
"the",
"field",
"if",
"it",
"is",
"null",
"or",
"disposes",
"it",
"if",
"the",
"field",
"contains",
"{",
"@link",
"#DISPOSED",
"}",
"."
] | df2eba4ab7d2393e1a942ce972c3307fbbd47ff9 | https://github.com/reactor/reactor-core/blob/df2eba4ab7d2393e1a942ce972c3307fbbd47ff9/reactor-core/src/main/java/reactor/core/publisher/OperatorDisposables.java#L172-L180 | valid | Try to set the value of the given holder to the given new value. | Create a Java method that does the following: "Try to set the value of the given holder to the given new value.". | Of course, here is the Java code you requested:
```java
public static <T> boolean trySet(AtomicReferenceFieldUpdater<T, Disposable> updater, T holder, Disposable newValue) {
if (!updater.compareAndSet(holder, null, newValue)) {
if (updater.get(holder) == DISPOSED) {
newValue.dispose();
}
return false;
... | |
threerings/playn | ios/src/playn/ios/IOSPlatform.java | IOSPlatform.register | public static IOSPlatform register(UIApplication app, Config config) {
return register(app, null, config);
} | java | public static IOSPlatform register(UIApplication app, Config config) {
return register(app, null, config);
} | [
"public",
"static",
"IOSPlatform",
"register",
"(",
"UIApplication",
"app",
",",
"Config",
"config",
")",
"{",
"return",
"register",
"(",
"app",
",",
"null",
",",
"config",
")",
";",
"}"
] | Registers your application using the supplied configuration. | [
"Registers",
"your",
"application",
"using",
"the",
"supplied",
"configuration",
"."
] | c266eeb39188dcada4b00992a0d1199759e03d42 | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/ios/src/playn/ios/IOSPlatform.java#L164-L166 | train | Register the application with the given configuration. | Create a Java method that does the following: "Register the application with the given configuration.". | Of course, here is the Java code you requested:
```java
public static IOSPlatform register(UIApplication app, Config config) {
return register(app, null, config);
}
```
Hope this helps! | |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/services/PartnerAccountService.java | PartnerAccountService.create | public Optional<PartnerAccount> create(long partnerId, PartnerAccount account)
{
return HTTP.POST(String.format("/v2/partners/%d/accounts", partnerId), account, PARTNER_ACCOUNT);
} | java | public Optional<PartnerAccount> create(long partnerId, PartnerAccount account)
{
return HTTP.POST(String.format("/v2/partners/%d/accounts", partnerId), account, PARTNER_ACCOUNT);
} | [
"public",
"Optional",
"<",
"PartnerAccount",
">",
"create",
"(",
"long",
"partnerId",
",",
"PartnerAccount",
"account",
")",
"{",
"return",
"HTTP",
".",
"POST",
"(",
"String",
".",
"format",
"(",
"\"/v2/partners/%d/accounts\"",
",",
"partnerId",
")",
",",
"acc... | Creates the given account.
@param partnerId The id of the partner the account belongs to
@param account The account to create
@return The account that was created | [
"Creates",
"the",
"given",
"account",
"."
] | 5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/PartnerAccountService.java#L68-L71 | train | Creates the specified account. | Create a Java method that does the following: "Creates the specified account.". | Of course, here is the Java code you requested:
```java
public Optional<PartnerAccount> create(long partnerId, PartnerAccount account)
{
return HTTP.POST(String.format("/v2/partners/%d/accounts", partnerId), account, PARTNER_ACCOUNT);
}
```
Hope this helps! | |
protostuff/protostuff | protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java | JsonIOUtil.parseListFrom | public static <T> List<T> parseListFrom(JsonParser parser, Schema<T> schema,
boolean numeric) throws IOException
{
if (parser.nextToken() != JsonToken.START_ARRAY)
{
throw new JsonInputException("Expected token: [ but was " +
parser.getCurrentToken()... | java | public static <T> List<T> parseListFrom(JsonParser parser, Schema<T> schema,
boolean numeric) throws IOException
{
if (parser.nextToken() != JsonToken.START_ARRAY)
{
throw new JsonInputException("Expected token: [ but was " +
parser.getCurrentToken()... | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"parseListFrom",
"(",
"JsonParser",
"parser",
",",
"Schema",
"<",
"T",
">",
"schema",
",",
"boolean",
"numeric",
")",
"throws",
"IOException",
"{",
"if",
"(",
"parser",
".",
"nextToken",
"(",
")... | Parses the {@code messages} from the parser using the given {@code schema}. | [
"Parses",
"the",
"{"
] | af669cf089057d0ec83220266131ce411854af7b | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-json/src/main/java/io/protostuff/JsonIOUtil.java#L623-L658 | train | Parses a list of
messages from the given JsonParser using the given schema. | Create a Java method that does the following: "Parses a list of
messages from the given JsonParser using the given schema.". | Of course, here is the Java code you requested:
```java
public static <T> List<T> parseListFrom(JsonParser parser, Schema<T> schema,
boolean numeric) throws IOException
{
if (parser.nextToken() != JsonToken.START_ARRAY)
{
throw new JsonInputException("Expected token: [ ... | |
alkacon/opencms-core | src-modules/org/opencms/workplace/list/CmsListMetadata.java | CmsListMetadata.checkIds | void checkIds() {
Set<String> ids = new TreeSet<String>();
// indep actions
Iterator<I_CmsListAction> itIndepActions = getIndependentActions().iterator();
while (itIndepActions.hasNext()) {
String id = itIndepActions.next().getId();
if (ids.contains(id)) {
... | java | void checkIds() {
Set<String> ids = new TreeSet<String>();
// indep actions
Iterator<I_CmsListAction> itIndepActions = getIndependentActions().iterator();
while (itIndepActions.hasNext()) {
String id = itIndepActions.next().getId();
if (ids.contains(id)) {
... | [
"void",
"checkIds",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"ids",
"=",
"new",
"TreeSet",
"<",
"String",
">",
"(",
")",
";",
"// indep actions",
"Iterator",
"<",
"I_CmsListAction",
">",
"itIndepActions",
"=",
"getIndependentActions",
"(",
")",
".",
"iter... | /*package | [
"/",
"*",
"package"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/list/CmsListMetadata.java#L864-L923 | train | Checks if the ids are valid. | Create a Java method that does the following: "Checks if the ids are valid.". | Of course, here is the Java code you requested:
```java
void checkIds() {
Set<String> ids = new TreeSet<String>();
// indep actions
Iterator<I_CmsListAction> itIndepActions = getIndependentActions().iterator();
while (itIndepActions.hasNext()) {
String id = itIndepActions.n... | |
Evol-Instruct | N/A | N/A | java | [] | [] | train | Create a class Employee in Java which contains the name, age, salary and department of the employee. Implement methods to calculate the yearly bonus based on the employee's salary and department. The bonus should be calculated as follows:
- For employees in the sales department, the bonus is 5% of their salary.
- For e... | Here is the implementation of the Employee class in Java:
```java
public class Employee {
private String name;
private int age;
private double salary;
private String department;
public Employee(String name, int age, double salary, String department) {
this.name = name;
this.age = a... | |||||||
landawn/AbacusUtil | src/com/landawn/abacus/util/Multimap.java | Multimap.replaceIf | public <X extends Exception> boolean replaceIf(Try.Predicate<? super K, X> predicate, Object oldValue, E newValue) throws X {
boolean modified = false;
for (Map.Entry<K, V> entry : this.valueMap.entrySet()) {
if (predicate.test(entry.getKey())) {
modified = modified | r... | java | public <X extends Exception> boolean replaceIf(Try.Predicate<? super K, X> predicate, Object oldValue, E newValue) throws X {
boolean modified = false;
for (Map.Entry<K, V> entry : this.valueMap.entrySet()) {
if (predicate.test(entry.getKey())) {
modified = modified | r... | [
"public",
"<",
"X",
"extends",
"Exception",
">",
"boolean",
"replaceIf",
"(",
"Try",
".",
"Predicate",
"<",
"?",
"super",
"K",
",",
"X",
">",
"predicate",
",",
"Object",
"oldValue",
",",
"E",
"newValue",
")",
"throws",
"X",
"{",
"boolean",
"modified",
... | Replace the specified value (one occurrence) from the value set associated with keys which satisfy the specified <code>predicate</code>.
@param predicate
@param oldValue
@param newValue
@return <code>true</code> if this Multimap is modified by this operation, otherwise <code>false</code>. | [
"Replace",
"the",
"specified",
"value",
"(",
"one",
"occurrence",
")",
"from",
"the",
"value",
"set",
"associated",
"with",
"keys",
"which",
"satisfy",
"the",
"specified",
"<code",
">",
"predicate<",
"/",
"code",
">",
".",
"@param",
"predicate",
"@param",
"o... | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Multimap.java#L845-L855 | train | Replaces all the records in this map with the given value if the predicate evaluates to true. | Create a Java method that does the following: "Replaces all the records in this map with the given value if the predicate evaluates to true.". | Of course, here is the Java code you requested:
```java
public <X extends Exception> boolean replaceIf(Try.Predicate<? super K, X> predicate, Object oldValue, E newValue) throws X {
boolean modified = false;
for (Map.Entry<K, V> entry : this.valueMap.entrySet()) {
if (predicate.test(en... | |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasACL.java | BaasACL.rolesWithGrant | public Set<String> rolesWithGrant(Grant grant){
if (grant==null) throw new IllegalArgumentException("grant cannot be null");
return rolesGrants.get(grant);
} | java | public Set<String> rolesWithGrant(Grant grant){
if (grant==null) throw new IllegalArgumentException("grant cannot be null");
return rolesGrants.get(grant);
} | [
"public",
"Set",
"<",
"String",
">",
"rolesWithGrant",
"(",
"Grant",
"grant",
")",
"{",
"if",
"(",
"grant",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"grant cannot be null\"",
")",
";",
"return",
"rolesGrants",
".",
"get",
"(",
"g... | Returns the roles that have the specified {@code grant}
@param grant a {@link com.baasbox.android.Grant}
@return | [
"Returns",
"the",
"roles",
"that",
"have",
"the",
"specified",
"{"
] | 6bb2203246b885b2ad63a7bfaf37c83caf15e0d8 | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasACL.java#L80-L83 | train | Returns the set of roles that have the specified grant. | Create a Java method that does the following: "Returns the set of roles that have the specified grant.". | Of course, here is the Java code you requested:
```java
public Set<String> rolesWithGrant(Grant grant){
if (grant==null) throw new IllegalArgumentException("grant cannot be null");
return rolesGrants.get(grant);
}
```
Hope this helps! | |
VoltDB/voltdb | src/frontend/org/voltdb/plannodes/AbstractPlanNode.java | AbstractPlanNode.findAllExpressionsOfClass | protected void findAllExpressionsOfClass(Class< ? extends AbstractExpression> aeClass,
Set<AbstractExpression> collected) {
// Check the inlined plan nodes
for (AbstractPlanNode inlineNode: getInlinePlanNodes().values()) {
// For inline node we MUST go recursive to its children!!... | java | protected void findAllExpressionsOfClass(Class< ? extends AbstractExpression> aeClass,
Set<AbstractExpression> collected) {
// Check the inlined plan nodes
for (AbstractPlanNode inlineNode: getInlinePlanNodes().values()) {
// For inline node we MUST go recursive to its children!!... | [
"protected",
"void",
"findAllExpressionsOfClass",
"(",
"Class",
"<",
"?",
"extends",
"AbstractExpression",
">",
"aeClass",
",",
"Set",
"<",
"AbstractExpression",
">",
"collected",
")",
"{",
"// Check the inlined plan nodes",
"for",
"(",
"AbstractPlanNode",
"inlineNode",... | Collect a unique list of expressions of a given type that this node has including its inlined nodes
@param aeClass AbstractExpression class to search for
@param collection set to populate with expressions that this node has | [
"Collect",
"a",
"unique",
"list",
"of",
"expressions",
"of",
"a",
"given",
"type",
"that",
"this",
"node",
"has",
"including",
"its",
"inlined",
"nodes"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/plannodes/AbstractPlanNode.java#L945-L958 | train | Recursively finds all expressions of a given class. | Create a Java method that does the following: "Recursively finds all expressions of a given class.". | Of course, here is the Java code you requested:
```java
protected void findAllExpressionsOfClass(Class< ? extends AbstractExpression> aeClass,
Set<AbstractExpression> collected) {
// Check the inlined plan nodes
for (AbstractPlanNode inlineNode: getInlinePlanNodes().values()) {
... | |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java | OrientEdge.getId | @Override
public Object getId() {
if (rawElement == null)
// CREATE A TEMPORARY ID
return vOut.getIdentity() + "->" + vIn.getIdentity();
setCurrentGraphInThreadLocal();
return super.getId();
} | java | @Override
public Object getId() {
if (rawElement == null)
// CREATE A TEMPORARY ID
return vOut.getIdentity() + "->" + vIn.getIdentity();
setCurrentGraphInThreadLocal();
return super.getId();
} | [
"@",
"Override",
"public",
"Object",
"getId",
"(",
")",
"{",
"if",
"(",
"rawElement",
"==",
"null",
")",
"// CREATE A TEMPORARY ID",
"return",
"vOut",
".",
"getIdentity",
"(",
")",
"+",
"\"->\"",
"+",
"vIn",
".",
"getIdentity",
"(",
")",
";",
"setCurrentGr... | Returns the Edge Id assuring to save it if it's transient yet. | [
"Returns",
"the",
"Edge",
"Id",
"assuring",
"to",
"save",
"it",
"if",
"it",
"s",
"transient",
"yet",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L255-L264 | test | This method is called to get the ID of the element. | Create a Java method that does the following: "This method is called to get the ID of the element.". | Of course, here is the Java code you requested:
```java
@Override
public Object getId() {
if (rawElement == null)
// CREATE A TEMPORARY ID
return vOut.getIdentity() + "->" + vIn.getIdentity();
setCurrentGraphInThreadLocal();
return super.getId();
}
```
Hope this helps! | |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.cleanAreaAsync | public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) {
BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin);
return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax);
} | java | public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) {
BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin);
return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax);
} | [
"public",
"CacheManagerTask",
"cleanAreaAsync",
"(",
"final",
"Context",
"ctx",
",",
"ArrayList",
"<",
"GeoPoint",
">",
"geoPoints",
",",
"int",
"zoomMin",
",",
"int",
"zoomMax",
")",
"{",
"BoundingBox",
"extendedBounds",
"=",
"extendedBoundsFromGeoPoints",
"(",
"... | Remove all cached tiles covered by the GeoPoints list.
@param ctx
@param geoPoints
@param zoomMin
@param zoomMax | [
"Remove",
"all",
"cached",
"tiles",
"covered",
"by",
"the",
"GeoPoints",
"list",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L905-L908 | train | Clean the cache area asynchronously. | Create a Java method that does the following: "Clean the cache area asynchronously.". | Of course, here is the Java code you requested:
```java
public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) {
BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin);
return cleanAreaAsync(ctx, extendedBounds, zoomMin, z... | |
otto-de/edison-hal | src/main/java/de/otto/edison/hal/traverson/Traverson.java | Traverson.follow | public Traverson follow(final List<String> rels,
final Map<String, Object> vars) {
for (String rel : rels) {
follow(rel, always(), vars);
}
return this;
} | java | public Traverson follow(final List<String> rels,
final Map<String, Object> vars) {
for (String rel : rels) {
follow(rel, always(), vars);
}
return this;
} | [
"public",
"Traverson",
"follow",
"(",
"final",
"List",
"<",
"String",
">",
"rels",
",",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"vars",
")",
"{",
"for",
"(",
"String",
"rel",
":",
"rels",
")",
"{",
"follow",
"(",
"rel",
",",
"always",
"(... | Follow multiple link-relation types, one by one.
<p>
Templated links are expanded to URIs using the specified template variables.
</p>
<p>
Embedded items are used instead of resolving links, if present in the returned HAL documents.
</p>
@param rels the link-relation types of the followed links
@param vars uri-templat... | [
"Follow",
"multiple",
"link",
"-",
"relation",
"types",
"one",
"by",
"one",
".",
"<p",
">",
"Templated",
"links",
"are",
"expanded",
"to",
"URIs",
"using",
"the",
"specified",
"template",
"variables",
".",
"<",
"/",
"p",
">",
"<p",
">",
"Embedded",
"item... | 1582d2b49d1f0d9103e03bf742f18afa9d166992 | https://github.com/otto-de/edison-hal/blob/1582d2b49d1f0d9103e03bf742f18afa9d166992/src/main/java/de/otto/edison/hal/traverson/Traverson.java#L458-L464 | train | Follow a list of rels and assign vars to the result. | Create a Java method that does the following: "Follow a list of rels and assign vars to the result.". | Of course, here is the Java code you requested:
```java
public Traverson follow(final List<String> rels,
final Map<String, Object> vars) {
for (String rel : rels) {
follow(rel, always(), vars);
}
return this;
}
```
Hope this helps! | |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductDimensions.java | ProductDimensions.createType | public static ProductType createType(ProductDimensionType productDimensionType,
@Nullable String productTypeValue) {
Preconditions.checkNotNull(productDimensionType,
"ProductDimensionType is required when creating a ProductType");
ProductType productType = new ProductType();
productType.setTyp... | java | public static ProductType createType(ProductDimensionType productDimensionType,
@Nullable String productTypeValue) {
Preconditions.checkNotNull(productDimensionType,
"ProductDimensionType is required when creating a ProductType");
ProductType productType = new ProductType();
productType.setTyp... | [
"public",
"static",
"ProductType",
"createType",
"(",
"ProductDimensionType",
"productDimensionType",
",",
"@",
"Nullable",
"String",
"productTypeValue",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"productDimensionType",
",",
"\"ProductDimensionType is required when... | Creates a new ProductType.
@param productDimensionType required
@param productTypeValue may be null if creating an "other" dimension | [
"Creates",
"a",
"new",
"ProductType",
"."
] | 967957cc4f6076514e3a7926fe653e4f1f7cc9c9 | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductDimensions.java#L56-L64 | train | Create a ProductType object. | Create a Java method that does the following: "Create a ProductType object.". | Of course, here is the Java code you requested:
```java
public static ProductType createType(ProductDimensionType productDimensionType,
@Nullable String productTypeValue) {
Preconditions.checkNotNull(productDimensionType,
"ProductDimensionType is required when creating a ProductType");
ProductTyp... | |
Harium/keel | src/main/java/com/harium/keel/catalano/core/IntRange.java | IntRange.IsOverlapping | public boolean IsOverlapping(IntRange range) {
return ((isInside(range.min)) || (isInside(range.max)) ||
(range.isInside(min)) || (range.isInside(max)));
} | java | public boolean IsOverlapping(IntRange range) {
return ((isInside(range.min)) || (isInside(range.max)) ||
(range.isInside(min)) || (range.isInside(max)));
} | [
"public",
"boolean",
"IsOverlapping",
"(",
"IntRange",
"range",
")",
"{",
"return",
"(",
"(",
"isInside",
"(",
"range",
".",
"min",
")",
")",
"||",
"(",
"isInside",
"(",
"range",
".",
"max",
")",
")",
"||",
"(",
"range",
".",
"isInside",
"(",
"min",
... | Check if the specified range overlaps with the range.
@param range IntRange.
@return True if the range overlaps with the range, otherwise returns false. | [
"Check",
"if",
"the",
"specified",
"range",
"overlaps",
"with",
"the",
"range",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/IntRange.java#L115-L118 | train | Check if the range is overlapping. | Create a Java method that does the following: "Check if the range is overlapping.". | Of course, here is the Java code you requested:
```java
public boolean IsOverlapping(IntRange range) {
return ((isInside(range.min)) || (isInside(range.max)) ||
(range.isInside(min)) || (range.isInside(max)));
}
```
Hope this helps! | |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/Stream.java | Stream.mapToLong | @NotNull
public LongStream mapToLong(@NotNull final ToLongFunction<? super T> mapper) {
return new LongStream(params, new ObjMapToLong<T>(iterator, mapper));
} | java | @NotNull
public LongStream mapToLong(@NotNull final ToLongFunction<? super T> mapper) {
return new LongStream(params, new ObjMapToLong<T>(iterator, mapper));
} | [
"@",
"NotNull",
"public",
"LongStream",
"mapToLong",
"(",
"@",
"NotNull",
"final",
"ToLongFunction",
"<",
"?",
"super",
"T",
">",
"mapper",
")",
"{",
"return",
"new",
"LongStream",
"(",
"params",
",",
"new",
"ObjMapToLong",
"<",
"T",
">",
"(",
"iterator",
... | Returns {@code LongStream} with elements that obtained by applying the given function.
<p>This is an intermediate operation.
@param mapper the mapper function used to apply to each element
@return the new {@code LongStream}
@since 1.1.4
@see #map(com.annimon.stream.function.Function) | [
"Returns",
"{",
"@code",
"LongStream",
"}",
"with",
"elements",
"that",
"obtained",
"by",
"applying",
"the",
"given",
"function",
"."
] | f29fd57208c20252a4549b084d55ed082c3e58f0 | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L826-L829 | train | Create a new stream that maps all elements of this stream to a LongStream. | Create a Java method that does the following: "Create a new stream that maps all elements of this stream to a LongStream.". | Of course, here is the Java code you requested:
```java
@NotNull
public LongStream mapToLong(@NotNull final ToLongFunction<? super T> mapper) {
return new LongStream(params, new ObjMapToLong<T>(iterator, mapper));
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.listQueryResultsForResourceGroupLevelPolicyAssignmentAsync | public ServiceFuture<PolicyStatesQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, final ServiceCallback<PolicyStatesQueryResultsInner> serviceCallback) {
return S... | java | public ServiceFuture<PolicyStatesQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, final ServiceCallback<PolicyStatesQueryResultsInner> serviceCallback) {
return S... | [
"public",
"ServiceFuture",
"<",
"PolicyStatesQueryResultsInner",
">",
"listQueryResultsForResourceGroupLevelPolicyAssignmentAsync",
"(",
"PolicyStatesResource",
"policyStatesResource",
",",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssign... | Queries policy states for the resource group level policy assignment.
@param policyStatesResource The virtual resource under PolicyStates resource type. In a given time range, 'latest' represents the latest policy state(s), whereas 'default' represents all policy state(s). Possible values include: 'default', 'latest'
... | [
"Queries",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L2895-L2897 | train | Query results for resource group level policy assignment. | Create a Java method that does the following: "Query results for resource group level policy assignment.". | Of course, here is the Java code you requested:
```java
public ServiceFuture<PolicyStatesQueryResultsInner> listQueryResultsForResourceGroupLevelPolicyAssignmentAsync(PolicyStatesResource policyStatesResource, String subscriptionId, String resourceGroupName, String policyAssignmentName, final ServiceCallback<PolicySta... | |
tvesalainen/util | util/src/main/java/org/vesalainen/util/CollectionHelp.java | CollectionHelp.print | public static final String print(String delim, Collection<?> collection)
{
return print(null, delim, null, null, null, collection);
} | java | public static final String print(String delim, Collection<?> collection)
{
return print(null, delim, null, null, null, collection);
} | [
"public",
"static",
"final",
"String",
"print",
"(",
"String",
"delim",
",",
"Collection",
"<",
"?",
">",
"collection",
")",
"{",
"return",
"print",
"(",
"null",
",",
"delim",
",",
"null",
",",
"null",
",",
"null",
",",
"collection",
")",
";",
"}"
] | Returns collection items delimited
@param delim
@param collection
@return
@deprecated Use java.util.stream.Collectors.joining
@see java.util.stream.Collectors#joining(java.lang.CharSequence) | [
"Returns",
"collection",
"items",
"delimited"
] | bba7a44689f638ffabc8be40a75bdc9a33676433 | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/util/CollectionHelp.java#L170-L173 | train | Print a Collection of
with the given delimiter. | Create a Java method that does the following: "Print a Collection of
with the given delimiter.". | Of course, here is the Java code you requested:
```java
public static final String print(String delim, Collection<?> collection)
{
return print(null, delim, null, null, null, collection);
}
```
Hope this helps! | |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/SqlManagerImpl.java | SqlManagerImpl.iterate | public <T, R> R iterate(Class<T> clazz, IterationCallback<T, R> callback, SqlResource resource, Object param) {
Node node = prepareNode(resource);
SqlContext context = prepareSqlContext(param);
node.accept(context);
return sqlExecutor.<T, R> iterate(clazz, callback, context.getSql(... | java | public <T, R> R iterate(Class<T> clazz, IterationCallback<T, R> callback, SqlResource resource, Object param) {
Node node = prepareNode(resource);
SqlContext context = prepareSqlContext(param);
node.accept(context);
return sqlExecutor.<T, R> iterate(clazz, callback, context.getSql(... | [
"public",
"<",
"T",
",",
"R",
">",
"R",
"iterate",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"IterationCallback",
"<",
"T",
",",
"R",
">",
"callback",
",",
"SqlResource",
"resource",
",",
"Object",
"param",
")",
"{",
"Node",
"node",
"=",
"prepareNod... | {@inheritDoc} | [
"{"
] | 29a44b7ad267b5a48bc250cd0ef7d74813d46889 | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/SqlManagerImpl.java#L576-L582 | train | Iterate over the resource and parameters. | Create a Java method that does the following: "Iterate over the resource and parameters.". | Of course, here is the Java code you requested:
```java
public <T, R> R iterate(Class<T> clazz, IterationCallback<T, R> callback, SqlResource resource, Object param) {
Node node = prepareNode(resource);
SqlContext context = prepareSqlContext(param);
node.accept(context);
return sq... | |
netty/netty | common/src/main/java/io/netty/util/AsciiString.java | AsciiString.concat | public AsciiString concat(CharSequence string) {
int thisLen = length();
int thatLen = string.length();
if (thatLen == 0) {
return this;
}
if (string.getClass() == AsciiString.class) {
AsciiString that = (AsciiString) string;
if (isEmpty()) {
... | java | public AsciiString concat(CharSequence string) {
int thisLen = length();
int thatLen = string.length();
if (thatLen == 0) {
return this;
}
if (string.getClass() == AsciiString.class) {
AsciiString that = (AsciiString) string;
if (isEmpty()) {
... | [
"public",
"AsciiString",
"concat",
"(",
"CharSequence",
"string",
")",
"{",
"int",
"thisLen",
"=",
"length",
"(",
")",
";",
"int",
"thatLen",
"=",
"string",
".",
"length",
"(",
")",
";",
"if",
"(",
"thatLen",
"==",
"0",
")",
"{",
"return",
"this",
";... | Concatenates this string and the specified string.
@param string the string to concatenate
@return a new string which is the concatenation of this string and the specified string. | [
"Concatenates",
"this",
"string",
"and",
"the",
"specified",
"string",
"."
] | ba06eafa1c1824bd154f1a380019e7ea2edf3c4c | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/AsciiString.java#L473-L503 | train | concat this string with another string. | Create a Java method that does the following: "concat this string with another string.". | Of course, here is the Java code you requested:
```java
public AsciiString concat(CharSequence string) {
int thisLen = length();
int thatLen = string.length();
if (thatLen == 0) {
return this;
}
if (string.getClass() == AsciiString.class) {
AsciiString t... | |
jtrfp/javamod | src/main/java/de/quippy/javamod/main/gui/components/SAMeterPanel.java | SAMeterPanel.drawMeter | protected void drawMeter(Graphics g, int newTop, int newLeft, int newWidth, int newHeight, boolean doClear)
{
if (g!=null)
{
switch (drawWhat)
{
default:
case DRAW_SA_METER: drawSAMeter(g, newTop, newLeft, newWidth, newHeight, doClear); break;
case DRAW_WAVE_METER: drawWaveMeter(g, newTop, newLe... | java | protected void drawMeter(Graphics g, int newTop, int newLeft, int newWidth, int newHeight, boolean doClear)
{
if (g!=null)
{
switch (drawWhat)
{
default:
case DRAW_SA_METER: drawSAMeter(g, newTop, newLeft, newWidth, newHeight, doClear); break;
case DRAW_WAVE_METER: drawWaveMeter(g, newTop, newLe... | [
"protected",
"void",
"drawMeter",
"(",
"Graphics",
"g",
",",
"int",
"newTop",
",",
"int",
"newLeft",
",",
"int",
"newWidth",
",",
"int",
"newHeight",
",",
"boolean",
"doClear",
")",
"{",
"if",
"(",
"g",
"!=",
"null",
")",
"{",
"switch",
"(",
"drawWhat"... | Internal method doing the drawing
@param g
@param newTop
@param newLeft
@param newWidth
@param newHeight
@param doClear
@since 06.05.2011 | [
"Internal",
"method",
"doing",
"the",
"drawing"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/main/gui/components/SAMeterPanel.java#L215-L238 | train | Draw a single meter. | Create a Java method that does the following: "Draw a single meter.". | Of course, here is the Java code you requested:
```java
protected void drawMeter(Graphics g, int newTop, int newLeft, int newWidth, int newHeight, boolean doClear)
{
if (g!=null)
{
switch (drawWhat)
{
default:
case DRAW_SA_METER: drawSAMeter(g, newTop, newLeft, newWidth, newHeight, doClear); break; ... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java | AfplibPackageImpl.getPGPRGSHside | public EEnum getPGPRGSHside() {
if (pgprgsHsideEEnum == null) {
pgprgsHsideEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(126);
}
return pgprgsHsideEEnum;
} | java | public EEnum getPGPRGSHside() {
if (pgprgsHsideEEnum == null) {
pgprgsHsideEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(126);
}
return pgprgsHsideEEnum;
} | [
"public",
"EEnum",
"getPGPRGSHside",
"(",
")",
"{",
"if",
"(",
"pgprgsHsideEEnum",
"==",
"null",
")",
"{",
"pgprgsHsideEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
"AfplibPackage",
".",
"eNS_URI",
")"... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java#L17458-L17463 | train | Get the EEnum representing the pgprgsHside feature. | Create a Java method that does the following: "Get the EEnum representing the pgprgsHside feature.". | Of course, here is the Java code you requested:
```java
public EEnum getPGPRGSHside() {
if (pgprgsHsideEEnum == null) {
pgprgsHsideEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(126);
}
return pgprgsHsideEEnum;
}
```
Hope this helps! | |
molgenis/molgenis | molgenis-data/src/main/java/org/molgenis/data/EntityReferenceResolverDecorator.java | EntityReferenceResolverDecorator.forEachBatched | @Override
public void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize) {
delegate()
.forEachBatched(
fetch,
entities -> {
List<Entity> resolvedEntities =
resolveEntityReferences(entities.stream(), fetch).collect(Collectors.... | java | @Override
public void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize) {
delegate()
.forEachBatched(
fetch,
entities -> {
List<Entity> resolvedEntities =
resolveEntityReferences(entities.stream(), fetch).collect(Collectors.... | [
"@",
"Override",
"public",
"void",
"forEachBatched",
"(",
"Fetch",
"fetch",
",",
"Consumer",
"<",
"List",
"<",
"Entity",
">",
">",
"consumer",
",",
"int",
"batchSize",
")",
"{",
"delegate",
"(",
")",
".",
"forEachBatched",
"(",
"fetch",
",",
"entities",
... | Resolve entity references | [
"Resolve",
"entity",
"references"
] | b4d0d6b27e6f6c8d7505a3863dc03b589601f987 | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-data/src/main/java/org/molgenis/data/EntityReferenceResolverDecorator.java#L43-L54 | train | Override for batched iteration of the result set. | Create a Java method that does the following: "Override for batched iteration of the result set.". | Of course, here is the Java code you requested:
```java
@Override
public void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize) {
delegate()
.forEachBatched(
fetch,
entities -> {
List<Entity> resolvedEntities =
resolveEntit... | |
thelinmichael/spotify-web-api-java | src/main/java/com/wrapper/spotify/SpotifyApi.java | SpotifyApi.saveTracksForUser | public SaveTracksForUserRequest.Builder saveTracksForUser(JsonArray ids) {
return new SaveTracksForUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(ids);
} | java | public SaveTracksForUserRequest.Builder saveTracksForUser(JsonArray ids) {
return new SaveTracksForUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(ids);
} | [
"public",
"SaveTracksForUserRequest",
".",
"Builder",
"saveTracksForUser",
"(",
"JsonArray",
"ids",
")",
"{",
"return",
"new",
"SaveTracksForUserRequest",
".",
"Builder",
"(",
"accessToken",
")",
".",
"setDefaults",
"(",
"httpManager",
",",
"scheme",
",",
"host",
... | Save tracks in the users "Your Music" library.
@param ids The track IDs to add to the users library. Maximum: 50 IDs.
@return A {@link SaveTracksForUserRequest.Builder}.
@see <a href="https://developer.spotify.com/web-api/user-guide/#spotify-uris-and-ids">Spotify: URLs & IDs</a> | [
"Save",
"tracks",
"in",
"the",
"users",
"Your",
"Music",
"library",
"."
] | c06b8512344c0310d0c1df362fa267879021da2e | https://github.com/thelinmichael/spotify-web-api-java/blob/c06b8512344c0310d0c1df362fa267879021da2e/src/main/java/com/wrapper/spotify/SpotifyApi.java#L849-L853 | train | Save tracks for a user | Create a Java method that does the following: "Save tracks for a user". | Of course, here is the Java code you requested:
```java
public SaveTracksForUserRequest.Builder saveTracksForUser(JsonArray ids) {
return new SaveTracksForUserRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(ids);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/InstanceLimitsMarshaller.java | InstanceLimitsMarshaller.marshall | public void marshall(InstanceLimits instanceLimits, ProtocolMarshaller protocolMarshaller) {
if (instanceLimits == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(instanceLimits.getInstanceCountLimits... | java | public void marshall(InstanceLimits instanceLimits, ProtocolMarshaller protocolMarshaller) {
if (instanceLimits == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(instanceLimits.getInstanceCountLimits... | [
"public",
"void",
"marshall",
"(",
"InstanceLimits",
"instanceLimits",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"instanceLimits",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\""... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/InstanceLimitsMarshaller.java#L42-L53 | train | marshalls the instanceLimits to the JSON - compatible parameter object. | Create a Java method that does the following: "marshalls the instanceLimits to the JSON - compatible parameter object.". | Of course, here is the Java code you requested:
```java
public void marshall(InstanceLimits instanceLimits, ProtocolMarshaller protocolMarshaller) {
if (instanceLimits == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocol... | |
arnohaase/a-foundation | a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/AListMap.java | AListMap.fromKeysAndValues | public static <K,V> AListMap<K,V> fromKeysAndValues(AEquality equality, Iterable<K> keys, Iterable<V> values) {
final Iterator<K> ki = keys.iterator();
final Iterator<V> vi = values.iterator();
AListMap<K,V> result = empty (equality);
while(ki.hasNext()) {
final K key = ki.... | java | public static <K,V> AListMap<K,V> fromKeysAndValues(AEquality equality, Iterable<K> keys, Iterable<V> values) {
final Iterator<K> ki = keys.iterator();
final Iterator<V> vi = values.iterator();
AListMap<K,V> result = empty (equality);
while(ki.hasNext()) {
final K key = ki.... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"AListMap",
"<",
"K",
",",
"V",
">",
"fromKeysAndValues",
"(",
"AEquality",
"equality",
",",
"Iterable",
"<",
"K",
">",
"keys",
",",
"Iterable",
"<",
"V",
">",
"values",
")",
"{",
"final",
"Iterator",
"<",... | Returns an AListMap instance with a given equalityForEquals, initializing it from separate 'keys'
and 'values' collections. Both collections are iterated exactly once, and are expected to have the same size. | [
"Returns",
"an",
"AListMap",
"instance",
"with",
"a",
"given",
"equalityForEquals",
"initializing",
"it",
"from",
"separate",
"keys",
"and",
"values",
"collections",
".",
"Both",
"collections",
"are",
"iterated",
"exactly",
"once",
"and",
"are",
"expected",
"to",
... | f3eef2ca89d67775f202a4c28140230a6229291e | https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/immutable/AListMap.java#L76-L89 | test | Create an AListMap from the given AEquality and Iterable of keys and Iterable of V. | Create a Java method that does the following: "Create an AListMap from the given AEquality and Iterable of keys and Iterable of V.". | Of course, here is the Java code you requested:
```java
public static <K,V> AListMap<K,V> fromKeysAndValues(AEquality equality, Iterable<K> keys, Iterable<V> values) {
final Iterator<K> ki = keys.iterator();
final Iterator<V> vi = values.iterator();
AListMap<K,V> result = empty (equality);
... | |
undertow-io/undertow | servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java | AsyncContextImpl.initialRequestDone | public synchronized void initialRequestDone() {
initialRequestDone = true;
if (previousAsyncContext != null) {
previousAsyncContext.onAsyncStart(this);
previousAsyncContext = null;
}
if (!processingAsyncTask) {
processAsyncTask();
}
ini... | java | public synchronized void initialRequestDone() {
initialRequestDone = true;
if (previousAsyncContext != null) {
previousAsyncContext.onAsyncStart(this);
previousAsyncContext = null;
}
if (!processingAsyncTask) {
processAsyncTask();
}
ini... | [
"public",
"synchronized",
"void",
"initialRequestDone",
"(",
")",
"{",
"initialRequestDone",
"=",
"true",
";",
"if",
"(",
"previousAsyncContext",
"!=",
"null",
")",
"{",
"previousAsyncContext",
".",
"onAsyncStart",
"(",
"this",
")",
";",
"previousAsyncContext",
"=... | Called by the container when the initial request is finished.
If this request has a dispatch or complete call pending then
this will be started. | [
"Called",
"by",
"the",
"container",
"when",
"the",
"initial",
"request",
"is",
"finished",
".",
"If",
"this",
"request",
"has",
"a",
"dispatch",
"or",
"complete",
"call",
"pending",
"then",
"this",
"will",
"be",
"started",
"."
] | 87de0b856a7a4ba8faf5b659537b9af07b763263 | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java#L459-L469 | train | Called by the request thread to indicate that the initial request has finished. | Create a Java method that does the following: "Called by the request thread to indicate that the initial request has finished.". | Of course, here is the Java code you requested:
```java
public synchronized void initialRequestDone() {
initialRequestDone = true;
if (previousAsyncContext != null) {
previousAsyncContext.onAsyncStart(this);
previousAsyncContext = null;
}
if (!processingAsyncTask... | |
Unidata/thredds | cdm/src/main/java/ucar/unidata/util/StringUtil2.java | StringUtil2.removeFromEnd | static public String removeFromEnd(String s, int c) {
if (0 > s.indexOf(c)) // none
return s;
int len = s.length();
while ((s.charAt(len - 1) == c) && (len > 0))
len--;
if (len == s.length())
return s;
return s.substring(0, len);
} | java | static public String removeFromEnd(String s, int c) {
if (0 > s.indexOf(c)) // none
return s;
int len = s.length();
while ((s.charAt(len - 1) == c) && (len > 0))
len--;
if (len == s.length())
return s;
return s.substring(0, len);
} | [
"static",
"public",
"String",
"removeFromEnd",
"(",
"String",
"s",
",",
"int",
"c",
")",
"{",
"if",
"(",
"0",
">",
"s",
".",
"indexOf",
"(",
"c",
")",
")",
"// none\r",
"return",
"s",
";",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"... | Remove all occurrences of the character c at the end of s.
@param s operate on this string
@param c remove all occurrences of this character that are at the end of the string.
@return result with any character c removed | [
"Remove",
"all",
"occurrences",
"of",
"the",
"character",
"c",
"at",
"the",
"end",
"of",
"s",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/util/StringUtil2.java#L321-L332 | test | Removes the last occurrence of c from the end of a String. | Create a Java method that does the following: "Removes the last occurrence of c from the end of a String.". | Of course, here is the Java code you requested:
```java
static public String removeFromEnd(String s, int c) {
if (0 > s.indexOf(c)) // none
return s;
int len = s.length();
while ((s.charAt(len - 1) == c) && (len > 0))
len--;
if (len == s.length())
return s;
return s.... | |
yan74/afplib | org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java | AfplibFactoryImpl.convertFNCXUnitBaseToString | public String convertFNCXUnitBaseToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | java | public String convertFNCXUnitBaseToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} | [
"public",
"String",
"convertFNCXUnitBaseToString",
"(",
"EDataType",
"eDataType",
",",
"Object",
"instanceValue",
")",
"{",
"return",
"instanceValue",
"==",
"null",
"?",
"null",
":",
"instanceValue",
".",
"toString",
"(",
")",
";",
"}"
] | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f | https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L4999-L5001 | train | Convert a FNCXUnit object to a String. | Create a Java method that does the following: "Convert a FNCXUnit object to a String.". | Of course, here is the Java code you requested:
```java
public String convertFNCXUnitBaseToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
}
```
Hope this helps! | |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/DataSet.java | DataSet.joinWithHuge | public <R> JoinOperatorSets<T, R> joinWithHuge(DataSet<R> other) {
return new JoinOperatorSets<>(this, other, JoinHint.BROADCAST_HASH_FIRST);
} | java | public <R> JoinOperatorSets<T, R> joinWithHuge(DataSet<R> other) {
return new JoinOperatorSets<>(this, other, JoinHint.BROADCAST_HASH_FIRST);
} | [
"public",
"<",
"R",
">",
"JoinOperatorSets",
"<",
"T",
",",
"R",
">",
"joinWithHuge",
"(",
"DataSet",
"<",
"R",
">",
"other",
")",
"{",
"return",
"new",
"JoinOperatorSets",
"<>",
"(",
"this",
",",
"other",
",",
"JoinHint",
".",
"BROADCAST_HASH_FIRST",
")... | Initiates a Join transformation.
<p>A Join transformation joins the elements of two
{@link DataSet DataSets} on key equality and provides multiple ways to combine
joining elements into one DataSet.
<p>This method also gives the hint to the optimizer that the second DataSet to join is much
larger than the first one.
... | [
"Initiates",
"a",
"Join",
"transformation",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/DataSet.java#L820-L822 | train | Joins this DataSet with the given DataSet. | Create a Java method that does the following: "Joins this DataSet with the given DataSet.". | Of course, here is the Java code you requested:
```java
public <R> JoinOperatorSets<T, R> joinWithHuge(DataSet<R> other) {
return new JoinOperatorSets<>(this, other, JoinHint.BROADCAST_HASH_FIRST);
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java | SecurityServiceImpl.getAuthenticationService | @Override
public AuthenticationService getAuthenticationService() {
AuthenticationService service = authnService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityConfiguration().getAuthenticationServiceId();
... | java | @Override
public AuthenticationService getAuthenticationService() {
AuthenticationService service = authnService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityConfiguration().getAuthenticationServiceId();
... | [
"@",
"Override",
"public",
"AuthenticationService",
"getAuthenticationService",
"(",
")",
"{",
"AuthenticationService",
"service",
"=",
"authnService",
".",
"get",
"(",
")",
";",
"if",
"(",
"service",
"==",
"null",
")",
"{",
"if",
"(",
"isConfigurationDefinedInFil... | {@inheritDoc} | [
"{"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security/src/com/ibm/ws/security/internal/SecurityServiceImpl.java#L417-L436 | train | Returns the AuthenticationService object. | Create a Java method that does the following: "Returns the AuthenticationService object.". | Of course, here is the Java code you requested:
```java
@Override
public AuthenticationService getAuthenticationService() {
AuthenticationService service = authnService.get();
if (service == null) {
if (isConfigurationDefinedInFile()) {
String id = getEffectiveSecurityCo... | |
bramp/unsafe | unsafe-collection/src/main/java/net/bramp/unsafe/UnsafeArrayList.java | UnsafeArrayList.get | public T get(T dest, int index) {
checkBounds(index);
// We would rather do
// UnsafeHelper.copyMemory(null, offset(index), dest, firstFieldOffset, elementSize);
// but this is unsupported by the Unsafe class
copier.copy(dest, offset(index));
return dest;
} | java | public T get(T dest, int index) {
checkBounds(index);
// We would rather do
// UnsafeHelper.copyMemory(null, offset(index), dest, firstFieldOffset, elementSize);
// but this is unsupported by the Unsafe class
copier.copy(dest, offset(index));
return dest;
} | [
"public",
"T",
"get",
"(",
"T",
"dest",
",",
"int",
"index",
")",
"{",
"checkBounds",
"(",
"index",
")",
";",
"// We would rather do",
"// UnsafeHelper.copyMemory(null, offset(index), dest, firstFieldOffset, elementSize);",
"// but this is unsupported by the Unsafe class",
"c... | Copies the element at index into dest
@param dest The destination object
@param index The index of the object to get
@return The fetched object | [
"Copies",
"the",
"element",
"at",
"index",
"into",
"dest"
] | 805f54e2a8aee905003329556135b6c4059b4418 | https://github.com/bramp/unsafe/blob/805f54e2a8aee905003329556135b6c4059b4418/unsafe-collection/src/main/java/net/bramp/unsafe/UnsafeArrayList.java#L122-L129 | train | Get the value at the given index in the specified object. | Create a Java method that does the following: "Get the value at the given index in the specified object.". | Of course, here is the Java code you requested:
```java
public T get(T dest, int index) {
checkBounds(index);
// We would rather do
// UnsafeHelper.copyMemory(null, offset(index), dest, firstFieldOffset, elementSize);
// but this is unsupported by the Unsafe class
copier.copy(dest, offset(index))... | |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java | CreateKeyspaceStatement.validate | public void validate() throws InvalidRequestException
{
// required
if (!attrs.containsKey("strategy_class"))
throw new InvalidRequestException("missing required argument \"strategy_class\"");
strategyClass = attrs.get("strategy_class");
// optional
for (String k... | java | public void validate() throws InvalidRequestException
{
// required
if (!attrs.containsKey("strategy_class"))
throw new InvalidRequestException("missing required argument \"strategy_class\"");
strategyClass = attrs.get("strategy_class");
// optional
for (String k... | [
"public",
"void",
"validate",
"(",
")",
"throws",
"InvalidRequestException",
"{",
"// required",
"if",
"(",
"!",
"attrs",
".",
"containsKey",
"(",
"\"strategy_class\"",
")",
")",
"throw",
"new",
"InvalidRequestException",
"(",
"\"missing required argument \\\"strategy_c... | The <code>CqlParser</code> only goes as far as extracting the keyword arguments
from these statements, so this method is responsible for processing and
validating, and must be called prior to access.
@throws InvalidRequestException if arguments are missing or unacceptable | [
"The",
"<code",
">",
"CqlParser<",
"/",
"code",
">",
"only",
"goes",
"as",
"far",
"as",
"extracting",
"the",
"keyword",
"arguments",
"from",
"these",
"statements",
"so",
"this",
"method",
"is",
"responsible",
"for",
"processing",
"and",
"validating",
"and",
... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql/CreateKeyspaceStatement.java#L53-L64 | train | Validate the request. | Create a Java method that does the following: "Validate the request.". | Of course, here is the Java code you requested:
```java
public void validate() throws InvalidRequestException
{
// required
if (!attrs.containsKey("strategy_class"))
throw new InvalidRequestException("missing required argument \"strategy_class\"");
strategyClass = attrs.get("str... | |
bpsm/edn-java | src/main/java/us/bpsm/edn/printer/Printers.java | Printers.printString | public static String printString(final Protocol<Printer.Fn<?>> fns,
Object ednValue) {
StringBuilder sb = new StringBuilder();
newPrinter(fns, sb).printValue(ednValue);
return sb.toString();
} | java | public static String printString(final Protocol<Printer.Fn<?>> fns,
Object ednValue) {
StringBuilder sb = new StringBuilder();
newPrinter(fns, sb).printValue(ednValue);
return sb.toString();
} | [
"public",
"static",
"String",
"printString",
"(",
"final",
"Protocol",
"<",
"Printer",
".",
"Fn",
"<",
"?",
">",
">",
"fns",
",",
"Object",
"ednValue",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"newPrinter",
"(",
"fns",... | Print {@code ednValue} to a new String using the printing
protocol given as {@code fns}.
@param fns a Protocol which knows how to print all the classes
of objects that we'll be asking our Printer to print.
Never null. Never null.
@param ednValue the value to be returned as a String in edn syntax.
@return A string in... | [
"Print",
"{",
"@code",
"ednValue",
"}",
"to",
"a",
"new",
"String",
"using",
"the",
"printing",
"protocol",
"given",
"as",
"{",
"@code",
"fns",
"}",
"."
] | c5dfdb77431da1aca3c257599b237a21575629b2 | https://github.com/bpsm/edn-java/blob/c5dfdb77431da1aca3c257599b237a21575629b2/src/main/java/us/bpsm/edn/printer/Printers.java#L71-L76 | train | Print a single coding value as a string. | Create a Java method that does the following: "Print a single coding value as a string.". | Of course, here is the Java code you requested:
```java
public static String printString(final Protocol<Printer.Fn<?>> fns,
Object ednValue) {
StringBuilder sb = new StringBuilder();
newPrinter(fns, sb).printValue(ednValue);
return sb.toString();
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.