repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createDachboden
@XmlElementDecl(namespace = "", name = "dachboden") public JAXBElement<Boolean> createDachboden(Boolean value) { return new JAXBElement<Boolean>(_Dachboden_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "dachboden") public JAXBElement<Boolean> createDachboden(Boolean value) { return new JAXBElement<Boolean>(_Dachboden_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"dachboden\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createDachboden", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", ">", "(", "_Dach...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2932-L2935
test
Create an instance of a Dachboden class.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "dachboden") public JAXBElement<Boolean> createDachboden(Boolean value) { return new JAXBElement<Boolean>(_Dachboden_QNAME, Boolean.class, null, value); } ``` Hope this helps!
robeio/robe
robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java
BaseDao.findAll
public List<Map<String, Object>> findAll(SearchModel search) { Result<Map<String, Object>> resultPair = queryAll(search).pairList(); search.setTotalCount(resultPair.getTotalCount()); ResponseHeadersUtil.addTotalCount(search); return resultPair.getList(); }
java
public List<Map<String, Object>> findAll(SearchModel search) { Result<Map<String, Object>> resultPair = queryAll(search).pairList(); search.setTotalCount(resultPair.getTotalCount()); ResponseHeadersUtil.addTotalCount(search); return resultPair.getList(); }
[ "public", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "findAll", "(", "SearchModel", "search", ")", "{", "Result", "<", "Map", "<", "String", ",", "Object", ">", ">", "resultPair", "=", "queryAll", "(", "search", ")", ".", "pairList", ...
Returns modified list of the entities regarding to the search model. {@inheritDoc} @return List of entities.
[ "Returns", "modified", "list", "of", "the", "entities", "regarding", "to", "the", "search", "model", ".", "{", "@inheritDoc", "}" ]
a0a8c7cebd1f70f78cf24a66a002859e937badfe
https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-hibernate/src/main/java/io/robe/hibernate/dao/BaseDao.java#L96-L101
test
Find all the resource sets.
Of course, here is the Java code you requested: ```java public List<Map<String, Object>> findAll(SearchModel search) { Result<Map<String, Object>> resultPair = queryAll(search).pairList(); search.setTotalCount(resultPair.getTotalCount()); ResponseHeadersUtil.addTotalCount(search); retur...
rest-assured/rest-assured
json-path/src/main/java/io/restassured/path/json/JsonPath.java
JsonPath.getDouble
public double getDouble(String path) { final Object value = get(path); if (value instanceof Double) { return (Double) value; } return ObjectConverter.convertObjectTo(value, Double.class); }
java
public double getDouble(String path) { final Object value = get(path); if (value instanceof Double) { return (Double) value; } return ObjectConverter.convertObjectTo(value, Double.class); }
[ "public", "double", "getDouble", "(", "String", "path", ")", "{", "final", "Object", "value", "=", "get", "(", "path", ")", ";", "if", "(", "value", "instanceof", "Double", ")", "{", "return", "(", "Double", ")", "value", ";", "}", "return", "ObjectCon...
Get the result of an Object path expression as a double. @param path The Object path. @return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object cannot be casted to the expected type.
[ "Get", "the", "result", "of", "an", "Object", "path", "expression", "as", "a", "double", "." ]
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/json-path/src/main/java/io/restassured/path/json/JsonPath.java#L315-L321
test
Gets a double value.
Of course, here is the Java code you requested: ```java public double getDouble(String path) { final Object value = get(path); if (value instanceof Double) { return (Double) value; } return ObjectConverter.convertObjectTo(value, Double.class); } ``` Hope this helps!
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/ToolsUI.java
ToolsUI.jumptoThreddsDatatype
private void jumptoThreddsDatatype(DataFactory.Result threddsData) { if (threddsData.fatalError) { JOptionPane.showMessageDialog(this, "Cant open dataset=" + threddsData.errLog); try { threddsData.close(); } catch (IOException e) { e.printStackTrace(); } ...
java
private void jumptoThreddsDatatype(DataFactory.Result threddsData) { if (threddsData.fatalError) { JOptionPane.showMessageDialog(this, "Cant open dataset=" + threddsData.errLog); try { threddsData.close(); } catch (IOException e) { e.printStackTrace(); } ...
[ "private", "void", "jumptoThreddsDatatype", "(", "DataFactory", ".", "Result", "threddsData", ")", "{", "if", "(", "threddsData", ".", "fatalError", ")", "{", "JOptionPane", ".", "showMessageDialog", "(", "this", ",", "\"Cant open dataset=\"", "+", "threddsData", ...
Jump to the appropriate tab based on datatype of threddsData
[ "Jump", "to", "the", "appropriate", "tab", "based", "on", "datatype", "of", "threddsData" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/ToolsUI.java#L1109-L1160
test
Jumpto ThreddsDatatype method.
Of course, here is the Java code you requested: ```java private void jumptoThreddsDatatype(DataFactory.Result threddsData) { if (threddsData.fatalError) { JOptionPane.showMessageDialog(this, "Cant open dataset=" + threddsData.errLog); try { threddsData.close(); } catch (IOEx...
CAFapi/caf-common
util-moduleloader/src/main/java/com/hpe/caf/util/ModuleLoader.java
ModuleLoader.getServiceOrElse
public static <T> T getServiceOrElse(final Class<T> intf, final T defaultObj) { Objects.requireNonNull(intf); final T ret; List<T> implementations = getServices(intf); if (implementations.isEmpty()) { return defaultObj; } else { ret = implementations.g...
java
public static <T> T getServiceOrElse(final Class<T> intf, final T defaultObj) { Objects.requireNonNull(intf); final T ret; List<T> implementations = getServices(intf); if (implementations.isEmpty()) { return defaultObj; } else { ret = implementations.g...
[ "public", "static", "<", "T", ">", "T", "getServiceOrElse", "(", "final", "Class", "<", "T", ">", "intf", ",", "final", "T", "defaultObj", ")", "{", "Objects", ".", "requireNonNull", "(", "intf", ")", ";", "final", "T", "ret", ";", "List", "<", "T", ...
Determine the first advertised service implementation for the specified interface. The implementations are advertised via the Java "ServiceLoader" mechanism. @param <T> the interface @param intf the interface to find an advertised service implementation for @param defaultObj the default object to return if an advertis...
[ "Determine", "the", "first", "advertised", "service", "implementation", "for", "the", "specified", "interface", ".", "The", "implementations", "are", "advertised", "via", "the", "Java", "ServiceLoader", "mechanism", "." ]
c9e617cd0b39e19d9480653f8c82efee53dee885
https://github.com/CAFapi/caf-common/blob/c9e617cd0b39e19d9480653f8c82efee53dee885/util-moduleloader/src/main/java/com/hpe/caf/util/ModuleLoader.java#L92-L108
test
Gets the service or else.
Of course, here is the Java code you requested: ```java public static <T> T getServiceOrElse(final Class<T> intf, final T defaultObj) { Objects.requireNonNull(intf); final T ret; List<T> implementations = getServices(intf); if (implementations.isEmpty()) { return default...
cucumber-ltd/cucumber-pro-plugin-jvm
src/main/java/io/cucumber/pro/config/Config.java
Config.setValue
public void setValue(String property, Value value) { this.valueByProperty.put(property.toLowerCase(), value); }
java
public void setValue(String property, Value value) { this.valueByProperty.put(property.toLowerCase(), value); }
[ "public", "void", "setValue", "(", "String", "property", ",", "Value", "value", ")", "{", "this", ".", "valueByProperty", ".", "put", "(", "property", ".", "toLowerCase", "(", ")", ",", "value", ")", ";", "}" ]
Use by loaders
[ "Use", "by", "loaders" ]
a09ee0b1682d3cd8b68c240820e647d4515e931f
https://github.com/cucumber-ltd/cucumber-pro-plugin-jvm/blob/a09ee0b1682d3cd8b68c240820e647d4515e931f/src/main/java/io/cucumber/pro/config/Config.java#L50-L52
test
Sets the value of a property.
Of course, here is the Java code you requested: ```java public void setValue(String property, Value value) { this.valueByProperty.put(property.toLowerCase(), value); } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-serde/nd4j-camel-routes/nd4j-kafka/src/main/java/org/nd4j/camel/kafka/KafkaConnectionInformation.java
KafkaConnectionInformation.kafkaUri
public String kafkaUri() { return String.format( "kafka://%s?topic=%s&groupId=%s&zookeeperHost=%s&zookeeperPort=%d&serializerClass=%s&keySerializerClass=%s", kafkaBrokerList, topicName, groupId, zookeeperHost, zookeeperPort, StringEncoder.c...
java
public String kafkaUri() { return String.format( "kafka://%s?topic=%s&groupId=%s&zookeeperHost=%s&zookeeperPort=%d&serializerClass=%s&keySerializerClass=%s", kafkaBrokerList, topicName, groupId, zookeeperHost, zookeeperPort, StringEncoder.c...
[ "public", "String", "kafkaUri", "(", ")", "{", "return", "String", ".", "format", "(", "\"kafka://%s?topic=%s&groupId=%s&zookeeperHost=%s&zookeeperPort=%d&serializerClass=%s&keySerializerClass=%s\"", ",", "kafkaBrokerList", ",", "topicName", ",", "groupId", ",", "zookeeperHost"...
Returns a kafka connection uri @return a kafka connection uri represented by this connection information
[ "Returns", "a", "kafka", "connection", "uri" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-serde/nd4j-camel-routes/nd4j-kafka/src/main/java/org/nd4j/camel/kafka/KafkaConnectionInformation.java#L29-L34
test
Get the URI of the Kafka broker.
Of course, here is the Java code you requested: ```java public String kafkaUri() { return String.format( "kafka://%s?topic=%s&groupId=%s&zookeeperHost=%s&zookeeperPort=%d&serializerClass=%s&keySerializerClass=%s", kafkaBrokerList, topicName, groupId, zookeeperHos...
wildfly/wildfly
jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsSpringProcessor.java
JaxrsSpringProcessor.getResteasySpringVirtualFile
protected synchronized VirtualFile getResteasySpringVirtualFile() throws DeploymentUnitProcessingException { if(resourceRoot != null) { return resourceRoot; } try { Module module = Module.getBootModuleLoader().loadModule(MODULE); URL fileUrl = module.getClassL...
java
protected synchronized VirtualFile getResteasySpringVirtualFile() throws DeploymentUnitProcessingException { if(resourceRoot != null) { return resourceRoot; } try { Module module = Module.getBootModuleLoader().loadModule(MODULE); URL fileUrl = module.getClassL...
[ "protected", "synchronized", "VirtualFile", "getResteasySpringVirtualFile", "(", ")", "throws", "DeploymentUnitProcessingException", "{", "if", "(", "resourceRoot", "!=", "null", ")", "{", "return", "resourceRoot", ";", "}", "try", "{", "Module", "module", "=", "Mod...
Lookup Seam integration resource loader. @return the Seam integration resource loader @throws DeploymentUnitProcessingException for any error
[ "Lookup", "Seam", "integration", "resource", "loader", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsSpringProcessor.java#L89-L134
test
Get the Spring VirtualFile that is used to serve the Spring Application.
Of course, here is the Java code you requested: ```java protected synchronized VirtualFile getResteasySpringVirtualFile() throws DeploymentUnitProcessingException { if(resourceRoot != null) { return resourceRoot; } try { Module module = Module.getBootModuleLoader().loadM...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/IdCardKit.java
IdCardKit.validateIdCard18
public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { // 前17位 String code17 = idCard.substring(0, 17); // 第18位 String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if ...
java
public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { // 前17位 String code17 = idCard.substring(0, 17); // 第18位 String code18 = idCard.substring(17, CHINA_ID_MAX_LENGTH); if ...
[ "public", "static", "boolean", "validateIdCard18", "(", "String", "idCard", ")", "{", "boolean", "bTrue", "=", "false", ";", "if", "(", "idCard", ".", "length", "(", ")", "==", "CHINA_ID_MAX_LENGTH", ")", "{", "// 前17位", "String", "code17", "=", "idCard", ...
验证18位身份编码是否合法 @param idCard 身份编码 @return 是否合法
[ "验证18位身份编码是否合法" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/IdCardKit.java#L221-L242
test
validateIdCard18 - Validate ID card
Of course, here is the Java code you requested: ```java public static boolean validateIdCard18(String idCard) { boolean bTrue = false; if (idCard.length() == CHINA_ID_MAX_LENGTH) { // 前17位 String code17 = idCard.substring(0, 17); // 第18位 String code18 = i...
spring-projects/spring-security
crypto/src/main/java/org/springframework/security/crypto/encrypt/AesBytesEncryptor.java
AesBytesEncryptor.iv
private byte[] iv(byte[] encrypted) { return this.ivGenerator != NULL_IV_GENERATOR ? subArray(encrypted, 0, this.ivGenerator.getKeyLength()) : NULL_IV_GENERATOR.generateKey(); }
java
private byte[] iv(byte[] encrypted) { return this.ivGenerator != NULL_IV_GENERATOR ? subArray(encrypted, 0, this.ivGenerator.getKeyLength()) : NULL_IV_GENERATOR.generateKey(); }
[ "private", "byte", "[", "]", "iv", "(", "byte", "[", "]", "encrypted", ")", "{", "return", "this", ".", "ivGenerator", "!=", "NULL_IV_GENERATOR", "?", "subArray", "(", "encrypted", ",", "0", ",", "this", ".", "ivGenerator", ".", "getKeyLength", "(", ")",...
internal helpers
[ "internal", "helpers" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/crypto/src/main/java/org/springframework/security/crypto/encrypt/AesBytesEncryptor.java#L137-L140
test
Returns the iv of the given encrypted byte array.
Of course, here is the Java code you requested: ```java private byte[] iv(byte[] encrypted) { return this.ivGenerator != NULL_IV_GENERATOR ? subArray(encrypted, 0, this.ivGenerator.getKeyLength()) : NULL_IV_GENERATOR.generateKey(); } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.certificate
public static AuthenticationScheme certificate(String certURL, String password, CertificateAuthSettings certificateAuthSettings) { return certificate(certURL, password, "", "", certificateAuthSettings); }
java
public static AuthenticationScheme certificate(String certURL, String password, CertificateAuthSettings certificateAuthSettings) { return certificate(certURL, password, "", "", certificateAuthSettings); }
[ "public", "static", "AuthenticationScheme", "certificate", "(", "String", "certURL", ",", "String", "password", ",", "CertificateAuthSettings", "certificateAuthSettings", ")", "{", "return", "certificate", "(", "certURL", ",", "password", ",", "\"\"", ",", "\"\"", "...
Sets a certificate to be used for SSL authentication. See {@link Class#getResource(String)} for how to get a URL from a resource on the classpath. <p/> @param certURL URL to a JKS keystore where the certificate is stored. @param password The password for the keystore @param certificateAu...
[ "Sets", "a", "certificate", "to", "be", "used", "for", "SSL", "authentication", ".", "See", "{", "@link", "Class#getResource", "(", "String", ")", "}", "for", "how", "to", "get", "a", "URL", "from", "a", "resource", "on", "the", "classpath", ".", "<p", ...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1279-L1281
test
Create an AuthenticationScheme that will authenticate using the specified certificate.
Of course, here is the Java code you requested: ```java public static AuthenticationScheme certificate(String certURL, String password, CertificateAuthSettings certificateAuthSettings) { return certificate(certURL, password, "", "", certificateAuthSettings); } ``` Hope this helps!
objectify/objectify
src/main/java/com/googlecode/objectify/impl/LoadEngine.java
LoadEngine.load
@SuppressWarnings("unchecked") public <T> T load(final BaseEntity<com.google.cloud.datastore.Key> ent, final LoadContext ctx) { if (ent == null) return null; final EntityMetadata<T> meta = ofy.factory().getMetadata(ent.getKey().getKind()); if (meta == null) return (T)ent; else return meta.lo...
java
@SuppressWarnings("unchecked") public <T> T load(final BaseEntity<com.google.cloud.datastore.Key> ent, final LoadContext ctx) { if (ent == null) return null; final EntityMetadata<T> meta = ofy.factory().getMetadata(ent.getKey().getKind()); if (meta == null) return (T)ent; else return meta.lo...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "load", "(", "final", "BaseEntity", "<", "com", ".", "google", ".", "cloud", ".", "datastore", ".", "Key", ">", "ent", ",", "final", "LoadContext", "ctx", ")", "{", "if",...
Converts a datastore entity into a typed pojo object @return an assembled pojo, or the Entity itself if the kind is not registered, or null if the input value was null
[ "Converts", "a", "datastore", "entity", "into", "a", "typed", "pojo", "object" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/LoadEngine.java#L187-L197
test
Load a entity.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public <T> T load(final BaseEntity<com.google.cloud.datastore.Key> ent, final LoadContext ctx) { if (ent == null) return null; final EntityMetadata<T> meta = ofy.factory().getMetadata(ent.getKey().getKind()); if (me...
rupertlssmith/lojix
base/common/src/main/com/thesett/common/util/TypeConverter.java
TypeConverter.bestMatchingConversion
public static Class bestMatchingConversion(MultiTypeData d, Collection<Class> types) { /*log.fine("public static Class bestMatchingConvertion(MultiTypeData d, Set<Class> types): called");*/ /*log.fine("d = " + d);*/ /*log.fine("types = " + types);*/ // Try to match the native type f...
java
public static Class bestMatchingConversion(MultiTypeData d, Collection<Class> types) { /*log.fine("public static Class bestMatchingConvertion(MultiTypeData d, Set<Class> types): called");*/ /*log.fine("d = " + d);*/ /*log.fine("types = " + types);*/ // Try to match the native type f...
[ "public", "static", "Class", "bestMatchingConversion", "(", "MultiTypeData", "d", ",", "Collection", "<", "Class", ">", "types", ")", "{", "/*log.fine(\"public static Class bestMatchingConvertion(MultiTypeData d, Set<Class> types): called\");*/", "/*log.fine(\"d = \" + d);*/", "/*l...
For a set of types this method selects the best type to convert a given multi type data object into. This method can be usefull when deciding which of several setter methods on a bean is the best one to convert the multi type data obejct into before calling the beans setter method. <p/>This method tries first to match...
[ "For", "a", "set", "of", "types", "this", "method", "selects", "the", "best", "type", "to", "convert", "a", "given", "multi", "type", "data", "object", "into", ".", "This", "method", "can", "be", "usefull", "when", "deciding", "which", "of", "several", "...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/TypeConverter.java#L487-L735
test
Returns the best class that can be used to convert the given types to the correct type.
Of course, here is the Java code you requested: ```java public static Class bestMatchingConversion(MultiTypeData d, Collection<Class> types) { /*log.fine("public static Class bestMatchingConvertion(MultiTypeData d, Set<Class> types): called");*/ /*log.fine("d = " + d);*/ /*log.fine("types =...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ErrorDispatcher.java
ErrorDispatcher.jspError
public void jspError(Node n, String errCode, String arg, Exception e) throws JasperException { dispatch(n.getStart(), errCode, new Object[] {arg}, e); }
java
public void jspError(Node n, String errCode, String arg, Exception e) throws JasperException { dispatch(n.getStart(), errCode, new Object[] {arg}, e); }
[ "public", "void", "jspError", "(", "Node", "n", ",", "String", "errCode", ",", "String", "arg", ",", "Exception", "e", ")", "throws", "JasperException", "{", "dispatch", "(", "n", ".", "getStart", "(", ")", ",", "errCode", ",", "new", "Object", "[", "]...
/* Dispatches the given JSP parse error to the configured error handler. The given error code is localized. If it is not found in the resource bundle for localized error messages, it is used as the error message. @param n Node that caused the error @param errCode Error code @param arg Argument for parametric replacem...
[ "/", "*", "Dispatches", "the", "given", "JSP", "parse", "error", "to", "the", "configured", "error", "handler", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ErrorDispatcher.java#L244-L247
test
jspError - Method called by jspError.
Of course, here is the Java code you requested: ```java public void jspError(Node n, String errCode, String arg, Exception e) throws JasperException { dispatch(n.getStart(), errCode, new Object[] {arg}, e); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/nowrad/NOWRadiosp.java
NOWRadiosp.open
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile file, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new NOWRadheader(); try { headerParser.read(this.raf, ncfile); } catc...
java
public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile file, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new NOWRadheader(); try { headerParser.read(this.raf, ncfile); } catc...
[ "public", "void", "open", "(", "ucar", ".", "unidata", ".", "io", ".", "RandomAccessFile", "raf", ",", "ucar", ".", "nc2", ".", "NetcdfFile", "file", ",", "ucar", ".", "nc2", ".", "util", ".", "CancelTask", "cancelTask", ")", "throws", "IOException", "{"...
Open the file and read the header part @param raf @param file @param cancelTask @throws java.io.IOException
[ "Open", "the", "file", "and", "read", "the", "header", "part" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nowrad/NOWRadiosp.java#L74-L88
test
This method is used to open a NCML file.
Of course, here is the Java code you requested: ```java public void open(ucar.unidata.io.RandomAccessFile raf, ucar.nc2.NetcdfFile file, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new NOWRadheader(); try ...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java
CoverageDataPng.getValue
@Override public Double getValue(GriddedTile griddedTile, CoverageDataPngImage image, int x, int y) { Double value = null; if (image.getReader() != null) { int pixelValue = image.getPixel(x, y); value = getValue(griddedTile, pixelValue); } e...
java
@Override public Double getValue(GriddedTile griddedTile, CoverageDataPngImage image, int x, int y) { Double value = null; if (image.getReader() != null) { int pixelValue = image.getPixel(x, y); value = getValue(griddedTile, pixelValue); } e...
[ "@", "Override", "public", "Double", "getValue", "(", "GriddedTile", "griddedTile", ",", "CoverageDataPngImage", "image", ",", "int", "x", ",", "int", "y", ")", "{", "Double", "value", "=", "null", ";", "if", "(", "image", ".", "getReader", "(", ")", "!=...
{@inheritDoc}
[ "{" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataPng.java#L86-L97
test
Get the value of the coverage data image pixel in the image.
Of course, here is the Java code you requested: ```java @Override public Double getValue(GriddedTile griddedTile, CoverageDataPngImage image, int x, int y) { Double value = null; if (image.getReader() != null) { int pixelValue = image.getPixel(x, y); ...
jboss/jboss-common-core
src/main/java/org/jboss/util/file/FilenamePrefixFilter.java
FilenamePrefixFilter.accept
public boolean accept(final File dir, final String name) { if (ignoreCase) { return name.toLowerCase().startsWith(prefix); } else { return name.startsWith(prefix); } }
java
public boolean accept(final File dir, final String name) { if (ignoreCase) { return name.toLowerCase().startsWith(prefix); } else { return name.startsWith(prefix); } }
[ "public", "boolean", "accept", "(", "final", "File", "dir", ",", "final", "String", "name", ")", "{", "if", "(", "ignoreCase", ")", "{", "return", "name", ".", "toLowerCase", "(", ")", ".", "startsWith", "(", "prefix", ")", ";", "}", "else", "{", "re...
Check if a file is acceptible. @param dir The directory the file resides in. @param name The name of the file. @return <tt>true</tt> if the file is acceptable.
[ "Check", "if", "a", "file", "is", "acceptible", "." ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/file/FilenamePrefixFilter.java#L67-L74
test
Check if the name starts with the prefix.
Of course, here is the Java code you requested: ```java public boolean accept(final File dir, final String name) { if (ignoreCase) { return name.toLowerCase().startsWith(prefix); } else { return name.startsWith(prefix); } } ``` Hope this helps!
oblac/jodd
jodd-http/src/main/java/jodd/http/Cookie.java
Cookie.setName
private void setName(final String name) { if (name.contains(";") || name.contains(",") || name.startsWith("$")) { throw new IllegalArgumentException("Invalid cookie name:" + name); } for (int n = 0; n < name.length(); n++) { char c = name.charAt(n); if (c <= 0x20 || c >= 0x7f) { throw new IllegalArg...
java
private void setName(final String name) { if (name.contains(";") || name.contains(",") || name.startsWith("$")) { throw new IllegalArgumentException("Invalid cookie name:" + name); } for (int n = 0; n < name.length(); n++) { char c = name.charAt(n); if (c <= 0x20 || c >= 0x7f) { throw new IllegalArg...
[ "private", "void", "setName", "(", "final", "String", "name", ")", "{", "if", "(", "name", ".", "contains", "(", "\";\"", ")", "||", "name", ".", "contains", "(", "\",\"", ")", "||", "name", ".", "startsWith", "(", "\"$\"", ")", ")", "{", "throw", ...
Sets the cookie name and checks for validity.
[ "Sets", "the", "cookie", "name", "and", "checks", "for", "validity", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/Cookie.java#L128-L140
test
Sets the name of the cookie.
Of course, here is the Java code you requested: ```java private void setName(final String name) { if (name.contains(";") || name.contains(",") || name.startsWith("$")) { throw new IllegalArgumentException("Invalid cookie name:" + name); } for (int n = 0; n < name.length(); n++) { char c = name.charAt(n); ...
orientechnologies/orientdb
distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java
OHazelcastPlugin.memberRemoved
@Override public void memberRemoved(final MembershipEvent iEvent) { try { updateLastClusterChange(); if (iEvent.getMember() == null) return; final String nodeLeftName = getNodeName(iEvent.getMember()); if (nodeLeftName == null) return; removeServer(nodeLeftName, tr...
java
@Override public void memberRemoved(final MembershipEvent iEvent) { try { updateLastClusterChange(); if (iEvent.getMember() == null) return; final String nodeLeftName = getNodeName(iEvent.getMember()); if (nodeLeftName == null) return; removeServer(nodeLeftName, tr...
[ "@", "Override", "public", "void", "memberRemoved", "(", "final", "MembershipEvent", "iEvent", ")", "{", "try", "{", "updateLastClusterChange", "(", ")", ";", "if", "(", "iEvent", ".", "getMember", "(", ")", "==", "null", ")", "return", ";", "final", "Stri...
Removes the node map entry.
[ "Removes", "the", "node", "map", "entry", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed/src/main/java/com/orientechnologies/orient/server/hazelcast/OHazelcastPlugin.java#L1046-L1065
test
Remove the server from the cluster.
Of course, here is the Java code you requested: ```java @Override public void memberRemoved(final MembershipEvent iEvent) { try { updateLastClusterChange(); if (iEvent.getMember() == null) return; final String nodeLeftName = getNodeName(iEvent.getMember()); if (nodeLeftName == n...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireNetworking.java
GemFireNetworking.parseLocatorPort
private static int parseLocatorPort(String locator) { int start = locator.indexOf("["); String text = null; if(start > 0) { String results = locator.substring(start+1); int end = results.indexOf("]"); if(end > 0) { text = results.substring(0,end).trim(); return Integer.parseInt(t...
java
private static int parseLocatorPort(String locator) { int start = locator.indexOf("["); String text = null; if(start > 0) { String results = locator.substring(start+1); int end = results.indexOf("]"); if(end > 0) { text = results.substring(0,end).trim(); return Integer.parseInt(t...
[ "private", "static", "int", "parseLocatorPort", "(", "String", "locator", ")", "{", "int", "start", "=", "locator", ".", "indexOf", "(", "\"[\"", ")", ";", "String", "text", "=", "null", ";", "if", "(", "start", ">", "0", ")", "{", "String", "results",...
--------------------------------------------------------
[ "--------------------------------------------------------" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/util/GemFireNetworking.java#L93-L113
test
Parses the locator string to get the port number.
Of course, here is the Java code you requested: ```java private static int parseLocatorPort(String locator) { int start = locator.indexOf("["); String text = null; if(start > 0) { String results = locator.substring(start+1); int end = results.indexOf("]"); if(end > 0) { text = resul...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/grib2/Grib2Record.java
Grib2Record.readData
public static float[] readData(RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine) throws IOException { raf.seek(drsPos); Grib2SectionDataRepresentation drs = new Grib2SectionDataRepresentation(raf); Grib2SectionBitMap bms = new Grib2Sectio...
java
public static float[] readData(RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine) throws IOException { raf.seek(drsPos); Grib2SectionDataRepresentation drs = new Grib2SectionDataRepresentation(raf); Grib2SectionBitMap bms = new Grib2Sectio...
[ "public", "static", "float", "[", "]", "readData", "(", "RandomAccessFile", "raf", ",", "long", "drsPos", ",", "long", "bmsPos", ",", "int", "gdsNumberPoints", ",", "int", "scanMode", ",", "int", "nx", ",", "int", "ny", ",", "int", "[", "]", "nptsInLine"...
Read data array: use when you want to be independent of the GribRecord @param raf from this RandomAccessFile @param drsPos Grib2SectionDataRepresentation starts here @param bmsPos if non-zero, use the bms that starts here @param gdsNumberPoints gdss.getNumberPoints() @param scanMode ...
[ "Read", "data", "array", ":", "use", "when", "you", "want", "to", "be", "independent", "of", "the", "GribRecord" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/grib2/Grib2Record.java#L323-L345
test
Read data from a file in the GDS format.
Of course, here is the Java code you requested: ```java public static float[] readData(RandomAccessFile raf, long drsPos, long bmsPos, int gdsNumberPoints, int scanMode, int nx, int ny, int[] nptsInLine) throws IOException { raf.seek(drsPos); Grib2SectionDataRepresentation drs = new Grib2SectionDataRepresent...
oblac/jodd
jodd-http/src/main/java/jodd/http/HttpBrowser.java
HttpBrowser.addCookies
protected void addCookies(final HttpRequest httpRequest) { // prepare all cookies List<Cookie> cookiesList = new ArrayList<>(); if (!cookies.isEmpty()) { for (Map.Entry<String, Cookie> cookieEntry : cookies) { cookiesList.add(cookieEntry.getValue()); } httpRequest.cookies(cookiesList.toArray(new Co...
java
protected void addCookies(final HttpRequest httpRequest) { // prepare all cookies List<Cookie> cookiesList = new ArrayList<>(); if (!cookies.isEmpty()) { for (Map.Entry<String, Cookie> cookieEntry : cookies) { cookiesList.add(cookieEntry.getValue()); } httpRequest.cookies(cookiesList.toArray(new Co...
[ "protected", "void", "addCookies", "(", "final", "HttpRequest", "httpRequest", ")", "{", "// prepare all cookies", "List", "<", "Cookie", ">", "cookiesList", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "!", "cookies", ".", "isEmpty", "(", ")", ...
Add cookies to the request.
[ "Add", "cookies", "to", "the", "request", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-http/src/main/java/jodd/http/HttpBrowser.java#L287-L298
test
Add all cookies to the request.
Of course, here is the Java code you requested: ```java protected void addCookies(final HttpRequest httpRequest) { // prepare all cookies List<Cookie> cookiesList = new ArrayList<>(); if (!cookies.isEmpty()) { for (Map.Entry<String, Cookie> cookieEntry : cookies) { cookiesList.add(cookieEntry.getValue())...
apache/parquet-mr
parquet-format-structures/src/main/java/org/apache/parquet/format/event/EventBasedThriftReader.java
EventBasedThriftReader.readStructContent
public void readStructContent(FieldConsumer c) throws TException { TField field; while (true) { field = protocol.readFieldBegin(); if (field.type == TType.STOP) { break; } c.consumeField(protocol, this, field.id, field.type); } }
java
public void readStructContent(FieldConsumer c) throws TException { TField field; while (true) { field = protocol.readFieldBegin(); if (field.type == TType.STOP) { break; } c.consumeField(protocol, this, field.id, field.type); } }
[ "public", "void", "readStructContent", "(", "FieldConsumer", "c", ")", "throws", "TException", "{", "TField", "field", ";", "while", "(", "true", ")", "{", "field", "=", "protocol", ".", "readFieldBegin", "(", ")", ";", "if", "(", "field", ".", "type", "...
reads the content of a struct (fields) from the underlying protocol and passes the events to c @param c the field consumer @throws TException if any thrift related error occurs during the reading
[ "reads", "the", "content", "of", "a", "struct", "(", "fields", ")", "from", "the", "underlying", "protocol", "and", "passes", "the", "events", "to", "c" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-format-structures/src/main/java/org/apache/parquet/format/event/EventBasedThriftReader.java#L63-L72
test
Read a structure of content.
Of course, here is the Java code you requested: ```java public void readStructContent(FieldConsumer c) throws TException { TField field; while (true) { field = protocol.readFieldBegin(); if (field.type == TType.STOP) { break; } c.consumeField(protocol, this, field.id, field.type...
xmlet/XsdParser
src/main/java/org/xmlet/xsdparser/xsdelements/XsdElement.java
XsdElement.rule3
private void rule3() { if (parent instanceof XsdSchema && attributesMap.containsKey(REF_TAG)){ throw new ParsingException(XSD_TAG + " element: The " + REF_TAG + " attribute cannot be present when the parent of the " + xsdElementIsXsdSchema); } }
java
private void rule3() { if (parent instanceof XsdSchema && attributesMap.containsKey(REF_TAG)){ throw new ParsingException(XSD_TAG + " element: The " + REF_TAG + " attribute cannot be present when the parent of the " + xsdElementIsXsdSchema); } }
[ "private", "void", "rule3", "(", ")", "{", "if", "(", "parent", "instanceof", "XsdSchema", "&&", "attributesMap", ".", "containsKey", "(", "REF_TAG", ")", ")", "{", "throw", "new", "ParsingException", "(", "XSD_TAG", "+", "\" element: The \"", "+", "REF_TAG", ...
Asserts if the current object has a ref attribute while being a direct child of the top level XsdSchema element, which isn't allowed, throwing an exception in that case.
[ "Asserts", "if", "the", "current", "object", "has", "a", "ref", "attribute", "while", "being", "a", "direct", "child", "of", "the", "top", "level", "XsdSchema", "element", "which", "isn", "t", "allowed", "throwing", "an", "exception", "in", "that", "case", ...
0044681d77400e1568d1e7b1024a38ec76caa2cb
https://github.com/xmlet/XsdParser/blob/0044681d77400e1568d1e7b1024a38ec76caa2cb/src/main/java/org/xmlet/xsdparser/xsdelements/XsdElement.java#L213-L217
test
rule 3.
Of course, here is the Java code you requested: ```java private void rule3() { if (parent instanceof XsdSchema && attributesMap.containsKey(REF_TAG)){ throw new ParsingException(XSD_TAG + " element: The " + REF_TAG + " attribute cannot be present when the parent of the " + xsdElementIsXsdSchema); ...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java
GridHorizCoordSys.makeMSGgeostationary
private void makeMSGgeostationary() { double Lat0 = gds.getDouble(GridDefRecord.LAP); // sub-satellite point lat double Lon0 = gds.getDouble(GridDefRecord.LOP); // sub-satellite point lon //int nx = gds.getInt(GridDefRecord.NX); int ny = gds.getInt(GridDefRecord.NY); int x_off = gds.getInt(GridDe...
java
private void makeMSGgeostationary() { double Lat0 = gds.getDouble(GridDefRecord.LAP); // sub-satellite point lat double Lon0 = gds.getDouble(GridDefRecord.LOP); // sub-satellite point lon //int nx = gds.getInt(GridDefRecord.NX); int ny = gds.getInt(GridDefRecord.NY); int x_off = gds.getInt(GridDe...
[ "private", "void", "makeMSGgeostationary", "(", ")", "{", "double", "Lat0", "=", "gds", ".", "getDouble", "(", "GridDefRecord", ".", "LAP", ")", ";", "// sub-satellite point lat", "double", "Lon0", "=", "gds", ".", "getDouble", "(", "GridDefRecord", ".", "LOP"...
Make a Eumetsat MSG "Normalized Geostationary Projection" projection. Fake coordinates for now, then see if this can be generalized. from FM 92 GRIB-2 doc: Grid Definition Template 3.90: Space view perspective or orthographic Octet Number(s) Contents 15 Shape of the earth (see Code Table 3.2) 16 Scale factor of radi...
[ "Make", "a", "Eumetsat", "MSG", "Normalized", "Geostationary", "Projection", "projection", ".", "Fake", "coordinates", "for", "now", "then", "see", "if", "this", "can", "be", "generalized", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridHorizCoordSys.java#L978-L1053
test
Make the message geostationary.
Of course, here is the Java code you requested: ```java private void makeMSGgeostationary() { double Lat0 = gds.getDouble(GridDefRecord.LAP); // sub-satellite point lat double Lon0 = gds.getDouble(GridDefRecord.LOP); // sub-satellite point lon //int nx = gds.getInt(GridDefRecord.NX); int ny = gds.ge...
wro4j/wro4j
wro4j-core/src/main/java/ro/isdc/wro/util/concurrent/TaskExecutor.java
TaskExecutor.newExecutor
protected ExecutorService newExecutor() { try { final ExecutorService executor = (ExecutorService) Class.forName("java.util.concurrent.ForkJoinPool").newInstance(); LOG.debug("Using ForkJoinPool as task executor."); return executor; } catch (final Exception e) { LOG.debug("ForkJoinPool c...
java
protected ExecutorService newExecutor() { try { final ExecutorService executor = (ExecutorService) Class.forName("java.util.concurrent.ForkJoinPool").newInstance(); LOG.debug("Using ForkJoinPool as task executor."); return executor; } catch (final Exception e) { LOG.debug("ForkJoinPool c...
[ "protected", "ExecutorService", "newExecutor", "(", ")", "{", "try", "{", "final", "ExecutorService", "executor", "=", "(", "ExecutorService", ")", "Class", ".", "forName", "(", "\"java.util.concurrent.ForkJoinPool\"", ")", ".", "newInstance", "(", ")", ";", "LOG"...
The implementation uses jsr166 ForkJoinPool implementation in case it is available and can be used, otherwise the default {@link ExecutorService} is used. @return the {@link ExecutorService} responsible for running the tasks.
[ "The", "implementation", "uses", "jsr166", "ForkJoinPool", "implementation", "in", "case", "it", "is", "available", "and", "can", "be", "used", "otherwise", "the", "default", "{", "@link", "ExecutorService", "}", "is", "used", "." ]
d2a3de71ab8bf0af7061fb6327501e08198338df
https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/util/concurrent/TaskExecutor.java#L58-L67
test
Create a new executor.
Of course, here is the Java code you requested: ```java protected ExecutorService newExecutor() { try { final ExecutorService executor = (ExecutorService) Class.forName("java.util.concurrent.ForkJoinPool").newInstance(); LOG.debug("Using ForkJoinPool as task executor."); return executor; } ca...
rockagen/commons-lib
src/main/java/com/rockagen/commons/util/ClassUtil.java
ClassUtil.getAnnotatedDeclaredMethods
public static Method[] getAnnotatedDeclaredMethods(Class<?> clazz, Class<? extends Annotation> annotationClass, boolean recursively) { Method[] allMethods = getDeclaredMethods(clazz, recursively); List<Method> annotatedMethods = new LinkedList<Method>(); for (Method method : allMethods) { if (method.isAnno...
java
public static Method[] getAnnotatedDeclaredMethods(Class<?> clazz, Class<? extends Annotation> annotationClass, boolean recursively) { Method[] allMethods = getDeclaredMethods(clazz, recursively); List<Method> annotatedMethods = new LinkedList<Method>(); for (Method method : allMethods) { if (method.isAnno...
[ "public", "static", "Method", "[", "]", "getAnnotatedDeclaredMethods", "(", "Class", "<", "?", ">", "clazz", ",", "Class", "<", "?", "extends", "Annotation", ">", "annotationClass", ",", "boolean", "recursively", ")", "{", "Method", "[", "]", "allMethods", "...
obtain methods list of specified class and which are annotated by incoming annotation class If recursively is true, obtain methods from all class hierarchy @param clazz class - where methods are searching @param annotationClass - specified annotation class @param recursively param @return list of annotated methods
[ "obtain", "methods", "list", "of", "specified", "class", "and", "which", "are", "annotated", "by", "incoming", "annotation", "class", "If", "recursively", "is", "true", "obtain", "methods", "from", "all", "class", "hierarchy" ]
f37141cf40be79d130db804c39ce61690541d5f1
https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/ClassUtil.java#L354-L365
test
Returns all methods annotated with the specified annotation class.
Of course, here is the Java code you requested: ```java public static Method[] getAnnotatedDeclaredMethods(Class<?> clazz, Class<? extends Annotation> annotationClass, boolean recursively) { Method[] allMethods = getDeclaredMethods(clazz, recursively); List<Method> annotatedMethods = new LinkedList<Method>(); ...
playframework/playframework
core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java
GuiceApplicationBuilder.load
public GuiceApplicationBuilder load(play.api.inject.Module... modules) { return load(Guiceable.modules(modules)); }
java
public GuiceApplicationBuilder load(play.api.inject.Module... modules) { return load(Guiceable.modules(modules)); }
[ "public", "GuiceApplicationBuilder", "load", "(", "play", ".", "api", ".", "inject", ".", "Module", "...", "modules", ")", "{", "return", "load", "(", "Guiceable", ".", "modules", "(", "modules", ")", ")", ";", "}" ]
Override the module loader with the given Play modules. @param modules the set of overriding modules @return an application builder that incorporates the overrides
[ "Override", "the", "module", "loader", "with", "the", "given", "Play", "modules", "." ]
3c46dca803d24e715d85de678c59dcfac9525a00
https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play-guice/src/main/java/play/inject/guice/GuiceApplicationBuilder.java#L101-L103
test
Load the application with the given modules.
Of course, here is the Java code you requested: ```java public GuiceApplicationBuilder load(play.api.inject.Module... modules) { return load(Guiceable.modules(modules)); } ``` Hope this helps!
spring-projects/spring-security
ldap/src/main/java/org/springframework/security/ldap/userdetails/LdapAuthority.java
LdapAuthority.getAttributeValues
public List<String> getAttributeValues(String name) { List<String> result = null; if (attributes != null) { result = attributes.get(name); } if (result == null) { result = Collections.emptyList(); } return result; }
java
public List<String> getAttributeValues(String name) { List<String> result = null; if (attributes != null) { result = attributes.get(name); } if (result == null) { result = Collections.emptyList(); } return result; }
[ "public", "List", "<", "String", ">", "getAttributeValues", "(", "String", "name", ")", "{", "List", "<", "String", ">", "result", "=", "null", ";", "if", "(", "attributes", "!=", "null", ")", "{", "result", "=", "attributes", ".", "get", "(", "name", ...
Returns the values for a specific attribute @param name the attribute name @return a String array, never null but may be zero length
[ "Returns", "the", "values", "for", "a", "specific", "attribute" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/ldap/src/main/java/org/springframework/security/ldap/userdetails/LdapAuthority.java#L87-L96
test
Gets the values of an attribute.
Of course, here is the Java code you requested: ```java public List<String> getAttributeValues(String name) { List<String> result = null; if (attributes != null) { result = attributes.get(name); } if (result == null) { result = Collections.emptyList(); } return result; } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/validation/readers/PropertiesFileValidatorMetaDataReader.java
PropertiesFileValidatorMetaDataReader.loadMetaDataPropsFile
private Properties loadMetaDataPropsFile( Class<?> clazzWhoseValidationMetaDataWeAreReading ) { String className = clazzWhoseValidationMetaDataWeAreReading.getName(); /* * If the class is proxied there will be a $CGLIB on the end of it. * Remove this. */ ...
java
private Properties loadMetaDataPropsFile( Class<?> clazzWhoseValidationMetaDataWeAreReading ) { String className = clazzWhoseValidationMetaDataWeAreReading.getName(); /* * If the class is proxied there will be a $CGLIB on the end of it. * Remove this. */ ...
[ "private", "Properties", "loadMetaDataPropsFile", "(", "Class", "<", "?", ">", "clazzWhoseValidationMetaDataWeAreReading", ")", "{", "String", "className", "=", "clazzWhoseValidationMetaDataWeAreReading", ".", "getName", "(", ")", ";", "/*\r\n * If the class is proxie...
This method loads the MetaData properties file. The Properties are cached in <b>metaDataPropsCache</b> and will not be reloaded twice. @param clazzWhoseValidationMetaDataWeAreReading The class whose property meta-data we are retrieving. @return
[ "This", "method", "loads", "the", "MetaData", "properties", "file", ".", "The", "Properties", "are", "cached", "in", "<b", ">", "metaDataPropsCache<", "/", "b", ">", "and", "will", "not", "be", "reloaded", "twice", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/validation/readers/PropertiesFileValidatorMetaDataReader.java#L111-L158
test
This method loads the properties file that contains the validation meta - data.
Of course, here is the Java code you requested: ```java private Properties loadMetaDataPropsFile( Class<?> clazzWhoseValidationMetaDataWeAreReading ) { String className = clazzWhoseValidationMetaDataWeAreReading.getName(); /* * If the class is proxied there will be a $CGLIB o...
Unidata/thredds
cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java
CalendarPeriod.of
public static CalendarPeriod of(int value, Field field) { CalendarPeriod want = new CalendarPeriod(value, field); if (cache == null) return want; CalendarPeriod got = cache.getIfPresent(want); if (got != null) return got; cache.put(want, want); return want; }
java
public static CalendarPeriod of(int value, Field field) { CalendarPeriod want = new CalendarPeriod(value, field); if (cache == null) return want; CalendarPeriod got = cache.getIfPresent(want); if (got != null) return got; cache.put(want, want); return want; }
[ "public", "static", "CalendarPeriod", "of", "(", "int", "value", ",", "Field", "field", ")", "{", "CalendarPeriod", "want", "=", "new", "CalendarPeriod", "(", "value", ",", "field", ")", ";", "if", "(", "cache", "==", "null", ")", "return", "want", ";", ...
minimize memory use by interning. wacko shit in GribPartitionBuilder TimeCoordinate, whoduhthunk?
[ "minimize", "memory", "use", "by", "interning", ".", "wacko", "shit", "in", "GribPartitionBuilder", "TimeCoordinate", "whoduhthunk?" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java#L92-L99
test
Creates a calendar period from an int field.
Of course, here is the Java code you requested: ```java public static CalendarPeriod of(int value, Field field) { CalendarPeriod want = new CalendarPeriod(value, field); if (cache == null) return want; CalendarPeriod got = cache.getIfPresent(want); if (got != null) return got; cache.put(want, ...
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/container/management/ServiceManagementImpl.java
ServiceManagementImpl.deactivate
public void deactivate(ServiceID[] arg0) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (arg0.length == 0) { throw new InvalidArgumentException("InvalidArgumentException"); } for (int i = 0; i < arg0.length; i++) { ...
java
public void deactivate(ServiceID[] arg0) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (arg0.length == 0) { throw new InvalidArgumentException("InvalidArgumentException"); } for (int i = 0; i < arg0.length; i++) { ...
[ "public", "void", "deactivate", "(", "ServiceID", "[", "]", "arg0", ")", "throws", "NullPointerException", ",", "InvalidArgumentException", ",", "UnrecognizedServiceException", ",", "InvalidStateException", ",", "ManagementException", "{", "if", "(", "arg0", ".", "len...
/* (non-Javadoc) @see javax.slee.management.ServiceManagementMBean#deactivate(javax.slee.ServiceID [])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/container/management/ServiceManagementImpl.java#L501-L530
test
Deactivate the service.
Of course, here is the Java code you requested: ```java public void deactivate(ServiceID[] arg0) throws NullPointerException, InvalidArgumentException, UnrecognizedServiceException, InvalidStateException, ManagementException { if (arg0.length == 0) { throw new InvalidArgumentException("InvalidArgumentExcep...
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/server/WebSocketServer.java
WebSocketServer.fillFrames
private void fillFrames(Draft draft, Map<Draft, List<Framedata>> draftFrames, String sData, ByteBuffer bData) { if( !draftFrames.containsKey( draft ) ) { List<Framedata> frames = null; if (sData != null) { frames = draft.createFrames( sData, false ); } if (bData != null) { frames = draft.createFra...
java
private void fillFrames(Draft draft, Map<Draft, List<Framedata>> draftFrames, String sData, ByteBuffer bData) { if( !draftFrames.containsKey( draft ) ) { List<Framedata> frames = null; if (sData != null) { frames = draft.createFrames( sData, false ); } if (bData != null) { frames = draft.createFra...
[ "private", "void", "fillFrames", "(", "Draft", "draft", ",", "Map", "<", "Draft", ",", "List", "<", "Framedata", ">", ">", "draftFrames", ",", "String", "sData", ",", "ByteBuffer", "bData", ")", "{", "if", "(", "!", "draftFrames", ".", "containsKey", "("...
Fills the draftFrames with new data for the broadcast @param draft The draft to use @param draftFrames The list of frames per draft to fill @param sData the string data, can be null @param bData the bytebuffer data, can be null
[ "Fills", "the", "draftFrames", "with", "new", "data", "for", "the", "broadcast" ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/server/WebSocketServer.java#L947-L960
test
Fill the frames map for a given draft.
Of course, here is the Java code you requested: ```java private void fillFrames(Draft draft, Map<Draft, List<Framedata>> draftFrames, String sData, ByteBuffer bData) { if( !draftFrames.containsKey( draft ) ) { List<Framedata> frames = null; if (sData != null) { frames = draft.createFrames( sData, false ); ...
eclipse/packagedrone
bundles/org.tukani.xz/src/org/tukaani/xz/lz/HC4.java
HC4.movePos
private int movePos() { int avail = movePos(4, 4); if (avail != 0) { if (++lzPos == Integer.MAX_VALUE) { int normalizationOffset = Integer.MAX_VALUE - cyclicSize; hash.normalize(normalizationOffset); normalize(chain, cyclicSize, normalizationO...
java
private int movePos() { int avail = movePos(4, 4); if (avail != 0) { if (++lzPos == Integer.MAX_VALUE) { int normalizationOffset = Integer.MAX_VALUE - cyclicSize; hash.normalize(normalizationOffset); normalize(chain, cyclicSize, normalizationO...
[ "private", "int", "movePos", "(", ")", "{", "int", "avail", "=", "movePos", "(", "4", ",", "4", ")", ";", "if", "(", "avail", "!=", "0", ")", "{", "if", "(", "++", "lzPos", "==", "Integer", ".", "MAX_VALUE", ")", "{", "int", "normalizationOffset", ...
Moves to the next byte, checks that there is enough available space, and possibly normalizes the hash tables and the hash chain. @return number of bytes available, including the current byte
[ "Moves", "to", "the", "next", "byte", "checks", "that", "there", "is", "enough", "available", "space", "and", "possibly", "normalizes", "the", "hash", "tables", "and", "the", "hash", "chain", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.tukani.xz/src/org/tukaani/xz/lz/HC4.java#L72-L88
test
Move the cursor to the next 4 bytes of data.
Of course, here is the Java code you requested: ```java private int movePos() { int avail = movePos(4, 4); if (avail != 0) { if (++lzPos == Integer.MAX_VALUE) { int normalizationOffset = Integer.MAX_VALUE - cyclicSize; hash.normalize(normalizationOffset); ...
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/WebSocketImpl.java
WebSocketImpl.decodeHandshake
private boolean decodeHandshake( ByteBuffer socketBufferNew ) { ByteBuffer socketBuffer; if( tmpHandshakeBytes.capacity() == 0 ) { socketBuffer = socketBufferNew; } else { if( tmpHandshakeBytes.remaining() < socketBufferNew.remaining() ) { ByteBuffer buf = ByteBuffer.allocate( tmpHandshakeBytes.capacity...
java
private boolean decodeHandshake( ByteBuffer socketBufferNew ) { ByteBuffer socketBuffer; if( tmpHandshakeBytes.capacity() == 0 ) { socketBuffer = socketBufferNew; } else { if( tmpHandshakeBytes.remaining() < socketBufferNew.remaining() ) { ByteBuffer buf = ByteBuffer.allocate( tmpHandshakeBytes.capacity...
[ "private", "boolean", "decodeHandshake", "(", "ByteBuffer", "socketBufferNew", ")", "{", "ByteBuffer", "socketBuffer", ";", "if", "(", "tmpHandshakeBytes", ".", "capacity", "(", ")", "==", "0", ")", "{", "socketBuffer", "=", "socketBufferNew", ";", "}", "else", ...
Returns whether the handshake phase has is completed. In case of a broken handshake this will be never the case.
[ "Returns", "whether", "the", "handshake", "phase", "has", "is", "completed", ".", "In", "case", "of", "a", "broken", "handshake", "this", "will", "be", "never", "the", "case", "." ]
73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9
https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/WebSocketImpl.java#L236-L373
test
Decodes the handshake from the socketBufferNew.
Of course, here is the Java code you requested: ```java private boolean decodeHandshake( ByteBuffer socketBufferNew ) { ByteBuffer socketBuffer; if( tmpHandshakeBytes.capacity() == 0 ) { socketBuffer = socketBufferNew; } else { if( tmpHandshakeBytes.remaining() < socketBufferNew.remaining() ) { ByteBuf...
Unidata/thredds
cdm/src/main/java/ucar/unidata/geoloc/vertical/WRFEta.java
WRFEta.extrapinterpolate
private double[] extrapinterpolate(double[] array) { int n = array.length; double[] d = new double[n + 1]; //end points from linear extrapolation //equations confirmed by Christopher Lindholm d[0] = 1.5 * array[0] - 0.5 * array[1]; d[n] = 1.5 * array[n - 1] - 0.5 * array[n - 2]; /...
java
private double[] extrapinterpolate(double[] array) { int n = array.length; double[] d = new double[n + 1]; //end points from linear extrapolation //equations confirmed by Christopher Lindholm d[0] = 1.5 * array[0] - 0.5 * array[1]; d[n] = 1.5 * array[n - 1] - 0.5 * array[n - 2]; /...
[ "private", "double", "[", "]", "extrapinterpolate", "(", "double", "[", "]", "array", ")", "{", "int", "n", "=", "array", ".", "length", ";", "double", "[", "]", "d", "=", "new", "double", "[", "n", "+", "1", "]", ";", "//end points from linear extrapo...
Add one element to the array by linear interpolation and extrapolation at the ends. @param array input array @return extrapolated/interpolated array
[ "Add", "one", "element", "to", "the", "array", "by", "linear", "interpolation", "and", "extrapolation", "at", "the", "ends", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/vertical/WRFEta.java#L265-L280
test
extrapolation of a double array
Of course, here is the Java code you requested: ```java private double[] extrapinterpolate(double[] array) { int n = array.length; double[] d = new double[n + 1]; //end points from linear extrapolation //equations confirmed by Christopher Lindholm d[0] = 1.5 * array[0] - 0.5 * array[1]; ...
oblac/jodd
jodd-db/src/main/java/jodd/db/oom/naming/ColumnNamingStrategy.java
ColumnNamingStrategy.convertColumnNameToPropertyName
public String convertColumnNameToPropertyName(final String columnName) { StringBuilder propertyName = new StringBuilder(columnName.length()); int len = columnName.length(); if (splitCamelCase) { boolean toUpper = false; for (int i = 0; i < len; i++) { char c = columnName.charAt(i); if (c == separat...
java
public String convertColumnNameToPropertyName(final String columnName) { StringBuilder propertyName = new StringBuilder(columnName.length()); int len = columnName.length(); if (splitCamelCase) { boolean toUpper = false; for (int i = 0; i < len; i++) { char c = columnName.charAt(i); if (c == separat...
[ "public", "String", "convertColumnNameToPropertyName", "(", "final", "String", "columnName", ")", "{", "StringBuilder", "propertyName", "=", "new", "StringBuilder", "(", "columnName", ".", "length", "(", ")", ")", ";", "int", "len", "=", "columnName", ".", "leng...
Converts column name to property name.
[ "Converts", "column", "name", "to", "property", "name", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/naming/ColumnNamingStrategy.java#L63-L85
test
Convert a column name to a property name.
Of course, here is the Java code you requested: ```java public String convertColumnNameToPropertyName(final String columnName) { StringBuilder propertyName = new StringBuilder(columnName.length()); int len = columnName.length(); if (splitCamelCase) { boolean toUpper = false; for (int i = 0; i < len; i++) ...
rupertlssmith/lojix
base/struts-tools/src/main/com/thesett/common/webapp/tags/DebugTag.java
DebugTag.getUserPrincipal
public String getUserPrincipal() { // Create a hash table to hold the results in Map info = new TreeMap(); // Extract the request from the page context HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); // Get the principal from the request ...
java
public String getUserPrincipal() { // Create a hash table to hold the results in Map info = new TreeMap(); // Extract the request from the page context HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); // Get the principal from the request ...
[ "public", "String", "getUserPrincipal", "(", ")", "{", "// Create a hash table to hold the results in", "Map", "info", "=", "new", "TreeMap", "(", ")", ";", "// Extract the request from the page context", "HttpServletRequest", "request", "=", "(", "HttpServletRequest", ")",...
Returns the user principal name. @return The user principal name.
[ "Returns", "the", "user", "principal", "name", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/struts-tools/src/main/com/thesett/common/webapp/tags/DebugTag.java#L270-L293
test
Get the user principal of the current user.
Of course, here is the Java code you requested: ```java public String getUserPrincipal() { // Create a hash table to hold the results in Map info = new TreeMap(); // Extract the request from the page context HttpServletRequest request = (HttpServletRequest) pageContext.getRequest()...
retog/wymiwyg-commons-core
src/main/java/org/wymiwyg/commons/util/arguments/AnnotatedInterfaceArguments.java
AnnotatedInterfaceArguments.process
public void process(List argumentList) throws InvalidArgumentsException { Set<Method> requiredArguments = new HashSet<Method>(); NamedAttributeProcessor namedAttributeProcessor = new NamedAttributeProcessor(); for (final Method m : annotated.getMethods()) { if (m.isAnnotationPresent(CommandLine.class)) { f...
java
public void process(List argumentList) throws InvalidArgumentsException { Set<Method> requiredArguments = new HashSet<Method>(); NamedAttributeProcessor namedAttributeProcessor = new NamedAttributeProcessor(); for (final Method m : annotated.getMethods()) { if (m.isAnnotationPresent(CommandLine.class)) { f...
[ "public", "void", "process", "(", "List", "argumentList", ")", "throws", "InvalidArgumentsException", "{", "Set", "<", "Method", ">", "requiredArguments", "=", "new", "HashSet", "<", "Method", ">", "(", ")", ";", "NamedAttributeProcessor", "namedAttributeProcessor",...
/* (non-Javadoc) @see org.wymiwyg.commons.util.arguments.ArgumentProcessor#process(java.util.List)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f64530a2690e2d9ee0184c5671214ee32572482d
https://github.com/retog/wymiwyg-commons-core/blob/f64530a2690e2d9ee0184c5671214ee32572482d/src/main/java/org/wymiwyg/commons/util/arguments/AnnotatedInterfaceArguments.java#L238-L271
test
Process the given argument list.
Of course, here is the Java code you requested: ```java public void process(List argumentList) throws InvalidArgumentsException { Set<Method> requiredArguments = new HashSet<Method>(); NamedAttributeProcessor namedAttributeProcessor = new NamedAttributeProcessor(); for (final Method m : annotated.getMethods()) {...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/Prop.java
Prop.getPropertyNames
public Enumeration getPropertyNames() throws MalformedElementException { Node firstChild = getChildElement(root, true); final Node firstElement = firstChild; Enumeration e = new Enumeration() { Node currentElement = firstElement; public boolean hasMoreElements() { ...
java
public Enumeration getPropertyNames() throws MalformedElementException { Node firstChild = getChildElement(root, true); final Node firstElement = firstChild; Enumeration e = new Enumeration() { Node currentElement = firstElement; public boolean hasMoreElements() { ...
[ "public", "Enumeration", "getPropertyNames", "(", ")", "throws", "MalformedElementException", "{", "Node", "firstChild", "=", "getChildElement", "(", "root", ",", "true", ")", ";", "final", "Node", "firstElement", "=", "firstChild", ";", "Enumeration", "e", "=", ...
Returns an <code>Enumeration</code> over this prop's property <code>QualifiedName</code>s. @returns an <code>Enumeration</code> of </code>QualifiedName</code>s @throws MalformedElementException if there is reason to believe that this editor's underlying element is not well formed
[ "Returns", "an", "<code", ">", "Enumeration<", "/", "code", ">", "over", "this", "prop", "s", "property", "<code", ">", "QualifiedName<", "/", "code", ">", "s", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/Prop.java#L122-L148
test
Get an enumeration of the property names of the current application.
Of course, here is the Java code you requested: ```java public Enumeration getPropertyNames() throws MalformedElementException { Node firstChild = getChildElement(root, true); final Node firstElement = firstChild; Enumeration e = new Enumeration() { Node currentElement = firstElemen...
ngageoint/geopackage-android
geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java
RTreeIndexTableDao.rawQuery
public UserCustomCursor rawQuery(String sql, String[] selectionArgs) { validateRTree(); Cursor cursor = database.rawQuery(sql, selectionArgs); UserCustomCursor customCursor = new UserCustomCursor(getTable(), cursor); return customCursor; }
java
public UserCustomCursor rawQuery(String sql, String[] selectionArgs) { validateRTree(); Cursor cursor = database.rawQuery(sql, selectionArgs); UserCustomCursor customCursor = new UserCustomCursor(getTable(), cursor); return customCursor; }
[ "public", "UserCustomCursor", "rawQuery", "(", "String", "sql", ",", "String", "[", "]", "selectionArgs", ")", "{", "validateRTree", "(", ")", ";", "Cursor", "cursor", "=", "database", ".", "rawQuery", "(", "sql", ",", "selectionArgs", ")", ";", "UserCustomC...
Perform a raw query @param sql sql statement @param selectionArgs selection arguments @return result cursor
[ "Perform", "a", "raw", "query" ]
d19e9fcc636462c0f0ae1b7eca4acafae48de21b
https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/extension/RTreeIndexTableDao.java#L211-L217
test
Query a user defined table.
Of course, here is the Java code you requested: ```java public UserCustomCursor rawQuery(String sql, String[] selectionArgs) { validateRTree(); Cursor cursor = database.rawQuery(sql, selectionArgs); UserCustomCursor customCursor = new UserCustomCursor(getTable(), cursor); return custom...
spring-projects/spring-session
samples/boot/findbyusername/src/main/java/sample/mvc/IndexController.java
IndexController.removeSession
@RequestMapping(value = "/sessions/{sessionIdToDelete}", method = RequestMethod.DELETE) public String removeSession(Principal principal, @PathVariable String sessionIdToDelete) { Set<String> usersSessionIds = this.sessions .findByPrincipalName(principal.getName()).keySet(); if (usersSessionIds.contains(sess...
java
@RequestMapping(value = "/sessions/{sessionIdToDelete}", method = RequestMethod.DELETE) public String removeSession(Principal principal, @PathVariable String sessionIdToDelete) { Set<String> usersSessionIds = this.sessions .findByPrincipalName(principal.getName()).keySet(); if (usersSessionIds.contains(sess...
[ "@", "RequestMapping", "(", "value", "=", "\"/sessions/{sessionIdToDelete}\"", ",", "method", "=", "RequestMethod", ".", "DELETE", ")", "public", "String", "removeSession", "(", "Principal", "principal", ",", "@", "PathVariable", "String", "sessionIdToDelete", ")", ...
end::findbyusername[]
[ "end", "::", "findbyusername", "[]" ]
397d4e5ca11954072187ac701ab0379505029f7d
https://github.com/spring-projects/spring-session/blob/397d4e5ca11954072187ac701ab0379505029f7d/samples/boot/findbyusername/src/main/java/sample/mvc/IndexController.java#L53-L63
test
Removes a session from the users session list.
Of course, here is the Java code you requested: ```java @RequestMapping(value = "/sessions/{sessionIdToDelete}", method = RequestMethod.DELETE) public String removeSession(Principal principal, @PathVariable String sessionIdToDelete) { Set<String> usersSessionIds = this.sessions .findByPrincipalName(principal...
kocakosm/pitaya
src/org/kocakosm/pitaya/util/ByteBuffer.java
ByteBuffer.append
public ByteBuffer append(byte b) { int newCount = count + 1; ensureCapacity(newCount); buf[count] = b; count = newCount; return this; }
java
public ByteBuffer append(byte b) { int newCount = count + 1; ensureCapacity(newCount); buf[count] = b; count = newCount; return this; }
[ "public", "ByteBuffer", "append", "(", "byte", "b", ")", "{", "int", "newCount", "=", "count", "+", "1", ";", "ensureCapacity", "(", "newCount", ")", ";", "buf", "[", "count", "]", "=", "b", ";", "count", "=", "newCount", ";", "return", "this", ";", ...
Writes the given byte to this buffer. @param b the byte to write. @return this object.
[ "Writes", "the", "given", "byte", "to", "this", "buffer", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/ByteBuffer.java#L82-L89
test
Appends a byte to the end of the buffer.
Of course, here is the Java code you requested: ```java public ByteBuffer append(byte b) { int newCount = count + 1; ensureCapacity(newCount); buf[count] = b; count = newCount; return this; } ``` Hope this helps!
oblac/jodd
jodd-petite/src/main/java/jodd/petite/PetiteBeans.java
PetiteBeans.registerPetiteMethodInjectionPoint
public void registerPetiteMethodInjectionPoint(final String beanName, final String methodName, final Class[] arguments, final String[] references) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospector.get().lookup(beanDefinition.type); Method method = n...
java
public void registerPetiteMethodInjectionPoint(final String beanName, final String methodName, final Class[] arguments, final String[] references) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospector.get().lookup(beanDefinition.type); Method method = n...
[ "public", "void", "registerPetiteMethodInjectionPoint", "(", "final", "String", "beanName", ",", "final", "String", "methodName", ",", "final", "Class", "[", "]", "arguments", ",", "final", "String", "[", "]", "references", ")", "{", "BeanDefinition", "beanDefinit...
Registers method injection point. @param beanName bean name @param methodName method name @param arguments method arguments, may be <code>null</code> @param references injection references
[ "Registers", "method", "injection", "point", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/PetiteBeans.java#L608-L638
test
Registers a method injection point.
Of course, here is the Java code you requested: ```java public void registerPetiteMethodInjectionPoint(final String beanName, final String methodName, final Class[] arguments, final String[] references) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); ClassDescriptor cd = ClassIntrospecto...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createVermietbareFlaeche
@XmlElementDecl(namespace = "", name = "vermietbare_flaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createVermietbareFlaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_VermietbareFlaeche_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "vermietbare_flaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createVermietbareFlaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_VermietbareFlaeche_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"vermietbare_flaeche\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createVermietbareFlaeche", "(", "BigDecimal", "...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L2458-L2462
test
Create an instance of the VermietbareFlaeche JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "vermietbare_flaeche") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createVermietbareFlaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_VermietbareFlaeche_QNAME, BigDecimal...
GojaFramework/goja
goja-rapid/src/main/java/goja/rapid/qrcode/QRCode.java
QRCode.toFile
public QRCode toFile(File qrcodeFile, File appendFile) { try { if (!qrcodeFile.exists()) { Files.createParentDirs(qrcodeFile); qrcodeFile.createNewFile(); } appendImage(this.qrcodeImage, ImageIO.read(appendFile), this.format); if ...
java
public QRCode toFile(File qrcodeFile, File appendFile) { try { if (!qrcodeFile.exists()) { Files.createParentDirs(qrcodeFile); qrcodeFile.createNewFile(); } appendImage(this.qrcodeImage, ImageIO.read(appendFile), this.format); if ...
[ "public", "QRCode", "toFile", "(", "File", "qrcodeFile", ",", "File", "appendFile", ")", "{", "try", "{", "if", "(", "!", "qrcodeFile", ".", "exists", "(", ")", ")", "{", "Files", ".", "createParentDirs", "(", "qrcodeFile", ")", ";", "qrcodeFile", ".", ...
把指定的内容生成为一个 QRCode 的图片,并在该图片中间添加上指定的图片;之后保存到指定的文件内。 @param qrcodeFile QRCode 图片生成的指定的文件 @param appendFile 需要添加的图片 @return QRCode 处理器
[ "把指定的内容生成为一个", "QRCode", "的图片,并在该图片中间添加上指定的图片;之后保存到指定的文件内。" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-rapid/src/main/java/goja/rapid/qrcode/QRCode.java#L275-L294
test
This method writes the image to the specified file.
Of course, here is the Java code you requested: ```java public QRCode toFile(File qrcodeFile, File appendFile) { try { if (!qrcodeFile.exists()) { Files.createParentDirs(qrcodeFile); qrcodeFile.createNewFile(); } appendImage(this.qrcodeImage...
RestComm/jain-slee
container/services/src/main/java/org/mobicents/slee/runtime/sbb/SbbActivityContextInterfaceImpl.java
SbbActivityContextInterfaceImpl.getFieldValue
public Object getFieldValue(String fieldName, Class<?> returnType) { String realFieldName = getRealFieldName(fieldName); Object value = aciImpl.getActivityContext().getDataAttribute( realFieldName); if (value == null) { if (returnType.isPrimitive()) { if (returnType.equals(Integer.TYPE)) { retu...
java
public Object getFieldValue(String fieldName, Class<?> returnType) { String realFieldName = getRealFieldName(fieldName); Object value = aciImpl.getActivityContext().getDataAttribute( realFieldName); if (value == null) { if (returnType.isPrimitive()) { if (returnType.equals(Integer.TYPE)) { retu...
[ "public", "Object", "getFieldValue", "(", "String", "fieldName", ",", "Class", "<", "?", ">", "returnType", ")", "{", "String", "realFieldName", "=", "getRealFieldName", "(", "fieldName", ")", ";", "Object", "value", "=", "aciImpl", ".", "getActivityContext", ...
Retrieves an sbb aci data field value @param fieldName @param returnType @return
[ "Retrieves", "an", "sbb", "aci", "data", "field", "value" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbb/SbbActivityContextInterfaceImpl.java#L237-L261
test
Gets the value of the field identified by the given name.
Of course, here is the Java code you requested: ```java public Object getFieldValue(String fieldName, Class<?> returnType) { String realFieldName = getRealFieldName(fieldName); Object value = aciImpl.getActivityContext().getDataAttribute( realFieldName); if (value == null) { if (returnType.isPrimitive(...
kocakosm/pitaya
src/org/kocakosm/pitaya/collection/Iterables.java
Iterables.skip
public static <T> Iterable<T> skip(Iterable<T> iterable, int n) { return new SkipIterable<T>(iterable, n); }
java
public static <T> Iterable<T> skip(Iterable<T> iterable, int n) { return new SkipIterable<T>(iterable, n); }
[ "public", "static", "<", "T", ">", "Iterable", "<", "T", ">", "skip", "(", "Iterable", "<", "T", ">", "iterable", ",", "int", "n", ")", "{", "return", "new", "SkipIterable", "<", "T", ">", "(", "iterable", ",", "n", ")", ";", "}" ]
Returns an {@code Iterable} view of the given {@code Iterable} that skips its first {@code n} elements. The returned {@code Iterable}'s {@code Iterator} supports {@link Iterator#remove()} if the original {@code Iterator} does. @param <T> the type of the {@code Iterable}'s elements. @param iterable the input {@code Ite...
[ "Returns", "an", "{", "@code", "Iterable", "}", "view", "of", "the", "given", "{", "@code", "Iterable", "}", "that", "skips", "its", "first", "{", "@code", "n", "}", "elements", ".", "The", "returned", "{", "@code", "Iterable", "}", "s", "{", "@code", ...
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/collection/Iterables.java#L184-L187
test
Returns an iterable that skips the specified number of elements from the specified iterable.
Of course, here is the Java code you requested: ```java public static <T> Iterable<T> skip(Iterable<T> iterable, int n) { return new SkipIterable<T>(iterable, n); } ``` Hope this helps!
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/astyanax/APreaggregatedMetricsRW.java
APreaggregatedMetricsRW.insertMetrics
@Override public void insertMetrics(Collection<IMetric> metrics) throws IOException { insertMetrics(metrics, Granularity.FULL); }
java
@Override public void insertMetrics(Collection<IMetric> metrics) throws IOException { insertMetrics(metrics, Granularity.FULL); }
[ "@", "Override", "public", "void", "insertMetrics", "(", "Collection", "<", "IMetric", ">", "metrics", ")", "throws", "IOException", "{", "insertMetrics", "(", "metrics", ",", "Granularity", ".", "FULL", ")", ";", "}" ]
Inserts a collection of metrics to the metrics_preaggregated_full column family @param metrics @throws IOException
[ "Inserts", "a", "collection", "of", "metrics", "to", "the", "metrics_preaggregated_full", "column", "family" ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/astyanax/APreaggregatedMetricsRW.java#L52-L55
test
Insert a collection of metrics into the CRA.
Of course, here is the Java code you requested: ```java @Override public void insertMetrics(Collection<IMetric> metrics) throws IOException { insertMetrics(metrics, Granularity.FULL); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Completable.java
Completable.doAfterTerminate
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable doAfterTerminate(final Action onAfterTerminate) { return doOnLifecycle( Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, Functi...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable doAfterTerminate(final Action onAfterTerminate) { return doOnLifecycle( Functions.emptyConsumer(), Functions.emptyConsumer(), Functions.EMPTY_ACTION, Functi...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "Completable", "doAfterTerminate", "(", "final", "Action", "onAfterTerminate", ")", "{", "return", "doOnLifecycle", "(", "Functions", ".", "emptyConsumer", ...
Returns a Completable instance that calls the given onTerminate callback after this Completable completes normally or with an exception. <p> <img width="640" height="304" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.doAfterTerminate.png" alt=""> <dl> <dt><b>Scheduler:</b></dt> <dd>{...
[ "Returns", "a", "Completable", "instance", "that", "calls", "the", "given", "onTerminate", "callback", "after", "this", "Completable", "completes", "normally", "or", "with", "an", "exception", ".", "<p", ">", "<img", "width", "=", "640", "height", "=", "304", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Completable.java#L1655-L1665
test
Execute the given action after the application has terminated.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final Completable doAfterTerminate(final Action onAfterTerminate) { return doOnLifecycle( Functions.emptyConsumer(), Functions.emptyConsumer(), ...
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java
AbstractResourceHandle.setProperties
public void setProperties(Collection properties) throws DAVException { Assert.isNotNull(properties); // Setting no properties is a no-op. if (properties.isEmpty()) return; // Build the request body to describe the properties to set. Document document = newDocument()...
java
public void setProperties(Collection properties) throws DAVException { Assert.isNotNull(properties); // Setting no properties is a no-op. if (properties.isEmpty()) return; // Build the request body to describe the properties to set. Document document = newDocument()...
[ "public", "void", "setProperties", "(", "Collection", "properties", ")", "throws", "DAVException", "{", "Assert", ".", "isNotNull", "(", "properties", ")", ";", "// Setting no properties is a no-op.", "if", "(", "properties", ".", "isEmpty", "(", ")", ")", "return...
Set the given properties on this resource. @param properties a <code>Collection</code> of property <code>Element</code>s. @exception DAVException if there was a problem setting the properties. @see IServer#proppatch(Locator, Context, Document)
[ "Set", "the", "given", "properties", "on", "this", "resource", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/client/AbstractResourceHandle.java#L1154-L1187
test
Sets the properties of the current application.
Of course, here is the Java code you requested: ```java public void setProperties(Collection properties) throws DAVException { Assert.isNotNull(properties); // Setting no properties is a no-op. if (properties.isEmpty()) return; // Build the request body to describe the pro...
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/Index.java
Index.deleteObjectsAsync
public Request deleteObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) { return deleteObjectsAsync(objectIDs, /* requestOptions: */ null, completionHandler); }
java
public Request deleteObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) { return deleteObjectsAsync(objectIDs, /* requestOptions: */ null, completionHandler); }
[ "public", "Request", "deleteObjectsAsync", "(", "final", "@", "NonNull", "Collection", "<", "String", ">", "objectIDs", ",", "@", "Nullable", "CompletionHandler", "completionHandler", ")", "{", "return", "deleteObjectsAsync", "(", "objectIDs", ",", "/* requestOptions:...
Deletes several objects from this index (asynchronously). @param objectIDs Identifiers of objects to delete. @param completionHandler The listener that will be notified of the request's outcome. @return A cancellable request.
[ "Deletes", "several", "objects", "from", "this", "index", "(", "asynchronously", ")", "." ]
3293ba6e6116a4f6c1face2cc606bc047d6d4a3c
https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L729-L731
test
Asynchronously delete a set of objects from the cache.
Of course, here is the Java code you requested: ```java public Request deleteObjectsAsync(final @NonNull Collection<String> objectIDs, @Nullable CompletionHandler completionHandler) { return deleteObjectsAsync(objectIDs, /* requestOptions: */ null, completionHandler); } ``` Hope this helps!
spring-projects/spring-security
config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java
HeadersConfigurer.addHeaderWriter
public HeadersConfigurer<H> addHeaderWriter(HeaderWriter headerWriter) { Assert.notNull(headerWriter, "headerWriter cannot be null"); this.headerWriters.add(headerWriter); return this; }
java
public HeadersConfigurer<H> addHeaderWriter(HeaderWriter headerWriter) { Assert.notNull(headerWriter, "headerWriter cannot be null"); this.headerWriters.add(headerWriter); return this; }
[ "public", "HeadersConfigurer", "<", "H", ">", "addHeaderWriter", "(", "HeaderWriter", "headerWriter", ")", "{", "Assert", ".", "notNull", "(", "headerWriter", ",", "\"headerWriter cannot be null\"", ")", ";", "this", ".", "headerWriters", ".", "add", "(", "headerW...
Adds a {@link HeaderWriter} instance @param headerWriter the {@link HeaderWriter} instance to add @return the {@link HeadersConfigurer} for additional customizations
[ "Adds", "a", "{", "@link", "HeaderWriter", "}", "instance" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java#L103-L107
test
Adds a new header writer to the configuration.
Of course, here is the Java code you requested: ```java public HeadersConfigurer<H> addHeaderWriter(HeaderWriter headerWriter) { Assert.notNull(headerWriter, "headerWriter cannot be null"); this.headerWriters.add(headerWriter); return this; } ``` Hope this helps!
abmargb/jamppa
src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
SASLMechanism.authenticate
public void authenticate(String username, String host, String password) throws IOException, XMPPException { authenticate(username, host, host, password); }
java
public void authenticate(String username, String host, String password) throws IOException, XMPPException { authenticate(username, host, host, password); }
[ "public", "void", "authenticate", "(", "String", "username", ",", "String", "host", ",", "String", "password", ")", "throws", "IOException", ",", "XMPPException", "{", "authenticate", "(", "username", ",", "host", ",", "host", ",", "password", ")", ";", "}" ...
Same as {@link #authenticate(String, String, String, String)}, but with the hostname used as the serviceName. <p> Kept for backward compatibility only. @param username the username of the user being authenticated. @param host the hostname where the user account resides. @param password the password for this account. @...
[ "Same", "as", "{", "@link", "#authenticate", "(", "String", "String", "String", "String", ")", "}", "but", "with", "the", "hostname", "used", "as", "the", "serviceName", ".", "<p", ">", "Kept", "for", "backward", "compatibility", "only", "." ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L183-L186
test
Authenticate with the CDN.
Of course, here is the Java code you requested: ```java public void authenticate(String username, String host, String password) throws IOException, XMPPException { authenticate(username, host, host, password); } ``` Hope this helps!
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Codec.java
Codec.findDecodingCodecByIntID
public static Codec findDecodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findDecodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); }
java
public static Codec findDecodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findDecodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); }
[ "public", "static", "Codec", "findDecodingCodecByIntID", "(", "int", "id", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "Codec_findDecodingCodecByIntID", "(", "id", ")", ";", "return", "(", "cPtr", "==", "0", ")", "?", "null", ":", "new", "Codec", "(", ...
Find a codec that can be used for decoding.<br> @param id The id of the codec, as an integer<br> @return the codec, or null if we can't find it.
[ "Find", "a", "codec", "that", "can", "be", "used", "for", "decoding", ".", "<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Codec.java#L409-L412
test
Find the decoding codec for the given integer id.
Of course, here is the Java code you requested: ```java public static Codec findDecodingCodecByIntID(int id) { long cPtr = VideoJNI.Codec_findDecodingCodecByIntID(id); return (cPtr == 0) ? null : new Codec(cPtr, false); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/FileUtil.java
FileUtil.writeStream
public static void writeStream(final FileOutputStream out, final InputStream in) throws IOException { try { StreamUtil.copy(in, out); } finally { StreamUtil.close(out); } }
java
public static void writeStream(final FileOutputStream out, final InputStream in) throws IOException { try { StreamUtil.copy(in, out); } finally { StreamUtil.close(out); } }
[ "public", "static", "void", "writeStream", "(", "final", "FileOutputStream", "out", ",", "final", "InputStream", "in", ")", "throws", "IOException", "{", "try", "{", "StreamUtil", ".", "copy", "(", "in", ",", "out", ")", ";", "}", "finally", "{", "StreamUt...
Write {@link InputStream} in to {@link FileOutputStream}. @param out {@link FileOutputStream} to write to. @param in {@link InputStream} to read. @throws IOException if there is an issue reading/writing.
[ "Write", "{", "@link", "InputStream", "}", "in", "to", "{", "@link", "FileOutputStream", "}", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L867-L873
test
Write stream.
Of course, here is the Java code you requested: ```java public static void writeStream(final FileOutputStream out, final InputStream in) throws IOException { try { StreamUtil.copy(in, out); } finally { StreamUtil.close(out); } } ``` Hope this helps!
eclipse/packagedrone
bundles/org.eclipse.packagedrone.repo.aspect.mvnosgi/src/org/eclipse/packagedrone/repo/aspect/mvnosgi/internal/VirtualizerImpl.java
VirtualizerImpl.virtualize
@Override public void virtualize ( final Context context ) { try { processVirtualize ( context ); } catch ( final Exception e ) { throw new RuntimeException ( e ); } }
java
@Override public void virtualize ( final Context context ) { try { processVirtualize ( context ); } catch ( final Exception e ) { throw new RuntimeException ( e ); } }
[ "@", "Override", "public", "void", "virtualize", "(", "final", "Context", "context", ")", "{", "try", "{", "processVirtualize", "(", "context", ")", ";", "}", "catch", "(", "final", "Exception", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ...
private final static Logger logger = LoggerFactory.getLogger ( VirtualizerImpl.class );
[ "private", "final", "static", "Logger", "logger", "=", "LoggerFactory", ".", "getLogger", "(", "VirtualizerImpl", ".", "class", ")", ";" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.eclipse.packagedrone.repo.aspect.mvnosgi/src/org/eclipse/packagedrone/repo/aspect/mvnosgi/internal/VirtualizerImpl.java#L29-L40
test
Virtualize the context.
Of course, here is the Java code you requested: ```java @Override public void virtualize ( final Context context ) { try { processVirtualize ( context ); } catch ( final Exception e ) { throw new RuntimeException ( e ); } } ``` Hope t...
wildfly/wildfly
batch-jberet/src/main/java/org/wildfly/extension/batch/jberet/AttributeParsers.java
AttributeParsers.readRequiredAttributes
static Map<Attribute, String> readRequiredAttributes(final XMLExtendedStreamReader reader, final Set<Attribute> attributes) throws XMLStreamException { final int attributeCount = reader.getAttributeCount(); final Map<Attribute, String> result = new EnumMap<>(Attribute.class); for (int i = 0; i <...
java
static Map<Attribute, String> readRequiredAttributes(final XMLExtendedStreamReader reader, final Set<Attribute> attributes) throws XMLStreamException { final int attributeCount = reader.getAttributeCount(); final Map<Attribute, String> result = new EnumMap<>(Attribute.class); for (int i = 0; i <...
[ "static", "Map", "<", "Attribute", ",", "String", ">", "readRequiredAttributes", "(", "final", "XMLExtendedStreamReader", "reader", ",", "final", "Set", "<", "Attribute", ">", "attributes", ")", "throws", "XMLStreamException", "{", "final", "int", "attributeCount", ...
Reads the required attributes from an XML configuration. <p> The reader must be on an element with attributes. </p> @param reader the reader for the attributes @param attributes the required attributes @return a map of the required attributes with the key being the attribute and the value being the value of the a...
[ "Reads", "the", "required", "attributes", "from", "an", "XML", "configuration", ".", "<p", ">", "The", "reader", "must", "be", "on", "an", "element", "with", "attributes", ".", "<", "/", "p", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/batch-jberet/src/main/java/org/wildfly/extension/batch/jberet/AttributeParsers.java#L95-L112
test
Read required attributes.
Of course, here is the Java code you requested: ```java static Map<Attribute, String> readRequiredAttributes(final XMLExtendedStreamReader reader, final Set<Attribute> attributes) throws XMLStreamException { final int attributeCount = reader.getAttributeCount(); final Map<Attribute, String> result = ne...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/lang/Strs.java
Strs.toHex
public static String toHex(int d, int width) { return Strs.cutRight(Integer.toHexString(d), width, '0'); }
java
public static String toHex(int d, int width) { return Strs.cutRight(Integer.toHexString(d), width, '0'); }
[ "public", "static", "String", "toHex", "(", "int", "d", ",", "int", "width", ")", "{", "return", "Strs", ".", "cutRight", "(", "Integer", ".", "toHexString", "(", "d", ")", ",", "width", ",", "'", "'", ")", ";", "}" ]
将一个整数转换成固定长度的十六进制形式字符串 @param d 整数 @param width 宽度 @return 新字符串
[ "将一个整数转换成固定长度的十六进制形式字符串" ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/lang/Strs.java#L1622-L1624
test
Convert an integer to a hex string.
Of course, here is the Java code you requested: ```java public static String toHex(int d, int width) { return Strs.cutRight(Integer.toHexString(d), width, '0'); } ``` Hope this helps!
oblac/jodd
jodd-core/src/main/java/jodd/io/NetUtil.java
NetUtil.validateAgaintIPAdressV4Format
public static boolean validateAgaintIPAdressV4Format(final String input) { if (input == null) { return false; } int hitDots = 0; char[] data = input.toCharArray(); for (int i = 0; i < data.length; i++) { char c = data[i]; int b = 0; do { if (c < '0' || c > '9') { return false; } ...
java
public static boolean validateAgaintIPAdressV4Format(final String input) { if (input == null) { return false; } int hitDots = 0; char[] data = input.toCharArray(); for (int i = 0; i < data.length; i++) { char c = data[i]; int b = 0; do { if (c < '0' || c > '9') { return false; } ...
[ "public", "static", "boolean", "validateAgaintIPAdressV4Format", "(", "final", "String", "input", ")", "{", "if", "(", "input", "==", "null", ")", "{", "return", "false", ";", "}", "int", "hitDots", "=", "0", ";", "char", "[", "]", "data", "=", "input", ...
Checks given string against IP address v4 format. @param input an ip address - may be null @return <tt>true</tt> if param has a valid ip v4 format <tt>false</tt> otherwise @see <a href="https://en.wikipedia.org/wiki/IP_address#IPv4_addresses">ip address v4</a>
[ "Checks", "given", "string", "against", "IP", "address", "v4", "format", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/NetUtil.java#L108-L136
test
Validate the input string for AGTIPAdressV4Format.
Of course, here is the Java code you requested: ```java public static boolean validateAgaintIPAdressV4Format(final String input) { if (input == null) { return false; } int hitDots = 0; char[] data = input.toCharArray(); for (int i = 0; i < data.length; i++) { char c = data[i]; int b = 0; do { ...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/config/switches/ProtocolSwitch.java
ProtocolSwitch.toBitSet
public static BitSet toBitSet(int value) { if (value > Byte.MAX_VALUE || value < Byte.MIN_VALUE) { throw new IllegalArgumentException( "The value " + value + " is out of byte range, should be limited between [" + Byte.MIN_VALUE + "] to [" + Byte.MAX_VALUE + "]...
java
public static BitSet toBitSet(int value) { if (value > Byte.MAX_VALUE || value < Byte.MIN_VALUE) { throw new IllegalArgumentException( "The value " + value + " is out of byte range, should be limited between [" + Byte.MIN_VALUE + "] to [" + Byte.MAX_VALUE + "]...
[ "public", "static", "BitSet", "toBitSet", "(", "int", "value", ")", "{", "if", "(", "value", ">", "Byte", ".", "MAX_VALUE", "||", "value", "<", "Byte", ".", "MIN_VALUE", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"The value \"", "+", "val...
from byte to bit set @param value @return bit set represent the byte
[ "from", "byte", "to", "bit", "set" ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/config/switches/ProtocolSwitch.java#L127-L143
test
Get a BitSet from a byte value.
Of course, here is the Java code you requested: ```java public static BitSet toBitSet(int value) { if (value > Byte.MAX_VALUE || value < Byte.MIN_VALUE) { throw new IllegalArgumentException( "The value " + value + " is out of byte range, should be limited between [" ...
wildfly/wildfly
messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/QueueService.java
QueueService.start
@Override public synchronized void start(StartContext context) throws StartException { if (createQueue) { try { final ActiveMQServer server = this.activeMQServerSupplier.get(); MessagingLogger.ROOT_LOGGER.debugf("Deploying queue on server %s with address: %s , na...
java
@Override public synchronized void start(StartContext context) throws StartException { if (createQueue) { try { final ActiveMQServer server = this.activeMQServerSupplier.get(); MessagingLogger.ROOT_LOGGER.debugf("Deploying queue on server %s with address: %s , na...
[ "@", "Override", "public", "synchronized", "void", "start", "(", "StartContext", "context", ")", "throws", "StartException", "{", "if", "(", "createQueue", ")", "{", "try", "{", "final", "ActiveMQServer", "server", "=", "this", ".", "activeMQServerSupplier", "."...
{@inheritDoc}
[ "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/QueueService.java#L58-L79
test
Override start to create a new queue.
Of course, here is the Java code you requested: ```java @Override public synchronized void start(StartContext context) throws StartException { if (createQueue) { try { final ActiveMQServer server = this.activeMQServerSupplier.get(); MessagingLogger.ROOT_LOGGER.de...
Unidata/thredds
legacy/src/main/java/thredds/cataloggen/config/DatasetFilter.java
DatasetFilter.acceptDatasetByFilterGroup
public static boolean acceptDatasetByFilterGroup(List filters, InvDataset dataset, boolean isCollectionDataset) { if (filters == null) throw new NullPointerException("Given null list of filters."); if (dataset == null) throw new NullPointerException("Given null dataset."); // If not filters, accept all dat...
java
public static boolean acceptDatasetByFilterGroup(List filters, InvDataset dataset, boolean isCollectionDataset) { if (filters == null) throw new NullPointerException("Given null list of filters."); if (dataset == null) throw new NullPointerException("Given null dataset."); // If not filters, accept all dat...
[ "public", "static", "boolean", "acceptDatasetByFilterGroup", "(", "List", "filters", ",", "InvDataset", "dataset", ",", "boolean", "isCollectionDataset", ")", "{", "if", "(", "filters", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"Given null li...
Given a dataset and a group of filters, return true if the group of filters indicates that the dataset should be accepted, false if it should be rejected. <p/> To make filtering out a set of datasets as easy as allowing a set of datasets, DatasetFilter provides a dataset reject mode as well as a dataset accept mode. Re...
[ "Given", "a", "dataset", "and", "a", "group", "of", "filters", "return", "true", "if", "the", "group", "of", "filters", "indicates", "that", "the", "dataset", "should", "be", "accepted", "false", "if", "it", "should", "be", "rejected", ".", "<p", "/", ">...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/cataloggen/config/DatasetFilter.java#L358-L400
test
Accept a dataset by a list of filters.
Of course, here is the Java code you requested: ```java public static boolean acceptDatasetByFilterGroup(List filters, InvDataset dataset, boolean isCollectionDataset) { if (filters == null) throw new NullPointerException("Given null list of filters."); if (dataset == null) throw new NullPointerException("Give...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/image/ScalablePicture.java
ScalablePicture.sourceStatusChange
public void sourceStatusChange(int statusCode, String statusMessage, SourcePicture sp) { //Tools.log("ScalablePicture.sourceStatusChange: status received from SourceImage: " + statusMessage); switch (statusCode) { case SourcePicture.UNINITIALISED: Tools.log("ScalablePicture.sourceStatusChang...
java
public void sourceStatusChange(int statusCode, String statusMessage, SourcePicture sp) { //Tools.log("ScalablePicture.sourceStatusChange: status received from SourceImage: " + statusMessage); switch (statusCode) { case SourcePicture.UNINITIALISED: Tools.log("ScalablePicture.sourceStatusChang...
[ "public", "void", "sourceStatusChange", "(", "int", "statusCode", ",", "String", "statusMessage", ",", "SourcePicture", "sp", ")", "{", "//Tools.log(\"ScalablePicture.sourceStatusChange: status received from SourceImage: \" + statusMessage);\r", "switch", "(", "statusCode", ")", ...
method that is invoked by the SourcePictureListener interface. Usually this will be called by the SourcePicture telling the ScalablePicture that it has completed loading. The ScalablePicture should then change it's own status and tell the ScalableListeners what's up.
[ "method", "that", "is", "invoked", "by", "the", "SourcePictureListener", "interface", ".", "Usually", "this", "will", "be", "called", "by", "the", "SourcePicture", "telling", "the", "ScalablePicture", "that", "it", "has", "completed", "loading", ".", "The", "Sca...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/image/ScalablePicture.java#L308-L343
test
Called by the ScalablePicture interface to handle the status change of the ARA file.
Of course, here is the Java code you requested: ```java public void sourceStatusChange(int statusCode, String statusMessage, SourcePicture sp) { //Tools.log("ScalablePicture.sourceStatusChange: status received from SourceImage: " + statusMessage); switch (statusCode) { case SourcePicture.UNINITIALIS...
GojaFramework/goja
goja-core/src/main/java/goja/core/libs/Codec.java
Codec.hexStringToByte
public static byte[] hexStringToByte(String hexString) { try { return Hex.decodeHex(hexString.toCharArray()); } catch (DecoderException e) { throw new UnexpectedException(e); } }
java
public static byte[] hexStringToByte(String hexString) { try { return Hex.decodeHex(hexString.toCharArray()); } catch (DecoderException e) { throw new UnexpectedException(e); } }
[ "public", "static", "byte", "[", "]", "hexStringToByte", "(", "String", "hexString", ")", "{", "try", "{", "return", "Hex", ".", "decodeHex", "(", "hexString", ".", "toCharArray", "(", ")", ")", ";", "}", "catch", "(", "DecoderException", "e", ")", "{", ...
Transform an hexadecimal String to a byte array.
[ "Transform", "an", "hexadecimal", "String", "to", "a", "byte", "array", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/libs/Codec.java#L120-L126
test
Hex string to byte array.
Of course, here is the Java code you requested: ```java public static byte[] hexStringToByte(String hexString) { try { return Hex.decodeHex(hexString.toCharArray()); } catch (DecoderException e) { throw new UnexpectedException(e); } } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/ucar/ma2/ArrayChar.java
ArrayChar.copyFrom1DJavaArray
protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { char[] ja = (char[]) javaArray; for (char aJa : ja) iter.setCharNext(aJa); }
java
protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { char[] ja = (char[]) javaArray; for (char aJa : ja) iter.setCharNext(aJa); }
[ "protected", "void", "copyFrom1DJavaArray", "(", "IndexIterator", "iter", ",", "Object", "javaArray", ")", "{", "char", "[", "]", "ja", "=", "(", "char", "[", "]", ")", "javaArray", ";", "for", "(", "char", "aJa", ":", "ja", ")", "iter", ".", "setCharN...
copy from javaArray to storage using the iterator: used by factory( Object);
[ "copy", "from", "javaArray", "to", "storage", "using", "the", "iterator", ":", "used", "by", "factory", "(", "Object", ")", ";" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/ma2/ArrayChar.java#L108-L111
test
Copy the contents of a 1D Java array to the index iterator.
Of course, here is the Java code you requested: ```java protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray) { char[] ja = (char[]) javaArray; for (char aJa : ja) iter.setCharNext(aJa); } ``` Hope this helps!
oblac/jodd
jodd-bean/src/main/java/jodd/introspector/PropertyDescriptor.java
PropertyDescriptor.resolveComponentType
public Class resolveComponentType(final boolean declared) { Class componentType = null; Getter getter = getGetter(declared); if (getter != null) { componentType = getter.getGetterRawComponentType(); } if (componentType == null) { FieldDescriptor fieldDescriptor = getFieldDescriptor(); if (fieldDe...
java
public Class resolveComponentType(final boolean declared) { Class componentType = null; Getter getter = getGetter(declared); if (getter != null) { componentType = getter.getGetterRawComponentType(); } if (componentType == null) { FieldDescriptor fieldDescriptor = getFieldDescriptor(); if (fieldDe...
[ "public", "Class", "resolveComponentType", "(", "final", "boolean", "declared", ")", "{", "Class", "componentType", "=", "null", ";", "Getter", "getter", "=", "getGetter", "(", "declared", ")", ";", "if", "(", "getter", "!=", "null", ")", "{", "componentType...
Resolves component type for given property descriptor.
[ "Resolves", "component", "type", "for", "given", "property", "descriptor", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/introspector/PropertyDescriptor.java#L293-L311
test
Resolves the component type of this field.
Of course, here is the Java code you requested: ```java public Class resolveComponentType(final boolean declared) { Class componentType = null; Getter getter = getGetter(declared); if (getter != null) { componentType = getter.getGetterRawComponentType(); } if (componentType == null) { FieldDescripto...
apache/parquet-mr
parquet-column/src/main/java/org/apache/parquet/column/values/ValuesReader.java
ValuesReader.initFromPage
@Deprecated public void initFromPage(int valueCount, byte[] page, int offset) throws IOException { this.initFromPage(valueCount, ByteBuffer.wrap(page), offset); }
java
@Deprecated public void initFromPage(int valueCount, byte[] page, int offset) throws IOException { this.initFromPage(valueCount, ByteBuffer.wrap(page), offset); }
[ "@", "Deprecated", "public", "void", "initFromPage", "(", "int", "valueCount", ",", "byte", "[", "]", "page", ",", "int", "offset", ")", "throws", "IOException", "{", "this", ".", "initFromPage", "(", "valueCount", ",", "ByteBuffer", ".", "wrap", "(", "pag...
Same functionality as method of the same name that takes a ByteBuffer instead of a byte[]. This method is only provided for backward compatibility and will be removed in a future release. Please update any code using it as soon as possible. @see #initFromPage(int, ByteBuffer, int)
[ "Same", "functionality", "as", "method", "of", "the", "same", "name", "that", "takes", "a", "ByteBuffer", "instead", "of", "a", "byte", "[]", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/column/values/ValuesReader.java#L85-L88
test
Initializes the sequence from a byte array of bytes.
Of course, here is the Java code you requested: ```java @Deprecated public void initFromPage(int valueCount, byte[] page, int offset) throws IOException { this.initFromPage(valueCount, ByteBuffer.wrap(page), offset); } ``` Hope this helps!
RestComm/jain-slee
container/router/src/main/java/org/mobicents/slee/container/management/jmx/EventRouterConfiguration.java
EventRouterConfiguration.setExecutorMapperClassName
public void setExecutorMapperClassName(String className) throws ClassNotFoundException { Class.forName(className); if (this.executorMapperClassName != null) { logger .warn("Setting executorMapperClassName property to " + className + ". If called with server running a stop and start is need to app...
java
public void setExecutorMapperClassName(String className) throws ClassNotFoundException { Class.forName(className); if (this.executorMapperClassName != null) { logger .warn("Setting executorMapperClassName property to " + className + ". If called with server running a stop and start is need to app...
[ "public", "void", "setExecutorMapperClassName", "(", "String", "className", ")", "throws", "ClassNotFoundException", "{", "Class", ".", "forName", "(", "className", ")", ";", "if", "(", "this", ".", "executorMapperClassName", "!=", "null", ")", "{", "logger", "....
/* (non-Javadoc) @see org.mobicents.slee.container.management.jmx.EventRouterConfigurationMBean#setExecutorMapperClassName(java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/router/src/main/java/org/mobicents/slee/container/management/jmx/EventRouterConfiguration.java#L103-L114
test
Sets the class name of the executor mapper class.
Of course, here is the Java code you requested: ```java public void setExecutorMapperClassName(String className) throws ClassNotFoundException { Class.forName(className); if (this.executorMapperClassName != null) { logger .warn("Setting executorMapperClassName property to " + className + ". If c...
Unidata/thredds
cdm/src/main/java/ucar/nc2/iosp/hdf4/H4iosp.java
H4iosp.readStructureData
private ucar.ma2.ArrayStructure readStructureData(ucar.nc2.Structure s, Section section) throws java.io.IOException, InvalidRangeException { H4header.Vinfo vinfo = (H4header.Vinfo) s.getSPobject(); vinfo.setLayoutInfo(); // make sure needed info is present int recsize = vinfo.elemSize; // create...
java
private ucar.ma2.ArrayStructure readStructureData(ucar.nc2.Structure s, Section section) throws java.io.IOException, InvalidRangeException { H4header.Vinfo vinfo = (H4header.Vinfo) s.getSPobject(); vinfo.setLayoutInfo(); // make sure needed info is present int recsize = vinfo.elemSize; // create...
[ "private", "ucar", ".", "ma2", ".", "ArrayStructure", "readStructureData", "(", "ucar", ".", "nc2", ".", "Structure", "s", ",", "Section", "section", ")", "throws", "java", ".", "io", ".", "IOException", ",", "InvalidRangeException", "{", "H4header", ".", "V...
Structures must be fixed sized @param s the record structure @param section the record range to read @return an ArrayStructure, with all the data read in. @throws IOException on error @throws ucar.ma2.InvalidRangeException if invalid section
[ "Structures", "must", "be", "fixed", "sized" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/hdf4/H4iosp.java#L128-L185
test
Reads the array structure data from the NetCDF4 structure.
Of course, here is the Java code you requested: ```java private ucar.ma2.ArrayStructure readStructureData(ucar.nc2.Structure s, Section section) throws java.io.IOException, InvalidRangeException { H4header.Vinfo vinfo = (H4header.Vinfo) s.getSPobject(); vinfo.setLayoutInfo(); // make sure needed info is pr...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/servlet/JspServletWrapper.java
JspServletWrapper.loadTagFilePrototype
public Class loadTagFilePrototype() throws JasperException { ctxt.setPrototypeMode(true); try { return loadTagFile(); } finally { ctxt.setPrototypeMode(false); } }
java
public Class loadTagFilePrototype() throws JasperException { ctxt.setPrototypeMode(true); try { return loadTagFile(); } finally { ctxt.setPrototypeMode(false); } }
[ "public", "Class", "loadTagFilePrototype", "(", ")", "throws", "JasperException", "{", "ctxt", ".", "setPrototypeMode", "(", "true", ")", ";", "try", "{", "return", "loadTagFile", "(", ")", ";", "}", "finally", "{", "ctxt", ".", "setPrototypeMode", "(", "fal...
Compile and load a prototype for the Tag file. This is needed when compiling tag files with circular dependencies. A prototpe (skeleton) with no dependencies on other other tag files is generated and compiled.
[ "Compile", "and", "load", "a", "prototype", "for", "the", "Tag", "file", ".", "This", "is", "needed", "when", "compiling", "tag", "files", "with", "circular", "dependencies", ".", "A", "prototpe", "(", "skeleton", ")", "with", "no", "dependencies", "on", "...
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/servlet/JspServletWrapper.java#L298-L306
test
Load the tag file prototype.
Of course, here is the Java code you requested: ```java public Class loadTagFilePrototype() throws JasperException { ctxt.setPrototypeMode(true); try { return loadTagFile(); } finally { ctxt.setPrototypeMode(false); } } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/BodyContentImpl.java
BodyContentImpl.write
public void write(int c) throws IOException { if (writer != null) { writer.write(c); } else { ensureOpen(); if (nextChar >= bufferSize) { reAllocBuff (1); } cb[nextChar++] = (char) c; } }
java
public void write(int c) throws IOException { if (writer != null) { writer.write(c); } else { ensureOpen(); if (nextChar >= bufferSize) { reAllocBuff (1); } cb[nextChar++] = (char) c; } }
[ "public", "void", "write", "(", "int", "c", ")", "throws", "IOException", "{", "if", "(", "writer", "!=", "null", ")", "{", "writer", ".", "write", "(", "c", ")", ";", "}", "else", "{", "ensureOpen", "(", ")", ";", "if", "(", "nextChar", ">=", "b...
Write a single character.
[ "Write", "a", "single", "character", "." ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/runtime/BodyContentImpl.java#L111-L121
test
Writes a single character to the output stream.
Of course, here is the Java code you requested: ```java public void write(int c) throws IOException { if (writer != null) { writer.write(c); } else { ensureOpen(); if (nextChar >= bufferSize) { reAllocBuff (1); } cb[nextChar++] = (char) c; } } ``` Hope this helps!
dschulten/hydra-java
spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java
Affordance.setAnchor
public void setAnchor(String anchor) { if (anchor != null) linkParams.set(ANCHOR.paramName, anchor); else linkParams.remove(ANCHOR.paramName); }
java
public void setAnchor(String anchor) { if (anchor != null) linkParams.set(ANCHOR.paramName, anchor); else linkParams.remove(ANCHOR.paramName); }
[ "public", "void", "setAnchor", "(", "String", "anchor", ")", "{", "if", "(", "anchor", "!=", "null", ")", "linkParams", ".", "set", "(", "ANCHOR", ".", "paramName", ",", "anchor", ")", ";", "else", "linkParams", ".", "remove", "(", "ANCHOR", ".", "para...
By default, the context of a link conveyed in the Link header field is the IRI of the requested resource. <p>When present, the anchor parameter overrides this with another URI, such as a fragment of this resource, or a third resource (i.e., when the anchor value is an absolute URI). If the anchor parameter's value is ...
[ "By", "default", "the", "context", "of", "a", "link", "conveyed", "in", "the", "Link", "header", "field", "is", "the", "IRI", "of", "the", "requested", "resource", ".", "<p", ">", "When", "present", "the", "anchor", "parameter", "overrides", "this", "with"...
21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a
https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/spring-hateoas-ext/src/main/java/de/escalon/hypermedia/affordance/Affordance.java#L336-L341
test
Set the anchor parameter of the generated code.
Of course, here is the Java code you requested: ```java public void setAnchor(String anchor) { if (anchor != null) linkParams.set(ANCHOR.paramName, anchor); else linkParams.remove(ANCHOR.paramName); } ``` Hope this helps!
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/destination/DebugDestinationPropertyView.java
DebugDestinationPropertyView.propertiesToControls
public void propertiesToControls() { super.propertiesToControls(); String strPathname = m_properties.getProperty(LOG_FILENAME_PARAM); m_tfLogFilename.setText(strPathname); boolean bSelected = true; String strSelected = m_properties.getProperty(CALC_FILE_LENGTH_PARAM); if (FALSE.equalsIgnoreCase(strSelected...
java
public void propertiesToControls() { super.propertiesToControls(); String strPathname = m_properties.getProperty(LOG_FILENAME_PARAM); m_tfLogFilename.setText(strPathname); boolean bSelected = true; String strSelected = m_properties.getProperty(CALC_FILE_LENGTH_PARAM); if (FALSE.equalsIgnoreCase(strSelected...
[ "public", "void", "propertiesToControls", "(", ")", "{", "super", ".", "propertiesToControls", "(", ")", ";", "String", "strPathname", "=", "m_properties", ".", "getProperty", "(", "LOG_FILENAME_PARAM", ")", ";", "m_tfLogFilename", ".", "setText", "(", "strPathnam...
/* Set the properties to the current control values.
[ "/", "*", "Set", "the", "properties", "to", "the", "current", "control", "values", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/destination/DebugDestinationPropertyView.java#L94-L104
test
Set the controls to the control.
Of course, here is the Java code you requested: ```java public void propertiesToControls() { super.propertiesToControls(); String strPathname = m_properties.getProperty(LOG_FILENAME_PARAM); m_tfLogFilename.setText(strPathname); boolean bSelected = true; String strSelected = m_properties.getProperty(CALC_FIL...
streamsets/datacollector
salesforce-lib/src/main/java/com/streamsets/pipeline/stage/origin/salesforce/ForceSource.java
ForceSource.destroy
@Override public void destroy() { // SDC-6258 - destroy() is called from a different thread, so we // need to signal produce() to terminate early destroyed.set(true); if (job != null) { try { try { bulkConnection.abortJob(job.getId()); } catch (AsyncApiException e) { ...
java
@Override public void destroy() { // SDC-6258 - destroy() is called from a different thread, so we // need to signal produce() to terminate early destroyed.set(true); if (job != null) { try { try { bulkConnection.abortJob(job.getId()); } catch (AsyncApiException e) { ...
[ "@", "Override", "public", "void", "destroy", "(", ")", "{", "// SDC-6258 - destroy() is called from a different thread, so we", "// need to signal produce() to terminate early", "destroyed", ".", "set", "(", "true", ")", ";", "if", "(", "job", "!=", "null", ")", "{", ...
{@inheritDoc}
[ "{" ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/salesforce-lib/src/main/java/com/streamsets/pipeline/stage/origin/salesforce/ForceSource.java#L394-L437
test
Destroy the HBase resources.
Of course, here is the Java code you requested: ```java @Override public void destroy() { // SDC-6258 - destroy() is called from a different thread, so we // need to signal produce() to terminate early destroyed.set(true); if (job != null) { try { try { bulkConnection.abortJo...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java
GemFireJmxClient.listHosts
public static Collection<String> listHosts(JMX jmx) { Set<ObjectName> objectNames = jmx.searchObjectNames("GemFire:type=Member,member=*"); if(objectNames == null || objectNames.isEmpty()) { return null; } HashSet<String> hostLists = new HashSet<String>(objectNames.size()); MemberMXBean memberM...
java
public static Collection<String> listHosts(JMX jmx) { Set<ObjectName> objectNames = jmx.searchObjectNames("GemFire:type=Member,member=*"); if(objectNames == null || objectNames.isEmpty()) { return null; } HashSet<String> hostLists = new HashSet<String>(objectNames.size()); MemberMXBean memberM...
[ "public", "static", "Collection", "<", "String", ">", "listHosts", "(", "JMX", "jmx", ")", "{", "Set", "<", "ObjectName", ">", "objectNames", "=", "jmx", ".", "searchObjectNames", "(", "\"GemFire:type=Member,member=*\"", ")", ";", "if", "(", "objectNames", "==...
Determines the unique set of the host names for the distributed system @param jmx the JMX connection @return string of server host names
[ "Determines", "the", "unique", "set", "of", "the", "host", "names", "for", "the", "distributed", "system" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java#L713-L734
test
List the hosts of the managed objects.
Of course, here is the Java code you requested: ```java public static Collection<String> listHosts(JMX jmx) { Set<ObjectName> objectNames = jmx.searchObjectNames("GemFire:type=Member,member=*"); if(objectNames == null || objectNames.isEmpty()) { return null; } HashSet<String> hostLists = new HashS...
1gravity/Android-RTEditor
RTEditor/src/main/java/com/onegravity/rteditor/media/crop/HighlightView.java
HighlightView.computeLayout
private Rect computeLayout() { RectF r = new RectF(mCropRect.left, mCropRect.top, mCropRect.right, mCropRect.bottom); mMatrix.mapRect(r); return new Rect(Math.round(r.left), Math.round(r.top), Math.round(r.right), Math.round(r.bottom)); }
java
private Rect computeLayout() { RectF r = new RectF(mCropRect.left, mCropRect.top, mCropRect.right, mCropRect.bottom); mMatrix.mapRect(r); return new Rect(Math.round(r.left), Math.round(r.top), Math.round(r.right), Math.round(r.bottom)); }
[ "private", "Rect", "computeLayout", "(", ")", "{", "RectF", "r", "=", "new", "RectF", "(", "mCropRect", ".", "left", ",", "mCropRect", ".", "top", ",", "mCropRect", ".", "right", ",", "mCropRect", ".", "bottom", ")", ";", "mMatrix", ".", "mapRect", "("...
Maps the cropping rectangle from image space to screen space.
[ "Maps", "the", "cropping", "rectangle", "from", "image", "space", "to", "screen", "space", "." ]
9d8fb4bb865b3b3d011e7633afedcdfb8d21754f
https://github.com/1gravity/Android-RTEditor/blob/9d8fb4bb865b3b3d011e7633afedcdfb8d21754f/RTEditor/src/main/java/com/onegravity/rteditor/media/crop/HighlightView.java#L381-L385
test
Compute the layout of the image.
Of course, here is the Java code you requested: ```java private Rect computeLayout() { RectF r = new RectF(mCropRect.left, mCropRect.top, mCropRect.right, mCropRect.bottom); mMatrix.mapRect(r); return new Rect(Math.round(r.left), Math.round(r.top), Math.round(r.right), Math.round(r.bottom)); ...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/gis/shapefile/Swap.java
Swap.swapFloat
static public float swapFloat(byte[] b, int offset) { int accum = 0; for (int shiftBy = 0, i = offset; shiftBy < 32; shiftBy += 8, i++) accum |= (b[i] & 0xff) << shiftBy; return Float.intBitsToFloat(accum); }
java
static public float swapFloat(byte[] b, int offset) { int accum = 0; for (int shiftBy = 0, i = offset; shiftBy < 32; shiftBy += 8, i++) accum |= (b[i] & 0xff) << shiftBy; return Float.intBitsToFloat(accum); }
[ "static", "public", "float", "swapFloat", "(", "byte", "[", "]", "b", ",", "int", "offset", ")", "{", "int", "accum", "=", "0", ";", "for", "(", "int", "shiftBy", "=", "0", ",", "i", "=", "offset", ";", "shiftBy", "<", "32", ";", "shiftBy", "+=",...
Returns the float resulting from reversing 4 bytes at a specified offset in a byte array. @param b the byte array @param offset the offset of the first byte @return the float represented by the bytes <code>b[offset+3], b[offset+2], ..., b[offset]</code>
[ "Returns", "the", "float", "resulting", "from", "reversing", "4", "bytes", "at", "a", "specified", "offset", "in", "a", "byte", "array", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/gis/shapefile/Swap.java#L79-L84
test
Swaps the bits of a float array at a given offset.
Of course, here is the Java code you requested: ```java static public float swapFloat(byte[] b, int offset) { int accum = 0; for (int shiftBy = 0, i = offset; shiftBy < 32; shiftBy += 8, i++) accum |= (b[i] & 0xff) << shiftBy; return Float.intBitsToFloat(accum); } ``` Hope this helps!
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/record/impl/OVertexDelegate.java
OVertexDelegate.createLink
public static Object createLink(final ODocument iFromVertex, final OIdentifiable iTo, final String iFieldName) { final Object out; OType outType = iFromVertex.fieldType(iFieldName); Object found = iFromVertex.field(iFieldName); final OClass linkClass = ODocumentInternal.getImmutableSchemaClass(iFromVer...
java
public static Object createLink(final ODocument iFromVertex, final OIdentifiable iTo, final String iFieldName) { final Object out; OType outType = iFromVertex.fieldType(iFieldName); Object found = iFromVertex.field(iFieldName); final OClass linkClass = ODocumentInternal.getImmutableSchemaClass(iFromVer...
[ "public", "static", "Object", "createLink", "(", "final", "ODocument", "iFromVertex", ",", "final", "OIdentifiable", "iTo", ",", "final", "String", "iFieldName", ")", "{", "final", "Object", "out", ";", "OType", "outType", "=", "iFromVertex", ".", "fieldType", ...
(Internal only) Creates a link between a vertices and a Graph Element.
[ "(", "Internal", "only", ")", "Creates", "a", "link", "between", "a", "vertices", "and", "a", "Graph", "Element", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/record/impl/OVertexDelegate.java#L470-L536
test
Create a link from the source vertex.
Of course, here is the Java code you requested: ```java public static Object createLink(final ODocument iFromVertex, final OIdentifiable iTo, final String iFieldName) { final Object out; OType outType = iFromVertex.fieldType(iFieldName); Object found = iFromVertex.field(iFieldName); final OClass linkC...
rupertlssmith/lojix
lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/BasicTraverser.java
BasicTraverser.traverse
public Iterator<Operator<Term>> traverse(Predicate predicate, boolean reverse) { /*log.fine("Traversing predicate " + predicate.toString());*/ Clause[] body = predicate.getBody(); Queue<Operator<Term>> queue = (!reverse) ? new StackQueue<Operator<Term>>() : new LinkedList<Operator<Term>>()...
java
public Iterator<Operator<Term>> traverse(Predicate predicate, boolean reverse) { /*log.fine("Traversing predicate " + predicate.toString());*/ Clause[] body = predicate.getBody(); Queue<Operator<Term>> queue = (!reverse) ? new StackQueue<Operator<Term>>() : new LinkedList<Operator<Term>>()...
[ "public", "Iterator", "<", "Operator", "<", "Term", ">", ">", "traverse", "(", "Predicate", "predicate", ",", "boolean", "reverse", ")", "{", "/*log.fine(\"Traversing predicate \" + predicate.toString());*/", "Clause", "[", "]", "body", "=", "predicate", ".", "getBo...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/compiler/BasicTraverser.java#L113-L137
test
Traverses the predicate.
Of course, here is the Java code you requested: ```java public Iterator<Operator<Term>> traverse(Predicate predicate, boolean reverse) { /*log.fine("Traversing predicate " + predicate.toString());*/ Clause[] body = predicate.getBody(); Queue<Operator<Term>> queue = (!reverse) ? new StackQ...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/CollaborationClient.java
CollaborationClient.getAllToByLoggedIn
public List<Collaboration> getAllToByLoggedIn() { CollaborationListing collaborationListing = new CollaborationListing(); if(this.serviceTicket != null) { collaborationListing.setServiceTicket(this.serviceTicket); } return new CollaborationListing(this.postJson( ...
java
public List<Collaboration> getAllToByLoggedIn() { CollaborationListing collaborationListing = new CollaborationListing(); if(this.serviceTicket != null) { collaborationListing.setServiceTicket(this.serviceTicket); } return new CollaborationListing(this.postJson( ...
[ "public", "List", "<", "Collaboration", ">", "getAllToByLoggedIn", "(", ")", "{", "CollaborationListing", "collaborationListing", "=", "new", "CollaborationListing", "(", ")", ";", "if", "(", "this", ".", "serviceTicket", "!=", "null", ")", "{", "collaborationList...
Retrieve all Collaboration items TO where logged in user. @return Created Collaboration's. @see Collaboration
[ "Retrieve", "all", "Collaboration", "items", "TO", "where", "logged", "in", "user", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/CollaborationClient.java#L83-L91
test
Get all collaboration list to by logged in user.
Of course, here is the Java code you requested: ```java public List<Collaboration> getAllToByLoggedIn() { CollaborationListing collaborationListing = new CollaborationListing(); if(this.serviceTicket != null) { collaborationListing.setServiceTicket(this.serviceTicket); } re...
PeterisP/morphology
src/main/java/lv/semti/morphology/analyzer/Wordform.java
Wordform.longDescription
public void longDescription(PrintStream out) { out.println(this.token + ":"); for (String s : this.attributes.keySet()) { out.println(s + "\t" + attributes.get(s)); } }
java
public void longDescription(PrintStream out) { out.println(this.token + ":"); for (String s : this.attributes.keySet()) { out.println(s + "\t" + attributes.get(s)); } }
[ "public", "void", "longDescription", "(", "PrintStream", "out", ")", "{", "out", ".", "println", "(", "this", ".", "token", "+", "\":\"", ")", ";", "for", "(", "String", "s", ":", "this", ".", "attributes", ".", "keySet", "(", ")", ")", "{", "out", ...
For debugging purposes only.
[ "For", "debugging", "purposes", "only", "." ]
a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783
https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/Wordform.java#L121-L128
test
Print out the long description of this object.
Of course, here is the Java code you requested: ```java public void longDescription(PrintStream out) { out.println(this.token + ":"); for (String s : this.attributes.keySet()) { out.println(s + "\t" + attributes.get(s)); } } ``` Hope this helps!
kocakosm/pitaya
src/org/kocakosm/pitaya/collection/ImmutableBag.java
ImmutableBag.of
public static <E> Bag<E> of(E... values) { return new ImmutableBag<E>(new ArrayBag<E>(values)); }
java
public static <E> Bag<E> of(E... values) { return new ImmutableBag<E>(new ArrayBag<E>(values)); }
[ "public", "static", "<", "E", ">", "Bag", "<", "E", ">", "of", "(", "E", "...", "values", ")", "{", "return", "new", "ImmutableBag", "<", "E", ">", "(", "new", "ArrayBag", "<", "E", ">", "(", "values", ")", ")", ";", "}" ]
Creates a new {@code ImmutableBag} containing the given elements. @param <E> the type of the {@code Bag}'s elements. @param values the {@code Bag}'s elements. @return the created {@code ImmutableBag}. @throws NullPointerException if {@code values} is {@code null}.
[ "Creates", "a", "new", "{", "@code", "ImmutableBag", "}", "containing", "the", "given", "elements", "." ]
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/collection/ImmutableBag.java#L176-L179
test
Returns an immutable bag containing the specified elements.
Of course, here is the Java code you requested: ```java public static <E> Bag<E> of(E... values) { return new ImmutableBag<E>(new ArrayBag<E>(values)); } ``` Hope this helps!
boonproject/boon
boon/src/main/java/org/boon/primitive/Flt.java
Flt.reduceBy
public static double reduceBy( final float[] array, ReduceBy reduceBy ) { double sum = 0; for ( float v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }
java
public static double reduceBy( final float[] array, ReduceBy reduceBy ) { double sum = 0; for ( float v : array ) { sum = reduceBy.reduce(sum, v); } return sum; }
[ "public", "static", "double", "reduceBy", "(", "final", "float", "[", "]", "array", ",", "ReduceBy", "reduceBy", ")", "{", "double", "sum", "=", "0", ";", "for", "(", "float", "v", ":", "array", ")", "{", "sum", "=", "reduceBy", ".", "reduce", "(", ...
A very fast reduce by. If performance is your thing, this seems to be as fast a plain for loop when benchmarking with JMH. @param array array of items to reduce by @param reduceBy reduceBy interface @return the final value
[ "A", "very", "fast", "reduce", "by", ".", "If", "performance", "is", "your", "thing", "this", "seems", "to", "be", "as", "fast", "a", "plain", "for", "loop", "when", "benchmarking", "with", "JMH", "." ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/primitive/Flt.java#L482-L490
test
Reduce by.
Of course, here is the Java code you requested: ```java public static double reduceBy( final float[] array, ReduceBy reduceBy ) { double sum = 0; for ( float v : array ) { sum = reduceBy.reduce(sum, v); } return sum; } ``` Hope this helps!
blademainer/common_utils
commons-file/src/main/java/info/monitorenter/util/FileUtil.java
FileUtil.getDefaultFileName
public static String getDefaultFileName(final String name) { String result; File f = new File(name); if (!f.exists()) { result = f.getAbsolutePath(); } else { final Map.Entry<String, String> cut = FileUtil.cutExtension(name); final String prefix = cut.getKey(); final String suffi...
java
public static String getDefaultFileName(final String name) { String result; File f = new File(name); if (!f.exists()) { result = f.getAbsolutePath(); } else { final Map.Entry<String, String> cut = FileUtil.cutExtension(name); final String prefix = cut.getKey(); final String suffi...
[ "public", "static", "String", "getDefaultFileName", "(", "final", "String", "name", ")", "{", "String", "result", ";", "File", "f", "=", "new", "File", "(", "name", ")", ";", "if", "(", "!", "f", ".", "exists", "(", ")", ")", "{", "result", "=", "f...
Finds a filename based on the given name. If a file with the given name does not exist, <tt>name</tt> will be returned. <p> Else: <pre> &quot;myFile.out&quot; --&gt; &quot;myFile_0.out&quot; &quot;myFile_0.out&quot; --&gt; &quot;myFile_1.out&quot; &quot;myFile_1.out&quot; --&gt; &quot;myFile_2.out&quot; .... ...
[ "Finds", "a", "filename", "based", "on", "the", "given", "name", ".", "If", "a", "file", "with", "the", "given", "name", "does", "not", "exist", "<tt", ">", "name<", "/", "tt", ">", "will", "be", "returned", ".", "<p", ">" ]
ef6baf0367c16de95a28caab67a7d5842a6d13db
https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/commons-file/src/main/java/info/monitorenter/util/FileUtil.java#L261-L278
test
Get the default file name for a file.
Of course, here is the Java code you requested: ```java public static String getDefaultFileName(final String name) { String result; File f = new File(name); if (!f.exists()) { result = f.getAbsolutePath(); } else { final Map.Entry<String, String> cut = FileUtil.cutExtension(name); fin...
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java
RollupService.setServerTime
public synchronized void setServerTime(long millis) { log.info("Manually setting server time to {} {}", millis, new java.util.Date(millis)); context.setCurrentTimeMillis(millis); }
java
public synchronized void setServerTime(long millis) { log.info("Manually setting server time to {} {}", millis, new java.util.Date(millis)); context.setCurrentTimeMillis(millis); }
[ "public", "synchronized", "void", "setServerTime", "(", "long", "millis", ")", "{", "log", ".", "info", "(", "\"Manually setting server time to {} {}\"", ",", "millis", ",", "new", "java", ".", "util", ".", "Date", "(", "millis", ")", ")", ";", "context", "...
set the server time in millis.
[ "set", "the", "server", "time", "in", "millis", "." ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/RollupService.java#L314-L317
test
Sets the server time.
Of course, here is the Java code you requested: ```java public synchronized void setServerTime(long millis) { log.info("Manually setting server time to {} {}", millis, new java.util.Date(millis)); context.setCurrentTimeMillis(millis); } ``` Hope this helps!
real-logic/aeron
aeron-samples/src/main/java/io/aeron/samples/BacklogStat.java
BacklogStat.print
public void print(final PrintStream out) { final StringBuilder builder = new StringBuilder(); for (final Map.Entry<StreamCompositeKey, StreamBacklog> entry : snapshot().entrySet()) { builder.setLength(0); final StreamCompositeKey key = entry.getKey(); bu...
java
public void print(final PrintStream out) { final StringBuilder builder = new StringBuilder(); for (final Map.Entry<StreamCompositeKey, StreamBacklog> entry : snapshot().entrySet()) { builder.setLength(0); final StreamCompositeKey key = entry.getKey(); bu...
[ "public", "void", "print", "(", "final", "PrintStream", "out", ")", "{", "final", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "final", "Map", ".", "Entry", "<", "StreamCompositeKey", ",", "StreamBacklog", ">", "entry",...
Print a snapshot of the stream backlog with some explanation to a {@link PrintStream}. <p> Each stream will be printed in its own section. @param out to which the stream backlog will be written.
[ "Print", "a", "snapshot", "of", "the", "stream", "backlog", "with", "some", "explanation", "to", "a", "{", "@link", "PrintStream", "}", ".", "<p", ">", "Each", "stream", "will", "be", "printed", "in", "its", "own", "section", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-samples/src/main/java/io/aeron/samples/BacklogStat.java#L141-L220
test
Print the contents of the composite key backlog to the specified PrintStream.
Of course, here is the Java code you requested: ```java public void print(final PrintStream out) { final StringBuilder builder = new StringBuilder(); for (final Map.Entry<StreamCompositeKey, StreamBacklog> entry : snapshot().entrySet()) { builder.setLength(0); final...
agentsoz/jill
jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java
ProgramLoader.getPlansFromGoalsInfoAnnotation
private static String[] getPlansFromGoalsInfoAnnotation(Class<?> gclass) { // Find the plans that this goal has Annotation annotation = gclass.getAnnotation(GoalInfo.class); if (annotation == null) { logger.error("Goal " + gclass.getName() + " is missing the " + "@GoalInfo(hasPlans={\"packag...
java
private static String[] getPlansFromGoalsInfoAnnotation(Class<?> gclass) { // Find the plans that this goal has Annotation annotation = gclass.getAnnotation(GoalInfo.class); if (annotation == null) { logger.error("Goal " + gclass.getName() + " is missing the " + "@GoalInfo(hasPlans={\"packag...
[ "private", "static", "String", "[", "]", "getPlansFromGoalsInfoAnnotation", "(", "Class", "<", "?", ">", "gclass", ")", "{", "// Find the plans that this goal has", "Annotation", "annotation", "=", "gclass", ".", "getAnnotation", "(", "GoalInfo", ".", "class", ")", ...
Gets the list of plans specified in the @GoalInfo annotation of the given goal class. @param gclass the goal class containing the @GoalInfo annotation @return list of plans specified in the @GoalInfo annotation, or an empty array if unsuccessful
[ "Gets", "the", "list", "of", "plans", "specified", "in", "the", "@GoalInfo", "annotation", "of", "the", "given", "goal", "class", "." ]
13126fc78350465b477386132465f84cad719426
https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/ProgramLoader.java#L255-L273
test
Get the plans from the GoalsInfo annotation.
Of course, here is the Java code you requested: ```java private static String[] getPlansFromGoalsInfoAnnotation(Class<?> gclass) { // Find the plans that this goal has Annotation annotation = gclass.getAnnotation(GoalInfo.class); if (annotation == null) { logger.error("Goal " + gclass.getName() + " i...
medcl/elasticsearch-analysis-ik
src/main/java/org/wltea/analyzer/core/CharacterUtil.java
CharacterUtil.identifyCharType
static int identifyCharType(char input){ if(input >= '0' && input <= '9'){ return CHAR_ARABIC; }else if((input >= 'a' && input <= 'z') || (input >= 'A' && input <= 'Z')){ return CHAR_ENGLISH; }else { Character.UnicodeBlock ub = Character.UnicodeBlock.of(input); if(ub == Char...
java
static int identifyCharType(char input){ if(input >= '0' && input <= '9'){ return CHAR_ARABIC; }else if((input >= 'a' && input <= 'z') || (input >= 'A' && input <= 'Z')){ return CHAR_ENGLISH; }else { Character.UnicodeBlock ub = Character.UnicodeBlock.of(input); if(ub == Char...
[ "static", "int", "identifyCharType", "(", "char", "input", ")", "{", "if", "(", "input", ">=", "'", "'", "&&", "input", "<=", "'", "'", ")", "{", "return", "CHAR_ARABIC", ";", "}", "else", "if", "(", "(", "input", ">=", "'", "'", "&&", "input", "...
识别字符类型 @param input @return int CharacterUtil定义的字符类型常量
[ "识别字符类型" ]
a1d6ba8ca206d750e68bbf3e53a25284100174bd
https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/core/CharacterUtil.java#L50-L82
test
Identify the type of a character.
Of course, here is the Java code you requested: ```java static int identifyCharType(char input){ if(input >= '0' && input <= '9'){ return CHAR_ARABIC; }else if((input >= 'a' && input <= 'z') || (input >= 'A' && input <= 'Z')){ return CHAR_ENGLISH; }else { Character.UnicodeBlock ub =...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java
OptimizeInstructions.isNonArg
private boolean isNonArg(WAMInstruction instruction) { SymbolKey symbolKey = instruction.getSymbolKeyReg1(); if (symbolKey != null) { Boolean nonArgPositionOnly = (Boolean) symbolTable.get(symbolKey, SymbolTableKeys.SYMKEY_FUNCTOR_NON_ARG); if (TRUE.equals(nonArgPos...
java
private boolean isNonArg(WAMInstruction instruction) { SymbolKey symbolKey = instruction.getSymbolKeyReg1(); if (symbolKey != null) { Boolean nonArgPositionOnly = (Boolean) symbolTable.get(symbolKey, SymbolTableKeys.SYMKEY_FUNCTOR_NON_ARG); if (TRUE.equals(nonArgPos...
[ "private", "boolean", "isNonArg", "(", "WAMInstruction", "instruction", ")", "{", "SymbolKey", "symbolKey", "=", "instruction", ".", "getSymbolKeyReg1", "(", ")", ";", "if", "(", "symbolKey", "!=", "null", ")", "{", "Boolean", "nonArgPositionOnly", "=", "(", "...
Checks if the term argument to an instruction was in a non-argument position. @param instruction The instruction to test. @return <tt>true</tt> iff the term argument to an instruction was in a non-argument position. <tt>false</tt> will be returned if this information was not recorded, and cannot be determined.
[ "Checks", "if", "the", "term", "argument", "to", "an", "instruction", "was", "in", "a", "non", "-", "argument", "position", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/optimizer/OptimizeInstructions.java#L318-L333
test
isNonArg returns true if the instruction is a non - argument instruction.
Of course, here is the Java code you requested: ```java private boolean isNonArg(WAMInstruction instruction) { SymbolKey symbolKey = instruction.getSymbolKeyReg1(); if (symbolKey != null) { Boolean nonArgPositionOnly = (Boolean) symbolTable.get(symbolKey, SymbolTableKeys.SYMKEY...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/service/ValidationHandler.java
ValidationHandler.validateRow
private boolean validateRow(final int irow, final SheetConfiguration sheetConfig, boolean updateGui) { boolean pass = true; if (sheetConfig == null) { return pass; } int top = sheetConfig.getBodyCellRange().getTopRow(); List<FacesCell> cellRow = parent.getBodyRows().get(irow - top).getCells(); for...
java
private boolean validateRow(final int irow, final SheetConfiguration sheetConfig, boolean updateGui) { boolean pass = true; if (sheetConfig == null) { return pass; } int top = sheetConfig.getBodyCellRange().getTopRow(); List<FacesCell> cellRow = parent.getBodyRows().get(irow - top).getCells(); for...
[ "private", "boolean", "validateRow", "(", "final", "int", "irow", ",", "final", "SheetConfiguration", "sheetConfig", ",", "boolean", "updateGui", ")", "{", "boolean", "pass", "=", "true", ";", "if", "(", "sheetConfig", "==", "null", ")", "{", "return", "pass...
Validate row. @param irow the irow @param sheetConfig the sheet config @param updateGui the update gui @return true, if successful
[ "Validate", "row", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/service/ValidationHandler.java#L366-L380
test
Validate the row.
Of course, here is the Java code you requested: ```java private boolean validateRow(final int irow, final SheetConfiguration sheetConfig, boolean updateGui) { boolean pass = true; if (sheetConfig == null) { return pass; } int top = sheetConfig.getBodyCellRange().getTopRow(); List<FacesCell> cellRow ...
jboss/jboss-common-core
src/main/java/org/jboss/util/graph/Graph.java
Graph.breadthFirstSearch
public <E extends Exception> void breadthFirstSearch(Vertex<T> v, VisitorEX<T, E> visitor) throws E { LinkedList<Vertex<T>> q = new LinkedList<Vertex<T>>(); q.add(v); if( visitor != null ) visitor.visit(this, v); v.visit(); while (q.isEmpty() == false) { v...
java
public <E extends Exception> void breadthFirstSearch(Vertex<T> v, VisitorEX<T, E> visitor) throws E { LinkedList<Vertex<T>> q = new LinkedList<Vertex<T>>(); q.add(v); if( visitor != null ) visitor.visit(this, v); v.visit(); while (q.isEmpty() == false) { v...
[ "public", "<", "E", "extends", "Exception", ">", "void", "breadthFirstSearch", "(", "Vertex", "<", "T", ">", "v", ",", "VisitorEX", "<", "T", ",", "E", ">", "visitor", ")", "throws", "E", "{", "LinkedList", "<", "Vertex", "<", "T", ">>", "q", "=", ...
Perform a breadth first search of this graph, starting at v. The vist may be cut short if visitor throws an exception during a vist callback. @param <E> exception type @param v - the search starting point @param visitor - the vistor whose vist method is called prior to visting a vertex. @throws E if vistor.visit throw...
[ "Perform", "a", "breadth", "first", "search", "of", "this", "graph", "starting", "at", "v", ".", "The", "vist", "may", "be", "cut", "short", "if", "visitor", "throws", "an", "exception", "during", "a", "vist", "callback", ".", "@param", "<E", ">", "excep...
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/graph/Graph.java#L338-L363
test
Breadth first search.
Of course, here is the Java code you requested: ```java public <E extends Exception> void breadthFirstSearch(Vertex<T> v, VisitorEX<T, E> visitor) throws E { LinkedList<Vertex<T>> q = new LinkedList<Vertex<T>>(); q.add(v); if( visitor != null ) visitor.visit(this, v); v.visit...
jcodec/jcodec
src/main/java/net/sourceforge/jaad/aac/sbr/SBR.java
SBR.invf_mode
private void invf_mode(IBitStream ld, int ch) throws AACException { int n; for(n = 0; n<this.N_Q; n++) { this.bs_invf_mode[ch][n] = ld.readBits(2); } }
java
private void invf_mode(IBitStream ld, int ch) throws AACException { int n; for(n = 0; n<this.N_Q; n++) { this.bs_invf_mode[ch][n] = ld.readBits(2); } }
[ "private", "void", "invf_mode", "(", "IBitStream", "ld", ",", "int", "ch", ")", "throws", "AACException", "{", "int", "n", ";", "for", "(", "n", "=", "0", ";", "n", "<", "this", ".", "N_Q", ";", "n", "++", ")", "{", "this", ".", "bs_invf_mode", "...
/* table 9
[ "/", "*", "table", "9" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/sbr/SBR.java#L929-L935
test
Read the inverse mode bits.
Of course, here is the Java code you requested: ```java private void invf_mode(IBitStream ld, int ch) throws AACException { int n; for(n = 0; n<this.N_Q; n++) { this.bs_invf_mode[ch][n] = ld.readBits(2); } } ``` Hope this helps!
FitLayout/api
src/main/java/org/fit/layout/impl/AreaGrid.java
AreaGrid.findCellY
public int findCellY(int y) { int ofs = 0; for (int i = 0; i < rows.length; i++) { ofs += rows[i]; if (y < ofs + abspos.getY1()) return i; } return -1; }
java
public int findCellY(int y) { int ofs = 0; for (int i = 0; i < rows.length; i++) { ofs += rows[i]; if (y < ofs + abspos.getY1()) return i; } return -1; }
[ "public", "int", "findCellY", "(", "int", "y", ")", "{", "int", "ofs", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "rows", ".", "length", ";", "i", "++", ")", "{", "ofs", "+=", "rows", "[", "i", "]", ";", "if", "(", "y...
Finds a grid cell that contains the specified point @param y the y coordinate of the specified point @return the Y offset of the grid cell that contains the specified absolute y coordinate or -1 when there is no such cell
[ "Finds", "a", "grid", "cell", "that", "contains", "the", "specified", "point" ]
fcfa67ce2a7485fbd722576413191fff5d68bae8
https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/impl/AreaGrid.java#L261-L271
test
Find cell Y.
Of course, here is the Java code you requested: ```java public int findCellY(int y) { int ofs = 0; for (int i = 0; i < rows.length; i++) { ofs += rows[i]; if (y < ofs + abspos.getY1()) return i; } return -1; } ``` Hope this helps!
objectify/objectify
src/main/java/com/googlecode/objectify/impl/QueryImpl.java
QueryImpl.first
@Override public LoadResult<T> first() { // By the way, this is the same thing that PreparedQuery.asSingleEntity() does internally final Iterator<T> it = this.limit(1).iterator(); return new LoadResult<>(null, new IteratorFirstResult<>(it)); }
java
@Override public LoadResult<T> first() { // By the way, this is the same thing that PreparedQuery.asSingleEntity() does internally final Iterator<T> it = this.limit(1).iterator(); return new LoadResult<>(null, new IteratorFirstResult<>(it)); }
[ "@", "Override", "public", "LoadResult", "<", "T", ">", "first", "(", ")", "{", "// By the way, this is the same thing that PreparedQuery.asSingleEntity() does internally\r", "final", "Iterator", "<", "T", ">", "it", "=", "this", ".", "limit", "(", "1", ")", ".", ...
/* (non-Javadoc) @see com.googlecode.objectify.cmd.Query#first()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/QueryImpl.java#L272-L278
test
Returns the first result of the query.
Of course, here is the Java code you requested: ```java @Override public LoadResult<T> first() { // By the way, this is the same thing that PreparedQuery.asSingleEntity() does internally final Iterator<T> it = this.limit(1).iterator(); return new LoadResult<>(null, new IteratorFirstResult<>(it)); } ``` ...
ReactiveX/RxJava
src/main/java/io/reactivex/internal/operators/flowable/FlowableCache.java
FlowableCache.add
void add(CacheSubscription<T> consumer) { for (;;) { CacheSubscription<T>[] current = subscribers.get(); if (current == TERMINATED) { return; } int n = current.length; @SuppressWarnings("unchecked") CacheSubscription<T>[] n...
java
void add(CacheSubscription<T> consumer) { for (;;) { CacheSubscription<T>[] current = subscribers.get(); if (current == TERMINATED) { return; } int n = current.length; @SuppressWarnings("unchecked") CacheSubscription<T>[] n...
[ "void", "add", "(", "CacheSubscription", "<", "T", ">", "consumer", ")", "{", "for", "(", ";", ";", ")", "{", "CacheSubscription", "<", "T", ">", "[", "]", "current", "=", "subscribers", ".", "get", "(", ")", ";", "if", "(", "current", "==", "TERMI...
Atomically adds the consumer to the {@link #subscribers} copy-on-write array if the source has not yet terminated. @param consumer the consumer to add
[ "Atomically", "adds", "the", "consumer", "to", "the", "{" ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/operators/flowable/FlowableCache.java#L150-L167
test
Add a CacheSubscription to the list of subscribers.
Of course, here is the Java code you requested: ```java void add(CacheSubscription<T> consumer) { for (;;) { CacheSubscription<T>[] current = subscribers.get(); if (current == TERMINATED) { return; } int n = current.length; @SuppressW...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/GlobalFieldClient.java
GlobalFieldClient.getFieldValueBy
private Field getFieldValueBy(Field fieldParam) { if(fieldParam != null) { //Set for Payara server... fieldParam.setFieldValue(new MultiChoice()); if(this.serviceTicket != null) { fieldParam.setServiceTicket(this.serviceTicket); ...
java
private Field getFieldValueBy(Field fieldParam) { if(fieldParam != null) { //Set for Payara server... fieldParam.setFieldValue(new MultiChoice()); if(this.serviceTicket != null) { fieldParam.setServiceTicket(this.serviceTicket); ...
[ "private", "Field", "getFieldValueBy", "(", "Field", "fieldParam", ")", "{", "if", "(", "fieldParam", "!=", "null", ")", "{", "//Set for Payara server...", "fieldParam", ".", "setFieldValue", "(", "new", "MultiChoice", "(", ")", ")", ";", "if", "(", "this", ...
Retrieves field value by {@code fieldParam}. @param fieldParam The field name. @return Field by primary key.
[ "Retrieves", "field", "value", "by", "{", "@code", "fieldParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/config/GlobalFieldClient.java#L104-L119
test
Get the value by.
Of course, here is the Java code you requested: ```java private Field getFieldValueBy(Field fieldParam) { if(fieldParam != null) { //Set for Payara server... fieldParam.setFieldValue(new MultiChoice()); if(this.serviceTicket != null) { ...
RestComm/jain-slee
container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextFactoryImpl.java
ActivityContextFactoryImpl.createActivityContext
public ActivityContextImpl createActivityContext(final ActivityContextHandle ach, int activityFlags) throws ActivityAlreadyExistsException { if (sleeContainer.getCongestionControl().refuseStartActivity()) { throw new SLEEException("congestion control refused activity start"); } // create ac Acti...
java
public ActivityContextImpl createActivityContext(final ActivityContextHandle ach, int activityFlags) throws ActivityAlreadyExistsException { if (sleeContainer.getCongestionControl().refuseStartActivity()) { throw new SLEEException("congestion control refused activity start"); } // create ac Acti...
[ "public", "ActivityContextImpl", "createActivityContext", "(", "final", "ActivityContextHandle", "ach", ",", "int", "activityFlags", ")", "throws", "ActivityAlreadyExistsException", "{", "if", "(", "sleeContainer", ".", "getCongestionControl", "(", ")", ".", "refuseStartA...
/* (non-Javadoc) @see org.mobicents.slee.container.activity.ActivityContextFactory#createActivityContext(org.mobicents.slee.container.activity.ActivityContextHandle, int)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/activities/src/main/java/org/mobicents/slee/runtime/activity/ActivityContextFactoryImpl.java#L153-L170
test
Creates an activity context.
Of course, here is the Java code you requested: ```java public ActivityContextImpl createActivityContext(final ActivityContextHandle ach, int activityFlags) throws ActivityAlreadyExistsException { if (sleeContainer.getCongestionControl().refuseStartActivity()) { throw new SLEEException("congestion control r...
subchen/jetbrick-all-1x
jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java
StringUtils.substring
public static String substring(final String s, int start, int end) { if (s == null) { return null; } // handle negatives if (end < 0) { end = s.length() + end; // remember end is negative } if (start < 0) { start = s.length() + start; ...
java
public static String substring(final String s, int start, int end) { if (s == null) { return null; } // handle negatives if (end < 0) { end = s.length() + end; // remember end is negative } if (start < 0) { start = s.length() + start; ...
[ "public", "static", "String", "substring", "(", "final", "String", "s", ",", "int", "start", ",", "int", "end", ")", "{", "if", "(", "s", "==", "null", ")", "{", "return", "null", ";", "}", "// handle negatives", "if", "(", "end", "<", "0", ")", "{...
<p> Gets a substring from the specified String avoiding exceptions. </p> <p> A negative start position can be used to start/end {@code n} characters from the end of the String. </p> <p> The returned substring starts with the character in the {@code start} position and ends before the {@code end} position. All positio...
[ "<p", ">", "Gets", "a", "substring", "from", "the", "specified", "String", "avoiding", "exceptions", ".", "<", "/", "p", ">" ]
abe54629a508592287afe5ca4ffc93bf8bf4940c
https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/lang/StringUtils.java#L1164-L1195
test
Get a substring of a String.
Of course, here is the Java code you requested: ```java public static String substring(final String s, int start, int end) { if (s == null) { return null; } // handle negatives if (end < 0) { end = s.length() + end; // remember end is negative } ...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPlane3D_F64.java
UtilPlane3D_F64.point3Dto2D
public static void point3Dto2D(Point3D_F64 pointOnPlane , Vector3D_F64 axisX , Vector3D_F64 axisY, Point3D_F64 A , Point2D_F64 output ) { double x = A.x - pointOnPlane.x; double y = A.y - pointOnPlane.y; double z = A.z - pointOnPlane.z; output.x = x*axisX.x + y*axisX.y + z*axisX.z; out...
java
public static void point3Dto2D(Point3D_F64 pointOnPlane , Vector3D_F64 axisX , Vector3D_F64 axisY, Point3D_F64 A , Point2D_F64 output ) { double x = A.x - pointOnPlane.x; double y = A.y - pointOnPlane.y; double z = A.z - pointOnPlane.z; output.x = x*axisX.x + y*axisX.y + z*axisX.z; out...
[ "public", "static", "void", "point3Dto2D", "(", "Point3D_F64", "pointOnPlane", ",", "Vector3D_F64", "axisX", ",", "Vector3D_F64", "axisY", ",", "Point3D_F64", "A", ",", "Point2D_F64", "output", ")", "{", "double", "x", "=", "A", ".", "x", "-", "pointOnPlane", ...
Projects the point onto the 2D coordinate system specified by the provided x-axis. If the chose of x-axis is arbitrary {@link UtilVector3D_F64#perpendicularCanonical(Vector3D_F64, Vector3D_F64)} is recommended as a way to select @param pointOnPlane (Input) A point on the plane. @param axisX (Input) Vector which define...
[ "Projects", "the", "point", "onto", "the", "2D", "coordinate", "system", "specified", "by", "the", "provided", "x", "-", "axis", ".", "If", "the", "chose", "of", "x", "-", "axis", "is", "arbitrary", "{", "@link", "UtilVector3D_F64#perpendicularCanonical", "(",...
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPlane3D_F64.java#L196-L206
test
Computes the 2D transformation of a point on plane using the 3D transformation.
Of course, here is the Java code you requested: ```java public static void point3Dto2D(Point3D_F64 pointOnPlane , Vector3D_F64 axisX , Vector3D_F64 axisY, Point3D_F64 A , Point2D_F64 output ) { double x = A.x - pointOnPlane.x; double y = A.y - pointOnPlane.y; double z = A.z - pointOnPlane....