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
jtrfp/javamod
src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v1Tag.java
ID3v1Tag.setArtist
public void setArtist(String newArtist) { if (newArtist.length() > ARTIST_SIZE) { artist = newArtist.substring(0, ARTIST_SIZE); } else { artist = newArtist; } }
java
public void setArtist(String newArtist) { if (newArtist.length() > ARTIST_SIZE) { artist = newArtist.substring(0, ARTIST_SIZE); } else { artist = newArtist; } }
[ "public", "void", "setArtist", "(", "String", "newArtist", ")", "{", "if", "(", "newArtist", ".", "length", "(", ")", ">", "ARTIST_SIZE", ")", "{", "artist", "=", "newArtist", ".", "substring", "(", "0", ",", "ARTIST_SIZE", ")", ";", "}", "else", "{", ...
Set the artist field of the tag. The maximum size of the String is 30. If the size exceeds the maximum size, the String will be truncated. @param newArtist the artist for the tag
[ "Set", "the", "artist", "field", "of", "the", "tag", ".", "The", "maximum", "size", "of", "the", "String", "is", "30", ".", "If", "the", "size", "exceeds", "the", "maximum", "size", "the", "String", "will", "be", "truncated", "." ]
cda4fe943a589dc49415f4413453e2eece72076a
https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mp3/id3/ID3v1Tag.java#L282-L292
train
Sets the artist of the image.
Of course, here is the Java code you requested: ```java public void setArtist(String newArtist) { if (newArtist.length() > ARTIST_SIZE) { artist = newArtist.substring(0, ARTIST_SIZE); } else { artist = newArtist; } } ``` Hope this helps!
LAW-Unimi/BUbiNG
src/it/unimi/di/law/warc/filters/DuplicateSegmentsLessThan.java
DuplicateSegmentsLessThan.apply
@Override public boolean apply(final URI url) { final String s = url.getRawPath(); final int length = s.length(); final boolean pathEndsWithSlash = s.charAt(length - 1) == '/'; final char[] path = new char[length + 1 + (! pathEndsWithSlash? 1 : 0)]; path[path.length - 1] = EXTRA_SYMBOL; // Usual suffix-arr...
java
@Override public boolean apply(final URI url) { final String s = url.getRawPath(); final int length = s.length(); final boolean pathEndsWithSlash = s.charAt(length - 1) == '/'; final char[] path = new char[length + 1 + (! pathEndsWithSlash? 1 : 0)]; path[path.length - 1] = EXTRA_SYMBOL; // Usual suffix-arr...
[ "@", "Override", "public", "boolean", "apply", "(", "final", "URI", "url", ")", "{", "final", "String", "s", "=", "url", ".", "getRawPath", "(", ")", ";", "final", "int", "length", "=", "s", ".", "length", "(", ")", ";", "final", "boolean", "pathEnds...
Apply the filter to a given URI @param url the URI to be filtered @return <code>true</code> if the path contains a number of duplicate segments less than a threshold
[ "Apply", "the", "filter", "to", "a", "given", "URI" ]
e148acc90031a4f3967422705a9fb07ddaf155e4
https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/filters/DuplicateSegmentsLessThan.java#L84-L275
train
Override the default implementation to perform the actual processing of the URI.
Of course, here is the Java code you requested: ```java @Override public boolean apply(final URI url) { final String s = url.getRawPath(); final int length = s.length(); final boolean pathEndsWithSlash = s.charAt(length - 1) == '/'; final char[] path = new char[length + 1 + (! pathEndsWithSlash? 1 : 0)]; ...
aehrc/snorocket
snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java
SnorocketOWLReasoner.getPendingAxiomAdditions
@Override public Set<OWLAxiom> getPendingAxiomAdditions() { Set<OWLAxiom> added = new HashSet<OWLAxiom>(); for (OWLOntologyChange change : rawChanges) { if (change instanceof AddAxiom) { added.add(change.getAxiom()); } } return added; ...
java
@Override public Set<OWLAxiom> getPendingAxiomAdditions() { Set<OWLAxiom> added = new HashSet<OWLAxiom>(); for (OWLOntologyChange change : rawChanges) { if (change instanceof AddAxiom) { added.add(change.getAxiom()); } } return added; ...
[ "@", "Override", "public", "Set", "<", "OWLAxiom", ">", "getPendingAxiomAdditions", "(", ")", "{", "Set", "<", "OWLAxiom", ">", "added", "=", "new", "HashSet", "<", "OWLAxiom", ">", "(", ")", ";", "for", "(", "OWLOntologyChange", "change", ":", "rawChanges...
Gets the axioms that as a result of ontology changes need to be added to the reasoner to synchronise it with the root ontology imports closure. If the buffering mode is {@link org.semanticweb.owlapi.reasoner.BufferingMode#NON_BUFFERING} then there will be no pending axiom additions. @return The set of axioms that need...
[ "Gets", "the", "axioms", "that", "as", "a", "result", "of", "ontology", "changes", "need", "to", "be", "added", "to", "the", "reasoner", "to", "synchronise", "it", "with", "the", "root", "ontology", "imports", "closure", ".", "If", "the", "buffering", "mod...
e33c1e216f8a66d6502e3a14e80876811feedd8b
https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L486-L495
train
Gets the pending axiom additions.
Of course, here is the Java code you requested: ```java @Override public Set<OWLAxiom> getPendingAxiomAdditions() { Set<OWLAxiom> added = new HashSet<OWLAxiom>(); for (OWLOntologyChange change : rawChanges) { if (change instanceof AddAxiom) { added.add(change.getAxi...
susom/database
src/main/java/com/github/susom/database/DatabaseProvider.java
DatabaseProvider.fromProperties
public static Builder fromProperties(Properties properties, String propertyPrefix) { return fromProperties(properties, propertyPrefix, false); }
java
public static Builder fromProperties(Properties properties, String propertyPrefix) { return fromProperties(properties, propertyPrefix, false); }
[ "public", "static", "Builder", "fromProperties", "(", "Properties", "properties", ",", "String", "propertyPrefix", ")", "{", "return", "fromProperties", "(", "properties", ",", "propertyPrefix", ",", "false", ")", ";", "}" ]
Configure the database from up to five properties read from the provided properties: <br/> <pre> database.url=... Database connect string (required) database.user=... Authenticate as this user (optional if provided in url) database.password=... User password (optional if user and password provided in url; prom...
[ "Configure", "the", "database", "from", "up", "to", "five", "properties", "read", "from", "the", "provided", "properties", ":", "<br", "/", ">", "<pre", ">", "database", ".", "url", "=", "...", "Database", "connect", "string", "(", "required", ")", "databa...
25add9e08ad863712f9b5e319b6cb826f6f97640
https://github.com/susom/database/blob/25add9e08ad863712f9b5e319b6cb826f6f97640/src/main/java/com/github/susom/database/DatabaseProvider.java#L394-L396
train
Create a new CID from properties.
Of course, here is the Java code you requested: ```java public static Builder fromProperties(Properties properties, String propertyPrefix) { return fromProperties(properties, propertyPrefix, false); } ``` Hope this helps!
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSContentProvider.java
DFSContentProvider.inputChanged
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { this.viewer = viewer; if ((viewer != null) && (viewer instanceof StructuredViewer)) this.sviewer = (StructuredViewer) viewer; else this.sviewer = null; }
java
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { this.viewer = viewer; if ((viewer != null) && (viewer instanceof StructuredViewer)) this.sviewer = (StructuredViewer) viewer; else this.sviewer = null; }
[ "public", "void", "inputChanged", "(", "Viewer", "viewer", ",", "Object", "oldInput", ",", "Object", "newInput", ")", "{", "this", ".", "viewer", "=", "viewer", ";", "if", "(", "(", "viewer", "!=", "null", ")", "&&", "(", "viewer", "instanceof", "Structu...
/* @inheritDoc
[ "/", "*" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSContentProvider.java#L195-L201
train
Called when the input of a CRAML element is changed.
Of course, here is the Java code you requested: ```java public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { this.viewer = viewer; if ((viewer != null) && (viewer instanceof StructuredViewer)) this.sviewer = (StructuredViewer) viewer; else this.sviewer = null; } ``` Ho...
aws/aws-sdk-java
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java
AWSOpsWorksClient.registerInstance
@Override public RegisterInstanceResult registerInstance(RegisterInstanceRequest request) { request = beforeClientExecution(request); return executeRegisterInstance(request); }
java
@Override public RegisterInstanceResult registerInstance(RegisterInstanceRequest request) { request = beforeClientExecution(request); return executeRegisterInstance(request); }
[ "@", "Override", "public", "RegisterInstanceResult", "registerInstance", "(", "RegisterInstanceRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeRegisterInstance", "(", "request", ")", ";", "}" ]
<p> Registers instances that were created outside of AWS OpsWorks Stacks with a specified stack. </p> <note> <p> We do not recommend using this action to register instances. The complete registration operation includes two tasks: installing the AWS OpsWorks Stacks agent on the instance, and registering the instance wit...
[ "<p", ">", "Registers", "instances", "that", "were", "created", "outside", "of", "AWS", "OpsWorks", "Stacks", "with", "a", "specified", "stack", ".", "<", "/", "p", ">", "<note", ">", "<p", ">", "We", "do", "not", "recommend", "using", "this", "action", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java#L3797-L3801
train
Registers an instance with AWS Identity Public Cloud.
Of course, here is the Java code you requested: ```java @Override public RegisterInstanceResult registerInstance(RegisterInstanceRequest request) { request = beforeClientExecution(request); return executeRegisterInstance(request); } ``` Hope this helps!
acromusashi/acromusashi-stream-ml
src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java
LofCalculator.calculateLofWithoutUpdate
public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet) { // 対象点のK距離、K距離近傍を算出する。 KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet); LofPoint tmpPoint = targetPoint.deepCopy(); tmpPoint.setkDistance(kResult.getkDistance())...
java
public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet) { // 対象点のK距離、K距離近傍を算出する。 KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet); LofPoint tmpPoint = targetPoint.deepCopy(); tmpPoint.setkDistance(kResult.getkDistance())...
[ "public", "static", "double", "calculateLofWithoutUpdate", "(", "int", "kn", ",", "LofPoint", "targetPoint", ",", "LofDataSet", "dataSet", ")", "{", "// 対象点のK距離、K距離近傍を算出する。", "KDistanceResult", "kResult", "=", "calculateKDistance", "(", "kn", ",", "targetPoint", ",", ...
指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br> 本メソッド呼び出しによってデータセットの更新は行われない。<br> 学習データの更新を伴わないため、高速に処理が可能となっている。 @param kn K値 @param targetPoint 対象点 @param dataSet 学習データセット @return LOFスコア
[ "指定したK値、対象点、データセットを基に局所外れ係数スコアを算出する。<br", ">", "本メソッド呼び出しによってデータセットの更新は行われない。<br", ">", "学習データの更新を伴わないため、高速に処理が可能となっている。" ]
26d6799a917cacda68e21d506c75cfeb17d832a6
https://github.com/acromusashi/acromusashi-stream-ml/blob/26d6799a917cacda68e21d506c75cfeb17d832a6/src/main/java/acromusashi/stream/ml/anomaly/lof/LofCalculator.java#L117-L131
train
Calculate the lof without updating the lof.
Of course, here is the Java code you requested: ```java public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet) { // 対象点のK距離、K距離近傍を算出する。 KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet); LofPoint tmpPoint = targetPoint.deepCopy...
fabiomaffioletti/jsondoc
jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringConsumesBuilder.java
SpringConsumesBuilder.buildConsumes
public static Set<String> buildConsumes(Method method) { Set<String> consumes = new LinkedHashSet<String>(); Class<?> controller = method.getDeclaringClass(); if (isAnnotated(controller, RequestMapping.class)) { RequestMapping requestMapping = getAnnotation(controller, RequestMapping.class); if (requestMap...
java
public static Set<String> buildConsumes(Method method) { Set<String> consumes = new LinkedHashSet<String>(); Class<?> controller = method.getDeclaringClass(); if (isAnnotated(controller, RequestMapping.class)) { RequestMapping requestMapping = getAnnotation(controller, RequestMapping.class); if (requestMap...
[ "public", "static", "Set", "<", "String", ">", "buildConsumes", "(", "Method", "method", ")", "{", "Set", "<", "String", ">", "consumes", "=", "new", "LinkedHashSet", "<", "String", ">", "(", ")", ";", "Class", "<", "?", ">", "controller", "=", "method...
From Spring's documentation: [consumes is] supported at the type level as well as at the method level! When used at the type level, all method-level mappings override this consumes restriction. @param method @return
[ "From", "Spring", "s", "documentation", ":", "[", "consumes", "is", "]", "supported", "at", "the", "type", "level", "as", "well", "as", "at", "the", "method", "level!", "When", "used", "at", "the", "type", "level", "all", "method", "-", "level", "mapping...
26bf413c236e7c3b66f534c2451b157783c1f45e
https://github.com/fabiomaffioletti/jsondoc/blob/26bf413c236e7c3b66f534c2451b157783c1f45e/jsondoc-springmvc/src/main/java/org/jsondoc/springmvc/scanner/builder/SpringConsumesBuilder.java#L22-L46
train
Build the list of consumes for a method
Of course, here is the Java code you requested: ```java public static Set<String> buildConsumes(Method method) { Set<String> consumes = new LinkedHashSet<String>(); Class<?> controller = method.getDeclaringClass(); if (isAnnotated(controller, RequestMapping.class)) { RequestMapping requestMapping = getAnnota...
samskivert/samskivert
src/main/java/com/samskivert/jdbc/jora/Table.java
Table.select
public final Cursor<T> select (Connection conn, String tables, String condition) { String query = "select " + qualifiedListOfFields + " from " + name + "," + tables + " " + condition; return new Cursor<T>(this, conn, query); }
java
public final Cursor<T> select (Connection conn, String tables, String condition) { String query = "select " + qualifiedListOfFields + " from " + name + "," + tables + " " + condition; return new Cursor<T>(this, conn, query); }
[ "public", "final", "Cursor", "<", "T", ">", "select", "(", "Connection", "conn", ",", "String", "tables", ",", "String", "condition", ")", "{", "String", "query", "=", "\"select \"", "+", "qualifiedListOfFields", "+", "\" from \"", "+", "name", "+", "\",\"",...
Select records from database table according to search condition including the specified (comma separated) extra tables into the SELECT clause to facilitate a join in determining the key. @param tables the (comma separated) names of extra tables to include in the SELECT clause. @param condition valid SQL condition exp...
[ "Select", "records", "from", "database", "table", "according", "to", "search", "condition", "including", "the", "specified", "(", "comma", "separated", ")", "extra", "tables", "into", "the", "SELECT", "clause", "to", "facilitate", "a", "join", "in", "determining...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/jora/Table.java#L115-L121
train
Returns a cursor of the records in the database.
Of course, here is the Java code you requested: ```java public final Cursor<T> select (Connection conn, String tables, String condition) { String query = "select " + qualifiedListOfFields + " from " + name + "," + tables + " " + condition; return new C...
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/AtomicGrowingMatrix.java
AtomicGrowingMatrix.getColumnVectorUnsafe
public DoubleVector getColumnVectorUnsafe(int column) { checkIndices(0, column); DoubleVector values = new DenseVector(rows.get()); for (int row = 0; row < rows.get(); ++row) { AtomicVector rowEntry = getRow(row, -1, false); double value = 0; if (r...
java
public DoubleVector getColumnVectorUnsafe(int column) { checkIndices(0, column); DoubleVector values = new DenseVector(rows.get()); for (int row = 0; row < rows.get(); ++row) { AtomicVector rowEntry = getRow(row, -1, false); double value = 0; if (r...
[ "public", "DoubleVector", "getColumnVectorUnsafe", "(", "int", "column", ")", "{", "checkIndices", "(", "0", ",", "column", ")", ";", "DoubleVector", "values", "=", "new", "DenseVector", "(", "rows", ".", "get", "(", ")", ")", ";", "for", "(", "int", "ro...
Returns an immutable view of the columns's data as a non-atomic vector, which may present an inconsistent view of the data if this matrix is being concurrently modified. This method should only be used in special cases where the vector is being accessed at a time when the matrix (or this particular row) will not be mo...
[ "Returns", "an", "immutable", "view", "of", "the", "columns", "s", "data", "as", "a", "non", "-", "atomic", "vector", "which", "may", "present", "an", "inconsistent", "view", "of", "the", "data", "if", "this", "matrix", "is", "being", "concurrently", "modi...
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/AtomicGrowingMatrix.java#L191-L201
train
Get the vector of values of a column.
Of course, here is the Java code you requested: ```java public DoubleVector getColumnVectorUnsafe(int column) { checkIndices(0, column); DoubleVector values = new DenseVector(rows.get()); for (int row = 0; row < rows.get(); ++row) { AtomicVector rowEntry = getRow(row, -1, false); ...
kkopacz/agiso-tempel
bundles/tempel-core/src/main/java/org/agiso/tempel/core/validator/DefaultParamValidator.java
DefaultParamValidator.validate
@Override public boolean validate(Object value) { if(constraints == null) { return false; } IConstraintChecker checker; for(BeanProperty constraint : constraints) { checker = checkers.get(constraint.getPropertyName()); if(checker == null) { throw new RuntimeException("No checker found for constra...
java
@Override public boolean validate(Object value) { if(constraints == null) { return false; } IConstraintChecker checker; for(BeanProperty constraint : constraints) { checker = checkers.get(constraint.getPropertyName()); if(checker == null) { throw new RuntimeException("No checker found for constra...
[ "@", "Override", "public", "boolean", "validate", "(", "Object", "value", ")", "{", "if", "(", "constraints", "==", "null", ")", "{", "return", "false", ";", "}", "IConstraintChecker", "checker", ";", "for", "(", "BeanProperty", "constraint", ":", "constrain...
--------------------------------------------------------------------------
[ "--------------------------------------------------------------------------" ]
ff7a96153153b6bc07212d776816b87d9538f6fa
https://github.com/kkopacz/agiso-tempel/blob/ff7a96153153b6bc07212d776816b87d9538f6fa/bundles/tempel-core/src/main/java/org/agiso/tempel/core/validator/DefaultParamValidator.java#L51-L68
train
Validate the value.
Of course, here is the Java code you requested: ```java @Override public boolean validate(Object value) { if(constraints == null) { return false; } IConstraintChecker checker; for(BeanProperty constraint : constraints) { checker = checkers.get(constraint.getPropertyName()); if(checker == null) { ...
tango-controls/JTango
dao/src/main/java/fr/esrf/TangoApi/events/EventConsumerUtil.java
EventConsumerUtil.unsubscribe_event
public void unsubscribe_event(int event_id) throws DevFailed { // Get the map Hashtable<String, EventCallBackStruct> callBackMap = EventConsumer.getEventCallbackMap(); // Get the callback structure EventCallBackStruct callbackStruct = EventConsumer.get...
java
public void unsubscribe_event(int event_id) throws DevFailed { // Get the map Hashtable<String, EventCallBackStruct> callBackMap = EventConsumer.getEventCallbackMap(); // Get the callback structure EventCallBackStruct callbackStruct = EventConsumer.get...
[ "public", "void", "unsubscribe_event", "(", "int", "event_id", ")", "throws", "DevFailed", "{", "// Get the map", "Hashtable", "<", "String", ",", "EventCallBackStruct", ">", "callBackMap", "=", "EventConsumer", ".", "getEventCallbackMap", "(", ")", ";", "// Get t...
===============================================================
[ "===============================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/dao/src/main/java/fr/esrf/TangoApi/events/EventConsumerUtil.java#L320-L333
train
Unsubscribe an event
Of course, here is the Java code you requested: ```java public void unsubscribe_event(int event_id) throws DevFailed { // Get the map Hashtable<String, EventCallBackStruct> callBackMap = EventConsumer.getEventCallbackMap(); // Get the callback structure EventCallBack...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3outputStreamWriter.java
N3outputStreamWriter.writeDataAll
public void writeDataAll(DataOutputStream stream) throws IOException { for (Vinfo vinfo : vinfoList) { if (!vinfo.isRecord) { Variable v = vinfo.v; assert filePos == vinfo.offset; if (debugPos) System.out.println(" writing at "+filePos+" should be "+vinfo.offset+" "+v.getFullName()); ...
java
public void writeDataAll(DataOutputStream stream) throws IOException { for (Vinfo vinfo : vinfoList) { if (!vinfo.isRecord) { Variable v = vinfo.v; assert filePos == vinfo.offset; if (debugPos) System.out.println(" writing at "+filePos+" should be "+vinfo.offset+" "+v.getFullName()); ...
[ "public", "void", "writeDataAll", "(", "DataOutputStream", "stream", ")", "throws", "IOException", "{", "for", "(", "Vinfo", "vinfo", ":", "vinfoList", ")", "{", "if", "(", "!", "vinfo", ".", "isRecord", ")", "{", "Variable", "v", "=", "vinfo", ".", "v",...
////////////////////////////////////////////////////////////////////////////////////////////////
[ "////////////////////////////////////////////////////////////////////////////////////////////////" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3outputStreamWriter.java#L32-L85
test
Write all the data in the file to the output stream.
Of course, here is the Java code you requested: ```java public void writeDataAll(DataOutputStream stream) throws IOException { for (Vinfo vinfo : vinfoList) { if (!vinfo.isRecord) { Variable v = vinfo.v; assert filePos == vinfo.offset; if (debugPos) System.out.println(" writing at "+f...
sonyxperiadev/gerrit-events
src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java
GerritHandler.setThreadKeepAliveTime
public void setThreadKeepAliveTime(int threadKeepAliveTime) { this.threadKeepAliveTime = Math.max(MIN_RECEIVE_THREAD_KEEP_ALIVE_TIME, threadKeepAliveTime); executor.setKeepAliveTime(threadKeepAliveTime, TimeUnit.SECONDS); }
java
public void setThreadKeepAliveTime(int threadKeepAliveTime) { this.threadKeepAliveTime = Math.max(MIN_RECEIVE_THREAD_KEEP_ALIVE_TIME, threadKeepAliveTime); executor.setKeepAliveTime(threadKeepAliveTime, TimeUnit.SECONDS); }
[ "public", "void", "setThreadKeepAliveTime", "(", "int", "threadKeepAliveTime", ")", "{", "this", ".", "threadKeepAliveTime", "=", "Math", ".", "max", "(", "MIN_RECEIVE_THREAD_KEEP_ALIVE_TIME", ",", "threadKeepAliveTime", ")", ";", "executor", ".", "setKeepAliveTime", ...
Sets the number of seconds threads well be kept alive. @param threadKeepAliveTime number of seconds
[ "Sets", "the", "number", "of", "seconds", "threads", "well", "be", "kept", "alive", "." ]
9a443d13dded85cc4709136ac33989f2bbb34fe2
https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritHandler.java#L435-L438
train
Sets the thread keep alive time.
Of course, here is the Java code you requested: ```java public void setThreadKeepAliveTime(int threadKeepAliveTime) { this.threadKeepAliveTime = Math.max(MIN_RECEIVE_THREAD_KEEP_ALIVE_TIME, threadKeepAliveTime); executor.setKeepAliveTime(threadKeepAliveTime, TimeUnit.SECONDS); } ``` Hope this help...
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.getDirectoriesFromJar
public static Set<Path> getDirectoriesFromJar(Path pathToJarFile) throws IOException { Set<Path> result = new HashSet<Path>(); ZipFile jarfile = new ZipFile(pathToJarFile.toFile()); try { final Enumeration<? extends ZipEntry> entries = jarfile.entries(); while (entries.ha...
java
public static Set<Path> getDirectoriesFromJar(Path pathToJarFile) throws IOException { Set<Path> result = new HashSet<Path>(); ZipFile jarfile = new ZipFile(pathToJarFile.toFile()); try { final Enumeration<? extends ZipEntry> entries = jarfile.entries(); while (entries.ha...
[ "public", "static", "Set", "<", "Path", ">", "getDirectoriesFromJar", "(", "Path", "pathToJarFile", ")", "throws", "IOException", "{", "Set", "<", "Path", ">", "result", "=", "new", "HashSet", "<", "Path", ">", "(", ")", ";", "ZipFile", "jarfile", "=", "...
Get all of the directory paths in a zip/jar file @param pathToJarFile location of the jarfile. can also be a zipfile @return set of directory paths relative to the root of the jar
[ "Get", "all", "of", "the", "directory", "paths", "in", "a", "zip", "/", "jar", "file" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L136-L152
train
Get all directories from a jar file.
Of course, here is the Java code you requested: ```java public static Set<Path> getDirectoriesFromJar(Path pathToJarFile) throws IOException { Set<Path> result = new HashSet<Path>(); ZipFile jarfile = new ZipFile(pathToJarFile.toFile()); try { final Enumeration<? extends ZipEntry> e...
citygml4j/citygml4j
src-gen/main/java/net/opengis/citygml/_1/ObjectFactory.java
ObjectFactory.createCityObjectMember
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/1.0", name = "cityObjectMember", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "featureMember") public JAXBElement<FeaturePropertyType> createCityObjectMember(FeaturePropertyType value) { return new JAXBElement<Fe...
java
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/1.0", name = "cityObjectMember", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "featureMember") public JAXBElement<FeaturePropertyType> createCityObjectMember(FeaturePropertyType value) { return new JAXBElement<Fe...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/citygml/1.0\"", ",", "name", "=", "\"cityObjectMember\"", ",", "substitutionHeadNamespace", "=", "\"http://www.opengis.net/gml\"", ",", "substitutionHeadName", "=", "\"featureMember\"", ")", "public", "JA...
Create an instance of {@link JAXBElement }{@code <}{@link FeaturePropertyType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link FeaturePropertyType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "FeaturePropertyType", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/citygml/_1/ObjectFactory.java#L159-L162
train
Create an instance of the cityObjectMember property.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/citygml/1.0", name = "cityObjectMember", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "featureMember") public JAXBElement<FeaturePropertyType> createCityObjectMember(Featu...
op4j/op4j-jodatime
src/main/java/org/op4j/jodatime/functions/FnJodaTimeUtils.java
FnJodaTimeUtils.calendarFieldArrayToInterval
public static final <T extends Calendar> Function<T[], Interval> calendarFieldArrayToInterval(Chronology chronology) { return FnInterval.calendarFieldArrayToInterval(chronology); }
java
public static final <T extends Calendar> Function<T[], Interval> calendarFieldArrayToInterval(Chronology chronology) { return FnInterval.calendarFieldArrayToInterval(chronology); }
[ "public", "static", "final", "<", "T", "extends", "Calendar", ">", "Function", "<", "T", "[", "]", ",", "Interval", ">", "calendarFieldArrayToInterval", "(", "Chronology", "chronology", ")", "{", "return", "FnInterval", ".", "calendarFieldArrayToInterval", "(", ...
<p> It creates an {@link Interval} from the input {@link Calendar} targets representing the start and end. The {@link Interval} will be created with the given {@link Chronology} </p> @param chronology {@link Chronology} to be used @return the {@link Interval} created from the input and arguments
[ "<p", ">", "It", "creates", "an", "{", "@link", "Interval", "}", "from", "the", "input", "{", "@link", "Calendar", "}", "targets", "representing", "the", "start", "and", "end", ".", "The", "{", "@link", "Interval", "}", "will", "be", "created", "with", ...
26e5b8cda8553fb3b5a4a64b3109dbbf5df21194
https://github.com/op4j/op4j-jodatime/blob/26e5b8cda8553fb3b5a4a64b3109dbbf5df21194/src/main/java/org/op4j/jodatime/functions/FnJodaTimeUtils.java#L2071-L2073
train
Convert an array of calendar fields to an interval.
Of course, here is the Java code you requested: ```java public static final <T extends Calendar> Function<T[], Interval> calendarFieldArrayToInterval(Chronology chronology) { return FnInterval.calendarFieldArrayToInterval(chronology); } ``` Hope this helps!
ist-dresden/composum
sling/core/usermgnt/src/main/java/com/composum/sling/core/usermanagement/core/UserMgmtServiceImpl.java
UserMgmtServiceImpl.getOrCreateUser
public Authorizable getOrCreateUser(JackrabbitSession session, UserManager userManager, String path, boolean systemUser) throws RepositoryException { String[] pathAndName = pathAndName(path); Authorizable user = userManager.getAuthorizable(pathAndName[...
java
public Authorizable getOrCreateUser(JackrabbitSession session, UserManager userManager, String path, boolean systemUser) throws RepositoryException { String[] pathAndName = pathAndName(path); Authorizable user = userManager.getAuthorizable(pathAndName[...
[ "public", "Authorizable", "getOrCreateUser", "(", "JackrabbitSession", "session", ",", "UserManager", "userManager", ",", "String", "path", ",", "boolean", "systemUser", ")", "throws", "RepositoryException", "{", "String", "[", "]", "pathAndName", "=", "pathAndName", ...
Retrieves a user by its name; if the user doesn't exist the user will be created. @param path the name of the user with an optional prepended intermediate path for user creation
[ "Retrieves", "a", "user", "by", "its", "name", ";", "if", "the", "user", "doesn", "t", "exist", "the", "user", "will", "be", "created", "." ]
ebc79f559f6022c935240c19102539bdfb1bd1e2
https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/usermgnt/src/main/java/com/composum/sling/core/usermanagement/core/UserMgmtServiceImpl.java#L29-L52
train
Gets the user from the UserManager.
Of course, here is the Java code you requested: ```java public Authorizable getOrCreateUser(JackrabbitSession session, UserManager userManager, String path, boolean systemUser) throws RepositoryException { String[] pathAndName = pathAndName(path); Aut...
jcodec/jcodec
src/main/java/org/jcodec/movtool/InplaceMP4Editor.java
InplaceMP4Editor.modify
public boolean modify(File file, MP4Edit edit) throws IOException { SeekableByteChannel fi = null; try { fi = NIOUtils.rwChannel(file); List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit); if (fragments == null) return false; ...
java
public boolean modify(File file, MP4Edit edit) throws IOException { SeekableByteChannel fi = null; try { fi = NIOUtils.rwChannel(file); List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit); if (fragments == null) return false; ...
[ "public", "boolean", "modify", "(", "File", "file", ",", "MP4Edit", "edit", ")", "throws", "IOException", "{", "SeekableByteChannel", "fi", "=", "null", ";", "try", "{", "fi", "=", "NIOUtils", ".", "rwChannel", "(", "file", ")", ";", "List", "<", "Tuple"...
Tries to modify movie header in place according to what's implemented in the edit, the file gets pysically modified if the operation is successful. No temporary file is created. @param file A file to be modified @param edit An edit to be carried out on a movie header @return Whether or not edit was successful, i.e. wa...
[ "Tries", "to", "modify", "movie", "header", "in", "place", "according", "to", "what", "s", "implemented", "in", "the", "edit", "the", "file", "gets", "pysically", "modified", "if", "the", "operation", "is", "successful", ".", "No", "temporary", "file", "is",...
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/movtool/InplaceMP4Editor.java#L59-L78
test
Modify the file.
Of course, here is the Java code you requested: ```java public boolean modify(File file, MP4Edit edit) throws IOException { SeekableByteChannel fi = null; try { fi = NIOUtils.rwChannel(file); List<Tuple._2<Atom, ByteBuffer>> fragments = doTheFix(fi, edit); if (fragm...
BlueBrain/bluima
modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/annotationviewer/BlueAnnotationViewGenerator.java
BlueAnnotationViewGenerator.autoGenerateStyleMap
public static String autoGenerateStyleMap(TypeSystemDescription aTypeSystem) { // styles used in automatically generated style maps final String[] STYLES = { "color:black; background:lightblue;", "color:black; background:lightgreen;", "color:black; background:orange;", "color:black; background:yellow;", "col...
java
public static String autoGenerateStyleMap(TypeSystemDescription aTypeSystem) { // styles used in automatically generated style maps final String[] STYLES = { "color:black; background:lightblue;", "color:black; background:lightgreen;", "color:black; background:orange;", "color:black; background:yellow;", "col...
[ "public", "static", "String", "autoGenerateStyleMap", "(", "TypeSystemDescription", "aTypeSystem", ")", "{", "// styles used in automatically generated style maps", "final", "String", "[", "]", "STYLES", "=", "{", "\"color:black; background:lightblue;\"", ",", "\"color:black; b...
Automatically generates a style map for the given type system. The style map will be returned as an XML string. @param aTypeSystem the type system for which a style map will be generated @return a String containing the XML style map
[ "Automatically", "generates", "a", "style", "map", "for", "the", "given", "type", "system", ".", "The", "style", "map", "will", "be", "returned", "as", "an", "XML", "string", "." ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_utils/src/main/java/ch/epfl/bbp/uima/annotationviewer/BlueAnnotationViewGenerator.java#L321-L371
train
Generate a style map for the given type system.
Of course, here is the Java code you requested: ```java public static String autoGenerateStyleMap(TypeSystemDescription aTypeSystem) { // styles used in automatically generated style maps final String[] STYLES = { "color:black; background:lightblue;", "color:black; background:lightgreen;", "color:black; backgro...
landawn/AbacusUtil
src/com/landawn/abacus/util/StringUtil.java
StringUtil.createInteger
public static OptionalInt createInteger(final String str) { if (N.isNullOrEmpty(str)) { return OptionalInt.empty(); } try { return OptionalInt.of(Integer.decode(str)); } catch (NumberFormatException e) { return OptionalInt.empty(); } ...
java
public static OptionalInt createInteger(final String str) { if (N.isNullOrEmpty(str)) { return OptionalInt.empty(); } try { return OptionalInt.of(Integer.decode(str)); } catch (NumberFormatException e) { return OptionalInt.empty(); } ...
[ "public", "static", "OptionalInt", "createInteger", "(", "final", "String", "str", ")", "{", "if", "(", "N", ".", "isNullOrEmpty", "(", "str", ")", ")", "{", "return", "OptionalInt", ".", "empty", "(", ")", ";", "}", "try", "{", "return", "OptionalInt", ...
<p> Convert a <code>String</code> to a <code>Integer</code>, handling hex (0xhhhh) and octal (0dddd) notations. N.B. a leading zero means octal; spaces are not trimmed. </p> <p> Returns an empty {@code OptionalInt} if the string is {@code null} or can't be parsed as {@code Integer}. </p> @param str a <code>String</co...
[ "<p", ">", "Convert", "a", "<code", ">", "String<", "/", "code", ">", "to", "a", "<code", ">", "Integer<", "/", "code", ">", "handling", "hex", "(", "0xhhhh", ")", "and", "octal", "(", "0dddd", ")", "notations", ".", "N", ".", "B", ".", "a", "lea...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L6094-L6104
train
Creates an OptionalInt from the given String.
Of course, here is the Java code you requested: ```java public static OptionalInt createInteger(final String str) { if (N.isNullOrEmpty(str)) { return OptionalInt.empty(); } try { return OptionalInt.of(Integer.decode(str)); } catch (NumberFormatException ...
alkacon/opencms-core
src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHelper.java
CmsImageCacheHelper.visitImage
private void visitImage(CmsObject cms, File f, boolean withVariations, boolean showSize, boolean statsOnly) { m_variationsCount++; m_variationsSize += f.length(); String oName = f.getAbsolutePath().substring(CmsImageLoader.getImageRepositoryPath().length()); oName = CmsStringUtil.substi...
java
private void visitImage(CmsObject cms, File f, boolean withVariations, boolean showSize, boolean statsOnly) { m_variationsCount++; m_variationsSize += f.length(); String oName = f.getAbsolutePath().substring(CmsImageLoader.getImageRepositoryPath().length()); oName = CmsStringUtil.substi...
[ "private", "void", "visitImage", "(", "CmsObject", "cms", ",", "File", "f", ",", "boolean", "withVariations", ",", "boolean", "showSize", ",", "boolean", "statsOnly", ")", "{", "m_variationsCount", "++", ";", "m_variationsSize", "+=", "f", ".", "length", "(", ...
Visits a single image.<p> @param cms CmsObject @param f a File to be read out @param withVariations boolean @param showSize boolean @param statsOnly boolean
[ "Visits", "a", "single", "image", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/cacheadmin/CmsImageCacheHelper.java#L271-L348
train
Visit an image.
Of course, here is the Java code you requested: ```java private void visitImage(CmsObject cms, File f, boolean withVariations, boolean showSize, boolean statsOnly) { m_variationsCount++; m_variationsSize += f.length(); String oName = f.getAbsolutePath().substring(CmsImageLoader.getImageReposit...
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleLimitedScrollArea.java
SampleLimitedScrollArea.onCreateOptionsMenu
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.add(0, MENU_LIMIT_SCROLLING_LAT_ID, Menu.NONE, "Latitude: Limit scrolling").setCheckable(true); menu.add(0, MENU_LIMIT_SCROLLING_LNG_ID, Menu.NONE, "Longitude: Limit scrolling").setCheckable(true); super.onCreateOptionsMenu(menu,...
java
@Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.add(0, MENU_LIMIT_SCROLLING_LAT_ID, Menu.NONE, "Latitude: Limit scrolling").setCheckable(true); menu.add(0, MENU_LIMIT_SCROLLING_LNG_ID, Menu.NONE, "Longitude: Limit scrolling").setCheckable(true); super.onCreateOptionsMenu(menu,...
[ "@", "Override", "public", "void", "onCreateOptionsMenu", "(", "Menu", "menu", ",", "MenuInflater", "inflater", ")", "{", "menu", ".", "add", "(", "0", ",", "MENU_LIMIT_SCROLLING_LAT_ID", ",", "Menu", ".", "NONE", ",", "\"Latitude: Limit scrolling\"", ")", ".", ...
===========================================================
[ "===========================================================" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleLimitedScrollArea.java#L138-L144
train
Override onCreateOptionsMenu to add additional options to the menu.
Of course, here is the Java code you requested: ```java @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { menu.add(0, MENU_LIMIT_SCROLLING_LAT_ID, Menu.NONE, "Latitude: Limit scrolling").setCheckable(true); menu.add(0, MENU_LIMIT_SCROLLING_LNG_ID, Menu.NONE, "Longitude: Limit scrolling...
jhg023/SimpleNet
src/main/java/simplenet/Server.java
Server.writeHelper
private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) { var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.size())); toExclude.addAll(clients); connectedClients.stream().filter(Predicate.not(toExclude::contains)).forEach(consumer); }
java
private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) { var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.size())); toExclude.addAll(clients); connectedClients.stream().filter(Predicate.not(toExclude::contains)).forEach(consumer); }
[ "private", "void", "writeHelper", "(", "Consumer", "<", "Client", ">", "consumer", ",", "Collection", "<", "?", "extends", "Client", ">", "clients", ")", "{", "var", "toExclude", "=", "Collections", ".", "newSetFromMap", "(", "new", "IdentityHashMap", "<>", ...
A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Collection)} and {@link #writeAndFlushToAllExcept(Packet, Collection)} methods. @param consumer The action to perform for each {@link Client}. @param clients A {@link Collection} of {@link Client}s to exclude from receiving the {@...
[ "A", "helper", "method", "that", "eliminates", "code", "duplication", "in", "the", "{", "@link", "#writeToAllExcept", "(", "Packet", "Collection", ")", "}", "and", "{", "@link", "#writeAndFlushToAllExcept", "(", "Packet", "Collection", ")", "}", "methods", "." ]
a5b55cbfe1768c6a28874f12adac3c748f2b509a
https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/Server.java#L224-L228
train
Write helper for all the clients.
Of course, here is the Java code you requested: ```java private void writeHelper(Consumer<Client> consumer, Collection<? extends Client> clients) { var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.size())); toExclude.addAll(clients); connectedClients.stream().filter(Predi...
shevek/jarjar
jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java
JarjarTask.from
public void from(@Nonnull Dependency dependency) { Configuration configuration = getProject().getConfigurations().detachedConfiguration(dependency); from(configuration); }
java
public void from(@Nonnull Dependency dependency) { Configuration configuration = getProject().getConfigurations().detachedConfiguration(dependency); from(configuration); }
[ "public", "void", "from", "(", "@", "Nonnull", "Dependency", "dependency", ")", "{", "Configuration", "configuration", "=", "getProject", "(", ")", ".", "getConfigurations", "(", ")", ".", "detachedConfiguration", "(", "dependency", ")", ";", "from", "(", "con...
Processes a Dependency directly, which may be derived from {@link DependencyHandler#create(java.lang.Object)}, {@link DependencyHandler#project(java.util.Map)}, {@link DependencyHandler#module(java.lang.Object)}, {@link DependencyHandler#gradleApi()}, etc. @param dependency The dependency to process.
[ "Processes", "a", "Dependency", "directly", "which", "may", "be", "derived", "from", "{", "@link", "DependencyHandler#create", "(", "java", ".", "lang", ".", "Object", ")", "}", "{", "@link", "DependencyHandler#project", "(", "java", ".", "util", ".", "Map", ...
59b9f04970d078184a0d1ac4eeb548215b8e2bc2
https://github.com/shevek/jarjar/blob/59b9f04970d078184a0d1ac4eeb548215b8e2bc2/jarjar-gradle/src/main/java/org/anarres/gradle/plugin/jarjar/JarjarTask.java#L176-L179
train
Creates a new instance of the class from the configuration of the given dependency.
Of course, here is the Java code you requested: ```java public void from(@Nonnull Dependency dependency) { Configuration configuration = getProject().getConfigurations().detachedConfiguration(dependency); from(configuration); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/TrainingJobDefinitionMarshaller.java
TrainingJobDefinitionMarshaller.marshall
public void marshall(TrainingJobDefinition trainingJobDefinition, ProtocolMarshaller protocolMarshaller) { if (trainingJobDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(trainingJobDefin...
java
public void marshall(TrainingJobDefinition trainingJobDefinition, ProtocolMarshaller protocolMarshaller) { if (trainingJobDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(trainingJobDefin...
[ "public", "void", "marshall", "(", "TrainingJobDefinition", "trainingJobDefinition", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "trainingJobDefinition", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passe...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/TrainingJobDefinitionMarshaller.java#L54-L70
train
marshalls the given trainingJobDefinition to the JSON object.
Of course, here is the Java code you requested: ```java public void marshall(TrainingJobDefinition trainingJobDefinition, ProtocolMarshaller protocolMarshaller) { if (trainingJobDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try {...
gmessner/gitlab4j-api
src/main/java/org/gitlab4j/api/LicensesApi.java
LicensesApi.getSingleLicenseTemplate
public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException { Response response = get(Response.Status.OK, null, "licenses", key); return (response.readEntity(LicenseTemplate.class)); }
java
public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException { Response response = get(Response.Status.OK, null, "licenses", key); return (response.readEntity(LicenseTemplate.class)); }
[ "public", "LicenseTemplate", "getSingleLicenseTemplate", "(", "String", "key", ")", "throws", "GitLabApiException", "{", "Response", "response", "=", "get", "(", "Response", ".", "Status", ".", "OK", ",", "null", ",", "\"licenses\"", ",", "key", ")", ";", "ret...
Get a single license template. GET /licenses @param key The key of the license template @return a LicenseTemplate instance @throws GitLabApiException if any exception occurs
[ "Get", "a", "single", "license", "template", "." ]
ab045070abac0a8f4ccbf17b5ed9bfdef5723eed
https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/LicensesApi.java#L56-L59
train
Get a single license template.
Of course, here is the Java code you requested: ```java public LicenseTemplate getSingleLicenseTemplate(String key) throws GitLabApiException { Response response = get(Response.Status.OK, null, "licenses", key); return (response.readEntity(LicenseTemplate.class)); } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/SimpleTimeZone.java
SimpleTimeZone.decodeEndRule
private void decodeEndRule() { useDaylight = (startDay != 0) && (endDay != 0); if (endDay != 0) { if (endMonth < Calendar.JANUARY || endMonth > Calendar.DECEMBER) { throw new IllegalArgumentException( "Illegal end month " + endMonth); } ...
java
private void decodeEndRule() { useDaylight = (startDay != 0) && (endDay != 0); if (endDay != 0) { if (endMonth < Calendar.JANUARY || endMonth > Calendar.DECEMBER) { throw new IllegalArgumentException( "Illegal end month " + endMonth); } ...
[ "private", "void", "decodeEndRule", "(", ")", "{", "useDaylight", "=", "(", "startDay", "!=", "0", ")", "&&", "(", "endDay", "!=", "0", ")", ";", "if", "(", "endDay", "!=", "0", ")", "{", "if", "(", "endMonth", "<", "Calendar", ".", "JANUARY", "||"...
Decode the end rule and validate the parameters. This method is exactly analogous to decodeStartRule(). @see decodeStartRule
[ "Decode", "the", "end", "rule", "and", "validate", "the", "parameters", ".", "This", "method", "is", "exactly", "analogous", "to", "decodeStartRule", "()", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/SimpleTimeZone.java#L1426-L1466
train
Decode end rule.
Of course, here is the Java code you requested: ```java private void decodeEndRule() { useDaylight = (startDay != 0) && (endDay != 0); if (endDay != 0) { if (endMonth < Calendar.JANUARY || endMonth > Calendar.DECEMBER) { throw new IllegalArgumentException( ...
ReactiveX/RxJavaGuava
src/main/java/rx/observable/ListenableFutureObservable.java
ListenableFutureObservable.from
public static <T> Observable<T> from(final ListenableFuture<T> future, final Executor executor) { return Observable.create(new OnSubscribe<T>() { @Override public void call(final Subscriber<? super T> subscriber) { final SingleDelayedProducer<T> sdp = new SingleDelayedPro...
java
public static <T> Observable<T> from(final ListenableFuture<T> future, final Executor executor) { return Observable.create(new OnSubscribe<T>() { @Override public void call(final Subscriber<? super T> subscriber) { final SingleDelayedProducer<T> sdp = new SingleDelayedPro...
[ "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "from", "(", "final", "ListenableFuture", "<", "T", ">", "future", ",", "final", "Executor", "executor", ")", "{", "return", "Observable", ".", "create", "(", "new", "OnSubscribe", "<", "T",...
Converts from {@link ListenableFuture} to {@link rx.Observable}. @param future the {@link ListenableFuture} to register a listener on. @param executor the {@link Executor} where the callback will be executed. The will be where the {@link Observer#onNext(Object)} call from. @return an {@link Observable} that emits t...
[ "Converts", "from", "{", "@link", "ListenableFuture", "}", "to", "{", "@link", "rx", ".", "Observable", "}", "." ]
bfb5da6e073364a96da23d57f47c6b706fb733aa
https://github.com/ReactiveX/RxJavaGuava/blob/bfb5da6e073364a96da23d57f47c6b706fb733aa/src/main/java/rx/observable/ListenableFutureObservable.java#L67-L88
train
Creates an observable from a listenable future.
Of course, here is the Java code you requested: ```java public static <T> Observable<T> from(final ListenableFuture<T> future, final Executor executor) { return Observable.create(new OnSubscribe<T>() { @Override public void call(final Subscriber<? super T> subscriber) { ...
apereo/cas
support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/Saml10ObjectBuilder.java
Saml10ObjectBuilder.newAuthenticationStatement
public AuthenticationStatement newAuthenticationStatement(final ZonedDateTime authenticationDate, final Collection<Object> authenticationMethod, final String subjectId) { val authnStateme...
java
public AuthenticationStatement newAuthenticationStatement(final ZonedDateTime authenticationDate, final Collection<Object> authenticationMethod, final String subjectId) { val authnStateme...
[ "public", "AuthenticationStatement", "newAuthenticationStatement", "(", "final", "ZonedDateTime", "authenticationDate", ",", "final", "Collection", "<", "Object", ">", "authenticationMethod", ",", "final", "String", "subjectId", ")", "{", "val", "authnStatement", "=", "...
New authentication statement. @param authenticationDate the authentication date @param authenticationMethod the authentication method @param subjectId the subject id @return the authentication statement
[ "New", "authentication", "statement", "." ]
b4b306433a8782cef803a39bea5b1f96740e0e9b
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/Saml10ObjectBuilder.java#L176-L189
train
New authentication statement.
Of course, here is the Java code you requested: ```java public AuthenticationStatement newAuthenticationStatement(final ZonedDateTime authenticationDate, final Collection<Object> authenticationMethod, ...
MenoData/Time4J
base/src/main/java/net/time4j/engine/TimePoint.java
TimePoint.plus
public T plus(TimeSpan<? extends U> timeSpan) { try { return timeSpan.addTo(this.getContext()); } catch (IllegalArgumentException iae) { ArithmeticException ex = new ArithmeticException("Result beyond boundaries of time axis."); ex.initCause(iae); throw e...
java
public T plus(TimeSpan<? extends U> timeSpan) { try { return timeSpan.addTo(this.getContext()); } catch (IllegalArgumentException iae) { ArithmeticException ex = new ArithmeticException("Result beyond boundaries of time axis."); ex.initCause(iae); throw e...
[ "public", "T", "plus", "(", "TimeSpan", "<", "?", "extends", "U", ">", "timeSpan", ")", "{", "try", "{", "return", "timeSpan", ".", "addTo", "(", "this", ".", "getContext", "(", ")", ")", ";", "}", "catch", "(", "IllegalArgumentException", "iae", ")", ...
/*[deutsch] <p>Addiert die angegebene Zeitspanne zur Bezugszeit und liefert das Additionsergebnis zur&uuml;ck. </p> <p>Delegiert an {@link TimeSpan#addTo(TimePoint)}. </p> @param timeSpan time span to be added to this instance @return result of addition as changed copy, this instance remains unaffected @throws ...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Addiert", "die", "angegebene", "Zeitspanne", "zur", "Bezugszeit", "und", "liefert", "das", "Additionsergebnis", "zur&uuml", ";", "ck", ".", "<", "/", "p", ">" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/engine/TimePoint.java#L270-L280
train
Add the specified time span to this time axis.
Of course, here is the Java code you requested: ```java public T plus(TimeSpan<? extends U> timeSpan) { try { return timeSpan.addTo(this.getContext()); } catch (IllegalArgumentException iae) { ArithmeticException ex = new ArithmeticException("Result beyond boundaries of time ax...
phax/ph-commons
ph-cli/src/main/java/com/helger/cli/HelpFormatter.java
HelpFormatter.printHelp
public void printHelp (@Nonnull @Nonempty final String sCmdLineSyntax, @Nullable final String sHeader, @Nonnull final Options aOptions, @Nullable final String sFooter, final boolean bAutoUsage) { printHelp (getWidt...
java
public void printHelp (@Nonnull @Nonempty final String sCmdLineSyntax, @Nullable final String sHeader, @Nonnull final Options aOptions, @Nullable final String sFooter, final boolean bAutoUsage) { printHelp (getWidt...
[ "public", "void", "printHelp", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sCmdLineSyntax", ",", "@", "Nullable", "final", "String", "sHeader", ",", "@", "Nonnull", "final", "Options", "aOptions", ",", "@", "Nullable", "final", "String", "sFooter...
Print the help for <code>options</code> with the specified command line syntax. This method prints help information to System.out. @param sCmdLineSyntax the syntax for this application @param sHeader the banner to display at the beginning of the help @param aOptions the Options instance @param sFooter the banner to di...
[ "Print", "the", "help", "for", "<code", ">", "options<", "/", "code", ">", "with", "the", "specified", "command", "line", "syntax", ".", "This", "method", "prints", "help", "information", "to", "System", ".", "out", "." ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-cli/src/main/java/com/helger/cli/HelpFormatter.java#L456-L463
train
Print the help for the CID .
Of course, here is the Java code you requested: ```java public void printHelp (@Nonnull @Nonempty final String sCmdLineSyntax, @Nullable final String sHeader, @Nonnull final Options aOptions, @Nullable final String sFooter, ...
vdmeer/asciitable
src/main/java/de/vandermeer/asciitable/AT_Row.java
AT_Row.setCharTranslator
public AT_Row setCharTranslator(CharacterTranslator charTranslator) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setCharTranslator(charTranslator); } } return this; }
java
public AT_Row setCharTranslator(CharacterTranslator charTranslator) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setCharTranslator(charTranslator); } } return this; }
[ "public", "AT_Row", "setCharTranslator", "(", "CharacterTranslator", "charTranslator", ")", "{", "if", "(", "this", ".", "hasCells", "(", ")", ")", "{", "for", "(", "AT_Cell", "cell", ":", "this", ".", "getCells", "(", ")", ")", "{", "cell", ".", "getCon...
Sets the character translator for all cells in the row. It will also remove any other translator set. Nothing will happen if the argument is null. @param charTranslator translator @return this to allow chaining
[ "Sets", "the", "character", "translator", "for", "all", "cells", "in", "the", "row", ".", "It", "will", "also", "remove", "any", "other", "translator", "set", ".", "Nothing", "will", "happen", "if", "the", "argument", "is", "null", "." ]
b6a73710271c89f9c749603be856ba84a969ed5f
https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AT_Row.java#L363-L370
train
Sets the character translator for all cells in the row.
Of course, here is the Java code you requested: ```java public AT_Row setCharTranslator(CharacterTranslator charTranslator) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setCharTranslator(charTranslator); } } return this; } ``` Hope this helps!
korpling/ANNIS
annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java
ANNISUserConfigurationManager.writeUser
public boolean writeUser(User user) { // save user info to file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.getAbsoluteP...
java
public boolean writeUser(User user) { // save user info to file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to the user File userFile = new File(userDir.getAbsoluteP...
[ "public", "boolean", "writeUser", "(", "User", "user", ")", "{", "// save user info to file", "if", "(", "resourcePath", "!=", "null", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "File", "userDir", "=", "new", ...
Writes the user to the disk @param user @return True if successful.
[ "Writes", "the", "user", "to", "the", "disk" ]
152a2e34832e015f73ac8ce8a7d4c32641641324
https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-service/src/main/java/annis/security/ANNISUserConfigurationManager.java#L173-L196
train
Write a user to the file.
Of course, here is the Java code you requested: ```java public boolean writeUser(User user) { // save user info to file if (resourcePath != null) { lock.writeLock().lock(); try { File userDir = new File(resourcePath, "users"); if (userDir.isDirectory()) { // get the file which corresponds to th...
authlete/authlete-java-jaxrs
src/main/java/com/authlete/jaxrs/AuthorizationRequestHandler.java
AuthorizationRequestHandler.handle
public Response handle(MultivaluedMap<String, String> parameters) throws WebApplicationException { try { // Process the given parameters. return process(parameters); } catch (WebApplicationException e) { throw e; } catch (Th...
java
public Response handle(MultivaluedMap<String, String> parameters) throws WebApplicationException { try { // Process the given parameters. return process(parameters); } catch (WebApplicationException e) { throw e; } catch (Th...
[ "public", "Response", "handle", "(", "MultivaluedMap", "<", "String", ",", "String", ">", "parameters", ")", "throws", "WebApplicationException", "{", "try", "{", "// Process the given parameters.", "return", "process", "(", "parameters", ")", ";", "}", "catch", "...
Handle an authorization request to a <a href= "https://tools.ietf.org/html/rfc6749#section-3.1">authorization endpoint</a> of OAuth 2.0 (<a href="https://tools.ietf.org/html/rfc6749">RFC 6749</a>). @param parameters Request parameters of an authorization request. @return A response that should be returned from the en...
[ "Handle", "an", "authorization", "request", "to", "a", "<a", "href", "=", "https", ":", "//", "tools", ".", "ietf", ".", "org", "/", "html", "/", "rfc6749#section", "-", "3", ".", "1", ">", "authorization", "endpoint<", "/", "a", ">", "of", "OAuth", ...
9b043732c57b5ad2aebb8ffebb5ab56b9c5d86ad
https://github.com/authlete/authlete-java-jaxrs/blob/9b043732c57b5ad2aebb8ffebb5ab56b9c5d86ad/src/main/java/com/authlete/jaxrs/AuthorizationRequestHandler.java#L88-L104
valid
Handle the request.
Of course, here is the Java code you requested: ```java public Response handle(MultivaluedMap<String, String> parameters) throws WebApplicationException { try { // Process the given parameters. return process(parameters); } catch (WebApplicationException e) ...
microfocus-idol/java-hod-client
src/main/java/com/hp/autonomy/hod/client/api/analysis/viewdocument/ViewDocumentRequestBuilder.java
ViewDocumentRequestBuilder.addHighlightExpressions
public ViewDocumentRequestBuilder addHighlightExpressions(final String highlightExpression, final String... highlightExpressions) { this.highlightExpressions.add(highlightExpression); this.highlightExpressions.addAll(Arrays.asList(highlightExpressions)); return this; }
java
public ViewDocumentRequestBuilder addHighlightExpressions(final String highlightExpression, final String... highlightExpressions) { this.highlightExpressions.add(highlightExpression); this.highlightExpressions.addAll(Arrays.asList(highlightExpressions)); return this; }
[ "public", "ViewDocumentRequestBuilder", "addHighlightExpressions", "(", "final", "String", "highlightExpression", ",", "final", "String", "...", "highlightExpressions", ")", "{", "this", ".", "highlightExpressions", ".", "add", "(", "highlightExpression", ")", ";", "thi...
Adds values to the highlight_expression parameter @param highlightExpression The first highlight expression @param highlightExpressions The remaining highlight expressions @return this
[ "Adds", "values", "to", "the", "highlight_expression", "parameter" ]
56359e5b93a5637c37ef82ce3fc78b95cf1f6d80
https://github.com/microfocus-idol/java-hod-client/blob/56359e5b93a5637c37ef82ce3fc78b95cf1f6d80/src/main/java/com/hp/autonomy/hod/client/api/analysis/viewdocument/ViewDocumentRequestBuilder.java#L55-L59
valid
Add highlight expressions.
Of course, here is the Java code you requested: ```java public ViewDocumentRequestBuilder addHighlightExpressions(final String highlightExpression, final String... highlightExpressions) { this.highlightExpressions.add(highlightExpression); this.highlightExpressions.addAll(Arrays.asList(highlightExpress...
exoplatform/jcr
exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/xml/PropstatGroupedRepresentation.java
PropstatGroupedRepresentation.getPropStats
public final Map<String, Set<HierarchicalProperty>> getPropStats() throws RepositoryException { String statname = WebDavConst.getStatusDescription(HTTPStatus.OK); if (propNames == null) { propStats.put(statname, resource.getProperties(namesOnly)); } else { ...
java
public final Map<String, Set<HierarchicalProperty>> getPropStats() throws RepositoryException { String statname = WebDavConst.getStatusDescription(HTTPStatus.OK); if (propNames == null) { propStats.put(statname, resource.getProperties(namesOnly)); } else { ...
[ "public", "final", "Map", "<", "String", ",", "Set", "<", "HierarchicalProperty", ">", ">", "getPropStats", "(", ")", "throws", "RepositoryException", "{", "String", "statname", "=", "WebDavConst", ".", "getStatusDescription", "(", "HTTPStatus", ".", "OK", ")", ...
Returns properties statuses. @return properties statuses @throws RepositoryException {@link RepositoryException}
[ "Returns", "properties", "statuses", "." ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/xml/PropstatGroupedRepresentation.java#L125-L193
train
Gets the status information for the individual properties of the resource.
Of course, here is the Java code you requested: ```java public final Map<String, Set<HierarchicalProperty>> getPropStats() throws RepositoryException { String statname = WebDavConst.getStatusDescription(HTTPStatus.OK); if (propNames == null) { propStats.put(statname, resource.getProp...
pardom-zz/Ollie
core/src/main/java/ollie/Ollie.java
Ollie.processCursor
public static <T extends Model> List<T> processCursor(Class<T> cls, Cursor cursor) { final List<T> entities = new ArrayList<T>(); try { Constructor<T> entityConstructor = cls.getConstructor(); if (cursor.moveToFirst()) { do { T entity = getEntity(cls, cursor.getLong(cursor.getColumnIndex(BaseColumns....
java
public static <T extends Model> List<T> processCursor(Class<T> cls, Cursor cursor) { final List<T> entities = new ArrayList<T>(); try { Constructor<T> entityConstructor = cls.getConstructor(); if (cursor.moveToFirst()) { do { T entity = getEntity(cls, cursor.getLong(cursor.getColumnIndex(BaseColumns....
[ "public", "static", "<", "T", "extends", "Model", ">", "List", "<", "T", ">", "processCursor", "(", "Class", "<", "T", ">", "cls", ",", "Cursor", "cursor", ")", "{", "final", "List", "<", "T", ">", "entities", "=", "new", "ArrayList", "<", "T", ">"...
Iterate over a cursor and load entities. @param cls The model class. @param cursor The result cursor. @return The list of entities.
[ "Iterate", "over", "a", "cursor", "and", "load", "entities", "." ]
9d20468ca78064002187f2c5db3be06d1d29e310
https://github.com/pardom-zz/Ollie/blob/9d20468ca78064002187f2c5db3be06d1d29e310/core/src/main/java/ollie/Ollie.java#L170-L191
train
Process a Cursor of entities.
Of course, here is the Java code you requested: ```java public static <T extends Model> List<T> processCursor(Class<T> cls, Cursor cursor) { final List<T> entities = new ArrayList<T>(); try { Constructor<T> entityConstructor = cls.getConstructor(); if (cursor.moveToFirst()) { do { T entity = getEnti...
aws/aws-sdk-java
aws-java-sdk-support/src/main/java/com/amazonaws/services/support/AWSSupportClient.java
AWSSupportClient.addCommunicationToCase
@Override public AddCommunicationToCaseResult addCommunicationToCase(AddCommunicationToCaseRequest request) { request = beforeClientExecution(request); return executeAddCommunicationToCase(request); }
java
@Override public AddCommunicationToCaseResult addCommunicationToCase(AddCommunicationToCaseRequest request) { request = beforeClientExecution(request); return executeAddCommunicationToCase(request); }
[ "@", "Override", "public", "AddCommunicationToCaseResult", "addCommunicationToCase", "(", "AddCommunicationToCaseRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeAddCommunicationToCase", "(", "request", ")",...
<p> Adds additional customer communication to an AWS Support case. You use the <code>caseId</code> value to identify the case to add communication to. You can list a set of email addresses to copy on the communication using the <code>ccEmailAddresses</code> value. The <code>communicationBody</code> value contains the t...
[ "<p", ">", "Adds", "additional", "customer", "communication", "to", "an", "AWS", "Support", "case", ".", "You", "use", "the", "<code", ">", "caseId<", "/", "code", ">", "value", "to", "identify", "the", "case", "to", "add", "communication", "to", ".", "Y...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-support/src/main/java/com/amazonaws/services/support/AWSSupportClient.java#L480-L484
train
Adds a communication to a specific case.
Of course, here is the Java code you requested: ```java @Override public AddCommunicationToCaseResult addCommunicationToCase(AddCommunicationToCaseRequest request) { request = beforeClientExecution(request); return executeAddCommunicationToCase(request); } ``` Hope this helps!
gsi-upm/Shanks
shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java
CreationShanksAgentCapability.removeAgent
public static void removeAgent(ShanksSimulation sim, String agentID) throws ShanksException { sim.logger.info("Stoppable not fount. Attempting direct stop..."); sim.unregisterShanksAgent(agentID); sim.logger.info("Agent " + agentID + " stopped."); }
java
public static void removeAgent(ShanksSimulation sim, String agentID) throws ShanksException { sim.logger.info("Stoppable not fount. Attempting direct stop..."); sim.unregisterShanksAgent(agentID); sim.logger.info("Agent " + agentID + " stopped."); }
[ "public", "static", "void", "removeAgent", "(", "ShanksSimulation", "sim", ",", "String", "agentID", ")", "throws", "ShanksException", "{", "sim", ".", "logger", ".", "info", "(", "\"Stoppable not fount. Attempting direct stop...\"", ")", ";", "sim", ".", "unregiste...
"Removes" an agent with the given name from the simulation Be careful: what this actually do is to stop the agent execution. @param sim -The Shanks Simulation @param agentID - The name of the agent to remove @throws ShanksException An UnkownAgentException if the Agent ID is not found on the simulation.
[ "Removes", "an", "agent", "with", "the", "given", "name", "from", "the", "simulation" ]
35d87a81c22731f4f83bbd0571c9c6d466bd16be
https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/agent/capability/creation/CreationShanksAgentCapability.java#L73-L78
train
Remove an agent from the system.
Of course, here is the Java code you requested: ```java public static void removeAgent(ShanksSimulation sim, String agentID) throws ShanksException { sim.logger.info("Stoppable not fount. Attempting direct stop..."); sim.unregisterShanksAgent(agentID); sim.logger.info("Agent " + age...
davidcarboni/cryptolite-java
src/main/java/com/github/davidcarboni/cryptolite/KeyWrapper.java
KeyWrapper.unwrapPrivateKey
public PrivateKey unwrapPrivateKey(String wrappedKey) { return (PrivateKey) unwrap(wrappedKey, Keys.ASYMMETRIC_ALGORITHM, Cipher.PRIVATE_KEY, WRAP_ALGORITHM_ASYMMETRIC); }
java
public PrivateKey unwrapPrivateKey(String wrappedKey) { return (PrivateKey) unwrap(wrappedKey, Keys.ASYMMETRIC_ALGORITHM, Cipher.PRIVATE_KEY, WRAP_ALGORITHM_ASYMMETRIC); }
[ "public", "PrivateKey", "unwrapPrivateKey", "(", "String", "wrappedKey", ")", "{", "return", "(", "PrivateKey", ")", "unwrap", "(", "wrappedKey", ",", "Keys", ".", "ASYMMETRIC_ALGORITHM", ",", "Cipher", ".", "PRIVATE_KEY", ",", "WRAP_ALGORITHM_ASYMMETRIC", ")", ";...
Unwraps the given encoded {@link PrivateKey}, using WRAP_ALGORITHM_ASYMMETRIC. @param wrappedKey The wrapped key, base-64 encoded, as returned by {@link #wrapPrivateKey(PrivateKey)} . @return The unwrapped {@link PrivateKey}.
[ "Unwraps", "the", "given", "encoded", "{", "@link", "PrivateKey", "}", "using", "WRAP_ALGORITHM_ASYMMETRIC", "." ]
e67954181a04ffc9beb1d9abca1421195fcf9764
https://github.com/davidcarboni/cryptolite-java/blob/e67954181a04ffc9beb1d9abca1421195fcf9764/src/main/java/com/github/davidcarboni/cryptolite/KeyWrapper.java#L185-L189
train
Unwrap a Private Key from an ASYMMETRIC key.
Of course, here is the Java code you requested: ```java public PrivateKey unwrapPrivateKey(String wrappedKey) { return (PrivateKey) unwrap(wrappedKey, Keys.ASYMMETRIC_ALGORITHM, Cipher.PRIVATE_KEY, WRAP_ALGORITHM_ASYMMETRIC); } ``` Hope this helps!
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/StringUtils.java
StringUtils.convertCase
public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) { final StringBuffer result = new StringBuffer(); boolean firstWord = true; boolean firstLetter = true; boolean upper = false; WordMachineState state = Wor...
java
public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) { final StringBuffer result = new StringBuffer(); boolean firstWord = true; boolean firstLetter = true; boolean upper = false; WordMachineState state = Wor...
[ "public", "static", "String", "convertCase", "(", "String", "value", ",", "String", "separator", ",", "boolean", "firstLetterUpper", ",", "boolean", "firstLetterOfWordUpper", ")", "{", "final", "StringBuffer", "result", "=", "new", "StringBuffer", "(", ")", ";", ...
Converts string between various case forms such as camel case, snake case or kebab case. <p/>Characters in the string are characterized as whitespace, upper case, or other by the following rules. <ol> <li> An upper case letter is marked as upper case (U). </li> <li> A lower case letter or digit is marked as lower cas...
[ "Converts", "string", "between", "various", "case", "forms", "such", "as", "camel", "case", "snake", "case", "or", "kebab", "case", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/StringUtils.java#L237-L321
test
Convert Case.
Of course, here is the Java code you requested: ```java public static String convertCase(String value, String separator, boolean firstLetterUpper, boolean firstLetterOfWordUpper) { final StringBuffer result = new StringBuffer(); boolean firstWord = true; boolean firstLetter = true; boo...
lastaflute/lastaflute
src/main/java/org/lastaflute/web/LastaAction.java
LastaAction.asJson
protected <RESULT> JsonResponse<RESULT> asJson(RESULT result) { assertArgumentNotNull("result", result); return newJsonResponse(result); }
java
protected <RESULT> JsonResponse<RESULT> asJson(RESULT result) { assertArgumentNotNull("result", result); return newJsonResponse(result); }
[ "protected", "<", "RESULT", ">", "JsonResponse", "<", "RESULT", ">", "asJson", "(", "RESULT", "result", ")", "{", "assertArgumentNotNull", "(", "\"result\"", ",", "result", ")", ";", "return", "newJsonResponse", "(", "result", ")", ";", "}" ]
Return response as JSON. <pre> <span style="color: #70226C">public</span> JsonResponse&lt;SeaResult&gt; index() { ... <span style="color: #70226C">return</span> asJson(<span style="color: #553000">result</span>); } </pre> @param <RESULT> The type of result serialized to JSON. @param result The result object converted t...
[ "Return", "response", "as", "JSON", ".", "<pre", ">", "<span", "style", "=", "color", ":", "#70226C", ">", "public<", "/", "span", ">", "JsonResponse&lt", ";", "SeaResult&gt", ";", "index", "()", "{", "...", "<span", "style", "=", "color", ":", "#70226C"...
17b56dda8322e4c6d79043532c1dda917d6b60a8
https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/web/LastaAction.java#L174-L177
train
Returns a JsonResponse object representing the given result.
Of course, here is the Java code you requested: ```java protected <RESULT> JsonResponse<RESULT> asJson(RESULT result) { assertArgumentNotNull("result", result); return newJsonResponse(result); } ``` Hope this helps!
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/WaitHttpConditionBuilder.java
WaitHttpConditionBuilder.status
public WaitHttpConditionBuilder status(HttpStatus status) { getCondition().setHttpResponseCode(String.valueOf(status.value())); return this; }
java
public WaitHttpConditionBuilder status(HttpStatus status) { getCondition().setHttpResponseCode(String.valueOf(status.value())); return this; }
[ "public", "WaitHttpConditionBuilder", "status", "(", "HttpStatus", "status", ")", "{", "getCondition", "(", ")", ".", "setHttpResponseCode", "(", "String", ".", "valueOf", "(", "status", ".", "value", "(", ")", ")", ")", ";", "return", "this", ";", "}" ]
Sets the Http status code to check. @param status @return
[ "Sets", "the", "Http", "status", "code", "to", "check", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/WaitHttpConditionBuilder.java#L69-L72
train
Sets the status code of the condition.
Of course, here is the Java code you requested: ```java public WaitHttpConditionBuilder status(HttpStatus status) { getCondition().setHttpResponseCode(String.valueOf(status.value())); return this; } ``` Hope this helps!
coursera/courier
typescript-lite/generator/src/main/java/org/coursera/courier/tslite/TSSyntax.java
TSSyntax.importString
private static String importString(String typeName, String moduleName) { return new StringBuilder() .append("import { ") .append(typeName) .append(" } from \"./") .append(moduleName) .append(".") .append(typeName) .append("\";") .toString(); }
java
private static String importString(String typeName, String moduleName) { return new StringBuilder() .append("import { ") .append(typeName) .append(" } from \"./") .append(moduleName) .append(".") .append(typeName) .append("\";") .toString(); }
[ "private", "static", "String", "importString", "(", "String", "typeName", ",", "String", "moduleName", ")", "{", "return", "new", "StringBuilder", "(", ")", ".", "append", "(", "\"import { \"", ")", ".", "append", "(", "typeName", ")", ".", "append", "(", ...
Creates a valid typescript import string given a type name (e.g. "Fortune") and the module name, which is usually the pegasus object's namespace. @param typeName Name of the type to import (e.g. "Fortune") @param moduleName That same type's namespace (e.g. "org.example") @return A fully formed import statement. e.g: ...
[ "Creates", "a", "valid", "typescript", "import", "string", "given", "a", "type", "name", "(", "e", ".", "g", ".", "Fortune", ")", "and", "the", "module", "name", "which", "is", "usually", "the", "pegasus", "object", "s", "namespace", "." ]
749674fa7ee33804ad11b6c8ecb560f455cb4c22
https://github.com/coursera/courier/blob/749674fa7ee33804ad11b6c8ecb560f455cb4c22/typescript-lite/generator/src/main/java/org/coursera/courier/tslite/TSSyntax.java#L182-L192
train
Import a string from a type name and module name.
Of course, here is the Java code you requested: ```java private static String importString(String typeName, String moduleName) { return new StringBuilder() .append("import { ") .append(typeName) .append(" } from \"./") .append(moduleName) .append(".") .append(typeNam...
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPOptionCategoryLocalServiceWrapper.java
CPOptionCategoryLocalServiceWrapper.getCPOptionCategoriesByUuidAndCompanyId
@Override public java.util.List<com.liferay.commerce.product.model.CPOptionCategory> getCPOptionCategoriesByUuidAndCompanyId( String uuid, long companyId) { return _cpOptionCategoryLocalService.getCPOptionCategoriesByUuidAndCompanyId(uuid, companyId); }
java
@Override public java.util.List<com.liferay.commerce.product.model.CPOptionCategory> getCPOptionCategoriesByUuidAndCompanyId( String uuid, long companyId) { return _cpOptionCategoryLocalService.getCPOptionCategoriesByUuidAndCompanyId(uuid, companyId); }
[ "@", "Override", "public", "java", ".", "util", ".", "List", "<", "com", ".", "liferay", ".", "commerce", ".", "product", ".", "model", ".", "CPOptionCategory", ">", "getCPOptionCategoriesByUuidAndCompanyId", "(", "String", "uuid", ",", "long", "companyId", ")...
Returns all the cp option categories matching the UUID and company. @param uuid the UUID of the cp option categories @param companyId the primary key of the company @return the matching cp option categories, or an empty list if no matches were found
[ "Returns", "all", "the", "cp", "option", "categories", "matching", "the", "UUID", "and", "company", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/CPOptionCategoryLocalServiceWrapper.java#L272-L277
train
Returns the cp option categories matching the UUID and company.
Of course, here is the Java code you requested: ```java @Override public java.util.List<com.liferay.commerce.product.model.CPOptionCategory> getCPOptionCategoriesByUuidAndCompanyId( String uuid, long companyId) { return _cpOptionCategoryLocalService.getCPOptionCategoriesByUuidAndCompanyId(uuid, companyId); } ...
perwendel/spark
src/main/java/spark/Request.java
Request.session
public Session session() { if (session == null || !validSession) { validSession(true); session = new Session(servletRequest.getSession(), this); } return session; }
java
public Session session() { if (session == null || !validSession) { validSession(true); session = new Session(servletRequest.getSession(), this); } return session; }
[ "public", "Session", "session", "(", ")", "{", "if", "(", "session", "==", "null", "||", "!", "validSession", ")", "{", "validSession", "(", "true", ")", ";", "session", "=", "new", "Session", "(", "servletRequest", ".", "getSession", "(", ")", ",", "t...
Returns the current session associated with this request, or if the request does not have a session, creates one. @return the session associated with this request
[ "Returns", "the", "current", "session", "associated", "with", "this", "request", "or", "if", "the", "request", "does", "not", "have", "a", "session", "creates", "one", "." ]
080fb1f9d6e580f6742e9589044c7420d3157b8b
https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/Request.java#L428-L434
train
Gets the session object.
Of course, here is the Java code you requested: ```java public Session session() { if (session == null || !validSession) { validSession(true); session = new Session(servletRequest.getSession(), this); } return session; } ``` Hope this helps!
Alluxio/alluxio
core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java
DefaultBlockMaster.processWorkerRemovedBlocks
@GuardedBy("workerInfo") private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds) { for (long removedBlockId : removedBlockIds) { try (LockResource lr = lockBlock(removedBlockId)) { Optional<BlockMeta> block = mBlockStore.getBlock(removedBlockId); ...
java
@GuardedBy("workerInfo") private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds) { for (long removedBlockId : removedBlockIds) { try (LockResource lr = lockBlock(removedBlockId)) { Optional<BlockMeta> block = mBlockStore.getBlock(removedBlockId); ...
[ "@", "GuardedBy", "(", "\"workerInfo\"", ")", "private", "void", "processWorkerRemovedBlocks", "(", "MasterWorkerInfo", "workerInfo", ",", "Collection", "<", "Long", ">", "removedBlockIds", ")", "{", "for", "(", "long", "removedBlockId", ":", "removedBlockIds", ")",...
Updates the worker and block metadata for blocks removed from a worker. @param workerInfo The worker metadata object @param removedBlockIds A list of block ids removed from the worker
[ "Updates", "the", "worker", "and", "block", "metadata", "for", "blocks", "removed", "from", "a", "worker", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/block/DefaultBlockMaster.java#L901-L918
train
Process the removed blocks.
Of course, here is the Java code you requested: ```java @GuardedBy("workerInfo") private void processWorkerRemovedBlocks(MasterWorkerInfo workerInfo, Collection<Long> removedBlockIds) { for (long removedBlockId : removedBlockIds) { try (LockResource lr = lockBlock(removedBlockId)) { Optional<...
czyzby/gdx-lml
examples/gdx-lml-vis-websocket/core/src/com/github/czyzby/views/container/WebSocketButtons.java
WebSocketButtons.onDisconnect
public void onDisconnect() { input.setDisabled(true); sendingButton.setDisabled(true); connectingButton.setDisabled(false); disconnectingButton.setDisabled(true); }
java
public void onDisconnect() { input.setDisabled(true); sendingButton.setDisabled(true); connectingButton.setDisabled(false); disconnectingButton.setDisabled(true); }
[ "public", "void", "onDisconnect", "(", ")", "{", "input", ".", "setDisabled", "(", "true", ")", ";", "sendingButton", ".", "setDisabled", "(", "true", ")", ";", "connectingButton", ".", "setDisabled", "(", "false", ")", ";", "disconnectingButton", ".", "setD...
Disables sending widgets. Enables connecting widgets.
[ "Disables", "sending", "widgets", ".", "Enables", "connecting", "widgets", "." ]
7623b322e6afe49ad4dd636c80c230150a1cfa4e
https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/examples/gdx-lml-vis-websocket/core/src/com/github/czyzby/views/container/WebSocketButtons.java#L29-L34
train
On disconnect.
Of course, here is the Java code you requested: ```java public void onDisconnect() { input.setDisabled(true); sendingButton.setDisabled(true); connectingButton.setDisabled(false); disconnectingButton.setDisabled(true); } ``` Hope this helps!
geomajas/geomajas-project-graphics
graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java
SliderBar.getKnobPercent
protected double getKnobPercent() { // If we have no range if (maxValue <= minValue) { return 0; } // Calculate the relative progress double percent = (curValue - minValue) / (maxValue - minValue); return Math.max(0.0, Math.min(1.0, percent)); }
java
protected double getKnobPercent() { // If we have no range if (maxValue <= minValue) { return 0; } // Calculate the relative progress double percent = (curValue - minValue) / (maxValue - minValue); return Math.max(0.0, Math.min(1.0, percent)); }
[ "protected", "double", "getKnobPercent", "(", ")", "{", "// If we have no range\r", "if", "(", "maxValue", "<=", "minValue", ")", "{", "return", "0", ";", "}", "// Calculate the relative progress\r", "double", "percent", "=", "(", "curValue", "-", "minValue", ")",...
Get the percentage of the knob's position relative to the size of the line. The return value will be between 0.0 and 1.0. @return the current percent complete
[ "Get", "the", "percentage", "of", "the", "knob", "s", "position", "relative", "to", "the", "size", "of", "the", "line", ".", "The", "return", "value", "will", "be", "between", "0", ".", "0", "and", "1", ".", "0", "." ]
1104196640e0ba455b8a619e774352a8e1e319ba
https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/widget/SliderBar.java#L736-L745
train
Returns the progress of the .
Of course, here is the Java code you requested: ```java protected double getKnobPercent() { // If we have no range if (maxValue <= minValue) { return 0; } // Calculate the relative progress double percent = (curValue - minValue) / (maxValue - minValue); return Math.max(0.0, Math.min(1.0, percen...
TheHortonMachine/hortonmachine
gears/src/main/java/org/hortonmachine/gears/utils/SldUtilities.java
SldUtilities.colorWithAlpha
public static Color colorWithAlpha( Color color, int alpha ) { return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha); }
java
public static Color colorWithAlpha( Color color, int alpha ) { return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha); }
[ "public", "static", "Color", "colorWithAlpha", "(", "Color", "color", ",", "int", "alpha", ")", "{", "return", "new", "Color", "(", "color", ".", "getRed", "(", ")", ",", "color", ".", "getGreen", "(", ")", ",", "color", ".", "getBlue", "(", ")", ","...
Creates a color with the given alpha. @param color the color to use. @param alpha an alpha value between 0 and 255. @return the color with alpha.
[ "Creates", "a", "color", "with", "the", "given", "alpha", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/SldUtilities.java#L290-L292
train
Color with alpha.
Of course, here is the Java code you requested: ```java public static Color colorWithAlpha( Color color, int alpha ) { return new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha); } ``` Hope this helps!
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java
PerceptronClassifier.readInstance
private Instance[] readInstance(String corpus, FeatureMap featureMap) { IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus); List<Instance> instanceList = new LinkedList<Instance>(); for (String line : lineIterator) { String[] cells = line.split(","); ...
java
private Instance[] readInstance(String corpus, FeatureMap featureMap) { IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus); List<Instance> instanceList = new LinkedList<Instance>(); for (String line : lineIterator) { String[] cells = line.split(","); ...
[ "private", "Instance", "[", "]", "readInstance", "(", "String", "corpus", ",", "FeatureMap", "featureMap", ")", "{", "IOUtil", ".", "LineIterator", "lineIterator", "=", "new", "IOUtil", ".", "LineIterator", "(", "corpus", ")", ";", "List", "<", "Instance", "...
从语料库读取实例 @param corpus 语料库 @param featureMap 特征映射 @return 数据集
[ "从语料库读取实例" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/PerceptronClassifier.java#L193-L210
train
readInstance returns an array of Instance
Of course, here is the Java code you requested: ```java private Instance[] readInstance(String corpus, FeatureMap featureMap) { IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(corpus); List<Instance> instanceList = new LinkedList<Instance>(); for (String line : lineIterator) ...
pressgang-ccms/PressGangCCMSContentSpec
src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java
CustomTopicXMLValidator.checkTopicForInvalidContent
public static List<String> checkTopicForInvalidContent(final ServerSettingsWrapper serverSettings, final BaseTopicWrapper<?> topic, final Document topicDoc, boolean skipNestedSectionValidation) { final List<String> xmlErrors = new ArrayList<String>(); // Check to ensure that if the topic has...
java
public static List<String> checkTopicForInvalidContent(final ServerSettingsWrapper serverSettings, final BaseTopicWrapper<?> topic, final Document topicDoc, boolean skipNestedSectionValidation) { final List<String> xmlErrors = new ArrayList<String>(); // Check to ensure that if the topic has...
[ "public", "static", "List", "<", "String", ">", "checkTopicForInvalidContent", "(", "final", "ServerSettingsWrapper", "serverSettings", ",", "final", "BaseTopicWrapper", "<", "?", ">", "topic", ",", "final", "Document", "topicDoc", ",", "boolean", "skipNestedSectionVa...
Checks to make sure that a topics xml content is valid for the specific topic. This involves checking the following: <ul> <li>Table row entries match the cols attribute.</li> <li>The root XML Element matches the topic type.</li> <li>The topic has no invalid content for the specific topic type.</li> </ul> @param server...
[ "Checks", "to", "make", "sure", "that", "a", "topics", "xml", "content", "is", "valid", "for", "the", "specific", "topic", ".", "This", "involves", "checking", "the", "following", ":", "<ul", ">", "<li", ">", "Table", "row", "entries", "match", "the", "c...
2bc02e2971e4522b47a130fb7ae5a0f5ad377df1
https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/CustomTopicXMLValidator.java#L40-L54
train
Check if the topic for invalid content is valid.
Of course, here is the Java code you requested: ```java public static List<String> checkTopicForInvalidContent(final ServerSettingsWrapper serverSettings, final BaseTopicWrapper<?> topic, final Document topicDoc, boolean skipNestedSectionValidation) { final List<String> xmlErrors = new ArrayList<St...
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java
ParameterFormatter.countArgumentPlaceholders2
static int countArgumentPlaceholders2(final String messagePattern, final int[] indices) { if (messagePattern == null) { return 0; } final int length = messagePattern.length(); int result = 0; boolean isEscaped = false; for (int i = 0; i < length - 1; i++) { ...
java
static int countArgumentPlaceholders2(final String messagePattern, final int[] indices) { if (messagePattern == null) { return 0; } final int length = messagePattern.length(); int result = 0; boolean isEscaped = false; for (int i = 0; i < length - 1; i++) { ...
[ "static", "int", "countArgumentPlaceholders2", "(", "final", "String", "messagePattern", ",", "final", "int", "[", "]", "indices", ")", "{", "if", "(", "messagePattern", "==", "null", ")", "{", "return", "0", ";", "}", "final", "int", "length", "=", "messa...
Counts the number of unescaped placeholders in the given messagePattern. @param messagePattern the message pattern to be analyzed. @return the number of unescaped placeholders.
[ "Counts", "the", "number", "of", "unescaped", "placeholders", "in", "the", "given", "messagePattern", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/ParameterFormatter.java#L104-L129
train
Count argument placeholders 2.
Of course, here is the Java code you requested: ```java static int countArgumentPlaceholders2(final String messagePattern, final int[] indices) { if (messagePattern == null) { return 0; } final int length = messagePattern.length(); int result = 0; boolean isEscaped =...
rterp/GMapsFX
GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java
JavascriptRuntime.getConstructor
@Override public String getConstructor(String javascriptObjectType, Object... args) { return getFunction("new " + javascriptObjectType, args); }
java
@Override public String getConstructor(String javascriptObjectType, Object... args) { return getFunction("new " + javascriptObjectType, args); }
[ "@", "Override", "public", "String", "getConstructor", "(", "String", "javascriptObjectType", ",", "Object", "...", "args", ")", "{", "return", "getFunction", "(", "\"new \"", "+", "javascriptObjectType", ",", "args", ")", ";", "}" ]
Gets a constructor as a string which then can be passed to the execute(). @param javascriptObjectType The type of JavaScript object to create @param args The args of the constructor @return A string which can be passed to the JavaScript environment to create a new object.
[ "Gets", "a", "constructor", "as", "a", "string", "which", "then", "can", "be", "passed", "to", "the", "execute", "()", "." ]
4623d3f768e8ad78fc50ee32dd204d236e01059f
https://github.com/rterp/GMapsFX/blob/4623d3f768e8ad78fc50ee32dd204d236e01059f/GMapsFX/src/main/java/com/lynden/gmapsfx/javascript/JavascriptRuntime.java#L79-L82
train
Get the constructor name.
Of course, here is the Java code you requested: ```java @Override public String getConstructor(String javascriptObjectType, Object... args) { return getFunction("new " + javascriptObjectType, args); } ``` Hope this helps!
GoogleCloudPlatform/bigdata-interop
gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java
GoogleCloudStorageFileSystem.delete
public void delete(URI path, boolean recursive) throws IOException { Preconditions.checkNotNull(path, "path can not be null"); checkArgument(!path.equals(GCS_ROOT), "Cannot delete root path (%s)", path); logger.atFine().log("delete(%s, %s)", path, recursive); FileInfo fileInfo = getFileInfo(path); ...
java
public void delete(URI path, boolean recursive) throws IOException { Preconditions.checkNotNull(path, "path can not be null"); checkArgument(!path.equals(GCS_ROOT), "Cannot delete root path (%s)", path); logger.atFine().log("delete(%s, %s)", path, recursive); FileInfo fileInfo = getFileInfo(path); ...
[ "public", "void", "delete", "(", "URI", "path", ",", "boolean", "recursive", ")", "throws", "IOException", "{", "Preconditions", ".", "checkNotNull", "(", "path", ",", "\"path can not be null\"", ")", ";", "checkArgument", "(", "!", "path", ".", "equals", "(",...
Deletes one or more items indicated by the given path. <p>If path points to a directory: <ul> <li>if recursive is true, all items under that path are recursively deleted followed by deletion of the directory. <li>else, <ul> <li>the directory is deleted if it is empty, <li>else, an IOException is thrown. </ul> </ul> ...
[ "Deletes", "one", "or", "more", "items", "indicated", "by", "the", "given", "path", "." ]
918d91c80a63e36046edb28972a5c65d3326a858
https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L364-L413
train
Deletes the file or directory with the given path.
Of course, here is the Java code you requested: ```java public void delete(URI path, boolean recursive) throws IOException { Preconditions.checkNotNull(path, "path can not be null"); checkArgument(!path.equals(GCS_ROOT), "Cannot delete root path (%s)", path); logger.atFine().log("delete(%s, %s)", path, rec...
teatrove/teatrove
trove/src/main/java/org/teatrove/trove/net/LazySocket.java
LazySocket.setSendBufferSize
public void setSendBufferSize(int size) throws SocketException { if (mSocket != null) { mSocket.setSendBufferSize(size); } else { setOption(3, new Integer(size)); } }
java
public void setSendBufferSize(int size) throws SocketException { if (mSocket != null) { mSocket.setSendBufferSize(size); } else { setOption(3, new Integer(size)); } }
[ "public", "void", "setSendBufferSize", "(", "int", "size", ")", "throws", "SocketException", "{", "if", "(", "mSocket", "!=", "null", ")", "{", "mSocket", ".", "setSendBufferSize", "(", "size", ")", ";", "}", "else", "{", "setOption", "(", "3", ",", "new...
Option 3.
[ "Option", "3", "." ]
7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea
https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/trove/src/main/java/org/teatrove/trove/net/LazySocket.java#L172-L179
train
Sets the send buffer size.
Of course, here is the Java code you requested: ```java public void setSendBufferSize(int size) throws SocketException { if (mSocket != null) { mSocket.setSendBufferSize(size); } else { setOption(3, new Integer(size)); } } ``` Hope this helps!
deeplearning4j/deeplearning4j
nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java
TensorflowConversion.ndArrayFromTensor
public INDArray ndArrayFromTensor(TF_Tensor tensor) { int rank = TF_NumDims(tensor); int[] ndShape; if (rank == 0) { // scalar ndShape = new int[] { 1 }; } else { ndShape = new int[rank]; for (int i = 0; i < ndShape.length; i++) { ...
java
public INDArray ndArrayFromTensor(TF_Tensor tensor) { int rank = TF_NumDims(tensor); int[] ndShape; if (rank == 0) { // scalar ndShape = new int[] { 1 }; } else { ndShape = new int[rank]; for (int i = 0; i < ndShape.length; i++) { ...
[ "public", "INDArray", "ndArrayFromTensor", "(", "TF_Tensor", "tensor", ")", "{", "int", "rank", "=", "TF_NumDims", "(", "tensor", ")", ";", "int", "[", "]", "ndShape", ";", "if", "(", "rank", "==", "0", ")", "{", "// scalar", "ndShape", "=", "new", "in...
Convert a {@link INDArray} to a {@link TF_Tensor} using zero copy. It will use the underlying pointer with in nd4j. @param tensor the tensor to use @return
[ "Convert", "a", "{" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-tensorflow/src/main/java/org/nd4j/tensorflow/conversion/TensorflowConversion.java#L201-L244
train
This method is used to get the nd array from a TF_Tensor
Of course, here is the Java code you requested: ```java public INDArray ndArrayFromTensor(TF_Tensor tensor) { int rank = TF_NumDims(tensor); int[] ndShape; if (rank == 0) { // scalar ndShape = new int[] { 1 }; } else { ndShape = new int[rank]; ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java
ArrayDeque.removeLastOccurrence
public boolean removeLastOccurrence(Object o) { if (o != null) { int mask = elements.length - 1; int i = (tail - 1) & mask; for (Object x; (x = elements[i]) != null; i = (i - 1) & mask) { if (o.equals(x)) { delete(i); re...
java
public boolean removeLastOccurrence(Object o) { if (o != null) { int mask = elements.length - 1; int i = (tail - 1) & mask; for (Object x; (x = elements[i]) != null; i = (i - 1) & mask) { if (o.equals(x)) { delete(i); re...
[ "public", "boolean", "removeLastOccurrence", "(", "Object", "o", ")", "{", "if", "(", "o", "!=", "null", ")", "{", "int", "mask", "=", "elements", ".", "length", "-", "1", ";", "int", "i", "=", "(", "tail", "-", "1", ")", "&", "mask", ";", "for",...
Removes the last occurrence of the specified element in this deque (when traversing the deque from head to tail). If the deque does not contain the element, it is unchanged. More formally, removes the last element {@code e} such that {@code o.equals(e)} (if such an element exists). Returns {@code true} if this deque co...
[ "Removes", "the", "last", "occurrence", "of", "the", "specified", "element", "in", "this", "deque", "(", "when", "traversing", "the", "deque", "from", "head", "to", "tail", ")", ".", "If", "the", "deque", "does", "not", "contain", "the", "element", "it", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/ArrayDeque.java#L374-L386
train
Remove the last occurrence of o from the list.
Of course, here is the Java code you requested: ```java public boolean removeLastOccurrence(Object o) { if (o != null) { int mask = elements.length - 1; int i = (tail - 1) & mask; for (Object x; (x = elements[i]) != null; i = (i - 1) & mask) { if (o.equals(x)...
SeaCloudsEU/SeaCloudsPlatform
deployer/src/main/java/org/apache/brooklyn/entity/php/httpd/PhpHttpdSshDriver.java
PhpHttpdSshDriver.configureHttpPort
private String configureHttpPort() { String result; result = String.format( "sudo sed -i 's@Listen[ 0-9]\\+@Listen %s@g' %s/ports.conf", getEntity().getHttpPort(), getEntity().getConfigurationDir() ); return result; }
java
private String configureHttpPort() { String result; result = String.format( "sudo sed -i 's@Listen[ 0-9]\\+@Listen %s@g' %s/ports.conf", getEntity().getHttpPort(), getEntity().getConfigurationDir() ); return result; }
[ "private", "String", "configureHttpPort", "(", ")", "{", "String", "result", ";", "result", "=", "String", ".", "format", "(", "\"sudo sed -i 's@Listen[ 0-9]\\\\+@Listen %s@g' %s/ports.conf\"", ",", "getEntity", "(", ")", ".", "getHttpPort", "(", ")", ",", "getEntit...
TODO the port configuration could be modified. So it is needed find Listen and change the port
[ "TODO", "the", "port", "configuration", "could", "be", "modified", ".", "So", "it", "is", "needed", "find", "Listen", "and", "change", "the", "port" ]
b199fe6de2c63b808cb248d3aca947d802375df8
https://github.com/SeaCloudsEU/SeaCloudsPlatform/blob/b199fe6de2c63b808cb248d3aca947d802375df8/deployer/src/main/java/org/apache/brooklyn/entity/php/httpd/PhpHttpdSshDriver.java#L245-L253
train
Configure HTTP port.
Of course, here is the Java code you requested: ```java private String configureHttpPort() { String result; result = String.format( "sudo sed -i 's@Listen[ 0-9]\\+@Listen %s@g' %s/ports.conf", getEntity().getHttpPort(), getEntity().getConfigurationDir() ...
MenoData/Time4J
base/src/main/java/net/time4j/range/IntervalCollection.java
IntervalCollection.plus
public IntervalCollection<T> plus(ChronoInterval<T> interval) { if (interval.isEmpty()) { return this; } List<ChronoInterval<T>> windows = new ArrayList<>(this.intervals); windows.add(this.adjust(interval)); windows.sort(this.getComparator()); return this.cr...
java
public IntervalCollection<T> plus(ChronoInterval<T> interval) { if (interval.isEmpty()) { return this; } List<ChronoInterval<T>> windows = new ArrayList<>(this.intervals); windows.add(this.adjust(interval)); windows.sort(this.getComparator()); return this.cr...
[ "public", "IntervalCollection", "<", "T", ">", "plus", "(", "ChronoInterval", "<", "T", ">", "interval", ")", "{", "if", "(", "interval", ".", "isEmpty", "(", ")", ")", "{", "return", "this", ";", "}", "List", "<", "ChronoInterval", "<", "T", ">", ">...
/*[deutsch] <p>F&uuml;gt das angegebene Intervall hinzu. </p> <p>Ein leeres Intervall wird ignoriert. </p> @param interval the new interval to be added @return new IntervalCollection-instance containing a sum of the own intervals and the given one while this instance remains unaffected @throws IllegalArgumentE...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "F&uuml", ";", "gt", "das", "angegebene", "Intervall", "hinzu", ".", "<", "/", "p", ">" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/IntervalCollection.java#L633-L644
train
Add an interval to the collection.
Of course, here is the Java code you requested: ```java public IntervalCollection<T> plus(ChronoInterval<T> interval) { if (interval.isEmpty()) { return this; } List<ChronoInterval<T>> windows = new ArrayList<>(this.intervals); windows.add(this.adjust(interval)); w...
aws/aws-sdk-java
aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/AccountSettings.java
AccountSettings.withUnmeteredRemoteAccessDevices
public AccountSettings withUnmeteredRemoteAccessDevices(java.util.Map<String, Integer> unmeteredRemoteAccessDevices) { setUnmeteredRemoteAccessDevices(unmeteredRemoteAccessDevices); return this; }
java
public AccountSettings withUnmeteredRemoteAccessDevices(java.util.Map<String, Integer> unmeteredRemoteAccessDevices) { setUnmeteredRemoteAccessDevices(unmeteredRemoteAccessDevices); return this; }
[ "public", "AccountSettings", "withUnmeteredRemoteAccessDevices", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "Integer", ">", "unmeteredRemoteAccessDevices", ")", "{", "setUnmeteredRemoteAccessDevices", "(", "unmeteredRemoteAccessDevices", ")", ";", "return",...
<p> Returns the unmetered remote access devices you have purchased or want to purchase. </p> @param unmeteredRemoteAccessDevices Returns the unmetered remote access devices you have purchased or want to purchase. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "Returns", "the", "unmetered", "remote", "access", "devices", "you", "have", "purchased", "or", "want", "to", "purchase", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/AccountSettings.java#L224-L227
train
Sets the unmeteredRemoteAccessDevices property.
Of course, here is the Java code you requested: ```java public AccountSettings withUnmeteredRemoteAccessDevices(java.util.Map<String, Integer> unmeteredRemoteAccessDevices) { setUnmeteredRemoteAccessDevices(unmeteredRemoteAccessDevices); return this; } ``` Hope this helps!
thinkaurelius/titan
titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Backend.java
Backend.getIndexInformation
public Map<String, IndexInformation> getIndexInformation() { ImmutableMap.Builder<String, IndexInformation> copy = ImmutableMap.builder(); copy.putAll(indexes); return copy.build(); }
java
public Map<String, IndexInformation> getIndexInformation() { ImmutableMap.Builder<String, IndexInformation> copy = ImmutableMap.builder(); copy.putAll(indexes); return copy.build(); }
[ "public", "Map", "<", "String", ",", "IndexInformation", ">", "getIndexInformation", "(", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "IndexInformation", ">", "copy", "=", "ImmutableMap", ".", "builder", "(", ")", ";", "copy", ".", "putAll"...
Get information about all registered {@link IndexProvider}s. @return
[ "Get", "information", "about", "all", "registered", "{", "@link", "IndexProvider", "}", "s", "." ]
ee226e52415b8bf43b700afac75fa5b9767993a5
https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/diskstorage/Backend.java#L310-L314
train
Gets the index information.
Of course, here is the Java code you requested: ```java public Map<String, IndexInformation> getIndexInformation() { ImmutableMap.Builder<String, IndexInformation> copy = ImmutableMap.builder(); copy.putAll(indexes); return copy.build(); } ``` Hope this helps!
Ordinastie/MalisisCore
src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java
IconProviderBuilder.getWallIconProvider
private IBlockIconProvider getWallIconProvider() { return (state, side) -> { if (side == EnumFacing.SOUTH || (side == EnumFacing.WEST && WallComponent.isCorner(state))) return insideIcon; return defaultIcon; }; }
java
private IBlockIconProvider getWallIconProvider() { return (state, side) -> { if (side == EnumFacing.SOUTH || (side == EnumFacing.WEST && WallComponent.isCorner(state))) return insideIcon; return defaultIcon; }; }
[ "private", "IBlockIconProvider", "getWallIconProvider", "(", ")", "{", "return", "(", "state", ",", "side", ")", "->", "{", "if", "(", "side", "==", "EnumFacing", ".", "SOUTH", "||", "(", "side", "==", "EnumFacing", ".", "WEST", "&&", "WallComponent", ".",...
Gets the {@link IBlockIconProvider} to use for {@link WallComponent}. @param insideIcon the inside icon @return the icon provider builder
[ "Gets", "the", "{", "@link", "IBlockIconProvider", "}", "to", "use", "for", "{", "@link", "WallComponent", "}", "." ]
4f8e1fa462d5c372fc23414482ba9f429881cc54
https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/icon/provider/IconProviderBuilder.java#L312-L319
train
Get the icon provider.
Of course, here is the Java code you requested: ```java private IBlockIconProvider getWallIconProvider() { return (state, side) -> { if (side == EnumFacing.SOUTH || (side == EnumFacing.WEST && WallComponent.isCorner(state))) return insideIcon; return defaultIcon; }; } ``` Hope this helps!
citygml4j/citygml4j
src-gen/main/java/net/opengis/citygml/vegetation/_1/ObjectFactory.java
ObjectFactory.create_GenericApplicationPropertyOfPlantCover
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/vegetation/1.0", name = "_GenericApplicationPropertyOfPlantCover") public JAXBElement<Object> create_GenericApplicationPropertyOfPlantCover(Object value) { return new JAXBElement<Object>(__GenericApplicationPropertyOfPlantCover_QNAME, Object.class,...
java
@XmlElementDecl(namespace = "http://www.opengis.net/citygml/vegetation/1.0", name = "_GenericApplicationPropertyOfPlantCover") public JAXBElement<Object> create_GenericApplicationPropertyOfPlantCover(Object value) { return new JAXBElement<Object>(__GenericApplicationPropertyOfPlantCover_QNAME, Object.class,...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/citygml/vegetation/1.0\"", ",", "name", "=", "\"_GenericApplicationPropertyOfPlantCover\"", ")", "public", "JAXBElement", "<", "Object", ">", "create_GenericApplicationPropertyOfPlantCover", "(", "Object", ...
Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link Object }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Object", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/citygml/vegetation/_1/ObjectFactory.java#L111-L114
train
Create an instance of the genericApplicationPropertyOfPlantCover property.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/citygml/vegetation/1.0", name = "_GenericApplicationPropertyOfPlantCover") public JAXBElement<Object> create_GenericApplicationPropertyOfPlantCover(Object value) { return new JAXBElement<Object>(__Ge...
landawn/AbacusUtil
src/com/landawn/abacus/util/ExceptionalStream.java
ExceptionalStream.distinct
public ExceptionalStream<T, E> distinct() { final Set<Object> set = new HashSet<>(); return filter(new Try.Predicate<T, E>() { @Override public boolean test(T value) { return set.add(hashKey(value)); } }); }
java
public ExceptionalStream<T, E> distinct() { final Set<Object> set = new HashSet<>(); return filter(new Try.Predicate<T, E>() { @Override public boolean test(T value) { return set.add(hashKey(value)); } }); }
[ "public", "ExceptionalStream", "<", "T", ",", "E", ">", "distinct", "(", ")", "{", "final", "Set", "<", "Object", ">", "set", "=", "new", "HashSet", "<>", "(", ")", ";", "return", "filter", "(", "new", "Try", ".", "Predicate", "<", "T", ",", "E", ...
Distinct and filter by occurrences. @param occurrencesFilter @return
[ "Distinct", "and", "filter", "by", "occurrences", "." ]
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/ExceptionalStream.java#L985-L994
train
Returns a stream of distinct tuples.
Of course, here is the Java code you requested: ```java public ExceptionalStream<T, E> distinct() { final Set<Object> set = new HashSet<>(); return filter(new Try.Predicate<T, E>() { @Override public boolean test(T value) { return set.add(hashKey(value)); ...
prestodb/presto
presto-orc/src/main/java/com/facebook/presto/orc/stream/BooleanInputStream.java
BooleanInputStream.getUnsetBits
public int getUnsetBits(int batchSize, boolean[] vector, int offset) throws IOException { int count = 0; for (int i = offset; i < batchSize + offset; i++) { vector[i] = !nextBit(); count += vector[i] ? 1 : 0; } return count; }
java
public int getUnsetBits(int batchSize, boolean[] vector, int offset) throws IOException { int count = 0; for (int i = offset; i < batchSize + offset; i++) { vector[i] = !nextBit(); count += vector[i] ? 1 : 0; } return count; }
[ "public", "int", "getUnsetBits", "(", "int", "batchSize", ",", "boolean", "[", "]", "vector", ",", "int", "offset", ")", "throws", "IOException", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "offset", ";", "i", "<", "batchSize", "...
Sets the vector element to true for the batchSize number of elements starting at offset if the bit is not set.
[ "Sets", "the", "vector", "element", "to", "true", "for", "the", "batchSize", "number", "of", "elements", "starting", "at", "offset", "if", "the", "bit", "is", "not", "set", "." ]
89de5e379d8f85e139d292b0add8c537a2a01a88
https://github.com/prestodb/presto/blob/89de5e379d8f85e139d292b0add8c537a2a01a88/presto-orc/src/main/java/com/facebook/presto/orc/stream/BooleanInputStream.java#L182-L191
train
getUnsetBits This method returns the number of set bits in the array.
Of course, here is the Java code you requested: ```java public int getUnsetBits(int batchSize, boolean[] vector, int offset) throws IOException { int count = 0; for (int i = offset; i < batchSize + offset; i++) { vector[i] = !nextBit(); count += vector[i] ? 1 : 0...
eclipse/xtext-extras
org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java
InternalPureXbaseParser.ruleXExpressionInClosure
public final EObject ruleXExpressionInClosure() throws RecognitionException { EObject current = null; Token otherlv_2=null; EObject lv_expressions_1_0 = null; enterRule(); try { // InternalPureXbase.g:3315:2: ( ( () ( ( (lv_expressions_1_0= ruleXExpressionOrVarD...
java
public final EObject ruleXExpressionInClosure() throws RecognitionException { EObject current = null; Token otherlv_2=null; EObject lv_expressions_1_0 = null; enterRule(); try { // InternalPureXbase.g:3315:2: ( ( () ( ( (lv_expressions_1_0= ruleXExpressionOrVarD...
[ "public", "final", "EObject", "ruleXExpressionInClosure", "(", ")", "throws", "RecognitionException", "{", "EObject", "current", "=", "null", ";", "Token", "otherlv_2", "=", "null", ";", "EObject", "lv_expressions_1_0", "=", "null", ";", "enterRule", "(", ")", "...
InternalPureXbase.g:3309:1: ruleXExpressionInClosure returns [EObject current=null] : ( () ( ( (lv_expressions_1_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_2= ';' )? )* ) ;
[ "InternalPureXbase", ".", "g", ":", "3309", ":", "1", ":", "ruleXExpressionInClosure", "returns", "[", "EObject", "current", "=", "null", "]", ":", "(", "()", "(", "(", "(", "lv_expressions_1_0", "=", "ruleXExpressionOrVarDeclaration", ")", ")", "(", "otherlv_...
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.purexbase/src-gen/org/eclipse/xtext/purexbase/parser/antlr/internal/InternalPureXbaseParser.java#L9372-L9504
train
Capture a Rule in Closure
Of course, here is the Java code you requested: ```java public final EObject ruleXExpressionInClosure() throws RecognitionException { EObject current = null; Token otherlv_2=null; EObject lv_expressions_1_0 = null; enterRule(); try { // InternalPureXbase.g:3315...
deeplearning4j/deeplearning4j
deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java
ComputationGraph.evaluate
public <T extends Evaluation> T evaluate(MultiDataSetIterator iterator) { return evaluate(iterator, (List<String>)null); }
java
public <T extends Evaluation> T evaluate(MultiDataSetIterator iterator) { return evaluate(iterator, (List<String>)null); }
[ "public", "<", "T", "extends", "Evaluation", ">", "T", "evaluate", "(", "MultiDataSetIterator", "iterator", ")", "{", "return", "evaluate", "(", "iterator", ",", "(", "List", "<", "String", ">", ")", "null", ")", ";", "}" ]
Evaluate the network (classification performance - single output ComputationGraphs only) @param iterator Iterator to evaluate on @return Evaluation object; results of evaluation on all examples in the data set
[ "Evaluate", "the", "network", "(", "classification", "performance", "-", "single", "output", "ComputationGraphs", "only", ")" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/graph/ComputationGraph.java#L3812-L3814
train
Evaluate a multi data set iterator.
Of course, here is the Java code you requested: ```java public <T extends Evaluation> T evaluate(MultiDataSetIterator iterator) { return evaluate(iterator, (List<String>)null); } ``` Hope this helps!
googleads/googleads-java-lib
modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/LocationCriterionServiceLocator.java
LocationCriterionServiceLocator.getPort
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.google.api.ads.adwords.axis.v201809.cm.LocationCriterionServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) { com.google.api.ads.adwords.axis.v201809.cm...
java
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.google.api.ads.adwords.axis.v201809.cm.LocationCriterionServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) { com.google.api.ads.adwords.axis.v201809.cm...
[ "public", "java", ".", "rmi", ".", "Remote", "getPort", "(", "Class", "serviceEndpointInterface", ")", "throws", "javax", ".", "xml", ".", "rpc", ".", "ServiceException", "{", "try", "{", "if", "(", "com", ".", "google", ".", "api", ".", "ads", ".", "a...
For the given interface, get the stub implementation. If this service has no port for the given interface, then ServiceException is thrown.
[ "For", "the", "given", "interface", "get", "the", "stub", "implementation", ".", "If", "this", "service", "has", "no", "port", "for", "the", "given", "interface", "then", "ServiceException", "is", "thrown", "." ]
967957cc4f6076514e3a7926fe653e4f1f7cc9c9
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/LocationCriterionServiceLocator.java#L87-L99
train
Gets the remote port for the given interface.
Of course, here is the Java code you requested: ```java public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { try { if (com.google.api.ads.adwords.axis.v201809.cm.LocationCriterionServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) { ...
twilio/twilio-java
src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java
FunctionVersion.fetcher
public static FunctionVersionFetcher fetcher(final String pathServiceSid, final String pathFunctionSid, final String pathSid) { return new FunctionVersionFetcher(pathServiceSid, pathFunctionSid, pathSid); }
java
public static FunctionVersionFetcher fetcher(final String pathServiceSid, final String pathFunctionSid, final String pathSid) { return new FunctionVersionFetcher(pathServiceSid, pathFunctionSid, pathSid); }
[ "public", "static", "FunctionVersionFetcher", "fetcher", "(", "final", "String", "pathServiceSid", ",", "final", "String", "pathFunctionSid", ",", "final", "String", "pathSid", ")", "{", "return", "new", "FunctionVersionFetcher", "(", "pathServiceSid", ",", "pathFunct...
Create a FunctionVersionFetcher to execute fetch. @param pathServiceSid The service_sid @param pathFunctionSid The function_sid @param pathSid The sid @return FunctionVersionFetcher capable of executing the fetch
[ "Create", "a", "FunctionVersionFetcher", "to", "execute", "fetch", "." ]
0318974c0a6a152994af167d430255684d5e9b9f
https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/serverless/v1/service/function/FunctionVersion.java#L92-L96
train
Create a FunctionVersionFetcher to execute fetch.
Of course, here is the Java code you requested: ```java public static FunctionVersionFetcher fetcher(final String pathServiceSid, final String pathFunctionSid, final String pathSid) { return new FunctionVersionF...
Axway/Grapes
server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java
ArtifactResource.get
@GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{gavc}") public Response get(@PathParam("gavc") final String gavc){ if(LOG.isInfoEnabled()) { LOG.info(String.format("Got a get artifact request [%s]", gavc)); } final ArtifactView view = new Artif...
java
@GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{gavc}") public Response get(@PathParam("gavc") final String gavc){ if(LOG.isInfoEnabled()) { LOG.info(String.format("Got a get artifact request [%s]", gavc)); } final ArtifactView view = new Artif...
[ "@", "GET", "@", "Produces", "(", "{", "MediaType", ".", "TEXT_HTML", ",", "MediaType", ".", "APPLICATION_JSON", "}", ")", "@", "Path", "(", "\"/{gavc}\"", ")", "public", "Response", "get", "(", "@", "PathParam", "(", "\"gavc\"", ")", "final", "String", ...
Return an Artifact regarding its gavc. This method is call via GET <grapes_url>/artifact/<gavc> @param gavc String @return Response An artifact in HTML or JSON
[ "Return", "an", "Artifact", "regarding", "its", "gavc", ".", "This", "method", "is", "call", "via", "GET", "<grapes_url", ">", "/", "artifact", "/", "<gavc", ">" ]
ce9cc73d85f83eaa5fbc991abb593915a8c8374e
https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/webapp/resources/ArtifactResource.java#L212-L241
train
Get a single entity from the database.
Of course, here is the Java code you requested: ```java @GET @Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) @Path("/{gavc}") public Response get(@PathParam("gavc") final String gavc){ if(LOG.isInfoEnabled()) { LOG.info(String.format("Got a get artifact request [%s]", gavc)...
xvik/dropwizard-guicey
src/main/java/ru/vyarus/dropwizard/guice/module/context/Disables.java
Disables.registeredBy
public static Predicate<ItemInfo> registeredBy(final ConfigScope... types) { return registeredBy(Arrays.stream(types).map(ConfigScope::getType).toArray(Class<?>[]::new)); }
java
public static Predicate<ItemInfo> registeredBy(final ConfigScope... types) { return registeredBy(Arrays.stream(types).map(ConfigScope::getType).toArray(Class<?>[]::new)); }
[ "public", "static", "Predicate", "<", "ItemInfo", ">", "registeredBy", "(", "final", "ConfigScope", "...", "types", ")", "{", "return", "registeredBy", "(", "Arrays", ".", "stream", "(", "types", ")", ".", "map", "(", "ConfigScope", "::", "getType", ")", "...
Shortcut for {@link #registeredBy(Class[])} for for special scopes (like classpath scan, bundles lookup etc). @param types special scopes @return items registered in specific contexts predicate
[ "Shortcut", "for", "{", "@link", "#registeredBy", "(", "Class", "[]", ")", "}", "for", "for", "special", "scopes", "(", "like", "classpath", "scan", "bundles", "lookup", "etc", ")", "." ]
dd39ad77283555be21f606d5ebf0f11207a733d4
https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/context/Disables.java#L27-L29
train
Create a predicate that returns true if an item is registered by one of the given scopes.
Of course, here is the Java code you requested: ```java public static Predicate<ItemInfo> registeredBy(final ConfigScope... types) { return registeredBy(Arrays.stream(types).map(ConfigScope::getType).toArray(Class<?>[]::new)); } ``` Hope this helps!
gitblit/fathom
fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java
ControllerHandler.configureContentTypeSuffixes
protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) { if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) { return Collections.emptySet(); } Set<String> suffixes = new TreeSet<>(); for (String suffix : engines.getContentTypeSuff...
java
protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) { if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) { return Collections.emptySet(); } Set<String> suffixes = new TreeSet<>(); for (String suffix : engines.getContentTypeSuff...
[ "protected", "Set", "<", "String", ">", "configureContentTypeSuffixes", "(", "ContentTypeEngines", "engines", ")", "{", "if", "(", "null", "==", "ClassUtil", ".", "getAnnotation", "(", "method", ",", "ContentTypeBySuffix", ".", "class", ")", ")", "{", "return", ...
Configures the content-type suffixes @param engines @return acceptable content-type suffixes
[ "Configures", "the", "content", "-", "type", "suffixes" ]
f2f820eb16e9fea1e36ad4eda4ed51b35f056538
https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L298-L311
train
Configure the content type suffixes.
Of course, here is the Java code you requested: ```java protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) { if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) { return Collections.emptySet(); } Set<String> suffixes = new TreeSet<>()...
vigna/fastutil
src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java
FastByteArrayInputStream.read
@Override public int read(final byte b[], final int offset, final int length) { if (this.length == this.position) return length == 0 ? 0 : -1; final int n = Math.min(length, this.length - this.position); System.arraycopy(array, this.offset + this.position, b, offset, n); this.position += n; return n; }
java
@Override public int read(final byte b[], final int offset, final int length) { if (this.length == this.position) return length == 0 ? 0 : -1; final int n = Math.min(length, this.length - this.position); System.arraycopy(array, this.offset + this.position, b, offset, n); this.position += n; return n; }
[ "@", "Override", "public", "int", "read", "(", "final", "byte", "b", "[", "]", ",", "final", "int", "offset", ",", "final", "int", "length", ")", "{", "if", "(", "this", ".", "length", "==", "this", ".", "position", ")", "return", "length", "==", "...
Reads bytes from this byte-array input stream as specified in {@link java.io.InputStream#read(byte[], int, int)}. Note that the implementation given in {@link java.io.ByteArrayInputStream#read(byte[], int, int)} will return -1 on a zero-length read at EOF, contrarily to the specification. We won't.
[ "Reads", "bytes", "from", "this", "byte", "-", "array", "input", "stream", "as", "specified", "in", "{" ]
192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c
https://github.com/vigna/fastutil/blob/192ce83affa4a6f2ad34a96c15b5f2ec2929cf1c/src/it/unimi/dsi/fastutil/io/FastByteArrayInputStream.java#L113-L120
test
Read length bytes from the buffer.
Of course, here is the Java code you requested: ```java @Override public int read(final byte b[], final int offset, final int length) { if (this.length == this.position) return length == 0 ? 0 : -1; final int n = Math.min(length, this.length - this.position); System.arraycopy(array, this.offset + this.position,...
OpenLiberty/open-liberty
dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseStoreService.java
DatabaseStoreService.unsetUowCurrent
protected void unsetUowCurrent(ServiceReference<UOWCurrent> ref) { if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetUowCurrent", "unsetting " + ref); } uowCurren...
java
protected void unsetUowCurrent(ServiceReference<UOWCurrent> ref) { if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetUowCurrent", "unsetting " + ref); } uowCurren...
[ "protected", "void", "unsetUowCurrent", "(", "ServiceReference", "<", "UOWCurrent", ">", "ref", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "LoggingUtil", ".", "SESSION_LOGGER_WAS", ".", "isLoggable", "(", "Level", ".", "FI...
Declarative Services method for unsetting the UOWCurrent service reference @param ref reference to service object; type of service object is verified
[ "Declarative", "Services", "method", "for", "unsetting", "the", "UOWCurrent", "service", "reference" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.db/src/com/ibm/ws/session/store/db/DatabaseStoreService.java#L312-L317
train
unset the UOWCurrent service reference
Of course, here is the Java code you requested: ```java protected void unsetUowCurrent(ServiceReference<UOWCurrent> ref) { if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "unsetUowC...
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java
CMMClassifier.loadClassifier
@SuppressWarnings("unchecked") @Override public void loadClassifier(ObjectInputStream ois, Properties props) throws ClassCastException, IOException, ClassNotFoundException { classifier = (LinearClassifier<String, String>) ois.readObject(); flags = (SeqClassifierFlags) ois.readObject(); featureFacto...
java
@SuppressWarnings("unchecked") @Override public void loadClassifier(ObjectInputStream ois, Properties props) throws ClassCastException, IOException, ClassNotFoundException { classifier = (LinearClassifier<String, String>) ois.readObject(); flags = (SeqClassifierFlags) ois.readObject(); featureFacto...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "void", "loadClassifier", "(", "ObjectInputStream", "ois", ",", "Properties", "props", ")", "throws", "ClassCastException", ",", "IOException", ",", "ClassNotFoundException", "{", "classifi...
Load a classifier from the given Stream. <i>Implementation note: </i> This method <i>does not</i> close the Stream that it reads from. @param ois The ObjectInputStream to load the serialized classifier from @throws IOException If there are problems accessing the input stream @throws ClassCastException If there are pr...
[ "Load", "a", "classifier", "from", "the", "given", "Stream", ".", "<i", ">", "Implementation", "note", ":", "<", "/", "i", ">", "This", "method", "<i", ">", "does", "not<", "/", "i", ">", "close", "the", "Stream", "that", "it", "reads", "from", "." ]
b3d44bab9ec07ace0d13612c448a6b7298c1f681
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ie/ner/CMMClassifier.java#L1077-L1093
train
This method loads the data from an input stream.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void loadClassifier(ObjectInputStream ois, Properties props) throws ClassCastException, IOException, ClassNotFoundException { classifier = (LinearClassifier<String, String>) ois.readObject(); flags =...
lessthanoptimal/BoofCV
main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/impl/ImplOrientationAverageGradientIntegral.java
ImplOrientationAverageGradientIntegral.computeWeighted
protected double computeWeighted( double tl_x, double tl_y, double samplePeriod , SparseImageGradient<T,G> g ) { // add 0.5 to c_x and c_y to have it round tl_x += 0.5; tl_y += 0.5; double Dx=0,Dy=0; int i = 0; for(int y = 0; y < sampleWidth; y++ ) { int pixelsY = (int)(tl_y + y...
java
protected double computeWeighted( double tl_x, double tl_y, double samplePeriod , SparseImageGradient<T,G> g ) { // add 0.5 to c_x and c_y to have it round tl_x += 0.5; tl_y += 0.5; double Dx=0,Dy=0; int i = 0; for(int y = 0; y < sampleWidth; y++ ) { int pixelsY = (int)(tl_y + y...
[ "protected", "double", "computeWeighted", "(", "double", "tl_x", ",", "double", "tl_y", ",", "double", "samplePeriod", ",", "SparseImageGradient", "<", "T", ",", "G", ">", "g", ")", "{", "// add 0.5 to c_x and c_y to have it round", "tl_x", "+=", "0.5", ";", "tl...
Compute the gradient while checking for border conditions
[ "Compute", "the", "gradient", "while", "checking", "for", "border", "conditions" ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/orientation/impl/ImplOrientationAverageGradientIntegral.java#L103-L127
train
Compute the weighted weight of the image.
Of course, here is the Java code you requested: ```java protected double computeWeighted( double tl_x, double tl_y, double samplePeriod , SparseImageGradient<T,G> g ) { // add 0.5 to c_x and c_y to have it round tl_x += 0.5; tl_y += 0.5; double Dx=0,Dy=0; int i = 0; for(int y = 0;...
markzhai/AndroidPerformanceMonitor
blockcanary-android/src/main/java/com/github/moduth/blockcanary/BlockCanary.java
BlockCanary.isMonitorDurationEnd
public boolean isMonitorDurationEnd() { long startTime = PreferenceManager.getDefaultSharedPreferences(BlockCanaryContext.get().provideContext()) .getLong("BlockCanary_StartTime", 0); return startTime != 0 && System.currentTimeMillis() - startTime > ...
java
public boolean isMonitorDurationEnd() { long startTime = PreferenceManager.getDefaultSharedPreferences(BlockCanaryContext.get().provideContext()) .getLong("BlockCanary_StartTime", 0); return startTime != 0 && System.currentTimeMillis() - startTime > ...
[ "public", "boolean", "isMonitorDurationEnd", "(", ")", "{", "long", "startTime", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "BlockCanaryContext", ".", "get", "(", ")", ".", "provideContext", "(", ")", ")", ".", "getLong", "(", "\"BlockCanar...
Is monitor duration end, compute from recordStartTime end provideMonitorDuration. @return true if ended
[ "Is", "monitor", "duration", "end", "compute", "from", "recordStartTime", "end", "provideMonitorDuration", "." ]
ed688391cdf95742892ce61494736667cf5baf08
https://github.com/markzhai/AndroidPerformanceMonitor/blob/ed688391cdf95742892ce61494736667cf5baf08/blockcanary-android/src/main/java/com/github/moduth/blockcanary/BlockCanary.java#L126-L132
train
Checks if the monitor duration is end.
Of course, here is the Java code you requested: ```java public boolean isMonitorDurationEnd() { long startTime = PreferenceManager.getDefaultSharedPreferences(BlockCanaryContext.get().provideContext()) .getLong("BlockCanary_StartTime", 0); return startTime != 0 &...
sporniket/core
sporniket-core-ui/src/main/java/com/sporniket/libre/ui/action/AdaptedAction.java
AdaptedAction.retrieveIcon
private ImageIcon retrieveIcon(IconLocationType location) { try { return myIconProvider.retrieveIcon(location); } catch (Exception _exception) { System.err.println(_exception.getMessage()); } return null; }
java
private ImageIcon retrieveIcon(IconLocationType location) { try { return myIconProvider.retrieveIcon(location); } catch (Exception _exception) { System.err.println(_exception.getMessage()); } return null; }
[ "private", "ImageIcon", "retrieveIcon", "(", "IconLocationType", "location", ")", "{", "try", "{", "return", "myIconProvider", ".", "retrieveIcon", "(", "location", ")", ";", "}", "catch", "(", "Exception", "_exception", ")", "{", "System", ".", "err", ".", ...
Load the icon file. @param location Path to the file.
[ "Load", "the", "icon", "file", "." ]
3480ebd72a07422fcc09971be2607ee25efb2c26
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ui/src/main/java/com/sporniket/libre/ui/action/AdaptedAction.java#L180-L191
train
Retrieve an image icon from the specified location.
Of course, here is the Java code you requested: ```java private ImageIcon retrieveIcon(IconLocationType location) { try { return myIconProvider.retrieveIcon(location); } catch (Exception _exception) { System.err.println(_exception.getMessage()); } return null; } ``` Hope this helps!
citygml4j/citygml4j
src-gen/main/java/net/opengis/gml/ObjectFactory.java
ObjectFactory.createTriangulatedSurface
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TriangulatedSurface", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "Surface") public JAXBElement<TriangulatedSurfaceType> createTriangulatedSurface(TriangulatedSurfaceType value) { return new JAXBElement<Tr...
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TriangulatedSurface", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "Surface") public JAXBElement<TriangulatedSurfaceType> createTriangulatedSurface(TriangulatedSurfaceType value) { return new JAXBElement<Tr...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/gml\"", ",", "name", "=", "\"TriangulatedSurface\"", ",", "substitutionHeadNamespace", "=", "\"http://www.opengis.net/gml\"", ",", "substitutionHeadName", "=", "\"Surface\"", ")", "public", "JAXBElement",...
Create an instance of {@link JAXBElement }{@code <}{@link TriangulatedSurfaceType }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link TriangulatedSurfaceType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "TriangulatedSurfaceType", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L5121-L5124
train
Create an instance of the TriangulatedSurface feature.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "TriangulatedSurface", substitutionHeadNamespace = "http://www.opengis.net/gml", substitutionHeadName = "Surface") public JAXBElement<TriangulatedSurfaceType> createTriangulatedSurface(Triangula...
logic-ng/LogicNG
src/main/java/org/logicng/solvers/datastructures/LNGHeap.java
LNGHeap.build
public void build(final LNGIntVector ns) { for (int i = 0; i < this.heap.size(); i++) this.indices.set(this.heap.get(i), -1); this.heap.clear(); for (int i = 0; i < ns.size(); i++) { this.indices.set(ns.get(i), i); this.heap.push(ns.get(i)); } for (int i = this.heap.size() / 2 - 1;...
java
public void build(final LNGIntVector ns) { for (int i = 0; i < this.heap.size(); i++) this.indices.set(this.heap.get(i), -1); this.heap.clear(); for (int i = 0; i < ns.size(); i++) { this.indices.set(ns.get(i), i); this.heap.push(ns.get(i)); } for (int i = this.heap.size() / 2 - 1;...
[ "public", "void", "build", "(", "final", "LNGIntVector", "ns", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "heap", ".", "size", "(", ")", ";", "i", "++", ")", "this", ".", "indices", ".", "set", "(", "this", ".", "...
Rebuilds the heap from a given vector of elements. @param ns the vector of elements
[ "Rebuilds", "the", "heap", "from", "a", "given", "vector", "of", "elements", "." ]
bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e
https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/datastructures/LNGHeap.java#L191-L201
train
Build the index vector.
Of course, here is the Java code you requested: ```java public void build(final LNGIntVector ns) { for (int i = 0; i < this.heap.size(); i++) this.indices.set(this.heap.get(i), -1); this.heap.clear(); for (int i = 0; i < ns.size(); i++) { this.indices.set(ns.get(i), i); this.heap.push(ns....
atomix/copycat
server/src/main/java/io/atomix/copycat/server/state/LeaderState.java
LeaderState.configure
protected CompletableFuture<Long> configure(Collection<Member> members) { final long index; try (ConfigurationEntry entry = context.getLog().create(ConfigurationEntry.class)) { entry.setTerm(context.getTerm()) .setTimestamp(System.currentTimeMillis()) .setMembers(members); index = co...
java
protected CompletableFuture<Long> configure(Collection<Member> members) { final long index; try (ConfigurationEntry entry = context.getLog().create(ConfigurationEntry.class)) { entry.setTerm(context.getTerm()) .setTimestamp(System.currentTimeMillis()) .setMembers(members); index = co...
[ "protected", "CompletableFuture", "<", "Long", ">", "configure", "(", "Collection", "<", "Member", ">", "members", ")", "{", "final", "long", "index", ";", "try", "(", "ConfigurationEntry", "entry", "=", "context", ".", "getLog", "(", ")", ".", "create", "...
Commits the given configuration.
[ "Commits", "the", "given", "configuration", "." ]
c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10
https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/state/LeaderState.java#L217-L239
train
Configure the cluster.
Of course, here is the Java code you requested: ```java protected CompletableFuture<Long> configure(Collection<Member> members) { final long index; try (ConfigurationEntry entry = context.getLog().create(ConfigurationEntry.class)) { entry.setTerm(context.getTerm()) .setTimestamp(System.currentTim...
alkacon/opencms-core
src/org/opencms/cmis/CmsCmisUtil.java
CmsCmisUtil.checkResourceName
public static void checkResourceName(String name) { try { CmsResource.checkResourceName(name); } catch (CmsIllegalArgumentException e) { throw new CmisNameConstraintViolationException(e.getLocalizedMessage(), e); } }
java
public static void checkResourceName(String name) { try { CmsResource.checkResourceName(name); } catch (CmsIllegalArgumentException e) { throw new CmisNameConstraintViolationException(e.getLocalizedMessage(), e); } }
[ "public", "static", "void", "checkResourceName", "(", "String", "name", ")", "{", "try", "{", "CmsResource", ".", "checkResourceName", "(", "name", ")", ";", "}", "catch", "(", "CmsIllegalArgumentException", "e", ")", "{", "throw", "new", "CmisNameConstraintViol...
Checks whether a name is a valid OpenCms resource name and throws an exception otherwise.<p> @param name the name to check
[ "Checks", "whether", "a", "name", "is", "a", "valid", "OpenCms", "resource", "name", "and", "throws", "an", "exception", "otherwise", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/cmis/CmsCmisUtil.java#L414-L421
train
Checks if the resource name is a valid UID.
Of course, here is the Java code you requested: ```java public static void checkResourceName(String name) { try { CmsResource.checkResourceName(name); } catch (CmsIllegalArgumentException e) { throw new CmisNameConstraintViolationException(e.getLocalizedMessage(), e); ...
flow/caustic
api/src/main/java/com/flowpowered/caustic/api/Material.java
Material.setProgram
public void setProgram(Program program) { if (program == null) { throw new IllegalStateException("Program cannot be null"); } program.checkCreated(); this.program = program; }
java
public void setProgram(Program program) { if (program == null) { throw new IllegalStateException("Program cannot be null"); } program.checkCreated(); this.program = program; }
[ "public", "void", "setProgram", "(", "Program", "program", ")", "{", "if", "(", "program", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Program cannot be null\"", ")", ";", "}", "program", ".", "checkCreated", "(", ")", ";", "this...
Sets the program to be used by this material to shade the models. @param program The program to use
[ "Sets", "the", "program", "to", "be", "used", "by", "this", "material", "to", "shade", "the", "models", "." ]
88652fcf0621ce158a0e92ce4c570ed6b1f6fca9
https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/Material.java#L101-L107
train
Sets the program for this exception.
Of course, here is the Java code you requested: ```java public void setProgram(Program program) { if (program == null) { throw new IllegalStateException("Program cannot be null"); } program.checkCreated(); this.program = program; } ``` Hope this helps!
RestComm/sip-servlets
sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipFactoryFacade.java
SipFactoryFacade.createSipURI
public SipURI createSipURI(String user, String host) { return sipFactoryImpl.createSipURI(user, host); }
java
public SipURI createSipURI(String user, String host) { return sipFactoryImpl.createSipURI(user, host); }
[ "public", "SipURI", "createSipURI", "(", "String", "user", ",", "String", "host", ")", "{", "return", "sipFactoryImpl", ".", "createSipURI", "(", "user", ",", "host", ")", ";", "}" ]
/* (non-Javadoc) @see javax.servlet.sip.SipFactory#createSipURI(java.lang.String, java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
fd7011d2803ab1d205b140768a760c8c69e0c997
https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/message/SipFactoryFacade.java#L194-L196
train
Create a SipURI object from the given user and host.
Of course, here is the Java code you requested: ```java public SipURI createSipURI(String user, String host) { return sipFactoryImpl.createSipURI(user, host); } ``` Hope this helps!
arangodb/spring-data
src/main/java/com/arangodb/springframework/repository/SimpleArangoRepository.java
SimpleArangoRepository.findAllById
@Override public Iterable<T> findAllById(final Iterable<ID> ids) { return arangoOperations.find(ids, domainClass); }
java
@Override public Iterable<T> findAllById(final Iterable<ID> ids) { return arangoOperations.find(ids, domainClass); }
[ "@", "Override", "public", "Iterable", "<", "T", ">", "findAllById", "(", "final", "Iterable", "<", "ID", ">", "ids", ")", "{", "return", "arangoOperations", ".", "find", "(", "ids", ",", "domainClass", ")", ";", "}" ]
Finds all documents with the an id or key in the argument @param ids an iterable with ids/keys of documents to get @return an iterable with documents in the collection which have a id/key in the argument
[ "Finds", "all", "documents", "with", "the", "an", "id", "or", "key", "in", "the", "argument" ]
ff8ae53986b353964b9b90bd8199996d5aabf0c1
https://github.com/arangodb/spring-data/blob/ff8ae53986b353964b9b90bd8199996d5aabf0c1/src/main/java/com/arangodb/springframework/repository/SimpleArangoRepository.java#L154-L157
train
Find all entities by id.
Of course, here is the Java code you requested: ```java @Override public Iterable<T> findAllById(final Iterable<ID> ids) { return arangoOperations.find(ids, domainClass); } ``` Hope this helps!
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java
JavaBean.isSimple
public static boolean isSimple(Object aObject) { if(aObject == null || aObject.getClass() ==null || aObject.getClass().getName() == null ) return true; return aObject instanceof Date || aObject instanceof Number || aO...
java
public static boolean isSimple(Object aObject) { if(aObject == null || aObject.getClass() ==null || aObject.getClass().getName() == null ) return true; return aObject instanceof Date || aObject instanceof Number || aO...
[ "public", "static", "boolean", "isSimple", "(", "Object", "aObject", ")", "{", "if", "(", "aObject", "==", "null", "||", "aObject", ".", "getClass", "(", ")", "==", "null", "||", "aObject", ".", "getClass", "(", ")", ".", "getName", "(", ")", "==", "...
--------------------------------------------------------
[ "--------------------------------------------------------" ]
38d5b843c76eae9762bbca20453ed0f0ad8412a9
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java#L407-L420
train
Is the object a simple
Of course, here is the Java code you requested: ```java public static boolean isSimple(Object aObject) { if(aObject == null || aObject.getClass() ==null || aObject.getClass().getName() == null ) return true; return aObject instanceof Date || ...
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
MultiUserChat.createOrJoin
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException { MucEnterConfiguration mucEnterConfiguration = getEnterConfigurat...
java
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException { MucEnterConfiguration mucEnterConfiguration = getEnterConfigurat...
[ "public", "synchronized", "MucCreateConfigFormHandle", "createOrJoin", "(", "Resourcepart", "nickname", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "InterruptedException", ",", "MucAlreadyJoinedException", ",", "NotConnectedException", ",", "NotAMucSer...
Create or join the MUC room with the given nickname. @param nickname the nickname to use in the MUC room. @return A {@link MucCreateConfigFormHandle} if the room was created while joining, or {@code null} if the room was just joined. @throws NoResponseException @throws XMPPErrorException @throws InterruptedException @...
[ "Create", "or", "join", "the", "MUC", "room", "with", "the", "given", "nickname", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java#L487-L491
train
Create or join the MUC.
Of course, here is the Java code you requested: ```java public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException { MucEnte...
b3dgs/lionengine
lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ScreenBaseAwt.java
ScreenBaseAwt.initMainFrame
private JFrame initMainFrame() { final String title = getTitle(); final JFrame jframe = new JFrame(title, conf); jframe.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); jframe.addWindowListener(new WindowAdapter() { @Override public void ...
java
private JFrame initMainFrame() { final String title = getTitle(); final JFrame jframe = new JFrame(title, conf); jframe.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); jframe.addWindowListener(new WindowAdapter() { @Override public void ...
[ "private", "JFrame", "initMainFrame", "(", ")", "{", "final", "String", "title", "=", "getTitle", "(", ")", ";", "final", "JFrame", "jframe", "=", "new", "JFrame", "(", "title", ",", "conf", ")", ";", "jframe", ".", "setDefaultCloseOperation", "(", "Window...
Initialize the main frame. @return The created main frame. @throws LionEngineException If the engine has not been started.
[ "Initialize", "the", "main", "frame", "." ]
cac3d5578532cf11724a737b9f09e71bf9995ab2
https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ScreenBaseAwt.java#L75-L93
train
Initialize the main frame.
Of course, here is the Java code you requested: ```java private JFrame initMainFrame() { final String title = getTitle(); final JFrame jframe = new JFrame(title, conf); jframe.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); jframe.addWindowListener(new WindowAdapter()...
arnohaase/a-foundation
a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java
ACollectionHelper.asJavaUtilList
public static <T> List<T> asJavaUtilList(Iterable<T> c) { if(c instanceof List) { return (List<T>) c; } return asJavaUtilCollection(c.iterator()); }
java
public static <T> List<T> asJavaUtilList(Iterable<T> c) { if(c instanceof List) { return (List<T>) c; } return asJavaUtilCollection(c.iterator()); }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "asJavaUtilList", "(", "Iterable", "<", "T", ">", "c", ")", "{", "if", "(", "c", "instanceof", "List", ")", "{", "return", "(", "List", "<", "T", ">", ")", "c", ";", "}", "return", "asJa...
Returns a <code>Collection</code> with the exact same elements as an <code>Iterable</code>, copying only if the parameter is not a collection.
[ "Returns", "a", "<code", ">", "Collection<", "/", "code", ">", "with", "the", "exact", "same", "elements", "as", "an", "<code", ">", "Iterable<", "/", "code", ">", "copying", "only", "if", "the", "parameter", "is", "not", "a", "collection", "." ]
f3eef2ca89d67775f202a4c28140230a6229291e
https://github.com/arnohaase/a-foundation/blob/f3eef2ca89d67775f202a4c28140230a6229291e/a-foundation/src/main/java/com/ajjpj/afoundation/collection/ACollectionHelper.java#L855-L862
test
As java. util. List.
Of course, here is the Java code you requested: ```java public static <T> List<T> asJavaUtilList(Iterable<T> c) { if(c instanceof List) { return (List<T>) c; } return asJavaUtilCollection(c.iterator()); } ``` Hope this helps!
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNNameParser.java
CNNameParser.cosNameToName
static Name cosNameToName(NameComponent[] cname) { Name nm = new CompositeName(); for (int i = 0; cname != null && i < cname.length; i++) { try { nm.add(stringifyComponent(cname[i])); } catch (InvalidNameException e) { // ignore } ...
java
static Name cosNameToName(NameComponent[] cname) { Name nm = new CompositeName(); for (int i = 0; cname != null && i < cname.length; i++) { try { nm.add(stringifyComponent(cname[i])); } catch (InvalidNameException e) { // ignore } ...
[ "static", "Name", "cosNameToName", "(", "NameComponent", "[", "]", "cname", ")", "{", "Name", "nm", "=", "new", "CompositeName", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "cname", "!=", "null", "&&", "i", "<", "cname", ".", "length", ";...
Creates a CompositeName from a NameComponent[]. Used by ExceptionMapper and CNBindingEnumeration to convert a NameComponent[] into a composite name.
[ "Creates", "a", "CompositeName", "from", "a", "NameComponent", "[]", ".", "Used", "by", "ExceptionMapper", "and", "CNBindingEnumeration", "to", "convert", "a", "NameComponent", "[]", "into", "a", "composite", "name", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/jndi/CNNameParser.java#L126-L136
test
Convert a name array to a composite name.
Of course, here is the Java code you requested: ```java static Name cosNameToName(NameComponent[] cname) { Name nm = new CompositeName(); for (int i = 0; cname != null && i < cname.length; i++) { try { nm.add(stringifyComponent(cname[i])); } catch (InvalidNameExc...
xm-online/xm-commons
xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/repository/CriteriaPermittedRepository.java
CriteriaPermittedRepository.findWithPermission
public <T> Page<T> findWithPermission(final Class<T> type, final Object criteria, final Pageable page, final String privilegeKey) { FilterConverter.QueryPart queryPart = FilterConverter....
java
public <T> Page<T> findWithPermission(final Class<T> type, final Object criteria, final Pageable page, final String privilegeKey) { FilterConverter.QueryPart queryPart = FilterConverter....
[ "public", "<", "T", ">", "Page", "<", "T", ">", "findWithPermission", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Object", "criteria", ",", "final", "Pageable", "page", ",", "final", "String", "privilegeKey", ")", "{", "FilterConverter", ...
Find entities with applied filtering and dynamic permissions written in SpEL (rresource condition). @param type Entity class @param criteria Filtering criteria from request @param page page @param privilegeKey privilege key @param <T> Entity type @return Entity page.
[ "Find", "entities", "with", "applied", "filtering", "and", "dynamic", "permissions", "written", "in", "SpEL", "(", "rresource", "condition", ")", "." ]
43eb2273adb96f40830d7b905ee3a767b8715caf
https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-permission/src/main/java/com/icthh/xm/commons/permission/repository/CriteriaPermittedRepository.java#L35-L53
train
Find with permission.
Of course, here is the Java code you requested: ```java public <T> Page<T> findWithPermission(final Class<T> type, final Object criteria, final Pageable page, final String privilegeKey) { ...
OpenTSDB/opentsdb
src/tools/UidManager.java
UidManager.assign
private static int assign(final TSDB tsdb, final byte[] table, final short idwidth, final String[] args) { boolean randomize = false; if (UniqueId.stringToUniqueIdType(args[1]) == UniqueIdType.METRIC) { randomize = tsdb.ge...
java
private static int assign(final TSDB tsdb, final byte[] table, final short idwidth, final String[] args) { boolean randomize = false; if (UniqueId.stringToUniqueIdType(args[1]) == UniqueIdType.METRIC) { randomize = tsdb.ge...
[ "private", "static", "int", "assign", "(", "final", "TSDB", "tsdb", ",", "final", "byte", "[", "]", "table", ",", "final", "short", "idwidth", ",", "final", "String", "[", "]", "args", ")", "{", "boolean", "randomize", "=", "false", ";", "if", "(", "...
Implements the {@code assign} subcommand. @param tsdb The TSDB to use. @param table The name of the HBase table to use. @param idwidth Number of bytes on which the UIDs should be. @param args Command line arguments ({@code assign name [names]}). @return The exit status of the command (0 means success).
[ "Implements", "the", "{" ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/UidManager.java#L363-L384
train
Assign a unique ID to a table.
Of course, here is the Java code you requested: ```java private static int assign(final TSDB tsdb, final byte[] table, final short idwidth, final String[] args) { boolean randomize = false; if (UniqueId.stringToUniqueIdType(arg...
Hack23/cia
service.external.esv/src/main/java/com/hack23/cia/service/external/esv/impl/EsvGovernmentBodyOperationOutcomeReaderImpl.java
EsvGovernmentBodyOperationOutcomeReaderImpl.addResultForMonth
private static void addResultForMonth(final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary, final int month, final String value) { if (value != null && value.length() >0 ) { governmentBodyAnnualOutcomeSummary.addData(month,Double.valueOf(value.replaceAll(",", "."))); } }
java
private static void addResultForMonth(final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary, final int month, final String value) { if (value != null && value.length() >0 ) { governmentBodyAnnualOutcomeSummary.addData(month,Double.valueOf(value.replaceAll(",", "."))); } }
[ "private", "static", "void", "addResultForMonth", "(", "final", "GovernmentBodyAnnualOutcomeSummary", "governmentBodyAnnualOutcomeSummary", ",", "final", "int", "month", ",", "final", "String", "value", ")", "{", "if", "(", "value", "!=", "null", "&&", "value", ".",...
Adds the result for month. @param governmentBodyAnnualOutcomeSummary the government body annual outcome summary @param month the month @param value the value
[ "Adds", "the", "result", "for", "month", "." ]
223312ca0eec74888a57a060de5b164f95a7785f
https://github.com/Hack23/cia/blob/223312ca0eec74888a57a060de5b164f95a7785f/service.external.esv/src/main/java/com/hack23/cia/service/external/esv/impl/EsvGovernmentBodyOperationOutcomeReaderImpl.java#L247-L252
valid
Add result for month.
Of course, here is the Java code you requested: ```java private static void addResultForMonth(final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary, final int month, final String value) { if (value != null && value.length() >0 ) { governmentBodyAnnualOutcomeSummary.addData(month,Double.va...
optimaize/language-detector
src/main/java/com/optimaize/langdetect/profiles/LanguageProfileReader.java
LanguageProfileReader.readAllBuiltIn
public List<LanguageProfile> readAllBuiltIn() throws IOException { List<LanguageProfile> loaded = new ArrayList<>(); for (LdLocale locale : BuiltInLanguages.getLanguages()) { loaded.add(readBuiltIn(locale)); } return loaded; }
java
public List<LanguageProfile> readAllBuiltIn() throws IOException { List<LanguageProfile> loaded = new ArrayList<>(); for (LdLocale locale : BuiltInLanguages.getLanguages()) { loaded.add(readBuiltIn(locale)); } return loaded; }
[ "public", "List", "<", "LanguageProfile", ">", "readAllBuiltIn", "(", ")", "throws", "IOException", "{", "List", "<", "LanguageProfile", ">", "loaded", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "LdLocale", "locale", ":", "BuiltInLanguages", "...
Reads all built-in language profiles from the "languages" folder (shipped with the jar).
[ "Reads", "all", "built", "-", "in", "language", "profiles", "from", "the", "languages", "folder", "(", "shipped", "with", "the", "jar", ")", "." ]
1a322c462f977b29eca8d3142b816b7111d3fa19
https://github.com/optimaize/language-detector/blob/1a322c462f977b29eca8d3142b816b7111d3fa19/src/main/java/com/optimaize/langdetect/profiles/LanguageProfileReader.java#L132-L138
train
Read all languages from the BuiltIn languages.
Of course, here is the Java code you requested: ```java public List<LanguageProfile> readAllBuiltIn() throws IOException { List<LanguageProfile> loaded = new ArrayList<>(); for (LdLocale locale : BuiltInLanguages.getLanguages()) { loaded.add(readBuiltIn(locale)); } return lo...
foundation-runtime/service-directory
2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/ServiceDirectoryImpl.java
ServiceDirectoryImpl.reinitServiceDirectoryManagerFactory
public void reinitServiceDirectoryManagerFactory(ServiceDirectoryManagerFactory factory) throws ServiceException{ if (factory == null) { throw new IllegalArgumentException("The ServiceDirectoryManagerFactory cannot be NULL."); } synchronized(this){ if(isShutdown){ ...
java
public void reinitServiceDirectoryManagerFactory(ServiceDirectoryManagerFactory factory) throws ServiceException{ if (factory == null) { throw new IllegalArgumentException("The ServiceDirectoryManagerFactory cannot be NULL."); } synchronized(this){ if(isShutdown){ ...
[ "public", "void", "reinitServiceDirectoryManagerFactory", "(", "ServiceDirectoryManagerFactory", "factory", ")", "throws", "ServiceException", "{", "if", "(", "factory", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The ServiceDirectoryManagerF...
Set the ServiceDirectoryManagerFactory in the sd-api. @param factory the ServiceDirectoryManagerFactory. @throws ServiceException
[ "Set", "the", "ServiceDirectoryManagerFactory", "in", "the", "sd", "-", "api", "." ]
a7bdefe173dc99e75eff4a24e07e6407e62f2ed4
https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/ServiceDirectoryImpl.java#L122-L151
train
Reinitializes the ServiceDirectoryManagerFactory.
Of course, here is the Java code you requested: ```java public void reinitServiceDirectoryManagerFactory(ServiceDirectoryManagerFactory factory) throws ServiceException{ if (factory == null) { throw new IllegalArgumentException("The ServiceDirectoryManagerFactory cannot be NULL."); } ...
Netflix/spectator
spectator-api/src/main/java/com/netflix/spectator/api/ArrayTagSet.java
ArrayTagSet.merge
private int merge(String[] dst, String[] srcA, int lengthA, Tag[] srcB, int lengthB) { int i = 0; int ai = 0; int bi = 0; while (ai < lengthA && bi < lengthB) { final String ak = srcA[ai]; final String av = srcA[ai + 1]; Tag b = srcB[bi]; int cmp = ak.compareTo(b.key()); i...
java
private int merge(String[] dst, String[] srcA, int lengthA, Tag[] srcB, int lengthB) { int i = 0; int ai = 0; int bi = 0; while (ai < lengthA && bi < lengthB) { final String ak = srcA[ai]; final String av = srcA[ai + 1]; Tag b = srcB[bi]; int cmp = ak.compareTo(b.key()); i...
[ "private", "int", "merge", "(", "String", "[", "]", "dst", ",", "String", "[", "]", "srcA", ",", "int", "lengthA", ",", "Tag", "[", "]", "srcB", ",", "int", "lengthB", ")", "{", "int", "i", "=", "0", ";", "int", "ai", "=", "0", ";", "int", "b...
Merge and dedup any entries in {@code ts} that have the same key. The last entry with a given key will get selected.
[ "Merge", "and", "dedup", "any", "entries", "in", "{" ]
259318252770de3bad581b85adff187d8f2c6537
https://github.com/Netflix/spectator/blob/259318252770de3bad581b85adff187d8f2c6537/spectator-api/src/main/java/com/netflix/spectator/api/ArrayTagSet.java#L228-L268
train
Merge two Tag objects into a single array of strings.
Of course, here is the Java code you requested: ```java private int merge(String[] dst, String[] srcA, int lengthA, Tag[] srcB, int lengthB) { int i = 0; int ai = 0; int bi = 0; while (ai < lengthA && bi < lengthB) { final String ak = srcA[ai]; final String av = srcA[ai + 1]; Tag b =...
HanSolo/tilesfx
src/main/java/eu/hansolo/tilesfx/Tile.java
Tile.setAveragingEnabled
public void setAveragingEnabled(final boolean ENABLED) { if (null == averagingEnabled) { _averagingEnabled = ENABLED; fireTileEvent(REDRAW_EVENT); } else { averagingEnabled.set(ENABLED); } }
java
public void setAveragingEnabled(final boolean ENABLED) { if (null == averagingEnabled) { _averagingEnabled = ENABLED; fireTileEvent(REDRAW_EVENT); } else { averagingEnabled.set(ENABLED); } }
[ "public", "void", "setAveragingEnabled", "(", "final", "boolean", "ENABLED", ")", "{", "if", "(", "null", "==", "averagingEnabled", ")", "{", "_averagingEnabled", "=", "ENABLED", ";", "fireTileEvent", "(", "REDRAW_EVENT", ")", ";", "}", "else", "{", "averaging...
Defines if the averaging functionality will be enabled.
[ "Defines", "if", "the", "averaging", "functionality", "will", "be", "enabled", "." ]
36eb07b1119017beb851dad95256439224d1fcf4
https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/Tile.java#L1493-L1500
train
Defines if averaging is enabled.
Of course, here is the Java code you requested: ```java public void setAveragingEnabled(final boolean ENABLED) { if (null == averagingEnabled) { _averagingEnabled = ENABLED; fireTileEvent(REDRAW_EVENT); } else { averagingEnabled.set(ENABLED); } } ``` Hop...
Azure/azure-sdk-for-java
batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java
JobsImpl.listNext
public PagedList<CloudJob> listNext(final String nextPageLink, final JobListNextOptions jobListNextOptions) { ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders> response = listNextSinglePageAsync(nextPageLink, jobListNextOptions).toBlocking().single(); return new PagedList<CloudJob>(response.bod...
java
public PagedList<CloudJob> listNext(final String nextPageLink, final JobListNextOptions jobListNextOptions) { ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders> response = listNextSinglePageAsync(nextPageLink, jobListNextOptions).toBlocking().single(); return new PagedList<CloudJob>(response.bod...
[ "public", "PagedList", "<", "CloudJob", ">", "listNext", "(", "final", "String", "nextPageLink", ",", "final", "JobListNextOptions", "jobListNextOptions", ")", "{", "ServiceResponseWithHeaders", "<", "Page", "<", "CloudJob", ">", ",", "JobListHeaders", ">", "respons...
Lists all of the jobs in the specified account. @param nextPageLink The NextLink from the previous successful call to List operation. @param jobListNextOptions Additional parameters for the operation @throws IllegalArgumentException thrown if parameters fail the validation @throws BatchErrorException thrown if the req...
[ "Lists", "all", "of", "the", "jobs", "in", "the", "specified", "account", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3427-L3435
train
Gets the next page of Cloud Jobs.
Of course, here is the Java code you requested: ```java public PagedList<CloudJob> listNext(final String nextPageLink, final JobListNextOptions jobListNextOptions) { ServiceResponseWithHeaders<Page<CloudJob>, JobListHeaders> response = listNextSinglePageAsync(nextPageLink, jobListNextOptions).toBlocking().sing...