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
101,300
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/AuthenticationHelper.java
AuthenticationHelper.getHttpHeaderBasic
private Map<String, String> getHttpHeaderBasic() throws Exception { return new HashMap<String, String>(){{ put("Authorization", "Basic " + getHttpHeaderBasicKey()); }}; }
java
private Map<String, String> getHttpHeaderBasic() throws Exception { return new HashMap<String, String>(){{ put("Authorization", "Basic " + getHttpHeaderBasicKey()); }}; }
[ "private", "Map", "<", "String", ",", "String", ">", "getHttpHeaderBasic", "(", ")", "throws", "Exception", "{", "return", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", "{", "{", "put", "(", "\"Authorization\"", ",", "\"Basic \"", "+", "...
gets HTTP header value with authorization string for basic authentication
[ "gets", "HTTP", "header", "value", "with", "authorization", "string", "for", "basic", "authentication" ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/AuthenticationHelper.java#L51-L56
101,301
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/AuthenticationHelper.java
AuthenticationHelper.getHttpHeaderStrong
private Map<String, String> getHttpHeaderStrong() throws Exception { final OAuthToken token = root.getOAuthTokenManager().getToken(); if (token == null || token.getAccessToken().length() == 0 || token.getTokenType().length() == 0) throw new Exception ("OAuth token is n...
java
private Map<String, String> getHttpHeaderStrong() throws Exception { final OAuthToken token = root.getOAuthTokenManager().getToken(); if (token == null || token.getAccessToken().length() == 0 || token.getTokenType().length() == 0) throw new Exception ("OAuth token is n...
[ "private", "Map", "<", "String", ",", "String", ">", "getHttpHeaderStrong", "(", ")", "throws", "Exception", "{", "final", "OAuthToken", "token", "=", "root", ".", "getOAuthTokenManager", "(", ")", ".", "getToken", "(", ")", ";", "if", "(", "token", "==", ...
gets HTTP header value with authorization string for strong authentication
[ "gets", "HTTP", "header", "value", "with", "authorization", "string", "for", "strong", "authentication" ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/AuthenticationHelper.java#L59-L69
101,302
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/Sorting.java
Sorting.addField
public void addField(String fieldName, SortDirection sortDirection) { if (sortFields == null) sortFields = new HashMap<>(); sortFields.put(fieldName, sortDirection); }
java
public void addField(String fieldName, SortDirection sortDirection) { if (sortFields == null) sortFields = new HashMap<>(); sortFields.put(fieldName, sortDirection); }
[ "public", "void", "addField", "(", "String", "fieldName", ",", "SortDirection", "sortDirection", ")", "{", "if", "(", "sortFields", "==", "null", ")", "sortFields", "=", "new", "HashMap", "<>", "(", ")", ";", "sortFields", ".", "put", "(", "fieldName", ","...
Adds field to sort by. @param fieldName Property name to sort by. @param sortDirection Sort direction.
[ "Adds", "field", "to", "sort", "by", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Sorting.java#L34-L38
101,303
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/Sorting.java
Sorting.getSortParameter
public Map<String, String> getSortParameter() { return new HashMap<String, String>() {{ put(sortUrlParameterName, getFields()); }}; }
java
public Map<String, String> getSortParameter() { return new HashMap<String, String>() {{ put(sortUrlParameterName, getFields()); }}; }
[ "public", "Map", "<", "String", ",", "String", ">", "getSortParameter", "(", ")", "{", "return", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", "{", "{", "put", "(", "sortUrlParameterName", ",", "getFields", "(", ")", ")", ";", "}", "...
Gets sort parameters. @return
[ "Gets", "sort", "parameters", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Sorting.java#L45-L50
101,304
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/UrlTool.java
UrlTool.getFullUrl
public String getFullUrl(String restUrl) { String result = ""; try { result = (new URL(root.getConfig().getBaseUrl())).getProtocol() + "://" + this.getHost() + restUrl; } catch (Exception ex) { } return result; }
java
public String getFullUrl(String restUrl) { String result = ""; try { result = (new URL(root.getConfig().getBaseUrl())).getProtocol() + "://" + this.getHost() + restUrl; } catch (Exception ex) { } return result; }
[ "public", "String", "getFullUrl", "(", "String", "restUrl", ")", "{", "String", "result", "=", "\"\"", ";", "try", "{", "result", "=", "(", "new", "URL", "(", "root", ".", "getConfig", "(", ")", ".", "getBaseUrl", "(", ")", ")", ")", ".", "getProtoco...
Gets complete url. @param restUrl Rest url. @return Complete url.
[ "Gets", "complete", "url", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/UrlTool.java#L118-L128
101,305
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/Address.java
Address.isValid
public Boolean isValid() { return addressLine1 != null || addressLine2 != null || city != null || region != null || postalCode != null || (country != null && country != CountryIso.NotSpecified); }
java
public Boolean isValid() { return addressLine1 != null || addressLine2 != null || city != null || region != null || postalCode != null || (country != null && country != CountryIso.NotSpecified); }
[ "public", "Boolean", "isValid", "(", ")", "{", "return", "addressLine1", "!=", "null", "||", "addressLine2", "!=", "null", "||", "city", "!=", "null", "||", "region", "!=", "null", "||", "postalCode", "!=", "null", "||", "(", "country", "!=", "null", "&&...
Helper method used internally. @return True if the {@link Address} details are valid.
[ "Helper", "method", "used", "internally", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Address.java#L100-L109
101,306
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/Configuration.java
Configuration.readMangopayVersion
private String readMangopayVersion() { try { Properties prop = new Properties(); InputStream input = getClass().getResourceAsStream("mangopay.properties"); prop.load(input); return prop.getProperty("version"); } catch (IOException ex) { ...
java
private String readMangopayVersion() { try { Properties prop = new Properties(); InputStream input = getClass().getResourceAsStream("mangopay.properties"); prop.load(input); return prop.getProperty("version"); } catch (IOException ex) { ...
[ "private", "String", "readMangopayVersion", "(", ")", "{", "try", "{", "Properties", "prop", "=", "new", "Properties", "(", ")", ";", "InputStream", "input", "=", "getClass", "(", ")", ".", "getResourceAsStream", "(", "\"mangopay.properties\"", ")", ";", "prop...
Read Mangopay version from mangopay properties @return String Mangopay Version
[ "Read", "Mangopay", "version", "from", "mangopay", "properties" ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Configuration.java#L134-L144
101,307
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ValidPort.java
ValidPort.ensureValid
@Override public void ensureValid(String setting, Object value) { if (null == value || !(value instanceof Integer)) { throw new ConfigException(setting, "Must be an integer."); } final Integer port = (Integer) value; if (!(port >= this.start && port <= this.end)) { throw new ConfigExcepti...
java
@Override public void ensureValid(String setting, Object value) { if (null == value || !(value instanceof Integer)) { throw new ConfigException(setting, "Must be an integer."); } final Integer port = (Integer) value; if (!(port >= this.start && port <= this.end)) { throw new ConfigExcepti...
[ "@", "Override", "public", "void", "ensureValid", "(", "String", "setting", ",", "Object", "value", ")", "{", "if", "(", "null", "==", "value", "||", "!", "(", "value", "instanceof", "Integer", ")", ")", "{", "throw", "new", "ConfigException", "(", "sett...
Method is used to validate that the supplied port is within the valid range. @param setting name of the setting being tested. @param value value being tested.
[ "Method", "is", "used", "to", "validate", "that", "the", "supplied", "port", "is", "within", "the", "valid", "range", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/ValidPort.java#L75-L88
101,308
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/recommenders/Recommenders.java
Recommenders.visibleIf
public static ConfigDef.Recommender visibleIf(String configKey, Object value) { return new VisibleIfRecommender(configKey, value, ValidValuesCallback.EMPTY); }
java
public static ConfigDef.Recommender visibleIf(String configKey, Object value) { return new VisibleIfRecommender(configKey, value, ValidValuesCallback.EMPTY); }
[ "public", "static", "ConfigDef", ".", "Recommender", "visibleIf", "(", "String", "configKey", ",", "Object", "value", ")", "{", "return", "new", "VisibleIfRecommender", "(", "configKey", ",", "value", ",", "ValidValuesCallback", ".", "EMPTY", ")", ";", "}" ]
Method is used to return a recommender that will mark a ConfigItem as visible if the configKey is set to the specified value. @param configKey The setting to retrieve the value from. @param value The expected value. @return recommender
[ "Method", "is", "used", "to", "return", "a", "recommender", "that", "will", "mark", "a", "ConfigItem", "as", "visible", "if", "the", "configKey", "is", "set", "to", "the", "specified", "value", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/recommenders/Recommenders.java#L36-L38
101,309
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/RestTool.java
RestTool.addRequestHttpHeader
public void addRequestHttpHeader(final String key, final String value) { addRequestHttpHeader(new HashMap<String, String>() {{ put(key, value); }}); }
java
public void addRequestHttpHeader(final String key, final String value) { addRequestHttpHeader(new HashMap<String, String>() {{ put(key, value); }}); }
[ "public", "void", "addRequestHttpHeader", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "addRequestHttpHeader", "(", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", "{", "{", "put", "(", "key", ",", "value", ")"...
Adds HTTP header into the request. @param key Header name. @param value Header value.
[ "Adds", "HTTP", "header", "into", "the", "request", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/RestTool.java#L88-L92
101,310
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/RestTool.java
RestTool.getHttpHeaders
private Map<String, String> getHttpHeaders(String restUrl) throws Exception { // return if already created... if (this.requestHttpHeaders != null) return this.requestHttpHeaders; // ...or initialize with default headers Map<String, String> httpHeaders = new HashMap<>(); ...
java
private Map<String, String> getHttpHeaders(String restUrl) throws Exception { // return if already created... if (this.requestHttpHeaders != null) return this.requestHttpHeaders; // ...or initialize with default headers Map<String, String> httpHeaders = new HashMap<>(); ...
[ "private", "Map", "<", "String", ",", "String", ">", "getHttpHeaders", "(", "String", "restUrl", ")", "throws", "Exception", "{", "// return if already created...", "if", "(", "this", ".", "requestHttpHeaders", "!=", "null", ")", "return", "this", ".", "requestH...
Gets HTTP header to use in request. @param restUrl The REST API URL. @return Array containing HTTP headers.
[ "Gets", "HTTP", "header", "to", "use", "in", "request", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/RestTool.java#L1023-L1041
101,311
Mangopay/mangopay2-java-sdk
src/main/java/com/mangopay/core/RestTool.java
RestTool.checkResponseCode
private void checkResponseCode(String message) throws ResponseException { if (this.responseCode != 200 && this.responseCode != 204) { HashMap<Integer, String> responseCodes = new HashMap<Integer, String>() {{ put(206, "PartialContent"); put(400, "Bad request"); ...
java
private void checkResponseCode(String message) throws ResponseException { if (this.responseCode != 200 && this.responseCode != 204) { HashMap<Integer, String> responseCodes = new HashMap<Integer, String>() {{ put(206, "PartialContent"); put(400, "Bad request"); ...
[ "private", "void", "checkResponseCode", "(", "String", "message", ")", "throws", "ResponseException", "{", "if", "(", "this", ".", "responseCode", "!=", "200", "&&", "this", ".", "responseCode", "!=", "204", ")", "{", "HashMap", "<", "Integer", ",", "String"...
Checks the HTTP response code and if it's neither 200 nor 204 throws a ResponseException. @param message Text response. @throws ResponseException If response code is other than 200 or 204.
[ "Checks", "the", "HTTP", "response", "code", "and", "if", "it", "s", "neither", "200", "nor", "204", "throws", "a", "ResponseException", "." ]
037cecb44ea62def63b507817fd9961649151157
https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/RestTool.java#L1049-L1114
101,312
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java
Parser.registerTypeParser
public final void registerTypeParser(Schema schema, TypeParser typeParser) { Preconditions.checkNotNull(schema, "schema cannot be null."); Preconditions.checkNotNull(typeParser, "typeParser cannot be null."); this.typeParsers.put(new ParserKey(schema), typeParser); }
java
public final void registerTypeParser(Schema schema, TypeParser typeParser) { Preconditions.checkNotNull(schema, "schema cannot be null."); Preconditions.checkNotNull(typeParser, "typeParser cannot be null."); this.typeParsers.put(new ParserKey(schema), typeParser); }
[ "public", "final", "void", "registerTypeParser", "(", "Schema", "schema", ",", "TypeParser", "typeParser", ")", "{", "Preconditions", ".", "checkNotNull", "(", "schema", ",", "\"schema cannot be null.\"", ")", ";", "Preconditions", ".", "checkNotNull", "(", "typePar...
Method is used to register a TypeParser for a given schema. If the schema is already registered, the new TypeParser will replace the existing one. @param schema Schema to register to. This supports any logical type by checking Schema.name() and schema.type(). @param typeParser The type parser to register for schem...
[ "Method", "is", "used", "to", "register", "a", "TypeParser", "for", "a", "given", "schema", ".", "If", "the", "schema", "is", "already", "registered", "the", "new", "TypeParser", "will", "replace", "the", "existing", "one", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java#L83-L87
101,313
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java
Parser.parseString
public Object parseString(Schema schema, String input) { checkSchemaAndInput(schema, input); if (null == input) { return null; } TypeParser parser = findParser(schema); try { Object result = parser.parseString(input, schema); return result; } catch (Exception ex) { Str...
java
public Object parseString(Schema schema, String input) { checkSchemaAndInput(schema, input); if (null == input) { return null; } TypeParser parser = findParser(schema); try { Object result = parser.parseString(input, schema); return result; } catch (Exception ex) { Str...
[ "public", "Object", "parseString", "(", "Schema", "schema", ",", "String", "input", ")", "{", "checkSchemaAndInput", "(", "schema", ",", "input", ")", ";", "if", "(", "null", "==", "input", ")", "{", "return", "null", ";", "}", "TypeParser", "parser", "=...
Method is used to parse String data to the proper Java types. @param schema Input schema to parse the String data by. @param input Java type specific to the schema supplied. @return Java type for the @throws DataException Exception is thrown when there is an exception thrown while parsing the input st...
[ "Method", "is", "used", "to", "parse", "String", "data", "to", "the", "proper", "Java", "types", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/data/Parser.java#L99-L115
101,314
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.blankOr
public static Validator blankOr(Validator validator) { Preconditions.checkNotNull(validator, "validator cannot be null."); return BlankOrValidator.of(validator); }
java
public static Validator blankOr(Validator validator) { Preconditions.checkNotNull(validator, "validator cannot be null."); return BlankOrValidator.of(validator); }
[ "public", "static", "Validator", "blankOr", "(", "Validator", "validator", ")", "{", "Preconditions", ".", "checkNotNull", "(", "validator", ",", "\"validator cannot be null.\"", ")", ";", "return", "BlankOrValidator", ".", "of", "(", "validator", ")", ";", "}" ]
Method will return a validator that will accept a blank string. Any other value will be passed on to the supplied validator. @param validator Validator to test non blank values with. @return validator that will accept a blank string. Any other value will be passed on to the supplied validator.
[ "Method", "will", "return", "a", "validator", "that", "will", "accept", "a", "blank", "string", ".", "Any", "other", "value", "will", "be", "passed", "on", "to", "the", "supplied", "validator", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L75-L78
101,315
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.validCharset
public static Validator validCharset(String... charsets) { if (null == charsets || charsets.length == 0) { return new ValidCharset(); } else { return new ValidCharset(charsets); } }
java
public static Validator validCharset(String... charsets) { if (null == charsets || charsets.length == 0) { return new ValidCharset(); } else { return new ValidCharset(charsets); } }
[ "public", "static", "Validator", "validCharset", "(", "String", "...", "charsets", ")", "{", "if", "(", "null", "==", "charsets", "||", "charsets", ".", "length", "==", "0", ")", "{", "return", "new", "ValidCharset", "(", ")", ";", "}", "else", "{", "r...
Method will return a validator that will ensure that a String or List contains a charset that is supported by the system. @param charsets The charsets that are allowed. If empty all of the available charsets on the system will be included. @return validator
[ "Method", "will", "return", "a", "validator", "that", "will", "ensure", "that", "a", "String", "or", "List", "contains", "a", "charset", "that", "is", "supported", "by", "the", "system", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L109-L115
101,316
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.validEnum
public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) { String[] ex = new String[excludes.length]; for (int i = 0; i < ex.length; i++) { ex[i] = excludes[i].toString(); } return ValidEnum.of(enumClass, ex); }
java
public static Validator validEnum(Class<? extends Enum> enumClass, Enum... excludes) { String[] ex = new String[excludes.length]; for (int i = 0; i < ex.length; i++) { ex[i] = excludes[i].toString(); } return ValidEnum.of(enumClass, ex); }
[ "public", "static", "Validator", "validEnum", "(", "Class", "<", "?", "extends", "Enum", ">", "enumClass", ",", "Enum", "...", "excludes", ")", "{", "String", "[", "]", "ex", "=", "new", "String", "[", "excludes", ".", "length", "]", ";", "for", "(", ...
Method is used to create a new INSTANCE of the enum validator. @param enumClass Enum class with the entries to validate for. @param excludes Enum entries to exclude from the validator. @return validator
[ "Method", "is", "used", "to", "create", "a", "new", "INSTANCE", "of", "the", "enum", "validator", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L134-L140
101,317
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.validHostAndPort
public static Validator validHostAndPort(Integer defaultPort, boolean requireBracketsForIPv6, boolean portRequired) { return ValidHostAndPort.of(defaultPort, requireBracketsForIPv6, portRequired); }
java
public static Validator validHostAndPort(Integer defaultPort, boolean requireBracketsForIPv6, boolean portRequired) { return ValidHostAndPort.of(defaultPort, requireBracketsForIPv6, portRequired); }
[ "public", "static", "Validator", "validHostAndPort", "(", "Integer", "defaultPort", ",", "boolean", "requireBracketsForIPv6", ",", "boolean", "portRequired", ")", "{", "return", "ValidHostAndPort", ".", "of", "(", "defaultPort", ",", "requireBracketsForIPv6", ",", "po...
Validator to ensure that a configuration setting is a hostname and port. @param defaultPort @param requireBracketsForIPv6 @param portRequired @return validator
[ "Validator", "to", "ensure", "that", "a", "configuration", "setting", "is", "a", "hostname", "and", "port", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L182-L184
101,318
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.validKeyStoreType
public static Validator validKeyStoreType() { return (s, o) -> { if (!(o instanceof String)) { throw new ConfigException(s, o, "Must be a string."); } String keyStoreType = o.toString(); try { KeyStore.getInstance(keyStoreType); } catch (KeyStoreException e) { ...
java
public static Validator validKeyStoreType() { return (s, o) -> { if (!(o instanceof String)) { throw new ConfigException(s, o, "Must be a string."); } String keyStoreType = o.toString(); try { KeyStore.getInstance(keyStoreType); } catch (KeyStoreException e) { ...
[ "public", "static", "Validator", "validKeyStoreType", "(", ")", "{", "return", "(", "s", ",", "o", ")", "->", "{", "if", "(", "!", "(", "o", "instanceof", "String", ")", ")", "{", "throw", "new", "ConfigException", "(", "s", ",", "o", ",", "\"Must be...
Validator is used to ensure that the KeyStore type specified is valid. @return
[ "Validator", "is", "used", "to", "ensure", "that", "the", "KeyStore", "type", "specified", "is", "valid", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L190-L205
101,319
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java
Validators.validKeyManagerFactory
public static Validator validKeyManagerFactory() { return (s, o) -> { if (!(o instanceof String)) { throw new ConfigException(s, o, "Must be a string."); } String keyStoreType = o.toString(); try { KeyManagerFactory.getInstance(keyStoreType); } catch (NoSuchAlgorithmEx...
java
public static Validator validKeyManagerFactory() { return (s, o) -> { if (!(o instanceof String)) { throw new ConfigException(s, o, "Must be a string."); } String keyStoreType = o.toString(); try { KeyManagerFactory.getInstance(keyStoreType); } catch (NoSuchAlgorithmEx...
[ "public", "static", "Validator", "validKeyManagerFactory", "(", ")", "{", "return", "(", "s", ",", "o", ")", "->", "{", "if", "(", "!", "(", "o", "instanceof", "String", ")", ")", "{", "throw", "new", "ConfigException", "(", "s", ",", "o", ",", "\"Mu...
Validator is used to ensure that the KeyManagerFactory Algorithm specified is valid. @return
[ "Validator", "is", "used", "to", "ensure", "that", "the", "KeyManagerFactory", "Algorithm", "specified", "is", "valid", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L211-L226
101,320
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/TaskConfigs.java
TaskConfigs.single
public static List<Map<String, String>> single(Map<String, String> settings) { Preconditions.checkNotNull(settings, "settings cannot be null."); return ImmutableList.of(settings); }
java
public static List<Map<String, String>> single(Map<String, String> settings) { Preconditions.checkNotNull(settings, "settings cannot be null."); return ImmutableList.of(settings); }
[ "public", "static", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "single", "(", "Map", "<", "String", ",", "String", ">", "settings", ")", "{", "Preconditions", ".", "checkNotNull", "(", "settings", ",", "\"settings cannot be null.\"", ")", ...
Method will create a single from the supplied settings. @param settings @return
[ "Method", "will", "create", "a", "single", "from", "the", "supplied", "settings", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/TaskConfigs.java#L32-L35
101,321
jcustenborder/connect-utils
connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/TaskConfigs.java
TaskConfigs.multiple
public static List<Map<String, String>> multiple(Map<String, String> settings, final int taskCount) { Preconditions.checkNotNull(settings, "settings cannot be null."); Preconditions.checkState(taskCount > 0, "taskCount must be greater than 0."); final List<Map<String, String>> result = new ArrayList<>(taskC...
java
public static List<Map<String, String>> multiple(Map<String, String> settings, final int taskCount) { Preconditions.checkNotNull(settings, "settings cannot be null."); Preconditions.checkState(taskCount > 0, "taskCount must be greater than 0."); final List<Map<String, String>> result = new ArrayList<>(taskC...
[ "public", "static", "List", "<", "Map", "<", "String", ",", "String", ">", ">", "multiple", "(", "Map", "<", "String", ",", "String", ">", "settings", ",", "final", "int", "taskCount", ")", "{", "Preconditions", ".", "checkNotNull", "(", "settings", ",",...
Method is used to generate a list of taskConfigs based on the supplied settings. @param settings @param taskCount @return
[ "Method", "is", "used", "to", "generate", "a", "list", "of", "taskConfigs", "based", "on", "the", "supplied", "settings", "." ]
19add138921f59ffcc85282d7aad551eeb582370
https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/TaskConfigs.java#L44-L52
101,322
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/codec/ZWaveFrameDecoder.java
ZWaveFrameDecoder.createDataFrame
private DataFrame createDataFrame(ByteBuf buf) { if (buf.readableBytes() > 3) { byte messageType = buf.getByte(buf.readerIndex() + 3); switch (messageType) { case Version.ID: return new Version(buf); case MemoryGetId.ID: ...
java
private DataFrame createDataFrame(ByteBuf buf) { if (buf.readableBytes() > 3) { byte messageType = buf.getByte(buf.readerIndex() + 3); switch (messageType) { case Version.ID: return new Version(buf); case MemoryGetId.ID: ...
[ "private", "DataFrame", "createDataFrame", "(", "ByteBuf", "buf", ")", "{", "if", "(", "buf", ".", "readableBytes", "(", ")", ">", "3", ")", "{", "byte", "messageType", "=", "buf", ".", "getByte", "(", "buf", ".", "readerIndex", "(", ")", "+", "3", "...
Creates a Z-Wave DataFrame from a ByteBuf. @param buf the buffer to process @return a DataFrame instance (or null if a valid one wasn't found)
[ "Creates", "a", "Z", "-", "Wave", "DataFrame", "from", "a", "ByteBuf", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/codec/ZWaveFrameDecoder.java#L143-L177
101,323
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/node/ZWaveNode.java
ZWaveNode.onApplicationCommand
public void onApplicationCommand(ZWaveControllerContext context, ApplicationCommand ac) { byte commandClassId = ac.getCommandClassId(); CommandClass cc = getCommandClass(commandClassId); if (cc != null) { // if it's a BasicCommandClass instance, allow the node to perform any ...
java
public void onApplicationCommand(ZWaveControllerContext context, ApplicationCommand ac) { byte commandClassId = ac.getCommandClassId(); CommandClass cc = getCommandClass(commandClassId); if (cc != null) { // if it's a BasicCommandClass instance, allow the node to perform any ...
[ "public", "void", "onApplicationCommand", "(", "ZWaveControllerContext", "context", ",", "ApplicationCommand", "ac", ")", "{", "byte", "commandClassId", "=", "ac", ".", "getCommandClassId", "(", ")", ";", "CommandClass", "cc", "=", "getCommandClass", "(", "commandCl...
Called when an application command message is received for this specific node. @param context the context for processing the command @param ac the application command received
[ "Called", "when", "an", "application", "command", "message", "is", "received", "for", "this", "specific", "node", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/node/ZWaveNode.java#L161-L192
101,324
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/node/ZWaveNode.java
ZWaveNode.onApplicationUpdate
public void onApplicationUpdate(ZWaveControllerContext context, ApplicationUpdate update) { switch (nodeState) { case NodeInfo: // if the application update failed to send, re-send it if (update.didInfoRequestFail()) { if (stateRetries < 1) { ...
java
public void onApplicationUpdate(ZWaveControllerContext context, ApplicationUpdate update) { switch (nodeState) { case NodeInfo: // if the application update failed to send, re-send it if (update.didInfoRequestFail()) { if (stateRetries < 1) { ...
[ "public", "void", "onApplicationUpdate", "(", "ZWaveControllerContext", "context", ",", "ApplicationUpdate", "update", ")", "{", "switch", "(", "nodeState", ")", "{", "case", "NodeInfo", ":", "// if the application update failed to send, re-send it", "if", "(", "update", ...
Called when an application update message is received for this node. @param context the context for processing the update @param update the application update received
[ "Called", "when", "an", "application", "update", "message", "is", "received", "for", "this", "node", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/node/ZWaveNode.java#L207-L258
101,325
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/channel/TransactionInboundHandler.java
TransactionInboundHandler.channelRead
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof Frame) { Frame frame = (Frame) msg; if (hasCurrentTransaction()) { String tid = currentDataFrameTransaction.getId(); logger.trace("Received frame within trans...
java
@Override public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof Frame) { Frame frame = (Frame) msg; if (hasCurrentTransaction()) { String tid = currentDataFrameTransaction.getId(); logger.trace("Received frame within trans...
[ "@", "Override", "public", "void", "channelRead", "(", "ChannelHandlerContext", "ctx", ",", "Object", "msg", ")", "{", "if", "(", "msg", "instanceof", "Frame", ")", "{", "Frame", "frame", "=", "(", "Frame", ")", "msg", ";", "if", "(", "hasCurrentTransactio...
Called when data is read from the Z-Wave network. @param ctx the handler context @param msg the message that was read
[ "Called", "when", "data", "is", "read", "from", "the", "Z", "-", "Wave", "network", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/channel/TransactionInboundHandler.java#L50-L82
101,326
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java
MultiInstanceCommandClass.createMultiInstanceGet
public DataFrame createMultiInstanceGet(byte nodeId, byte commandClass) { if (getVersion() > 1) { throw new ZWaveRuntimeException("MULTI_INSTANCE_GET is deprecated for command class versions > 1"); } return createSendDataFrame( "MULTI_INSTANCE_GET", nodeId, ...
java
public DataFrame createMultiInstanceGet(byte nodeId, byte commandClass) { if (getVersion() > 1) { throw new ZWaveRuntimeException("MULTI_INSTANCE_GET is deprecated for command class versions > 1"); } return createSendDataFrame( "MULTI_INSTANCE_GET", nodeId, ...
[ "public", "DataFrame", "createMultiInstanceGet", "(", "byte", "nodeId", ",", "byte", "commandClass", ")", "{", "if", "(", "getVersion", "(", ")", ">", "1", ")", "{", "throw", "new", "ZWaveRuntimeException", "(", "\"MULTI_INSTANCE_GET is deprecated for command class ve...
Create a MULTI_INSTANCE_GET command. @param nodeId the target node ID @param commandClass the command class being requested @return a DataFrame instance
[ "Create", "a", "MULTI_INSTANCE_GET", "command", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java#L234-L248
101,327
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java
MultiInstanceCommandClass.createMultiChannelEndPointGet
public DataFrame createMultiChannelEndPointGet(byte nodeId) { if (getVersion() < 2) { throw new ZWaveRuntimeException("MULTI_CHANNEL_END_POINT_GET is not available in command class version 1"); } return createSendDataFrame( "MULTI_CHANNEL_END_POINT_GET", nodeI...
java
public DataFrame createMultiChannelEndPointGet(byte nodeId) { if (getVersion() < 2) { throw new ZWaveRuntimeException("MULTI_CHANNEL_END_POINT_GET is not available in command class version 1"); } return createSendDataFrame( "MULTI_CHANNEL_END_POINT_GET", nodeI...
[ "public", "DataFrame", "createMultiChannelEndPointGet", "(", "byte", "nodeId", ")", "{", "if", "(", "getVersion", "(", ")", "<", "2", ")", "{", "throw", "new", "ZWaveRuntimeException", "(", "\"MULTI_CHANNEL_END_POINT_GET is not available in command class version 1\"", ")"...
Create a MULTI_CHANNEL_END_POINT_GET command. @param nodeId the target node ID @return a DataFrame instance
[ "Create", "a", "MULTI_CHANNEL_END_POINT_GET", "command", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java#L273-L286
101,328
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java
MultiInstanceCommandClass.createMultiChannelCapabilityGet
public DataFrame createMultiChannelCapabilityGet(byte nodeId, byte endPoint) { if (getVersion() < 2) { throw new ZWaveRuntimeException("MULTI_CHANNEL_CAPABILITY_GET is not available in command class version 1"); } return createSendDataFrame( "MULTI_CHANNEL_CAPABILITY_GET"...
java
public DataFrame createMultiChannelCapabilityGet(byte nodeId, byte endPoint) { if (getVersion() < 2) { throw new ZWaveRuntimeException("MULTI_CHANNEL_CAPABILITY_GET is not available in command class version 1"); } return createSendDataFrame( "MULTI_CHANNEL_CAPABILITY_GET"...
[ "public", "DataFrame", "createMultiChannelCapabilityGet", "(", "byte", "nodeId", ",", "byte", "endPoint", ")", "{", "if", "(", "getVersion", "(", ")", "<", "2", ")", "{", "throw", "new", "ZWaveRuntimeException", "(", "\"MULTI_CHANNEL_CAPABILITY_GET is not available in...
Create a MULTI_CHANNEL_CAPABILITY_GET command. @param nodeId the target node ID @param endPoint the endpoint ID @return a DataFrame instance
[ "Create", "a", "MULTI_CHANNEL_CAPABILITY_GET", "command", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/MultiInstanceCommandClass.java#L296-L310
101,329
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java
AbstractDataFrameTransaction.attemptResend
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { if (startFrame.getSendCount() < MAX_SEND_COUNT) { logger.debug("Transaction {} has failed - will reset and resend initial request", getId()); reset(); // if a CAN was received, then we decrement the send count...
java
boolean attemptResend(ZWaveChannelContext ctx, boolean dueToCAN) { if (startFrame.getSendCount() < MAX_SEND_COUNT) { logger.debug("Transaction {} has failed - will reset and resend initial request", getId()); reset(); // if a CAN was received, then we decrement the send count...
[ "boolean", "attemptResend", "(", "ZWaveChannelContext", "ctx", ",", "boolean", "dueToCAN", ")", "{", "if", "(", "startFrame", ".", "getSendCount", "(", ")", "<", "MAX_SEND_COUNT", ")", "{", "logger", ".", "debug", "(", "\"Transaction {} has failed - will reset and r...
Attempts to re-send the data frame that initiated this transaction. @param ctx the ChannelHandlerContext @param dueToCAN indicates whether the re-send attempt was due to a CAN frame that was received @return boolean indicating whether re-send was attempted
[ "Attempts", "to", "re", "-", "send", "the", "data", "frame", "that", "initiated", "this", "transaction", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/frame/transaction/AbstractDataFrameTransaction.java#L71-L86
101,330
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java
CommandClass.restore
public Map<String,Object> restore(PersistenceContext ctx, byte nodeId) { Map<String,Object> map = ctx.getCommandClassMap(nodeId, getId()); this.version = (int)map.get("version"); return map; }
java
public Map<String,Object> restore(PersistenceContext ctx, byte nodeId) { Map<String,Object> map = ctx.getCommandClassMap(nodeId, getId()); this.version = (int)map.get("version"); return map; }
[ "public", "Map", "<", "String", ",", "Object", ">", "restore", "(", "PersistenceContext", "ctx", ",", "byte", "nodeId", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "ctx", ".", "getCommandClassMap", "(", "nodeId", ",", "getId", "(", ...
Restores details about this command class from a persistence context. @param ctx the persistence context @param nodeId the node ID associated with this command class @return a Map with the command class properties
[ "Restores", "details", "about", "this", "command", "class", "from", "a", "persistence", "context", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java#L72-L76
101,331
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java
CommandClass.save
public Map<String,Object> save(PersistenceContext ctx, byte nodeId) { Map<String,Object> map = ctx.getCommandClassMap(nodeId, getId()); map.put("version", getVersion()); return map; }
java
public Map<String,Object> save(PersistenceContext ctx, byte nodeId) { Map<String,Object> map = ctx.getCommandClassMap(nodeId, getId()); map.put("version", getVersion()); return map; }
[ "public", "Map", "<", "String", ",", "Object", ">", "save", "(", "PersistenceContext", "ctx", ",", "byte", "nodeId", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "ctx", ".", "getCommandClassMap", "(", "nodeId", ",", "getId", "(", ")"...
Saves details about this command class to a persistence context. @param ctx the persistence context @param nodeId the node ID associated with this command class @return a Map with the command class properties
[ "Saves", "details", "about", "this", "command", "class", "to", "a", "persistence", "context", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java#L86-L90
101,332
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java
CommandClass.createSendDataFrame
static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) { return new SendData(name, nodeId, data, (byte)(SendData.TRANSMIT_OPTION_ACK | SendData.TRANSMIT_OPTION_AUTO_ROUTE), isResponseExpected); }
java
static protected DataFrame createSendDataFrame(String name, byte nodeId, byte[] data, boolean isResponseExpected) { return new SendData(name, nodeId, data, (byte)(SendData.TRANSMIT_OPTION_ACK | SendData.TRANSMIT_OPTION_AUTO_ROUTE), isResponseExpected); }
[ "static", "protected", "DataFrame", "createSendDataFrame", "(", "String", "name", ",", "byte", "nodeId", ",", "byte", "[", "]", "data", ",", "boolean", "isResponseExpected", ")", "{", "return", "new", "SendData", "(", "name", ",", "nodeId", ",", "data", ",",...
Convenience method for creating SendData frames @param name the name for logging purposes @param nodeId the destination node ID @param data the data portion of the SendData frame @param isResponseExpected indicates whether sending this data frame should require a response @return a DataFrame instance
[ "Convenience", "method", "for", "creating", "SendData", "frames" ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/CommandClass.java#L136-L138
101,333
whizzosoftware/WZWave
src/main/java/com/whizzosoftware/wzwave/commandclass/MeterCommandClass.java
MeterCommandClass.createGet
public DataFrame createGet(byte nodeId, Scale s) { switch (getVersion()) { case 1: return createSendDataFrame("METER_GET", nodeId, new byte[]{MeterCommandClass.ID, METER_GET}, true); default: { byte scale = scaleToByte(s); byte b = (byte) (...
java
public DataFrame createGet(byte nodeId, Scale s) { switch (getVersion()) { case 1: return createSendDataFrame("METER_GET", nodeId, new byte[]{MeterCommandClass.ID, METER_GET}, true); default: { byte scale = scaleToByte(s); byte b = (byte) (...
[ "public", "DataFrame", "createGet", "(", "byte", "nodeId", ",", "Scale", "s", ")", "{", "switch", "(", "getVersion", "(", ")", ")", "{", "case", "1", ":", "return", "createSendDataFrame", "(", "\"METER_GET\"", ",", "nodeId", ",", "new", "byte", "[", "]",...
Create a Get data frame. @param nodeId the target node ID @param s the scale (null for version 1) @return a DataFrame instance
[ "Create", "a", "Get", "data", "frame", "." ]
b9dfec6b55515226edf9d772a89933b336397501
https://github.com/whizzosoftware/WZWave/blob/b9dfec6b55515226edf9d772a89933b336397501/src/main/java/com/whizzosoftware/wzwave/commandclass/MeterCommandClass.java#L180-L191
101,334
iwgang/FamiliarRecyclerView
library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRecyclerView.java
FamiliarRecyclerView.setOnHeadViewBindViewHolderListener
public void setOnHeadViewBindViewHolderListener(FamiliarRecyclerView.OnHeadViewBindViewHolderListener onHeadViewBindViewHolderListener) { if (null != mWrapFamiliarRecyclerViewAdapter) { mWrapFamiliarRecyclerViewAdapter.setOnHeadViewBindViewHolderListener(onHeadViewBindViewHolderListener); } ...
java
public void setOnHeadViewBindViewHolderListener(FamiliarRecyclerView.OnHeadViewBindViewHolderListener onHeadViewBindViewHolderListener) { if (null != mWrapFamiliarRecyclerViewAdapter) { mWrapFamiliarRecyclerViewAdapter.setOnHeadViewBindViewHolderListener(onHeadViewBindViewHolderListener); } ...
[ "public", "void", "setOnHeadViewBindViewHolderListener", "(", "FamiliarRecyclerView", ".", "OnHeadViewBindViewHolderListener", "onHeadViewBindViewHolderListener", ")", "{", "if", "(", "null", "!=", "mWrapFamiliarRecyclerViewAdapter", ")", "{", "mWrapFamiliarRecyclerViewAdapter", ...
HeadView onBindViewHolder callback @param onHeadViewBindViewHolderListener OnHeadViewBindViewHolderListener
[ "HeadView", "onBindViewHolder", "callback" ]
e1254ead7ef081a7212e95921806ece6522e5f50
https://github.com/iwgang/FamiliarRecyclerView/blob/e1254ead7ef081a7212e95921806ece6522e5f50/library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRecyclerView.java#L611-L617
101,335
iwgang/FamiliarRecyclerView
library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRecyclerView.java
FamiliarRecyclerView.setOnFooterViewBindViewHolderListener
public void setOnFooterViewBindViewHolderListener(FamiliarRecyclerView.OnFooterViewBindViewHolderListener onFooterViewBindViewHolderListener) { if (null != mWrapFamiliarRecyclerViewAdapter) { mWrapFamiliarRecyclerViewAdapter.setOnFooterViewBindViewHolderListener(onFooterViewBindViewHolderListener); ...
java
public void setOnFooterViewBindViewHolderListener(FamiliarRecyclerView.OnFooterViewBindViewHolderListener onFooterViewBindViewHolderListener) { if (null != mWrapFamiliarRecyclerViewAdapter) { mWrapFamiliarRecyclerViewAdapter.setOnFooterViewBindViewHolderListener(onFooterViewBindViewHolderListener); ...
[ "public", "void", "setOnFooterViewBindViewHolderListener", "(", "FamiliarRecyclerView", ".", "OnFooterViewBindViewHolderListener", "onFooterViewBindViewHolderListener", ")", "{", "if", "(", "null", "!=", "mWrapFamiliarRecyclerViewAdapter", ")", "{", "mWrapFamiliarRecyclerViewAdapte...
FooterView onBindViewHolder callback @param onFooterViewBindViewHolderListener OnFooterViewBindViewHolderListener
[ "FooterView", "onBindViewHolder", "callback" ]
e1254ead7ef081a7212e95921806ece6522e5f50
https://github.com/iwgang/FamiliarRecyclerView/blob/e1254ead7ef081a7212e95921806ece6522e5f50/library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRecyclerView.java#L624-L630
101,336
iwgang/FamiliarRecyclerView
library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRefreshRecyclerView.java
FamiliarRefreshRecyclerView.autoRefresh
public void autoRefresh() { if (!isPullRefreshEnabled) return; setRefreshing(true); new android.os.Handler().postDelayed(new Runnable() { @Override public void run() { callOnPullRefresh(); } }, 1000); }
java
public void autoRefresh() { if (!isPullRefreshEnabled) return; setRefreshing(true); new android.os.Handler().postDelayed(new Runnable() { @Override public void run() { callOnPullRefresh(); } }, 1000); }
[ "public", "void", "autoRefresh", "(", ")", "{", "if", "(", "!", "isPullRefreshEnabled", ")", "return", ";", "setRefreshing", "(", "true", ")", ";", "new", "android", ".", "os", ".", "Handler", "(", ")", ".", "postDelayed", "(", "new", "Runnable", "(", ...
Automatic pull refresh
[ "Automatic", "pull", "refresh" ]
e1254ead7ef081a7212e95921806ece6522e5f50
https://github.com/iwgang/FamiliarRecyclerView/blob/e1254ead7ef081a7212e95921806ece6522e5f50/library/src/main/java/cn/iwgang/familiarrecyclerview/FamiliarRefreshRecyclerView.java#L75-L85
101,337
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.readRules
protected RuleSet readRules(MavenProject rootModule) throws MojoExecutionException { List<RuleSource> sources = new ArrayList<>(); PluginRepository pluginRepository = pluginRepositoryProvider.getPluginRepository(); if (rulesUrl != null) { getLog().debug("Retrieving rules from URL " +...
java
protected RuleSet readRules(MavenProject rootModule) throws MojoExecutionException { List<RuleSource> sources = new ArrayList<>(); PluginRepository pluginRepository = pluginRepositoryProvider.getPluginRepository(); if (rulesUrl != null) { getLog().debug("Retrieving rules from URL " +...
[ "protected", "RuleSet", "readRules", "(", "MavenProject", "rootModule", ")", "throws", "MojoExecutionException", "{", "List", "<", "RuleSource", ">", "sources", "=", "new", "ArrayList", "<>", "(", ")", ";", "PluginRepository", "pluginRepository", "=", "pluginReposit...
Reads the available rules from the rules directory and deployed catalogs. @return A rule set. . @throws MojoExecutionException If the rules cannot be read.
[ "Reads", "the", "available", "rules", "from", "the", "rules", "directory", "and", "deployed", "catalogs", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L268-L296
101,338
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.addRuleFiles
private void addRuleFiles(List<RuleSource> sources, File directory) throws MojoExecutionException { List<RuleSource> ruleSources = readRulesDirectory(directory); for (RuleSource ruleSource : ruleSources) { getLog().debug("Adding rules from file " + ruleSource); sources.add(ruleSo...
java
private void addRuleFiles(List<RuleSource> sources, File directory) throws MojoExecutionException { List<RuleSource> ruleSources = readRulesDirectory(directory); for (RuleSource ruleSource : ruleSources) { getLog().debug("Adding rules from file " + ruleSource); sources.add(ruleSo...
[ "private", "void", "addRuleFiles", "(", "List", "<", "RuleSource", ">", "sources", ",", "File", "directory", ")", "throws", "MojoExecutionException", "{", "List", "<", "RuleSource", ">", "ruleSources", "=", "readRulesDirectory", "(", "directory", ")", ";", "for"...
Add rules from the given directory to the list of sources. @param sources The sources. @param directory The directory. @throws MojoExecutionException On error.
[ "Add", "rules", "from", "the", "given", "directory", "to", "the", "list", "of", "sources", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L327-L333
101,339
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.readRulesDirectory
private List<RuleSource> readRulesDirectory(File rulesDirectory) throws MojoExecutionException { if (rulesDirectory.exists() && !rulesDirectory.isDirectory()) { throw new MojoExecutionException(rulesDirectory.getAbsolutePath() + " does not exist or is not a directory."); } getLog().i...
java
private List<RuleSource> readRulesDirectory(File rulesDirectory) throws MojoExecutionException { if (rulesDirectory.exists() && !rulesDirectory.isDirectory()) { throw new MojoExecutionException(rulesDirectory.getAbsolutePath() + " does not exist or is not a directory."); } getLog().i...
[ "private", "List", "<", "RuleSource", ">", "readRulesDirectory", "(", "File", "rulesDirectory", ")", "throws", "MojoExecutionException", "{", "if", "(", "rulesDirectory", ".", "exists", "(", ")", "&&", "!", "rulesDirectory", ".", "isDirectory", "(", ")", ")", ...
Retrieves the list of available rules from the rules directory. @param rulesDirectory The rules directory. @return The {@link java.util.List} of available rules {@link java.io.File}s. @throws MojoExecutionException If the rules directory cannot be read.
[ "Retrieves", "the", "list", "of", "available", "rules", "from", "the", "rules", "directory", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L343-L353
101,340
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.execute
protected void execute(StoreOperation storeOperation, MavenProject rootModule, Set<MavenProject> executedModules) throws MojoExecutionException, MojoFailureException { synchronized (cachingStoreProvider) { Store store = getStore(rootModule); if (isResetStoreBeforeExecution() ...
java
protected void execute(StoreOperation storeOperation, MavenProject rootModule, Set<MavenProject> executedModules) throws MojoExecutionException, MojoFailureException { synchronized (cachingStoreProvider) { Store store = getStore(rootModule); if (isResetStoreBeforeExecution() ...
[ "protected", "void", "execute", "(", "StoreOperation", "storeOperation", ",", "MavenProject", "rootModule", ",", "Set", "<", "MavenProject", ">", "executedModules", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "synchronized", "(", "cachingS...
Execute an operation with the store. This method enforces thread safety based on the store factory. @param storeOperation The store. @param rootModule The root module to use for store initialization. @throws MojoExecutionException On execution errors. @throws MojoFailureException On execution failures.
[ "Execute", "an", "operation", "with", "the", "store", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L365-L377
101,341
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.getExecutedModules
protected Set<MavenProject> getExecutedModules(MavenProject rootModule) { String executionKey = createExecutionKey( execution ); String executedModulesContextKey = AbstractProjectMojo.class.getName() + "#executedModules"; Map<String, Set<MavenProject>> executedProjectsPerExecutionKey = ...
java
protected Set<MavenProject> getExecutedModules(MavenProject rootModule) { String executionKey = createExecutionKey( execution ); String executedModulesContextKey = AbstractProjectMojo.class.getName() + "#executedModules"; Map<String, Set<MavenProject>> executedProjectsPerExecutionKey = ...
[ "protected", "Set", "<", "MavenProject", ">", "getExecutedModules", "(", "MavenProject", "rootModule", ")", "{", "String", "executionKey", "=", "createExecutionKey", "(", "execution", ")", ";", "String", "executedModulesContextKey", "=", "AbstractProjectMojo", ".", "c...
Determine the already executed modules for a given root module. @param rootModule The root module. @return The set of already executed modules belonging to the root module.
[ "Determine", "the", "already", "executed", "modules", "for", "a", "given", "root", "module", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L385-L400
101,342
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.getStore
private Store getStore(MavenProject rootModule) throws MojoExecutionException { StoreConfiguration configuration = getStoreConfiguration(rootModule); List<Class<?>> descriptorTypes; try { descriptorTypes = pluginRepositoryProvider.getPluginRepository().getModelPluginRepository().getD...
java
private Store getStore(MavenProject rootModule) throws MojoExecutionException { StoreConfiguration configuration = getStoreConfiguration(rootModule); List<Class<?>> descriptorTypes; try { descriptorTypes = pluginRepositoryProvider.getPluginRepository().getModelPluginRepository().getD...
[ "private", "Store", "getStore", "(", "MavenProject", "rootModule", ")", "throws", "MojoExecutionException", "{", "StoreConfiguration", "configuration", "=", "getStoreConfiguration", "(", "rootModule", ")", ";", "List", "<", "Class", "<", "?", ">", ">", "descriptorTy...
Determine the store instance to use for the given root module. @param rootModule The root module. @return The store instance. @throws MojoExecutionException If the store cannot be opened.
[ "Determine", "the", "store", "instance", "to", "use", "for", "the", "given", "root", "module", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L409-L424
101,343
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java
AbstractMojo.getEmbeddedNeo4jConfiguration
private EmbeddedNeo4jConfiguration getEmbeddedNeo4jConfiguration() { OptionHelper.verifyDeprecatedOption(PARAMETER_SERVER_ADDRESS, this.serverAddress, PARAMETER_EMBEDDED_LISTEN_ADDRESS); OptionHelper.verifyDeprecatedOption(PARAMETER_SERVER_PORT, this.serverPort, PARAMETER_EMBEDDED_HTTP_PORT); Em...
java
private EmbeddedNeo4jConfiguration getEmbeddedNeo4jConfiguration() { OptionHelper.verifyDeprecatedOption(PARAMETER_SERVER_ADDRESS, this.serverAddress, PARAMETER_EMBEDDED_LISTEN_ADDRESS); OptionHelper.verifyDeprecatedOption(PARAMETER_SERVER_PORT, this.serverPort, PARAMETER_EMBEDDED_HTTP_PORT); Em...
[ "private", "EmbeddedNeo4jConfiguration", "getEmbeddedNeo4jConfiguration", "(", ")", "{", "OptionHelper", ".", "verifyDeprecatedOption", "(", "PARAMETER_SERVER_ADDRESS", ",", "this", ".", "serverAddress", ",", "PARAMETER_EMBEDDED_LISTEN_ADDRESS", ")", ";", "OptionHelper", ".",...
Create the configuration for the embedded server.
[ "Create", "the", "configuration", "for", "the", "embedded", "server", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractMojo.java#L472-L484
101,344
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java
ProjectResolver.getProjects
static Map<MavenProject, List<MavenProject>> getProjects(List<MavenProject> reactorProjects, String rulesDirectory, boolean useExecutionRootAsProjectRoot) throws MojoExecutionException { Map<MavenProject, List<MavenProject>> rootModules = new HashMap<...
java
static Map<MavenProject, List<MavenProject>> getProjects(List<MavenProject> reactorProjects, String rulesDirectory, boolean useExecutionRootAsProjectRoot) throws MojoExecutionException { Map<MavenProject, List<MavenProject>> rootModules = new HashMap<...
[ "static", "Map", "<", "MavenProject", ",", "List", "<", "MavenProject", ">", ">", "getProjects", "(", "List", "<", "MavenProject", ">", "reactorProjects", ",", "String", "rulesDirectory", ",", "boolean", "useExecutionRootAsProjectRoot", ")", "throws", "MojoExecution...
Aggregate projects to their base projects @param reactorProjects The current reactor projects. @param rulesDirectory The configured rules directory. @param useExecutionRootAsProjectRoot <code>true</code> if the execution root shall be used as project root. @return A map containing resolved...
[ "Aggregate", "projects", "to", "their", "base", "projects" ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java#L96-L110
101,345
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java
ProjectResolver.getRulesDirectory
static File getRulesDirectory(MavenProject rootModule, String rulesDirectory) { File rules = new File(rulesDirectory); return rules.isAbsolute() ? rules : new File(rootModule.getBasedir().getAbsolutePath() + File.separator + rulesDirectory); }
java
static File getRulesDirectory(MavenProject rootModule, String rulesDirectory) { File rules = new File(rulesDirectory); return rules.isAbsolute() ? rules : new File(rootModule.getBasedir().getAbsolutePath() + File.separator + rulesDirectory); }
[ "static", "File", "getRulesDirectory", "(", "MavenProject", "rootModule", ",", "String", "rulesDirectory", ")", "{", "File", "rules", "=", "new", "File", "(", "rulesDirectory", ")", ";", "return", "rules", ".", "isAbsolute", "(", ")", "?", "rules", ":", "new...
Returns the directory containing rules. @param rootModule The root module of the project. @param rulesDirectory The name of the directory used for identifying the root module. @return The file representing the directory.
[ "Returns", "the", "directory", "containing", "rules", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java#L130-L133
101,346
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java
ProjectResolver.getOutputDirectory
static File getOutputDirectory(MavenProject rootModule) { String directoryName = rootModule.getBuild().getDirectory() + "/" + OUTPUT_DIRECTORY; File directory = new File(directoryName); directory.mkdirs(); return directory; }
java
static File getOutputDirectory(MavenProject rootModule) { String directoryName = rootModule.getBuild().getDirectory() + "/" + OUTPUT_DIRECTORY; File directory = new File(directoryName); directory.mkdirs(); return directory; }
[ "static", "File", "getOutputDirectory", "(", "MavenProject", "rootModule", ")", "{", "String", "directoryName", "=", "rootModule", ".", "getBuild", "(", ")", ".", "getDirectory", "(", ")", "+", "\"/\"", "+", "OUTPUT_DIRECTORY", ";", "File", "directory", "=", "...
Determines the directory for writing output files. @param rootModule The root module of the project. @return The report directory.
[ "Determines", "the", "directory", "for", "writing", "output", "files", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java#L141-L146
101,347
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java
ProjectResolver.getOutputFile
static File getOutputFile(MavenProject rootModule, File reportFile, String defaultFile) throws MojoExecutionException { File selectedXmlReportFile; if (reportFile != null) { selectedXmlReportFile = reportFile; } else if (rootModule != null) { selectedXmlReportFile = new F...
java
static File getOutputFile(MavenProject rootModule, File reportFile, String defaultFile) throws MojoExecutionException { File selectedXmlReportFile; if (reportFile != null) { selectedXmlReportFile = reportFile; } else if (rootModule != null) { selectedXmlReportFile = new F...
[ "static", "File", "getOutputFile", "(", "MavenProject", "rootModule", ",", "File", "reportFile", ",", "String", "defaultFile", ")", "throws", "MojoExecutionException", "{", "File", "selectedXmlReportFile", ";", "if", "(", "reportFile", "!=", "null", ")", "{", "sel...
Determines a report file name. @param rootModule The base project. @param reportFile The report file as specified in the pom.xml file or on the command line. @return The resolved {@link java.io.File}. @throws MojoExecutionException If the file cannot be determined.
[ "Determines", "a", "report", "file", "name", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ProjectResolver.java#L156-L166
101,348
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java
ScanMojo.getPluginProperties
protected Map<String, Object> getPluginProperties() { Map<String, Object> properties = new HashMap<>(); if (scanProperties != null) { properties.putAll(scanProperties); } properties.put(ScanInclude.class.getName(), scanIncludes); return properties; }
java
protected Map<String, Object> getPluginProperties() { Map<String, Object> properties = new HashMap<>(); if (scanProperties != null) { properties.putAll(scanProperties); } properties.put(ScanInclude.class.getName(), scanIncludes); return properties; }
[ "protected", "Map", "<", "String", ",", "Object", ">", "getPluginProperties", "(", ")", "{", "Map", "<", "String", ",", "Object", ">", "properties", "=", "new", "HashMap", "<>", "(", ")", ";", "if", "(", "scanProperties", "!=", "null", ")", "{", "prope...
Return the plugin properties. @return The plugin properties.
[ "Return", "the", "plugin", "properties", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java#L82-L89
101,349
buschmais/jqa-maven-plugin
src/main/java/com/buschmais/jqassistant/scm/maven/AbstractProjectMojo.java
AbstractProjectMojo.isLastModuleInProject
private boolean isLastModuleInProject(Set<MavenProject> executedModules, List<MavenProject> projectModules) { Set<MavenProject> remainingModules = new HashSet<>(); if (execution.getPlugin().getExecutions().isEmpty()) { getLog().debug("No configured executions found, assuming CLI invocation."...
java
private boolean isLastModuleInProject(Set<MavenProject> executedModules, List<MavenProject> projectModules) { Set<MavenProject> remainingModules = new HashSet<>(); if (execution.getPlugin().getExecutions().isEmpty()) { getLog().debug("No configured executions found, assuming CLI invocation."...
[ "private", "boolean", "isLastModuleInProject", "(", "Set", "<", "MavenProject", ">", "executedModules", ",", "List", "<", "MavenProject", ">", "projectModules", ")", "{", "Set", "<", "MavenProject", ">", "remainingModules", "=", "new", "HashSet", "<>", "(", ")",...
Determines if the last module for a project is currently executed. @param projectModules The modules of the project. @return <code>true</code> if the current module is the last of the project.
[ "Determines", "if", "the", "last", "module", "for", "a", "project", "is", "currently", "executed", "." ]
5c21a8058fc1b013333081907fbf00d3525e11c3
https://github.com/buschmais/jqa-maven-plugin/blob/5c21a8058fc1b013333081907fbf00d3525e11c3/src/main/java/com/buschmais/jqassistant/scm/maven/AbstractProjectMojo.java#L45-L73
101,350
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java
SimplePBKDF2.deriveKeyFormatted
public String deriveKeyFormatted(String inputPassword) { PBKDF2Parameters p = getParameters(); byte[] salt = generateSalt(); p.setSalt(salt); p.setDerivedKey(deriveKey(inputPassword)); String formatted = getFormatter().toString(p); return formatted; }
java
public String deriveKeyFormatted(String inputPassword) { PBKDF2Parameters p = getParameters(); byte[] salt = generateSalt(); p.setSalt(salt); p.setDerivedKey(deriveKey(inputPassword)); String formatted = getFormatter().toString(p); return formatted; }
[ "public", "String", "deriveKeyFormatted", "(", "String", "inputPassword", ")", "{", "PBKDF2Parameters", "p", "=", "getParameters", "(", ")", ";", "byte", "[", "]", "salt", "=", "generateSalt", "(", ")", ";", "p", ".", "setSalt", "(", "salt", ")", ";", "p...
Derive key from password, then format. @param inputPassword The password to derive key from. @return &quot;salt:iteration-count:derived-key&quot; (depends on effective formatter)
[ "Derive", "key", "from", "password", "then", "format", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java#L119-L126
101,351
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java
SimplePBKDF2.verifyKeyFormatted
public boolean verifyKeyFormatted(String formatted, String candidatePassword) { // Parameter as member of Engine was not the smartest design decision back then... PBKDF2Parameters p = getParameters(); PBKDF2Parameters q = new PBKDF2Parameters(); q.hashAlgorithm = p.hashAlgorithm; q.hashCharset = p.hashCharse...
java
public boolean verifyKeyFormatted(String formatted, String candidatePassword) { // Parameter as member of Engine was not the smartest design decision back then... PBKDF2Parameters p = getParameters(); PBKDF2Parameters q = new PBKDF2Parameters(); q.hashAlgorithm = p.hashAlgorithm; q.hashCharset = p.hashCharse...
[ "public", "boolean", "verifyKeyFormatted", "(", "String", "formatted", ",", "String", "candidatePassword", ")", "{", "// Parameter as member of Engine was not the smartest design decision back then...", "PBKDF2Parameters", "p", "=", "getParameters", "(", ")", ";", "PBKDF2Parame...
Verification function. @param formatted &quot;salt:iteration-count:derived-key&quot; (depends on effective formatter). This value should come from server-side storage. @param candidatePassword The password that is checked against the formatted reference data. This value will usually be supplied by the &quot;user&quot;...
[ "Verification", "function", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/SimplePBKDF2.java#L154-L170
101,352
m9aertner/PBKDF2
src/jboss/java/de/rtner/security/auth/spi/SaltedDatabaseServerLoginModule.java
SaltedDatabaseServerLoginModule.validatePassword
@Override protected boolean validatePassword(String inputPassword, String expectedPassword) { boolean verifyOK = false; for(;;) { // single point of exit if (inputPassword == null || expectedPassword == null) { break; } PBKDF2Parameters p = getEngineParameters(); ...
java
@Override protected boolean validatePassword(String inputPassword, String expectedPassword) { boolean verifyOK = false; for(;;) { // single point of exit if (inputPassword == null || expectedPassword == null) { break; } PBKDF2Parameters p = getEngineParameters(); ...
[ "@", "Override", "protected", "boolean", "validatePassword", "(", "String", "inputPassword", ",", "String", "expectedPassword", ")", "{", "boolean", "verifyOK", "=", "false", ";", "for", "(", ";", ";", ")", "{", "// single point of exit", "if", "(", "inputPasswo...
Actual salt-enabled verification function. Get parameters from database 'password', then compute candidate derived key from user-supplied password and parameters, then compare database derived key and candidate derived key. Login if match. @param inputPassword Password that was supplied by user (candidate password) @p...
[ "Actual", "salt", "-", "enabled", "verification", "function", ".", "Get", "parameters", "from", "database", "password", "then", "compute", "candidate", "derived", "key", "from", "user", "-", "supplied", "password", "and", "parameters", "then", "compare", "database...
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/jboss/java/de/rtner/security/auth/spi/SaltedDatabaseServerLoginModule.java#L161-L191
101,353
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java
PBKDF2Engine.PBKDF2
protected byte[] PBKDF2(PRF prf, byte[] S, int c, int dkLen) { if (S == null) { S = new byte[0]; } int hLen = prf.getHLen(); int l = ceil(dkLen, hLen); int r = dkLen - (l - 1) * hLen; byte T[] = new byte[l * hLen]; int ti_offset = 0; ...
java
protected byte[] PBKDF2(PRF prf, byte[] S, int c, int dkLen) { if (S == null) { S = new byte[0]; } int hLen = prf.getHLen(); int l = ceil(dkLen, hLen); int r = dkLen - (l - 1) * hLen; byte T[] = new byte[l * hLen]; int ti_offset = 0; ...
[ "protected", "byte", "[", "]", "PBKDF2", "(", "PRF", "prf", ",", "byte", "[", "]", "S", ",", "int", "c", ",", "int", "dkLen", ")", "{", "if", "(", "S", "==", "null", ")", "{", "S", "=", "new", "byte", "[", "0", "]", ";", "}", "int", "hLen",...
Core Password Based Key Derivation Function 2. @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2</a> @param prf Pseudo Random Function (i.e. HmacSHA1) @param S Salt as array of bytes. <code>null</code> means no salt. @param c Iteration count (see RFC 2898 4.2) @param dkLen desired length of derived key. @...
[ "Core", "Password", "Based", "Key", "Derivation", "Function", "2", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java#L206-L230
101,354
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java
PBKDF2Engine.ceil
protected int ceil(int a, int b) { int m = 0; if (a % b > 0) { m = 1; } return a / b + m; }
java
protected int ceil(int a, int b) { int m = 0; if (a % b > 0) { m = 1; } return a / b + m; }
[ "protected", "int", "ceil", "(", "int", "a", ",", "int", "b", ")", "{", "int", "m", "=", "0", ";", "if", "(", "a", "%", "b", ">", "0", ")", "{", "m", "=", "1", ";", "}", "return", "a", "/", "b", "+", "m", ";", "}" ]
Integer division with ceiling function. @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step 2.</a> @param a Numerator @param b Denominator @return ceil(a/b)
[ "Integer", "division", "with", "ceiling", "function", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java#L240-L248
101,355
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java
PBKDF2Engine._F
protected void _F(byte[] dest, int offset, PRF prf, byte[] S, int c, int blockIndex) { int hLen = prf.getHLen(); byte U_r[] = new byte[hLen]; // U0 = S || INT (i); byte U_i[] = new byte[S.length + 4]; System.arraycopy(S, 0, U_i, 0, S.length); INT(U_i, S.l...
java
protected void _F(byte[] dest, int offset, PRF prf, byte[] S, int c, int blockIndex) { int hLen = prf.getHLen(); byte U_r[] = new byte[hLen]; // U0 = S || INT (i); byte U_i[] = new byte[S.length + 4]; System.arraycopy(S, 0, U_i, 0, S.length); INT(U_i, S.l...
[ "protected", "void", "_F", "(", "byte", "[", "]", "dest", ",", "int", "offset", ",", "PRF", "prf", ",", "byte", "[", "]", "S", ",", "int", "c", ",", "int", "blockIndex", ")", "{", "int", "hLen", "=", "prf", ".", "getHLen", "(", ")", ";", "byte"...
Function F. @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step 3.</a> @param dest Destination byte buffer @param offset Offset into destination byte buffer @param prf Pseudo Random Function @param S Salt as array of bytes @param c Iteration count @param blockIndex The block index (&gt;= 1).
[ "Function", "F", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java#L267-L284
101,356
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java
PBKDF2Engine.xor
protected void xor(byte[] dest, byte[] src) { for (int i = 0; i < dest.length; i++) { dest[i] ^= src[i]; } }
java
protected void xor(byte[] dest, byte[] src) { for (int i = 0; i < dest.length; i++) { dest[i] ^= src[i]; } }
[ "protected", "void", "xor", "(", "byte", "[", "]", "dest", ",", "byte", "[", "]", "src", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dest", ".", "length", ";", "i", "++", ")", "{", "dest", "[", "i", "]", "^=", "src", "[", ...
Block-Xor. Xor source bytes into destination byte buffer. Destination buffer must be same length or less than source buffer. @param dest destination byte buffer @param src source bytes
[ "Block", "-", "Xor", ".", "Xor", "source", "bytes", "into", "destination", "byte", "buffer", ".", "Destination", "buffer", "must", "be", "same", "length", "or", "less", "than", "source", "buffer", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java#L293-L299
101,357
m9aertner/PBKDF2
src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java
PBKDF2Engine.INT
protected void INT(byte[] dest, int offset, int i) { dest[offset + 0] = (byte) (i / (256 * 256 * 256)); dest[offset + 1] = (byte) (i / (256 * 256)); dest[offset + 2] = (byte) (i / (256)); dest[offset + 3] = (byte) (i); }
java
protected void INT(byte[] dest, int offset, int i) { dest[offset + 0] = (byte) (i / (256 * 256 * 256)); dest[offset + 1] = (byte) (i / (256 * 256)); dest[offset + 2] = (byte) (i / (256)); dest[offset + 3] = (byte) (i); }
[ "protected", "void", "INT", "(", "byte", "[", "]", "dest", ",", "int", "offset", ",", "int", "i", ")", "{", "dest", "[", "offset", "+", "0", "]", "=", "(", "byte", ")", "(", "i", "/", "(", "256", "*", "256", "*", "256", ")", ")", ";", "dest...
Four-octet encoding of the integer i, most significant octet first. @see <a href="http://tools.ietf.org/html/rfc2898">RFC 2898 5.2 Step 3.</a> @param dest destination byte buffer @param offset zero-based offset into dest @param i the integer to encode
[ "Four", "-", "octet", "encoding", "of", "the", "integer", "i", "most", "significant", "octet", "first", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/security/auth/spi/PBKDF2Engine.java#L309-L315
101,358
m9aertner/PBKDF2
src/main/java/de/rtner/misc/BinTools.java
BinTools.bin2hex
public static String bin2hex(final byte[] b) { if (b == null) { return ""; } StringBuffer sb = new StringBuffer(2 * b.length); for (int i = 0; i < b.length; i++) { int v = (256 + b[i]) % 256; sb.append(hex.charAt((v / 16) & 15)); ...
java
public static String bin2hex(final byte[] b) { if (b == null) { return ""; } StringBuffer sb = new StringBuffer(2 * b.length); for (int i = 0; i < b.length; i++) { int v = (256 + b[i]) % 256; sb.append(hex.charAt((v / 16) & 15)); ...
[ "public", "static", "String", "bin2hex", "(", "final", "byte", "[", "]", "b", ")", "{", "if", "(", "b", "==", "null", ")", "{", "return", "\"\"", ";", "}", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "2", "*", "b", ".", "length", ")", ...
Simple binary-to-hexadecimal conversion. @param b Input bytes. May be <code>null</code>. @return Hexadecimal representation of b. Uppercase A-F, two characters per byte. Empty string on <code>null</code> input.
[ "Simple", "binary", "-", "to", "-", "hexadecimal", "conversion", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/misc/BinTools.java#L39-L53
101,359
m9aertner/PBKDF2
src/main/java/de/rtner/misc/BinTools.java
BinTools.hex2bin
public static byte[] hex2bin(final String s) { String m = s; if (s == null) { // Allow empty input string. m = ""; } else if (s.length() % 2 != 0) { // Assume leading zero for odd string length m = "0" + s; } ...
java
public static byte[] hex2bin(final String s) { String m = s; if (s == null) { // Allow empty input string. m = ""; } else if (s.length() % 2 != 0) { // Assume leading zero for odd string length m = "0" + s; } ...
[ "public", "static", "byte", "[", "]", "hex2bin", "(", "final", "String", "s", ")", "{", "String", "m", "=", "s", ";", "if", "(", "s", "==", "null", ")", "{", "// Allow empty input string.", "m", "=", "\"\"", ";", "}", "else", "if", "(", "s", ".", ...
Convert hex string to array of bytes. @param s String containing hexadecimal digits. May be <code>null</code>. On odd length leading zero will be assumed. @return Array on bytes, non-<code>null</code>. @throws IllegalArgumentException when string contains non-hex character
[ "Convert", "hex", "string", "to", "array", "of", "bytes", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/misc/BinTools.java#L65-L86
101,360
m9aertner/PBKDF2
src/main/java/de/rtner/misc/BinTools.java
BinTools.hex2bin
public static int hex2bin(char c) { if (c >= '0' && c <= '9') { return (c - '0'); } if (c >= 'A' && c <= 'F') { return (c - 'A' + 10); } if (c >= 'a' && c <= 'f') { return (c - 'a' + 10); } throw new ...
java
public static int hex2bin(char c) { if (c >= '0' && c <= '9') { return (c - '0'); } if (c >= 'A' && c <= 'F') { return (c - 'A' + 10); } if (c >= 'a' && c <= 'f') { return (c - 'a' + 10); } throw new ...
[ "public", "static", "int", "hex2bin", "(", "char", "c", ")", "{", "if", "(", "c", ">=", "'", "'", "&&", "c", "<=", "'", "'", ")", "{", "return", "(", "c", "-", "'", "'", ")", ";", "}", "if", "(", "c", ">=", "'", "'", "&&", "c", "<=", "'...
Convert hex digit to numerical value. @param c 0-9, a-f, A-F allowd. @return 0-15 @throws IllegalArgumentException on non-hex character
[ "Convert", "hex", "digit", "to", "numerical", "value", "." ]
b84511bb78848106c0f778136d9f01870c957722
https://github.com/m9aertner/PBKDF2/blob/b84511bb78848106c0f778136d9f01870c957722/src/main/java/de/rtner/misc/BinTools.java#L97-L114
101,361
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java
AMRulesAggregatorProcessor.processInstanceEvent
private void processInstanceEvent(InstanceContentEvent instanceEvent) { Instance instance = instanceEvent.getInstance(); boolean predictionCovered = false; boolean trainingCovered = false; boolean continuePrediction = instanceEvent.isTesting(); boolean continueTraining = instanceEvent.isTraining(); Error...
java
private void processInstanceEvent(InstanceContentEvent instanceEvent) { Instance instance = instanceEvent.getInstance(); boolean predictionCovered = false; boolean trainingCovered = false; boolean continuePrediction = instanceEvent.isTesting(); boolean continueTraining = instanceEvent.isTraining(); Error...
[ "private", "void", "processInstanceEvent", "(", "InstanceContentEvent", "instanceEvent", ")", "{", "Instance", "instance", "=", "instanceEvent", ".", "getInstance", "(", ")", ";", "boolean", "predictionCovered", "=", "false", ";", "boolean", "trainingCovered", "=", ...
Merge predict and train so we only check for covering rules one time
[ "Merge", "predict", "and", "train", "so", "we", "only", "check", "for", "covering", "rules", "one", "time" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java#L144-L210
101,362
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java
AMRulesAggregatorProcessor.newResultContentEvent
private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent){ ResultContentEvent rce = new ResultContentEvent(inEvent.getInstanceIndex(), inEvent.getInstance(), inEvent.getClassId(), prediction, inEvent.isLastEvent()); rce.setClassifierIndex(this.processorId); rce.setEvaluat...
java
private ResultContentEvent newResultContentEvent(double[] prediction, InstanceContentEvent inEvent){ ResultContentEvent rce = new ResultContentEvent(inEvent.getInstanceIndex(), inEvent.getInstance(), inEvent.getClassId(), prediction, inEvent.isLastEvent()); rce.setClassifierIndex(this.processorId); rce.setEvaluat...
[ "private", "ResultContentEvent", "newResultContentEvent", "(", "double", "[", "]", "prediction", ",", "InstanceContentEvent", "inEvent", ")", "{", "ResultContentEvent", "rce", "=", "new", "ResultContentEvent", "(", "inEvent", ".", "getInstanceIndex", "(", ")", ",", ...
Helper method to generate new ResultContentEvent based on an instance and its prediction result. @param prediction The predicted class label from the decision tree model. @param inEvent The associated instance content event @return ResultContentEvent to be sent into Evaluator PI or other destination PI.
[ "Helper", "method", "to", "generate", "new", "ResultContentEvent", "based", "on", "an", "instance", "and", "its", "prediction", "result", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java#L219-L224
101,363
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/ClustreamClustererAdapter.java
ClustreamClustererAdapter.getVotesForInstance
@Override public double[] getVotesForInstance(Instance inst) { double[] ret; inst.setDataset(dataset); if (this.isInit == false) { ret = new double[dataset.numClasses()]; } else { ret = learner.getVotesForInstance(inst); } return ret; }
java
@Override public double[] getVotesForInstance(Instance inst) { double[] ret; inst.setDataset(dataset); if (this.isInit == false) { ret = new double[dataset.numClasses()]; } else { ret = learner.getVotesForInstance(inst); } return ret; }
[ "@", "Override", "public", "double", "[", "]", "getVotesForInstance", "(", "Instance", "inst", ")", "{", "double", "[", "]", "ret", ";", "inst", ".", "setDataset", "(", "dataset", ")", ";", "if", "(", "this", ".", "isInit", "==", "false", ")", "{", "...
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements must be all zero. @param inst the instance to be classified @return an array containing the estimated membership probabilities of the test instance in each class
[ "Predicts", "the", "class", "memberships", "for", "a", "given", "instance", ".", "If", "an", "instance", "is", "unclassified", "the", "returned", "array", "elements", "must", "be", "all", "zero", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/ClustreamClustererAdapter.java#L132-L142
101,364
YahooArchive/samoa
samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4ProcessingItem.java
S4ProcessingItem.getKeyFinder
private KeyFinder<S4Event> getKeyFinder() { KeyFinder<S4Event> keyFinder = new KeyFinder<S4Event>() { @Override public List<String> get(S4Event s4event) { List<String> results = new ArrayList<String>(); results.add(s4event.getKey()); return results; } }; return keyFinder; }
java
private KeyFinder<S4Event> getKeyFinder() { KeyFinder<S4Event> keyFinder = new KeyFinder<S4Event>() { @Override public List<String> get(S4Event s4event) { List<String> results = new ArrayList<String>(); results.add(s4event.getKey()); return results; } }; return keyFinder; }
[ "private", "KeyFinder", "<", "S4Event", ">", "getKeyFinder", "(", ")", "{", "KeyFinder", "<", "S4Event", ">", "keyFinder", "=", "new", "KeyFinder", "<", "S4Event", ">", "(", ")", "{", "@", "Override", "public", "List", "<", "String", ">", "get", "(", "...
KeyFinder sets the keys for a specific event. @return KeyFinder
[ "KeyFinder", "sets", "the", "keys", "for", "a", "specific", "event", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4ProcessingItem.java#L123-L134
101,365
YahooArchive/samoa
samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4ProcessingItem.java
S4ProcessingItem.onCreate
@Override protected void onCreate() { logger.debug("PE ID {}", getId()); if (this.processor != null) { this.processor = this.processor.newProcessor(this.processor); this.processor.onCreate(Integer.parseInt(getId())); } }
java
@Override protected void onCreate() { logger.debug("PE ID {}", getId()); if (this.processor != null) { this.processor = this.processor.newProcessor(this.processor); this.processor.onCreate(Integer.parseInt(getId())); } }
[ "@", "Override", "protected", "void", "onCreate", "(", ")", "{", "logger", ".", "debug", "(", "\"PE ID {}\"", ",", "getId", "(", ")", ")", ";", "if", "(", "this", ".", "processor", "!=", "null", ")", "{", "this", ".", "processor", "=", "this", ".", ...
Methods from ProcessingElement
[ "Methods", "from", "ProcessingElement" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-s4/src/main/java/com/yahoo/labs/samoa/topology/impl/S4ProcessingItem.java#L170-L177
101,366
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/moa/options/OptionsHandler.java
OptionsHandler.getPreparedClassOption
public Object getPreparedClassOption(ClassOption opt) { if (this.classOptionNamesToPreparedObjects == null) { this.prepareForUse(); } return this.classOptionNamesToPreparedObjects.get(opt.getName()); }
java
public Object getPreparedClassOption(ClassOption opt) { if (this.classOptionNamesToPreparedObjects == null) { this.prepareForUse(); } return this.classOptionNamesToPreparedObjects.get(opt.getName()); }
[ "public", "Object", "getPreparedClassOption", "(", "ClassOption", "opt", ")", "{", "if", "(", "this", ".", "classOptionNamesToPreparedObjects", "==", "null", ")", "{", "this", ".", "prepareForUse", "(", ")", ";", "}", "return", "this", ".", "classOptionNamesToPr...
Gets a prepared option of this class. @param opt the class option to get @return an option stored in the dictionary
[ "Gets", "a", "prepared", "option", "of", "this", "class", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/options/OptionsHandler.java#L190-L195
101,367
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/LocalEntranceProcessingItem.java
LocalEntranceProcessingItem.injectNextEvent
public boolean injectNextEvent() { if (this.getProcessor().hasNext()) { ContentEvent event = this.getProcessor().nextEvent(); this.getOutputStream().put(event); return true; } return false; }
java
public boolean injectNextEvent() { if (this.getProcessor().hasNext()) { ContentEvent event = this.getProcessor().nextEvent(); this.getOutputStream().put(event); return true; } return false; }
[ "public", "boolean", "injectNextEvent", "(", ")", "{", "if", "(", "this", ".", "getProcessor", "(", ")", ".", "hasNext", "(", ")", ")", "{", "ContentEvent", "event", "=", "this", ".", "getProcessor", "(", ")", ".", "nextEvent", "(", ")", ";", "this", ...
If there are available events, first event in the queue will be sent out on the output stream. @return true if there is (at least) one available event and it was sent out false otherwise
[ "If", "there", "are", "available", "events", "first", "event", "in", "the", "queue", "will", "be", "sent", "out", "on", "the", "output", "stream", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/LocalEntranceProcessingItem.java#L43-L50
101,368
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/simple/ClusteringDistributorProcessor.java
ClusteringDistributorProcessor.process
public boolean process(ContentEvent event) { // distinguish between ClusteringContentEvent and ClusteringEvaluationContentEvent if (event instanceof ClusteringContentEvent) { ClusteringContentEvent cce = (ClusteringContentEvent) event; outputStream.put(event); if (cce...
java
public boolean process(ContentEvent event) { // distinguish between ClusteringContentEvent and ClusteringEvaluationContentEvent if (event instanceof ClusteringContentEvent) { ClusteringContentEvent cce = (ClusteringContentEvent) event; outputStream.put(event); if (cce...
[ "public", "boolean", "process", "(", "ContentEvent", "event", ")", "{", "// distinguish between ClusteringContentEvent and ClusteringEvaluationContentEvent", "if", "(", "event", "instanceof", "ClusteringContentEvent", ")", "{", "ClusteringContentEvent", "cce", "=", "(", "Clus...
Process event. @param event the event @return true, if successful
[ "Process", "event", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/simple/ClusteringDistributorProcessor.java#L66-L78
101,369
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/NaiveBayes.java
NaiveBayes.getVotesForInstance
@Override public double[] getVotesForInstance(Instance inst) { // Prepare the results array double[] votes = new double[getNumberOfClasses()]; // Over all classes for (int classIndex = 0; classIndex < votes.length; classIndex++) { // Get the prior for this class votes[classIndex] = Math.log(getPrior(clas...
java
@Override public double[] getVotesForInstance(Instance inst) { // Prepare the results array double[] votes = new double[getNumberOfClasses()]; // Over all classes for (int classIndex = 0; classIndex < votes.length; classIndex++) { // Get the prior for this class votes[classIndex] = Math.log(getPrior(clas...
[ "@", "Override", "public", "double", "[", "]", "getVotesForInstance", "(", "Instance", "inst", ")", "{", "// Prepare the results array", "double", "[", "]", "votes", "=", "new", "double", "[", "getNumberOfClasses", "(", ")", "]", ";", "// Over all classes", "for...
Predicts the class memberships for a given instance. If an instance is unclassified, the returned array elements will be all zero. Smoothing is being implemented by the AttributeClassObserver classes. At the moment, the GaussianNumericProbabilityAttributeClassObserver needs no smoothing as it processes continuous vari...
[ "Predicts", "the", "class", "memberships", "for", "a", "given", "instance", ".", "If", "an", "instance", "is", "unclassified", "the", "returned", "array", "elements", "will", "be", "all", "zero", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/NaiveBayes.java#L123-L166
101,370
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/NaiveBayes.java
NaiveBayes.getPrior
private double getPrior(int classIndex) { // Maximum likelihood Double currentCount = this.classInstances.get(classIndex); if (currentCount == null || currentCount == 0) return 0; else return currentCount * 1. / this.instancesSeen; }
java
private double getPrior(int classIndex) { // Maximum likelihood Double currentCount = this.classInstances.get(classIndex); if (currentCount == null || currentCount == 0) return 0; else return currentCount * 1. / this.instancesSeen; }
[ "private", "double", "getPrior", "(", "int", "classIndex", ")", "{", "// Maximum likelihood", "Double", "currentCount", "=", "this", ".", "classInstances", ".", "get", "(", "classIndex", ")", ";", "if", "(", "currentCount", "==", "null", "||", "currentCount", ...
Compute the prior for the given classIndex. Implemented by maximum likelihood at the moment. @param classIndex Id of the class for which we want to compute the prior. @return Prior probability for the requested class
[ "Compute", "the", "prior", "for", "the", "given", "classIndex", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/NaiveBayes.java#L177-L184
101,371
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java
StreamSourceProcessor.setStreamSource
public void setStreamSource(InstanceStream stream) { this.streamSource = new StreamSource(stream); firstInstance = streamSource.nextInstance().getData(); }
java
public void setStreamSource(InstanceStream stream) { this.streamSource = new StreamSource(stream); firstInstance = streamSource.nextInstance().getData(); }
[ "public", "void", "setStreamSource", "(", "InstanceStream", "stream", ")", "{", "this", ".", "streamSource", "=", "new", "StreamSource", "(", "stream", ")", ";", "firstInstance", "=", "streamSource", ".", "nextInstance", "(", ")", ".", "getData", "(", ")", "...
Sets the stream source. @param stream the new stream source
[ "Sets", "the", "stream", "source", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java#L69-L72
101,372
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java
StreamSourceProcessor.sendInstances
public void sendInstances(Stream inputStream, int numberInstances, boolean isTraining, boolean isTesting) { int numberSamples = 0; while (streamSource.hasMoreInstances() && numberSamples < numberInstances) { numberSamples++; numberInstancesSent++; InstanceContentEvent instanceContent...
java
public void sendInstances(Stream inputStream, int numberInstances, boolean isTraining, boolean isTesting) { int numberSamples = 0; while (streamSource.hasMoreInstances() && numberSamples < numberInstances) { numberSamples++; numberInstancesSent++; InstanceContentEvent instanceContent...
[ "public", "void", "sendInstances", "(", "Stream", "inputStream", ",", "int", "numberInstances", ",", "boolean", "isTraining", ",", "boolean", "isTesting", ")", "{", "int", "numberSamples", "=", "0", ";", "while", "(", "streamSource", ".", "hasMoreInstances", "("...
Send instances. @param inputStream the input stream @param numberInstances the number instances @param isTraining the is training
[ "Send", "instances", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java#L83-L103
101,373
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java
StreamSourceProcessor.sendEndEvaluationInstance
public void sendEndEvaluationInstance(Stream inputStream) { InstanceContentEvent instanceContentEvent = new InstanceContentEvent(-1, firstInstance,false, true); inputStream.put(instanceContentEvent); }
java
public void sendEndEvaluationInstance(Stream inputStream) { InstanceContentEvent instanceContentEvent = new InstanceContentEvent(-1, firstInstance,false, true); inputStream.put(instanceContentEvent); }
[ "public", "void", "sendEndEvaluationInstance", "(", "Stream", "inputStream", ")", "{", "InstanceContentEvent", "instanceContentEvent", "=", "new", "InstanceContentEvent", "(", "-", "1", ",", "firstInstance", ",", "false", ",", "true", ")", ";", "inputStream", ".", ...
Send end evaluation instance. @param inputStream the input stream
[ "Send", "end", "evaluation", "instance", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/StreamSourceProcessor.java#L110-L113
101,374
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
ModelAggregatorProcessor.processInstanceContentEvent
private void processInstanceContentEvent(InstancesContentEvent instContentEvent){ this.numBatches++; this.contentEventList.add(instContentEvent); if (this.numBatches == 1 || this.numBatches > 4){ this.processInstances(this.contentEventList.remove(0)); } ...
java
private void processInstanceContentEvent(InstancesContentEvent instContentEvent){ this.numBatches++; this.contentEventList.add(instContentEvent); if (this.numBatches == 1 || this.numBatches > 4){ this.processInstances(this.contentEventList.remove(0)); } ...
[ "private", "void", "processInstanceContentEvent", "(", "InstancesContentEvent", "instContentEvent", ")", "{", "this", ".", "numBatches", "++", ";", "this", ".", "contentEventList", ".", "add", "(", "instContentEvent", ")", ";", "if", "(", "this", ".", "numBatches"...
Helper method to process the InstanceContentEvent @param instContentEvent
[ "Helper", "method", "to", "process", "the", "InstanceContentEvent" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java#L281-L295
101,375
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
ModelAggregatorProcessor.trainOnInstanceImpl
private void trainOnInstanceImpl(Instance inst) { if(this.treeRoot == null){ this.treeRoot = newLearningNode(this.parallelismHint); this.activeLeafNodeCount = 1; } FoundNode foundNode = this.treeRoot.filterInstanceToLeaf(inst, null, -1); trainOnInstanceImpl(foundNode...
java
private void trainOnInstanceImpl(Instance inst) { if(this.treeRoot == null){ this.treeRoot = newLearningNode(this.parallelismHint); this.activeLeafNodeCount = 1; } FoundNode foundNode = this.treeRoot.filterInstanceToLeaf(inst, null, -1); trainOnInstanceImpl(foundNode...
[ "private", "void", "trainOnInstanceImpl", "(", "Instance", "inst", ")", "{", "if", "(", "this", ".", "treeRoot", "==", "null", ")", "{", "this", ".", "treeRoot", "=", "newLearningNode", "(", "this", ".", "parallelismHint", ")", ";", "this", ".", "activeLea...
Helper method that represent training of an instance. Since it is decision tree, this method routes the incoming instance into the correct leaf and then update the statistic on the found leaf. @param inst
[ "Helper", "method", "that", "represent", "training", "of", "an", "instance", ".", "Since", "it", "is", "decision", "tree", "this", "method", "routes", "the", "incoming", "instance", "into", "the", "correct", "leaf", "and", "then", "update", "the", "statistic",...
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java#L425-L433
101,376
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
ModelAggregatorProcessor.attemptToSplit
private void attemptToSplit(ActiveLearningNode activeLearningNode, FoundNode foundNode){ //Increment the split ID this.splitId++; //Schedule time-out thread ScheduledFuture<?> timeOutHandler = this.executor.schedule(new AggregationTimeOutHandler(this.splitId, this.timedOutSplittingNodes), this.timeOut, ...
java
private void attemptToSplit(ActiveLearningNode activeLearningNode, FoundNode foundNode){ //Increment the split ID this.splitId++; //Schedule time-out thread ScheduledFuture<?> timeOutHandler = this.executor.schedule(new AggregationTimeOutHandler(this.splitId, this.timedOutSplittingNodes), this.timeOut, ...
[ "private", "void", "attemptToSplit", "(", "ActiveLearningNode", "activeLearningNode", ",", "FoundNode", "foundNode", ")", "{", "//Increment the split ID", "this", ".", "splitId", "++", ";", "//Schedule time-out thread", "ScheduledFuture", "<", "?", ">", "timeOutHandler", ...
Helper method to represent a split attempt @param activeLearningNode The corresponding active learning node which will be split @param foundNode The data structure to represents the filtering of the instance using the tree model.
[ "Helper", "method", "to", "represent", "a", "split", "attempt" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java#L461-L476
101,377
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
ModelAggregatorProcessor.continueAttemptToSplit
private void continueAttemptToSplit(ActiveLearningNode activeLearningNode, FoundNode foundNode){ AttributeSplitSuggestion bestSuggestion = activeLearningNode.getDistributedBestSuggestion(); AttributeSplitSuggestion secondBestSuggestion = activeLearningNode.getDistributedSecondBestSuggestion(); //compare with n...
java
private void continueAttemptToSplit(ActiveLearningNode activeLearningNode, FoundNode foundNode){ AttributeSplitSuggestion bestSuggestion = activeLearningNode.getDistributedBestSuggestion(); AttributeSplitSuggestion secondBestSuggestion = activeLearningNode.getDistributedSecondBestSuggestion(); //compare with n...
[ "private", "void", "continueAttemptToSplit", "(", "ActiveLearningNode", "activeLearningNode", ",", "FoundNode", "foundNode", ")", "{", "AttributeSplitSuggestion", "bestSuggestion", "=", "activeLearningNode", ".", "getDistributedBestSuggestion", "(", ")", ";", "AttributeSplitS...
Helper method to continue the attempt to split once all local calculation results are received. @param activeLearningNode The corresponding active learning node which will be split @param foundNode The data structure to represents the filtering of the instance using the tree model.
[ "Helper", "method", "to", "continue", "the", "attempt", "to", "split", "once", "all", "local", "calculation", "results", "are", "received", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java#L485-L552
101,378
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java
ModelAggregatorProcessor.setModelContext
private void setModelContext(InstancesHeader ih){ //TODO possibly refactored if ((ih != null) && (ih.classIndex() < 0)) { throw new IllegalArgumentException( "Context for a classifier must include a class to learn"); } //TODO: check flag for checking whether tra...
java
private void setModelContext(InstancesHeader ih){ //TODO possibly refactored if ((ih != null) && (ih.classIndex() < 0)) { throw new IllegalArgumentException( "Context for a classifier must include a class to learn"); } //TODO: check flag for checking whether tra...
[ "private", "void", "setModelContext", "(", "InstancesHeader", "ih", ")", "{", "//TODO possibly refactored", "if", "(", "(", "ih", "!=", "null", ")", "&&", "(", "ih", ".", "classIndex", "(", ")", "<", "0", ")", ")", "{", "throw", "new", "IllegalArgumentExce...
Helper method to set the model context, i.e. how many attributes they are and what is the class index @param ih
[ "Helper", "method", "to", "set", "the", "model", "context", "i", ".", "e", ".", "how", "many", "attributes", "they", "are", "and", "what", "is", "the", "class", "index" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/ModelAggregatorProcessor.java#L586-L596
101,379
YahooArchive/samoa
samoa-samza/src/main/java/com/yahoo/labs/samoa/utils/SamzaConfigFactory.java
SamzaConfigFactory.getMapConfigsForTopology
public List<MapConfig> getMapConfigsForTopology(SamzaTopology topology) throws Exception { List<MapConfig> configs = new ArrayList<MapConfig>(); List<Map<String,String>> maps = this.getMapsForTopology(topology); for(Map<String,String> map:maps) { configs.add(new MapConfig(map)); } return configs; }
java
public List<MapConfig> getMapConfigsForTopology(SamzaTopology topology) throws Exception { List<MapConfig> configs = new ArrayList<MapConfig>(); List<Map<String,String>> maps = this.getMapsForTopology(topology); for(Map<String,String> map:maps) { configs.add(new MapConfig(map)); } return configs; }
[ "public", "List", "<", "MapConfig", ">", "getMapConfigsForTopology", "(", "SamzaTopology", "topology", ")", "throws", "Exception", "{", "List", "<", "MapConfig", ">", "configs", "=", "new", "ArrayList", "<", "MapConfig", ">", "(", ")", ";", "List", "<", "Map...
Construct a list of MapConfigs for a Topology @return the list of MapConfigs @throws Exception
[ "Construct", "a", "list", "of", "MapConfigs", "for", "a", "Topology" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-samza/src/main/java/com/yahoo/labs/samoa/utils/SamzaConfigFactory.java#L358-L365
101,380
YahooArchive/samoa
samoa-samza/src/main/java/com/yahoo/labs/samoa/utils/SamzaConfigFactory.java
SamzaConfigFactory.setValue
private static void setValue(Map<String,String> map, String key, String value) { map.put(key,value); }
java
private static void setValue(Map<String,String> map, String key, String value) { map.put(key,value); }
[ "private", "static", "void", "setValue", "(", "Map", "<", "String", ",", "String", ">", "map", ",", "String", "key", ",", "String", "value", ")", "{", "map", ".", "put", "(", "key", ",", "value", ")", ";", "}" ]
Set custom properties
[ "Set", "custom", "properties" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-samza/src/main/java/com/yahoo/labs/samoa/utils/SamzaConfigFactory.java#L480-L482
101,381
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java
HorizontalAMRulesRegressor.init
@Override public void init(TopologyBuilder topologyBuilder, Instances dataset, int parallelism) { // Create MODEL PIs this.model = new AMRRuleSetProcessor.Builder(dataset) .noAnomalyDetection(noAnomalyDetectionOption.isSet()) .multivariateAnomalyProbabilityThreshold(multivariateAnomalyProbabilityThresholdOp...
java
@Override public void init(TopologyBuilder topologyBuilder, Instances dataset, int parallelism) { // Create MODEL PIs this.model = new AMRRuleSetProcessor.Builder(dataset) .noAnomalyDetection(noAnomalyDetectionOption.isSet()) .multivariateAnomalyProbabilityThreshold(multivariateAnomalyProbabilityThresholdOp...
[ "@", "Override", "public", "void", "init", "(", "TopologyBuilder", "topologyBuilder", ",", "Instances", "dataset", ",", "int", "parallelism", ")", "{", "// Create MODEL PIs", "this", ".", "model", "=", "new", "AMRRuleSetProcessor", ".", "Builder", "(", "dataset", ...
private Stream resultStream;
[ "private", "Stream", "resultStream", ";" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java#L155-L227
101,382
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/SplitNode.java
SplitNode.setChild
void setChild(int index, Node child){ if ((this.splitTest.maxBranches() >= 0) && (index >= this.splitTest.maxBranches())) { throw new IndexOutOfBoundsException(); } this.children.set(index, child); }
java
void setChild(int index, Node child){ if ((this.splitTest.maxBranches() >= 0) && (index >= this.splitTest.maxBranches())) { throw new IndexOutOfBoundsException(); } this.children.set(index, child); }
[ "void", "setChild", "(", "int", "index", ",", "Node", "child", ")", "{", "if", "(", "(", "this", ".", "splitTest", ".", "maxBranches", "(", ")", ">=", "0", ")", "&&", "(", "index", ">=", "this", ".", "splitTest", ".", "maxBranches", "(", ")", ")", ...
Method to set the children in a specific index of the SplitNode with the appropriate child @param index Index of the child in the SplitNode @param child The child node
[ "Method", "to", "set", "the", "children", "in", "a", "specific", "index", "of", "the", "SplitNode", "with", "the", "appropriate", "child" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/trees/SplitNode.java#L83-L89
101,383
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java
TopologyBuilder.initTopology
public void initTopology(String topologyName, int delay) { if (this.topology != null) { // TODO: possible refactor this code later System.out.println("Topology has been initialized before!"); return; } this.topology = componentFactory.createTopology(topologyNa...
java
public void initTopology(String topologyName, int delay) { if (this.topology != null) { // TODO: possible refactor this code later System.out.println("Topology has been initialized before!"); return; } this.topology = componentFactory.createTopology(topologyNa...
[ "public", "void", "initTopology", "(", "String", "topologyName", ",", "int", "delay", ")", "{", "if", "(", "this", ".", "topology", "!=", "null", ")", "{", "// TODO: possible refactor this code later", "System", ".", "out", ".", "println", "(", "\"Topology has b...
Initiates topology with a specific name and a delay between consecutive instances. @param topologyName @param delay delay between injections of two instances from source (in milliseconds)
[ "Initiates", "topology", "with", "a", "specific", "name", "and", "a", "delay", "between", "consecutive", "instances", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java#L76-L83
101,384
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java
TopologyBuilder.createPi
private ProcessingItem createPi(Processor processor, int parallelism) { ProcessingItem pi = this.componentFactory.createPi(processor, parallelism); this.topology.addProcessingItem(pi, parallelism); return pi; }
java
private ProcessingItem createPi(Processor processor, int parallelism) { ProcessingItem pi = this.componentFactory.createPi(processor, parallelism); this.topology.addProcessingItem(pi, parallelism); return pi; }
[ "private", "ProcessingItem", "createPi", "(", "Processor", "processor", ",", "int", "parallelism", ")", "{", "ProcessingItem", "pi", "=", "this", ".", "componentFactory", ".", "createPi", "(", "processor", ",", "parallelism", ")", ";", "this", ".", "topology", ...
Creates a processing item with a specific processor and paralellism level. @param processor @param parallelism @return ProcessingItem
[ "Creates", "a", "processing", "item", "with", "a", "specific", "processor", "and", "paralellism", "level", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java#L190-L194
101,385
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java
TopologyBuilder.createEntrancePi
private EntranceProcessingItem createEntrancePi(EntranceProcessor processor) { EntranceProcessingItem epi = this.componentFactory.createEntrancePi(processor); this.topology.addEntranceProcessingItem(epi); if (this.mapProcessorToProcessingItem == null) this.mapProcessorToProcessingIte...
java
private EntranceProcessingItem createEntrancePi(EntranceProcessor processor) { EntranceProcessingItem epi = this.componentFactory.createEntrancePi(processor); this.topology.addEntranceProcessingItem(epi); if (this.mapProcessorToProcessingItem == null) this.mapProcessorToProcessingIte...
[ "private", "EntranceProcessingItem", "createEntrancePi", "(", "EntranceProcessor", "processor", ")", "{", "EntranceProcessingItem", "epi", "=", "this", ".", "componentFactory", ".", "createEntrancePi", "(", "processor", ")", ";", "this", ".", "topology", ".", "addEntr...
Creates a platform specific entrance processing item. @param processor @return
[ "Creates", "a", "platform", "specific", "entrance", "processing", "item", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java#L202-L209
101,386
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java
TopologyBuilder.createStream
private Stream createStream(IProcessingItem sourcePi) { Stream stream = this.componentFactory.createStream(sourcePi); this.topology.addStream(stream); return stream; }
java
private Stream createStream(IProcessingItem sourcePi) { Stream stream = this.componentFactory.createStream(sourcePi); this.topology.addStream(stream); return stream; }
[ "private", "Stream", "createStream", "(", "IProcessingItem", "sourcePi", ")", "{", "Stream", "stream", "=", "this", ".", "componentFactory", ".", "createStream", "(", "sourcePi", ")", ";", "this", ".", "topology", ".", "addStream", "(", "stream", ")", ";", "...
Creates a platform specific stream. @param sourcePi source processing item. @return
[ "Creates", "a", "platform", "specific", "stream", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/TopologyBuilder.java#L218-L222
101,387
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/simple/DistributedClusterer.java
DistributedClusterer.init
@Override public void init(TopologyBuilder builder, Instances dataset, int parallelism) { this.builder = builder; this.dataset = dataset; // this.parallelism = parallelism; this.setLayout(); }
java
@Override public void init(TopologyBuilder builder, Instances dataset, int parallelism) { this.builder = builder; this.dataset = dataset; // this.parallelism = parallelism; this.setLayout(); }
[ "@", "Override", "public", "void", "init", "(", "TopologyBuilder", "builder", ",", "Instances", "dataset", ",", "int", "parallelism", ")", "{", "this", ".", "builder", "=", "builder", ";", "this", ".", "dataset", "=", "dataset", ";", "// this.parallelis...
private int parallelism;
[ "private", "int", "parallelism", ";" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/clusterers/simple/DistributedClusterer.java#L69-L75
101,388
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/topology/AbstractEntranceProcessingItem.java
AbstractEntranceProcessingItem.setOutputStream
public EntranceProcessingItem setOutputStream(Stream outputStream) { if (this.outputStream != null && this.outputStream != outputStream) { throw new IllegalStateException("Cannot overwrite output stream of EntranceProcessingItem"); } else this.outputStream = outputStream; return this; }
java
public EntranceProcessingItem setOutputStream(Stream outputStream) { if (this.outputStream != null && this.outputStream != outputStream) { throw new IllegalStateException("Cannot overwrite output stream of EntranceProcessingItem"); } else this.outputStream = outputStream; return this; }
[ "public", "EntranceProcessingItem", "setOutputStream", "(", "Stream", "outputStream", ")", "{", "if", "(", "this", ".", "outputStream", "!=", "null", "&&", "this", ".", "outputStream", "!=", "outputStream", ")", "{", "throw", "new", "IllegalStateException", "(", ...
Set the output stream of this EntranceProcessingItem. An EntranceProcessingItem should have only 1 single output stream and should not be re-assigned. @return this EntranceProcessingItem
[ "Set", "the", "output", "stream", "of", "this", "EntranceProcessingItem", ".", "An", "EntranceProcessingItem", "should", "have", "only", "1", "single", "output", "stream", "and", "should", "not", "be", "re", "-", "assigned", "." ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/topology/AbstractEntranceProcessingItem.java#L93-L99
101,389
YahooArchive/samoa
samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java
AMRulesRegressorProcessor.getVotesForInstance
private double[] getVotesForInstance(Instance instance) { ErrorWeightedVote errorWeightedVote=newErrorWeightedVote(); int numberOfRulesCovering = 0; for (ActiveRule rule: ruleSet) { if (rule.isCovering(instance) == true){ numberOfRulesCovering++; double [] vote=rule.getPrediction(instance); dou...
java
private double[] getVotesForInstance(Instance instance) { ErrorWeightedVote errorWeightedVote=newErrorWeightedVote(); int numberOfRulesCovering = 0; for (ActiveRule rule: ruleSet) { if (rule.isCovering(instance) == true){ numberOfRulesCovering++; double [] vote=rule.getPrediction(instance); dou...
[ "private", "double", "[", "]", "getVotesForInstance", "(", "Instance", "instance", ")", "{", "ErrorWeightedVote", "errorWeightedVote", "=", "newErrorWeightedVote", "(", ")", ";", "int", "numberOfRulesCovering", "=", "0", ";", "for", "(", "ActiveRule", "rule", ":",...
getVotesForInstance extension of the instance method getVotesForInstance in moa.classifier.java returns the prediction of the instance. Called in EvaluateModelRegression
[ "getVotesForInstance", "extension", "of", "the", "instance", "method", "getVotesForInstance", "in", "moa", ".", "classifier", ".", "java", "returns", "the", "prediction", "of", "the", "instance", ".", "Called", "in", "EvaluateModelRegression" ]
540a2c30167ac85c432b593baabd5ca97e7e8a0f
https://github.com/YahooArchive/samoa/blob/540a2c30167ac85c432b593baabd5ca97e7e8a0f/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java#L161-L185
101,390
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Transaction.java
Transaction.finish
public void finish() { if (mSuccessful) { mDb.setTransactionSuccessful(); } mDb.endTransaction(); if (mSuccessful) { for (OnTransactionCommittedListener listener : mOnTransactionCommittedListeners) { listener.onTransactionCommitted(); } } }
java
public void finish() { if (mSuccessful) { mDb.setTransactionSuccessful(); } mDb.endTransaction(); if (mSuccessful) { for (OnTransactionCommittedListener listener : mOnTransactionCommittedListeners) { listener.onTransactionCommitted(); } } }
[ "public", "void", "finish", "(", ")", "{", "if", "(", "mSuccessful", ")", "{", "mDb", ".", "setTransactionSuccessful", "(", ")", ";", "}", "mDb", ".", "endTransaction", "(", ")", ";", "if", "(", "mSuccessful", ")", "{", "for", "(", "OnTransactionCommitte...
Finish the transaction. This will commit or rollback the transaction depending on whether is was marked as successful or not
[ "Finish", "the", "transaction", ".", "This", "will", "commit", "or", "rollback", "the", "transaction", "depending", "on", "whether", "is", "was", "marked", "as", "successful", "or", "not" ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Transaction.java#L50-L61
101,391
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/SupportCursorLoader.java
SupportCursorLoader.onStartLoading
@Override protected void onStartLoading() { if (mCursor != null) { deliverResult(mCursor); } if (takeContentChanged() || mCursor == null) { forceLoad(); } }
java
@Override protected void onStartLoading() { if (mCursor != null) { deliverResult(mCursor); } if (takeContentChanged() || mCursor == null) { forceLoad(); } }
[ "@", "Override", "protected", "void", "onStartLoading", "(", ")", "{", "if", "(", "mCursor", "!=", "null", ")", "{", "deliverResult", "(", "mCursor", ")", ";", "}", "if", "(", "takeContentChanged", "(", ")", "||", "mCursor", "==", "null", ")", "{", "fo...
Starts an asynchronous load of the contacts list data. When the result is ready the callbacks will be called on the UI thread. If a previous load has been completed and is still valid the result may be passed to the callbacks immediately. Must be called from the UI thread
[ "Starts", "an", "asynchronous", "load", "of", "the", "contacts", "list", "data", ".", "When", "the", "result", "is", "ready", "the", "callbacks", "will", "be", "called", "on", "the", "UI", "thread", ".", "If", "a", "previous", "load", "has", "been", "com...
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/SupportCursorLoader.java#L76-L84
101,392
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Model.java
Model.exists
final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }
java
final public boolean exists() { final Model m = Query.one( getClass(), String.format("SELECT * FROM %s WHERE %s LIMIT 1", Utils.getTableName(getClass()), Utils.getWhereStatement(this))).get(); return m != null; }
[ "final", "public", "boolean", "exists", "(", ")", "{", "final", "Model", "m", "=", "Query", ".", "one", "(", "getClass", "(", ")", ",", "String", ".", "format", "(", "\"SELECT * FROM %s WHERE %s LIMIT 1\"", ",", "Utils", ".", "getTableName", "(", "getClass",...
Check whether this model exists in the database @return true if this model is currently saved in the database (could be an older version)
[ "Check", "whether", "this", "model", "exists", "in", "the", "database" ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Model.java#L60-L67
101,393
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Model.java
Model.delete
final public void delete() { Transaction t = new Transaction(); try { delete(t); t.setSuccessful(true); } finally { t.finish(); } }
java
final public void delete() { Transaction t = new Transaction(); try { delete(t); t.setSuccessful(true); } finally { t.finish(); } }
[ "final", "public", "void", "delete", "(", ")", "{", "Transaction", "t", "=", "new", "Transaction", "(", ")", ";", "try", "{", "delete", "(", "t", ")", ";", "t", ".", "setSuccessful", "(", "true", ")", ";", "}", "finally", "{", "t", ".", "finish", ...
Delete this model
[ "Delete", "this", "model" ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Model.java#L178-L186
101,394
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Model.java
Model.delete
final public void delete(Transaction t) { t.delete(Utils.getTableName(getClass()), Utils.getWhereStatement(this)); t.addOnTransactionCommittedListener(new OnTransactionCommittedListener() { @Override public void onTransactionCommitted() { Sprinkles.sInstance.mContext.g...
java
final public void delete(Transaction t) { t.delete(Utils.getTableName(getClass()), Utils.getWhereStatement(this)); t.addOnTransactionCommittedListener(new OnTransactionCommittedListener() { @Override public void onTransactionCommitted() { Sprinkles.sInstance.mContext.g...
[ "final", "public", "void", "delete", "(", "Transaction", "t", ")", "{", "t", ".", "delete", "(", "Utils", ".", "getTableName", "(", "getClass", "(", ")", ")", ",", "Utils", ".", "getWhereStatement", "(", "this", ")", ")", ";", "t", ".", "addOnTransacti...
Delete this model within the given transaction @param t The transaction to delete this model in
[ "Delete", "this", "model", "within", "the", "given", "transaction" ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Model.java#L194-L205
101,395
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Query.java
Query.all
public static <T extends Model> ManyQuery<T> all(Class<T> clazz) { return many(clazz, "SELECT * FROM " + Utils.getTableName(clazz)); }
java
public static <T extends Model> ManyQuery<T> all(Class<T> clazz) { return many(clazz, "SELECT * FROM " + Utils.getTableName(clazz)); }
[ "public", "static", "<", "T", "extends", "Model", ">", "ManyQuery", "<", "T", ">", "all", "(", "Class", "<", "T", ">", "clazz", ")", "{", "return", "many", "(", "clazz", ",", "\"SELECT * FROM \"", "+", "Utils", ".", "getTableName", "(", "clazz", ")", ...
Start a query for the entire list of instance of type T @param clazz The class representing the type of the list you want returned @param <T> The type of the list you want returned @return the query to execute
[ "Start", "a", "query", "for", "the", "entire", "list", "of", "instance", "of", "type", "T" ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Query.java#L124-L126
101,396
emilsjolander/sprinkles
library/src/main/java/se/emilsjolander/sprinkles/Sprinkles.java
Sprinkles.getDatabase
static synchronized SQLiteDatabase getDatabase() { if(sInstance == null) { throw new SprinklesNotInitializedException(); } if(sDatabase == null) { DbOpenHelper dbOpenHelper = new DbOpenHelper(sInstance.mContext, sInstance.databaseName, sInstance.initialDatabaseVersion); ...
java
static synchronized SQLiteDatabase getDatabase() { if(sInstance == null) { throw new SprinklesNotInitializedException(); } if(sDatabase == null) { DbOpenHelper dbOpenHelper = new DbOpenHelper(sInstance.mContext, sInstance.databaseName, sInstance.initialDatabaseVersion); ...
[ "static", "synchronized", "SQLiteDatabase", "getDatabase", "(", ")", "{", "if", "(", "sInstance", "==", "null", ")", "{", "throw", "new", "SprinklesNotInitializedException", "(", ")", ";", "}", "if", "(", "sDatabase", "==", "null", ")", "{", "DbOpenHelper", ...
Throws SprinklesNotInitializedException if you try to access the database before initializing Sprinkles. @return the SQL Database used by Sprinkles.
[ "Throws", "SprinklesNotInitializedException", "if", "you", "try", "to", "access", "the", "database", "before", "initializing", "Sprinkles", "." ]
3a666f18ee5158db6fe3b4f4346b470481559606
https://github.com/emilsjolander/sprinkles/blob/3a666f18ee5158db6fe3b4f4346b470481559606/library/src/main/java/se/emilsjolander/sprinkles/Sprinkles.java#L113-L124
101,397
CycloneDX/cyclonedx-core-java
src/main/java/org/cyclonedx/CycloneDxSchema.java
CycloneDxSchema.getXmlSchema
public Schema getXmlSchema(CycloneDxSchema.Version schemaVersion) throws SAXException { if (CycloneDxSchema.Version.VERSION_10 == schemaVersion) { return getXmlSchema10(); } else { return getXmlSchema11(); } }
java
public Schema getXmlSchema(CycloneDxSchema.Version schemaVersion) throws SAXException { if (CycloneDxSchema.Version.VERSION_10 == schemaVersion) { return getXmlSchema10(); } else { return getXmlSchema11(); } }
[ "public", "Schema", "getXmlSchema", "(", "CycloneDxSchema", ".", "Version", "schemaVersion", ")", "throws", "SAXException", "{", "if", "(", "CycloneDxSchema", ".", "Version", ".", "VERSION_10", "==", "schemaVersion", ")", "{", "return", "getXmlSchema10", "(", ")",...
Returns the CycloneDX XML Schema for the specified schema version. @param schemaVersion The version to return the schema for @return a Schema @throws SAXException a SAXException @since 2.0.0
[ "Returns", "the", "CycloneDX", "XML", "Schema", "for", "the", "specified", "schema", "version", "." ]
45f8f55a7f308f41280b834f179b48ea852b8c20
https://github.com/CycloneDX/cyclonedx-core-java/blob/45f8f55a7f308f41280b834f179b48ea852b8c20/src/main/java/org/cyclonedx/CycloneDxSchema.java#L58-L64
101,398
CycloneDX/cyclonedx-core-java
src/main/java/org/cyclonedx/CycloneDxSchema.java
CycloneDxSchema.getXmlSchema10
private Schema getXmlSchema10() throws SAXException { final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); // Use local copies of schemas rather than resolving from the net. It's faster, and less prone to errors. final Source[] schemaFiles = { ...
java
private Schema getXmlSchema10() throws SAXException { final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); // Use local copies of schemas rather than resolving from the net. It's faster, and less prone to errors. final Source[] schemaFiles = { ...
[ "private", "Schema", "getXmlSchema10", "(", ")", "throws", "SAXException", "{", "final", "SchemaFactory", "schemaFactory", "=", "SchemaFactory", ".", "newInstance", "(", "XMLConstants", ".", "W3C_XML_SCHEMA_NS_URI", ")", ";", "// Use local copies of schemas rather than reso...
Returns the CycloneDX XML Schema from the specifications XSD. @return a Schema @throws SAXException a SAXException @since 1.1.0
[ "Returns", "the", "CycloneDX", "XML", "Schema", "from", "the", "specifications", "XSD", "." ]
45f8f55a7f308f41280b834f179b48ea852b8c20
https://github.com/CycloneDX/cyclonedx-core-java/blob/45f8f55a7f308f41280b834f179b48ea852b8c20/src/main/java/org/cyclonedx/CycloneDxSchema.java#L71-L79
101,399
CycloneDX/cyclonedx-core-java
src/main/java/org/cyclonedx/util/LicenseResolver.java
LicenseResolver.resolve
public static LicenseChoice resolve(String licenseString) { try { return resolveSpdxLicenseString(licenseString); } catch (InvalidLicenseStringException e1) { final LicenseChoice licenseChoice = resolveViaAlternativeMapping(licenseString); if (licenseChoice != null) {...
java
public static LicenseChoice resolve(String licenseString) { try { return resolveSpdxLicenseString(licenseString); } catch (InvalidLicenseStringException e1) { final LicenseChoice licenseChoice = resolveViaAlternativeMapping(licenseString); if (licenseChoice != null) {...
[ "public", "static", "LicenseChoice", "resolve", "(", "String", "licenseString", ")", "{", "try", "{", "return", "resolveSpdxLicenseString", "(", "licenseString", ")", ";", "}", "catch", "(", "InvalidLicenseStringException", "e1", ")", "{", "final", "LicenseChoice", ...
Attempts to resolve the specified license string via SPDX license identifier and expression parsing first. If SPDX resolution is not successful, the method will attempt fuzzy matching. @param licenseString the license string to resolve @return a LicenseChoice object if resolution was successful, or null if unresolved
[ "Attempts", "to", "resolve", "the", "specified", "license", "string", "via", "SPDX", "license", "identifier", "and", "expression", "parsing", "first", ".", "If", "SPDX", "resolution", "is", "not", "successful", "the", "method", "will", "attempt", "fuzzy", "match...
45f8f55a7f308f41280b834f179b48ea852b8c20
https://github.com/CycloneDX/cyclonedx-core-java/blob/45f8f55a7f308f41280b834f179b48ea852b8c20/src/main/java/org/cyclonedx/util/LicenseResolver.java#L83-L102