id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
122,500
spring-projects/spring-boot
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
Restarter.relaunch
protected Throwable relaunch(ClassLoader classLoader) throws Exception { RestartLauncher launcher = new RestartLauncher(classLoader, this.mainClassName, this.args, this.exceptionHandler); launcher.start(); launcher.join(); return launcher.getError(); }
java
protected Throwable relaunch(ClassLoader classLoader) throws Exception { RestartLauncher launcher = new RestartLauncher(classLoader, this.mainClassName, this.args, this.exceptionHandler); launcher.start(); launcher.join(); return launcher.getError(); }
[ "protected", "Throwable", "relaunch", "(", "ClassLoader", "classLoader", ")", "throws", "Exception", "{", "RestartLauncher", "launcher", "=", "new", "RestartLauncher", "(", "classLoader", ",", "this", ".", "mainClassName", ",", "this", ".", "args", ",", "this", ...
Relaunch the application using the specified classloader. @param classLoader the classloader to use @return any exception that caused the launch to fail or {@code null} @throws Exception in case of errors
[ "Relaunch", "the", "application", "using", "the", "specified", "classloader", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java#L295-L301
122,501
spring-projects/spring-boot
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
Restarter.stop
protected void stop() throws Exception { this.logger.debug("Stopping application"); this.stopLock.lock(); try { for (ConfigurableApplicationContext context : this.rootContexts) { context.close(); this.rootContexts.remove(context); } cleanupCaches(); if (this.forceReferenceCleanup) { forceR...
java
protected void stop() throws Exception { this.logger.debug("Stopping application"); this.stopLock.lock(); try { for (ConfigurableApplicationContext context : this.rootContexts) { context.close(); this.rootContexts.remove(context); } cleanupCaches(); if (this.forceReferenceCleanup) { forceR...
[ "protected", "void", "stop", "(", ")", "throws", "Exception", "{", "this", ".", "logger", ".", "debug", "(", "\"Stopping application\"", ")", ";", "this", ".", "stopLock", ".", "lock", "(", ")", ";", "try", "{", "for", "(", "ConfigurableApplicationContext", ...
Stop the application. @throws Exception in case of errors
[ "Stop", "the", "application", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java#L307-L325
122,502
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
ConfigurationPropertyName.getLastElement
public String getLastElement(Form form) { int size = getNumberOfElements(); return (size != 0) ? getElement(size - 1, form) : EMPTY_STRING; }
java
public String getLastElement(Form form) { int size = getNumberOfElements(); return (size != 0) ? getElement(size - 1, form) : EMPTY_STRING; }
[ "public", "String", "getLastElement", "(", "Form", "form", ")", "{", "int", "size", "=", "getNumberOfElements", "(", ")", ";", "return", "(", "size", "!=", "0", ")", "?", "getElement", "(", "size", "-", "1", ",", "form", ")", ":", "EMPTY_STRING", ";", ...
Return the last element in the name in the given form. @param form the form to return @return the last element
[ "Return", "the", "last", "element", "in", "the", "name", "in", "the", "given", "form", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L114-L117
122,503
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java
ConfigurationPropertyName.getElement
public String getElement(int elementIndex, Form form) { CharSequence element = this.elements.get(elementIndex); ElementType type = this.elements.getType(elementIndex); if (type.isIndexed()) { return element.toString(); } if (form == Form.ORIGINAL) { if (type != ElementType.NON_UNIFORM) { return elem...
java
public String getElement(int elementIndex, Form form) { CharSequence element = this.elements.get(elementIndex); ElementType type = this.elements.getType(elementIndex); if (type.isIndexed()) { return element.toString(); } if (form == Form.ORIGINAL) { if (type != ElementType.NON_UNIFORM) { return elem...
[ "public", "String", "getElement", "(", "int", "elementIndex", ",", "Form", "form", ")", "{", "CharSequence", "element", "=", "this", ".", "elements", ".", "get", "(", "elementIndex", ")", ";", "ElementType", "type", "=", "this", ".", "elements", ".", "getT...
Return an element in the name in the given form. @param elementIndex the element index @param form the form to return @return the last element
[ "Return", "an", "element", "in", "the", "name", "in", "the", "given", "form", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertyName.java#L125-L150
122,504
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
CommandRunner.addCommands
public void addCommands(Iterable<Command> commands) { Assert.notNull(commands, "Commands must not be null"); for (Command command : commands) { addCommand(command); } }
java
public void addCommands(Iterable<Command> commands) { Assert.notNull(commands, "Commands must not be null"); for (Command command : commands) { addCommand(command); } }
[ "public", "void", "addCommands", "(", "Iterable", "<", "Command", ">", "commands", ")", "{", "Assert", ".", "notNull", "(", "commands", ",", "\"Commands must not be null\"", ")", ";", "for", "(", "Command", "command", ":", "commands", ")", "{", "addCommand", ...
Add the specified commands. @param commands the commands to add
[ "Add", "the", "specified", "commands", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L73-L78
122,505
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
CommandRunner.findCommand
public Command findCommand(String name) { for (Command candidate : this.commands) { String candidateName = candidate.getName(); if (candidateName.equals(name) || (isOptionCommand(candidate) && ("--" + candidateName).equals(name))) { return candidate; } } return null; }
java
public Command findCommand(String name) { for (Command candidate : this.commands) { String candidateName = candidate.getName(); if (candidateName.equals(name) || (isOptionCommand(candidate) && ("--" + candidateName).equals(name))) { return candidate; } } return null; }
[ "public", "Command", "findCommand", "(", "String", "name", ")", "{", "for", "(", "Command", "candidate", ":", "this", ".", "commands", ")", "{", "String", "candidateName", "=", "candidate", ".", "getName", "(", ")", ";", "if", "(", "candidateName", ".", ...
Find a command by name. @param name the name of the command @return the command or {@code null} if not found
[ "Find", "a", "command", "by", "name", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L148-L157
122,506
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
CommandRunner.runAndHandleErrors
public int runAndHandleErrors(String... args) { String[] argsWithoutDebugFlags = removeDebugFlags(args); boolean debug = argsWithoutDebugFlags.length != args.length; if (debug) { System.setProperty("debug", "true"); } try { ExitStatus result = run(argsWithoutDebugFlags); // The caller will hang up if...
java
public int runAndHandleErrors(String... args) { String[] argsWithoutDebugFlags = removeDebugFlags(args); boolean debug = argsWithoutDebugFlags.length != args.length; if (debug) { System.setProperty("debug", "true"); } try { ExitStatus result = run(argsWithoutDebugFlags); // The caller will hang up if...
[ "public", "int", "runAndHandleErrors", "(", "String", "...", "args", ")", "{", "String", "[", "]", "argsWithoutDebugFlags", "=", "removeDebugFlags", "(", "args", ")", ";", "boolean", "debug", "=", "argsWithoutDebugFlags", ".", "length", "!=", "args", ".", "len...
Run the appropriate and handle and errors. @param args the input arguments @return a return status code (non boot is used to indicate an error)
[ "Run", "the", "appropriate", "and", "handle", "and", "errors", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L164-L185
122,507
spring-projects/spring-boot
spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
CommandRunner.run
protected ExitStatus run(String... args) throws Exception { if (args.length == 0) { throw new NoArgumentsException(); } String commandName = args[0]; String[] commandArguments = Arrays.copyOfRange(args, 1, args.length); Command command = findCommand(commandName); if (command == null) { throw new NoSuc...
java
protected ExitStatus run(String... args) throws Exception { if (args.length == 0) { throw new NoArgumentsException(); } String commandName = args[0]; String[] commandArguments = Arrays.copyOfRange(args, 1, args.length); Command command = findCommand(commandName); if (command == null) { throw new NoSuc...
[ "protected", "ExitStatus", "run", "(", "String", "...", "args", ")", "throws", "Exception", "{", "if", "(", "args", ".", "length", "==", "0", ")", "{", "throw", "new", "NoArgumentsException", "(", ")", ";", "}", "String", "commandName", "=", "args", "[",...
Parse the arguments and run a suitable command. @param args the arguments @return the outcome of the command @throws Exception if the command fails
[ "Parse", "the", "arguments", "and", "run", "a", "suitable", "command", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java#L207-L224
122,508
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java
ConfigurationPropertiesReportEndpoint.applySerializationModifier
private void applySerializationModifier(ObjectMapper mapper) { SerializerFactory factory = BeanSerializerFactory.instance .withSerializerModifier(new GenericSerializerModifier()); mapper.setSerializerFactory(factory); }
java
private void applySerializationModifier(ObjectMapper mapper) { SerializerFactory factory = BeanSerializerFactory.instance .withSerializerModifier(new GenericSerializerModifier()); mapper.setSerializerFactory(factory); }
[ "private", "void", "applySerializationModifier", "(", "ObjectMapper", "mapper", ")", "{", "SerializerFactory", "factory", "=", "BeanSerializerFactory", ".", "instance", ".", "withSerializerModifier", "(", "new", "GenericSerializerModifier", "(", ")", ")", ";", "mapper",...
Ensure only bindable and non-cyclic bean properties are reported. @param mapper the object mapper
[ "Ensure", "only", "bindable", "and", "non", "-", "cyclic", "bean", "properties", "are", "reported", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java#L193-L197
122,509
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java
ConfigurationPropertiesReportEndpoint.sanitize
@SuppressWarnings("unchecked") private Map<String, Object> sanitize(String prefix, Map<String, Object> map) { map.forEach((key, value) -> { String qualifiedKey = (prefix.isEmpty() ? prefix : prefix + ".") + key; if (value instanceof Map) { map.put(key, sanitize(qualifiedKey, (Map<String, Object>) value)); ...
java
@SuppressWarnings("unchecked") private Map<String, Object> sanitize(String prefix, Map<String, Object> map) { map.forEach((key, value) -> { String qualifiedKey = (prefix.isEmpty() ? prefix : prefix + ".") + key; if (value instanceof Map) { map.put(key, sanitize(qualifiedKey, (Map<String, Object>) value)); ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "Map", "<", "String", ",", "Object", ">", "sanitize", "(", "String", "prefix", ",", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "map", ".", "forEach", "(", "(", "key", ",", ...
Sanitize all unwanted configuration properties to avoid leaking of sensitive information. @param prefix the property prefix @param map the source map @return the sanitized map
[ "Sanitize", "all", "unwanted", "configuration", "properties", "to", "avoid", "leaking", "of", "sensitive", "information", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java#L238-L255
122,510
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java
Sanitizer.setKeysToSanitize
public void setKeysToSanitize(String... keysToSanitize) { Assert.notNull(keysToSanitize, "KeysToSanitize must not be null"); this.keysToSanitize = new Pattern[keysToSanitize.length]; for (int i = 0; i < keysToSanitize.length; i++) { this.keysToSanitize[i] = getPattern(keysToSanitize[i]); } }
java
public void setKeysToSanitize(String... keysToSanitize) { Assert.notNull(keysToSanitize, "KeysToSanitize must not be null"); this.keysToSanitize = new Pattern[keysToSanitize.length]; for (int i = 0; i < keysToSanitize.length; i++) { this.keysToSanitize[i] = getPattern(keysToSanitize[i]); } }
[ "public", "void", "setKeysToSanitize", "(", "String", "...", "keysToSanitize", ")", "{", "Assert", ".", "notNull", "(", "keysToSanitize", ",", "\"KeysToSanitize must not be null\"", ")", ";", "this", ".", "keysToSanitize", "=", "new", "Pattern", "[", "keysToSanitize...
Keys that should be sanitized. Keys can be simple strings that the property ends with or regular expressions. @param keysToSanitize the keys to sanitize
[ "Keys", "that", "should", "be", "sanitized", ".", "Keys", "can", "be", "simple", "strings", "that", "the", "property", "ends", "with", "or", "regular", "expressions", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java#L54-L60
122,511
spring-projects/spring-boot
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java
Sanitizer.sanitize
public Object sanitize(String key, Object value) { if (value == null) { return null; } for (Pattern pattern : this.keysToSanitize) { if (pattern.matcher(key).matches()) { return "******"; } } return value; }
java
public Object sanitize(String key, Object value) { if (value == null) { return null; } for (Pattern pattern : this.keysToSanitize) { if (pattern.matcher(key).matches()) { return "******"; } } return value; }
[ "public", "Object", "sanitize", "(", "String", "key", ",", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "null", ";", "}", "for", "(", "Pattern", "pattern", ":", "this", ".", "keysToSanitize", ")", "{", "if", "(",...
Sanitize the given value if necessary. @param key the key to sanitize @param value the value @return the potentially sanitized value
[ "Sanitize", "the", "given", "value", "if", "necessary", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/Sanitizer.java#L84-L94
122,512
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java
JSONObject.numberToString
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Number must be non-null"); } double doubleValue = number.doubleValue(); JSON.checkDouble(doubleValue); // the original returns "-0" instead of "-0.0" for negative zero if (number.equ...
java
public static String numberToString(Number number) throws JSONException { if (number == null) { throw new JSONException("Number must be non-null"); } double doubleValue = number.doubleValue(); JSON.checkDouble(doubleValue); // the original returns "-0" instead of "-0.0" for negative zero if (number.equ...
[ "public", "static", "String", "numberToString", "(", "Number", "number", ")", "throws", "JSONException", "{", "if", "(", "number", "==", "null", ")", "{", "throw", "new", "JSONException", "(", "\"Number must be non-null\"", ")", ";", "}", "double", "doubleValue"...
Encodes the number as a JSON string. @param number a finite value. May not be {@link Double#isNaN() NaNs} or {@link Double#isInfinite() infinities}. @return the encoded value @throws JSONException if an error occurs
[ "Encodes", "the", "number", "as", "a", "JSON", "string", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONObject.java#L748-L767
122,513
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java
DefaultJmsListenerContainerFactoryConfigurer.configure
public void configure(DefaultJmsListenerContainerFactory factory, ConnectionFactory connectionFactory) { Assert.notNull(factory, "Factory must not be null"); Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); factory.setConnectionFactory(connectionFactory); factory.setPubSubDomain(this....
java
public void configure(DefaultJmsListenerContainerFactory factory, ConnectionFactory connectionFactory) { Assert.notNull(factory, "Factory must not be null"); Assert.notNull(connectionFactory, "ConnectionFactory must not be null"); factory.setConnectionFactory(connectionFactory); factory.setPubSubDomain(this....
[ "public", "void", "configure", "(", "DefaultJmsListenerContainerFactory", "factory", ",", "ConnectionFactory", "connectionFactory", ")", "{", "Assert", ".", "notNull", "(", "factory", ",", "\"Factory must not be null\"", ")", ";", "Assert", ".", "notNull", "(", "conne...
Configure the specified jms listener container factory. The factory can be further tuned and default settings can be overridden. @param factory the {@link DefaultJmsListenerContainerFactory} instance to configure @param connectionFactory the {@link ConnectionFactory} to use
[ "Configure", "the", "specified", "jms", "listener", "container", "factory", ".", "The", "factory", "can", "be", "further", "tuned", "and", "default", "settings", "can", "be", "overridden", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java#L84-L111
122,514
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/SimpleConfigurationMetadataRepository.java
SimpleConfigurationMetadataRepository.include
public void include(ConfigurationMetadataRepository repository) { for (ConfigurationMetadataGroup group : repository.getAllGroups().values()) { ConfigurationMetadataGroup existingGroup = this.allGroups.get(group.getId()); if (existingGroup == null) { this.allGroups.put(group.getId(), group); } else { ...
java
public void include(ConfigurationMetadataRepository repository) { for (ConfigurationMetadataGroup group : repository.getAllGroups().values()) { ConfigurationMetadataGroup existingGroup = this.allGroups.get(group.getId()); if (existingGroup == null) { this.allGroups.put(group.getId(), group); } else { ...
[ "public", "void", "include", "(", "ConfigurationMetadataRepository", "repository", ")", "{", "for", "(", "ConfigurationMetadataGroup", "group", ":", "repository", ".", "getAllGroups", "(", ")", ".", "values", "(", ")", ")", "{", "ConfigurationMetadataGroup", "existi...
Merge the content of the specified repository to this repository. @param repository the repository to include
[ "Merge", "the", "content", "of", "the", "specified", "repository", "to", "this", "repository", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-configuration-metadata/src/main/java/org/springframework/boot/configurationmetadata/SimpleConfigurationMetadataRepository.java#L88-L104
122,515
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java
SslServerCustomizer.configureSsl
protected void configureSsl(SslContextFactory factory, Ssl ssl, SslStoreProvider sslStoreProvider) { factory.setProtocol(ssl.getProtocol()); configureSslClientAuth(factory, ssl); configureSslPasswords(factory, ssl); factory.setCertAlias(ssl.getKeyAlias()); if (!ObjectUtils.isEmpty(ssl.getCiphers())) { f...
java
protected void configureSsl(SslContextFactory factory, Ssl ssl, SslStoreProvider sslStoreProvider) { factory.setProtocol(ssl.getProtocol()); configureSslClientAuth(factory, ssl); configureSslPasswords(factory, ssl); factory.setCertAlias(ssl.getKeyAlias()); if (!ObjectUtils.isEmpty(ssl.getCiphers())) { f...
[ "protected", "void", "configureSsl", "(", "SslContextFactory", "factory", ",", "Ssl", "ssl", ",", "SslStoreProvider", "sslStoreProvider", ")", "{", "factory", ".", "setProtocol", "(", "ssl", ".", "getProtocol", "(", ")", ")", ";", "configureSslClientAuth", "(", ...
Configure the SSL connection. @param factory the Jetty {@link SslContextFactory}. @param ssl the ssl details. @param sslStoreProvider the ssl store provider
[ "Configure", "the", "SSL", "connection", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/SslServerCustomizer.java#L141-L167
122,516
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/ConcurrentKafkaListenerContainerFactoryConfigurer.java
ConcurrentKafkaListenerContainerFactoryConfigurer.configure
public void configure( ConcurrentKafkaListenerContainerFactory<Object, Object> listenerFactory, ConsumerFactory<Object, Object> consumerFactory) { listenerFactory.setConsumerFactory(consumerFactory); configureListenerFactory(listenerFactory); configureContainer(listenerFactory.getContainerProperties()); }
java
public void configure( ConcurrentKafkaListenerContainerFactory<Object, Object> listenerFactory, ConsumerFactory<Object, Object> consumerFactory) { listenerFactory.setConsumerFactory(consumerFactory); configureListenerFactory(listenerFactory); configureContainer(listenerFactory.getContainerProperties()); }
[ "public", "void", "configure", "(", "ConcurrentKafkaListenerContainerFactory", "<", "Object", ",", "Object", ">", "listenerFactory", ",", "ConsumerFactory", "<", "Object", ",", "Object", ">", "consumerFactory", ")", "{", "listenerFactory", ".", "setConsumerFactory", "...
Configure the specified Kafka listener container factory. The factory can be further tuned and default settings can be overridden. @param listenerFactory the {@link ConcurrentKafkaListenerContainerFactory} instance to configure @param consumerFactory the {@link ConsumerFactory} to use
[ "Configure", "the", "specified", "Kafka", "listener", "container", "factory", ".", "The", "factory", "can", "be", "further", "tuned", "and", "default", "settings", "can", "be", "overridden", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/ConcurrentKafkaListenerContainerFactoryConfigurer.java#L121-L127
122,517
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java
HazelcastProperties.resolveConfigLocation
public Resource resolveConfigLocation() { if (this.config == null) { return null; } Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not " + "exist '" + this.config.getDescription() + "'"); return this.config; }
java
public Resource resolveConfigLocation() { if (this.config == null) { return null; } Assert.isTrue(this.config.exists(), () -> "Hazelcast configuration does not " + "exist '" + this.config.getDescription() + "'"); return this.config; }
[ "public", "Resource", "resolveConfigLocation", "(", ")", "{", "if", "(", "this", ".", "config", "==", "null", ")", "{", "return", "null", ";", "}", "Assert", ".", "isTrue", "(", "this", ".", "config", ".", "exists", "(", ")", ",", "(", ")", "->", "...
Resolve the config location if set. @return the location or {@code null} if it is not set @throws IllegalArgumentException if the config attribute is set to an unknown location
[ "Resolve", "the", "config", "location", "if", "set", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastProperties.java#L51-L58
122,518
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java
StartMojo.execute
public <T> T execute(long wait, int maxAttempts, Callable<T> callback) throws Exception { getLog().debug("Waiting for spring application to start..."); for (int i = 0; i < maxAttempts; i++) { T result = callback.call(); if (result != null) { return result; } String message = "Spring application i...
java
public <T> T execute(long wait, int maxAttempts, Callable<T> callback) throws Exception { getLog().debug("Waiting for spring application to start..."); for (int i = 0; i < maxAttempts; i++) { T result = callback.call(); if (result != null) { return result; } String message = "Spring application i...
[ "public", "<", "T", ">", "T", "execute", "(", "long", "wait", ",", "int", "maxAttempts", ",", "Callable", "<", "T", ">", "callback", ")", "throws", "Exception", "{", "getLog", "(", ")", ".", "debug", "(", "\"Waiting for spring application to start...\"", ")"...
Execute a task, retrying it on failure. @param <T> the result type @param wait the wait time @param maxAttempts the maximum number of attempts @param callback the task to execute (possibly multiple times). The callback should return {@code null} to indicate that another attempt should be made @return the result @throws...
[ "Execute", "a", "task", "retrying", "it", "on", "failure", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java#L257-L282
122,519
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java
DynamicRegistrationBean.setInitParameters
public void setInitParameters(Map<String, String> initParameters) { Assert.notNull(initParameters, "InitParameters must not be null"); this.initParameters = new LinkedHashMap<>(initParameters); }
java
public void setInitParameters(Map<String, String> initParameters) { Assert.notNull(initParameters, "InitParameters must not be null"); this.initParameters = new LinkedHashMap<>(initParameters); }
[ "public", "void", "setInitParameters", "(", "Map", "<", "String", ",", "String", ">", "initParameters", ")", "{", "Assert", ".", "notNull", "(", "initParameters", ",", "\"InitParameters must not be null\"", ")", ";", "this", ".", "initParameters", "=", "new", "L...
Set init-parameters for this registration. Calling this method will replace any existing init-parameters. @param initParameters the init parameters @see #getInitParameters @see #addInitParameter
[ "Set", "init", "-", "parameters", "for", "this", "registration", ".", "Calling", "this", "method", "will", "replace", "any", "existing", "init", "-", "parameters", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java#L84-L87
122,520
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java
DynamicRegistrationBean.addInitParameter
public void addInitParameter(String name, String value) { Assert.notNull(name, "Name must not be null"); this.initParameters.put(name, value); }
java
public void addInitParameter(String name, String value) { Assert.notNull(name, "Name must not be null"); this.initParameters.put(name, value); }
[ "public", "void", "addInitParameter", "(", "String", "name", ",", "String", "value", ")", "{", "Assert", ".", "notNull", "(", "name", ",", "\"Name must not be null\"", ")", ";", "this", ".", "initParameters", ".", "put", "(", "name", ",", "value", ")", ";"...
Add a single init-parameter, replacing any existing parameter with the same name. @param name the init-parameter name @param value the init-parameter value
[ "Add", "a", "single", "init", "-", "parameter", "replacing", "any", "existing", "parameter", "with", "the", "same", "name", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java#L102-L105
122,521
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java
DynamicRegistrationBean.getOrDeduceName
protected final String getOrDeduceName(Object value) { return (this.name != null) ? this.name : Conventions.getVariableName(value); }
java
protected final String getOrDeduceName(Object value) { return (this.name != null) ? this.name : Conventions.getVariableName(value); }
[ "protected", "final", "String", "getOrDeduceName", "(", "Object", "value", ")", "{", "return", "(", "this", ".", "name", "!=", "null", ")", "?", "this", ".", "name", ":", "Conventions", ".", "getVariableName", "(", "value", ")", ";", "}" ]
Deduces the name for this registration. Will return user specified name or fallback to convention based naming. @param value the object used for convention based names @return the deduced name
[ "Deduces", "the", "name", "for", "this", "registration", ".", "Will", "return", "user", "specified", "name", "or", "fallback", "to", "convention", "based", "naming", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/DynamicRegistrationBean.java#L134-L136
122,522
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java
Bindable.getAnnotation
@SuppressWarnings("unchecked") public <A extends Annotation> A getAnnotation(Class<A> type) { for (Annotation annotation : this.annotations) { if (type.isInstance(annotation)) { return (A) annotation; } } return null; }
java
@SuppressWarnings("unchecked") public <A extends Annotation> A getAnnotation(Class<A> type) { for (Annotation annotation : this.annotations) { if (type.isInstance(annotation)) { return (A) annotation; } } return null; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "A", "extends", "Annotation", ">", "A", "getAnnotation", "(", "Class", "<", "A", ">", "type", ")", "{", "for", "(", "Annotation", "annotation", ":", "this", ".", "annotations", ")", "{", ...
Return a single associated annotations that could affect binding. @param <A> the annotation type @param type annotation type @return the associated annotation or {@code null}
[ "Return", "a", "single", "associated", "annotations", "that", "could", "affect", "binding", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Bindable.java#L99-L107
122,523
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/AbstractFailureAnalyzer.java
AbstractFailureAnalyzer.getCauseType
@SuppressWarnings("unchecked") protected Class<? extends T> getCauseType() { return (Class<? extends T>) ResolvableType .forClass(AbstractFailureAnalyzer.class, getClass()).resolveGeneric(); }
java
@SuppressWarnings("unchecked") protected Class<? extends T> getCauseType() { return (Class<? extends T>) ResolvableType .forClass(AbstractFailureAnalyzer.class, getClass()).resolveGeneric(); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "Class", "<", "?", "extends", "T", ">", "getCauseType", "(", ")", "{", "return", "(", "Class", "<", "?", "extends", "T", ">", ")", "ResolvableType", ".", "forClass", "(", "AbstractFailureAnalyz...
Return the cause type being handled by the analyzer. By default the class generic is used. @return the cause type
[ "Return", "the", "cause", "type", "being", "handled", "by", "the", "analyzer", ".", "By", "default", "the", "class", "generic", "is", "used", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/AbstractFailureAnalyzer.java#L55-L59
122,524
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java
SpringApplicationJsonEnvironmentPostProcessor.flatten
private Map<String, Object> flatten(Map<String, Object> map) { Map<String, Object> result = new LinkedHashMap<>(); flatten(null, result, map); return result; }
java
private Map<String, Object> flatten(Map<String, Object> map) { Map<String, Object> result = new LinkedHashMap<>(); flatten(null, result, map); return result; }
[ "private", "Map", "<", "String", ",", "Object", ">", "flatten", "(", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "Map", "<", "String", ",", "Object", ">", "result", "=", "new", "LinkedHashMap", "<>", "(", ")", ";", "flatten", "(", "n...
Flatten the map keys using period separator. @param map the map that should be flattened @return the flattened map
[ "Flatten", "the", "map", "keys", "using", "period", "separator", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/SpringApplicationJsonEnvironmentPostProcessor.java#L108-L112
122,525
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java
ConditionEvaluationReport.recordConditionEvaluation
public void recordConditionEvaluation(String source, Condition condition, ConditionOutcome outcome) { Assert.notNull(source, "Source must not be null"); Assert.notNull(condition, "Condition must not be null"); Assert.notNull(outcome, "Outcome must not be null"); this.unconditionalClasses.remove(source); if...
java
public void recordConditionEvaluation(String source, Condition condition, ConditionOutcome outcome) { Assert.notNull(source, "Source must not be null"); Assert.notNull(condition, "Condition must not be null"); Assert.notNull(outcome, "Outcome must not be null"); this.unconditionalClasses.remove(source); if...
[ "public", "void", "recordConditionEvaluation", "(", "String", "source", ",", "Condition", "condition", ",", "ConditionOutcome", "outcome", ")", "{", "Assert", ".", "notNull", "(", "source", ",", "\"Source must not be null\"", ")", ";", "Assert", ".", "notNull", "(...
Record the occurrence of condition evaluation. @param source the source of the condition (class or method name) @param condition the condition evaluated @param outcome the condition outcome
[ "Record", "the", "occurrence", "of", "condition", "evaluation", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java#L78-L89
122,526
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java
ConditionEvaluationReport.recordExclusions
public void recordExclusions(Collection<String> exclusions) { Assert.notNull(exclusions, "exclusions must not be null"); this.exclusions.addAll(exclusions); }
java
public void recordExclusions(Collection<String> exclusions) { Assert.notNull(exclusions, "exclusions must not be null"); this.exclusions.addAll(exclusions); }
[ "public", "void", "recordExclusions", "(", "Collection", "<", "String", ">", "exclusions", ")", "{", "Assert", ".", "notNull", "(", "exclusions", ",", "\"exclusions must not be null\"", ")", ";", "this", ".", "exclusions", ".", "addAll", "(", "exclusions", ")", ...
Records the names of the classes that have been excluded from condition evaluation. @param exclusions the names of the excluded classes
[ "Records", "the", "names", "of", "the", "classes", "that", "have", "been", "excluded", "from", "condition", "evaluation", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java#L95-L98
122,527
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java
ConditionEvaluationReport.recordEvaluationCandidates
public void recordEvaluationCandidates(List<String> evaluationCandidates) { Assert.notNull(evaluationCandidates, "evaluationCandidates must not be null"); this.unconditionalClasses.addAll(evaluationCandidates); }
java
public void recordEvaluationCandidates(List<String> evaluationCandidates) { Assert.notNull(evaluationCandidates, "evaluationCandidates must not be null"); this.unconditionalClasses.addAll(evaluationCandidates); }
[ "public", "void", "recordEvaluationCandidates", "(", "List", "<", "String", ">", "evaluationCandidates", ")", "{", "Assert", ".", "notNull", "(", "evaluationCandidates", ",", "\"evaluationCandidates must not be null\"", ")", ";", "this", ".", "unconditionalClasses", "."...
Records the names of the classes that are candidates for condition evaluation. @param evaluationCandidates the names of the classes whose conditions will be evaluated
[ "Records", "the", "names", "of", "the", "classes", "that", "are", "candidates", "for", "condition", "evaluation", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java#L105-L108
122,528
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java
ConditionEvaluationReport.getConditionAndOutcomesBySource
public Map<String, ConditionAndOutcomes> getConditionAndOutcomesBySource() { if (!this.addedAncestorOutcomes) { this.outcomes.forEach((source, sourceOutcomes) -> { if (!sourceOutcomes.isFullMatch()) { addNoMatchOutcomeToAncestors(source); } }); this.addedAncestorOutcomes = true; } return Col...
java
public Map<String, ConditionAndOutcomes> getConditionAndOutcomesBySource() { if (!this.addedAncestorOutcomes) { this.outcomes.forEach((source, sourceOutcomes) -> { if (!sourceOutcomes.isFullMatch()) { addNoMatchOutcomeToAncestors(source); } }); this.addedAncestorOutcomes = true; } return Col...
[ "public", "Map", "<", "String", ",", "ConditionAndOutcomes", ">", "getConditionAndOutcomesBySource", "(", ")", "{", "if", "(", "!", "this", ".", "addedAncestorOutcomes", ")", "{", "this", ".", "outcomes", ".", "forEach", "(", "(", "source", ",", "sourceOutcome...
Returns condition outcomes from this report, grouped by the source. @return the condition outcomes
[ "Returns", "condition", "outcomes", "from", "this", "report", "grouped", "by", "the", "source", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java#L114-L124
122,529
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java
ConditionEvaluationReport.getUnconditionalClasses
public Set<String> getUnconditionalClasses() { Set<String> filtered = new HashSet<>(this.unconditionalClasses); filtered.removeAll(this.exclusions); return Collections.unmodifiableSet(filtered); }
java
public Set<String> getUnconditionalClasses() { Set<String> filtered = new HashSet<>(this.unconditionalClasses); filtered.removeAll(this.exclusions); return Collections.unmodifiableSet(filtered); }
[ "public", "Set", "<", "String", ">", "getUnconditionalClasses", "(", ")", "{", "Set", "<", "String", ">", "filtered", "=", "new", "HashSet", "<>", "(", "this", ".", "unconditionalClasses", ")", ";", "filtered", ".", "removeAll", "(", "this", ".", "exclusio...
Returns the names of the classes that were evaluated but were not conditional. @return the names of the unconditional classes
[ "Returns", "the", "names", "of", "the", "classes", "that", "were", "evaluated", "but", "were", "not", "conditional", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionEvaluationReport.java#L149-L153
122,530
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java
DataSourceInitializer.createSchema
public boolean createSchema() { List<Resource> scripts = getScripts("spring.datasource.schema", this.properties.getSchema(), "schema"); if (!scripts.isEmpty()) { if (!isEnabled()) { logger.debug("Initialization disabled (not running DDL scripts)"); return false; } String username = this.propert...
java
public boolean createSchema() { List<Resource> scripts = getScripts("spring.datasource.schema", this.properties.getSchema(), "schema"); if (!scripts.isEmpty()) { if (!isEnabled()) { logger.debug("Initialization disabled (not running DDL scripts)"); return false; } String username = this.propert...
[ "public", "boolean", "createSchema", "(", ")", "{", "List", "<", "Resource", ">", "scripts", "=", "getScripts", "(", "\"spring.datasource.schema\"", ",", "this", ".", "properties", ".", "getSchema", "(", ")", ",", "\"schema\"", ")", ";", "if", "(", "!", "s...
Create the schema if necessary. @return {@code true} if the schema was created @see DataSourceProperties#getSchema()
[ "Create", "the", "schema", "if", "necessary", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java#L94-L107
122,531
spring-projects/spring-boot
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java
DataSourceInitializer.initSchema
public void initSchema() { List<Resource> scripts = getScripts("spring.datasource.data", this.properties.getData(), "data"); if (!scripts.isEmpty()) { if (!isEnabled()) { logger.debug("Initialization disabled (not running data scripts)"); return; } String username = this.properties.getDataUsern...
java
public void initSchema() { List<Resource> scripts = getScripts("spring.datasource.data", this.properties.getData(), "data"); if (!scripts.isEmpty()) { if (!isEnabled()) { logger.debug("Initialization disabled (not running data scripts)"); return; } String username = this.properties.getDataUsern...
[ "public", "void", "initSchema", "(", ")", "{", "List", "<", "Resource", ">", "scripts", "=", "getScripts", "(", "\"spring.datasource.data\"", ",", "this", ".", "properties", ".", "getData", "(", ")", ",", "\"data\"", ")", ";", "if", "(", "!", "scripts", ...
Initialize the schema if necessary. @see DataSourceProperties#getData()
[ "Initialize", "the", "schema", "if", "necessary", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java#L113-L125
122,532
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
TomcatServletWebServerFactory.setTldSkipPatterns
public void setTldSkipPatterns(Collection<String> patterns) { Assert.notNull(patterns, "Patterns must not be null"); this.tldSkipPatterns = new LinkedHashSet<>(patterns); }
java
public void setTldSkipPatterns(Collection<String> patterns) { Assert.notNull(patterns, "Patterns must not be null"); this.tldSkipPatterns = new LinkedHashSet<>(patterns); }
[ "public", "void", "setTldSkipPatterns", "(", "Collection", "<", "String", ">", "patterns", ")", "{", "Assert", ".", "notNull", "(", "patterns", ",", "\"Patterns must not be null\"", ")", ";", "this", ".", "tldSkipPatterns", "=", "new", "LinkedHashSet", "<>", "("...
Set the patterns that match jars to ignore for TLD scanning. See Tomcat's catalina.properties for typical values. Defaults to a list drawn from that source. @param patterns the jar patterns to skip when scanning for TLDs etc
[ "Set", "the", "patterns", "that", "match", "jars", "to", "ignore", "for", "TLD", "scanning", ".", "See", "Tomcat", "s", "catalina", ".", "properties", "for", "typical", "values", ".", "Defaults", "to", "a", "list", "drawn", "from", "that", "source", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java#L466-L469
122,533
spring-projects/spring-boot
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
TomcatServletWebServerFactory.addTldSkipPatterns
public void addTldSkipPatterns(String... patterns) { Assert.notNull(patterns, "Patterns must not be null"); this.tldSkipPatterns.addAll(Arrays.asList(patterns)); }
java
public void addTldSkipPatterns(String... patterns) { Assert.notNull(patterns, "Patterns must not be null"); this.tldSkipPatterns.addAll(Arrays.asList(patterns)); }
[ "public", "void", "addTldSkipPatterns", "(", "String", "...", "patterns", ")", "{", "Assert", ".", "notNull", "(", "patterns", ",", "\"Patterns must not be null\"", ")", ";", "this", ".", "tldSkipPatterns", ".", "addAll", "(", "Arrays", ".", "asList", "(", "pa...
Add patterns that match jars to ignore for TLD scanning. See Tomcat's catalina.properties for typical values. @param patterns the additional jar patterns to skip when scanning for TLDs etc
[ "Add", "patterns", "that", "match", "jars", "to", "ignore", "for", "TLD", "scanning", ".", "See", "Tomcat", "s", "catalina", ".", "properties", "for", "typical", "values", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java#L476-L479
122,534
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/parser/ArcEager.java
ArcEager.isTerminal
public static boolean isTerminal(ArrayList<Configuration> beam) { for (Configuration configuration : beam) if (!configuration.state.isTerminalState()) return false; return true; }
java
public static boolean isTerminal(ArrayList<Configuration> beam) { for (Configuration configuration : beam) if (!configuration.state.isTerminalState()) return false; return true; }
[ "public", "static", "boolean", "isTerminal", "(", "ArrayList", "<", "Configuration", ">", "beam", ")", "{", "for", "(", "Configuration", "configuration", ":", "beam", ")", "if", "(", "!", "configuration", ".", "state", ".", "isTerminalState", "(", ")", ")", ...
Shows true if all of the configurations in the beam are in the terminal state @param beam the current beam @return true if all of the configurations in the beam are in the terminal state
[ "Shows", "true", "if", "all", "of", "the", "configurations", "in", "the", "beam", "are", "in", "the", "terminal", "state" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/parser/ArcEager.java#L102-L108
122,535
hankcs/HanLP
src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java
Sentence.toWordTagNerArray
public String[][] toWordTagNerArray(NERTagSet tagSet) { List<String[]> tupleList = Utility.convertSentenceToNER(this, tagSet); String[][] result = new String[3][tupleList.size()]; Iterator<String[]> iterator = tupleList.iterator(); for (int i = 0; i < result[0].length; i++) {...
java
public String[][] toWordTagNerArray(NERTagSet tagSet) { List<String[]> tupleList = Utility.convertSentenceToNER(this, tagSet); String[][] result = new String[3][tupleList.size()]; Iterator<String[]> iterator = tupleList.iterator(); for (int i = 0; i < result[0].length; i++) {...
[ "public", "String", "[", "]", "[", "]", "toWordTagNerArray", "(", "NERTagSet", "tagSet", ")", "{", "List", "<", "String", "[", "]", ">", "tupleList", "=", "Utility", ".", "convertSentenceToNER", "(", "this", ",", "tagSet", ")", ";", "String", "[", "]", ...
word pos ner @param tagSet @return
[ "word", "pos", "ner" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/corpus/document/sentence/Sentence.java#L455-L469
122,536
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java
Corpus.addWordToVocab
protected int addWordToVocab(String word) { vocab[vocabSize] = new VocabWord(word); vocabSize++; // Reallocate memory if needed if (vocabSize + 2 >= vocabMaxSize) { vocabMaxSize += 1000; VocabWord[] temp = new VocabWord[vocabMaxSize]; Syst...
java
protected int addWordToVocab(String word) { vocab[vocabSize] = new VocabWord(word); vocabSize++; // Reallocate memory if needed if (vocabSize + 2 >= vocabMaxSize) { vocabMaxSize += 1000; VocabWord[] temp = new VocabWord[vocabMaxSize]; Syst...
[ "protected", "int", "addWordToVocab", "(", "String", "word", ")", "{", "vocab", "[", "vocabSize", "]", "=", "new", "VocabWord", "(", "word", ")", ";", "vocabSize", "++", ";", "// Reallocate memory if needed", "if", "(", "vocabSize", "+", "2", ">=", "vocabMax...
Adds a word to the vocabulary @param word @return
[ "Adds", "a", "word", "to", "the", "vocabulary" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java#L46-L61
122,537
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java
Corpus.searchVocab
int searchVocab(String word) { if (word == null) return -1; Integer pos = vocabIndexMap.get(word); return pos == null ? -1 : pos.intValue(); }
java
int searchVocab(String word) { if (word == null) return -1; Integer pos = vocabIndexMap.get(word); return pos == null ? -1 : pos.intValue(); }
[ "int", "searchVocab", "(", "String", "word", ")", "{", "if", "(", "word", "==", "null", ")", "return", "-", "1", ";", "Integer", "pos", "=", "vocabIndexMap", ".", "get", "(", "word", ")", ";", "return", "pos", "==", "null", "?", "-", "1", ":", "p...
Returns position of a word in the vocabulary; if the word is not found, returns -1 @param word @return
[ "Returns", "position", "of", "a", "word", "in", "the", "vocabulary", ";", "if", "the", "word", "is", "not", "found", "returns", "-", "1" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java#L137-L142
122,538
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java
Corpus.sortVocab
void sortVocab() { Arrays.sort(vocab, 0, vocabSize); // re-build vocabIndexMap final int size = vocabSize; trainWords = 0; table = new int[size]; for (int i = 0; i < size; i++) { VocabWord word = vocab[i]; // Words occuring less than m...
java
void sortVocab() { Arrays.sort(vocab, 0, vocabSize); // re-build vocabIndexMap final int size = vocabSize; trainWords = 0; table = new int[size]; for (int i = 0; i < size; i++) { VocabWord word = vocab[i]; // Words occuring less than m...
[ "void", "sortVocab", "(", ")", "{", "Arrays", ".", "sort", "(", "vocab", ",", "0", ",", "vocabSize", ")", ";", "// re-build vocabIndexMap", "final", "int", "size", "=", "vocabSize", ";", "trainWords", "=", "0", ";", "table", "=", "new", "int", "[", "si...
Sorts the vocabulary by frequency using word counts
[ "Sorts", "the", "vocabulary", "by", "frequency", "using", "word", "counts" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java#L147-L177
122,539
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java
Corpus.createBinaryTree
void createBinaryTree() { int[] point = new int[VocabWord.MAX_CODE_LENGTH]; char[] code = new char[VocabWord.MAX_CODE_LENGTH]; int[] count = new int[vocabSize * 2 + 1]; char[] binary = new char[vocabSize * 2 + 1]; int[] parentNode = new int[vocabSize * 2 + 1]; for (i...
java
void createBinaryTree() { int[] point = new int[VocabWord.MAX_CODE_LENGTH]; char[] code = new char[VocabWord.MAX_CODE_LENGTH]; int[] count = new int[vocabSize * 2 + 1]; char[] binary = new char[vocabSize * 2 + 1]; int[] parentNode = new int[vocabSize * 2 + 1]; for (i...
[ "void", "createBinaryTree", "(", ")", "{", "int", "[", "]", "point", "=", "new", "int", "[", "VocabWord", ".", "MAX_CODE_LENGTH", "]", ";", "char", "[", "]", "code", "=", "new", "char", "[", "VocabWord", ".", "MAX_CODE_LENGTH", "]", ";", "int", "[", ...
Create binary Huffman tree using the word counts. Frequent words will have short uniqe binary codes
[ "Create", "binary", "Huffman", "tree", "using", "the", "word", "counts", ".", "Frequent", "words", "will", "have", "short", "uniqe", "binary", "codes" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/Corpus.java#L189-L270
122,540
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/trie/datrie/Utf8CharacterMapping.java
Utf8CharacterMapping.toIdList
@Override public int[] toIdList(int codePoint) { int count; if (codePoint < 0x80) count = 1; else if (codePoint < 0x800) count = 2; else if (codePoint < 0x10000) count = 3; else if (codePoint < 0x200000) count = 4; e...
java
@Override public int[] toIdList(int codePoint) { int count; if (codePoint < 0x80) count = 1; else if (codePoint < 0x800) count = 2; else if (codePoint < 0x10000) count = 3; else if (codePoint < 0x200000) count = 4; e...
[ "@", "Override", "public", "int", "[", "]", "toIdList", "(", "int", "codePoint", ")", "{", "int", "count", ";", "if", "(", "codePoint", "<", "0x80", ")", "count", "=", "1", ";", "else", "if", "(", "codePoint", "<", "0x800", ")", "count", "=", "2", ...
codes ported from iconv lib in utf8.h utf8_codepointtomb
[ "codes", "ported", "from", "iconv", "lib", "in", "utf8", ".", "h", "utf8_codepointtomb" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/trie/datrie/Utf8CharacterMapping.java#L55-L100
122,541
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java
SparseVector.normalize
void normalize() { double nrm = norm(); for (Map.Entry<Integer, Double> d : entrySet()) { d.setValue(d.getValue() / nrm); } }
java
void normalize() { double nrm = norm(); for (Map.Entry<Integer, Double> d : entrySet()) { d.setValue(d.getValue() / nrm); } }
[ "void", "normalize", "(", ")", "{", "double", "nrm", "=", "norm", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Integer", ",", "Double", ">", "d", ":", "entrySet", "(", ")", ")", "{", "d", ".", "setValue", "(", "d", ".", "getValue", "("...
Normalize a vector.
[ "Normalize", "a", "vector", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L33-L40
122,542
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java
SparseVector.multiply_constant
void multiply_constant(double x) { for (Map.Entry<Integer, Double> entry : entrySet()) { entry.setValue(entry.getValue() * x); } }
java
void multiply_constant(double x) { for (Map.Entry<Integer, Double> entry : entrySet()) { entry.setValue(entry.getValue() * x); } }
[ "void", "multiply_constant", "(", "double", "x", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Integer", ",", "Double", ">", "entry", ":", "entrySet", "(", ")", ")", "{", "entry", ".", "setValue", "(", "entry", ".", "getValue", "(", ")", "*", "x...
Multiply each value of avector by a constant value.
[ "Multiply", "each", "value", "of", "avector", "by", "a", "constant", "value", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L66-L72
122,543
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java
SparseVector.add_vector
void add_vector(SparseVector vec) { for (Map.Entry<Integer, Double> entry : vec.entrySet()) { Double v = get(entry.getKey()); if (v == null) v = 0.; put(entry.getKey(), v + entry.getValue()); } }
java
void add_vector(SparseVector vec) { for (Map.Entry<Integer, Double> entry : vec.entrySet()) { Double v = get(entry.getKey()); if (v == null) v = 0.; put(entry.getKey(), v + entry.getValue()); } }
[ "void", "add_vector", "(", "SparseVector", "vec", ")", "{", "for", "(", "Map", ".", "Entry", "<", "Integer", ",", "Double", ">", "entry", ":", "vec", ".", "entrySet", "(", ")", ")", "{", "Double", "v", "=", "get", "(", "entry", ".", "getKey", "(", ...
Add other vector.
[ "Add", "other", "vector", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L77-L87
122,544
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java
SparseVector.inner_product
static double inner_product(SparseVector vec1, SparseVector vec2) { Iterator<Map.Entry<Integer, Double>> it; SparseVector other; if (vec1.size() < vec2.size()) { it = vec1.entrySet().iterator(); other = vec2; } else { it = v...
java
static double inner_product(SparseVector vec1, SparseVector vec2) { Iterator<Map.Entry<Integer, Double>> it; SparseVector other; if (vec1.size() < vec2.size()) { it = vec1.entrySet().iterator(); other = vec2; } else { it = v...
[ "static", "double", "inner_product", "(", "SparseVector", "vec1", ",", "SparseVector", "vec2", ")", "{", "Iterator", "<", "Map", ".", "Entry", "<", "Integer", ",", "Double", ">", ">", "it", ";", "SparseVector", "other", ";", "if", "(", "vec1", ".", "size...
Calculate the inner product value between vectors.
[ "Calculate", "the", "inner", "product", "value", "between", "vectors", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L141-L162
122,545
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java
SparseVector.cosine
double cosine(SparseVector vec1, SparseVector vec2) { double norm1 = vec1.norm(); double norm2 = vec2.norm(); double result = 0.0f; if (norm1 == 0 && norm2 == 0) { return result; } else { double prod = inner_product(vec1, vec2);...
java
double cosine(SparseVector vec1, SparseVector vec2) { double norm1 = vec1.norm(); double norm2 = vec2.norm(); double result = 0.0f; if (norm1 == 0 && norm2 == 0) { return result; } else { double prod = inner_product(vec1, vec2);...
[ "double", "cosine", "(", "SparseVector", "vec1", ",", "SparseVector", "vec2", ")", "{", "double", "norm1", "=", "vec1", ".", "norm", "(", ")", ";", "double", "norm2", "=", "vec2", ".", "norm", "(", ")", ";", "double", "result", "=", "0.0f", ";", "if"...
Calculate the cosine value between vectors.
[ "Calculate", "the", "cosine", "value", "between", "vectors", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/SparseVector.java#L167-L182
122,546
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/TextFileCorpus.java
TextFileCorpus.reduceVocab
void reduceVocab() { table = new int[vocabSize]; int j = 0; for (int i = 0; i < vocabSize; i++) { if (vocab[i].cn > minReduce) { vocab[j].cn = vocab[i].cn; vocab[j].word = vocab[i].word; table[vocabIndexMap.get(v...
java
void reduceVocab() { table = new int[vocabSize]; int j = 0; for (int i = 0; i < vocabSize; i++) { if (vocab[i].cn > minReduce) { vocab[j].cn = vocab[i].cn; vocab[j].word = vocab[i].word; table[vocabIndexMap.get(v...
[ "void", "reduceVocab", "(", ")", "{", "table", "=", "new", "int", "[", "vocabSize", "]", ";", "int", "j", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vocabSize", ";", "i", "++", ")", "{", "if", "(", "vocab", "[", "i", "...
Reduces the vocabulary by removing infrequent tokens
[ "Reduces", "the", "vocabulary", "by", "removing", "infrequent", "tokens" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/TextFileCorpus.java#L42-L99
122,547
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/word2vec/TextFileCorpus.java
TextFileCorpus.readWord
String readWord(BufferedReader raf) throws IOException { while (true) { // check the buffer first if (wbp < wordsBuffer.length) { return wordsBuffer[wbp++]; } String line = raf.readLine(); if (line == null) ...
java
String readWord(BufferedReader raf) throws IOException { while (true) { // check the buffer first if (wbp < wordsBuffer.length) { return wordsBuffer[wbp++]; } String line = raf.readLine(); if (line == null) ...
[ "String", "readWord", "(", "BufferedReader", "raf", ")", "throws", "IOException", "{", "while", "(", "true", ")", "{", "// check the buffer first", "if", "(", "wbp", "<", "wordsBuffer", ".", "length", ")", "{", "return", "wordsBuffer", "[", "wbp", "++", "]",...
Reads a single word from a file, assuming space + tab + EOL to be word boundaries @param raf @return null if EOF @throws IOException
[ "Reads", "a", "single", "word", "from", "a", "file", "assuming", "space", "+", "tab", "+", "EOL", "to", "be", "word", "boundaries" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word2vec/TextFileCorpus.java#L184-L210
122,548
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java
Cluster.set_composite_vector
void set_composite_vector() { composite_.clear(); for (Document<K> document : documents_) { composite_.add_vector(document.feature()); } }
java
void set_composite_vector() { composite_.clear(); for (Document<K> document : documents_) { composite_.add_vector(document.feature()); } }
[ "void", "set_composite_vector", "(", ")", "{", "composite_", ".", "clear", "(", ")", ";", "for", "(", "Document", "<", "K", ">", "document", ":", "documents_", ")", "{", "composite_", ".", "add_vector", "(", "document", ".", "feature", "(", ")", ")", "...
Add the vectors of all documents to a composite vector.
[ "Add", "the", "vectors", "of", "all", "documents", "to", "a", "composite", "vector", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L42-L49
122,549
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java
Cluster.clear
void clear() { documents_.clear(); composite_.clear(); if (centroid_ != null) centroid_.clear(); if (sectioned_clusters_ != null) sectioned_clusters_.clear(); sectioned_gain_ = 0.0; }
java
void clear() { documents_.clear(); composite_.clear(); if (centroid_ != null) centroid_.clear(); if (sectioned_clusters_ != null) sectioned_clusters_.clear(); sectioned_gain_ = 0.0; }
[ "void", "clear", "(", ")", "{", "documents_", ".", "clear", "(", ")", ";", "composite_", ".", "clear", "(", ")", ";", "if", "(", "centroid_", "!=", "null", ")", "centroid_", ".", "clear", "(", ")", ";", "if", "(", "sectioned_clusters_", "!=", "null",...
Clear status.
[ "Clear", "status", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L54-L63
122,550
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java
Cluster.centroid_vector
SparseVector centroid_vector() { if (documents_.size() > 0 && composite_.size() == 0) set_composite_vector(); centroid_ = (SparseVector) composite_vector().clone(); centroid_.normalize(); return centroid_; }
java
SparseVector centroid_vector() { if (documents_.size() > 0 && composite_.size() == 0) set_composite_vector(); centroid_ = (SparseVector) composite_vector().clone(); centroid_.normalize(); return centroid_; }
[ "SparseVector", "centroid_vector", "(", ")", "{", "if", "(", "documents_", ".", "size", "(", ")", ">", "0", "&&", "composite_", ".", "size", "(", ")", "==", "0", ")", "set_composite_vector", "(", ")", ";", "centroid_", "=", "(", "SparseVector", ")", "c...
Get the pointer of a centroid vector. @return the pointer of a centroid vector
[ "Get", "the", "pointer", "of", "a", "centroid", "vector", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L81-L88
122,551
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java
Cluster.refresh
void refresh() { ListIterator<Document<K>> listIterator = documents_.listIterator(); while (listIterator.hasNext()) { if (listIterator.next() == null) listIterator.remove(); } }
java
void refresh() { ListIterator<Document<K>> listIterator = documents_.listIterator(); while (listIterator.hasNext()) { if (listIterator.next() == null) listIterator.remove(); } }
[ "void", "refresh", "(", ")", "{", "ListIterator", "<", "Document", "<", "K", ">>", "listIterator", "=", "documents_", ".", "listIterator", "(", ")", ";", "while", "(", "listIterator", ".", "hasNext", "(", ")", ")", "{", "if", "(", "listIterator", ".", ...
Delete removed documents from the internal container.
[ "Delete", "removed", "documents", "from", "the", "internal", "container", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L156-L164
122,552
hankcs/HanLP
src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java
Cluster.set_sectioned_gain
void set_sectioned_gain() { double gain = 0.0f; if (sectioned_gain_ == 0 && sectioned_clusters_.size() > 1) { for (Cluster<K> cluster : sectioned_clusters_) { gain += cluster.composite_vector().norm(); } gain -= composite_.norm(...
java
void set_sectioned_gain() { double gain = 0.0f; if (sectioned_gain_ == 0 && sectioned_clusters_.size() > 1) { for (Cluster<K> cluster : sectioned_clusters_) { gain += cluster.composite_vector().norm(); } gain -= composite_.norm(...
[ "void", "set_sectioned_gain", "(", ")", "{", "double", "gain", "=", "0.0f", ";", "if", "(", "sectioned_gain_", "==", "0", "&&", "sectioned_clusters_", ".", "size", "(", ")", ">", "1", ")", "{", "for", "(", "Cluster", "<", "K", ">", "cluster", ":", "s...
Set a gain when the cluster sectioned.
[ "Set", "a", "gain", "when", "the", "cluster", "sectioned", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/cluster/Cluster.java#L179-L191
122,553
hankcs/HanLP
src/main/java/com/hankcs/hanlp/model/perceptron/cli/Args.java
Args.parseOrExit
public static List<String> parseOrExit(Object target, String[] args) { try { return parse(target, args); } catch (IllegalArgumentException e) { System.err.println(e.getMessage()); Args.usage(target); System.exit(1); ...
java
public static List<String> parseOrExit(Object target, String[] args) { try { return parse(target, args); } catch (IllegalArgumentException e) { System.err.println(e.getMessage()); Args.usage(target); System.exit(1); ...
[ "public", "static", "List", "<", "String", ">", "parseOrExit", "(", "Object", "target", ",", "String", "[", "]", "args", ")", "{", "try", "{", "return", "parse", "(", "target", ",", "args", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ...
A convenience method for parsing and automatically producing error messages. @param target Either an instance or a class @param args The arguments you want to parse and populate @return The list of arguments that were not consumed
[ "A", "convenience", "method", "for", "parsing", "and", "automatically", "producing", "error", "messages", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/model/perceptron/cli/Args.java#L30-L43
122,554
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.constructWithCopy
public static Matrix constructWithCopy(double[][] A) { int m = A.length; int n = A[0].length; Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { if (A[i].length != n) { throw new IllegalArgum...
java
public static Matrix constructWithCopy(double[][] A) { int m = A.length; int n = A[0].length; Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { if (A[i].length != n) { throw new IllegalArgum...
[ "public", "static", "Matrix", "constructWithCopy", "(", "double", "[", "]", "[", "]", "A", ")", "{", "int", "m", "=", "A", ".", "length", ";", "int", "n", "=", "A", "[", "0", "]", ".", "length", ";", "Matrix", "X", "=", "new", "Matrix", "(", "m...
Construct a matrix from a copy of a 2-D array. @param A Two-dimensional array of doubles. @throws IllegalArgumentException All rows must have the same length
[ "Construct", "a", "matrix", "from", "a", "copy", "of", "a", "2", "-", "D", "array", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L199-L218
122,555
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.copy
public Matrix copy() { Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j]; } } return X; }
java
public Matrix copy() { Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j]; } } return X; }
[ "public", "Matrix", "copy", "(", ")", "{", "Matrix", "X", "=", "new", "Matrix", "(", "m", ",", "n", ")", ";", "double", "[", "]", "[", "]", "C", "=", "X", ".", "getArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "m...
Make a deep copy of a matrix
[ "Make", "a", "deep", "copy", "of", "a", "matrix" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L224-L236
122,556
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.getArrayCopy
public double[][] getArrayCopy() { double[][] C = new double[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j]; } } return C; }
java
public double[][] getArrayCopy() { double[][] C = new double[m][n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j]; } } return C; }
[ "public", "double", "[", "]", "[", "]", "getArrayCopy", "(", ")", "{", "double", "[", "]", "[", "]", "C", "=", "new", "double", "[", "m", "]", "[", "n", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "m", ";", "i", "++", ")", ...
Copy the internal two-dimensional array. @return Two-dimensional array copy of matrix elements.
[ "Copy", "the", "internal", "two", "-", "dimensional", "array", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L264-L275
122,557
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.plus
public Matrix plus(Matrix B) { checkMatrixDimensions(B); Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j] + B.A[i][j]; } } ...
java
public Matrix plus(Matrix B) { checkMatrixDimensions(B); Matrix X = new Matrix(m, n); double[][] C = X.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { C[i][j] = A[i][j] + B.A[i][j]; } } ...
[ "public", "Matrix", "plus", "(", "Matrix", "B", ")", "{", "checkMatrixDimensions", "(", "B", ")", ";", "Matrix", "X", "=", "new", "Matrix", "(", "m", ",", "n", ")", ";", "double", "[", "]", "[", "]", "C", "=", "X", ".", "getArray", "(", ")", ";...
C = A + B @param B another matrix @return A + B
[ "C", "=", "A", "+", "B" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L690-L703
122,558
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.plusEquals
public Matrix plusEquals(Matrix B) { checkMatrixDimensions(B); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { A[i][j] = A[i][j] + B.A[i][j]; } } return this; }
java
public Matrix plusEquals(Matrix B) { checkMatrixDimensions(B); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { A[i][j] = A[i][j] + B.A[i][j]; } } return this; }
[ "public", "Matrix", "plusEquals", "(", "Matrix", "B", ")", "{", "checkMatrixDimensions", "(", "B", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "m", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "n",...
A = A + B @param B another matrix @return A + B
[ "A", "=", "A", "+", "B" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L712-L723
122,559
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.trace
public double trace() { double t = 0; for (int i = 0; i < Math.min(m, n); i++) { t += A[i][i]; } return t; }
java
public double trace() { double t = 0; for (int i = 0; i < Math.min(m, n); i++) { t += A[i][i]; } return t; }
[ "public", "double", "trace", "(", ")", "{", "double", "t", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "Math", ".", "min", "(", "m", ",", "n", ")", ";", "i", "++", ")", "{", "t", "+=", "A", "[", "i", "]", "[", "i", ...
Matrix trace. @return sum of the diagonal elements.
[ "Matrix", "trace", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L977-L985
122,560
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.random
public static Matrix random(int m, int n) { Matrix A = new Matrix(m, n); double[][] X = A.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { X[i][j] = Math.random(); } } return A; }
java
public static Matrix random(int m, int n) { Matrix A = new Matrix(m, n); double[][] X = A.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { X[i][j] = Math.random(); } } return A; }
[ "public", "static", "Matrix", "random", "(", "int", "m", ",", "int", "n", ")", "{", "Matrix", "A", "=", "new", "Matrix", "(", "m", ",", "n", ")", ";", "double", "[", "]", "[", "]", "X", "=", "A", ".", "getArray", "(", ")", ";", "for", "(", ...
Generate matrix with random elements @param m Number of rows. @param n Number of colums. @return An m-by-n matrix with uniformly distributed random elements.
[ "Generate", "matrix", "with", "random", "elements" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L995-L1007
122,561
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.identity
public static Matrix identity(int m, int n) { Matrix A = new Matrix(m, n); double[][] X = A.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { X[i][j] = (i == j ? 1.0 : 0.0); } } return A; }
java
public static Matrix identity(int m, int n) { Matrix A = new Matrix(m, n); double[][] X = A.getArray(); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { X[i][j] = (i == j ? 1.0 : 0.0); } } return A; }
[ "public", "static", "Matrix", "identity", "(", "int", "m", ",", "int", "n", ")", "{", "Matrix", "A", "=", "new", "Matrix", "(", "m", ",", "n", ")", ";", "double", "[", "]", "[", "]", "X", "=", "A", ".", "getArray", "(", ")", ";", "for", "(", ...
Generate identity matrix @param m Number of rows. @param n Number of colums. @return An m-by-n matrix with ones on the diagonal and zeros elsewhere.
[ "Generate", "identity", "matrix" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L1017-L1029
122,562
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.print
public void print(int w, int d) { print(new PrintWriter(System.out, true), w, d); }
java
public void print(int w, int d) { print(new PrintWriter(System.out, true), w, d); }
[ "public", "void", "print", "(", "int", "w", ",", "int", "d", ")", "{", "print", "(", "new", "PrintWriter", "(", "System", ".", "out", ",", "true", ")", ",", "w", ",", "d", ")", ";", "}" ]
Print the matrix to stdout. Line the elements up in columns with a Fortran-like 'Fw.d' style format. @param w Column width. @param d Number of digits after the decimal.
[ "Print", "the", "matrix", "to", "stdout", ".", "Line", "the", "elements", "up", "in", "columns", "with", "a", "Fortran", "-", "like", "Fw", ".", "d", "style", "format", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L1040-L1043
122,563
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.print
public void print(PrintWriter output, int w, int d) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFractionDigits(d); ...
java
public void print(PrintWriter output, int w, int d) { DecimalFormat format = new DecimalFormat(); format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); format.setMinimumIntegerDigits(1); format.setMaximumFractionDigits(d); format.setMinimumFractionDigits(d); ...
[ "public", "void", "print", "(", "PrintWriter", "output", ",", "int", "w", ",", "int", "d", ")", "{", "DecimalFormat", "format", "=", "new", "DecimalFormat", "(", ")", ";", "format", ".", "setDecimalFormatSymbols", "(", "new", "DecimalFormatSymbols", "(", "Lo...
Print the matrix to the output stream. Line the elements up in columns with a Fortran-like 'Fw.d' style format. @param output Output stream. @param w Column width. @param d Number of digits after the decimal.
[ "Print", "the", "matrix", "to", "the", "output", "stream", ".", "Line", "the", "elements", "up", "in", "columns", "with", "a", "Fortran", "-", "like", "Fw", ".", "d", "style", "format", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L1054-L1063
122,564
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java
Matrix.print
public void print(NumberFormat format, int width) { print(new PrintWriter(System.out, true), format, width); }
java
public void print(NumberFormat format, int width) { print(new PrintWriter(System.out, true), format, width); }
[ "public", "void", "print", "(", "NumberFormat", "format", ",", "int", "width", ")", "{", "print", "(", "new", "PrintWriter", "(", "System", ".", "out", ",", "true", ")", ",", "format", ",", "width", ")", ";", "}" ]
Print the matrix to stdout. Line the elements up in columns. Use the format object, and right justify within columns of width characters. Note that is the matrix is to be read back in, you probably will want to use a NumberFormat that is set to US Locale. @param format A Formatting object for individual elements. @p...
[ "Print", "the", "matrix", "to", "stdout", ".", "Line", "the", "elements", "up", "in", "columns", ".", "Use", "the", "format", "object", "and", "right", "justify", "within", "columns", "of", "width", "characters", ".", "Note", "that", "is", "the", "matrix",...
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/nnparser/Matrix.java#L1077-L1080
122,565
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.addStrings
public final void addStrings(Collection<String> strCollection) { if (sourceNode != null) { String previousString = ""; //Add all the Strings in strCollection to the MDAG. for (String currentString : strCollection) { int mpsIndex = calc...
java
public final void addStrings(Collection<String> strCollection) { if (sourceNode != null) { String previousString = ""; //Add all the Strings in strCollection to the MDAG. for (String currentString : strCollection) { int mpsIndex = calc...
[ "public", "final", "void", "addStrings", "(", "Collection", "<", "String", ">", "strCollection", ")", "{", "if", "(", "sourceNode", "!=", "null", ")", "{", "String", "previousString", "=", "\"\"", ";", "//Add all the Strings in strCollection to the MDAG.", "for", ...
Adds a Collection of Strings to the MDAG. @param strCollection a {@link java.util.Collection} containing Strings to be added to the MDAG
[ "Adds", "a", "Collection", "of", "Strings", "to", "the", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L246-L283
122,566
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.addString
public void addString(String str) { if (sourceNode != null) { addStringInternal(str); replaceOrRegister(sourceNode, str); } else { unSimplify(); addString(str); } }
java
public void addString(String str) { if (sourceNode != null) { addStringInternal(str); replaceOrRegister(sourceNode, str); } else { unSimplify(); addString(str); } }
[ "public", "void", "addString", "(", "String", "str", ")", "{", "if", "(", "sourceNode", "!=", "null", ")", "{", "addStringInternal", "(", "str", ")", ";", "replaceOrRegister", "(", "sourceNode", ",", "str", ")", ";", "}", "else", "{", "unSimplify", "(", ...
Adds a string to the MDAG. @param str the String to be added to the MDAG
[ "Adds", "a", "string", "to", "the", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L291-L303
122,567
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.calculateSoleTransitionPathLength
private int calculateSoleTransitionPathLength(String str) { Stack<MDAGNode> transitionPathNodeStack = sourceNode.getTransitionPathNodes(str); transitionPathNodeStack.pop(); //The MDAGNode at the top of the stack is not needed //(we are processing the outgoing transitions of nodes inside str...
java
private int calculateSoleTransitionPathLength(String str) { Stack<MDAGNode> transitionPathNodeStack = sourceNode.getTransitionPathNodes(str); transitionPathNodeStack.pop(); //The MDAGNode at the top of the stack is not needed //(we are processing the outgoing transitions of nodes inside str...
[ "private", "int", "calculateSoleTransitionPathLength", "(", "String", "str", ")", "{", "Stack", "<", "MDAGNode", ">", "transitionPathNodeStack", "=", "sourceNode", ".", "getTransitionPathNodes", "(", "str", ")", ";", "transitionPathNodeStack", ".", "pop", "(", ")", ...
Calculates the length of the the sub-path in a _transition path, that is used only by a given string. @param str a String corresponding to a _transition path from sourceNode @return an int denoting the size of the sub-path in the _transition path corresponding to {@code str} that is only used by {@code str}
[ "Calculates", "the", "length", "of", "the", "the", "sub", "-", "path", "in", "a", "_transition", "path", "that", "is", "used", "only", "by", "a", "given", "string", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L333-L356
122,568
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.removeString
public void removeString(String str) { if (sourceNode != null) { //Split the _transition path corresponding to str to ensure that //any other _transition paths sharing nodes with it are not affected splitTransitionPath(sourceNode, str); //Remove from ...
java
public void removeString(String str) { if (sourceNode != null) { //Split the _transition path corresponding to str to ensure that //any other _transition paths sharing nodes with it are not affected splitTransitionPath(sourceNode, str); //Remove from ...
[ "public", "void", "removeString", "(", "String", "str", ")", "{", "if", "(", "sourceNode", "!=", "null", ")", "{", "//Split the _transition path corresponding to str to ensure that", "//any other _transition paths sharing nodes with it are not affected", "splitTransitionPath", "(...
Removes a String from the MDAG. @param str the String to be removed from the MDAG
[ "Removes", "a", "String", "from", "the", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L364-L412
122,569
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.determineLongestPrefixInMDAG
private String determineLongestPrefixInMDAG(String str) { MDAGNode currentNode = sourceNode; int numberOfChars = str.length(); int onePastPrefixEndIndex = 0; //Loop through the characters in str, using them in sequence to _transition //through the MDAG until the currently pr...
java
private String determineLongestPrefixInMDAG(String str) { MDAGNode currentNode = sourceNode; int numberOfChars = str.length(); int onePastPrefixEndIndex = 0; //Loop through the characters in str, using them in sequence to _transition //through the MDAG until the currently pr...
[ "private", "String", "determineLongestPrefixInMDAG", "(", "String", "str", ")", "{", "MDAGNode", "currentNode", "=", "sourceNode", ";", "int", "numberOfChars", "=", "str", ".", "length", "(", ")", ";", "int", "onePastPrefixEndIndex", "=", "0", ";", "//Loop throu...
Determines the longest prefix of a given String that is the prefix of another String previously added to the MDAG. @param str the String to be processed @return a String of the longest prefix of {@code str} that is also a prefix of a String contained in the MDAG
[ "Determines", "the", "longest", "prefix", "of", "a", "given", "String", "that", "is", "the", "prefix", "of", "another", "String", "previously", "added", "to", "the", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L462-L482
122,570
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.createSimpleMDAGTransitionSet
private int createSimpleMDAGTransitionSet(MDAGNode node, SimpleMDAGNode[] mdagDataArray, int onePastLastCreatedTransitionSetIndex) { int pivotIndex = onePastLastCreatedTransitionSetIndex; // node自己的位置 node.setTransitionSetBeginIndex(pivotIndex); onePastLastCreatedTransitionSetIndex += node...
java
private int createSimpleMDAGTransitionSet(MDAGNode node, SimpleMDAGNode[] mdagDataArray, int onePastLastCreatedTransitionSetIndex) { int pivotIndex = onePastLastCreatedTransitionSetIndex; // node自己的位置 node.setTransitionSetBeginIndex(pivotIndex); onePastLastCreatedTransitionSetIndex += node...
[ "private", "int", "createSimpleMDAGTransitionSet", "(", "MDAGNode", "node", ",", "SimpleMDAGNode", "[", "]", "mdagDataArray", ",", "int", "onePastLastCreatedTransitionSetIndex", ")", "{", "int", "pivotIndex", "=", "onePastLastCreatedTransitionSetIndex", ";", "// node自己的位置",...
Creates a SimpleMDAGNode version of an MDAGNode's outgoing _transition set in mdagDataArray. @param node the MDAGNode containing the _transition set to be inserted in to {@code mdagDataArray} @param mdagDataArray an array of SimpleMDAGNodes containing a subset of ...
[ "Creates", "a", "SimpleMDAGNode", "version", "of", "an", "MDAGNode", "s", "outgoing", "_transition", "set", "in", "mdagDataArray", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L723-L752
122,571
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java
MDAG.isAcceptNode
private static boolean isAcceptNode(Object nodeObj) { if (nodeObj != null) { Class nodeObjClass = nodeObj.getClass(); if (nodeObjClass.equals(MDAGNode.class)) return ((MDAGNode) nodeObj).isAcceptNode(); else if (nodeObjClass.equals(SimpleMDAGNode....
java
private static boolean isAcceptNode(Object nodeObj) { if (nodeObj != null) { Class nodeObjClass = nodeObj.getClass(); if (nodeObjClass.equals(MDAGNode.class)) return ((MDAGNode) nodeObj).isAcceptNode(); else if (nodeObjClass.equals(SimpleMDAGNode....
[ "private", "static", "boolean", "isAcceptNode", "(", "Object", "nodeObj", ")", "{", "if", "(", "nodeObj", "!=", "null", ")", "{", "Class", "nodeObjClass", "=", "nodeObj", ".", "getClass", "(", ")", ";", "if", "(", "nodeObjClass", ".", "equals", "(", "MDA...
Determines if a child node object is accepting. @param nodeObj an Object @return if {@code nodeObj} is either an MDAGNode or a SimplifiedMDAGNode, true if the node is accepting, false otherwise throws IllegalArgumentException if {@code nodeObj} is not an MDAGNode or SimplifiedMDAGNode
[ "Determines", "if", "a", "child", "node", "object", "is", "accepting", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/MDAG.java#L1054-L1068
122,572
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java
SimpleMDAGNode.transition
public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, char letter) { SimpleMDAGNode targetNode = null; int offset = binarySearch(mdagDataArray, letter); if (offset >= 0) { targetNode = mdagDataArray[offset]; } ///// return targetNode; ...
java
public SimpleMDAGNode transition(SimpleMDAGNode[] mdagDataArray, char letter) { SimpleMDAGNode targetNode = null; int offset = binarySearch(mdagDataArray, letter); if (offset >= 0) { targetNode = mdagDataArray[offset]; } ///// return targetNode; ...
[ "public", "SimpleMDAGNode", "transition", "(", "SimpleMDAGNode", "[", "]", "mdagDataArray", ",", "char", "letter", ")", "{", "SimpleMDAGNode", "targetNode", "=", "null", ";", "int", "offset", "=", "binarySearch", "(", "mdagDataArray", ",", "letter", ")", ";", ...
Follows an outgoing _transition from this node. @param mdagDataArray the array of SimpleMDAGNodes containing this node @param letter the char representation of the desired _transition's label @return the SimpleMDAGNode that is the target of the _transition labeled with {@code letter}, or null if there is no suc...
[ "Follows", "an", "outgoing", "_transition", "from", "this", "node", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java#L135-L146
122,573
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java
SimpleMDAGNode.traverseMDAG
public static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray, SimpleMDAGNode sourceNode, String str) { // char firstLetter = str.charAt(0); //Loop through the SimpleMDAGNodes in the processing MDAG's source node's _transition set, //searching for the the one with a letter (char) ...
java
public static SimpleMDAGNode traverseMDAG(SimpleMDAGNode[] mdagDataArray, SimpleMDAGNode sourceNode, String str) { // char firstLetter = str.charAt(0); //Loop through the SimpleMDAGNodes in the processing MDAG's source node's _transition set, //searching for the the one with a letter (char) ...
[ "public", "static", "SimpleMDAGNode", "traverseMDAG", "(", "SimpleMDAGNode", "[", "]", "mdagDataArray", ",", "SimpleMDAGNode", "sourceNode", ",", "String", "str", ")", "{", "// char firstLetter = str.charAt(0);", "//Loop through the SimpleMDAGNodes in the processing MDAG's...
Follows a _transition path starting from the source node of a MDAG. @param mdagDataArray the array containing the data of the MDAG to be traversed @param sourceNode the dummy SimpleMDAGNode which functions as the source of the MDAG data in {@code mdagDataArray} @param str a String corresponding to a _tran...
[ "Follows", "a", "_transition", "path", "starting", "from", "the", "source", "node", "of", "a", "MDAG", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/MDAG/SimpleMDAGNode.java#L264-L280
122,574
hankcs/HanLP
src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java
Instance.isNonprojective
public boolean isNonprojective() { for (int dep1 : goldDependencies.keySet()) { int head1 = goldDependencies.get(dep1).headIndex; for (int dep2 : goldDependencies.keySet()) { int head2 = goldDependencies.get(dep2).headIndex; if (hea...
java
public boolean isNonprojective() { for (int dep1 : goldDependencies.keySet()) { int head1 = goldDependencies.get(dep1).headIndex; for (int dep2 : goldDependencies.keySet()) { int head2 = goldDependencies.get(dep2).headIndex; if (hea...
[ "public", "boolean", "isNonprojective", "(", ")", "{", "for", "(", "int", "dep1", ":", "goldDependencies", ".", "keySet", "(", ")", ")", "{", "int", "head1", "=", "goldDependencies", ".", "get", "(", "dep1", ")", ".", "headIndex", ";", "for", "(", "int...
Shows whether the tree to train is projective or not @return true if the tree is non-projective
[ "Shows", "whether", "the", "tree", "to", "train", "is", "projective", "or", "not" ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/dependency/perceptron/transition/configuration/Instance.java#L84-L103
122,575
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java
DoubleArray.save
public void save(OutputStream stream) throws IOException { DataOutputStream out = null; try { out = new DataOutputStream(new BufferedOutputStream( stream)); for (int i = 0; i < _array.length; ++i) { out.writeInt(_array[i...
java
public void save(OutputStream stream) throws IOException { DataOutputStream out = null; try { out = new DataOutputStream(new BufferedOutputStream( stream)); for (int i = 0; i < _array.length; ++i) { out.writeInt(_array[i...
[ "public", "void", "save", "(", "OutputStream", "stream", ")", "throws", "IOException", "{", "DataOutputStream", "out", "=", "null", ";", "try", "{", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "stream", ")", ")", ";", "for...
Saves the trie data into a stream. @param stream @throws java.io.IOException
[ "Saves", "the", "trie", "data", "into", "a", "stream", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java#L91-L110
122,576
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java
DoubleArray.exactMatchSearch
public int exactMatchSearch(byte[] key) { int unit = _array[0]; int nodePos = 0; for (byte b : key) { // nodePos ^= unit.offset() ^ b nodePos ^= ((unit >>> 10) << ((unit & (1 << 9)) >>> 6)) ^ (b & 0xFF); unit = _array[nodePos]; // if (...
java
public int exactMatchSearch(byte[] key) { int unit = _array[0]; int nodePos = 0; for (byte b : key) { // nodePos ^= unit.offset() ^ b nodePos ^= ((unit >>> 10) << ((unit & (1 << 9)) >>> 6)) ^ (b & 0xFF); unit = _array[nodePos]; // if (...
[ "public", "int", "exactMatchSearch", "(", "byte", "[", "]", "key", ")", "{", "int", "unit", "=", "_array", "[", "0", "]", ";", "int", "nodePos", "=", "0", ";", "for", "(", "byte", "b", ":", "key", ")", "{", "// nodePos ^= unit.offset() ^ b", "nodePos",...
Returns the corresponding value if the key is found. Otherwise returns -1. @param key search key @return found value
[ "Returns", "the", "corresponding", "value", "if", "the", "key", "is", "found", ".", "Otherwise", "returns", "-", "1", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java#L140-L165
122,577
hankcs/HanLP
src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java
DoubleArray.commonPrefixSearch
public List<Pair<Integer, Integer>> commonPrefixSearch(byte[] key, int offset, int maxResults) { ArrayList<Pair<Integer, Integer>> result = new ArrayList<Pair<Integer, Integer>>(); i...
java
public List<Pair<Integer, Integer>> commonPrefixSearch(byte[] key, int offset, int maxResults) { ArrayList<Pair<Integer, Integer>> result = new ArrayList<Pair<Integer, Integer>>(); i...
[ "public", "List", "<", "Pair", "<", "Integer", ",", "Integer", ">", ">", "commonPrefixSearch", "(", "byte", "[", "]", "key", ",", "int", "offset", ",", "int", "maxResults", ")", "{", "ArrayList", "<", "Pair", "<", "Integer", ",", "Integer", ">", ">", ...
Returns the keys that begins with the given key and its corresponding values. The first of the returned pair represents the length of the found key. @param key @param offset @param maxResults @return found keys and values
[ "Returns", "the", "keys", "that", "begins", "with", "the", "given", "key", "and", "its", "corresponding", "values", ".", "The", "first", "of", "the", "returned", "pair", "represents", "the", "length", "of", "the", "found", "key", "." ]
a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce
https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/DoubleArray.java#L176-L210
122,578
netty/netty
codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java
RedisEncoder.writeArrayHeader
private void writeArrayHeader(ByteBufAllocator allocator, ArrayHeaderRedisMessage msg, List<Object> out) { writeArrayHeader(allocator, msg.isNull(), msg.length(), out); }
java
private void writeArrayHeader(ByteBufAllocator allocator, ArrayHeaderRedisMessage msg, List<Object> out) { writeArrayHeader(allocator, msg.isNull(), msg.length(), out); }
[ "private", "void", "writeArrayHeader", "(", "ByteBufAllocator", "allocator", ",", "ArrayHeaderRedisMessage", "msg", ",", "List", "<", "Object", ">", "out", ")", "{", "writeArrayHeader", "(", "allocator", ",", "msg", ".", "isNull", "(", ")", ",", "msg", ".", ...
Write array header only without body. Use this if you want to write arrays as streaming.
[ "Write", "array", "header", "only", "without", "body", ".", "Use", "this", "if", "you", "want", "to", "write", "arrays", "as", "streaming", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java#L167-L169
122,579
netty/netty
codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java
RedisEncoder.writeArrayMessage
private void writeArrayMessage(ByteBufAllocator allocator, ArrayRedisMessage msg, List<Object> out) { if (msg.isNull()) { writeArrayHeader(allocator, msg.isNull(), RedisConstants.NULL_VALUE, out); } else { writeArrayHeader(allocator, msg.isNull(), msg.children().size(), out); ...
java
private void writeArrayMessage(ByteBufAllocator allocator, ArrayRedisMessage msg, List<Object> out) { if (msg.isNull()) { writeArrayHeader(allocator, msg.isNull(), RedisConstants.NULL_VALUE, out); } else { writeArrayHeader(allocator, msg.isNull(), msg.children().size(), out); ...
[ "private", "void", "writeArrayMessage", "(", "ByteBufAllocator", "allocator", ",", "ArrayRedisMessage", "msg", ",", "List", "<", "Object", ">", "out", ")", "{", "if", "(", "msg", ".", "isNull", "(", ")", ")", "{", "writeArrayHeader", "(", "allocator", ",", ...
Write full constructed array message.
[ "Write", "full", "constructed", "array", "message", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-redis/src/main/java/io/netty/handler/codec/redis/RedisEncoder.java#L174-L183
122,580
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(ByteBuffer buffer) { if (!buffer.hasRemaining()) { return EMPTY_BUFFER; } if (!buffer.isDirect() && buffer.hasArray()) { return wrappedBuffer( buffer.array(), buffer.arrayOffset() + buffer.positio...
java
public static ByteBuf wrappedBuffer(ByteBuffer buffer) { if (!buffer.hasRemaining()) { return EMPTY_BUFFER; } if (!buffer.isDirect() && buffer.hasArray()) { return wrappedBuffer( buffer.array(), buffer.arrayOffset() + buffer.positio...
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "ByteBuffer", "buffer", ")", "{", "if", "(", "!", "buffer", ".", "hasRemaining", "(", ")", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "if", "(", "!", "buffer", ".", "isDirect", "(", ")", "&&", "bu...
Creates a new buffer which wraps the specified NIO buffer's current slice. A modification on the specified buffer's content will be visible to the returned buffer.
[ "Creates", "a", "new", "buffer", "which", "wraps", "the", "specified", "NIO", "buffer", "s", "current", "slice", ".", "A", "modification", "on", "the", "specified", "buffer", "s", "content", "will", "be", "visible", "to", "the", "returned", "buffer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L182-L208
122,581
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(ByteBuf buffer) { if (buffer.isReadable()) { return buffer.slice(); } else { buffer.release(); return EMPTY_BUFFER; } }
java
public static ByteBuf wrappedBuffer(ByteBuf buffer) { if (buffer.isReadable()) { return buffer.slice(); } else { buffer.release(); return EMPTY_BUFFER; } }
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "ByteBuf", "buffer", ")", "{", "if", "(", "buffer", ".", "isReadable", "(", ")", ")", "{", "return", "buffer", ".", "slice", "(", ")", ";", "}", "else", "{", "buffer", ".", "release", "(", ")", ";"...
Creates a new buffer which wraps the specified buffer's readable bytes. A modification on the specified buffer's content will be visible to the returned buffer. @param buffer The buffer to wrap. Reference count ownership of this variable is transferred to this method. @return The readable portion of the {@code buffer},...
[ "Creates", "a", "new", "buffer", "which", "wraps", "the", "specified", "buffer", "s", "readable", "bytes", ".", "A", "modification", "on", "the", "specified", "buffer", "s", "content", "will", "be", "visible", "to", "the", "returned", "buffer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L226-L233
122,582
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) { switch (buffers.length) { case 0: break; case 1: ByteBuf buffer = buffers[0]; if (buffer.isReadable()) { return wrappedBuffer(buffer.order(BIG_ENDIAN)); ...
java
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuf... buffers) { switch (buffers.length) { case 0: break; case 1: ByteBuf buffer = buffers[0]; if (buffer.isReadable()) { return wrappedBuffer(buffer.order(BIG_ENDIAN)); ...
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "int", "maxNumComponents", ",", "ByteBuf", "...", "buffers", ")", "{", "switch", "(", "buffers", ".", "length", ")", "{", "case", "0", ":", "break", ";", "case", "1", ":", "ByteBuf", "buffer", "=", "bu...
Creates a new big-endian composite buffer which wraps the readable bytes of the specified buffers without copying them. A modification on the content of the specified buffers will be visible to the returned buffer. @param maxNumComponents Advisement as to how many independent buffers are allowed to exist before consol...
[ "Creates", "a", "new", "big", "-", "endian", "composite", "buffer", "which", "wraps", "the", "readable", "bytes", "of", "the", "specified", "buffers", "without", "copying", "them", ".", "A", "modification", "on", "the", "content", "of", "the", "specified", "...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L306-L329
122,583
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.wrappedBuffer
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) { return wrappedBuffer(maxNumComponents, CompositeByteBuf.BYTE_BUFFER_WRAPPER, buffers); }
java
public static ByteBuf wrappedBuffer(int maxNumComponents, ByteBuffer... buffers) { return wrappedBuffer(maxNumComponents, CompositeByteBuf.BYTE_BUFFER_WRAPPER, buffers); }
[ "public", "static", "ByteBuf", "wrappedBuffer", "(", "int", "maxNumComponents", ",", "ByteBuffer", "...", "buffers", ")", "{", "return", "wrappedBuffer", "(", "maxNumComponents", ",", "CompositeByteBuf", ".", "BYTE_BUFFER_WRAPPER", ",", "buffers", ")", ";", "}" ]
Creates a new big-endian composite buffer which wraps the slices of the specified NIO buffers without copying them. A modification on the content of the specified buffers will be visible to the returned buffer.
[ "Creates", "a", "new", "big", "-", "endian", "composite", "buffer", "which", "wraps", "the", "slices", "of", "the", "specified", "NIO", "buffers", "without", "copying", "them", ".", "A", "modification", "on", "the", "content", "of", "the", "specified", "buff...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L336-L338
122,584
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyInt
public static ByteBuf copyInt(int value) { ByteBuf buf = buffer(4); buf.writeInt(value); return buf; }
java
public static ByteBuf copyInt(int value) { ByteBuf buf = buffer(4); buf.writeInt(value); return buf; }
[ "public", "static", "ByteBuf", "copyInt", "(", "int", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "4", ")", ";", "buf", ".", "writeInt", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 4-byte big-endian buffer that holds the specified 32-bit integer.
[ "Creates", "a", "new", "4", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "32", "-", "bit", "integer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L676-L680
122,585
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyInt
public static ByteBuf copyInt(int... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (int v: values) { buffer.writeInt(v); } return buffer; }
java
public static ByteBuf copyInt(int... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (int v: values) { buffer.writeInt(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyInt", "(", "int", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "values...
Create a big-endian buffer that holds a sequence of the specified 32-bit integers.
[ "Create", "a", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "32", "-", "bit", "integers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L685-L694
122,586
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyShort
public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; }
java
public static ByteBuf copyShort(int value) { ByteBuf buf = buffer(2); buf.writeShort(value); return buf; }
[ "public", "static", "ByteBuf", "copyShort", "(", "int", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "2", ")", ";", "buf", ".", "writeShort", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 2-byte big-endian buffer that holds the specified 16-bit integer.
[ "Creates", "a", "new", "2", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "16", "-", "bit", "integer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L699-L703
122,587
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyShort
public static ByteBuf copyShort(short... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 2); for (int v: values) { buffer.writeShort(v); } return buffer; }
java
public static ByteBuf copyShort(short... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 2); for (int v: values) { buffer.writeShort(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyShort", "(", "short", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "va...
Create a new big-endian buffer that holds a sequence of the specified 16-bit integers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "16", "-", "bit", "integers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L708-L717
122,588
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyMedium
public static ByteBuf copyMedium(int value) { ByteBuf buf = buffer(3); buf.writeMedium(value); return buf; }
java
public static ByteBuf copyMedium(int value) { ByteBuf buf = buffer(3); buf.writeMedium(value); return buf; }
[ "public", "static", "ByteBuf", "copyMedium", "(", "int", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "3", ")", ";", "buf", ".", "writeMedium", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 3-byte big-endian buffer that holds the specified 24-bit integer.
[ "Creates", "a", "new", "3", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "24", "-", "bit", "integer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L736-L740
122,589
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyMedium
public static ByteBuf copyMedium(int... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 3); for (int v: values) { buffer.writeMedium(v); } return buffer; }
java
public static ByteBuf copyMedium(int... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 3); for (int v: values) { buffer.writeMedium(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyMedium", "(", "int", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "val...
Create a new big-endian buffer that holds a sequence of the specified 24-bit integers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "24", "-", "bit", "integers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L745-L754
122,590
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyLong
public static ByteBuf copyLong(long value) { ByteBuf buf = buffer(8); buf.writeLong(value); return buf; }
java
public static ByteBuf copyLong(long value) { ByteBuf buf = buffer(8); buf.writeLong(value); return buf; }
[ "public", "static", "ByteBuf", "copyLong", "(", "long", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "8", ")", ";", "buf", ".", "writeLong", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 8-byte big-endian buffer that holds the specified 64-bit integer.
[ "Creates", "a", "new", "8", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "64", "-", "bit", "integer", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L759-L763
122,591
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyLong
public static ByteBuf copyLong(long... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 8); for (long v: values) { buffer.writeLong(v); } return buffer; }
java
public static ByteBuf copyLong(long... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 8); for (long v: values) { buffer.writeLong(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyLong", "(", "long", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "valu...
Create a new big-endian buffer that holds a sequence of the specified 64-bit integers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "64", "-", "bit", "integers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L768-L777
122,592
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyBoolean
public static ByteBuf copyBoolean(boolean value) { ByteBuf buf = buffer(1); buf.writeBoolean(value); return buf; }
java
public static ByteBuf copyBoolean(boolean value) { ByteBuf buf = buffer(1); buf.writeBoolean(value); return buf; }
[ "public", "static", "ByteBuf", "copyBoolean", "(", "boolean", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "1", ")", ";", "buf", ".", "writeBoolean", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new single-byte big-endian buffer that holds the specified boolean value.
[ "Creates", "a", "new", "single", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "boolean", "value", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L782-L786
122,593
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyBoolean
public static ByteBuf copyBoolean(boolean... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length); for (boolean v: values) { buffer.writeBoolean(v); } return buffer; }
java
public static ByteBuf copyBoolean(boolean... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length); for (boolean v: values) { buffer.writeBoolean(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyBoolean", "(", "boolean", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", ...
Create a new big-endian buffer that holds a sequence of the specified boolean values.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "boolean", "values", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L791-L800
122,594
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyFloat
public static ByteBuf copyFloat(float value) { ByteBuf buf = buffer(4); buf.writeFloat(value); return buf; }
java
public static ByteBuf copyFloat(float value) { ByteBuf buf = buffer(4); buf.writeFloat(value); return buf; }
[ "public", "static", "ByteBuf", "copyFloat", "(", "float", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "4", ")", ";", "buf", ".", "writeFloat", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 4-byte big-endian buffer that holds the specified 32-bit floating point number.
[ "Creates", "a", "new", "4", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "32", "-", "bit", "floating", "point", "number", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L805-L809
122,595
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyFloat
public static ByteBuf copyFloat(float... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (float v: values) { buffer.writeFloat(v); } return buffer; }
java
public static ByteBuf copyFloat(float... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 4); for (float v: values) { buffer.writeFloat(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyFloat", "(", "float", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "va...
Create a new big-endian buffer that holds a sequence of the specified 32-bit floating point numbers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "32", "-", "bit", "floating", "point", "numbers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L814-L823
122,596
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyDouble
public static ByteBuf copyDouble(double value) { ByteBuf buf = buffer(8); buf.writeDouble(value); return buf; }
java
public static ByteBuf copyDouble(double value) { ByteBuf buf = buffer(8); buf.writeDouble(value); return buf; }
[ "public", "static", "ByteBuf", "copyDouble", "(", "double", "value", ")", "{", "ByteBuf", "buf", "=", "buffer", "(", "8", ")", ";", "buf", ".", "writeDouble", "(", "value", ")", ";", "return", "buf", ";", "}" ]
Creates a new 8-byte big-endian buffer that holds the specified 64-bit floating point number.
[ "Creates", "a", "new", "8", "-", "byte", "big", "-", "endian", "buffer", "that", "holds", "the", "specified", "64", "-", "bit", "floating", "point", "number", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L828-L832
122,597
netty/netty
buffer/src/main/java/io/netty/buffer/Unpooled.java
Unpooled.copyDouble
public static ByteBuf copyDouble(double... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 8); for (double v: values) { buffer.writeDouble(v); } return buffer; }
java
public static ByteBuf copyDouble(double... values) { if (values == null || values.length == 0) { return EMPTY_BUFFER; } ByteBuf buffer = buffer(values.length * 8); for (double v: values) { buffer.writeDouble(v); } return buffer; }
[ "public", "static", "ByteBuf", "copyDouble", "(", "double", "...", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "length", "==", "0", ")", "{", "return", "EMPTY_BUFFER", ";", "}", "ByteBuf", "buffer", "=", "buffer", "(", "...
Create a new big-endian buffer that holds a sequence of the specified 64-bit floating point numbers.
[ "Create", "a", "new", "big", "-", "endian", "buffer", "that", "holds", "a", "sequence", "of", "the", "specified", "64", "-", "bit", "floating", "point", "numbers", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/Unpooled.java#L837-L846
122,598
netty/netty
codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java
AbstractBinaryMemcacheEncoder.encodeExtras
private static void encodeExtras(ByteBuf buf, ByteBuf extras) { if (extras == null || !extras.isReadable()) { return; } buf.writeBytes(extras); }
java
private static void encodeExtras(ByteBuf buf, ByteBuf extras) { if (extras == null || !extras.isReadable()) { return; } buf.writeBytes(extras); }
[ "private", "static", "void", "encodeExtras", "(", "ByteBuf", "buf", ",", "ByteBuf", "extras", ")", "{", "if", "(", "extras", "==", "null", "||", "!", "extras", ".", "isReadable", "(", ")", ")", "{", "return", ";", "}", "buf", ".", "writeBytes", "(", ...
Encode the extras. @param buf the {@link ByteBuf} to write into. @param extras the extras to encode.
[ "Encode", "the", "extras", "." ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-memcache/src/main/java/io/netty/handler/codec/memcache/binary/AbstractBinaryMemcacheEncoder.java#L54-L60
122,599
netty/netty
codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java
WebSocketServerHandshakerFactory.newHandshaker
public WebSocketServerHandshaker newHandshaker(HttpRequest req) { CharSequence version = req.headers().get(HttpHeaderNames.SEC_WEBSOCKET_VERSION); if (version != null) { if (version.equals(WebSocketVersion.V13.toHttpHeaderValue())) { // Version 13 of the wire protocol - RFC ...
java
public WebSocketServerHandshaker newHandshaker(HttpRequest req) { CharSequence version = req.headers().get(HttpHeaderNames.SEC_WEBSOCKET_VERSION); if (version != null) { if (version.equals(WebSocketVersion.V13.toHttpHeaderValue())) { // Version 13 of the wire protocol - RFC ...
[ "public", "WebSocketServerHandshaker", "newHandshaker", "(", "HttpRequest", "req", ")", "{", "CharSequence", "version", "=", "req", ".", "headers", "(", ")", ".", "get", "(", "HttpHeaderNames", ".", "SEC_WEBSOCKET_VERSION", ")", ";", "if", "(", "version", "!=", ...
Instances a new handshaker @return A new WebSocketServerHandshaker for the requested web socket version. Null if web socket version is not supported.
[ "Instances", "a", "new", "handshaker" ]
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java#L114-L137