repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/autoscale/autoscaleprofile.java
autoscaleprofile.update
public static base_response update(nitro_service client, autoscaleprofile resource) throws Exception { autoscaleprofile updateresource = new autoscaleprofile(); updateresource.name = resource.name; updateresource.url = resource.url; updateresource.apikey = resource.apikey; updateresource.sharedsecret = resour...
java
public static base_response update(nitro_service client, autoscaleprofile resource) throws Exception { autoscaleprofile updateresource = new autoscaleprofile(); updateresource.name = resource.name; updateresource.url = resource.url; updateresource.apikey = resource.apikey; updateresource.sharedsecret = resour...
[ "public", "static", "base_response", "update", "(", "nitro_service", "client", ",", "autoscaleprofile", "resource", ")", "throws", "Exception", "{", "autoscaleprofile", "updateresource", "=", "new", "autoscaleprofile", "(", ")", ";", "updateresource", ".", "name", "...
Use this API to update autoscaleprofile.
[ "Use", "this", "API", "to", "update", "autoscaleprofile", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/autoscale/autoscaleprofile.java#L252-L259
train
Use this API to update autoscaleprofile.
Of course, here is the Java code you requested: ```java public static base_response update(nitro_service client, autoscaleprofile resource) throws Exception { autoscaleprofile updateresource = new autoscaleprofile(); updateresource.name = resource.name; updateresource.url = resource.url; updateresource.apikey ...
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newNoAvailablePortException
public static NoAvailablePortException newNoAvailablePortException(Throwable cause, String message, Object... args) { return new NoAvailablePortException(format(message, args), cause); }
java
public static NoAvailablePortException newNoAvailablePortException(Throwable cause, String message, Object... args) { return new NoAvailablePortException(format(message, args), cause); }
[ "public", "static", "NoAvailablePortException", "newNoAvailablePortException", "(", "Throwable", "cause", ",", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "new", "NoAvailablePortException", "(", "format", "(", "message", ",", "args", ")", ...
Constructs and initializes a new {@link NoAvailablePortException} with the given {@link Throwable cause} and {@link String message} formatted with the given {@link Object[] arguments}. @param cause {@link Throwable} identified as the reason this {@link NoAvailablePortException} was thrown. @param message {@link String...
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "NoAvailablePortException", "}", "with", "the", "given", "{", "@link", "Throwable", "cause", "}", "and", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", ...
f2163c149fbbef05015e688132064ebcac7c49ab
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L569-L571
train
Creates a NoAvailablePortException with the specified detail message.
Of course, here is the Java code you requested: ```java public static NoAvailablePortException newNoAvailablePortException(Throwable cause, String message, Object... args) { return new NoAvailablePortException(format(message, args), cause); } ``` Hope this helps!
baratine/baratine
kraken/src/main/java/com/caucho/v5/kelp/Row.java
Row.data
public byte []data() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { toData(bos); } catch (IOException e) { throw new RuntimeException(e); } return bos.toByteArray(); }
java
public byte []data() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { toData(bos); } catch (IOException e) { throw new RuntimeException(e); } return bos.toByteArray(); }
[ "public", "byte", "[", "]", "data", "(", ")", "{", "ByteArrayOutputStream", "bos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "try", "{", "toData", "(", "bos", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "Runtime...
Serialize the row's metadata to enable upgrade.
[ "Serialize", "the", "row", "s", "metadata", "to", "enable", "upgrade", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/Row.java#L153-L164
train
Get the data of the CID .
Of course, here is the Java code you requested: ```java public byte []data() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); try { toData(bos); } catch (IOException e) { throw new RuntimeException(e); } return bos.toByteArray(); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/AttributeValue.java
AttributeValue.setBS
public void setBS(java.util.Collection<java.nio.ByteBuffer> bS) { if (bS == null) { this.bS = null; return; } this.bS = new java.util.ArrayList<java.nio.ByteBuffer>(bS); }
java
public void setBS(java.util.Collection<java.nio.ByteBuffer> bS) { if (bS == null) { this.bS = null; return; } this.bS = new java.util.ArrayList<java.nio.ByteBuffer>(bS); }
[ "public", "void", "setBS", "(", "java", ".", "util", ".", "Collection", "<", "java", ".", "nio", ".", "ByteBuffer", ">", "bS", ")", "{", "if", "(", "bS", "==", "null", ")", "{", "this", ".", "bS", "=", "null", ";", "return", ";", "}", "this", "...
<p> An attribute of type Binary Set. For example: </p> <p> <code>"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]</code> </p> @param bS An attribute of type Binary Set. For example:</p> <p> <code>"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]</code>
[ "<p", ">", "An", "attribute", "of", "type", "Binary", "Set", ".", "For", "example", ":", "<", "/", "p", ">", "<p", ">", "<code", ">", "BS", ":", "[", "U3Vubnk", "=", "UmFpbnk", "=", "U25vd3k", "=", "]", "<", "/", "code", ">", "<", "/", "p", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/model/AttributeValue.java#L630-L637
train
Sets the value bS.
Of course, here is the Java code you requested: ```java public void setBS(java.util.Collection<java.nio.ByteBuffer> bS) { if (bS == null) { this.bS = null; return; } this.bS = new java.util.ArrayList<java.nio.ByteBuffer>(bS); } ``` Hope this helps!
ggrandes/kvstore
src/main/java/org/javastack/kvstore/structures/btree/InternalNode.java
InternalNode.checkUnderflow
protected boolean checkUnderflow(final int slot) { if (childs[slot] == NULL_ID) { return false; } if (slot == 0) { return checkUnderflowWithRight(slot); // use nodeParent right sibling } else { if (getSlotLeft(slot) == slot) { return checkUnderflowWithRight(slot); // use nodeParent right sibling ...
java
protected boolean checkUnderflow(final int slot) { if (childs[slot] == NULL_ID) { return false; } if (slot == 0) { return checkUnderflowWithRight(slot); // use nodeParent right sibling } else { if (getSlotLeft(slot) == slot) { return checkUnderflowWithRight(slot); // use nodeParent right sibling ...
[ "protected", "boolean", "checkUnderflow", "(", "final", "int", "slot", ")", "{", "if", "(", "childs", "[", "slot", "]", "==", "NULL_ID", ")", "{", "return", "false", ";", "}", "if", "(", "slot", "==", "0", ")", "{", "return", "checkUnderflowWithRight", ...
Check if underflow occurred in child of slot @param slot the index of a child in nodeParent (this)
[ "Check", "if", "underflow", "occurred", "in", "child", "of", "slot" ]
c79277f79f4604e0fec8349a98519838e3de38f0
https://github.com/ggrandes/kvstore/blob/c79277f79f4604e0fec8349a98519838e3de38f0/src/main/java/org/javastack/kvstore/structures/btree/InternalNode.java#L257-L270
train
Check underflow.
Of course, here is the Java code you requested: ```java protected boolean checkUnderflow(final int slot) { if (childs[slot] == NULL_ID) { return false; } if (slot == 0) { return checkUnderflowWithRight(slot); // use nodeParent right sibling } else { if (getSlotLeft(slot) == slot) { return checkUnd...
liferay/com-liferay-commerce
commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.java
CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.getCommercePriceListUserSegmentEntryRelByUuidAndGroupId
@Override public CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId( String uuid, long groupId) throws PortalException { return commercePriceListUserSegmentEntryRelPersistence.findByUUID_G(uuid, groupId); }
java
@Override public CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId( String uuid, long groupId) throws PortalException { return commercePriceListUserSegmentEntryRelPersistence.findByUUID_G(uuid, groupId); }
[ "@", "Override", "public", "CommercePriceListUserSegmentEntryRel", "getCommercePriceListUserSegmentEntryRelByUuidAndGroupId", "(", "String", "uuid", ",", "long", "groupId", ")", "throws", "PortalException", "{", "return", "commercePriceListUserSegmentEntryRelPersistence", ".", "f...
Returns the commerce price list user segment entry rel matching the UUID and group. @param uuid the commerce price list user segment entry rel's UUID @param groupId the primary key of the group @return the matching commerce price list user segment entry rel @throws PortalException if a matching commerce price list use...
[ "Returns", "the", "commerce", "price", "list", "user", "segment", "entry", "rel", "matching", "the", "UUID", "and", "group", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-service/src/main/java/com/liferay/commerce/price/list/service/base/CommercePriceListUserSegmentEntryRelLocalServiceBaseImpl.java#L413-L418
train
Returns the commerce price list user segment entry rel matching the UUID and group.
Of course, here is the Java code you requested: ```java @Override public CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId( String uuid, long groupId) throws PortalException { return commercePriceListUserSegmentEntryRelPersistence.findByUUID_G(uuid, groupId); } ``` ...
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java
DrawerBuilder.withActivity
public DrawerBuilder withActivity(@NonNull Activity activity) { this.mRootView = (ViewGroup) activity.findViewById(android.R.id.content); this.mActivity = activity; this.mLayoutManager = new LinearLayoutManager(mActivity); return this; }
java
public DrawerBuilder withActivity(@NonNull Activity activity) { this.mRootView = (ViewGroup) activity.findViewById(android.R.id.content); this.mActivity = activity; this.mLayoutManager = new LinearLayoutManager(mActivity); return this; }
[ "public", "DrawerBuilder", "withActivity", "(", "@", "NonNull", "Activity", "activity", ")", "{", "this", ".", "mRootView", "=", "(", "ViewGroup", ")", "activity", ".", "findViewById", "(", "android", ".", "R", ".", "id", ".", "content", ")", ";", "this", ...
Sets the activity which will be generated for the generation The activity is required and will be used to inflate the content in. After generation it is set to null to prevent a memory leak. @param activity current activity which will contain the drawer
[ "Sets", "the", "activity", "which", "will", "be", "generated", "for", "the", "generation", "The", "activity", "is", "required", "and", "will", "be", "used", "to", "inflate", "the", "content", "in", ".", "After", "generation", "it", "is", "set", "to", "null...
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/DrawerBuilder.java#L114-L119
train
Set the activity to use.
Of course, here is the Java code you requested: ```java public DrawerBuilder withActivity(@NonNull Activity activity) { this.mRootView = (ViewGroup) activity.findViewById(android.R.id.content); this.mActivity = activity; this.mLayoutManager = new LinearLayoutManager(mActivity); return t...
OpenLiberty/open-liberty
dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannelProvider.java
SSLChannelProvider.updated
@SuppressWarnings("unchecked") @Override public void updated(String pid, Dictionary properties) throws ConfigurationException { if (FrameworkState.isStopping() || bContext == null) { return; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr....
java
@SuppressWarnings("unchecked") @Override public void updated(String pid, Dictionary properties) throws ConfigurationException { if (FrameworkState.isStopping() || bContext == null) { return; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr....
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "void", "updated", "(", "String", "pid", ",", "Dictionary", "properties", ")", "throws", "ConfigurationException", "{", "if", "(", "FrameworkState", ".", "isStopping", "(", ")", "||",...
{@inheritDoc}
[ "{" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channel.ssl/src/com/ibm/ws/channel/ssl/internal/SSLChannelProvider.java#L133-L162
train
Update the configuration of a single language specification.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void updated(String pid, Dictionary properties) throws ConfigurationException { if (FrameworkState.isStopping() || bContext == null) { return; } if (TraceComponent.isAnyT...
srikalyc/Sql4D
IndexerAgent/src/main/java/com/yahoo/sql4d/indexeragent/meta/DBHandler.java
DBHandler.markTask
public void markTask(StatusTrail st, boolean success) { st.setStatus(success ? JobStatus.done : JobStatus.not_done); st.setAttemptsDone(st.getAttemptsDone() + 1); st.setGivenUp(st.getAttemptsDone() >= getMaxTaskAttempts() ? 1 : 0); updateStatusTrail(st); }
java
public void markTask(StatusTrail st, boolean success) { st.setStatus(success ? JobStatus.done : JobStatus.not_done); st.setAttemptsDone(st.getAttemptsDone() + 1); st.setGivenUp(st.getAttemptsDone() >= getMaxTaskAttempts() ? 1 : 0); updateStatusTrail(st); }
[ "public", "void", "markTask", "(", "StatusTrail", "st", ",", "boolean", "success", ")", "{", "st", ".", "setStatus", "(", "success", "?", "JobStatus", ".", "done", ":", "JobStatus", ".", "not_done", ")", ";", "st", ".", "setAttemptsDone", "(", "st", ".",...
Change the status of a task. @param st @param success
[ "Change", "the", "status", "of", "a", "task", "." ]
2c052fe60ead5a16277c798a3440de7d4f6f24f6
https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/IndexerAgent/src/main/java/com/yahoo/sql4d/indexeragent/meta/DBHandler.java#L218-L223
train
Mark a status trail as done or not_done.
Of course, here is the Java code you requested: ```java public void markTask(StatusTrail st, boolean success) { st.setStatus(success ? JobStatus.done : JobStatus.not_done); st.setAttemptsDone(st.getAttemptsDone() + 1); st.setGivenUp(st.getAttemptsDone() >= getMaxTaskAttempts() ? 1 : 0);...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcMappedItem
@Override public EClass getIfcMappedItem() { if (ifcMappedItemEClass == null) { ifcMappedItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(355); } return ifcMappedItemEClass; }
java
@Override public EClass getIfcMappedItem() { if (ifcMappedItemEClass == null) { ifcMappedItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(355); } return ifcMappedItemEClass; }
[ "@", "Override", "public", "EClass", "getIfcMappedItem", "(", ")", "{", "if", "(", "ifcMappedItemEClass", "==", "null", ")", "{", "ifcMappedItemEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "Ifc4Packag...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L21590-L21597
train
Get the IfcMappedItemEClass for the ifcMappedItem.
Of course, here is the Java code you requested: ```java @Override public EClass getIfcMappedItem() { if (ifcMappedItemEClass == null) { ifcMappedItemEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(355); } return ifcMappedItemEClass; } ``` Hop...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/IfcProcessImpl.java
IfcProcessImpl.getIsPredecessorTo
@SuppressWarnings("unchecked") @Override public EList<IfcRelSequence> getIsPredecessorTo() { return (EList<IfcRelSequence>) eGet(Ifc4Package.Literals.IFC_PROCESS__IS_PREDECESSOR_TO, true); }
java
@SuppressWarnings("unchecked") @Override public EList<IfcRelSequence> getIsPredecessorTo() { return (EList<IfcRelSequence>) eGet(Ifc4Package.Literals.IFC_PROCESS__IS_PREDECESSOR_TO, true); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "EList", "<", "IfcRelSequence", ">", "getIsPredecessorTo", "(", ")", "{", "return", "(", "EList", "<", "IfcRelSequence", ">", ")", "eGet", "(", "Ifc4Package", ".", "Literals", ".", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/IfcProcessImpl.java#L165-L169
train
Gets the value of the IsPredecessorTo property.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public EList<IfcRelSequence> getIsPredecessorTo() { return (EList<IfcRelSequence>) eGet(Ifc4Package.Literals.IFC_PROCESS__IS_PREDECESSOR_TO, true); } ``` Hope this helps!
VoltDB/voltdb
third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java
DoubleHistogram.getCountBetweenValues
public double getCountBetweenValues(final double lowValue, final double highValue) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountBetweenValues( (long)(lowValue * doubleToIntegerValueConversionRatio), (long)(highValue * doubleToIntegerVa...
java
public double getCountBetweenValues(final double lowValue, final double highValue) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountBetweenValues( (long)(lowValue * doubleToIntegerValueConversionRatio), (long)(highValue * doubleToIntegerVa...
[ "public", "double", "getCountBetweenValues", "(", "final", "double", "lowValue", ",", "final", "double", "highValue", ")", "throws", "ArrayIndexOutOfBoundsException", "{", "return", "integerValuesHistogram", ".", "getCountBetweenValues", "(", "(", "long", ")", "(", "l...
Get the count of recorded values within a range of value levels (inclusive to within the histogram's resolution). @param lowValue The lower value bound on the range for which to provide the recorded count. Will be rounded down with {@link DoubleHistogram#lowestEquivalentValue lowestEquivalentValue}. @param highValue ...
[ "Get", "the", "count", "of", "recorded", "values", "within", "a", "range", "of", "value", "levels", "(", "inclusive", "to", "within", "the", "histogram", "s", "resolution", ")", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/HdrHistogram_voltpatches/DoubleHistogram.java#L1078-L1084
train
Gets the count between the two values.
Of course, here is the Java code you requested: ```java public double getCountBetweenValues(final double lowValue, final double highValue) throws ArrayIndexOutOfBoundsException { return integerValuesHistogram.getCountBetweenValues( (long)(lowValue * doubleToIntegerValueConversionRat...
kiegroup/jbpm
jbpm-flow/src/main/java/org/jbpm/process/core/impl/ProcessImpl.java
ProcessImpl.readObject
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.runtimeMetaData = new HashMap<String, Object>(); }
java
private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.runtimeMetaData = new HashMap<String, Object>(); }
[ "private", "void", "readObject", "(", "java", ".", "io", ".", "ObjectInputStream", "in", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "in", ".", "defaultReadObject", "(", ")", ";", "this", ".", "runtimeMetaData", "=", "new", "HashMap", "<"...
/* Special handling for serialization to initialize transient (runtime related) meta data
[ "/", "*", "Special", "handling", "for", "serialization", "to", "initialize", "transient", "(", "runtime", "related", ")", "meta", "data" ]
c3473c728aa382ebbea01e380c5e754a96647b82
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-flow/src/main/java/org/jbpm/process/core/impl/ProcessImpl.java#L219-L222
train
Read the object from an input stream.
Of course, here is the Java code you requested: ```java private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); this.runtimeMetaData = new HashMap<String, Object>(); } ``` Hope this helps!
lessthanoptimal/ejml
examples/src/org/ejml/example/PrincipalComponentAnalysis.java
PrincipalComponentAnalysis.addSample
public void addSample( double[] sampleData ) { if( A.getNumCols() != sampleData.length ) throw new IllegalArgumentException("Unexpected sample size"); if( sampleIndex >= A.getNumRows() ) throw new IllegalArgumentException("Too many samples"); for( int i = 0; i < sampleDa...
java
public void addSample( double[] sampleData ) { if( A.getNumCols() != sampleData.length ) throw new IllegalArgumentException("Unexpected sample size"); if( sampleIndex >= A.getNumRows() ) throw new IllegalArgumentException("Too many samples"); for( int i = 0; i < sampleDa...
[ "public", "void", "addSample", "(", "double", "[", "]", "sampleData", ")", "{", "if", "(", "A", ".", "getNumCols", "(", ")", "!=", "sampleData", ".", "length", ")", "throw", "new", "IllegalArgumentException", "(", "\"Unexpected sample size\"", ")", ";", "if"...
Adds a new sample of the raw data to internal data structure for later processing. All the samples must be added before computeBasis is called. @param sampleData Sample from original raw data.
[ "Adds", "a", "new", "sample", "of", "the", "raw", "data", "to", "internal", "data", "structure", "for", "later", "processing", ".", "All", "the", "samples", "must", "be", "added", "before", "computeBasis", "is", "called", "." ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PrincipalComponentAnalysis.java#L93-L103
train
Add a sample to the matrix.
Of course, here is the Java code you requested: ```java public void addSample( double[] sampleData ) { if( A.getNumCols() != sampleData.length ) throw new IllegalArgumentException("Unexpected sample size"); if( sampleIndex >= A.getNumRows() ) throw new IllegalArgumentException("...
mapsforge/mapsforge
mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidPaint.java
AndroidPaint.setBitmapShaderShift
@Override public void setBitmapShaderShift(Point origin) { Shader shader = this.paint.getShader(); if (shader != null) { int relativeDx = ((int) -origin.x) % this.shaderWidth; int relativeDy = ((int) -origin.y) % this.shaderHeight; Matrix localMatrix = new Matrix...
java
@Override public void setBitmapShaderShift(Point origin) { Shader shader = this.paint.getShader(); if (shader != null) { int relativeDx = ((int) -origin.x) % this.shaderWidth; int relativeDy = ((int) -origin.y) % this.shaderHeight; Matrix localMatrix = new Matrix...
[ "@", "Override", "public", "void", "setBitmapShaderShift", "(", "Point", "origin", ")", "{", "Shader", "shader", "=", "this", ".", "paint", ".", "getShader", "(", ")", ";", "if", "(", "shader", "!=", "null", ")", "{", "int", "relativeDx", "=", "(", "("...
Shifts the bitmap pattern so that it will always start at a multiple of itself for any tile the pattern is used. This ensures that regardless of size of the pattern it tiles correctly. @param origin the reference point
[ "Shifts", "the", "bitmap", "pattern", "so", "that", "it", "will", "always", "start", "at", "a", "multiple", "of", "itself", "for", "any", "tile", "the", "pattern", "is", "used", ".", "This", "ensures", "that", "regardless", "of", "size", "of", "the", "pa...
c49c83f7f727552f793dff15cefa532ade030842
https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-android/src/main/java/org/mapsforge/map/android/graphics/AndroidPaint.java#L201-L212
train
Set the bitmap shader shift.
Of course, here is the Java code you requested: ```java @Override public void setBitmapShaderShift(Point origin) { Shader shader = this.paint.getShader(); if (shader != null) { int relativeDx = ((int) -origin.x) % this.shaderWidth; int relativeDy = ((int) -origin.y) % this.s...
Azure/azure-sdk-for-java
appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java
DiagnosticsInner.listSiteAnalysesAsync
public ServiceFuture<List<AnalysisDefinitionInner>> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback<AnalysisDefinitionInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSiteAnalysesSingle...
java
public ServiceFuture<List<AnalysisDefinitionInner>> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback<AnalysisDefinitionInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSiteAnalysesSingle...
[ "public", "ServiceFuture", "<", "List", "<", "AnalysisDefinitionInner", ">", ">", "listSiteAnalysesAsync", "(", "final", "String", "resourceGroupName", ",", "final", "String", "siteName", ",", "final", "String", "diagnosticCategory", ",", "final", "ListOperationCallback...
Get Site Analyses. Get Site Analyses. @param resourceGroupName Name of the resource group to which the resource belongs. @param siteName Site Name @param diagnosticCategory Diagnostic Category @param serviceCallback the async ServiceCallback to handle successful and failed responses. @throws IllegalArgumentException t...
[ "Get", "Site", "Analyses", ".", "Get", "Site", "Analyses", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L418-L428
train
List all analyses for a given site.
Of course, here is the Java code you requested: ```java public ServiceFuture<List<AnalysisDefinitionInner>> listSiteAnalysesAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final ListOperationCallback<AnalysisDefinitionInner> serviceCallback) { return AzureServiceFu...
aws/aws-sdk-java
aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/model/RebootWorkspacesRequest.java
RebootWorkspacesRequest.getRebootWorkspaceRequests
public java.util.List<RebootRequest> getRebootWorkspaceRequests() { if (rebootWorkspaceRequests == null) { rebootWorkspaceRequests = new com.amazonaws.internal.SdkInternalList<RebootRequest>(); } return rebootWorkspaceRequests; }
java
public java.util.List<RebootRequest> getRebootWorkspaceRequests() { if (rebootWorkspaceRequests == null) { rebootWorkspaceRequests = new com.amazonaws.internal.SdkInternalList<RebootRequest>(); } return rebootWorkspaceRequests; }
[ "public", "java", ".", "util", ".", "List", "<", "RebootRequest", ">", "getRebootWorkspaceRequests", "(", ")", "{", "if", "(", "rebootWorkspaceRequests", "==", "null", ")", "{", "rebootWorkspaceRequests", "=", "new", "com", ".", "amazonaws", ".", "internal", "...
<p> The WorkSpaces to reboot. You can specify up to 25 WorkSpaces. </p> @return The WorkSpaces to reboot. You can specify up to 25 WorkSpaces.
[ "<p", ">", "The", "WorkSpaces", "to", "reboot", ".", "You", "can", "specify", "up", "to", "25", "WorkSpaces", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-workspaces/src/main/java/com/amazonaws/services/workspaces/model/RebootWorkspacesRequest.java#L43-L48
train
Gets the value of the rebootWorkspaceRequests property.
Of course, here is the Java code you requested: ```java public java.util.List<RebootRequest> getRebootWorkspaceRequests() { if (rebootWorkspaceRequests == null) { rebootWorkspaceRequests = new com.amazonaws.internal.SdkInternalList<RebootRequest>(); } return rebootWorkspaceRequests;...
wildfly/wildfly
microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MetricCollector.java
MetricCollector.collectResourceMetrics
public MetricRegistration collectResourceMetrics(final Resource resource, ImmutableManagementResourceRegistration managementResourceRegistration, Function<PathAddress, PathAddress> resourceAddressResolver) { MetricRegist...
java
public MetricRegistration collectResourceMetrics(final Resource resource, ImmutableManagementResourceRegistration managementResourceRegistration, Function<PathAddress, PathAddress> resourceAddressResolver) { MetricRegist...
[ "public", "MetricRegistration", "collectResourceMetrics", "(", "final", "Resource", "resource", ",", "ImmutableManagementResourceRegistration", "managementResourceRegistration", ",", "Function", "<", "PathAddress", ",", "PathAddress", ">", "resourceAddressResolver", ")", "{", ...
collect metrics from the resources
[ "collect", "metrics", "from", "the", "resources" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/microprofile/metrics-smallrye/src/main/java/org/wildfly/extension/microprofile/metrics/MetricCollector.java#L88-L94
test
Collect resource metrics.
Of course, here is the Java code you requested: ```java public MetricRegistration collectResourceMetrics(final Resource resource, ImmutableManagementResourceRegistration managementResourceRegistration, Function<PathAddress, Pat...
openbase/jul
extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/ProtoBufBuilderProcessor.java
ProtoBufBuilderProcessor.addDefaultInstanceToRepeatedField
public static Message.Builder addDefaultInstanceToRepeatedField(final int repeatedFieldNumber, final Message.Builder builder) throws CouldNotPerformException { return addDefaultInstanceToRepeatedField(builder.getDescriptorForType().findFieldByNumber(repeatedFieldNumber), builder); }
java
public static Message.Builder addDefaultInstanceToRepeatedField(final int repeatedFieldNumber, final Message.Builder builder) throws CouldNotPerformException { return addDefaultInstanceToRepeatedField(builder.getDescriptorForType().findFieldByNumber(repeatedFieldNumber), builder); }
[ "public", "static", "Message", ".", "Builder", "addDefaultInstanceToRepeatedField", "(", "final", "int", "repeatedFieldNumber", ",", "final", "Message", ".", "Builder", "builder", ")", "throws", "CouldNotPerformException", "{", "return", "addDefaultInstanceToRepeatedField",...
Method adds a new default message instance to the repeated field and return it's builder instance. @param repeatedFieldNumber The field number of the repeated field. @param builder The builder instance of the message which contains the repeated field. @return The builder instance of the new added message is returned. @...
[ "Method", "adds", "a", "new", "default", "message", "instance", "to", "the", "repeated", "field", "and", "return", "it", "s", "builder", "instance", "." ]
662e98c3a853085e475be54c3be3deb72193c72d
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/protobuf/src/main/java/org/openbase/jul/extension/protobuf/ProtoBufBuilderProcessor.java#L113-L115
train
This method is used to add a default instance to a repeated field.
Of course, here is the Java code you requested: ```java public static Message.Builder addDefaultInstanceToRepeatedField(final int repeatedFieldNumber, final Message.Builder builder) throws CouldNotPerformException { return addDefaultInstanceToRepeatedField(builder.getDescriptorForType().findFieldByNumber(repea...
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/db/util/ResourceTable.java
ResourceTable.syncRecords
public void syncRecords(Record recAlt, Record recMain) { boolean bFieldsInSync = true; // Copy the language-specific fields m_buffer = new VectorBuffer(null); for (int iIndex = 0; iIndex < recMain.getFieldCount(); iIndex++) { BaseField fieldAlt = recAlt.getField(i...
java
public void syncRecords(Record recAlt, Record recMain) { boolean bFieldsInSync = true; // Copy the language-specific fields m_buffer = new VectorBuffer(null); for (int iIndex = 0; iIndex < recMain.getFieldCount(); iIndex++) { BaseField fieldAlt = recAlt.getField(i...
[ "public", "void", "syncRecords", "(", "Record", "recAlt", ",", "Record", "recMain", ")", "{", "boolean", "bFieldsInSync", "=", "true", ";", "// Copy the language-specific fields", "m_buffer", "=", "new", "VectorBuffer", "(", "null", ")", ";", "for", "(", "int", ...
Save the record state and copy the localized fields from the language record to the main record. @param tblTarget The table to read the same record from. @param recSource Source record @return The target table's record.
[ "Save", "the", "record", "state", "and", "copy", "the", "localized", "fields", "from", "the", "language", "record", "to", "the", "main", "record", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/ResourceTable.java#L142-L169
train
Synchronize the records.
Of course, here is the Java code you requested: ```java public void syncRecords(Record recAlt, Record recMain) { boolean bFieldsInSync = true; // Copy the language-specific fields m_buffer = new VectorBuffer(null); for (int iIndex = 0; iIndex < recMain.getFieldCount(); iIndex++) ...
stratosphere/stratosphere
stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java
GlobalConfiguration.loadYAMLResource
private void loadYAMLResource(final File file) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); String line = null; while ((line = reader.readLine()) != null) { // 1. check for comments String[] comments = line.split("#", 2); ...
java
private void loadYAMLResource(final File file) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); String line = null; while ((line = reader.readLine()) != null) { // 1. check for comments String[] comments = line.split("#", 2); ...
[ "private", "void", "loadYAMLResource", "(", "final", "File", "file", ")", "{", "BufferedReader", "reader", "=", "null", ";", "try", "{", "reader", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "new", "FileInputStream", "(", "file", ")", ...
Loads a YAML-file of key-value pairs. <p> Colon and whitespace ": " separate key and value (one per line). The hash tag "#" starts a single-line comment. <p> Example: <pre> jobmanager.rpc.address: localhost # network address for communication with the job manager jobmanager.rpc.port : 6123 # network port to con...
[ "Loads", "a", "YAML", "-", "file", "of", "key", "-", "value", "pairs", ".", "<p", ">", "Colon", "and", "whitespace", ":", "separate", "key", "and", "value", "(", "one", "per", "line", ")", ".", "The", "hash", "tag", "#", "starts", "a", "single", "-...
c543a08f9676c5b2b0a7088123bd6e795a8ae0c8
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/GlobalConfiguration.java#L378-L424
train
Load the YAML file.
Of course, here is the Java code you requested: ```java private void loadYAMLResource(final File file) { BufferedReader reader = null; try { reader = new BufferedReader(new InputStreamReader(new FileInputStream(file))); String line = null; while ((line = reader.readLine()) != null) { // 1. check fo...
b3log/latke
latke-core/src/main/java/org/b3log/latke/util/URLs.java
URLs.decode
public static String decode(final String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (final Exception e) { LOGGER.log(Level.WARN, "Decodes str [" + str + "] failed", e); return str; } }
java
public static String decode(final String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (final Exception e) { LOGGER.log(Level.WARN, "Decodes str [" + str + "] failed", e); return str; } }
[ "public", "static", "String", "decode", "(", "final", "String", "str", ")", "{", "try", "{", "return", "URLDecoder", ".", "decode", "(", "str", ",", "\"UTF-8\"", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "LOGGER", ".", "log", ...
Decodes the specified string. @param str the specified string @return URL decoded string
[ "Decodes", "the", "specified", "string", "." ]
f7e08a47eeecea5f7c94006382c24f353585de33
https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/URLs.java#L60-L68
train
Decodes a string.
Of course, here is the Java code you requested: ```java public static String decode(final String str) { try { return URLDecoder.decode(str, "UTF-8"); } catch (final Exception e) { LOGGER.log(Level.WARN, "Decodes str [" + str + "] failed", e); return str; } ...
thymeleaf/thymeleaf
src/main/java/org/thymeleaf/templateresolver/AbstractConfigurableTemplateResolver.java
AbstractConfigurableTemplateResolver.addTemplateAlias
public final void addTemplateAlias(final String alias, final String templateName) { Validate.notNull(alias, "Alias cannot be null"); Validate.notNull(templateName, "Template name cannot be null"); this.templateAliases.put(alias, templateName); }
java
public final void addTemplateAlias(final String alias, final String templateName) { Validate.notNull(alias, "Alias cannot be null"); Validate.notNull(templateName, "Template name cannot be null"); this.templateAliases.put(alias, templateName); }
[ "public", "final", "void", "addTemplateAlias", "(", "final", "String", "alias", ",", "final", "String", "templateName", ")", "{", "Validate", ".", "notNull", "(", "alias", ",", "\"Alias cannot be null\"", ")", ";", "Validate", ".", "notNull", "(", "templateName"...
<p> Adds a new template alias to the currently configured ones. </p> @param alias the new alias name @param templateName the name of the template the alias will be applied to
[ "<p", ">", "Adds", "a", "new", "template", "alias", "to", "the", "currently", "configured", "ones", ".", "<", "/", "p", ">" ]
2b0e6d6d7571fbe638904b5fd222fc9e77188879
https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/templateresolver/AbstractConfigurableTemplateResolver.java#L497-L501
train
Add a template alias.
Of course, here is the Java code you requested: ```java public final void addTemplateAlias(final String alias, final String templateName) { Validate.notNull(alias, "Alias cannot be null"); Validate.notNull(templateName, "Template name cannot be null"); this.templateAliases.put(alias, templateNa...
igniterealtime/Smack
smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java
MultiUserChatLight.sendMessage
public void sendMessage(String text) throws NotConnectedException, InterruptedException { Message message = createMessage(); message.setBody(text); connection.sendStanza(message); }
java
public void sendMessage(String text) throws NotConnectedException, InterruptedException { Message message = createMessage(); message.setBody(text); connection.sendStanza(message); }
[ "public", "void", "sendMessage", "(", "String", "text", ")", "throws", "NotConnectedException", ",", "InterruptedException", "{", "Message", "message", "=", "createMessage", "(", ")", ";", "message", ".", "setBody", "(", "text", ")", ";", "connection", ".", "s...
Sends a message to the chat room. @param text the text of the message to send. @throws NotConnectedException @throws InterruptedException
[ "Sends", "a", "message", "to", "the", "chat", "room", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java#L128-L132
train
Send a message to the server.
Of course, here is the Java code you requested: ```java public void sendMessage(String text) throws NotConnectedException, InterruptedException { Message message = createMessage(); message.setBody(text); connection.sendStanza(message); } ``` Hope this helps!
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/DistributedAtomicValue.java
DistributedAtomicValue.forceSet
public void forceSet(byte[] newValue) throws Exception { try { client.setData().forPath(path, newValue); } catch ( KeeperException.NoNodeException dummy ) { try { client.create().creatingParentContainersIfNeeded().forPath(pa...
java
public void forceSet(byte[] newValue) throws Exception { try { client.setData().forPath(path, newValue); } catch ( KeeperException.NoNodeException dummy ) { try { client.create().creatingParentContainersIfNeeded().forPath(pa...
[ "public", "void", "forceSet", "(", "byte", "[", "]", "newValue", ")", "throws", "Exception", "{", "try", "{", "client", ".", "setData", "(", ")", ".", "forPath", "(", "path", ",", "newValue", ")", ";", "}", "catch", "(", "KeeperException", ".", "NoNode...
Forcibly sets the value any guarantees of atomicity. @param newValue the new value @throws Exception ZooKeeper errors
[ "Forcibly", "sets", "the", "value", "any", "guarantees", "of", "atomicity", "." ]
1948e088545553d2745b2c86d8b5a64988bb850e
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/atomic/DistributedAtomicValue.java#L99-L116
train
Force set of the data in the underlying node.
Of course, here is the Java code you requested: ```java public void forceSet(byte[] newValue) throws Exception { try { client.setData().forPath(path, newValue); } catch ( KeeperException.NoNodeException dummy ) { try { clie...
czyzby/gdx-lml
mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/controller/impl/AnnotatedViewDialogController.java
AnnotatedViewDialogController.prepareDialogInstance
public void prepareDialogInstance() { final LmlParser parser = interfaceService.getParser(); if (actionContainer != null) { parser.getData().addActionContainer(getId(), actionContainer); } dialog = (Window) parser.createView(wrappedObject, Gdx.files.internal(dialogData.value(...
java
public void prepareDialogInstance() { final LmlParser parser = interfaceService.getParser(); if (actionContainer != null) { parser.getData().addActionContainer(getId(), actionContainer); } dialog = (Window) parser.createView(wrappedObject, Gdx.files.internal(dialogData.value(...
[ "public", "void", "prepareDialogInstance", "(", ")", "{", "final", "LmlParser", "parser", "=", "interfaceService", ".", "getParser", "(", ")", ";", "if", "(", "actionContainer", "!=", "null", ")", "{", "parser", ".", "getData", "(", ")", ".", "addActionConta...
Creates instance of the managed dialog actor.
[ "Creates", "instance", "of", "the", "managed", "dialog", "actor", "." ]
7623b322e6afe49ad4dd636c80c230150a1cfa4e
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/mvc/src/main/java/com/github/czyzby/autumn/mvc/component/ui/controller/impl/AnnotatedViewDialogController.java#L84-L93
train
Prepare dialog instance.
Of course, here is the Java code you requested: ```java public void prepareDialogInstance() { final LmlParser parser = interfaceService.getParser(); if (actionContainer != null) { parser.getData().addActionContainer(getId(), actionContainer); } dialog = (Window) parser.creat...
PistoiaHELM/HELM2NotationToolkit
src/main/java/org/helm/notation2/tools/SMILES.java
SMILES.getCanonicalSMILESForPolymer
public static String getCanonicalSMILESForPolymer(PolymerNotation polymer) throws BuilderMoleculeException, HELM2HandledException, CTKSmilesException, CTKException, NotationException, ChemistryException { AbstractMolecule molecule = BuilderMolecule.buildMoleculefromSinglePolymer(polymer).getMolecule(); molecu...
java
public static String getCanonicalSMILESForPolymer(PolymerNotation polymer) throws BuilderMoleculeException, HELM2HandledException, CTKSmilesException, CTKException, NotationException, ChemistryException { AbstractMolecule molecule = BuilderMolecule.buildMoleculefromSinglePolymer(polymer).getMolecule(); molecu...
[ "public", "static", "String", "getCanonicalSMILESForPolymer", "(", "PolymerNotation", "polymer", ")", "throws", "BuilderMoleculeException", ",", "HELM2HandledException", ",", "CTKSmilesException", ",", "CTKException", ",", "NotationException", ",", "ChemistryException", "{", ...
method to generate canonical smiles for one single PolymerNotation @param polymer PolymerNotation @return smiles for the sinlge given PolymerNotation @throws BuilderMoleculeException if the molecule can't be built @throws HELM2HandledException if it contains HELM2 specific features, so that it can not be casted to HEL...
[ "method", "to", "generate", "canonical", "smiles", "for", "one", "single", "PolymerNotation" ]
ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38
https://github.com/PistoiaHELM/HELM2NotationToolkit/blob/ac5bb01fd5b4082134a8ef226bbe2ff0f60fcd38/src/main/java/org/helm/notation2/tools/SMILES.java#L194-L201
train
method to get the canonical smiles for a single polymer
Of course, here is the Java code you requested: ```java public static String getCanonicalSMILESForPolymer(PolymerNotation polymer) throws BuilderMoleculeException, HELM2HandledException, CTKSmilesException, CTKException, NotationException, ChemistryException { AbstractMolecule molecule = BuilderMolecule.buildMo...
hibernate/hibernate-ogm
core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java
BiDirectionalAssociationHelper.getMainSidePropertyName
public static String getMainSidePropertyName(OgmCollectionPersister collectionPersister) { if ( !collectionPersister.isInverse() ) { return collectionPersister.getUnqualifiedRole(); } Loadable mainSidePersister = (Loadable) collectionPersister.getElementPersister(); for ( int i = 0; i < mainSidePersister.g...
java
public static String getMainSidePropertyName(OgmCollectionPersister collectionPersister) { if ( !collectionPersister.isInverse() ) { return collectionPersister.getUnqualifiedRole(); } Loadable mainSidePersister = (Loadable) collectionPersister.getElementPersister(); for ( int i = 0; i < mainSidePersister.g...
[ "public", "static", "String", "getMainSidePropertyName", "(", "OgmCollectionPersister", "collectionPersister", ")", "{", "if", "(", "!", "collectionPersister", ".", "isInverse", "(", ")", ")", "{", "return", "collectionPersister", ".", "getUnqualifiedRole", "(", ")", ...
Returns the role on the main side of the given association. If the collection is on the main side itself (or if it is an uni-directional association), its own unqualified role will be returned. If the collection is on the inverse side of a one-to-many or many-to-many association, the corresponding property on the main ...
[ "Returns", "the", "role", "on", "the", "main", "side", "of", "the", "given", "association", ".", "If", "the", "collection", "is", "on", "the", "main", "side", "itself", "(", "or", "if", "it", "is", "an", "uni", "-", "directional", "association", ")", "...
9ea971df7c27277029006a6f748d8272fb1d69d2
https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/persister/impl/BiDirectionalAssociationHelper.java#L128-L155
train
Gets the main side property name.
Of course, here is the Java code you requested: ```java public static String getMainSidePropertyName(OgmCollectionPersister collectionPersister) { if ( !collectionPersister.isInverse() ) { return collectionPersister.getUnqualifiedRole(); } Loadable mainSidePersister = (Loadable) collectionPersister.getElemen...
nostra13/Android-Universal-Image-Loader
library/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java
LruMemoryCache.put
@Override public final boolean put(String key, Bitmap value) { if (key == null || value == null) { throw new NullPointerException("key == null || value == null"); } synchronized (this) { size += sizeOf(key, value); Bitmap previous = map.put(key, value); if (previous != null) { size -= sizeOf(key...
java
@Override public final boolean put(String key, Bitmap value) { if (key == null || value == null) { throw new NullPointerException("key == null || value == null"); } synchronized (this) { size += sizeOf(key, value); Bitmap previous = map.put(key, value); if (previous != null) { size -= sizeOf(key...
[ "@", "Override", "public", "final", "boolean", "put", "(", "String", "key", ",", "Bitmap", "value", ")", "{", "if", "(", "key", "==", "null", "||", "value", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"key == null || value == null\...
Caches {@code Bitmap} for {@code key}. The Bitmap is moved to the head of the queue.
[ "Caches", "{" ]
fc3c5f6779bb4f702e233653b61bd9d559e345cc
https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java#L55-L71
train
Override this method to add a bitmap to the map.
Of course, here is the Java code you requested: ```java @Override public final boolean put(String key, Bitmap value) { if (key == null || value == null) { throw new NullPointerException("key == null || value == null"); } synchronized (this) { size += sizeOf(key, value); Bitmap previous = map.put(key, ...
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/conductor/ConductorActor.java
ConductorActor.onInitialDataDownloaded
public void onInitialDataDownloaded() { Log.d(TAG, "Initial Data Loaded"); context().getContactsModule().startImport(); if (appStateVM.isBookImported()) { onAppLoaded(); } }
java
public void onInitialDataDownloaded() { Log.d(TAG, "Initial Data Loaded"); context().getContactsModule().startImport(); if (appStateVM.isBookImported()) { onAppLoaded(); } }
[ "public", "void", "onInitialDataDownloaded", "(", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Initial Data Loaded\"", ")", ";", "context", "(", ")", ".", "getContactsModule", "(", ")", ".", "startImport", "(", ")", ";", "if", "(", "appStateVM", ".", "...
Called after dialogs, contacts and settings are downloaded from server
[ "Called", "after", "dialogs", "contacts", "and", "settings", "are", "downloaded", "from", "server" ]
5123c1584757c6eeea0ed2a0e7e043629871a0c6
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/modules/conductor/ConductorActor.java#L96-L102
train
Called when the initial data has been downloaded.
Of course, here is the Java code you requested: ```java public void onInitialDataDownloaded() { Log.d(TAG, "Initial Data Loaded"); context().getContactsModule().startImport(); if (appStateVM.isBookImported()) { onAppLoaded(); } } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Flowable.java
Flowable.filter
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> filter(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is null"); return RxJavaPlugins.onAssembly(new Flowa...
java
@CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> filter(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is null"); return RxJavaPlugins.onAssembly(new Flowa...
[ "@", "CheckReturnValue", "@", "NonNull", "@", "BackpressureSupport", "(", "BackpressureKind", ".", "PASS_THROUGH", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Flowable", "<", "T", ">", "filter", "(", "Predicate", ...
Filters items emitted by a Publisher by only emitting those that satisfy a specified predicate. <p> <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/filter.png" alt=""> <dl> <dt><b>Backpressure:</b></dt> <dd>The operator doesn't interfere with backpressure which is det...
[ "Filters", "items", "emitted", "by", "a", "Publisher", "by", "only", "emitting", "those", "that", "satisfy", "a", "specified", "predicate", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "310", "src", "=", "https", ":", "//", "raw", ".", "...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L9501-L9508
test
Returns a sequence of items that match the specified predicate.
Of course, here is the Java code you requested: ```java @CheckReturnValue @NonNull @BackpressureSupport(BackpressureKind.PASS_THROUGH) @SchedulerSupport(SchedulerSupport.NONE) public final Flowable<T> filter(Predicate<? super T> predicate) { ObjectHelper.requireNonNull(predicate, "predicate is ...
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java
DiscreteDistributions.hypergeometric
public static double hypergeometric(int k, int n, int Kp, int Np) { if(k<0 || n<0 || Kp<0 || Np<0) { throw new IllegalArgumentException("All the parameters must be positive."); } Kp = Math.max(k, Kp); Np = Math.max(n, Np); /* //slow! $probabil...
java
public static double hypergeometric(int k, int n, int Kp, int Np) { if(k<0 || n<0 || Kp<0 || Np<0) { throw new IllegalArgumentException("All the parameters must be positive."); } Kp = Math.max(k, Kp); Np = Math.max(n, Np); /* //slow! $probabil...
[ "public", "static", "double", "hypergeometric", "(", "int", "k", ",", "int", "n", ",", "int", "Kp", ",", "int", "Np", ")", "{", "if", "(", "k", "<", "0", "||", "n", "<", "0", "||", "Kp", "<", "0", "||", "Np", "<", "0", ")", "{", "throw", "n...
Returns the probability of finding k successes on a sample of n, from a population with Kp successes and size Np @param k @param n @param Kp @param Np @return
[ "Returns", "the", "probability", "of", "finding", "k", "successes", "on", "a", "sample", "of", "n", "from", "a", "population", "with", "Kp", "successes", "and", "size", "Np" ]
909dff0476e80834f05ecdde0624dd2390e9b0ca
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L268-L289
train
Returns the probability of hypergeometric k - > n
Of course, here is the Java code you requested: ```java public static double hypergeometric(int k, int n, int Kp, int Np) { if(k<0 || n<0 || Kp<0 || Np<0) { throw new IllegalArgumentException("All the parameters must be positive."); } Kp = Math.max(k, Kp); Np = Math.max(n, N...
Unidata/thredds
legacy/src/main/java/ucar/nc2/dt/point/StationObsDatasetInfo.java
StationObsDatasetInfo.main
public static void main(String args[]) throws IOException { String url = "C:/data/metars/Surface_METAR_20060326_0000.nc"; StationObsDataset ncd = (StationObsDataset) TypedDatasetFactory.open(FeatureType.STATION, url, null, new StringBuilder()); StationObsDatasetInfo info = new StationObsDatasetInfo(ncd, nu...
java
public static void main(String args[]) throws IOException { String url = "C:/data/metars/Surface_METAR_20060326_0000.nc"; StationObsDataset ncd = (StationObsDataset) TypedDatasetFactory.open(FeatureType.STATION, url, null, new StringBuilder()); StationObsDatasetInfo info = new StationObsDatasetInfo(ncd, nu...
[ "public", "static", "void", "main", "(", "String", "args", "[", "]", ")", "throws", "IOException", "{", "String", "url", "=", "\"C:/data/metars/Surface_METAR_20060326_0000.nc\"", ";", "StationObsDataset", "ncd", "=", "(", "StationObsDataset", ")", "TypedDatasetFactory...
debug
[ "debug" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/dt/point/StationObsDatasetInfo.java#L296-L310
test
This is the main method of the class.
Of course, here is the Java code you requested: ```java public static void main(String args[]) throws IOException { String url = "C:/data/metars/Surface_METAR_20060326_0000.nc"; StationObsDataset ncd = (StationObsDataset) TypedDatasetFactory.open(FeatureType.STATION, url, null, new StringBuilder()); Stati...
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/StartInstancesResult.java
StartInstancesResult.withStartingInstances
public StartInstancesResult withStartingInstances(InstanceStateChange... startingInstances) { if (this.startingInstances == null) { setStartingInstances(new com.amazonaws.internal.SdkInternalList<InstanceStateChange>(startingInstances.length)); } for (InstanceStateChange ele : starti...
java
public StartInstancesResult withStartingInstances(InstanceStateChange... startingInstances) { if (this.startingInstances == null) { setStartingInstances(new com.amazonaws.internal.SdkInternalList<InstanceStateChange>(startingInstances.length)); } for (InstanceStateChange ele : starti...
[ "public", "StartInstancesResult", "withStartingInstances", "(", "InstanceStateChange", "...", "startingInstances", ")", "{", "if", "(", "this", ".", "startingInstances", "==", "null", ")", "{", "setStartingInstances", "(", "new", "com", ".", "amazonaws", ".", "inter...
<p> Information about the started instances. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setStartingInstances(java.util.Collection)} or {@link #withStartingInstances(java.util.Collection)} if you want to override the existing values. </p> @param startingInstances Inf...
[ "<p", ">", "Information", "about", "the", "started", "instances", ".", "<", "/", "p", ">", "<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-ec2/src/main/java/com/amazonaws/services/ec2/model/StartInstancesResult.java#L81-L89
train
Adds the following instances to the startingInstances property.
Of course, here is the Java code you requested: ```java public StartInstancesResult withStartingInstances(InstanceStateChange... startingInstances) { if (this.startingInstances == null) { setStartingInstances(new com.amazonaws.internal.SdkInternalList<InstanceStateChange>(startingInstances.length))...
yanzhenjie/Album
album/src/main/java/com/yanzhenjie/album/util/SystemBar.java
SystemBar.setNavigationBarColor
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static void setNavigationBarColor(Window window, int navigationBarColor) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setNavigationBarColor(navigationBarColor); }
java
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static void setNavigationBarColor(Window window, int navigationBarColor) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setNavigationBarColor(navigationBarColor); }
[ "@", "RequiresApi", "(", "api", "=", "Build", ".", "VERSION_CODES", ".", "LOLLIPOP", ")", "public", "static", "void", "setNavigationBarColor", "(", "Window", "window", ",", "int", "navigationBarColor", ")", "{", "window", ".", "addFlags", "(", "WindowManager", ...
Set the navigation bar color.
[ "Set", "the", "navigation", "bar", "color", "." ]
b17506440d32909d42aba41f6a388041a25c8363
https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/SystemBar.java#L60-L64
train
Set the navigation bar color.
Of course, here is the Java code you requested: ```java @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public static void setNavigationBarColor(Window window, int navigationBarColor) { window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.setNavigationBarColor(navi...
BlueBrain/bluima
modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Annotation.java
Annotation.getComponentId
public String getComponentId() { if (Annotation_Type.featOkTst && ((Annotation_Type)jcasType).casFeat_componentId == null) jcasType.jcas.throwFeatMissing("componentId", "de.julielab.jules.types.Annotation"); return jcasType.ll_cas.ll_getStringValue(addr, ((Annotation_Type)jcasType).casFeatCode_componentId...
java
public String getComponentId() { if (Annotation_Type.featOkTst && ((Annotation_Type)jcasType).casFeat_componentId == null) jcasType.jcas.throwFeatMissing("componentId", "de.julielab.jules.types.Annotation"); return jcasType.ll_cas.ll_getStringValue(addr, ((Annotation_Type)jcasType).casFeatCode_componentId...
[ "public", "String", "getComponentId", "(", ")", "{", "if", "(", "Annotation_Type", ".", "featOkTst", "&&", "(", "(", "Annotation_Type", ")", "jcasType", ")", ".", "casFeat_componentId", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", "(", ...
getter for componentId - gets Indicates which NLP component has been used to derive the annotation, C @generated @return value of the feature
[ "getter", "for", "componentId", "-", "gets", "Indicates", "which", "NLP", "component", "has", "been", "used", "to", "derive", "the", "annotation", "C" ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/Annotation.java#L107-L110
train
getter for componentId - gets
Of course, here is the Java code you requested: ```java public String getComponentId() { if (Annotation_Type.featOkTst && ((Annotation_Type)jcasType).casFeat_componentId == null) jcasType.jcas.throwFeatMissing("componentId", "de.julielab.jules.types.Annotation"); return jcasType.ll_cas.ll_getStringValue(...
apache/groovy
src/main/groovy/groovy/lang/Tuple.java
Tuple.tuple
public static <T1, T2, T3> Tuple3<T1, T2, T3> tuple(T1 v1, T2 v2, T3 v3) { return new Tuple3<>(v1, v2, v3); }
java
public static <T1, T2, T3> Tuple3<T1, T2, T3> tuple(T1 v1, T2 v2, T3 v3) { return new Tuple3<>(v1, v2, v3); }
[ "public", "static", "<", "T1", ",", "T2", ",", "T3", ">", "Tuple3", "<", "T1", ",", "T2", ",", "T3", ">", "tuple", "(", "T1", "v1", ",", "T2", "v2", ",", "T3", "v3", ")", "{", "return", "new", "Tuple3", "<>", "(", "v1", ",", "v2", ",", "v3"...
Construct a tuple of degree 3.
[ "Construct", "a", "tuple", "of", "degree", "3", "." ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/Tuple.java#L145-L147
train
Gets a tuple of degree 3.
Of course, here is the Java code you requested: ```java public static <T1, T2, T3> Tuple3<T1, T2, T3> tuple(T1 v1, T2 v2, T3 v3) { return new Tuple3<>(v1, v2, v3); } ``` Hope this helps!
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java
ByteArrayUtil.readUnsignedVarint
public static int readUnsignedVarint(ByteBuffer buffer) throws IOException { int val = 0; int bits = 0; while(true) { final int data = buffer.get(); val |= (data & 0x7F) << bits; if((data & 0x80) == 0) { return val; } bits += 7; if(bits > 35) { throw new I...
java
public static int readUnsignedVarint(ByteBuffer buffer) throws IOException { int val = 0; int bits = 0; while(true) { final int data = buffer.get(); val |= (data & 0x7F) << bits; if((data & 0x80) == 0) { return val; } bits += 7; if(bits > 35) { throw new I...
[ "public", "static", "int", "readUnsignedVarint", "(", "ByteBuffer", "buffer", ")", "throws", "IOException", "{", "int", "val", "=", "0", ";", "int", "bits", "=", "0", ";", "while", "(", "true", ")", "{", "final", "int", "data", "=", "buffer", ".", "get...
Read an unsigned integer. @param buffer Buffer to read from @return Integer value
[ "Read", "an", "unsigned", "integer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L775-L789
train
Read an unsigned integer from the buffer.
Of course, here is the Java code you requested: ```java public static int readUnsignedVarint(ByteBuffer buffer) throws IOException { int val = 0; int bits = 0; while(true) { final int data = buffer.get(); val |= (data & 0x7F) << bits; if((data & 0x80) == 0) { return val; } ...
googleapis/google-cloud-java
google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java
TargetTcpProxyClient.getTargetTcpProxy
@BetaApi public final TargetTcpProxy getTargetTcpProxy(ProjectGlobalTargetTcpProxyName targetTcpProxy) { GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder() .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) .build(); ret...
java
@BetaApi public final TargetTcpProxy getTargetTcpProxy(ProjectGlobalTargetTcpProxyName targetTcpProxy) { GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder() .setTargetTcpProxy(targetTcpProxy == null ? null : targetTcpProxy.toString()) .build(); ret...
[ "@", "BetaApi", "public", "final", "TargetTcpProxy", "getTargetTcpProxy", "(", "ProjectGlobalTargetTcpProxyName", "targetTcpProxy", ")", "{", "GetTargetTcpProxyHttpRequest", "request", "=", "GetTargetTcpProxyHttpRequest", ".", "newBuilder", "(", ")", ".", "setTargetTcpProxy",...
Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. <p>Sample code: <pre><code> try (TargetTcpProxyClient targetTcpProxyClient = TargetTcpProxyClient.create()) { ProjectGlobalTargetTcpProxyName targetTcpProxy = ProjectGlobalTargetTcpProxyName.of("[PRO...
[ "Returns", "the", "specified", "TargetTcpProxy", "resource", ".", "Gets", "a", "list", "of", "available", "target", "TCP", "proxies", "by", "making", "a", "list", "()", "request", "." ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/TargetTcpProxyClient.java#L271-L279
train
Gets the TargetTcpProxy resource that supports the TargetTcpProxy REST API.
Of course, here is the Java code you requested: ```java @BetaApi public final TargetTcpProxy getTargetTcpProxy(ProjectGlobalTargetTcpProxyName targetTcpProxy) { GetTargetTcpProxyHttpRequest request = GetTargetTcpProxyHttpRequest.newBuilder() .setTargetTcpProxy(targetTcpProxy == null ? null :...
lucee/Lucee
core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java
CFMLTransformer.identifier
public static String identifier(SourceCode cfml, boolean throwError, boolean allowColon) throws TemplateException { int start = cfml.getPos(); if (!cfml.isCurrentBetween('a', 'z') && !cfml.isCurrent('_')) { if (throwError) throw new TemplateException(cfml, "Invalid Identifier, the following character cannot be ...
java
public static String identifier(SourceCode cfml, boolean throwError, boolean allowColon) throws TemplateException { int start = cfml.getPos(); if (!cfml.isCurrentBetween('a', 'z') && !cfml.isCurrent('_')) { if (throwError) throw new TemplateException(cfml, "Invalid Identifier, the following character cannot be ...
[ "public", "static", "String", "identifier", "(", "SourceCode", "cfml", ",", "boolean", "throwError", ",", "boolean", "allowColon", ")", "throws", "TemplateException", "{", "int", "start", "=", "cfml", ".", "getPos", "(", ")", ";", "if", "(", "!", "cfml", "...
Liest einen Identifier ein und gibt diesen als String zurueck. <br /> EBNF:<br /> <code>(letter | "_") {letter | "_"|digit};</code> @param throwError throw error or return null if name is invalid @return Identifier String. @throws TemplateException
[ "Liest", "einen", "Identifier", "ein", "und", "gibt", "diesen", "als", "String", "zurueck", ".", "<br", "/", ">", "EBNF", ":", "<br", "/", ">", "<code", ">", "(", "letter", "|", "_", ")", "{", "letter", "|", "_", "|digit", "}", ";", "<", "/", "co...
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/tag/CFMLTransformer.java#L1249-L1264
train
Returns the next identifier in the source code.
Of course, here is the Java code you requested: ```java public static String identifier(SourceCode cfml, boolean throwError, boolean allowColon) throws TemplateException { int start = cfml.getPos(); if (!cfml.isCurrentBetween('a', 'z') && !cfml.isCurrent('_')) { if (throwError) throw new TemplateException(cfml...
BorderTech/wcomponents
wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenuItem.java
WMenuItem.setAction
public void setAction(final Action action) { MenuItemModel model = getOrCreateComponentModel(); model.action = action; model.url = null; }
java
public void setAction(final Action action) { MenuItemModel model = getOrCreateComponentModel(); model.action = action; model.url = null; }
[ "public", "void", "setAction", "(", "final", "Action", "action", ")", "{", "MenuItemModel", "model", "=", "getOrCreateComponentModel", "(", ")", ";", "model", ".", "action", "=", "action", ";", "model", ".", "url", "=", "null", ";", "}" ]
Sets the action to execute when the menu item is invoked. @param action the menu item's action.
[ "Sets", "the", "action", "to", "execute", "when", "the", "menu", "item", "is", "invoked", "." ]
d1a2b2243270067db030feb36ca74255aaa94436
https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WMenuItem.java#L138-L142
train
Sets the action.
Of course, here is the Java code you requested: ```java public void setAction(final Action action) { MenuItemModel model = getOrCreateComponentModel(); model.action = action; model.url = null; } ``` Hope this helps!
CenturyLinkCloud/mdw
mdw-workflow/assets/com/centurylink/mdw/microservice/MicroserviceRestAdapter.java
MicroserviceRestAdapter.logResponse
@Override protected Long logResponse(Response response) { Long responseId = super.logResponse(response); int code = response.getStatusCode() == null ? 0 : response.getStatusCode(); String message = response.getStatusMessage() == null ? StatusResponse.forCode(code).getStatus().getMessage() : ...
java
@Override protected Long logResponse(Response response) { Long responseId = super.logResponse(response); int code = response.getStatusCode() == null ? 0 : response.getStatusCode(); String message = response.getStatusMessage() == null ? StatusResponse.forCode(code).getStatus().getMessage() : ...
[ "@", "Override", "protected", "Long", "logResponse", "(", "Response", "response", ")", "{", "Long", "responseId", "=", "super", ".", "logResponse", "(", "response", ")", ";", "int", "code", "=", "response", ".", "getStatusCode", "(", ")", "==", "null", "?"...
Populates serviceSummary @return responseId
[ "Populates", "serviceSummary" ]
91167fe65a25a5d7022cdcf8b0fae8506f5b87ce
https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-workflow/assets/com/centurylink/mdw/microservice/MicroserviceRestAdapter.java#L57-L71
train
Log a response.
Of course, here is the Java code you requested: ```java @Override protected Long logResponse(Response response) { Long responseId = super.logResponse(response); int code = response.getStatusCode() == null ? 0 : response.getStatusCode(); String message = response.getStatusMessage() == null ?...
jspringbot/jspringbot
src/main/java/org/jspringbot/spring/KeywordUtils.java
KeywordUtils.getDescription
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } String desc = keywordInfo.description(); if(de...
java
public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } String desc = keywordInfo.description(); if(de...
[ "public", "static", "String", "getDescription", "(", "String", "keyword", ",", "ApplicationContext", "context", ",", "Map", "<", "String", ",", "String", ">", "beanMap", ")", "{", "KeywordInfo", "keywordInfo", "=", "getKeywordInfo", "(", "keyword", ",", "context...
Retrieves the given keyword's description. @param keyword keyword name @param context Spring application context @param beanMap keyword name to bean name mapping @return the documentation string of the given keyword, or empty string if unavailable.
[ "Retrieves", "the", "given", "keyword", "s", "description", "." ]
03285a7013492fb793cb0c38a4625a5f5c5750e0
https://github.com/jspringbot/jspringbot/blob/03285a7013492fb793cb0c38a4625a5f5c5750e0/src/main/java/org/jspringbot/spring/KeywordUtils.java#L90-L111
train
Get the description of a class.
Of course, here is the Java code you requested: ```java public static String getDescription(String keyword, ApplicationContext context, Map<String, String> beanMap) { KeywordInfo keywordInfo = getKeywordInfo(keyword, context, beanMap); if(keywordInfo == null) { return ""; } ...
alibaba/canal
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java
MysqlConnection.loadBinlogChecksum
private void loadBinlogChecksum() { ResultSetPacket rs = null; try { rs = query("select @@global.binlog_checksum"); List<String> columnValues = rs.getFieldValues(); if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0).toUpperCase().equals("CRC32...
java
private void loadBinlogChecksum() { ResultSetPacket rs = null; try { rs = query("select @@global.binlog_checksum"); List<String> columnValues = rs.getFieldValues(); if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0).toUpperCase().equals("CRC32...
[ "private", "void", "loadBinlogChecksum", "(", ")", "{", "ResultSetPacket", "rs", "=", "null", ";", "try", "{", "rs", "=", "query", "(", "\"select @@global.binlog_checksum\"", ")", ";", "List", "<", "String", ">", "columnValues", "=", "rs", ".", "getFieldValues...
获取主库checksum信息 <pre> mariadb区别于mysql会在binlog的第一个事件Rotate_Event里也会采用checksum逻辑,而mysql是在第二个binlog事件之后才感知是否需要处理checksum 导致maraidb只要是开启checksum就会出现binlog文件名解析乱码 fixed issue : https://github.com/alibaba/canal/issues/1081 </pre>
[ "获取主库checksum信息" ]
8f088cddc0755f4350c5aaae95c6e4002d90a40f
https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java#L519-L533
train
Load the binlog checksum
Of course, here is the Java code you requested: ```java private void loadBinlogChecksum() { ResultSetPacket rs = null; try { rs = query("select @@global.binlog_checksum"); List<String> columnValues = rs.getFieldValues(); if (columnValues != null && columnValues.size(...
Sciss/abc4j
abc/src/main/java/abc/ui/swing/ScoreTemplate.java
ScoreTemplate.setTextSize
public void setTextSize(byte field, float size, SizeUnit unit) { FieldInfos fi = getFieldInfos(field); fi.m_fontSize = size; fi.m_fontSizeUnit = unit; notifyListeners(); }
java
public void setTextSize(byte field, float size, SizeUnit unit) { FieldInfos fi = getFieldInfos(field); fi.m_fontSize = size; fi.m_fontSizeUnit = unit; notifyListeners(); }
[ "public", "void", "setTextSize", "(", "byte", "field", ",", "float", "size", ",", "SizeUnit", "unit", ")", "{", "FieldInfos", "fi", "=", "getFieldInfos", "(", "field", ")", ";", "fi", ".", "m_fontSize", "=", "size", ";", "fi", ".", "m_fontSizeUnit", "=",...
Sets the font size of a field @param field one of {@link ScoreElements} constants @param size text size in percent of {@link #getDefaultTextSize()} if {@link #getTextSize(byte)} is {@link SizeUnit#PERCENT}, else in pt @param unit {@link SizeUnit#PERCENT} or {@link SizeUnit#PT}
[ "Sets", "the", "font", "size", "of", "a", "field" ]
117b405642c84a7bfca4e3e13668838258b90ca7
https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/ScoreTemplate.java#L932-L937
train
Sets the font size of a field.
Of course, here is the Java code you requested: ```java public void setTextSize(byte field, float size, SizeUnit unit) { FieldInfos fi = getFieldInfos(field); fi.m_fontSize = size; fi.m_fontSizeUnit = unit; notifyListeners(); } ``` Hope this helps!
Carbonado/Carbonado
src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java
UpgradableLock.tryLockForUpgrade_
private final Result tryLockForUpgrade_(L locker, long timeout, TimeUnit unit) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } Result result; if ((result = tryLockForUpgrade_(locker)) == Result.FAILED) { ...
java
private final Result tryLockForUpgrade_(L locker, long timeout, TimeUnit unit) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } Result result; if ((result = tryLockForUpgrade_(locker)) == Result.FAILED) { ...
[ "private", "final", "Result", "tryLockForUpgrade_", "(", "L", "locker", ",", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", "{", "if", "(", "Thread", ".", "interrupted", "(", ")", ")", "{", "throw", "new", "InterruptedExcept...
Attempt to acquire an upgrade lock, waiting a maximum amount of time. @param locker object trying to become lock owner @return FAILED, ACQUIRED or OWNED
[ "Attempt", "to", "acquire", "an", "upgrade", "lock", "waiting", "a", "maximum", "amount", "of", "time", "." ]
eee29b365a61c8f03e1a1dc6bed0692e6b04b1db
https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/repo/map/UpgradableLock.java#L337-L349
train
Tries to acquire a lock for an upgrade.
Of course, here is the Java code you requested: ```java private final Result tryLockForUpgrade_(L locker, long timeout, TimeUnit unit) throws InterruptedException { if (Thread.interrupted()) { throw new InterruptedException(); } Result result; if ((result ...
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.doStart
protected void doStart() throws Exception { if (isStarted()) return; // save context classloader Thread thread= Thread.currentThread(); ClassLoader lastContextLoader= thread.getContextClassLoader(); MultiException mex= null; try { // ...
java
protected void doStart() throws Exception { if (isStarted()) return; // save context classloader Thread thread= Thread.currentThread(); ClassLoader lastContextLoader= thread.getContextClassLoader(); MultiException mex= null; try { // ...
[ "protected", "void", "doStart", "(", ")", "throws", "Exception", "{", "if", "(", "isStarted", "(", ")", ")", "return", ";", "// save context classloader", "Thread", "thread", "=", "Thread", ".", "currentThread", "(", ")", ";", "ClassLoader", "lastContextLoader",...
Start the Web Application. @exception IOException
[ "Start", "the", "Web", "Application", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L425-L520
train
Override doStart to start the exception handling.
Of course, here is the Java code you requested: ```java protected void doStart() throws Exception { if (isStarted()) return; // save context classloader Thread thread= Thread.currentThread(); ClassLoader lastContextLoader= thread.getContextClassLoader(); MultiE...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar31/SessionBeanTypeImpl.java
SessionBeanTypeImpl.getAllPostConstruct
public List<LifecycleCallbackType<SessionBeanType<T>>> getAllPostConstruct() { List<LifecycleCallbackType<SessionBeanType<T>>> list = new ArrayList<LifecycleCallbackType<SessionBeanType<T>>>(); List<Node> nodeList = childNode.get("post-construct"); for(Node node: nodeList) { Lifecycl...
java
public List<LifecycleCallbackType<SessionBeanType<T>>> getAllPostConstruct() { List<LifecycleCallbackType<SessionBeanType<T>>> list = new ArrayList<LifecycleCallbackType<SessionBeanType<T>>>(); List<Node> nodeList = childNode.get("post-construct"); for(Node node: nodeList) { Lifecycl...
[ "public", "List", "<", "LifecycleCallbackType", "<", "SessionBeanType", "<", "T", ">", ">", ">", "getAllPostConstruct", "(", ")", "{", "List", "<", "LifecycleCallbackType", "<", "SessionBeanType", "<", "T", ">>>", "list", "=", "new", "ArrayList", "<", "Lifecyc...
Returns all <code>post-construct</code> elements @return list of <code>post-construct</code>
[ "Returns", "all", "<code", ">", "post", "-", "construct<", "/", "code", ">", "elements" ]
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar31/SessionBeanTypeImpl.java#L710-L720
train
Get all post - construct lifecycle callback types
Of course, here is the Java code you requested: ```java public List<LifecycleCallbackType<SessionBeanType<T>>> getAllPostConstruct() { List<LifecycleCallbackType<SessionBeanType<T>>> list = new ArrayList<LifecycleCallbackType<SessionBeanType<T>>>(); List<Node> nodeList = childNode.get("post-construct");...
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuMemsetD16Async
public static int cuMemsetD16Async(CUdeviceptr dstDevice, short us, long N, CUstream hStream) { return checkResult(cuMemsetD16AsyncNative(dstDevice, us, N, hStream)); }
java
public static int cuMemsetD16Async(CUdeviceptr dstDevice, short us, long N, CUstream hStream) { return checkResult(cuMemsetD16AsyncNative(dstDevice, us, N, hStream)); }
[ "public", "static", "int", "cuMemsetD16Async", "(", "CUdeviceptr", "dstDevice", ",", "short", "us", ",", "long", "N", ",", "CUstream", "hStream", ")", "{", "return", "checkResult", "(", "cuMemsetD16AsyncNative", "(", "dstDevice", ",", "us", ",", "N", ",", "h...
Sets device memory. <pre> CUresult cuMemsetD16Async ( CUdeviceptr dstDevice, unsigned short us, size_t N, CUstream hStream ) </pre> <div> <p>Sets device memory. Sets the memory range of <tt>N</tt> 16-bit values to the specified value <tt>us</tt>. The <tt>dstDevice</tt> pointer must be two byte aligned. </p> <p>cuMems...
[ "Sets", "device", "memory", "." ]
468528b5b9b37dfceb6ed83fcfd889e9b359f984
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L7640-L7643
train
Copies memory from CUDA to a device address using async memory set command.
Of course, here is the Java code you requested: ```java public static int cuMemsetD16Async(CUdeviceptr dstDevice, short us, long N, CUstream hStream) { return checkResult(cuMemsetD16AsyncNative(dstDevice, us, N, hStream)); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/TypedLinkSpecifier.java
TypedLinkSpecifier.setIdentityAttributeValues
public void setIdentityAttributeValues(java.util.Collection<AttributeNameAndValue> identityAttributeValues) { if (identityAttributeValues == null) { this.identityAttributeValues = null; return; } this.identityAttributeValues = new java.util.ArrayList<AttributeNameAndValu...
java
public void setIdentityAttributeValues(java.util.Collection<AttributeNameAndValue> identityAttributeValues) { if (identityAttributeValues == null) { this.identityAttributeValues = null; return; } this.identityAttributeValues = new java.util.ArrayList<AttributeNameAndValu...
[ "public", "void", "setIdentityAttributeValues", "(", "java", ".", "util", ".", "Collection", "<", "AttributeNameAndValue", ">", "identityAttributeValues", ")", "{", "if", "(", "identityAttributeValues", "==", "null", ")", "{", "this", ".", "identityAttributeValues", ...
<p> Identifies the attribute value to update. </p> @param identityAttributeValues Identifies the attribute value to update.
[ "<p", ">", "Identifies", "the", "attribute", "value", "to", "update", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/TypedLinkSpecifier.java#L201-L208
train
Sets the value of the identityAttributeValues property.
Of course, here is the Java code you requested: ```java public void setIdentityAttributeValues(java.util.Collection<AttributeNameAndValue> identityAttributeValues) { if (identityAttributeValues == null) { this.identityAttributeValues = null; return; } this.identityAttri...
Samsung/GearVRf
GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java
GVRAvatar.animate
public GVRAnimator animate(int animIndex, float timeInSec) { if ((animIndex < 0) || (animIndex >= mAnimations.size())) { throw new IndexOutOfBoundsException("Animation index out of bounds"); } GVRAnimator anim = mAnimations.get(animIndex); anim.animate(timeInSec);...
java
public GVRAnimator animate(int animIndex, float timeInSec) { if ((animIndex < 0) || (animIndex >= mAnimations.size())) { throw new IndexOutOfBoundsException("Animation index out of bounds"); } GVRAnimator anim = mAnimations.get(animIndex); anim.animate(timeInSec);...
[ "public", "GVRAnimator", "animate", "(", "int", "animIndex", ",", "float", "timeInSec", ")", "{", "if", "(", "(", "animIndex", "<", "0", ")", "||", "(", "animIndex", ">=", "mAnimations", ".", "size", "(", ")", ")", ")", "{", "throw", "new", "IndexOutOf...
Evaluates the animation with the given index at the specified time. @param animIndex 0-based index of {@link GVRAnimator} to start @param timeInSec time to evaluate the animation at @see GVRAvatar#stop() @see #start(String)
[ "Evaluates", "the", "animation", "with", "the", "given", "index", "at", "the", "specified", "time", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRAvatar.java#L449-L458
train
Animate the specified animation.
Of course, here is the Java code you requested: ```java public GVRAnimator animate(int animIndex, float timeInSec) { if ((animIndex < 0) || (animIndex >= mAnimations.size())) { throw new IndexOutOfBoundsException("Animation index out of bounds"); } GVRAnimator anim = mAn...
Azure/azure-sdk-for-java
mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ObjectFactory.java
ObjectFactory.createEntryTypeUpdated
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = EntryType.class) public JAXBElement<DateTimeType> createEntryTypeUpdated(DateTimeType value) { return new JAXBElement<DateTimeType>(ENTRY_TYPE_UPDATED_QNAME, DateTimeType.class, EntryType.class, value); ...
java
@XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = EntryType.class) public JAXBElement<DateTimeType> createEntryTypeUpdated(DateTimeType value) { return new JAXBElement<DateTimeType>(ENTRY_TYPE_UPDATED_QNAME, DateTimeType.class, EntryType.class, value); ...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.w3.org/2005/Atom\"", ",", "name", "=", "\"updated\"", ",", "scope", "=", "EntryType", ".", "class", ")", "public", "JAXBElement", "<", "DateTimeType", ">", "createEntryTypeUpdated", "(", "DateTimeType", "va...
Create an instance of {@link JAXBElement }{@code <}{@link DateTimeType } {@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "DateTimeType", "}", "{", "@code", ">", "}" ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/data-plane/src/main/java/com/microsoft/windowsazure/services/media/implementation/atom/ObjectFactory.java#L356-L360
train
Create an instance of the appropriate type for the updated property.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.w3.org/2005/Atom", name = "updated", scope = EntryType.class) public JAXBElement<DateTimeType> createEntryTypeUpdated(DateTimeType value) { return new JAXBElement<DateTimeType>(ENTRY_TYPE_UPDATED_QNAME, ...
looly/hutool
hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/UploadFile.java
UploadFile.write
public File write(File destination) throws IOException { assertValid(); if (destination.isDirectory() == true) { destination = new File(destination, this.header.getFileName()); } if (data != null) { FileUtil.writeBytes(data, destination); data = null; } else { if (tempFile != null) { ...
java
public File write(File destination) throws IOException { assertValid(); if (destination.isDirectory() == true) { destination = new File(destination, this.header.getFileName()); } if (data != null) { FileUtil.writeBytes(data, destination); data = null; } else { if (tempFile != null) { ...
[ "public", "File", "write", "(", "File", "destination", ")", "throws", "IOException", "{", "assertValid", "(", ")", ";", "if", "(", "destination", ".", "isDirectory", "(", ")", "==", "true", ")", "{", "destination", "=", "new", "File", "(", "destination", ...
将上传的文件写入目标文件<br> 写入后原临时文件会被删除 @return 目标文件
[ "将上传的文件写入目标文件<br", ">", "写入后原临时文件会被删除" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/servlet/multipart/UploadFile.java#L86-L101
train
Write the contents of this object to the given file.
Of course, here is the Java code you requested: ```java public File write(File destination) throws IOException { assertValid(); if (destination.isDirectory() == true) { destination = new File(destination, this.header.getFileName()); } if (data != null) { FileUtil.writeBytes(data, destination); ...
fabric8io/docker-maven-plugin
src/main/java/io/fabric8/maven/docker/util/ImageArchiveUtil.java
ImageArchiveUtil.mapEntriesById
public static Map<String, ImageArchiveManifestEntry> mapEntriesById(Iterable<ImageArchiveManifestEntry> entries) { Map<String, ImageArchiveManifestEntry> mapped = new LinkedHashMap<>(); for(ImageArchiveManifestEntry entry : entries) { mapped.put(entry.getId(), entry); } ret...
java
public static Map<String, ImageArchiveManifestEntry> mapEntriesById(Iterable<ImageArchiveManifestEntry> entries) { Map<String, ImageArchiveManifestEntry> mapped = new LinkedHashMap<>(); for(ImageArchiveManifestEntry entry : entries) { mapped.put(entry.getId(), entry); } ret...
[ "public", "static", "Map", "<", "String", ",", "ImageArchiveManifestEntry", ">", "mapEntriesById", "(", "Iterable", "<", "ImageArchiveManifestEntry", ">", "entries", ")", "{", "Map", "<", "String", ",", "ImageArchiveManifestEntry", ">", "mapped", "=", "new", "Link...
Build a map of entries by id from an iterable of entries. @param entries @return a map of entries by id
[ "Build", "a", "map", "of", "entries", "by", "id", "from", "an", "iterable", "of", "entries", "." ]
70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3
https://github.com/fabric8io/docker-maven-plugin/blob/70ce4f56125d8efb8ddcf2ad4dbb5d6e2c7642b3/src/main/java/io/fabric8/maven/docker/util/ImageArchiveUtil.java#L220-L228
train
Map the given Iterable of ImageArchiveManifestEntry objects to a Map of the ID to the corresponding ImageArchiveManifestEntry objects.
Of course, here is the Java code you requested: ```java public static Map<String, ImageArchiveManifestEntry> mapEntriesById(Iterable<ImageArchiveManifestEntry> entries) { Map<String, ImageArchiveManifestEntry> mapped = new LinkedHashMap<>(); for(ImageArchiveManifestEntry entry : entries) { ...
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setTitle
public void setTitle(final String TITLE) { if (null == title) { _title = null == TITLE ? "" : TITLE; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { title.set(TITLE); } }
java
public void setTitle(final String TITLE) { if (null == title) { _title = null == TITLE ? "" : TITLE; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { title.set(TITLE); } }
[ "public", "void", "setTitle", "(", "final", "String", "TITLE", ")", "{", "if", "(", "null", "==", "title", ")", "{", "_title", "=", "null", "==", "TITLE", "?", "\"\"", ":", "TITLE", ";", "fireTileEvent", "(", "VISIBILITY_EVENT", ")", ";", "fireTileEvent"...
Sets the title of the gauge. This title will only be visible if it is not empty. @param TITLE
[ "Sets", "the", "title", "of", "the", "gauge", ".", "This", "title", "will", "only", "be", "visible", "if", "it", "is", "not", "empty", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1256-L1264
train
Sets the title of the image.
Of course, here is the Java code you requested: ```java public void setTitle(final String TITLE) { if (null == title) { _title = null == TITLE ? "" : TITLE; fireTileEvent(VISIBILITY_EVENT); fireTileEvent(REDRAW_EVENT); } else { title.set(TITLE); }...
alexvasilkov/GestureViews
library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java
ViewPosition.apply
public static boolean apply(@NonNull ViewPosition pos, @NonNull View view) { return pos.init(view); }
java
public static boolean apply(@NonNull ViewPosition pos, @NonNull View view) { return pos.init(view); }
[ "public", "static", "boolean", "apply", "(", "@", "NonNull", "ViewPosition", "pos", ",", "@", "NonNull", "View", "view", ")", "{", "return", "pos", ".", "init", "(", "view", ")", ";", "}" ]
Computes view position and stores it in given {@code pos}. Note, that view should be already attached and laid out before calling this method. @param pos Output position @param view View for which we want to get on-screen location @return true if view position is changed, false otherwise
[ "Computes", "view", "position", "and", "stores", "it", "in", "given", "{", "@code", "pos", "}", ".", "Note", "that", "view", "should", "be", "already", "attached", "and", "laid", "out", "before", "calling", "this", "method", "." ]
f0a4c266e31dcad23bd0d9013531bc1c501b9c9f
https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPosition.java#L158-L160
train
Apply a view position to a view.
Of course, here is the Java code you requested: ```java public static boolean apply(@NonNull ViewPosition pos, @NonNull View view) { return pos.init(view); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-athena/src/main/java/com/amazonaws/services/athena/AmazonAthenaClient.java
AmazonAthenaClient.listNamedQueries
@Override public ListNamedQueriesResult listNamedQueries(ListNamedQueriesRequest request) { request = beforeClientExecution(request); return executeListNamedQueries(request); }
java
@Override public ListNamedQueriesResult listNamedQueries(ListNamedQueriesRequest request) { request = beforeClientExecution(request); return executeListNamedQueries(request); }
[ "@", "Override", "public", "ListNamedQueriesResult", "listNamedQueries", "(", "ListNamedQueriesRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeListNamedQueries", "(", "request", ")", ";", "}" ]
<p> Provides a list of available query IDs only for queries saved in the specified workgroup. Requires that you have access to the workgroup. </p> <p> For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples and Code Samples</a> in the <i>Amazon A...
[ "<p", ">", "Provides", "a", "list", "of", "available", "query", "IDs", "only", "for", "queries", "saved", "in", "the", "specified", "workgroup", ".", "Requires", "that", "you", "have", "access", "to", "the", "workgroup", ".", "<", "/", "p", ">", "<p", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-athena/src/main/java/com/amazonaws/services/athena/AmazonAthenaClient.java#L770-L774
train
Returns a list of named queries.
Of course, here is the Java code you requested: ```java @Override public ListNamedQueriesResult listNamedQueries(ListNamedQueriesRequest request) { request = beforeClientExecution(request); return executeListNamedQueries(request); } ``` Hope this helps!
cloudfoundry/uaa
server/src/main/java/org/cloudfoundry/identity/uaa/authentication/manager/UsernamePasswordExtractingAuthenticationManager.java
UsernamePasswordExtractingAuthenticationManager.authenticate
@Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (authentication == null) { return authentication; } UsernamePasswordAuthenticationToken output = null; if (authentication instanceof UsernamePasswordAuthenticat...
java
@Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (authentication == null) { return authentication; } UsernamePasswordAuthenticationToken output = null; if (authentication instanceof UsernamePasswordAuthenticat...
[ "@", "Override", "public", "Authentication", "authenticate", "(", "Authentication", "authentication", ")", "throws", "AuthenticationException", "{", "if", "(", "authentication", "==", "null", ")", "{", "return", "authentication", ";", "}", "UsernamePasswordAuthenticatio...
/* (non-Javadoc) @see org.springframework.security.authentication.AuthenticationManager# authenticate(org.springframework.security.core.Authentication)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
e8df3d7060580c92d33461106399f9e4f36e3cd2
https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/authentication/manager/UsernamePasswordExtractingAuthenticationManager.java#L49-L64
train
Override method to override the authenticate method.
Of course, here is the Java code you requested: ```java @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (authentication == null) { return authentication; } UsernamePasswordAuthenticationToken output = null; ...
wonderpush/wonderpush-android-sdk
sdk/src/main/java/com/wonderpush/sdk/WonderPushRestClient.java
WonderPushRestClient.request
private static void request(final Request request) { if (null == request) { WonderPush.logError("Request with null request."); return; } WonderPush.safeDefer(new Runnable() { @Override public void run() { // Decorate parameters ...
java
private static void request(final Request request) { if (null == request) { WonderPush.logError("Request with null request."); return; } WonderPush.safeDefer(new Runnable() { @Override public void run() { // Decorate parameters ...
[ "private", "static", "void", "request", "(", "final", "Request", "request", ")", "{", "if", "(", "null", "==", "request", ")", "{", "WonderPush", ".", "logError", "(", "\"Request with null request.\"", ")", ";", "return", ";", "}", "WonderPush", ".", "safeDe...
Thin wrapper to the {@link AsyncHttpClient} library.
[ "Thin", "wrapper", "to", "the", "{" ]
ba0a1568f705cdd6206639bfab1e5cf529084b59
https://github.com/wonderpush/wonderpush-android-sdk/blob/ba0a1568f705cdd6206639bfab1e5cf529084b59/sdk/src/main/java/com/wonderpush/sdk/WonderPushRestClient.java#L272-L395
train
Request the request.
Of course, here is the Java code you requested: ```java private static void request(final Request request) { if (null == request) { WonderPush.logError("Request with null request."); return; } WonderPush.safeDefer(new Runnable() { @Override publi...
BioPAX/Paxtools
paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/TemplateReactionWrapper.java
TemplateReactionWrapper.initUpstream
@Override public void initUpstream() { NucleicAcid nuc = tempReac.getTemplate(); if (nuc != null) addToUpstream(nuc, getGraph()); for (Control cont : tempReac.getControlledOf()) { addToUpstream(cont, graph); } }
java
@Override public void initUpstream() { NucleicAcid nuc = tempReac.getTemplate(); if (nuc != null) addToUpstream(nuc, getGraph()); for (Control cont : tempReac.getControlledOf()) { addToUpstream(cont, graph); } }
[ "@", "Override", "public", "void", "initUpstream", "(", ")", "{", "NucleicAcid", "nuc", "=", "tempReac", ".", "getTemplate", "(", ")", ";", "if", "(", "nuc", "!=", "null", ")", "addToUpstream", "(", "nuc", ",", "getGraph", "(", ")", ")", ";", "for", ...
Binds to template and controllers.
[ "Binds", "to", "template", "and", "controllers", "." ]
2f93afa94426bf8b5afc2e0e61cd4b269a83288d
https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/paxtools-query/src/main/java/org/biopax/paxtools/query/wrapperL3/TemplateReactionWrapper.java#L35-L46
train
Override the initUpstream method to add data to the downstream.
Of course, here is the Java code you requested: ```java @Override public void initUpstream() { NucleicAcid nuc = tempReac.getTemplate(); if (nuc != null) addToUpstream(nuc, getGraph()); for (Control cont : tempReac.getControlledOf()) { addToUpstream(cont, graph); } } ``` Hope this helps!
Wikidata/Wikidata-Toolkit
wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/JsonSerializer.java
JsonSerializer.jacksonObjectToString
protected static String jacksonObjectToString(Object object) { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { logger.error("Failed to serialize JSON data: " + e.toString()); return null; } }
java
protected static String jacksonObjectToString(Object object) { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { logger.error("Failed to serialize JSON data: " + e.toString()); return null; } }
[ "protected", "static", "String", "jacksonObjectToString", "(", "Object", "object", ")", "{", "try", "{", "return", "mapper", ".", "writeValueAsString", "(", "object", ")", ";", "}", "catch", "(", "JsonProcessingException", "e", ")", "{", "logger", ".", "error"...
Serializes the given object in JSON and returns the resulting string. In case of errors, null is returned. In particular, this happens if the object is not based on a Jackson-annotated class. An error is logged in this case. @param object object to serialize @return JSON serialization or null
[ "Serializes", "the", "given", "object", "in", "JSON", "and", "returns", "the", "resulting", "string", ".", "In", "case", "of", "errors", "null", "is", "returned", ".", "In", "particular", "this", "happens", "if", "the", "object", "is", "not", "based", "on"...
7732851dda47e1febff406fba27bfec023f4786e
https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/JsonSerializer.java#L209-L216
train
Convert a jackson object to a string.
Of course, here is the Java code you requested: ```java protected static String jacksonObjectToString(Object object) { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { logger.error("Failed to serialize JSON data: " + e.toString()); return null; } } ``` Hope this he...
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java
MonetaryFormat.prefixCode
public MonetaryFormat prefixCode() { if (codePrefixed) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, codes, codeSeparator, true); }
java
public MonetaryFormat prefixCode() { if (codePrefixed) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, codes, codeSeparator, true); }
[ "public", "MonetaryFormat", "prefixCode", "(", ")", "{", "if", "(", "codePrefixed", ")", "return", "this", ";", "else", "return", "new", "MonetaryFormat", "(", "negativeSign", ",", "positiveSign", ",", "zeroDigit", ",", "decimalMark", ",", "minDecimals", ",", ...
Prefix formatted output by currency code. This configuration is not relevant for parsing.
[ "Prefix", "formatted", "output", "by", "currency", "code", ".", "This", "configuration", "is", "not", "relevant", "for", "parsing", "." ]
9cf13d29315014ed59cf4fc5944e5f227e8df9a6
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/MonetaryFormat.java#L269-L275
train
Prefix the currency code with the currency code.
Of course, here is the Java code you requested: ```java public MonetaryFormat prefixCode() { if (codePrefixed) return this; else return new MonetaryFormat(negativeSign, positiveSign, zeroDigit, decimalMark, minDecimals, decimalGroups, shift, roundingMode, cod...
grpc/grpc-java
api/src/main/java/io/grpc/MethodDescriptor.java
MethodDescriptor.create
@Deprecated public static <RequestT, ResponseT> MethodDescriptor<RequestT, ResponseT> create( MethodType type, String fullMethodName, Marshaller<RequestT> requestMarshaller, Marshaller<ResponseT> responseMarshaller) { return new MethodDescriptor<>( type, fullMethodName, requestMarshaller...
java
@Deprecated public static <RequestT, ResponseT> MethodDescriptor<RequestT, ResponseT> create( MethodType type, String fullMethodName, Marshaller<RequestT> requestMarshaller, Marshaller<ResponseT> responseMarshaller) { return new MethodDescriptor<>( type, fullMethodName, requestMarshaller...
[ "@", "Deprecated", "public", "static", "<", "RequestT", ",", "ResponseT", ">", "MethodDescriptor", "<", "RequestT", ",", "ResponseT", ">", "create", "(", "MethodType", "type", ",", "String", "fullMethodName", ",", "Marshaller", "<", "RequestT", ">", "requestMars...
Creates a new {@code MethodDescriptor}. @param type the call type of this method @param fullMethodName the fully qualified name of this method @param requestMarshaller the marshaller used to encode and decode requests @param responseMarshaller the marshaller used to encode and decode responses @since 1.0.0 @deprecated...
[ "Creates", "a", "new", "{", "@code", "MethodDescriptor", "}", "." ]
973885457f9609de232d2553b82c67f6c3ff57bf
https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/api/src/main/java/io/grpc/MethodDescriptor.java#L209-L216
train
Create a new MethodDescriptor instance.
Of course, here is the Java code you requested: ```java @Deprecated public static <RequestT, ResponseT> MethodDescriptor<RequestT, ResponseT> create( MethodType type, String fullMethodName, Marshaller<RequestT> requestMarshaller, Marshaller<ResponseT> responseMarshaller) { return new MethodDesc...
SimonVT/android-menudrawer
menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java
MenuDrawer.getIndicatorStartPos
private int getIndicatorStartPos() { switch (getPosition()) { case TOP: return mIndicatorClipRect.left; case RIGHT: return mIndicatorClipRect.top; case BOTTOM: return mIndicatorClipRect.left; default: ...
java
private int getIndicatorStartPos() { switch (getPosition()) { case TOP: return mIndicatorClipRect.left; case RIGHT: return mIndicatorClipRect.top; case BOTTOM: return mIndicatorClipRect.left; default: ...
[ "private", "int", "getIndicatorStartPos", "(", ")", "{", "switch", "(", "getPosition", "(", ")", ")", "{", "case", "TOP", ":", "return", "mIndicatorClipRect", ".", "left", ";", "case", "RIGHT", ":", "return", "mIndicatorClipRect", ".", "top", ";", "case", ...
Returns the start position of the indicator. @return The start position of the indicator.
[ "Returns", "the", "start", "position", "of", "the", "indicator", "." ]
59e8d18e109c77d911b8b63232d66d5f0551cf6a
https://github.com/SimonVT/android-menudrawer/blob/59e8d18e109c77d911b8b63232d66d5f0551cf6a/menudrawer/src/net/simonvt/menudrawer/MenuDrawer.java#L1071-L1082
train
Get the start position of the indicator.
Of course, here is the Java code you requested: ```java private int getIndicatorStartPos() { switch (getPosition()) { case TOP: return mIndicatorClipRect.left; case RIGHT: return mIndicatorClipRect.top; case BOTTOM: return mInd...
wisdom-framework/wisdom
extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java
AbstractWisdomSourceWatcherMojo.execute
@Override public void execute() throws MojoExecutionException, MojoFailureException { javaSourceDir = WatcherUtils.getJavaSource(basedir); try { for (File file : FileUtils.listFiles(javaSourceDir, new String[]{"java"}, true)) { if (accept(file)) { par...
java
@Override public void execute() throws MojoExecutionException, MojoFailureException { javaSourceDir = WatcherUtils.getJavaSource(basedir); try { for (File file : FileUtils.listFiles(javaSourceDir, new String[]{"java"}, true)) { if (accept(file)) { par...
[ "@", "Override", "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "javaSourceDir", "=", "WatcherUtils", ".", "getJavaSource", "(", "basedir", ")", ";", "try", "{", "for", "(", "File", "file", ":", "Fi...
Create a model for each wisdom controller available in the java source directory and call {@link #controllerParsed(File, ControllerModel)} for each of them. @throws MojoExecutionException when an exception occurred while creating the raml file. @throws MojoFailureException {@inheritDoc}
[ "Create", "a", "model", "for", "each", "wisdom", "controller", "available", "in", "the", "java", "source", "directory", "and", "call", "{", "@link", "#controllerParsed", "(", "File", "ControllerModel", ")", "}", "for", "each", "of", "them", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java#L71-L84
train
Execute the action.
Of course, here is the Java code you requested: ```java @Override public void execute() throws MojoExecutionException, MojoFailureException { javaSourceDir = WatcherUtils.getJavaSource(basedir); try { for (File file : FileUtils.listFiles(javaSourceDir, new String[]{"java"}, true)) { ...
demidenko05/beigesoft-bcommon
src/main/java/org/beigesoft/service/SrvNumberToString.java
SrvNumberToString.printNtz
@Override public final String printNtz(final String pNumber, final String pDigSep, final String pDigGrSep, final Integer pDigitsInGroup) { if (pNumber == null || "".equals(pNumber)) { return ""; } int dotIdx = pNumber.indexOf("."); String leftWing; String rightWing; if (dotIdx == -1)...
java
@Override public final String printNtz(final String pNumber, final String pDigSep, final String pDigGrSep, final Integer pDigitsInGroup) { if (pNumber == null || "".equals(pNumber)) { return ""; } int dotIdx = pNumber.indexOf("."); String leftWing; String rightWing; if (dotIdx == -1)...
[ "@", "Override", "public", "final", "String", "printNtz", "(", "final", "String", "pNumber", ",", "final", "String", "pDigSep", ",", "final", "String", "pDigGrSep", ",", "final", "Integer", "pDigitsInGroup", ")", "{", "if", "(", "pNumber", "==", "null", "||"...
<p>Prints number without trailing zeros, e.g.: 1.0 -> 1; 1.1234[,sp] -> 1,1234; 1234.0[.,] -> 1,1234; 1234.10[.,] -> 1,1234.1. </p> @param pNumber e.g. "1214.10" @param pDigSep decimal separator, e.g. "," @param pDigGrSep decimal group separator, e.g. " " @param pDigitsInGroup Digits in group, e.g. 3 @return internatio...
[ "<p", ">", "Prints", "number", "without", "trailing", "zeros", "e", ".", "g", ".", ":", "1", ".", "0", "-", ">", "1", ";", "1", ".", "1234", "[", "sp", "]", "-", ">", "1", "1234", ";", "1234", ".", "0", "[", ".", "]", "-", ">", "1", "1234...
bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf
https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/service/SrvNumberToString.java#L101-L132
train
Print the ntz.
Of course, here is the Java code you requested: ```java @Override public final String printNtz(final String pNumber, final String pDigSep, final String pDigGrSep, final Integer pDigitsInGroup) { if (pNumber == null || "".equals(pNumber)) { return ""; } int dotIdx = pNumber.indexOf("."); Str...
versionone/VersionOne.SDK.Java.ObjectModel
src/main/java/com/versionone/om/V1InstanceGetter.java
V1InstanceGetter.epics
public Collection<Epic> epics(EpicFilter filter) { return get(Epic.class, (filter != null) ? filter : new EpicFilter()); }
java
public Collection<Epic> epics(EpicFilter filter) { return get(Epic.class, (filter != null) ? filter : new EpicFilter()); }
[ "public", "Collection", "<", "Epic", ">", "epics", "(", "EpicFilter", "filter", ")", "{", "return", "get", "(", "Epic", ".", "class", ",", "(", "filter", "!=", "null", ")", "?", "filter", ":", "new", "EpicFilter", "(", ")", ")", ";", "}" ]
Get Epics filtered by the criteria specified in the passed in filter. @param filter Limit the items returned. If null, then all items returned. @return Collection of items as specified in the filter.
[ "Get", "Epics", "filtered", "by", "the", "criteria", "specified", "in", "the", "passed", "in", "filter", "." ]
59d35b67c849299631bca45ee94143237eb2ae1a
https://github.com/versionone/VersionOne.SDK.Java.ObjectModel/blob/59d35b67c849299631bca45ee94143237eb2ae1a/src/main/java/com/versionone/om/V1InstanceGetter.java#L118-L120
train
Get Epic filtered by the criteria specified in the passed in filter.
Of course, here is the Java code you requested: ```java public Collection<Epic> epics(EpicFilter filter) { return get(Epic.class, (filter != null) ? filter : new EpicFilter()); } ``` Hope this helps!
davidcarboni/restolino
src/main/java/com/github/davidcarboni/restolino/json/Serialiser.java
Serialiser.deserialise
public static <O> O deserialise(HttpServletRequest request, Class<O> requestMessageType) throws IOException { return deserialise(request.getInputStream(), requestMessageType); }
java
public static <O> O deserialise(HttpServletRequest request, Class<O> requestMessageType) throws IOException { return deserialise(request.getInputStream(), requestMessageType); }
[ "public", "static", "<", "O", ">", "O", "deserialise", "(", "HttpServletRequest", "request", ",", "Class", "<", "O", ">", "requestMessageType", ")", "throws", "IOException", "{", "return", "deserialise", "(", "request", ".", "getInputStream", "(", ")", ",", ...
Deserialises the given {@link HttpServletRequest} to a JSON String. @param request The request to deserialise. @param requestMessageType The message type to deserialise into. @param <O> The type to deserialise to. @return A new instance of the given type. @throws IOException If an error occur...
[ "Deserialises", "the", "given", "{", "@link", "HttpServletRequest", "}", "to", "a", "JSON", "String", "." ]
3f84ece1bd016fbb597c624d46fcca5a2580a33d
https://github.com/davidcarboni/restolino/blob/3f84ece1bd016fbb597c624d46fcca5a2580a33d/src/main/java/com/github/davidcarboni/restolino/json/Serialiser.java#L215-L219
train
Deserialise a single SECTYPE from the input stream of the request.
Of course, here is the Java code you requested: ```java public static <O> O deserialise(HttpServletRequest request, Class<O> requestMessageType) throws IOException { return deserialise(request.getInputStream(), requestMessageType); } ``` Hope this helps!
citrusframework/citrus
modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/message/FtpMessage.java
FtpMessage.getArguments
public String getArguments() { return Optional.ofNullable(getHeader(FtpMessageHeaders.FTP_ARGS)).map(Object::toString).orElse(null); }
java
public String getArguments() { return Optional.ofNullable(getHeader(FtpMessageHeaders.FTP_ARGS)).map(Object::toString).orElse(null); }
[ "public", "String", "getArguments", "(", ")", "{", "return", "Optional", ".", "ofNullable", "(", "getHeader", "(", "FtpMessageHeaders", ".", "FTP_ARGS", ")", ")", ".", "map", "(", "Object", "::", "toString", ")", ".", "orElse", "(", "null", ")", ";", "}"...
Gets the command args.
[ "Gets", "the", "command", "args", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ftp/src/main/java/com/consol/citrus/ftp/message/FtpMessage.java#L324-L326
train
Gets the value of the arguments header.
Of course, here is the Java code you requested: ```java public String getArguments() { return Optional.ofNullable(getHeader(FtpMessageHeaders.FTP_ARGS)).map(Object::toString).orElse(null); } ``` Hope this helps!
jenkinsci/jenkins
core/src/main/java/hudson/util/spring/BeanBuilder.java
BeanBuilder.loadBeans
public void loadBeans(Resource[] resources) throws IOException { Closure beans = new Closure(this){ @Override public Object call(Object... args) { return beans((Closure)args[0]); } }; Binding b = new Binding(); b.setVariable("beans", beans); GroovyShell shell = classLoader != null ? new GroovySh...
java
public void loadBeans(Resource[] resources) throws IOException { Closure beans = new Closure(this){ @Override public Object call(Object... args) { return beans((Closure)args[0]); } }; Binding b = new Binding(); b.setVariable("beans", beans); GroovyShell shell = classLoader != null ? new GroovySh...
[ "public", "void", "loadBeans", "(", "Resource", "[", "]", "resources", ")", "throws", "IOException", "{", "Closure", "beans", "=", "new", "Closure", "(", "this", ")", "{", "@", "Override", "public", "Object", "call", "(", "Object", "...", "args", ")", "{...
Loads a set of given beans @param resources The resources to load @throws IOException
[ "Loads", "a", "set", "of", "given", "beans" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/spring/BeanBuilder.java#L328-L342
train
Load beans from the given resources.
Of course, here is the Java code you requested: ```java public void loadBeans(Resource[] resources) throws IOException { Closure beans = new Closure(this){ @Override public Object call(Object... args) { return beans((Closure)args[0]); } }; Binding b = new Binding(); b.setVariable("beans", beans); ...
google/guava
guava/src/com/google/common/collect/Multimaps.java
Multimaps.asMap
@Beta @SuppressWarnings("unchecked") // safe by specification of SortedSetMultimap.asMap() public static <K, V> Map<K, SortedSet<V>> asMap(SortedSetMultimap<K, V> multimap) { return (Map<K, SortedSet<V>>) (Map<K, ?>) multimap.asMap(); }
java
@Beta @SuppressWarnings("unchecked") // safe by specification of SortedSetMultimap.asMap() public static <K, V> Map<K, SortedSet<V>> asMap(SortedSetMultimap<K, V> multimap) { return (Map<K, SortedSet<V>>) (Map<K, ?>) multimap.asMap(); }
[ "@", "Beta", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "// safe by specification of SortedSetMultimap.asMap()", "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "SortedSet", "<", "V", ">", ">", "asMap", "(", "SortedSetMultimap", "<", ...
Returns {@link SortedSetMultimap#asMap multimap.asMap()}, with its type corrected from {@code Map<K, Collection<V>>} to {@code Map<K, SortedSet<V>>}. @since 15.0
[ "Returns", "{", "@link", "SortedSetMultimap#asMap", "multimap", ".", "asMap", "()", "}", "with", "its", "type", "corrected", "from", "{", "@code", "Map<K", "Collection<V", ">>", "}", "to", "{", "@code", "Map<K", "SortedSet<V", ">>", "}", "." ]
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/collect/Multimaps.java#L1052-L1057
valid
Returns a map of the given multimap.
Of course, here is the Java code you requested: ```java @Beta @SuppressWarnings("unchecked") // safe by specification of SortedSetMultimap.asMap() public static <K, V> Map<K, SortedSet<V>> asMap(SortedSetMultimap<K, V> multimap) { return (Map<K, SortedSet<V>>) (Map<K, ?>) multimap.asMap(); } ``` Hope this...
nmdp-bioinformatics/ngs
sra/src/main/java/org/nmdp/ngs/sra/SraReader.java
SraReader.readRunSet
public static RunSet readRunSet(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return readRunSet(reader); } }
java
public static RunSet readRunSet(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return readRunSet(reader); } }
[ "public", "static", "RunSet", "readRunSet", "(", "final", "File", "file", ")", "throws", "IOException", "{", "checkNotNull", "(", "file", ")", ";", "try", "(", "BufferedReader", "reader", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "file", "...
Read a run set from the specified file. @param file file, must not be null @return a run set read from the specified file @throws IOException if an I/O error occurs
[ "Read", "a", "run", "set", "from", "the", "specified", "file", "." ]
277627e4311313a80f5dc110b3185b0d7af32bd0
https://github.com/nmdp-bioinformatics/ngs/blob/277627e4311313a80f5dc110b3185b0d7af32bd0/sra/src/main/java/org/nmdp/ngs/sra/SraReader.java#L231-L236
train
Read a run set from a file.
Of course, here is the Java code you requested: ```java public static RunSet readRunSet(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return readRunSet(reader); } } ``` Hope this helps!
goldmansachs/gs-collections
collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java
StringIterate.forEachTrimmedToken
public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure) { for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); ) { String token = stringTokenizer.nextToken().trim(); proced...
java
public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure) { for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); ) { String token = stringTokenizer.nextToken().trim(); proced...
[ "public", "static", "void", "forEachTrimmedToken", "(", "String", "string", ",", "String", "separator", ",", "Procedure", "<", "String", ">", "procedure", ")", "{", "for", "(", "StringTokenizer", "stringTokenizer", "=", "new", "StringTokenizer", "(", "string", "...
For each token in a {@code string} separated by the specified {@code separator}, execute the specified {@link Procedure}.
[ "For", "each", "token", "in", "a", "{" ]
fa8bf3e103689efa18bca2ab70203e71cde34b52
https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/StringIterate.java#L318-L325
train
For each token in a string that is trimmed.
Of course, here is the Java code you requested: ```java public static void forEachTrimmedToken(String string, String separator, Procedure<String> procedure) { for (StringTokenizer stringTokenizer = new StringTokenizer(string, separator); stringTokenizer.hasMoreTokens(); ) { String token...
OpenLiberty/open-liberty
dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/AdminObjectService.java
AdminObjectService.createResource
@Override public Object createResource(ResourceInfo refInfo) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "createResource", refInfo); try { BootstrapContextImpl bootstrapContext = b...
java
@Override public Object createResource(ResourceInfo refInfo) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "createResource", refInfo); try { BootstrapContextImpl bootstrapContext = b...
[ "@", "Override", "public", "Object", "createResource", "(", "ResourceInfo", "refInfo", ")", "throws", "Exception", "{", "final", "boolean", "trace", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isEntry...
{@inheritDoc}
[ "{" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/AdminObjectService.java#L126-L161
train
Override the createResource method to create an instance of the AdminObjectImpl class.
Of course, here is the Java code you requested: ```java @Override public Object createResource(ResourceInfo refInfo) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "createResource", refInfo); tr...
projectodd/wunderboss-release
web/src/main/java/org/projectodd/wunderboss/web/async/OutputStreamHttpChannel.java
OutputStreamHttpChannel.send
@Override public synchronized boolean send(final Object message, final boolean shouldClose, final OnComplete onComplete) throws IOException { if (!isOpen()) { return false; } this.sendQueued = true; ...
java
@Override public synchronized boolean send(final Object message, final boolean shouldClose, final OnComplete onComplete) throws IOException { if (!isOpen()) { return false; } this.sendQueued = true; ...
[ "@", "Override", "public", "synchronized", "boolean", "send", "(", "final", "Object", "message", ",", "final", "boolean", "shouldClose", ",", "final", "OnComplete", "onComplete", ")", "throws", "IOException", "{", "if", "(", "!", "isOpen", "(", ")", ")", "{"...
message must be String or byte[]. Allowing Object makes life easier from clojure
[ "message", "must", "be", "String", "or", "byte", "[]", ".", "Allowing", "Object", "makes", "life", "easier", "from", "clojure" ]
f67c68e80c5798169e3a9b2015e278239dbf005d
https://github.com/projectodd/wunderboss-release/blob/f67c68e80c5798169e3a9b2015e278239dbf005d/web/src/main/java/org/projectodd/wunderboss/web/async/OutputStreamHttpChannel.java#L93-L117
train
Sends a message to the server.
Of course, here is the Java code you requested: ```java @Override public synchronized boolean send(final Object message, final boolean shouldClose, final OnComplete onComplete) throws IOException { if (!isOpen()) { return...
segmentio/analytics-android
analytics/src/main/java/com/segment/analytics/internal/Utils.java
Utils.coerceToFloat
public static float coerceToFloat(Object value, float defaultValue) { if (value instanceof Float) { return (float) value; } if (value instanceof Number) { return ((Number) value).floatValue(); } else if (value instanceof String) { try { return Float.valueOf((String) value); ...
java
public static float coerceToFloat(Object value, float defaultValue) { if (value instanceof Float) { return (float) value; } if (value instanceof Number) { return ((Number) value).floatValue(); } else if (value instanceof String) { try { return Float.valueOf((String) value); ...
[ "public", "static", "float", "coerceToFloat", "(", "Object", "value", ",", "float", "defaultValue", ")", "{", "if", "(", "value", "instanceof", "Float", ")", "{", "return", "(", "float", ")", "value", ";", "}", "if", "(", "value", "instanceof", "Number", ...
Returns the float representation at {@code value} if it exists and is a float or can be coerced to a float. Returns {@code defaultValue} otherwise.
[ "Returns", "the", "float", "representation", "at", "{" ]
93c7d5bb09b593440a2347a6089db3e9f74012da
https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L123-L136
train
Coerce a value to a float.
Of course, here is the Java code you requested: ```java public static float coerceToFloat(Object value, float defaultValue) { if (value instanceof Float) { return (float) value; } if (value instanceof Number) { return ((Number) value).floatValue(); } else if (value instanceof String) { ...
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getAllByName
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
java
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
[ "public", "static", "InetAddress", "[", "]", "getAllByName", "(", "String", "name", ")", "throws", "UnknownHostException", "{", "try", "{", "InetAddress", "addr", "=", "getByAddress", "(", "name", ")", ";", "return", "new", "InetAddress", "[", "]", "{", "add...
Determines all IP address of a host @param name The hostname to look up @return All matching IP addresses @throws UnknownHostException The hostname does not have any addresses
[ "Determines", "all", "IP", "address", "of", "a", "host" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L285-L297
train
Get all the IPs of a single user.
Of course, here is the Java code you requested: ```java public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] re...
wildfly/wildfly
undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java
UndertowDeploymentInfoService.handleJASPIMechanism
private void handleJASPIMechanism(final DeploymentInfo deploymentInfo) { ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationPolicy(this.securityDomain); if (applicationPolicy != null && JASPIAuthenticationInfo.class.isInstance(applicationPolicy.getAuthenticationInfo())) { ...
java
private void handleJASPIMechanism(final DeploymentInfo deploymentInfo) { ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationPolicy(this.securityDomain); if (applicationPolicy != null && JASPIAuthenticationInfo.class.isInstance(applicationPolicy.getAuthenticationInfo())) { ...
[ "private", "void", "handleJASPIMechanism", "(", "final", "DeploymentInfo", "deploymentInfo", ")", "{", "ApplicationPolicy", "applicationPolicy", "=", "SecurityConfiguration", ".", "getApplicationPolicy", "(", "this", ".", "securityDomain", ")", ";", "if", "(", "applicat...
<p>Adds to the deployment the {@link org.wildfly.extension.undertow.security.jaspi.JASPICAuthenticationMechanism}, if necessary. The handler will be added if the security domain is configured with JASPI authentication.</p> @param deploymentInfo
[ "<p", ">", "Adds", "to", "the", "deployment", "the", "{", "@link", "org", ".", "wildfly", ".", "extension", ".", "undertow", ".", "security", ".", "jaspi", ".", "JASPICAuthenticationMechanism", "}", "if", "necessary", ".", "The", "handler", "will", "be", "...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L465-L478
test
Handle JASPIMechanism.
Of course, here is the Java code you requested: ```java private void handleJASPIMechanism(final DeploymentInfo deploymentInfo) { ApplicationPolicy applicationPolicy = SecurityConfiguration.getApplicationPolicy(this.securityDomain); if (applicationPolicy != null && JASPIAuthenticationInfo.class.isInsta...
Unidata/thredds
opendap/src/main/java/opendap/servlet/ascii/asciiGrid.java
asciiGrid.toASCII
public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiGrid.toASCII(" + addName + ",'" + rootName + "') getName(): " + getEncodedName()); ...
java
public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiGrid.toASCII(" + addName + ",'" + rootName + "') getName(): " + getEncodedName()); ...
[ "public", "void", "toASCII", "(", "PrintWriter", "pw", ",", "boolean", "addName", ",", "String", "rootName", ",", "boolean", "newLine", ")", "{", "if", "(", "_Debug", ")", "System", ".", "out", ".", "println", "(", "\"asciiGrid.toASCII(\"", "+", "addName", ...
Returns a string representation of the variables value. This is really foreshadowing functionality for Server types, but as it may come in useful for clients it is added here. Simple types (example: DFloat32) will return a single value. DConstuctor and DVector types will be flattened. DStrings and DURL's will have doub...
[ "Returns", "a", "string", "representation", "of", "the", "variables", "value", ".", "This", "is", "really", "foreshadowing", "functionality", "for", "Server", "types", "but", "as", "it", "may", "come", "in", "useful", "for", "clients", "it", "is", "added", "...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servlet/ascii/asciiGrid.java#L84-L113
test
Write the data of this object to ASCII.
Of course, here is the Java code you requested: ```java public void toASCII(PrintWriter pw, boolean addName, String rootName, boolean newLine) { if (_Debug) System.out.println("asciiGrid.toASCII(" + addName + ",'" + root...
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
AbstractIoSession.getServiceName
private String getServiceName() { TransportMetadata tm = getTransportMetadata(); if (tm == null) { return "null"; } return tm.getProviderName() + ' ' + tm.getName(); }
java
private String getServiceName() { TransportMetadata tm = getTransportMetadata(); if (tm == null) { return "null"; } return tm.getProviderName() + ' ' + tm.getName(); }
[ "private", "String", "getServiceName", "(", ")", "{", "TransportMetadata", "tm", "=", "getTransportMetadata", "(", ")", ";", "if", "(", "tm", "==", "null", ")", "{", "return", "\"null\"", ";", "}", "return", "tm", ".", "getProviderName", "(", ")", "+", "...
TODO Add method documentation
[ "TODO", "Add", "method", "documentation" ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java#L1184-L1191
train
Get the service name.
Of course, here is the Java code you requested: ```java private String getServiceName() { TransportMetadata tm = getTransportMetadata(); if (tm == null) { return "null"; } return tm.getProviderName() + ' ' + tm.getName(); } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java
DateFormatSymbols.getDateFormatBundle
@Deprecated // This API was formerly @stable ICU 2.0 static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass, Locale locale) throws MissingResourceException { return null; }
java
@Deprecated // This API was formerly @stable ICU 2.0 static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass, Locale locale) throws MissingResourceException { return null; }
[ "@", "Deprecated", "// This API was formerly @stable ICU 2.0", "static", "public", "ResourceBundle", "getDateFormatBundle", "(", "Class", "<", "?", "extends", "Calendar", ">", "calendarClass", ",", "Locale", "locale", ")", "throws", "MissingResourceException", "{", "retur...
Finds the ResourceBundle containing the date format information for a specified calendar subclass in a given locale. <p> The resource bundle name is based on the calendar's fully-specified class name, with ".resources" inserted at the end of the package name (just before the class name) and "Symbols" appended to the en...
[ "Finds", "the", "ResourceBundle", "containing", "the", "date", "format", "information", "for", "a", "specified", "calendar", "subclass", "in", "a", "given", "locale", ".", "<p", ">", "The", "resource", "bundle", "name", "is", "based", "on", "the", "calendar", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormatSymbols.java#L2326-L2332
train
Get a ResourceBundle for the calendar class.
Of course, here is the Java code you requested: ```java @Deprecated // This API was formerly @stable ICU 2.0 static public ResourceBundle getDateFormatBundle(Class<? extends Calendar> calendarClass, Locale locale) throws MissingResourceException { ...
boonproject/boon
boon/src/main/java/org/boon/validation/validators/LongRangeValidator.java
LongRangeValidator.dynamicallyInitIfNeeded
private void dynamicallyInitIfNeeded( Object value ) { /* Check to see if this class was already initialized, * if not, initialize it based on the type of the value. */ if ( !isInitialized() ) { if ( value instanceof Integer ) { init( new Integer( min.intVal...
java
private void dynamicallyInitIfNeeded( Object value ) { /* Check to see if this class was already initialized, * if not, initialize it based on the type of the value. */ if ( !isInitialized() ) { if ( value instanceof Integer ) { init( new Integer( min.intVal...
[ "private", "void", "dynamicallyInitIfNeeded", "(", "Object", "value", ")", "{", "/* Check to see if this class was already initialized,\r\n * if not, initialize it based on the type of the value.\r\n\t\t */", "if", "(", "!", "isInitialized", "(", ")", ")", "{", "if", "(",...
If the type was not initialized, we can still figure it out at runtime. @param value
[ "If", "the", "type", "was", "not", "initialized", "we", "can", "still", "figure", "it", "out", "at", "runtime", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/validation/validators/LongRangeValidator.java#L122-L137
test
Dynamically initialize the related class based on the type of the value.
Of course, here is the Java code you requested: ```java private void dynamicallyInitIfNeeded( Object value ) { /* Check to see if this class was already initialized, * if not, initialize it based on the type of the value. */ if ( !isInitialized() ) { if ( value instanceof I...
powermock/powermock
powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java
WhiteboxImpl.findFieldOrThrowException
private static Field findFieldOrThrowException(Class<?> fieldType, Class<?> where) { if (fieldType == null || where == null) { throw new IllegalArgumentException("fieldType and where cannot be null"); } Field field = null; for (Field currentField : where.getDeclaredFields()) ...
java
private static Field findFieldOrThrowException(Class<?> fieldType, Class<?> where) { if (fieldType == null || where == null) { throw new IllegalArgumentException("fieldType and where cannot be null"); } Field field = null; for (Field currentField : where.getDeclaredFields()) ...
[ "private", "static", "Field", "findFieldOrThrowException", "(", "Class", "<", "?", ">", "fieldType", ",", "Class", "<", "?", ">", "where", ")", "{", "if", "(", "fieldType", "==", "null", "||", "where", "==", "null", ")", "{", "throw", "new", "IllegalArgu...
Find field or throw exception. @param fieldType the field type @param where the where @return the field
[ "Find", "field", "or", "throw", "exception", "." ]
e8cd68026c284c6a7efe66959809eeebd8d1f9ad
https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L2277-L2293
train
Find field or exception.
Of course, here is the Java code you requested: ```java private static Field findFieldOrThrowException(Class<?> fieldType, Class<?> where) { if (fieldType == null || where == null) { throw new IllegalArgumentException("fieldType and where cannot be null"); } Field field = null; ...
beanshell/beanshell
src/main/java/bsh/Primitive.java
Primitive.unwrap
public static Object [] unwrap( Object[] args ) { if ( args == null ) return null; Object [] oa = new Object[ args.length ]; for(int i=0; i<args.length; i++) oa[i] = unwrap( args[i] ); return oa; }
java
public static Object [] unwrap( Object[] args ) { if ( args == null ) return null; Object [] oa = new Object[ args.length ]; for(int i=0; i<args.length; i++) oa[i] = unwrap( args[i] ); return oa; }
[ "public", "static", "Object", "[", "]", "unwrap", "(", "Object", "[", "]", "args", ")", "{", "if", "(", "args", "==", "null", ")", "return", "null", ";", "Object", "[", "]", "oa", "=", "new", "Object", "[", "args", ".", "length", "]", ";", "for",...
/* Unwrap Primitive wrappers to their java.lang wrapper values. e.g. Primitive(42) becomes Integer(42) @see #unwrap( Object )
[ "/", "*", "Unwrap", "Primitive", "wrappers", "to", "their", "java", ".", "lang", "wrapper", "values", ".", "e", ".", "g", ".", "Primitive", "(", "42", ")", "becomes", "Integer", "(", "42", ")" ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/Primitive.java#L306-L314
train
Unwraps the arguments array into an array of objects.
Of course, here is the Java code you requested: ```java public static Object [] unwrap( Object[] args ) { if ( args == null ) return null; Object [] oa = new Object[ args.length ]; for(int i=0; i<args.length; i++) oa[i] = unwrap( args[i] ); return oa; } `...
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java
OmsLineSmootherMcMaster.defaultSmoothShapefile
public static void defaultSmoothShapefile( String shapePath, String outPath ) throws Exception { PrintStreamProgressMonitor pm = new PrintStreamProgressMonitor(System.out, System.err); SimpleFeatureCollection initialFC = OmsShapefileFeatureReader.readShapefile(shapePath); OmsLineSmootherMcMaste...
java
public static void defaultSmoothShapefile( String shapePath, String outPath ) throws Exception { PrintStreamProgressMonitor pm = new PrintStreamProgressMonitor(System.out, System.err); SimpleFeatureCollection initialFC = OmsShapefileFeatureReader.readShapefile(shapePath); OmsLineSmootherMcMaste...
[ "public", "static", "void", "defaultSmoothShapefile", "(", "String", "shapePath", ",", "String", "outPath", ")", "throws", "Exception", "{", "PrintStreamProgressMonitor", "pm", "=", "new", "PrintStreamProgressMonitor", "(", "System", ".", "out", ",", "System", ".", ...
An utility method to use the module with default values and shapefiles. <p> This will use the windowed average and a density of 0.2, simplification threshold of 0.1 and a lookahead of 13, as well as a length filter of 10. </p> @param shapePath the input file. @param outPath the output smoothed path. @throws Exception
[ "An", "utility", "method", "to", "use", "the", "module", "with", "default", "values", "and", "shapefiles", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/v/smoothing/OmsLineSmootherMcMaster.java#L245-L262
train
Default smoothed shapefile.
Of course, here is the Java code you requested: ```java public static void defaultSmoothShapefile( String shapePath, String outPath ) throws Exception { PrintStreamProgressMonitor pm = new PrintStreamProgressMonitor(System.out, System.err); SimpleFeatureCollection initialFC = OmsShapefileFeatureReader....
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java
MessageMap.getMultiChoice
private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant[] vars) throws JMFUninitializedAccessException { // Mixed-radix-encode the contribution from all the subvariants BigInteger base = BigInteger.ZERO; for (int i = 0; i < vars.length; i++) base = base.multiply(vars[i].getMu...
java
private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant[] vars) throws JMFUninitializedAccessException { // Mixed-radix-encode the contribution from all the subvariants BigInteger base = BigInteger.ZERO; for (int i = 0; i < vars.length; i++) base = base.multiply(vars[i].getMu...
[ "private", "static", "BigInteger", "getMultiChoice", "(", "int", "[", "]", "choices", ",", "JSchema", "schema", ",", "JSVariant", "[", "]", "vars", ")", "throws", "JMFUninitializedAccessException", "{", "// Mixed-radix-encode the contribution from all the subvariants", "B...
being calculate.
[ "being", "calculate", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/MessageMap.java#L214-L220
train
Gets the MultiChoice value from all the subvariants of the sequence.
Of course, here is the Java code you requested: ```java private static BigInteger getMultiChoice(int[] choices, JSchema schema, JSVariant[] vars) throws JMFUninitializedAccessException { // Mixed-radix-encode the contribution from all the subvariants BigInteger base = BigInteger.ZERO; for (int i = 0; i < v...
geomajas/geomajas-project-client-gwt
plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/geometricsearch/GeometricSearchPanel.java
GeometricSearchPanel.validate
@Override public boolean validate() { if (searchGeometry == null) { SC.say(messages.geometricSearchWidgetTitle(), messages.geometricSearchWidgetNoGeometry()); return false; } else if (SearchCommService.getVisibleServerLayerIds(mapWidget.getMapModel()).size() < 1) { SC.say(messages.geometricSearchWidgetTit...
java
@Override public boolean validate() { if (searchGeometry == null) { SC.say(messages.geometricSearchWidgetTitle(), messages.geometricSearchWidgetNoGeometry()); return false; } else if (SearchCommService.getVisibleServerLayerIds(mapWidget.getMapModel()).size() < 1) { SC.say(messages.geometricSearchWidgetTit...
[ "@", "Override", "public", "boolean", "validate", "(", ")", "{", "if", "(", "searchGeometry", "==", "null", ")", "{", "SC", ".", "say", "(", "messages", ".", "geometricSearchWidgetTitle", "(", ")", ",", "messages", ".", "geometricSearchWidgetNoGeometry", "(", ...
----------------------------------------------------------
[ "----------------------------------------------------------" ]
1c1adc48deb192ed825265eebcc74d70bbf45670
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-searchandfilter/searchandfilter-gwt/src/main/java/org/geomajas/widget/searchandfilter/client/widget/geometricsearch/GeometricSearchPanel.java#L106-L117
train
Validate the geometry and layer ids.
Of course, here is the Java code you requested: ```java @Override public boolean validate() { if (searchGeometry == null) { SC.say(messages.geometricSearchWidgetTitle(), messages.geometricSearchWidgetNoGeometry()); return false; } else if (SearchCommService.getVisibleServerLayerIds(mapWidget.getMapModel())....
s1-platform/s1
s1-core/src/java/org/s1/script/Context.java
Context.remove
public void remove(String name){ Map<String,Object> m = getMap(name); if(m!=null) { memoryHeap.release(m.get(name)); m.remove(name); } }
java
public void remove(String name){ Map<String,Object> m = getMap(name); if(m!=null) { memoryHeap.release(m.get(name)); m.remove(name); } }
[ "public", "void", "remove", "(", "String", "name", ")", "{", "Map", "<", "String", ",", "Object", ">", "m", "=", "getMap", "(", "name", ")", ";", "if", "(", "m", "!=", "null", ")", "{", "memoryHeap", ".", "release", "(", "m", ".", "get", "(", "...
Find and remove parameter from this context and upwards @param name
[ "Find", "and", "remove", "parameter", "from", "this", "context", "and", "upwards" ]
370101c13fef01af524bc171bcc1a97e5acc76e8
https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/script/Context.java#L131-L137
train
Removes the entry with the given name from the cache.
Of course, here is the Java code you requested: ```java public void remove(String name){ Map<String,Object> m = getMap(name); if(m!=null) { memoryHeap.release(m.get(name)); m.remove(name); } } ``` Hope this helps!
jenetics/jenetics
jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java
TreeNode.remove
public void remove(final Tree<?, ?> child) { requireNonNull(child); if (!isChild(child)) { throw new IllegalArgumentException("The given child is not a child."); } remove(getIndex(child)); }
java
public void remove(final Tree<?, ?> child) { requireNonNull(child); if (!isChild(child)) { throw new IllegalArgumentException("The given child is not a child."); } remove(getIndex(child)); }
[ "public", "void", "remove", "(", "final", "Tree", "<", "?", ",", "?", ">", "child", ")", "{", "requireNonNull", "(", "child", ")", ";", "if", "(", "!", "isChild", "(", "child", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The give...
Remove the {@code child} from {@code this} node's child array, giving it a {@code null} parent. @param child the child of this node to remove @throws NullPointerException if the given {@code child} is {@code null} @throws IllegalArgumentException if the given {@code child} is not a child of this node
[ "Remove", "the", "{", "@code", "child", "}", "from", "{", "@code", "this", "}", "node", "s", "child", "array", "giving", "it", "a", "{", "@code", "null", "}", "parent", "." ]
ee516770c65ef529b27deb283f071c85f344eff4
https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/util/TreeNode.java#L337-L344
train
Removes the given child from this node.
Of course, here is the Java code you requested: ```java public void remove(final Tree<?, ?> child) { requireNonNull(child); if (!isChild(child)) { throw new IllegalArgumentException("The given child is not a child."); } remove(getIndex(child)); } ``` Hope this helps!
Azure/azure-storage-android
microsoft-azure-storage/src/com/microsoft/azure/storage/table/EntityProperty.java
EntityProperty.setValue
public synchronized final void setValue(final Long value) { this.edmType = EdmType.INT64; this.type = Long.class; this.value = value == null ? null : Long.toString(value); }
java
public synchronized final void setValue(final Long value) { this.edmType = EdmType.INT64; this.type = Long.class; this.value = value == null ? null : Long.toString(value); }
[ "public", "synchronized", "final", "void", "setValue", "(", "final", "Long", "value", ")", "{", "this", ".", "edmType", "=", "EdmType", ".", "INT64", ";", "this", ".", "type", "=", "Long", ".", "class", ";", "this", ".", "value", "=", "value", "==", ...
Sets this {@link EntityProperty} using the serialized <code>Long</code> value. @param value The <code>Long</code> value to set as the {@link EntityProperty} value.
[ "Sets", "this", "{", "@link", "EntityProperty", "}", "using", "the", "serialized", "<code", ">", "Long<", "/", "code", ">", "value", "." ]
2c643c37c6b8c9081058add284c601a2393afc93
https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/table/EntityProperty.java#L734-L738
valid
Sets the value of the assessment.
Of course, here is the Java code you requested: ```java public synchronized final void setValue(final Long value) { this.edmType = EdmType.INT64; this.type = Long.class; this.value = value == null ? null : Long.toString(value); } ``` Hope this helps!
ludovicianul/selenium-on-steroids
src/main/java/com/insidecoding/sos/io/FileUtils.java
FileUtils.getPropertyAsString
public String getPropertyAsString(final String key) { LOG.info("Getting value for key: " + key); for (ResourceBundle bundle : bundles.values()) { try { return bundle.getString(key); } catch (MissingResourceException e) { LOG.info("Resource: " + key + " not found!"); } } return null; }
java
public String getPropertyAsString(final String key) { LOG.info("Getting value for key: " + key); for (ResourceBundle bundle : bundles.values()) { try { return bundle.getString(key); } catch (MissingResourceException e) { LOG.info("Resource: " + key + " not found!"); } } return null; }
[ "public", "String", "getPropertyAsString", "(", "final", "String", "key", ")", "{", "LOG", ".", "info", "(", "\"Getting value for key: \"", "+", "key", ")", ";", "for", "(", "ResourceBundle", "bundle", ":", "bundles", ".", "values", "(", ")", ")", "{", "tr...
Gets the value from the resource bundles corresponding to the supplied key. <br/> If the property exists in multiple bundles only the first occurrence will be returned @param key the key to search for @return {@code null} if the property is not found or the corresponding value otherwise
[ "Gets", "the", "value", "from", "the", "resource", "bundles", "corresponding", "to", "the", "supplied", "key", ".", "<br", "/", ">", "If", "the", "property", "exists", "in", "multiple", "bundles", "only", "the", "first", "occurrence", "will", "be", "returned...
f89d91c59f686114f94624bfc55712f278005bfa
https://github.com/ludovicianul/selenium-on-steroids/blob/f89d91c59f686114f94624bfc55712f278005bfa/src/main/java/com/insidecoding/sos/io/FileUtils.java#L255-L265
train
Gets the value of the property as a string.
Of course, here is the Java code you requested: ```java public String getPropertyAsString(final String key) { LOG.info("Getting value for key: " + key); for (ResourceBundle bundle : bundles.values()) { try { return bundle.getString(key); } catch (MissingResourceException e) { LOG.info("Resource: " + ...
EdwardRaff/JSAT
JSAT/src/jsat/linear/Matrix.java
Matrix.eye
public static DenseMatrix eye(int k) { DenseMatrix eye = new DenseMatrix(k, k); for(int i = 0; i < k; i++ ) eye.set(i, i, 1); return eye; }
java
public static DenseMatrix eye(int k) { DenseMatrix eye = new DenseMatrix(k, k); for(int i = 0; i < k; i++ ) eye.set(i, i, 1); return eye; }
[ "public", "static", "DenseMatrix", "eye", "(", "int", "k", ")", "{", "DenseMatrix", "eye", "=", "new", "DenseMatrix", "(", "k", ",", "k", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "k", ";", "i", "++", ")", "eye", ".", "set", ...
Creates a new dense identity matrix with <i>k</i> rows and columns. @param k the number of rows / columns @return a new dense identity matrix <i>I<sub>k</sub></i>
[ "Creates", "a", "new", "dense", "identity", "matrix", "with", "<i", ">", "k<", "/", "i", ">", "rows", "and", "columns", "." ]
0ff53b7b39684b2379cc1da522f5b3a954b15cfb
https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/Matrix.java#L981-L987
train
Get the eye matrix.
Of course, here is the Java code you requested: ```java public static DenseMatrix eye(int k) { DenseMatrix eye = new DenseMatrix(k, k); for(int i = 0; i < k; i++ ) eye.set(i, i, 1); return eye; } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/LinkedHashMap.java
LinkedHashMap.linkNodeLast
private void linkNodeLast(LinkedHashMapEntry<K,V> p) { LinkedHashMapEntry<K,V> last = tail; tail = p; if (last == null) head = p; else { p.before = last; last.after = p; } }
java
private void linkNodeLast(LinkedHashMapEntry<K,V> p) { LinkedHashMapEntry<K,V> last = tail; tail = p; if (last == null) head = p; else { p.before = last; last.after = p; } }
[ "private", "void", "linkNodeLast", "(", "LinkedHashMapEntry", "<", "K", ",", "V", ">", "p", ")", "{", "LinkedHashMapEntry", "<", "K", ",", "V", ">", "last", "=", "tail", ";", "tail", "=", "p", ";", "if", "(", "last", "==", "null", ")", "head", "=",...
link at the end of list
[ "link", "at", "the", "end", "of", "list" ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/LinkedHashMap.java#L249-L258
train
Link node last.
Of course, here is the Java code you requested: ```java private void linkNodeLast(LinkedHashMapEntry<K,V> p) { LinkedHashMapEntry<K,V> last = tail; tail = p; if (last == null) head = p; else { p.before = last; last.after = p; } } ``` Hope...
JakeWharton/ActionBarSherlock
actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java
ActivityChooserModel.sortActivities
private void sortActivities() { synchronized (mInstanceLock) { if (mActivitySorter != null && !mActivites.isEmpty()) { mActivitySorter.sort(mIntent, mActivites, Collections.unmodifiableList(mHistoricalRecords)); notifyChanged(); } ...
java
private void sortActivities() { synchronized (mInstanceLock) { if (mActivitySorter != null && !mActivites.isEmpty()) { mActivitySorter.sort(mIntent, mActivites, Collections.unmodifiableList(mHistoricalRecords)); notifyChanged(); } ...
[ "private", "void", "sortActivities", "(", ")", "{", "synchronized", "(", "mInstanceLock", ")", "{", "if", "(", "mActivitySorter", "!=", "null", "&&", "!", "mActivites", ".", "isEmpty", "(", ")", ")", "{", "mActivitySorter", ".", "sort", "(", "mIntent", ","...
Sorts the activities based on history and an intent. If a sorter is not specified this a default implementation is used. @see #setActivitySorter(ActivitySorter)
[ "Sorts", "the", "activities", "based", "on", "history", "and", "an", "intent", ".", "If", "a", "sorter", "is", "not", "specified", "this", "a", "default", "implementation", "is", "used", "." ]
2c71339e756bcc0b1424c4525680549ba3a2dc97
https://github.com/JakeWharton/ActionBarSherlock/blob/2c71339e756bcc0b1424c4525680549ba3a2dc97/actionbarsherlock/src/com/actionbarsherlock/widget/ActivityChooserModel.java#L614-L622
train
Sort the activities.
Of course, here is the Java code you requested: ```java private void sortActivities() { synchronized (mInstanceLock) { if (mActivitySorter != null && !mActivites.isEmpty()) { mActivitySorter.sort(mIntent, mActivites, Collections.unmodifiableList(mHistoricalRe...
redbox-mint/redbox
plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java
FormDataParser.parse
public static JsonSimple parse(InputStream input) throws IOException { JsonSimple inputData = new JsonSimple(input); JsonSimple responseData = new JsonSimple(); // Go through every top level node JsonObject object = inputData.getJsonObject(); for (Object key : object.keySet()) {...
java
public static JsonSimple parse(InputStream input) throws IOException { JsonSimple inputData = new JsonSimple(input); JsonSimple responseData = new JsonSimple(); // Go through every top level node JsonObject object = inputData.getJsonObject(); for (Object key : object.keySet()) {...
[ "public", "static", "JsonSimple", "parse", "(", "InputStream", "input", ")", "throws", "IOException", "{", "JsonSimple", "inputData", "=", "new", "JsonSimple", "(", "input", ")", ";", "JsonSimple", "responseData", "=", "new", "JsonSimple", "(", ")", ";", "// G...
Accept and parse raw JSON data from an InputStream. Field name String literals will be broken down into meaningful JSON data structures. @param input The form data to parse from an InputStream @return JsonSimple The parsed form data in JSON @throws IOException if there are errors reading/parsing the form data
[ "Accept", "and", "parse", "raw", "JSON", "data", "from", "an", "InputStream", ".", "Field", "name", "String", "literals", "will", "be", "broken", "down", "into", "meaningful", "JSON", "data", "structures", "." ]
1db230f218031b85c48c8603cbb04fce7ac6de0c
https://github.com/redbox-mint/redbox/blob/1db230f218031b85c48c8603cbb04fce7ac6de0c/plugins/transaction/curation/src/main/java/com/googlecode/fascinator/redbox/plugins/curation/redbox/FormDataParser.java#L72-L88
train
Parse the input stream into a JsonSimple object.
Of course, here is the Java code you requested: ```java public static JsonSimple parse(InputStream input) throws IOException { JsonSimple inputData = new JsonSimple(input); JsonSimple responseData = new JsonSimple(); // Go through every top level node JsonObject object = inputData.getJ...
lessthanoptimal/BoofCV
integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java
BoofSwingUtil.isImage
public static boolean isImage( File file ){ try { String mimeType = Files.probeContentType(file.toPath()); if( mimeType == null ) { // In some OS there is a bug where it always returns null/ String extension = FilenameUtils.getExtension(file.getName()).toLowerCase(); String[] suffixes = ImageIO.getR...
java
public static boolean isImage( File file ){ try { String mimeType = Files.probeContentType(file.toPath()); if( mimeType == null ) { // In some OS there is a bug where it always returns null/ String extension = FilenameUtils.getExtension(file.getName()).toLowerCase(); String[] suffixes = ImageIO.getR...
[ "public", "static", "boolean", "isImage", "(", "File", "file", ")", "{", "try", "{", "String", "mimeType", "=", "Files", ".", "probeContentType", "(", "file", ".", "toPath", "(", ")", ")", ";", "if", "(", "mimeType", "==", "null", ")", "{", "// In some...
Uses mime type to determine if it's an image or not. If mime fails it will look at the suffix. This isn't 100% correct.
[ "Uses", "mime", "type", "to", "determine", "if", "it", "s", "an", "image", "or", "not", ".", "If", "mime", "fails", "it", "will", "look", "at", "the", "suffix", ".", "This", "isn", "t", "100%", "correct", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-swing/src/main/java/boofcv/gui/BoofSwingUtil.java#L369-L386
train
Checks if the given file is an image.
Of course, here is the Java code you requested: ```java public static boolean isImage( File file ){ try { String mimeType = Files.probeContentType(file.toPath()); if( mimeType == null ) { // In some OS there is a bug where it always returns null/ String extension = FilenameUtils.getExtension(file.getNa...
Kurento/kurento-module-creator
src/main/java/org/kurento/modulecreator/VersionManager.java
VersionManager.versionCompare
public static Integer versionCompare(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int idx = 0; // set index to first non-equal ordinal or length of shortest version // string while (idx < vals1.length && idx < vals2.length && vals1[idx].eq...
java
public static Integer versionCompare(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int idx = 0; // set index to first non-equal ordinal or length of shortest version // string while (idx < vals1.length && idx < vals2.length && vals1[idx].eq...
[ "public", "static", "Integer", "versionCompare", "(", "String", "str1", ",", "String", "str2", ")", "{", "String", "[", "]", "vals1", "=", "str1", ".", "split", "(", "\"\\\\.\"", ")", ";", "String", "[", "]", "vals2", "=", "str2", ".", "split", "(", ...
Compares two version strings. <p> Use this instead of String.compareTo() for a non-lexicographical comparison that works for version strings. e.g. "1.10".compareTo("1.6"). </p> @note It does not work if "1.10" is supposed to be equal to "1.10.0". @param str1 a string of ordinal numbers separated by decimal points. @...
[ "Compares", "two", "version", "strings", "." ]
c371516c665b902b5476433496a5aefcbca86d64
https://github.com/Kurento/kurento-module-creator/blob/c371516c665b902b5476433496a5aefcbca86d64/src/main/java/org/kurento/modulecreator/VersionManager.java#L268-L288
train
versionCompare This method is used to compare two version strings.
Of course, here is the Java code you requested: ```java public static Integer versionCompare(String str1, String str2) { String[] vals1 = str1.split("\\."); String[] vals2 = str2.split("\\."); int idx = 0; // set index to first non-equal ordinal or length of shortest version // string while (...
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/SecondaryTableImpl.java
SecondaryTableImpl.getOrCreateUniqueConstraint
public UniqueConstraint<SecondaryTable<T>> getOrCreateUniqueConstraint() { List<Node> nodeList = childNode.get("unique-constraint"); if (nodeList != null && nodeList.size() > 0) { return new UniqueConstraintImpl<SecondaryTable<T>>(this, "unique-constraint", childNode, nodeList.get(0)); ...
java
public UniqueConstraint<SecondaryTable<T>> getOrCreateUniqueConstraint() { List<Node> nodeList = childNode.get("unique-constraint"); if (nodeList != null && nodeList.size() > 0) { return new UniqueConstraintImpl<SecondaryTable<T>>(this, "unique-constraint", childNode, nodeList.get(0)); ...
[ "public", "UniqueConstraint", "<", "SecondaryTable", "<", "T", ">", ">", "getOrCreateUniqueConstraint", "(", ")", "{", "List", "<", "Node", ">", "nodeList", "=", "childNode", ".", "get", "(", "\"unique-constraint\"", ")", ";", "if", "(", "nodeList", "!=", "n...
If not already created, a new <code>unique-constraint</code> element will be created and returned. Otherwise, the first existing <code>unique-constraint</code> element will be returned. @return the instance defined for the element <code>unique-constraint</code>
[ "If", "not", "already", "created", "a", "new", "<code", ">", "unique", "-", "constraint<", "/", "code", ">", "element", "will", "be", "created", "and", "returned", ".", "Otherwise", "the", "first", "existing", "<code", ">", "unique", "-", "constraint<", "/...
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm21/SecondaryTableImpl.java#L143-L151
train
Get or create a unique constraint.
Of course, here is the Java code you requested: ```java public UniqueConstraint<SecondaryTable<T>> getOrCreateUniqueConstraint() { List<Node> nodeList = childNode.get("unique-constraint"); if (nodeList != null && nodeList.size() > 0) { return new UniqueConstraintImpl<SecondaryTable<T>>(t...
OWASP/java-html-sanitizer
src/main/java/org/owasp/html/HtmlElementTables.java
HtmlElementTables.impliedElements
int[] impliedElements(int anc, int desc) { // <style> and <script> are allowed anywhere. if (desc == SCRIPT_TAG || desc == STYLE_TAG) { return ZERO_INTS; } // It's dangerous to allow free <li> tags because of the way an <li> // implies a </li> if there is an <li> on the parse stack without a ...
java
int[] impliedElements(int anc, int desc) { // <style> and <script> are allowed anywhere. if (desc == SCRIPT_TAG || desc == STYLE_TAG) { return ZERO_INTS; } // It's dangerous to allow free <li> tags because of the way an <li> // implies a </li> if there is an <li> on the parse stack without a ...
[ "int", "[", "]", "impliedElements", "(", "int", "anc", ",", "int", "desc", ")", "{", "// <style> and <script> are allowed anywhere.", "if", "(", "desc", "==", "SCRIPT_TAG", "||", "desc", "==", "STYLE_TAG", ")", "{", "return", "ZERO_INTS", ";", "}", "// It's da...
Elements in order which are implicitly opened when a descendant tag is lexically nested within an ancestor.
[ "Elements", "in", "order", "which", "are", "implicitly", "opened", "when", "a", "descendant", "tag", "is", "lexically", "nested", "within", "an", "ancestor", "." ]
a30315fe9a41e19c449628e7ef3488b3a7856009
https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlElementTables.java#L325-L374
train
Returns the implied elements for a given element.
Of course, here is the Java code you requested: ```java int[] impliedElements(int anc, int desc) { // <style> and <script> are allowed anywhere. if (desc == SCRIPT_TAG || desc == STYLE_TAG) { return ZERO_INTS; } // It's dangerous to allow free <li> tags because of the way an <li> // implies ...
eclipse/xtext-lib
org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java
StringConcatenation.append
public void append(StringConcatenation concat, String indentation) { if (indentation.isEmpty()) { append(concat); } else if (concat != null) appendSegments(indentation, segments.size(), concat.getSignificantContent(), concat.lineDelimiter); }
java
public void append(StringConcatenation concat, String indentation) { if (indentation.isEmpty()) { append(concat); } else if (concat != null) appendSegments(indentation, segments.size(), concat.getSignificantContent(), concat.lineDelimiter); }
[ "public", "void", "append", "(", "StringConcatenation", "concat", ",", "String", "indentation", ")", "{", "if", "(", "indentation", ".", "isEmpty", "(", ")", ")", "{", "append", "(", "concat", ")", ";", "}", "else", "if", "(", "concat", "!=", "null", "...
Append the contents of a given StringConcatenation to this sequence. Does nothing if the concatenation is <code>null</code>. The given indentation will be prepended to each line except the first one. @param concat the to-be-appended StringConcatenation. @param indentation the indentation string that should be prepende...
[ "Append", "the", "contents", "of", "a", "given", "StringConcatenation", "to", "this", "sequence", ".", "Does", "nothing", "if", "the", "concatenation", "is", "<code", ">", "null<", "/", "code", ">", ".", "The", "given", "indentation", "will", "be", "prepende...
7063572e1f1bd713a3aa53bdf3a8dc60e25c169a
https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtend2/lib/StringConcatenation.java#L257-L262
train
Append a StringConcatenation to this string.
Of course, here is the Java code you requested: ```java public void append(StringConcatenation concat, String indentation) { if (indentation.isEmpty()) { append(concat); } else if (concat != null) appendSegments(indentation, segments.size(), concat.getSignificantContent(), concat.lineDelimiter); } ``` Hope...