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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4,500 | xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java | TypesWalker.isLowerBoundCompatible | private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) {
boolean res = true;
if (type.getLowerBounds().length > 0) {
// only one super could be used
// couldn't be an object here as ? super Object is always replaced to simply Object before com... | java | private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) {
boolean res = true;
if (type.getLowerBounds().length > 0) {
// only one super could be used
// couldn't be an object here as ? super Object is always replaced to simply Object before com... | [
"private",
"static",
"boolean",
"isLowerBoundCompatible",
"(",
"final",
"WildcardType",
"type",
",",
"final",
"Class",
"...",
"with",
")",
"{",
"boolean",
"res",
"=",
"true",
";",
"if",
"(",
"type",
".",
"getLowerBounds",
"(",
")",
".",
"length",
">",
"0",... | Check that wildcard's lower bound type is not less then any of provided types.
@param type wildcard with possible lower bound
@param with types to compare with lower bound
@return true if compatible or no lower bound set, false otherwise | [
"Check",
"that",
"wildcard",
"s",
"lower",
"bound",
"type",
"is",
"not",
"less",
"then",
"any",
"of",
"provided",
"types",
"."
] | d7d9d2783265df1178230e8f0b7cb6d853b67a7b | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java#L241-L257 |
4,501 | xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/error/UnknownGenericException.java | UnknownGenericException.rethrowWithType | public UnknownGenericException rethrowWithType(final Class<?> type) {
final boolean sameType = contextType != null && contextType.equals(type);
if (!sameType && contextType != null) {
// not allow changing type if it's already set
throw new IllegalStateException("Context type can... | java | public UnknownGenericException rethrowWithType(final Class<?> type) {
final boolean sameType = contextType != null && contextType.equals(type);
if (!sameType && contextType != null) {
// not allow changing type if it's already set
throw new IllegalStateException("Context type can... | [
"public",
"UnknownGenericException",
"rethrowWithType",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"final",
"boolean",
"sameType",
"=",
"contextType",
"!=",
"null",
"&&",
"contextType",
".",
"equals",
"(",
"type",
")",
";",
"if",
"(",
"!",
"sa... | Throw more specific exception.
@param type context type
@return new exception if type is different, same exception instance if type is the same | [
"Throw",
"more",
"specific",
"exception",
"."
] | d7d9d2783265df1178230e8f0b7cb6d853b67a7b | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/error/UnknownGenericException.java#L75-L82 |
4,502 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/ValidateMojo.java | ValidateMojo.getSchema | private Schema getSchema( Resolver pResolver, ValidationSet pValidationSet )
throws MojoExecutionException
{
String schemaLanguage = pValidationSet.getSchemaLanguage();
if ( schemaLanguage == null || "".equals( schemaLanguage ) )
{
schemaLanguage = XMLConstants.W3C_XML_SC... | java | private Schema getSchema( Resolver pResolver, ValidationSet pValidationSet )
throws MojoExecutionException
{
String schemaLanguage = pValidationSet.getSchemaLanguage();
if ( schemaLanguage == null || "".equals( schemaLanguage ) )
{
schemaLanguage = XMLConstants.W3C_XML_SC... | [
"private",
"Schema",
"getSchema",
"(",
"Resolver",
"pResolver",
",",
"ValidationSet",
"pValidationSet",
")",
"throws",
"MojoExecutionException",
"{",
"String",
"schemaLanguage",
"=",
"pValidationSet",
".",
"getSchemaLanguage",
"(",
")",
";",
"if",
"(",
"schemaLanguage... | Reads a validation sets schema.
@param pResolver The resolver to use for loading external entities.
@param pValidationSet The validation set to configure.
@return The validation sets schema, if any, or null.
@throws MojoExecutionException Loading the schema failed. | [
"Reads",
"a",
"validation",
"sets",
"schema",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/ValidateMojo.java#L72-L131 |
4,503 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/ValidateMojo.java | ValidateMojo.validate | private void validate( final Resolver pResolver, ValidationSet pValidationSet, Schema pSchema, File pFile, ValidationErrorHandler errorHandler )
throws MojoExecutionException
{
errorHandler.setContext(pFile);
try
{
if ( pSchema == null )
{
getL... | java | private void validate( final Resolver pResolver, ValidationSet pValidationSet, Schema pSchema, File pFile, ValidationErrorHandler errorHandler )
throws MojoExecutionException
{
errorHandler.setContext(pFile);
try
{
if ( pSchema == null )
{
getL... | [
"private",
"void",
"validate",
"(",
"final",
"Resolver",
"pResolver",
",",
"ValidationSet",
"pValidationSet",
",",
"Schema",
"pSchema",
",",
"File",
"pFile",
",",
"ValidationErrorHandler",
"errorHandler",
")",
"throws",
"MojoExecutionException",
"{",
"errorHandler",
"... | Called for parsing or validating a single file.
@param pResolver The resolver to use for loading external entities.
@param pValidationSet The parsers or validators configuration.
@param pSchema The schema to use.
@param pFile The file to parse or validate.
@throws MojoExecutionException Parsing or validating the file ... | [
"Called",
"for",
"parsing",
"or",
"validating",
"a",
"single",
"file",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/ValidateMojo.java#L142-L194 |
4,504 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/ValidateMojo.java | ValidateMojo.parse | private void parse( Resolver pResolver, ValidationSet pValidationSet, File pFile , ErrorHandler errorHandler)
throws IOException, SAXException, ParserConfigurationException
{
XMLReader xr = newSAXParserFactory( pValidationSet ).newSAXParser().getXMLReader();
if ( pResolver != null )
... | java | private void parse( Resolver pResolver, ValidationSet pValidationSet, File pFile , ErrorHandler errorHandler)
throws IOException, SAXException, ParserConfigurationException
{
XMLReader xr = newSAXParserFactory( pValidationSet ).newSAXParser().getXMLReader();
if ( pResolver != null )
... | [
"private",
"void",
"parse",
"(",
"Resolver",
"pResolver",
",",
"ValidationSet",
"pValidationSet",
",",
"File",
"pFile",
",",
"ErrorHandler",
"errorHandler",
")",
"throws",
"IOException",
",",
"SAXException",
",",
"ParserConfigurationException",
"{",
"XMLReader",
"xr",... | Called for validating a single file.
@param pResolver The resolver to use for loading external entities.
@param pValidationSet The validators configuration.
@param pFile The file to validate.
@throws IOException An I/O error occurred.
@throws SAXException Parsing the file failed.
@throws ParserConfigurationException C... | [
"Called",
"for",
"validating",
"a",
"single",
"file",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/ValidateMojo.java#L250-L260 |
4,505 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/ValidateMojo.java | ValidateMojo.validate | private void validate( Resolver pResolver, ValidationSet pValidationSet,ValidationErrorHandler errorHandler )
throws MojoExecutionException, MojoFailureException
{
final Schema schema = getSchema( pResolver, pValidationSet );
final File[] files =
getFiles( pValidationSet.getDir()... | java | private void validate( Resolver pResolver, ValidationSet pValidationSet,ValidationErrorHandler errorHandler )
throws MojoExecutionException, MojoFailureException
{
final Schema schema = getSchema( pResolver, pValidationSet );
final File[] files =
getFiles( pValidationSet.getDir()... | [
"private",
"void",
"validate",
"(",
"Resolver",
"pResolver",
",",
"ValidationSet",
"pValidationSet",
",",
"ValidationErrorHandler",
"errorHandler",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"final",
"Schema",
"schema",
"=",
"getSchema",
... | Called for validating a set of XML files against a common schema.
@param pResolver The resolver to use for loading external entities.
@param pValidationSet The set of XML files to validate.
@throws MojoExecutionException Validating the set of files failed.
@throws MojoFailureException A configuration error was detecte... | [
"Called",
"for",
"validating",
"a",
"set",
"of",
"XML",
"files",
"against",
"a",
"common",
"schema",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/ValidateMojo.java#L270-L286 |
4,506 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/TransformMojo.java | TransformMojo.newTransformerFactory | public static TransformerFactory newTransformerFactory( String factoryClassName, ClassLoader classLoader )
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
{
// use reflection to avoid JAXP 1.4 (and hence JDK6) requirement
Class<?>[] methodTypes = new Class[] ... | java | public static TransformerFactory newTransformerFactory( String factoryClassName, ClassLoader classLoader )
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
{
// use reflection to avoid JAXP 1.4 (and hence JDK6) requirement
Class<?>[] methodTypes = new Class[] ... | [
"public",
"static",
"TransformerFactory",
"newTransformerFactory",
"(",
"String",
"factoryClassName",
",",
"ClassLoader",
"classLoader",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"// use reflection to avoid JAXP ... | public for use by unit test | [
"public",
"for",
"use",
"by",
"unit",
"test"
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/TransformMojo.java#L209-L221 |
4,507 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/TransformMojo.java | TransformMojo.execute | public void execute()
throws MojoExecutionException, MojoFailureException
{
if ( isSkipping() )
{
getLog().debug( "Skipping execution, as demanded by user." );
return;
}
if ( transformationSets == null || transformationSets.length == 0 )
{
... | java | public void execute()
throws MojoExecutionException, MojoFailureException
{
if ( isSkipping() )
{
getLog().debug( "Skipping execution, as demanded by user." );
return;
}
if ( transformationSets == null || transformationSets.length == 0 )
{
... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
",",
"MojoFailureException",
"{",
"if",
"(",
"isSkipping",
"(",
")",
")",
"{",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"Skipping execution, as demanded by user.\"",
")",
";",
"return",
"... | Called by Maven to run the plugin. | [
"Called",
"by",
"Maven",
"to",
"run",
"the",
"plugin",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/TransformMojo.java#L610-L640 |
4,508 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java | IndentCheckSaxHandler.characters | @Override
public void characters( char[] ch, int start, int length )
throws SAXException
{
charBuffer.append( ch, start, length );
charLineNumber = locator.getLineNumber();
} | java | @Override
public void characters( char[] ch, int start, int length )
throws SAXException
{
charBuffer.append( ch, start, length );
charLineNumber = locator.getLineNumber();
} | [
"@",
"Override",
"public",
"void",
"characters",
"(",
"char",
"[",
"]",
"ch",
",",
"int",
"start",
",",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"charBuffer",
".",
"append",
"(",
"ch",
",",
"start",
",",
"length",
")",
";",
"charLineNumber",
... | Stores the passed characters into a character buffer.
@see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) | [
"Stores",
"the",
"passed",
"characters",
"into",
"a",
"character",
"buffer",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java#L129-L135 |
4,509 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java | IndentCheckSaxHandler.endElement | @Override
public void endElement( String uri, String localName, String qName )
throws SAXException
{
flushCharacters();
if ( stack.isEmpty() )
{
throw new IllegalStateException( "Stack must not be empty when closing the element " + qName
+ " around lin... | java | @Override
public void endElement( String uri, String localName, String qName )
throws SAXException
{
flushCharacters();
if ( stack.isEmpty() )
{
throw new IllegalStateException( "Stack must not be empty when closing the element " + qName
+ " around lin... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"flushCharacters",
"(",
")",
";",
"if",
"(",
"stack",
".",
"isEmpty",
"(",
")",
")",
"{",
"thro... | Checks indentation for an end element.
@see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes) | [
"Checks",
"indentation",
"for",
"an",
"end",
"element",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java#L143-L170 |
4,510 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java | IndentCheckSaxHandler.startElement | @Override
public void startElement( String uri, String localName, String qName, Attributes attributes )
throws SAXException
{
flushCharacters();
IndentCheckSaxHandler.ElementEntry currentEntry = new ElementEntry( qName, lastIndent );
if ( !stack.isEmpty() )
{
... | java | @Override
public void startElement( String uri, String localName, String qName, Attributes attributes )
throws SAXException
{
flushCharacters();
IndentCheckSaxHandler.ElementEntry currentEntry = new ElementEntry( qName, lastIndent );
if ( !stack.isEmpty() )
{
... | [
"@",
"Override",
"public",
"void",
"startElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
",",
"Attributes",
"attributes",
")",
"throws",
"SAXException",
"{",
"flushCharacters",
"(",
")",
";",
"IndentCheckSaxHandler",
".",
"Ele... | Checks indentation for a start element.
@see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String,
org.xml.sax.Attributes) | [
"Checks",
"indentation",
"for",
"a",
"start",
"element",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/format/IndentCheckSaxHandler.java#L245-L285 |
4,511 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.asAbsoluteFile | protected File asAbsoluteFile( File f )
{
if ( f.isAbsolute() )
{
return f;
}
return new File( getBasedir(), f.getPath() );
} | java | protected File asAbsoluteFile( File f )
{
if ( f.isAbsolute() )
{
return f;
}
return new File( getBasedir(), f.getPath() );
} | [
"protected",
"File",
"asAbsoluteFile",
"(",
"File",
"f",
")",
"{",
"if",
"(",
"f",
".",
"isAbsolute",
"(",
")",
")",
"{",
"return",
"f",
";",
"}",
"return",
"new",
"File",
"(",
"getBasedir",
"(",
")",
",",
"f",
".",
"getPath",
"(",
")",
")",
";",... | Converts the given file into an file with an absolute path. | [
"Converts",
"the",
"given",
"file",
"into",
"an",
"file",
"with",
"an",
"absolute",
"path",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L135-L142 |
4,512 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.setCatalogs | protected void setCatalogs(List<File> pCatalogFiles, List<URL> pCatalogUrls ) throws MojoExecutionException
{
if ( catalogs == null || catalogs.length == 0 )
{
return;
}
for ( int i = 0; i < catalogs.length; i++ )
{
try
{
U... | java | protected void setCatalogs(List<File> pCatalogFiles, List<URL> pCatalogUrls ) throws MojoExecutionException
{
if ( catalogs == null || catalogs.length == 0 )
{
return;
}
for ( int i = 0; i < catalogs.length; i++ )
{
try
{
U... | [
"protected",
"void",
"setCatalogs",
"(",
"List",
"<",
"File",
">",
"pCatalogFiles",
",",
"List",
"<",
"URL",
">",
"pCatalogUrls",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"catalogs",
"==",
"null",
"||",
"catalogs",
".",
"length",
"==",
"0",
... | Returns the plugins catalog files. | [
"Returns",
"the",
"plugins",
"catalog",
"files",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L147-L170 |
4,513 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.getResolver | protected Resolver getResolver()
throws MojoExecutionException
{
List<File> catalogFiles = new ArrayList<File>();
List<URL> catalogUrls = new ArrayList<URL>();
setCatalogs( catalogFiles, catalogUrls );
return new Resolver( getBasedir(), catalogFiles, catalogUrls, getLocator(... | java | protected Resolver getResolver()
throws MojoExecutionException
{
List<File> catalogFiles = new ArrayList<File>();
List<URL> catalogUrls = new ArrayList<URL>();
setCatalogs( catalogFiles, catalogUrls );
return new Resolver( getBasedir(), catalogFiles, catalogUrls, getLocator(... | [
"protected",
"Resolver",
"getResolver",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"List",
"<",
"File",
">",
"catalogFiles",
"=",
"new",
"ArrayList",
"<",
"File",
">",
"(",
")",
";",
"List",
"<",
"URL",
">",
"catalogUrls",
"=",
"new",
"ArrayList",
... | Creates a new resolver. | [
"Creates",
"a",
"new",
"resolver",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L175-L183 |
4,514 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.getFileNames | protected String[] getFileNames( File pDir, String[] pIncludes, String[] pExcludes )
throws MojoFailureException, MojoExecutionException
{
if ( pDir == null )
{
throw new MojoFailureException( "A ValidationSet or TransformationSet"
+ " requires a nonempty 'dir' ch... | java | protected String[] getFileNames( File pDir, String[] pIncludes, String[] pExcludes )
throws MojoFailureException, MojoExecutionException
{
if ( pDir == null )
{
throw new MojoFailureException( "A ValidationSet or TransformationSet"
+ " requires a nonempty 'dir' ch... | [
"protected",
"String",
"[",
"]",
"getFileNames",
"(",
"File",
"pDir",
",",
"String",
"[",
"]",
"pIncludes",
",",
"String",
"[",
"]",
"pExcludes",
")",
"throws",
"MojoFailureException",
",",
"MojoExecutionException",
"{",
"if",
"(",
"pDir",
"==",
"null",
")",... | Scans a directory for files and returns a set of path names. | [
"Scans",
"a",
"directory",
"for",
"files",
"and",
"returns",
"a",
"set",
"of",
"path",
"names",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L188-L214 |
4,515 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.getExcludes | protected String[] getExcludes( String[] origExcludes, boolean skipDefaultExcludes )
{
if ( skipDefaultExcludes )
{
return origExcludes;
}
String[] defaultExcludes = FileUtils.getDefaultExcludes();
if ( origExcludes == null || origExcludes.length == 0 )
{... | java | protected String[] getExcludes( String[] origExcludes, boolean skipDefaultExcludes )
{
if ( skipDefaultExcludes )
{
return origExcludes;
}
String[] defaultExcludes = FileUtils.getDefaultExcludes();
if ( origExcludes == null || origExcludes.length == 0 )
{... | [
"protected",
"String",
"[",
"]",
"getExcludes",
"(",
"String",
"[",
"]",
"origExcludes",
",",
"boolean",
"skipDefaultExcludes",
")",
"{",
"if",
"(",
"skipDefaultExcludes",
")",
"{",
"return",
"origExcludes",
";",
"}",
"String",
"[",
"]",
"defaultExcludes",
"="... | Calculates the exclusions to use when searching files. | [
"Calculates",
"the",
"exclusions",
"to",
"use",
"when",
"searching",
"files",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L248-L264 |
4,516 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.activateProxy | protected Object activateProxy()
{
if ( settings == null )
{
return null;
}
final Proxy proxy = settings.getActiveProxy();
if ( proxy == null )
{
return null;
}
final List<String> properties = new ArrayList<String>();
f... | java | protected Object activateProxy()
{
if ( settings == null )
{
return null;
}
final Proxy proxy = settings.getActiveProxy();
if ( proxy == null )
{
return null;
}
final List<String> properties = new ArrayList<String>();
f... | [
"protected",
"Object",
"activateProxy",
"(",
")",
"{",
"if",
"(",
"settings",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Proxy",
"proxy",
"=",
"settings",
".",
"getActiveProxy",
"(",
")",
";",
"if",
"(",
"proxy",
"==",
"null",
")",
... | Called to install the plugins proxy settings. | [
"Called",
"to",
"install",
"the",
"plugins",
"proxy",
"settings",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L291-L332 |
4,517 | mojohaus/xml-maven-plugin | src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java | AbstractXmlMojo.passivateProxy | protected void passivateProxy( Object pProperties )
{
if ( pProperties == null )
{
return;
}
@SuppressWarnings( "unchecked" )
final List<String> properties = (List<String>) pProperties;
for ( Iterator<String> iter = properties.iterator(); iter.hasNext(); )... | java | protected void passivateProxy( Object pProperties )
{
if ( pProperties == null )
{
return;
}
@SuppressWarnings( "unchecked" )
final List<String> properties = (List<String>) pProperties;
for ( Iterator<String> iter = properties.iterator(); iter.hasNext(); )... | [
"protected",
"void",
"passivateProxy",
"(",
"Object",
"pProperties",
")",
"{",
"if",
"(",
"pProperties",
"==",
"null",
")",
"{",
"return",
";",
"}",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"final",
"List",
"<",
"String",
">",
"properties",
"=",
... | Called to restore the proxy settings, which have been installed when the plugin was invoked. | [
"Called",
"to",
"restore",
"the",
"proxy",
"settings",
"which",
"have",
"been",
"installed",
"when",
"the",
"plugin",
"was",
"invoked",
"."
] | 161edde37bbfe7a472369a9675c44d91ec24561d | https://github.com/mojohaus/xml-maven-plugin/blob/161edde37bbfe7a472369a9675c44d91ec24561d/src/main/java/org/codehaus/mojo/xml/AbstractXmlMojo.java#L337-L351 |
4,518 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/client/HttpClient.java | HttpClient.addQueryParameters | private void addQueryParameters(HttpRequestBase request, Map<String, String> params) {
if (params != null) {
URIBuilder builder = new URIBuilder(request.getURI());
for(Map.Entry<String, String> param : params.entrySet()) {
builder.addParameter(param.getKey(), param.getVal... | java | private void addQueryParameters(HttpRequestBase request, Map<String, String> params) {
if (params != null) {
URIBuilder builder = new URIBuilder(request.getURI());
for(Map.Entry<String, String> param : params.entrySet()) {
builder.addParameter(param.getKey(), param.getVal... | [
"private",
"void",
"addQueryParameters",
"(",
"HttpRequestBase",
"request",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"if",
"(",
"params",
"!=",
"null",
")",
"{",
"URIBuilder",
"builder",
"=",
"new",
"URIBuilder",
"(",
"request",
"... | Modifies request in place to add on any query parameters | [
"Modifies",
"request",
"in",
"place",
"to",
"add",
"on",
"any",
"query",
"parameters"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/client/HttpClient.java#L97-L109 |
4,519 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/AlgorithmException.java | AlgorithmException.wrapException | private static AlgorithmException wrapException(Throwable throwable) {
if(throwable == null) {
return null;
} else if(throwable instanceof AlgorithmException) {
return (AlgorithmException) throwable;
} else {
return new AlgorithmException(throwable.getMessage(... | java | private static AlgorithmException wrapException(Throwable throwable) {
if(throwable == null) {
return null;
} else if(throwable instanceof AlgorithmException) {
return (AlgorithmException) throwable;
} else {
return new AlgorithmException(throwable.getMessage(... | [
"private",
"static",
"AlgorithmException",
"wrapException",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"throwable",
"instanceof",
"AlgorithmException",
")",
"{",
"retu... | Constructs a new algorithm exception from an existing throwable.
This replaces all Exceptions in the cause hierarchy to be replaced with AlgorithmException, for inter-jvm communication safety. | [
"Constructs",
"a",
"new",
"algorithm",
"exception",
"from",
"an",
"existing",
"throwable",
".",
"This",
"replaces",
"all",
"Exceptions",
"in",
"the",
"cause",
"hierarchy",
"to",
"be",
"replaced",
"with",
"AlgorithmException",
"for",
"inter",
"-",
"jvm",
"communi... | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/AlgorithmException.java#L90-L98 |
4,520 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.putFile | public DataFile putFile(File file) throws APIException, FileNotFoundException {
DataFile dataFile = new DataFile(client, trimmedPath + "/" + file.getName());
dataFile.put(file);
return dataFile;
} | java | public DataFile putFile(File file) throws APIException, FileNotFoundException {
DataFile dataFile = new DataFile(client, trimmedPath + "/" + file.getName());
dataFile.put(file);
return dataFile;
} | [
"public",
"DataFile",
"putFile",
"(",
"File",
"file",
")",
"throws",
"APIException",
",",
"FileNotFoundException",
"{",
"DataFile",
"dataFile",
"=",
"new",
"DataFile",
"(",
"client",
",",
"trimmedPath",
"+",
"\"/\"",
"+",
"file",
".",
"getName",
"(",
")",
")... | Convenience wrapper for putting a File
@param file a file to put into this data directory
@return a handle to the requested file
@throws APIException if there were any problems communicating with the Algorithmia API
@throws FileNotFoundException if the specified file does not exist | [
"Convenience",
"wrapper",
"for",
"putting",
"a",
"File"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L88-L92 |
4,521 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.create | public void create() throws APIException {
CreateDirectoryRequest reqObj = new CreateDirectoryRequest(this.getName(), null);
Gson gson = new Gson();
JsonElement inputJson = gson.toJsonTree(reqObj);
String url = this.getParent().getUrl();
HttpResponse response = this.client.post(... | java | public void create() throws APIException {
CreateDirectoryRequest reqObj = new CreateDirectoryRequest(this.getName(), null);
Gson gson = new Gson();
JsonElement inputJson = gson.toJsonTree(reqObj);
String url = this.getParent().getUrl();
HttpResponse response = this.client.post(... | [
"public",
"void",
"create",
"(",
")",
"throws",
"APIException",
"{",
"CreateDirectoryRequest",
"reqObj",
"=",
"new",
"CreateDirectoryRequest",
"(",
"this",
".",
"getName",
"(",
")",
",",
"null",
")",
";",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";",
... | Creates this directory via the Algorithmia Data API
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Creates",
"this",
"directory",
"via",
"the",
"Algorithmia",
"Data",
"API"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L116-L124 |
4,522 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.delete | public void delete(boolean forceDelete) throws APIException {
HttpResponse response = client.delete(getUrl() + "?force=" + forceDelete);
HttpClientHelpers.throwIfNotOk(response);
} | java | public void delete(boolean forceDelete) throws APIException {
HttpResponse response = client.delete(getUrl() + "?force=" + forceDelete);
HttpClientHelpers.throwIfNotOk(response);
} | [
"public",
"void",
"delete",
"(",
"boolean",
"forceDelete",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"delete",
"(",
"getUrl",
"(",
")",
"+",
"\"?force=\"",
"+",
"forceDelete",
")",
";",
"HttpClientHelpers",
".",
"throw... | Creates this directory vi the Algorithmia Data API
@param forceDelete forces deletion of the directory even if it still has other files in it
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Creates",
"this",
"directory",
"vi",
"the",
"Algorithmia",
"Data",
"API"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L142-L145 |
4,523 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataDirectory.java | DataDirectory.getPage | protected DirectoryListResponse getPage(String marker, Boolean getAcl) throws APIException {
String url = getUrl();
Map<String, String> params = new HashMap<String, String>();
if (marker != null) {
params.put("marker", marker);
}
if (getAcl) {
params.put(... | java | protected DirectoryListResponse getPage(String marker, Boolean getAcl) throws APIException {
String url = getUrl();
Map<String, String> params = new HashMap<String, String>();
if (marker != null) {
params.put("marker", marker);
}
if (getAcl) {
params.put(... | [
"protected",
"DirectoryListResponse",
"getPage",
"(",
"String",
"marker",
",",
"Boolean",
"getAcl",
")",
"throws",
"APIException",
"{",
"String",
"url",
"=",
"getUrl",
"(",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"HashMap",
... | Gets a single page of the directory listing. Subsquent pages are fetched with the returned marker value.
@param marker indicates the specific page to fetch; first page is fetched if null
@return a page of files and directories that exist within this directory
@throws APIException if there were any problems communicatin... | [
"Gets",
"a",
"single",
"page",
"of",
"the",
"directory",
"listing",
".",
"Subsquent",
"pages",
"are",
"fetched",
"with",
"the",
"returned",
"marker",
"value",
"."
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataDirectory.java#L201-L213 |
4,524 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataObject.java | DataObject.getTrimmedPath | private static String getTrimmedPath(String path) {
String result = path;
if (result.endsWith("/")) {
result = result.substring(0, result.length() - 1);
}
return result;
} | java | private static String getTrimmedPath(String path) {
String result = path;
if (result.endsWith("/")) {
result = result.substring(0, result.length() - 1);
}
return result;
} | [
"private",
"static",
"String",
"getTrimmedPath",
"(",
"String",
"path",
")",
"{",
"String",
"result",
"=",
"path",
";",
"if",
"(",
"result",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"result",
"=",
"result",
".",
"substring",
"(",
"0",
",",
"result... | a slash and those that don't. | [
"a",
"slash",
"and",
"those",
"that",
"don",
"t",
"."
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataObject.java#L73-L79 |
4,525 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.exists | public boolean exists() throws APIException {
HttpResponse response = client.head(getUrl());
int status = response.getStatusLine().getStatusCode();
if(status != 200 && status != 404) {
throw APIException.fromHttpResponse(response);
}
return (200 == status);
} | java | public boolean exists() throws APIException {
HttpResponse response = client.head(getUrl());
int status = response.getStatusLine().getStatusCode();
if(status != 200 && status != 404) {
throw APIException.fromHttpResponse(response);
}
return (200 == status);
} | [
"public",
"boolean",
"exists",
"(",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"head",
"(",
"getUrl",
"(",
")",
")",
";",
"int",
"status",
"=",
"response",
".",
"getStatusLine",
"(",
")",
".",
"getStatusCode",
"(",
... | Returns whether the file exists in the Data API
@return true iff the file exists
@throws APIException if there were any problems communicating with the DataAPI | [
"Returns",
"whether",
"the",
"file",
"exists",
"in",
"the",
"Data",
"API"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L36-L43 |
4,526 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.getFile | public File getFile() throws APIException, IOException {
String filename = getName();
int extensionIndex = filename.lastIndexOf('.');
String body;
String ext;
if(extensionIndex <= 0) {
// No extension
body = filename;
ext = "";
} else {... | java | public File getFile() throws APIException, IOException {
String filename = getName();
int extensionIndex = filename.lastIndexOf('.');
String body;
String ext;
if(extensionIndex <= 0) {
// No extension
body = filename;
ext = "";
} else {... | [
"public",
"File",
"getFile",
"(",
")",
"throws",
"APIException",
",",
"IOException",
"{",
"String",
"filename",
"=",
"getName",
"(",
")",
";",
"int",
"extensionIndex",
"=",
"filename",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"String",
"body",
";",
"... | Gets the data for this file and saves it to a local temporary file
@return the data as a local temporary file
@throws APIException if there were any problems communicating with the DataAPI
@throws IOException if there were any problems consuming the response content | [
"Gets",
"the",
"data",
"for",
"this",
"file",
"and",
"saves",
"it",
"to",
"a",
"local",
"temporary",
"file"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L51-L73 |
4,527 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.getInputStream | public InputStream getInputStream() throws APIException, IOException {
final HttpResponse response = client.get(getUrl());
HttpClientHelpers.throwIfNotOk(response);
return response.getEntity().getContent();
} | java | public InputStream getInputStream() throws APIException, IOException {
final HttpResponse response = client.get(getUrl());
HttpClientHelpers.throwIfNotOk(response);
return response.getEntity().getContent();
} | [
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"APIException",
",",
"IOException",
"{",
"final",
"HttpResponse",
"response",
"=",
"client",
".",
"get",
"(",
"getUrl",
"(",
")",
")",
";",
"HttpClientHelpers",
".",
"throwIfNotOk",
"(",
"response",
... | Gets the data for this file as an InputStream
@return the data as an InputStream
@throws APIException if there were any problems communicating with the Algorithmia API
@throws IOException if there were any problems consuming the response content | [
"Gets",
"the",
"data",
"for",
"this",
"file",
"as",
"an",
"InputStream"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L81-L85 |
4,528 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.put | public void put(String data,Charset charset) throws APIException {
HttpResponse response = client.put(getUrl(), new StringEntity(data, charset));
HttpClientHelpers.throwIfNotOk(response);
} | java | public void put(String data,Charset charset) throws APIException {
HttpResponse response = client.put(getUrl(), new StringEntity(data, charset));
HttpClientHelpers.throwIfNotOk(response);
} | [
"public",
"void",
"put",
"(",
"String",
"data",
",",
"Charset",
"charset",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"put",
"(",
"getUrl",
"(",
")",
",",
"new",
"StringEntity",
"(",
"data",
",",
"charset",
")",
"... | Upload string data to this file as text using a custom Charset
@param data the data to upload
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Upload",
"string",
"data",
"to",
"this",
"file",
"as",
"text",
"using",
"a",
"custom",
"Charset"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L133-L136 |
4,529 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.put | public void put(byte[] data) throws APIException {
HttpResponse response = client.put(getUrl(), new ByteArrayEntity(data, ContentType.APPLICATION_OCTET_STREAM));
HttpClientHelpers.throwIfNotOk(response);
} | java | public void put(byte[] data) throws APIException {
HttpResponse response = client.put(getUrl(), new ByteArrayEntity(data, ContentType.APPLICATION_OCTET_STREAM));
HttpClientHelpers.throwIfNotOk(response);
} | [
"public",
"void",
"put",
"(",
"byte",
"[",
"]",
"data",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"put",
"(",
"getUrl",
"(",
")",
",",
"new",
"ByteArrayEntity",
"(",
"data",
",",
"ContentType",
".",
"APPLICATION_OC... | Upload raw data to this file as binary
@param data the data to upload
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Upload",
"raw",
"data",
"to",
"this",
"file",
"as",
"binary"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L143-L146 |
4,530 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/data/DataFile.java | DataFile.put | public void put(InputStream is) throws APIException {
HttpResponse response = client.put(getUrl(), new InputStreamEntity(is, -1, ContentType.APPLICATION_OCTET_STREAM));
HttpClientHelpers.throwIfNotOk(response);
} | java | public void put(InputStream is) throws APIException {
HttpResponse response = client.put(getUrl(), new InputStreamEntity(is, -1, ContentType.APPLICATION_OCTET_STREAM));
HttpClientHelpers.throwIfNotOk(response);
} | [
"public",
"void",
"put",
"(",
"InputStream",
"is",
")",
"throws",
"APIException",
"{",
"HttpResponse",
"response",
"=",
"client",
".",
"put",
"(",
"getUrl",
"(",
")",
",",
"new",
"InputStreamEntity",
"(",
"is",
",",
"-",
"1",
",",
"ContentType",
".",
"AP... | Upload raw data to this file as an input stream
@param is the input stream of data to upload
@throws APIException if there were any problems communicating with the Algorithmia API | [
"Upload",
"raw",
"data",
"to",
"this",
"file",
"as",
"an",
"input",
"stream"
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/data/DataFile.java#L153-L156 |
4,531 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/algo/Algorithm.java | Algorithm.pipe | public AlgoResponse pipe(Object input) throws APIException {
if (input instanceof String) {
return pipeRequest((String)input,ContentType.Text);
} else if (input instanceof byte[]) {
return pipeBinaryRequest((byte[])input);
} else {
return pipeRequest(gson.toJs... | java | public AlgoResponse pipe(Object input) throws APIException {
if (input instanceof String) {
return pipeRequest((String)input,ContentType.Text);
} else if (input instanceof byte[]) {
return pipeBinaryRequest((byte[])input);
} else {
return pipeRequest(gson.toJs... | [
"public",
"AlgoResponse",
"pipe",
"(",
"Object",
"input",
")",
"throws",
"APIException",
"{",
"if",
"(",
"input",
"instanceof",
"String",
")",
"{",
"return",
"pipeRequest",
"(",
"(",
"String",
")",
"input",
",",
"ContentType",
".",
"Text",
")",
";",
"}",
... | Calls the Algorithmia API for a given input.
Attempts to automatically serialize the input to JSON.
@param input algorithm input, will automatically be converted into JSON
@return algorithm result (AlgoSuccess or AlgoFailure)
@throws APIException if there is a problem communication with the Algorithmia API. | [
"Calls",
"the",
"Algorithmia",
"API",
"for",
"a",
"given",
"input",
".",
"Attempts",
"to",
"automatically",
"serialize",
"the",
"input",
"to",
"JSON",
"."
] | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/algo/Algorithm.java#L94-L102 |
4,532 | algorithmiaio/algorithmia-java | src/main/java/com/algorithmia/algo/Algorithm.java | Algorithm.pipeAsync | public FutureAlgoResponse pipeAsync(Object input) {
final Gson gson = new Gson();
final JsonElement inputJson = gson.toJsonTree(input);
return pipeJsonAsync(inputJson.toString());
} | java | public FutureAlgoResponse pipeAsync(Object input) {
final Gson gson = new Gson();
final JsonElement inputJson = gson.toJsonTree(input);
return pipeJsonAsync(inputJson.toString());
} | [
"public",
"FutureAlgoResponse",
"pipeAsync",
"(",
"Object",
"input",
")",
"{",
"final",
"Gson",
"gson",
"=",
"new",
"Gson",
"(",
")",
";",
"final",
"JsonElement",
"inputJson",
"=",
"gson",
".",
"toJsonTree",
"(",
"input",
")",
";",
"return",
"pipeJsonAsync",... | Calls the Algorithmia API asynchronously for a given input.
Attempts to automatically serialize the input to JSON.
The future response will complete when the algorithm has completed or errored
@param input algorithm input, will automatically be converted into JSON
@return future algorithm result (AlgoSuccess or AlgoFa... | [
"Calls",
"the",
"Algorithmia",
"API",
"asynchronously",
"for",
"a",
"given",
"input",
".",
"Attempts",
"to",
"automatically",
"serialize",
"the",
"input",
"to",
"JSON",
".",
"The",
"future",
"response",
"will",
"complete",
"when",
"the",
"algorithm",
"has",
"c... | 64bfdbd426e2d7f659be06d230523253e642a730 | https://github.com/algorithmiaio/algorithmia-java/blob/64bfdbd426e2d7f659be06d230523253e642a730/src/main/java/com/algorithmia/algo/Algorithm.java#L112-L116 |
4,533 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpClient.java | MailChimpClient.execute | public <R> R execute(MailChimpMethod<R> method) throws IOException, MailChimpException {
final Gson gson = MailChimpGsonFactory.createGson();
JsonElement result = execute(buildUrl(method), gson.toJsonTree(method), method.getMetaInfo().version());
if(result.isJsonObject()) {
JsonElement error = result.getAsJso... | java | public <R> R execute(MailChimpMethod<R> method) throws IOException, MailChimpException {
final Gson gson = MailChimpGsonFactory.createGson();
JsonElement result = execute(buildUrl(method), gson.toJsonTree(method), method.getMetaInfo().version());
if(result.isJsonObject()) {
JsonElement error = result.getAsJso... | [
"public",
"<",
"R",
">",
"R",
"execute",
"(",
"MailChimpMethod",
"<",
"R",
">",
"method",
")",
"throws",
"IOException",
",",
"MailChimpException",
"{",
"final",
"Gson",
"gson",
"=",
"MailChimpGsonFactory",
".",
"createGson",
"(",
")",
";",
"JsonElement",
"re... | Execute MailChimp API method.
@param method MailChimp API method to be executed
@return execution result | [
"Execute",
"MailChimp",
"API",
"method",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpClient.java#L92-L105 |
4,534 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpClient.java | MailChimpClient.close | @Override
public void close() {
try {
connection.close();
} catch(IOException e) {
log.log(Level.WARNING, "Could not close connection", e);
}
} | java | @Override
public void close() {
try {
connection.close();
} catch(IOException e) {
log.log(Level.WARNING, "Could not close connection", e);
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"try",
"{",
"connection",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"log",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"Could not close connection\"",
"... | Release resources associated with the connection to MailChimp API service point. | [
"Release",
"resources",
"associated",
"with",
"the",
"connection",
"to",
"MailChimp",
"API",
"service",
"point",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpClient.java#L142-L149 |
4,535 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpObject.java | MailChimpObject.remove | @Override
public Object remove(Object key) {
if(key instanceof String && reflective.containsKey((String) key)) {
throw new ReflectiveValueRemovalException((String) key);
} else {
return regular.remove(key);
}
} | java | @Override
public Object remove(Object key) {
if(key instanceof String && reflective.containsKey((String) key)) {
throw new ReflectiveValueRemovalException((String) key);
} else {
return regular.remove(key);
}
} | [
"@",
"Override",
"public",
"Object",
"remove",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"key",
"instanceof",
"String",
"&&",
"reflective",
".",
"containsKey",
"(",
"(",
"String",
")",
"key",
")",
")",
"{",
"throw",
"new",
"ReflectiveValueRemovalException",... | Removes a regular mapping for a key from this map if it is present.
@param key key for a regular mapping
@return the previous value associated with key, or null if there was no mapping for key
@throws IllegalArgumentException if key is associated with a reflective mapping | [
"Removes",
"a",
"regular",
"mapping",
"for",
"a",
"key",
"from",
"this",
"map",
"if",
"it",
"is",
"present",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpObject.java#L268-L275 |
4,536 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpObject.java | MailChimpObject.fromJson | public static <T extends MailChimpObject> T fromJson(String json, Class<T> clazz) {
try {
return MailChimpGsonFactory.createGson().fromJson(json, clazz);
} catch(JsonParseException e) {
throw new IllegalArgumentException(e);
}
} | java | public static <T extends MailChimpObject> T fromJson(String json, Class<T> clazz) {
try {
return MailChimpGsonFactory.createGson().fromJson(json, clazz);
} catch(JsonParseException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"<",
"T",
"extends",
"MailChimpObject",
">",
"T",
"fromJson",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"try",
"{",
"return",
"MailChimpGsonFactory",
".",
"createGson",
"(",
")",
".",
"fromJson",
"(",
"jso... | Deserializes an object from JSON.
@throws IllegalArgumentException if <code>json</code> cannot be deserialized to an object of class <code>clazz</code>. | [
"Deserializes",
"an",
"object",
"from",
"JSON",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpObject.java#L383-L389 |
4,537 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpMethod.java | MailChimpMethod.getMetaInfo | public final Method getMetaInfo() {
for(Class<?> c=getClass(); c != null; c=c.getSuperclass()) {
Method a = c.getAnnotation(Method.class);
if(a != null) {
return a;
}
}
throw new IllegalArgumentException("Neither "+getClass()+" nor its superclasses are annotated with "+Method.class);
} | java | public final Method getMetaInfo() {
for(Class<?> c=getClass(); c != null; c=c.getSuperclass()) {
Method a = c.getAnnotation(Method.class);
if(a != null) {
return a;
}
}
throw new IllegalArgumentException("Neither "+getClass()+" nor its superclasses are annotated with "+Method.class);
} | [
"public",
"final",
"Method",
"getMetaInfo",
"(",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"c",
"=",
"getClass",
"(",
")",
";",
"c",
"!=",
"null",
";",
"c",
"=",
"c",
".",
"getSuperclass",
"(",
")",
")",
"{",
"Method",
"a",
"=",
"c",
".",
... | Get the MailChimp API method meta-info.
@throws IllegalArgumentException if neither this class nor any of its superclasses
are annotated with {@link Method}. | [
"Get",
"the",
"MailChimp",
"API",
"method",
"meta",
"-",
"info",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpMethod.java#L76-L85 |
4,538 | Ecwid/ecwid-mailchimp | src/main/java/com/ecwid/mailchimp/MailChimpMethod.java | MailChimpMethod.getResultType | public final Type getResultType() {
Type type = resultTypeToken.getType();
if (type instanceof Class || type instanceof ParameterizedType || type instanceof GenericArrayType) {
return type;
} else {
throw new IllegalArgumentException("Cannot resolve result type: "+resultTypeToken);
}
} | java | public final Type getResultType() {
Type type = resultTypeToken.getType();
if (type instanceof Class || type instanceof ParameterizedType || type instanceof GenericArrayType) {
return type;
} else {
throw new IllegalArgumentException("Cannot resolve result type: "+resultTypeToken);
}
} | [
"public",
"final",
"Type",
"getResultType",
"(",
")",
"{",
"Type",
"type",
"=",
"resultTypeToken",
".",
"getType",
"(",
")",
";",
"if",
"(",
"type",
"instanceof",
"Class",
"||",
"type",
"instanceof",
"ParameterizedType",
"||",
"type",
"instanceof",
"GenericArr... | Get the method result type. | [
"Get",
"the",
"method",
"result",
"type",
"."
] | 8acb37d7677bd494879d4db11f3c42ba4c85eb36 | https://github.com/Ecwid/ecwid-mailchimp/blob/8acb37d7677bd494879d4db11f3c42ba4c85eb36/src/main/java/com/ecwid/mailchimp/MailChimpMethod.java#L90-L97 |
4,539 | pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2UserDetailsService.java | OAuth2UserDetailsService.postCreatedOrEnabledUser | private void postCreatedOrEnabledUser(UserDetails userDetails, Map<String, Object> userInfo) {
if (oAuth2PostCreatedOrEnabledUserService != null) {
oAuth2PostCreatedOrEnabledUserService.postCreatedOrEnabledUser(userDetails, userInfo);
}
} | java | private void postCreatedOrEnabledUser(UserDetails userDetails, Map<String, Object> userInfo) {
if (oAuth2PostCreatedOrEnabledUserService != null) {
oAuth2PostCreatedOrEnabledUserService.postCreatedOrEnabledUser(userDetails, userInfo);
}
} | [
"private",
"void",
"postCreatedOrEnabledUser",
"(",
"UserDetails",
"userDetails",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"userInfo",
")",
"{",
"if",
"(",
"oAuth2PostCreatedOrEnabledUserService",
"!=",
"null",
")",
"{",
"oAuth2PostCreatedOrEnabledUserService",
... | Extension point to allow sub classes to optionally do some processing after a user has been created or enabled.
For example they could set something in the session so that the authentication success handler can treat
the first log in differently.
@param userDetails The {@link UserDetails} object created by
{@link OAuth... | [
"Extension",
"point",
"to",
"allow",
"sub",
"classes",
"to",
"optionally",
"do",
"some",
"processing",
"after",
"a",
"user",
"has",
"been",
"created",
"or",
"enabled",
".",
"For",
"example",
"they",
"could",
"set",
"something",
"in",
"the",
"session",
"so",
... | c0258823493e268495c9752c5d752f74c6809c6b | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2UserDetailsService.java#L99-L103 |
4,540 | pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2ServiceProperties.java | OAuth2ServiceProperties.afterPropertiesSet | @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(userAuthorisationUri, "The userAuthorisationUri must be set");
Assert.notNull(redirectUri, "The redirectUri must be set");
Assert.notNull(accessTokenUri, "The accessTokenUri must be set");
Assert.notNull(cli... | java | @Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(userAuthorisationUri, "The userAuthorisationUri must be set");
Assert.notNull(redirectUri, "The redirectUri must be set");
Assert.notNull(accessTokenUri, "The accessTokenUri must be set");
Assert.notNull(cli... | [
"@",
"Override",
"public",
"void",
"afterPropertiesSet",
"(",
")",
"throws",
"Exception",
"{",
"Assert",
".",
"notNull",
"(",
"userAuthorisationUri",
",",
"\"The userAuthorisationUri must be set\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"redirectUri",
",",
"\"The... | Check whether all required properties have been set
@throws Exception in the event of misconfiguration (such
as failure to set an essential property) or if initialization fails. | [
"Check",
"whether",
"all",
"required",
"properties",
"have",
"been",
"set"
] | c0258823493e268495c9752c5d752f74c6809c6b | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2ServiceProperties.java#L63-L71 |
4,541 | pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java | OAuth2AuthenticationFilter.checkStateParameter | protected void checkStateParameter(HttpSession session, Map<String, String[]> parameters)
throws AuthenticationException {
String originalState = (String)session.getAttribute(oAuth2ServiceProperties.getStateParamName());
String receivedStates[] = parameters.get(oAuth2ServiceProperties.getSt... | java | protected void checkStateParameter(HttpSession session, Map<String, String[]> parameters)
throws AuthenticationException {
String originalState = (String)session.getAttribute(oAuth2ServiceProperties.getStateParamName());
String receivedStates[] = parameters.get(oAuth2ServiceProperties.getSt... | [
"protected",
"void",
"checkStateParameter",
"(",
"HttpSession",
"session",
",",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parameters",
")",
"throws",
"AuthenticationException",
"{",
"String",
"originalState",
"=",
"(",
"String",
")",
"session",
".",
... | Check the state parameter to ensure it is the same as was originally sent. Subclasses can override this
behaviour if they so choose, but it is not recommended.
@param session The http session, which will contain the original scope as an attribute.
@param parameters The parameters received from the OAuth 2 Provider, whi... | [
"Check",
"the",
"state",
"parameter",
"to",
"ensure",
"it",
"is",
"the",
"same",
"as",
"was",
"originally",
"sent",
".",
"Subclasses",
"can",
"override",
"this",
"behaviour",
"if",
"they",
"so",
"choose",
"but",
"it",
"is",
"not",
"recommended",
"."
] | c0258823493e268495c9752c5d752f74c6809c6b | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java#L107-L121 |
4,542 | pwheel/spring-security-oauth2-client | src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java | OAuth2AuthenticationFilter.afterPropertiesSet | @Override
public void afterPropertiesSet() {
super.afterPropertiesSet();
Assert.notNull(oAuth2ServiceProperties);
Assert.isTrue(oAuth2ServiceProperties.getRedirectUri().toString().endsWith(super.getFilterProcessesUrl()),
"The filter must be configured to be listening on the r... | java | @Override
public void afterPropertiesSet() {
super.afterPropertiesSet();
Assert.notNull(oAuth2ServiceProperties);
Assert.isTrue(oAuth2ServiceProperties.getRedirectUri().toString().endsWith(super.getFilterProcessesUrl()),
"The filter must be configured to be listening on the r... | [
"@",
"Override",
"public",
"void",
"afterPropertiesSet",
"(",
")",
"{",
"super",
".",
"afterPropertiesSet",
"(",
")",
";",
"Assert",
".",
"notNull",
"(",
"oAuth2ServiceProperties",
")",
";",
"Assert",
".",
"isTrue",
"(",
"oAuth2ServiceProperties",
".",
"getRedir... | Check properties are set | [
"Check",
"properties",
"are",
"set"
] | c0258823493e268495c9752c5d752f74c6809c6b | https://github.com/pwheel/spring-security-oauth2-client/blob/c0258823493e268495c9752c5d752f74c6809c6b/src/main/java/com/racquettrack/security/oauth/OAuth2AuthenticationFilter.java#L165-L171 |
4,543 | tikivn/NoAdapter | noadapter/src/main/java/vn/tiki/noadapter2/AbsViewHolder.java | AbsViewHolder.bind | public void bind(Object item) {
this.item = item;
if (onItemBindListener != null) {
onItemBindListener.onItemBind(itemView, item, getAdapterPosition());
}
} | java | public void bind(Object item) {
this.item = item;
if (onItemBindListener != null) {
onItemBindListener.onItemBind(itemView, item, getAdapterPosition());
}
} | [
"public",
"void",
"bind",
"(",
"Object",
"item",
")",
"{",
"this",
".",
"item",
"=",
"item",
";",
"if",
"(",
"onItemBindListener",
"!=",
"null",
")",
"{",
"onItemBindListener",
".",
"onItemBind",
"(",
"itemView",
",",
"item",
",",
"getAdapterPosition",
"("... | Called to update view
@param item data | [
"Called",
"to",
"update",
"view"
] | eee9c86bddcb0ddc4ab473efe2d14252e813cca4 | https://github.com/tikivn/NoAdapter/blob/eee9c86bddcb0ddc4ab473efe2d14252e813cca4/noadapter/src/main/java/vn/tiki/noadapter2/AbsViewHolder.java#L26-L31 |
4,544 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java | BigIntStringChecksum.startsWithPrefix | public static boolean startsWithPrefix(final String input)
{
boolean ret = false;
if (input != null)
{
ret = input.toLowerCase().startsWith(PREFIX_BIGINT_DASH_CHECKSUM);
}
else
{
ret = false;
}
return ret;
} | java | public static boolean startsWithPrefix(final String input)
{
boolean ret = false;
if (input != null)
{
ret = input.toLowerCase().startsWith(PREFIX_BIGINT_DASH_CHECKSUM);
}
else
{
ret = false;
}
return ret;
} | [
"public",
"static",
"boolean",
"startsWithPrefix",
"(",
"final",
"String",
"input",
")",
"{",
"boolean",
"ret",
"=",
"false",
";",
"if",
"(",
"input",
"!=",
"null",
")",
"{",
"ret",
"=",
"input",
".",
"toLowerCase",
"(",
")",
".",
"startsWith",
"(",
"P... | Utility to test if the input string can even -possibly- be a BigIntStringChecksum encoded.
This is check is "necessary, but not sufficient" for the input string
to parse correctly.
@param input the string to check
@return true if the string starts with (case-insensitive)
BigIntStringChecksum.PREFIX_BIGINT_DASH_CHECKSU... | [
"Utility",
"to",
"test",
"if",
"the",
"input",
"string",
"can",
"even",
"-",
"possibly",
"-",
"be",
"a",
"BigIntStringChecksum",
"encoded",
".",
"This",
"is",
"check",
"is",
"necessary",
"but",
"not",
"sufficient",
"for",
"the",
"input",
"string",
"to",
"p... | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java#L109-L121 |
4,545 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java | BigIntStringChecksum.fromString | public static BigIntStringChecksum fromString(String bics)
{
boolean returnIsNegative = false;
BigIntStringChecksum ret = null;
if (bics == null)
{
createThrow("Input cannot be null", bics);
}
if (startsWithPrefix(bics))
{
String nopref... | java | public static BigIntStringChecksum fromString(String bics)
{
boolean returnIsNegative = false;
BigIntStringChecksum ret = null;
if (bics == null)
{
createThrow("Input cannot be null", bics);
}
if (startsWithPrefix(bics))
{
String nopref... | [
"public",
"static",
"BigIntStringChecksum",
"fromString",
"(",
"String",
"bics",
")",
"{",
"boolean",
"returnIsNegative",
"=",
"false",
";",
"BigIntStringChecksum",
"ret",
"=",
"null",
";",
"if",
"(",
"bics",
"==",
"null",
")",
"{",
"createThrow",
"(",
"\"Inpu... | Take input string, and create the instance.
As of version 1.3.2 forward, the case of the INPUT is not relevant.
Note, however, that when the Checksum CCCCCC is computed, the hex hhhhhh- string
is LOWER CASE.
@param bics string in "bigintcs:hhhhhh-hhhhhh-CCCCCC" format
@return big integer string checksum object
@throws... | [
"Take",
"input",
"string",
"and",
"create",
"the",
"instance",
".",
"As",
"of",
"version",
"1",
".",
"3",
".",
"2",
"forward",
"the",
"case",
"of",
"the",
"INPUT",
"is",
"not",
"relevant",
".",
"Note",
"however",
"that",
"when",
"the",
"Checksum",
"CCC... | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java#L136-L193 |
4,546 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java | BigIntStringChecksum.fromStringOrNull | public static BigIntStringChecksum fromStringOrNull(String bics)
{
BigIntStringChecksum ret;
if (bics == null)
{
ret = null;
}
else if (! startsWithPrefix(bics))
{
ret = null;
}
else
{
try
{
... | java | public static BigIntStringChecksum fromStringOrNull(String bics)
{
BigIntStringChecksum ret;
if (bics == null)
{
ret = null;
}
else if (! startsWithPrefix(bics))
{
ret = null;
}
else
{
try
{
... | [
"public",
"static",
"BigIntStringChecksum",
"fromStringOrNull",
"(",
"String",
"bics",
")",
"{",
"BigIntStringChecksum",
"ret",
";",
"if",
"(",
"bics",
"==",
"null",
")",
"{",
"ret",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"!",
"startsWithPrefix",
"(",
"... | Take string as input, and either return an instance or return null.
@param bics string in "bigintcs:hhhhhh-hhhhhh-CCCCCC" format
@return big integer string checksum object
OR null if incorrect format, error parsing, etc. | [
"Take",
"string",
"as",
"input",
"and",
"either",
"return",
"an",
"instance",
"or",
"return",
"null",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/BigIntStringChecksum.java#L202-L235 |
4,547 | androidsx/rate-me | LibraryRateMe/src/com/androidsx/rateme/RateMeDialogTimer.java | RateMeDialogTimer.setOptOut | public static void setOptOut(final Context context, boolean optOut) {
SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
Editor editor = pref.edit();
editor.putBoolean(KEY_OPT_OUT, optOut);
editor.apply();
} | java | public static void setOptOut(final Context context, boolean optOut) {
SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
Editor editor = pref.edit();
editor.putBoolean(KEY_OPT_OUT, optOut);
editor.apply();
} | [
"public",
"static",
"void",
"setOptOut",
"(",
"final",
"Context",
"context",
",",
"boolean",
"optOut",
")",
"{",
"SharedPreferences",
"pref",
"=",
"context",
".",
"getSharedPreferences",
"(",
"PREF_NAME",
",",
"Context",
".",
"MODE_PRIVATE",
")",
";",
"Editor",
... | Set opt out flag. If it is true, the rate dialog will never shown unless app data is cleared. | [
"Set",
"opt",
"out",
"flag",
".",
"If",
"it",
"is",
"true",
"the",
"rate",
"dialog",
"will",
"never",
"shown",
"unless",
"app",
"data",
"is",
"cleared",
"."
] | a779706454ba585a09110745ac3035f28920524a | https://github.com/androidsx/rate-me/blob/a779706454ba585a09110745ac3035f28920524a/LibraryRateMe/src/com/androidsx/rateme/RateMeDialogTimer.java#L97-L102 |
4,548 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/EasyLinearEquation.java | EasyLinearEquation.createForPolynomial | public static EasyLinearEquation createForPolynomial(final BigInteger[] xarray,
final BigInteger[] fofxarray)
{
if (xarray.length != fofxarray.length)
{
throw new SecretShareException("Unequal length arrays are not allowed");
... | java | public static EasyLinearEquation createForPolynomial(final BigInteger[] xarray,
final BigInteger[] fofxarray)
{
if (xarray.length != fofxarray.length)
{
throw new SecretShareException("Unequal length arrays are not allowed");
... | [
"public",
"static",
"EasyLinearEquation",
"createForPolynomial",
"(",
"final",
"BigInteger",
"[",
"]",
"xarray",
",",
"final",
"BigInteger",
"[",
"]",
"fofxarray",
")",
"{",
"if",
"(",
"xarray",
".",
"length",
"!=",
"fofxarray",
".",
"length",
")",
"{",
"thr... | Create solver for polynomial equations.
Polynomial linear equations are a special case, because the C,x,x^2,x^3 coefficients
can be turned into the rows we need by being given:
a) which "x" values were used
b) what "constant" values were computed
This information happens to be exactly what the holder of a "Secret" in
... | [
"Create",
"solver",
"for",
"polynomial",
"equations",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/EasyLinearEquation.java#L127-L148 |
4,549 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/EasyLinearEquation.java | EasyLinearEquation.create | public static EasyLinearEquation create(BigInteger[][] inMatrix)
{
EasyLinearEquation ret = null;
final int width = inMatrix[0].length;
for (BigInteger[] row : inMatrix)
{
if (width != row.length)
{
throw new SecretShareException("All rows must... | java | public static EasyLinearEquation create(BigInteger[][] inMatrix)
{
EasyLinearEquation ret = null;
final int width = inMatrix[0].length;
for (BigInteger[] row : inMatrix)
{
if (width != row.length)
{
throw new SecretShareException("All rows must... | [
"public",
"static",
"EasyLinearEquation",
"create",
"(",
"BigInteger",
"[",
"]",
"[",
"]",
"inMatrix",
")",
"{",
"EasyLinearEquation",
"ret",
"=",
"null",
";",
"final",
"int",
"width",
"=",
"inMatrix",
"[",
"0",
"]",
".",
"length",
";",
"for",
"(",
"BigI... | Most typical factory, for BigInteger arrays.
@param inMatrix given in BigIntegers, where the first column is the constant
and all the other columns are the variables
@return instance | [
"Most",
"typical",
"factory",
"for",
"BigInteger",
"arrays",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/EasyLinearEquation.java#L172-L192 |
4,550 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.getPrimeUsedFor8192bigSecretPayload | public static BigInteger getPrimeUsedFor8192bigSecretPayload()
{
// 2018: It took 6 seconds to check using alpertron.com.ar/ECM.HTM "WebAssembly version".
// (comparison: the 4096 prime, below, took 1 second)
//
// This number is 2470 digits long
BigInteger p8192one =
... | java | public static BigInteger getPrimeUsedFor8192bigSecretPayload()
{
// 2018: It took 6 seconds to check using alpertron.com.ar/ECM.HTM "WebAssembly version".
// (comparison: the 4096 prime, below, took 1 second)
//
// This number is 2470 digits long
BigInteger p8192one =
... | [
"public",
"static",
"BigInteger",
"getPrimeUsedFor8192bigSecretPayload",
"(",
")",
"{",
"// 2018: It took 6 seconds to check using alpertron.com.ar/ECM.HTM \"WebAssembly version\".",
"// (comparison: the 4096 prime, below, took 1 second)",
"//",
"// This number is 2470 digits long",
"Big... | All primes were tested with 100,000 iterations of Miller-Rabin | [
"All",
"primes",
"were",
"tested",
"with",
"100",
"000",
"iterations",
"of",
"Miller",
"-",
"Rabin"
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L201-L330 |
4,551 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.checkAndReturn | private static BigInteger checkAndReturn(String which,
BigInteger expected,
String asbigintcs)
{
BigInteger other =
BigIntStringChecksum.fromString(asbigintcs).asBigInteger();
if (expected.equa... | java | private static BigInteger checkAndReturn(String which,
BigInteger expected,
String asbigintcs)
{
BigInteger other =
BigIntStringChecksum.fromString(asbigintcs).asBigInteger();
if (expected.equa... | [
"private",
"static",
"BigInteger",
"checkAndReturn",
"(",
"String",
"which",
",",
"BigInteger",
"expected",
",",
"String",
"asbigintcs",
")",
"{",
"BigInteger",
"other",
"=",
"BigIntStringChecksum",
".",
"fromString",
"(",
"asbigintcs",
")",
".",
"asBigInteger",
"... | Guard against accidental changes to the strings.
@param which caller
@param expected value as biginteger
@param asbigintcs value as big-integer-checksum string
@return expected or throw exception
@throws SecretShareException if expected does not match asbigintcs | [
"Guard",
"against",
"accidental",
"changes",
"to",
"the",
"strings",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L470-L485 |
4,552 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.split | public SplitSecretOutput split(final BigInteger secret,
final Random random)
{
if (secret == null)
{
throw new SecretShareException("Secret cannot be null");
}
if (secret.signum() <= 0)
{
throw new SecretShareExceptio... | java | public SplitSecretOutput split(final BigInteger secret,
final Random random)
{
if (secret == null)
{
throw new SecretShareException("Secret cannot be null");
}
if (secret.signum() <= 0)
{
throw new SecretShareExceptio... | [
"public",
"SplitSecretOutput",
"split",
"(",
"final",
"BigInteger",
"secret",
",",
"final",
"Random",
"random",
")",
"{",
"if",
"(",
"secret",
"==",
"null",
")",
"{",
"throw",
"new",
"SecretShareException",
"(",
"\"Secret cannot be null\"",
")",
";",
"}",
"if"... | Split the secret into pieces, where the caller controls the random instance.
@param secret to split
@param random to use for random number generation
@return split secret output instance | [
"Split",
"the",
"secret",
"into",
"pieces",
"where",
"the",
"caller",
"controls",
"the",
"random",
"instance",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L528-L579 |
4,553 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.combine | public CombineOutput combine(final List<ShareInfo> usetheseshares)
{
CombineOutput ret = null;
sanityCheckPublicInfos(publicInfo, usetheseshares);
if (true)
{
println(" SOLVING USING THESE SHARES, mod=" + publicInfo.getPrimeModulus());
for (ShareInfo si : us... | java | public CombineOutput combine(final List<ShareInfo> usetheseshares)
{
CombineOutput ret = null;
sanityCheckPublicInfos(publicInfo, usetheseshares);
if (true)
{
println(" SOLVING USING THESE SHARES, mod=" + publicInfo.getPrimeModulus());
for (ShareInfo si : us... | [
"public",
"CombineOutput",
"combine",
"(",
"final",
"List",
"<",
"ShareInfo",
">",
"usetheseshares",
")",
"{",
"CombineOutput",
"ret",
"=",
"null",
";",
"sanityCheckPublicInfos",
"(",
"publicInfo",
",",
"usetheseshares",
")",
";",
"if",
"(",
"true",
")",
"{",
... | Combine the shares generated by the split to recover the secret.
@param usetheseshares shares to use - only the first "K" of size() will be used
@return the combine output instance [which in turn contains the recovered secret] | [
"Combine",
"the",
"shares",
"generated",
"by",
"the",
"split",
"to",
"recover",
"the",
"secret",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L594-L673 |
4,554 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.combineParanoid | public ParanoidOutput combineParanoid(List<ShareInfo> shares,
ParanoidInput paranoidInput)
{
ParanoidOutput ret = performParanoidCombines(shares, paranoidInput);
if (paranoidInput != null)
{
if (ret.getReconstructedMap().size() != 1)
... | java | public ParanoidOutput combineParanoid(List<ShareInfo> shares,
ParanoidInput paranoidInput)
{
ParanoidOutput ret = performParanoidCombines(shares, paranoidInput);
if (paranoidInput != null)
{
if (ret.getReconstructedMap().size() != 1)
... | [
"public",
"ParanoidOutput",
"combineParanoid",
"(",
"List",
"<",
"ShareInfo",
">",
"shares",
",",
"ParanoidInput",
"paranoidInput",
")",
"{",
"ParanoidOutput",
"ret",
"=",
"performParanoidCombines",
"(",
"shares",
",",
"paranoidInput",
")",
";",
"if",
"(",
"parano... | This version does the combines, and throws an exception if there is not 100% agreement.
@param shares - all shares available to make unique subsets from
@param paranoidInput control over the process
@return ParanoidOutput
@throws SecretShareException if there is not 100% agreement on the reconstructed secret | [
"This",
"version",
"does",
"the",
"combines",
"and",
"throws",
"an",
"exception",
"if",
"there",
"is",
"not",
"100%",
"agreement",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L1142-L1156 |
4,555 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/engine/SecretShare.java | SecretShare.performParanoidCombines | public ParanoidOutput performParanoidCombines(List<ShareInfo> shares,
ParanoidInput paranoidInput)
{
if (paranoidInput == null)
{
return ParanoidOutput.createEmpty();
}
else
{
return performParanoidComb... | java | public ParanoidOutput performParanoidCombines(List<ShareInfo> shares,
ParanoidInput paranoidInput)
{
if (paranoidInput == null)
{
return ParanoidOutput.createEmpty();
}
else
{
return performParanoidComb... | [
"public",
"ParanoidOutput",
"performParanoidCombines",
"(",
"List",
"<",
"ShareInfo",
">",
"shares",
",",
"ParanoidInput",
"paranoidInput",
")",
"{",
"if",
"(",
"paranoidInput",
"==",
"null",
")",
"{",
"return",
"ParanoidOutput",
".",
"createEmpty",
"(",
")",
";... | This version just collects all of the reconstructed secrets.
@param shares to use
@param paranoidInput - control over process
if greater than 0 use that number
if less than 0 OR null no limit
@return ParanoidOutput | [
"This",
"version",
"just",
"collects",
"all",
"of",
"the",
"reconstructed",
"secrets",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/engine/SecretShare.java#L1167-L1178 |
4,556 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/PolyEquationImpl.java | PolyEquationImpl.create | public static PolyEquationImpl create(final int ...args)
{
BigInteger[] bigints = new BigInteger[args.length];
for (int i = 0, n = args.length; i < n; i++)
{
bigints[i] = BigInteger.valueOf(args[i]);
}
return new PolyEquationImpl(bigints);
} | java | public static PolyEquationImpl create(final int ...args)
{
BigInteger[] bigints = new BigInteger[args.length];
for (int i = 0, n = args.length; i < n; i++)
{
bigints[i] = BigInteger.valueOf(args[i]);
}
return new PolyEquationImpl(bigints);
} | [
"public",
"static",
"PolyEquationImpl",
"create",
"(",
"final",
"int",
"...",
"args",
")",
"{",
"BigInteger",
"[",
"]",
"bigints",
"=",
"new",
"BigInteger",
"[",
"args",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"n",
"=",
"args"... | Helper factory to create instances.
Accepts 'int', converts them to BigInteger, and calls the constructor.
@param args as int values
@return instance | [
"Helper",
"factory",
"to",
"create",
"instances",
".",
"Accepts",
"int",
"converts",
"them",
"to",
"BigInteger",
"and",
"calls",
"the",
"constructor",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/PolyEquationImpl.java#L76-L84 |
4,557 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.addMatrix | public E[][] addMatrix(E[][] matrix1, E[][] matrix2)
{
// Check bounds of the two matrices
if ((matrix1.length != matrix2.length) ||
(matrix1[0].length != matrix2[0].length))
{
throw new SecretShareException("The matrices do not have the same size");
}
... | java | public E[][] addMatrix(E[][] matrix1, E[][] matrix2)
{
// Check bounds of the two matrices
if ((matrix1.length != matrix2.length) ||
(matrix1[0].length != matrix2[0].length))
{
throw new SecretShareException("The matrices do not have the same size");
}
... | [
"public",
"E",
"[",
"]",
"[",
"]",
"addMatrix",
"(",
"E",
"[",
"]",
"[",
"]",
"matrix1",
",",
"E",
"[",
"]",
"[",
"]",
"matrix2",
")",
"{",
"// Check bounds of the two matrices",
"if",
"(",
"(",
"matrix1",
".",
"length",
"!=",
"matrix2",
".",
"length... | Add two matrices.
@param matrix1 first
@param matrix2 second
@return maxtrix 1 + 1 | [
"Add",
"two",
"matrices",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L143-L165 |
4,558 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.multiplyMatrix | public E[][] multiplyMatrix(E[][] matrix1, E[][] matrix2)
{
// Check bounds
if (matrix1[0].length != matrix2.length)
{
throw new SecretShareException("The matrices do not have compatible size");
}
// Create result matrix
E[][] result = //(E[][]) new Numbe... | java | public E[][] multiplyMatrix(E[][] matrix1, E[][] matrix2)
{
// Check bounds
if (matrix1[0].length != matrix2.length)
{
throw new SecretShareException("The matrices do not have compatible size");
}
// Create result matrix
E[][] result = //(E[][]) new Numbe... | [
"public",
"E",
"[",
"]",
"[",
"]",
"multiplyMatrix",
"(",
"E",
"[",
"]",
"[",
"]",
"matrix1",
",",
"E",
"[",
"]",
"[",
"]",
"matrix2",
")",
"{",
"// Check bounds",
"if",
"(",
"matrix1",
"[",
"0",
"]",
".",
"length",
"!=",
"matrix2",
".",
"length"... | Multiply two matrices.
@param matrix1 array-array
@param matrix2 array-array
@return matrix 1 * 2 | [
"Multiply",
"two",
"matrices",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L172-L200 |
4,559 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.determinant | public E determinant(E[][] matrix, int r, int s, int i, int j)
{
E a, b, c, d;
a = matrix[r][s];
b = matrix[r][j];
c = matrix[i][s];
d = matrix[i][j];
E ad = multiply(a, d); // matrix[r][s], matrix[i][j]);
E bc = multiply(b, c); // matrix[i][s], matrix[r][j])... | java | public E determinant(E[][] matrix, int r, int s, int i, int j)
{
E a, b, c, d;
a = matrix[r][s];
b = matrix[r][j];
c = matrix[i][s];
d = matrix[i][j];
E ad = multiply(a, d); // matrix[r][s], matrix[i][j]);
E bc = multiply(b, c); // matrix[i][s], matrix[r][j])... | [
"public",
"E",
"determinant",
"(",
"E",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"r",
",",
"int",
"s",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"E",
"a",
",",
"b",
",",
"c",
",",
"d",
";",
"a",
"=",
"matrix",
"[",
"r",
"]",
"[",
"s"... | Return the determinant.
@param matrix array
@param r index
@param s index
@param i index
@param j index
@return element determinant | [
"Return",
"the",
"determinant",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L216-L228 |
4,560 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.print | public static void print(String string, Number[][] matrix2, PrintStream out)
{
if (out == null)
{
return;
}
out.println(string);
printResult(matrix2, out);
} | java | public static void print(String string, Number[][] matrix2, PrintStream out)
{
if (out == null)
{
return;
}
out.println(string);
printResult(matrix2, out);
} | [
"public",
"static",
"void",
"print",
"(",
"String",
"string",
",",
"Number",
"[",
"]",
"[",
"]",
"matrix2",
",",
"PrintStream",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"{",
"return",
";",
"}",
"out",
".",
"println",
"(",
"string",
")"... | Print this array-array.
@param string header
@param matrix2 array-array
@param out printstream | [
"Print",
"this",
"array",
"-",
"array",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L245-L253 |
4,561 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.printResult | public static void printResult(Number[][] m1, PrintStream out)
{
if (out == null)
{
return;
}
for (int i = 0; i < m1.length; i++)
{
for (int j = 0; j < m1[0].length; j++)
{
out.print(" " + m1[i][j]);
}
... | java | public static void printResult(Number[][] m1, PrintStream out)
{
if (out == null)
{
return;
}
for (int i = 0; i < m1.length; i++)
{
for (int j = 0; j < m1[0].length; j++)
{
out.print(" " + m1[i][j]);
}
... | [
"public",
"static",
"void",
"printResult",
"(",
"Number",
"[",
"]",
"[",
"]",
"m1",
",",
"PrintStream",
"out",
")",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"m1",
".",
... | Print array-array.
@param m1 array-array
@param out printstream | [
"Print",
"array",
"-",
"array",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L260-L274 |
4,562 | timtiemens/secretshare | src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java | NumberMatrix.printResult | public static void printResult(Number[][] m1, Number[][] m2, Number[][] m3, char op, PrintStream out)
{
for (int i = 0; i < m1.length; i++)
{
for (int j = 0; j < m1[0].length; j++)
{
out.print(" " + m1[i][j]);
}
if (i == m1.length / 2)... | java | public static void printResult(Number[][] m1, Number[][] m2, Number[][] m3, char op, PrintStream out)
{
for (int i = 0; i < m1.length; i++)
{
for (int j = 0; j < m1[0].length; j++)
{
out.print(" " + m1[i][j]);
}
if (i == m1.length / 2)... | [
"public",
"static",
"void",
"printResult",
"(",
"Number",
"[",
"]",
"[",
"]",
"m1",
",",
"Number",
"[",
"]",
"[",
"]",
"m2",
",",
"Number",
"[",
"]",
"[",
"]",
"m3",
",",
"char",
"op",
",",
"PrintStream",
"out",
")",
"{",
"for",
"(",
"int",
"i"... | Print matrices, the operator, and their operation result.
@param m1 array-array
@param m2 array-array
@param m3 array-array
@param op operator
@param out printstream | [
"Print",
"matrices",
"the",
"operator",
"and",
"their",
"operation",
"result",
"."
] | f5f88929af99ae0ed0df02dc802e40cdb25fceac | https://github.com/timtiemens/secretshare/blob/f5f88929af99ae0ed0df02dc802e40cdb25fceac/src/main/java/com/tiemens/secretshare/math/matrix/NumberMatrix.java#L283-L322 |
4,563 | thorntail/wildfly-config-api | runtime/src/main/java/org/wildfly/swarm/config/runtime/invocation/IndexFactory.java | IndexFactory.createIndex | public synchronized static Index createIndex(Class<?> type) {
Index index = indices.get(type);
if (index == null) {
try {
Indexer indexer = new Indexer();
Class<?> currentType = type;
while ( currentType != null ) {
String c... | java | public synchronized static Index createIndex(Class<?> type) {
Index index = indices.get(type);
if (index == null) {
try {
Indexer indexer = new Indexer();
Class<?> currentType = type;
while ( currentType != null ) {
String c... | [
"public",
"synchronized",
"static",
"Index",
"createIndex",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Index",
"index",
"=",
"indices",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"try",
"{",
"Indexer",
"indexe... | Creates an annotation index for the given entity type | [
"Creates",
"an",
"annotation",
"index",
"for",
"the",
"given",
"entity",
"type"
] | ddb3f3bcb7b85b22c6371415546f567bc44493db | https://github.com/thorntail/wildfly-config-api/blob/ddb3f3bcb7b85b22c6371415546f567bc44493db/runtime/src/main/java/org/wildfly/swarm/config/runtime/invocation/IndexFactory.java#L31-L51 |
4,564 | thorntail/wildfly-config-api | runtime/src/main/java/org/wildfly/swarm/config/runtime/invocation/EntityAdapter.java | EntityAdapter.fromChangeset | public ModelNode fromChangeset(Map<String, Object> changeSet, String... wildcards) {
ClassInfo clazz = null;
Class<?> currentType = getType();
while (clazz == null) {
clazz = index.getClassByName(DotName.createSimple(currentType.getCanonicalName()));
if (clazz == null)... | java | public ModelNode fromChangeset(Map<String, Object> changeSet, String... wildcards) {
ClassInfo clazz = null;
Class<?> currentType = getType();
while (clazz == null) {
clazz = index.getClassByName(DotName.createSimple(currentType.getCanonicalName()));
if (clazz == null)... | [
"public",
"ModelNode",
"fromChangeset",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"changeSet",
",",
"String",
"...",
"wildcards",
")",
"{",
"ClassInfo",
"clazz",
"=",
"null",
";",
"Class",
"<",
"?",
">",
"currentType",
"=",
"getType",
"(",
")",
";",... | Turns a changeset into a composite write attribute operation.
The keys to the changeset are the java property names of the attributes that have been modified.
@param changeSet values of the java properties that changed
@return composite operation | [
"Turns",
"a",
"changeset",
"into",
"a",
"composite",
"write",
"attribute",
"operation",
".",
"The",
"keys",
"to",
"the",
"changeset",
"are",
"the",
"java",
"property",
"names",
"of",
"the",
"attributes",
"that",
"have",
"been",
"modified",
"."
] | ddb3f3bcb7b85b22c6371415546f567bc44493db | https://github.com/thorntail/wildfly-config-api/blob/ddb3f3bcb7b85b22c6371415546f567bc44493db/runtime/src/main/java/org/wildfly/swarm/config/runtime/invocation/EntityAdapter.java#L185-L262 |
4,565 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/Preference.java | Preference.adaptIconTint | private void adaptIconTint() {
Drawable icon = getIcon();
if (icon != null) {
DrawableCompat.setTintList(icon, tintList);
DrawableCompat.setTintMode(icon, tintMode);
}
} | java | private void adaptIconTint() {
Drawable icon = getIcon();
if (icon != null) {
DrawableCompat.setTintList(icon, tintList);
DrawableCompat.setTintMode(icon, tintMode);
}
} | [
"private",
"void",
"adaptIconTint",
"(",
")",
"{",
"Drawable",
"icon",
"=",
"getIcon",
"(",
")",
";",
"if",
"(",
"icon",
"!=",
"null",
")",
"{",
"DrawableCompat",
".",
"setTintList",
"(",
"icon",
",",
"tintList",
")",
";",
"DrawableCompat",
".",
"setTint... | Adapts the tint of the preference's icon. | [
"Adapts",
"the",
"tint",
"of",
"the",
"preference",
"s",
"icon",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/Preference.java#L135-L142 |
4,566 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ActionPreference.java | ActionPreference.obtainTextColor | private void obtainTextColor(@NonNull final TypedArray typedArray) {
ColorStateList colorStateList =
typedArray.getColorStateList(R.styleable.ActionPreference_android_textColor);
if (colorStateList == null) {
colorStateList = ContextCompat
.getColorStateL... | java | private void obtainTextColor(@NonNull final TypedArray typedArray) {
ColorStateList colorStateList =
typedArray.getColorStateList(R.styleable.ActionPreference_android_textColor);
if (colorStateList == null) {
colorStateList = ContextCompat
.getColorStateL... | [
"private",
"void",
"obtainTextColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"ColorStateList",
"colorStateList",
"=",
"typedArray",
".",
"getColorStateList",
"(",
"R",
".",
"styleable",
".",
"ActionPreference_android_textColor",
")",
";",
... | Obtains the text color of the preference's title from a specific typed array.
@param typedArray
The typed array, the color should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"text",
"color",
"of",
"the",
"preference",
"s",
"title",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ActionPreference.java#L110-L120 |
4,567 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java | DigitPickerPreference.obtainNumberOfDigits | private void obtainNumberOfDigits(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.digit_picker_preference_default_number_of_digits);
setNumberOfDigits(typedArray
.getInteger(R.styleable.DigitPickerPreference_num... | java | private void obtainNumberOfDigits(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.digit_picker_preference_default_number_of_digits);
setNumberOfDigits(typedArray
.getInteger(R.styleable.DigitPickerPreference_num... | [
"private",
"void",
"obtainNumberOfDigits",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"digit_picker_pr... | Obtains the number of digits of the numbers, the preference allows to choose, from a specific
typed array.
@param typedArray
The typed array, the number of digits should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"number",
"of",
"digits",
"of",
"the",
"numbers",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java#L176-L181 |
4,568 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java | DigitPickerPreference.getDigit | private int getDigit(final int index, final int number) {
String format = "%0" + getNumberOfDigits() + "d";
String formattedNumber = String.format(Locale.getDefault(), format, number);
String digit = formattedNumber.substring(index, index + 1);
return Integer.valueOf(digit);
} | java | private int getDigit(final int index, final int number) {
String format = "%0" + getNumberOfDigits() + "d";
String formattedNumber = String.format(Locale.getDefault(), format, number);
String digit = formattedNumber.substring(index, index + 1);
return Integer.valueOf(digit);
} | [
"private",
"int",
"getDigit",
"(",
"final",
"int",
"index",
",",
"final",
"int",
"number",
")",
"{",
"String",
"format",
"=",
"\"%0\"",
"+",
"getNumberOfDigits",
"(",
")",
"+",
"\"d\"",
";",
"String",
"formattedNumber",
"=",
"String",
".",
"format",
"(",
... | Returns the the digit, which corresponds to a specific index of a number.
@param index
The index of the digit, which should be retrieved, as an {@link Integer} value
@param number
The number, which contains the digit, which should be retrieved, as an {@link
Integer} value
@return The digit, which corresponds to the gi... | [
"Returns",
"the",
"the",
"digit",
"which",
"corresponds",
"to",
"a",
"specific",
"index",
"of",
"a",
"number",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java#L219-L224 |
4,569 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java | DigitPickerPreference.getMaxNumber | private int getMaxNumber(final int numberOfDigits) {
int result = 0;
for (int i = 0; i < numberOfDigits; i++) {
result += (NUMERIC_SYTEM - 1) * Math.pow(NUMERIC_SYTEM, i);
}
return result;
} | java | private int getMaxNumber(final int numberOfDigits) {
int result = 0;
for (int i = 0; i < numberOfDigits; i++) {
result += (NUMERIC_SYTEM - 1) * Math.pow(NUMERIC_SYTEM, i);
}
return result;
} | [
"private",
"int",
"getMaxNumber",
"(",
"final",
"int",
"numberOfDigits",
")",
"{",
"int",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberOfDigits",
";",
"i",
"++",
")",
"{",
"result",
"+=",
"(",
"NUMERIC_SYTEM",
"-",... | Returns the maximum number, which can be created with a specific number of digits.
@param numberOfDigits
The number of digits as an {@link Integer} value
@return The maximum number, which can be created with the given number of digits, as an
{@link Integer} value | [
"Returns",
"the",
"maximum",
"number",
"which",
"can",
"be",
"created",
"with",
"a",
"specific",
"number",
"of",
"digits",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java#L234-L242 |
4,570 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java | DigitPickerPreference.setNumberOfDigits | public final void setNumberOfDigits(final int numberOfDigits) {
Condition.INSTANCE
.ensureAtLeast(numberOfDigits, 1, "The number of digits must be at least 1");
this.numberOfDigits = numberOfDigits;
setNumber(Math.min(getNumber(), getMaxNumber(numberOfDigits)));
} | java | public final void setNumberOfDigits(final int numberOfDigits) {
Condition.INSTANCE
.ensureAtLeast(numberOfDigits, 1, "The number of digits must be at least 1");
this.numberOfDigits = numberOfDigits;
setNumber(Math.min(getNumber(), getMaxNumber(numberOfDigits)));
} | [
"public",
"final",
"void",
"setNumberOfDigits",
"(",
"final",
"int",
"numberOfDigits",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"numberOfDigits",
",",
"1",
",",
"\"The number of digits must be at least 1\"",
")",
";",
"this",
".",
"numberOf... | Sets the number of digits of the numbers, the preference should allow to choose.
@param numberOfDigits
The number of digits, which should be set, as an {@link Integer} value. The number of
digits must be at least 1 | [
"Sets",
"the",
"number",
"of",
"digits",
"of",
"the",
"numbers",
"the",
"preference",
"should",
"allow",
"to",
"choose",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/DigitPickerPreference.java#L348-L353 |
4,571 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainDecimals | private void obtainDecimals(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_decimals);
setDecimals(typedArray.getInteger(R.styleable.SeekBarPreference_decimals, defaultValue));
} | java | private void obtainDecimals(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_decimals);
setDecimals(typedArray.getInteger(R.styleable.SeekBarPreference_decimals, defaultValue));
} | [
"private",
"void",
"obtainDecimals",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"seek_bar_preference_d... | Obtains the number of decimals of the floating point numbers, the preference allows to
choose, from a specific typed array.
@param typedArray
The typed array, the number of decimals should be obtained from, as an instance of
the class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"number",
"of",
"decimals",
"of",
"the",
"floating",
"point",
"numbers",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L261-L265 |
4,572 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainMinValue | private void obtainMinValue(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_min_value);
setMinValue(typedArray.getInteger(R.styleable.AbstractNumericPreference_min, defaultValue));
} | java | private void obtainMinValue(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_min_value);
setMinValue(typedArray.getInteger(R.styleable.AbstractNumericPreference_min, defaultValue));
} | [
"private",
"void",
"obtainMinValue",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"seek_bar_preference_d... | Obtains the minimum value, the preference allows to choose, from a specific typed array.
@param typedArray
The typed array, the minimum value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"minimum",
"value",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L274-L278 |
4,573 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainMaxValue | private void obtainMaxValue(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_max_value);
setMaxValue(typedArray
.getInteger(R.styleable.AbstractNumericPreference_android_max, defaultVa... | java | private void obtainMaxValue(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.seek_bar_preference_default_max_value);
setMaxValue(typedArray
.getInteger(R.styleable.AbstractNumericPreference_android_max, defaultVa... | [
"private",
"void",
"obtainMaxValue",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"seek_bar_preference_d... | Obtains the maximum value, the preference allows to choose, from a specific typed array.
@param typedArray
The typed array, the maximum value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"maximum",
"value",
"the",
"preference",
"allows",
"to",
"choose",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L287-L292 |
4,574 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainUnit | private void obtainUnit(@NonNull final TypedArray typedArray) {
setUnit(typedArray.getText(R.styleable.AbstractUnitPreference_unit));
} | java | private void obtainUnit(@NonNull final TypedArray typedArray) {
setUnit(typedArray.getText(R.styleable.AbstractUnitPreference_unit));
} | [
"private",
"void",
"obtainUnit",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setUnit",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"AbstractUnitPreference_unit",
")",
")",
";",
"}"
] | Obtains the unit, which is used for textual representation of the preference's value, from a
specific typed array.
@param typedArray
The typed array, the unit should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"unit",
"which",
"is",
"used",
"for",
"textual",
"representation",
"of",
"the",
"preference",
"s",
"value",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L317-L319 |
4,575 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainFloatingPointSeparator | private void obtainFloatingPointSeparator(@NonNull final TypedArray typedArray) {
setFloatingPointSeparator(
typedArray.getText(R.styleable.SeekBarPreference_floatingPointSeparator));
} | java | private void obtainFloatingPointSeparator(@NonNull final TypedArray typedArray) {
setFloatingPointSeparator(
typedArray.getText(R.styleable.SeekBarPreference_floatingPointSeparator));
} | [
"private",
"void",
"obtainFloatingPointSeparator",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setFloatingPointSeparator",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"SeekBarPreference_floatingPointSeparator",
")",
")",
... | Obtains the symbol, which is used to separate floating point numbers for textual
representation, from a specific typed array.
@param typedArray
The typed array, the symbol should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"symbol",
"which",
"is",
"used",
"to",
"separate",
"floating",
"point",
"numbers",
"for",
"textual",
"representation",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L329-L332 |
4,576 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainShowProgress | private void obtainShowProgress(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.seek_bar_preference_default_show_progress);
showProgress(
typedArray.getBoolean(R.styleable.SeekBarPreference_showProgress, defaul... | java | private void obtainShowProgress(@NonNull final TypedArray typedArray) {
boolean defaultValue = getContext().getResources()
.getBoolean(R.bool.seek_bar_preference_default_show_progress);
showProgress(
typedArray.getBoolean(R.styleable.SeekBarPreference_showProgress, defaul... | [
"private",
"void",
"obtainShowProgress",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"boolean",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getBoolean",
"(",
"R",
".",
"bool",
".",
"seek_bar_prefere... | Obtains the boolean value, which specifies whether the progress of the seek bar should be
shown, from a specific typed array.
@param typedArray
The typed array, the boolean value should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"boolean",
"value",
"which",
"specifies",
"whether",
"the",
"progress",
"of",
"the",
"seek",
"bar",
"should",
"be",
"shown",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L342-L347 |
4,577 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.obtainSummaries | private void obtainSummaries(@NonNull final TypedArray typedArray) {
try {
setSummaries(typedArray.getTextArray(R.styleable.SeekBarPreference_android_summary));
} catch (Resources.NotFoundException e) {
setSummaries(null);
}
} | java | private void obtainSummaries(@NonNull final TypedArray typedArray) {
try {
setSummaries(typedArray.getTextArray(R.styleable.SeekBarPreference_android_summary));
} catch (Resources.NotFoundException e) {
setSummaries(null);
}
} | [
"private",
"void",
"obtainSummaries",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"try",
"{",
"setSummaries",
"(",
"typedArray",
".",
"getTextArray",
"(",
"R",
".",
"styleable",
".",
"SeekBarPreference_android_summary",
")",
")",
";",
"}"... | Obtains the summaries, which are shown depending on the currently persisted value, from a
specific typed array.
@param typedArray
The typed array, the summaries should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"summaries",
"which",
"are",
"shown",
"depending",
"on",
"the",
"currently",
"persisted",
"value",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L357-L363 |
4,578 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.createSeekBarListener | private OnSeekBarChangeListener createSeekBarListener(
@NonNull final TextView progressTextView) {
return new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(final android.widget.SeekBar seekBar) {
}
@Override
publi... | java | private OnSeekBarChangeListener createSeekBarListener(
@NonNull final TextView progressTextView) {
return new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(final android.widget.SeekBar seekBar) {
}
@Override
publi... | [
"private",
"OnSeekBarChangeListener",
"createSeekBarListener",
"(",
"@",
"NonNull",
"final",
"TextView",
"progressTextView",
")",
"{",
"return",
"new",
"OnSeekBarChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onStopTrackingTouch",
"(",
"final",
"a... | Creates and returns a listener, which allows to display the currently chosen value of the
pereference's seek bar. The current value is internally stored, but it will not become
persisted, until the user's confirmation.
@param progressTextView
The text view, which should be used to display the currently chosen value, a... | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"display",
"the",
"currently",
"chosen",
"value",
"of",
"the",
"pereference",
"s",
"seek",
"bar",
".",
"The",
"current",
"value",
"is",
"internally",
"stored",
"but",
"it",
"will",
"not",... | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L399-L422 |
4,579 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.adaptToStepSize | private float adaptToStepSize(final float value) {
if (getStepSize() > 0) {
float offset = value - getMinValue();
float mod = offset % getStepSize();
float halfStepSize = (float) getStepSize() / 2.0f;
float result = ((mod > halfStepSize) ? offset + getStepSize() -... | java | private float adaptToStepSize(final float value) {
if (getStepSize() > 0) {
float offset = value - getMinValue();
float mod = offset % getStepSize();
float halfStepSize = (float) getStepSize() / 2.0f;
float result = ((mod > halfStepSize) ? offset + getStepSize() -... | [
"private",
"float",
"adaptToStepSize",
"(",
"final",
"float",
"value",
")",
"{",
"if",
"(",
"getStepSize",
"(",
")",
">",
"0",
")",
"{",
"float",
"offset",
"=",
"value",
"-",
"getMinValue",
"(",
")",
";",
"float",
"mod",
"=",
"offset",
"%",
"getStepSiz... | Adapts a specific value to the step size, which is currently set. The value will be decreased
or increased to the numerically closest value, which matches the step size.
@param value
The value, which should be adapted to the step size, as a {@link Float} value
@return The adapted value as a {@link Float} value | [
"Adapts",
"a",
"specific",
"value",
"to",
"the",
"step",
"size",
"which",
"is",
"currently",
"set",
".",
"The",
"value",
"will",
"be",
"decreased",
"or",
"increased",
"to",
"the",
"numerically",
"closest",
"value",
"which",
"matches",
"the",
"step",
"size",
... | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L432-L443 |
4,580 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.getProgressText | private String getProgressText(final float value) {
NumberFormat numberFormat = NumberFormat.getInstance();
if (getFloatingPointSeparator() != null && numberFormat instanceof DecimalFormat) {
DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
decimalFormatSy... | java | private String getProgressText(final float value) {
NumberFormat numberFormat = NumberFormat.getInstance();
if (getFloatingPointSeparator() != null && numberFormat instanceof DecimalFormat) {
DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
decimalFormatSy... | [
"private",
"String",
"getProgressText",
"(",
"final",
"float",
"value",
")",
"{",
"NumberFormat",
"numberFormat",
"=",
"NumberFormat",
".",
"getInstance",
"(",
")",
";",
"if",
"(",
"getFloatingPointSeparator",
"(",
")",
"!=",
"null",
"&&",
"numberFormat",
"insta... | Returns a textual representation of a specific value. The text is formatted depending on the
decimal separator, which is currently set and contains the unit, if currently set.
@param value
The value, whose textual representation should be returned, as a {@link Float} value
@return A textual representation of the given... | [
"Returns",
"a",
"textual",
"representation",
"of",
"a",
"specific",
"value",
".",
"The",
"text",
"is",
"formatted",
"depending",
"on",
"the",
"decimal",
"separator",
"which",
"is",
"currently",
"set",
"and",
"contains",
"the",
"unit",
"if",
"currently",
"set",... | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L453-L471 |
4,581 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.setMinValue | public final void setMinValue(final int minValue) {
Condition.INSTANCE.ensureSmaller(minValue, getMaxValue(),
"The minimum value must be less than the maximum value");
this.minValue = minValue;
setValue(Math.max(getValue(), minValue));
} | java | public final void setMinValue(final int minValue) {
Condition.INSTANCE.ensureSmaller(minValue, getMaxValue(),
"The minimum value must be less than the maximum value");
this.minValue = minValue;
setValue(Math.max(getValue(), minValue));
} | [
"public",
"final",
"void",
"setMinValue",
"(",
"final",
"int",
"minValue",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureSmaller",
"(",
"minValue",
",",
"getMaxValue",
"(",
")",
",",
"\"The minimum value must be less than the maximum value\"",
")",
";",
"this"... | Sets the minimum value, the preference should allow to choose.
@param minValue
The minimum value, which should be set, as an {@link Integer} value. The value must
be less than the maximum value, the preference allows to choose | [
"Sets",
"the",
"minimum",
"value",
"the",
"preference",
"should",
"allow",
"to",
"choose",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L611-L616 |
4,582 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.setMaxValue | public final void setMaxValue(final int maxValue) {
Condition.INSTANCE.ensureGreater(maxValue, getMinValue(),
"The maximum value must be greater than the minimum value");
this.maxValue = maxValue;
setValue(Math.min(getValue(), maxValue));
} | java | public final void setMaxValue(final int maxValue) {
Condition.INSTANCE.ensureGreater(maxValue, getMinValue(),
"The maximum value must be greater than the minimum value");
this.maxValue = maxValue;
setValue(Math.min(getValue(), maxValue));
} | [
"public",
"final",
"void",
"setMaxValue",
"(",
"final",
"int",
"maxValue",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureGreater",
"(",
"maxValue",
",",
"getMinValue",
"(",
")",
",",
"\"The maximum value must be greater than the minimum value\"",
")",
";",
"th... | Sets the maximum value, the preference should allow to choose.
@param maxValue
The maximum value, which should be set, as an {@link Integer} value. The value must
be greater than the minimum value, that preference allows to choose | [
"Sets",
"the",
"maximum",
"value",
"the",
"preference",
"should",
"allow",
"to",
"choose",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L634-L639 |
4,583 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.setStepSize | public final void setStepSize(final int stepSize) {
if (stepSize != -1) {
Condition.INSTANCE.ensureAtLeast(stepSize, 1, "The step size must be at least 1");
Condition.INSTANCE.ensureAtMaximum(stepSize, getRange(),
"The step size must be at maximum the range");
... | java | public final void setStepSize(final int stepSize) {
if (stepSize != -1) {
Condition.INSTANCE.ensureAtLeast(stepSize, 1, "The step size must be at least 1");
Condition.INSTANCE.ensureAtMaximum(stepSize, getRange(),
"The step size must be at maximum the range");
... | [
"public",
"final",
"void",
"setStepSize",
"(",
"final",
"int",
"stepSize",
")",
"{",
"if",
"(",
"stepSize",
"!=",
"-",
"1",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"stepSize",
",",
"1",
",",
"\"The step size must be at least 1\"",
... | Sets the step size, the value should be increased or decreased by, when moving the seek bar.
@param stepSize
The step size, which should be set, as an {@link Integer} value. The value must be at
least 1 and at maximum the value of the method <code>getRange():int</code> or -1, if
the preference should allow to select a... | [
"Sets",
"the",
"step",
"size",
"the",
"value",
"should",
"be",
"increased",
"or",
"decreased",
"by",
"when",
"moving",
"the",
"seek",
"bar",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L669-L678 |
4,584 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.setDecimals | public final void setDecimals(final int decimals) {
Condition.INSTANCE.ensureAtLeast(decimals, 0, "The decimals must be at least 0");
this.decimals = decimals;
setValue(roundToDecimals(getValue()));
} | java | public final void setDecimals(final int decimals) {
Condition.INSTANCE.ensureAtLeast(decimals, 0, "The decimals must be at least 0");
this.decimals = decimals;
setValue(roundToDecimals(getValue()));
} | [
"public",
"final",
"void",
"setDecimals",
"(",
"final",
"int",
"decimals",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtLeast",
"(",
"decimals",
",",
"0",
",",
"\"The decimals must be at least 0\"",
")",
";",
"this",
".",
"decimals",
"=",
"decimals",
... | Sets the number of decimals of the floating point numbers, the preference should allow to
choose. If the number of decimals is set to 0, the preference will only allow to choose
integer values.
@param decimals
The number of decimals, which should be set, as an {@link Integer} value. The value
must be at least 0. If th... | [
"Sets",
"the",
"number",
"of",
"decimals",
"of",
"the",
"floating",
"point",
"numbers",
"the",
"preference",
"should",
"allow",
"to",
"choose",
".",
"If",
"the",
"number",
"of",
"decimals",
"is",
"set",
"to",
"0",
"the",
"preference",
"will",
"only",
"allo... | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L702-L706 |
4,585 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java | SeekBarPreference.setFloatingPointSeparator | public final void setFloatingPointSeparator(
@Nullable final CharSequence floatingPointSeparator) {
if (floatingPointSeparator != null) {
Condition.INSTANCE.ensureAtMaximum(floatingPointSeparator.length(), 1,
"The floating point separator's length must be 1");
... | java | public final void setFloatingPointSeparator(
@Nullable final CharSequence floatingPointSeparator) {
if (floatingPointSeparator != null) {
Condition.INSTANCE.ensureAtMaximum(floatingPointSeparator.length(), 1,
"The floating point separator's length must be 1");
... | [
"public",
"final",
"void",
"setFloatingPointSeparator",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"floatingPointSeparator",
")",
"{",
"if",
"(",
"floatingPointSeparator",
"!=",
"null",
")",
"{",
"Condition",
".",
"INSTANCE",
".",
"ensureAtMaximum",
"(",
"floati... | Sets the symbol, which should be used to separate floating point numbers for textual
representation.
@param floatingPointSeparator
The symbol, which should be set, as an instance of the type {@link CharSequence} or
null, if the default symbol should be used. The length of the symbol must be 1 | [
"Sets",
"the",
"symbol",
"which",
"should",
"be",
"used",
"to",
"separate",
"floating",
"point",
"numbers",
"for",
"textual",
"representation",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SeekBarPreference.java#L760-L767 |
4,586 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/view/SeekBar.java | SeekBar.applyTheme | private void applyTheme() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setSeekBarColor(ThemeUtil.getColor(getContext(), R.attr.colorAccent));
}
} | java | private void applyTheme() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setSeekBarColor(ThemeUtil.getColor(getContext(), R.attr.colorAccent));
}
} | [
"private",
"void",
"applyTheme",
"(",
")",
"{",
"if",
"(",
"Build",
".",
"VERSION",
".",
"SDK_INT",
">=",
"Build",
".",
"VERSION_CODES",
".",
"LOLLIPOP",
")",
"{",
"setSeekBarColor",
"(",
"ThemeUtil",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R... | Applies the attributes of the context's theme on the seek bar. | [
"Applies",
"the",
"attributes",
"of",
"the",
"context",
"s",
"theme",
"on",
"the",
"seek",
"bar",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/view/SeekBar.java#L55-L59 |
4,587 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/view/SeekBar.java | SeekBar.setSeekBarColor | public final void setSeekBarColor(@ColorInt final int color) {
this.seekBarColor = color;
ColorFilter colorFilter = new PorterDuffColorFilter(color, Mode.SRC_IN);
getProgressDrawable().setColorFilter(colorFilter);
getThumbDrawable().setColorFilter(colorFilter);
} | java | public final void setSeekBarColor(@ColorInt final int color) {
this.seekBarColor = color;
ColorFilter colorFilter = new PorterDuffColorFilter(color, Mode.SRC_IN);
getProgressDrawable().setColorFilter(colorFilter);
getThumbDrawable().setColorFilter(colorFilter);
} | [
"public",
"final",
"void",
"setSeekBarColor",
"(",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"this",
".",
"seekBarColor",
"=",
"color",
";",
"ColorFilter",
"colorFilter",
"=",
"new",
"PorterDuffColorFilter",
"(",
"color",
",",
"Mode",
".",
"SRC_IN",
... | Sets the color of the seek bar.
@param color
The color, which should be set as an {@link Integer} value | [
"Sets",
"the",
"color",
"of",
"the",
"seek",
"bar",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/view/SeekBar.java#L123-L128 |
4,588 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/adapter/ColorPaletteAdapter.java | ColorPaletteAdapter.indexOf | public final int indexOf(@ColorInt final int color) {
for (int i = 0; i < colorPalette.length; i++) {
if (colorPalette[i] == color) {
return i;
}
}
return -1;
} | java | public final int indexOf(@ColorInt final int color) {
for (int i = 0; i < colorPalette.length; i++) {
if (colorPalette[i] == color) {
return i;
}
}
return -1;
} | [
"public",
"final",
"int",
"indexOf",
"(",
"@",
"ColorInt",
"final",
"int",
"color",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"colorPalette",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"colorPalette",
"[",
"i",
"]",
"=="... | Returns the index of a specific color.
@param color
The color, whose index should be returned, as an {@link Integer} value
@return The index of the given color or -1, if the adapter does not contain the color | [
"Returns",
"the",
"index",
"of",
"a",
"specific",
"color",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/adapter/ColorPaletteAdapter.java#L110-L118 |
4,589 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SwitchPreference.java | SwitchPreference.obtainSwitchTextOn | private void obtainSwitchTextOn(@NonNull final TypedArray typedArray) {
setSwitchTextOn(typedArray.getText(R.styleable.SwitchPreference_android_switchTextOn));
} | java | private void obtainSwitchTextOn(@NonNull final TypedArray typedArray) {
setSwitchTextOn(typedArray.getText(R.styleable.SwitchPreference_android_switchTextOn));
} | [
"private",
"void",
"obtainSwitchTextOn",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setSwitchTextOn",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"SwitchPreference_android_switchTextOn",
")",
")",
";",
"}"
] | Obtains the text, which should be displayed on the preference's switch, when it is checked,
from a specific typed array.
@param typedArray
The typed array, the text should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"text",
"which",
"should",
"be",
"displayed",
"on",
"the",
"preference",
"s",
"switch",
"when",
"it",
"is",
"checked",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SwitchPreference.java#L117-L119 |
4,590 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SwitchPreference.java | SwitchPreference.obtainSwitchTextOff | private void obtainSwitchTextOff(@NonNull final TypedArray typedArray) {
setSwitchTextOff(typedArray.getText(R.styleable.SwitchPreference_android_switchTextOff));
} | java | private void obtainSwitchTextOff(@NonNull final TypedArray typedArray) {
setSwitchTextOff(typedArray.getText(R.styleable.SwitchPreference_android_switchTextOff));
} | [
"private",
"void",
"obtainSwitchTextOff",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"setSwitchTextOff",
"(",
"typedArray",
".",
"getText",
"(",
"R",
".",
"styleable",
".",
"SwitchPreference_android_switchTextOff",
")",
")",
";",
"}"
] | Obtains the text, which should be displayed on the preference's switch, when it is not
checked, from a specific typed array.
@param typedArray
The typed array, the text should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"text",
"which",
"should",
"be",
"displayed",
"on",
"the",
"preference",
"s",
"switch",
"when",
"it",
"is",
"not",
"checked",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SwitchPreference.java#L129-L131 |
4,591 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SwitchPreference.java | SwitchPreference.adaptSwitch | private void adaptSwitch() {
if (switchWidget != null) {
switchWidget.setTextOn(getSwitchTextOn());
switchWidget.setTextOff(getSwitchTextOff());
switchWidget.setShowText(!TextUtils.isEmpty(getSwitchTextOn()) ||
!TextUtils.isEmpty(getSwitchTextOff()));
... | java | private void adaptSwitch() {
if (switchWidget != null) {
switchWidget.setTextOn(getSwitchTextOn());
switchWidget.setTextOff(getSwitchTextOff());
switchWidget.setShowText(!TextUtils.isEmpty(getSwitchTextOn()) ||
!TextUtils.isEmpty(getSwitchTextOff()));
... | [
"private",
"void",
"adaptSwitch",
"(",
")",
"{",
"if",
"(",
"switchWidget",
"!=",
"null",
")",
"{",
"switchWidget",
".",
"setTextOn",
"(",
"getSwitchTextOn",
"(",
")",
")",
";",
"switchWidget",
".",
"setTextOff",
"(",
"getSwitchTextOff",
"(",
")",
")",
";"... | Adapts the preference's switch, depending on the preference's properties and on whether it is
currently checked or not. | [
"Adapts",
"the",
"preference",
"s",
"switch",
"depending",
"on",
"the",
"preference",
"s",
"properties",
"and",
"on",
"whether",
"it",
"is",
"currently",
"checked",
"or",
"not",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SwitchPreference.java#L137-L145 |
4,592 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/SwitchPreference.java | SwitchPreference.createCheckedChangeListener | private OnCheckedChangeListener createCheckedChangeListener() {
return new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
if (getOnPreferenceChangeListener() == null || getOnPreferenceChangeL... | java | private OnCheckedChangeListener createCheckedChangeListener() {
return new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
if (getOnPreferenceChangeListener() == null || getOnPreferenceChangeL... | [
"private",
"OnCheckedChangeListener",
"createCheckedChangeListener",
"(",
")",
"{",
"return",
"new",
"OnCheckedChangeListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onCheckedChanged",
"(",
"final",
"CompoundButton",
"buttonView",
",",
"final",
"boolean",
... | Creates and returns a listener, which allows to change the preference's value, depending on
the preference's switch's state.
@return The listener, which has been created, as an instance of the type {@link
OnCheckedChangeListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"change",
"the",
"preference",
"s",
"value",
"depending",
"on",
"the",
"preference",
"s",
"switch",
"s",
"state",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/SwitchPreference.java#L154-L168 |
4,593 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainColorPalette | private void obtainColorPalette(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.ColorPalettePreference_colorPalette, -1);
if (resourceId != -1) {
int[] obtainedColorPalette = getContext().getResources().getIntArray(resourceId);
... | java | private void obtainColorPalette(@NonNull final TypedArray typedArray) {
int resourceId =
typedArray.getResourceId(R.styleable.ColorPalettePreference_colorPalette, -1);
if (resourceId != -1) {
int[] obtainedColorPalette = getContext().getResources().getIntArray(resourceId);
... | [
"private",
"void",
"obtainColorPalette",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"resourceId",
"=",
"typedArray",
".",
"getResourceId",
"(",
"R",
".",
"styleable",
".",
"ColorPalettePreference_colorPalette",
",",
"-",
"1",
")",
... | Obtains the color palette from a specific typed array.
@param typedArray
The typed array, the color palette, should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"color",
"palette",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L164-L172 |
4,594 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainDialogPreviewSize | private void obtainDialogPreviewSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_palette_preference_default_dialog_preview_size);
setDialogPreviewSize(typedArray
.getDimensionPixelSize(R.style... | java | private void obtainDialogPreviewSize(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_palette_preference_default_dialog_preview_size);
setDialogPreviewSize(typedArray
.getDimensionPixelSize(R.style... | [
"private",
"void",
"obtainDialogPreviewSize",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",
"col... | Obtains the size, which should be used to preview colors in the preference's dialog, from a
specific typed array.
@param typedArray
The typed array, the size should be obtained from, as an instance of the class {@link
TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"size",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L182-L188 |
4,595 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainDialogPreviewShape | private void obtainDialogPreviewShape(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_palette_preference_default_dialog_preview_shape);
setDialogPreviewShape(PreviewShape.fromValue(typedArray
.getInteger(R... | java | private void obtainDialogPreviewShape(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_palette_preference_default_dialog_preview_shape);
setDialogPreviewShape(PreviewShape.fromValue(typedArray
.getInteger(R... | [
"private",
"void",
"obtainDialogPreviewShape",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"color_palet... | Obtains the shape, which should be used to preview colors in the preference's dialog, from a
specific typed array.
@param typedArray
The typed array, the shape should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"shape",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L198-L203 |
4,596 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainDialogPreviewBorderWidth | private void obtainDialogPreviewBorderWidth(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_palette_preference_default_dialog_preview_border_width);
setDialogPreviewBorderWidth(typedArray
.getDime... | java | private void obtainDialogPreviewBorderWidth(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources().getDimensionPixelSize(
R.dimen.color_palette_preference_default_dialog_preview_border_width);
setDialogPreviewBorderWidth(typedArray
.getDime... | [
"private",
"void",
"obtainDialogPreviewBorderWidth",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getDimensionPixelSize",
"(",
"R",
".",
"dimen",
".",... | Obtains the border width, which should be used to preview colors in the preference's dialog,
from a specific typed array.
@param typedArray
The typed array, the border width should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"border",
"width",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L213-L219 |
4,597 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainDialogPreviewBorderColor | private void obtainDialogPreviewBorderColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(),
R.color.color_palette_preference_default_dialog_preview_border_color);
setDialogPreviewBorderColor(typedArray
.getColor(R.styleable.... | java | private void obtainDialogPreviewBorderColor(@NonNull final TypedArray typedArray) {
int defaultValue = ContextCompat.getColor(getContext(),
R.color.color_palette_preference_default_dialog_preview_border_color);
setDialogPreviewBorderColor(typedArray
.getColor(R.styleable.... | [
"private",
"void",
"obtainDialogPreviewBorderColor",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"ContextCompat",
".",
"getColor",
"(",
"getContext",
"(",
")",
",",
"R",
".",
"color",
".",
"color_palette_preferen... | Obtains the border color, which should be used to preview colors in the preference's dialog,
from a specific typed array.
@param typedArray
The typed array, the border color should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"border",
"color",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L229-L235 |
4,598 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainDialogPreviewBackground | private void obtainDialogPreviewBackground(@NonNull final TypedArray typedArray) {
int backgroundColor =
typedArray.getColor(R.styleable.ColorPalettePreference_dialogPreviewBackground, -1);
if (backgroundColor != -1) {
setPreviewBackgroundColor(backgroundColor);
} el... | java | private void obtainDialogPreviewBackground(@NonNull final TypedArray typedArray) {
int backgroundColor =
typedArray.getColor(R.styleable.ColorPalettePreference_dialogPreviewBackground, -1);
if (backgroundColor != -1) {
setPreviewBackgroundColor(backgroundColor);
} el... | [
"private",
"void",
"obtainDialogPreviewBackground",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"backgroundColor",
"=",
"typedArray",
".",
"getColor",
"(",
"R",
".",
"styleable",
".",
"ColorPalettePreference_dialogPreviewBackground",
",",
... | Obtains the background, which should be used to preview colors in the preference's dialog,
from a specific typed array.
@param typedArray
The typed array, the background should be obtained from, as an instance of the class
{@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"background",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L245-L257 |
4,599 | michael-rapp/AndroidMaterialPreferences | library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java | ColorPalettePreference.obtainNumberOfColumns | private void obtainNumberOfColumns(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_palette_preference_default_number_of_columns);
setNumberOfColumns(typedArray
.getInteger(R.styleable.ColorPalettePreferenc... | java | private void obtainNumberOfColumns(@NonNull final TypedArray typedArray) {
int defaultValue = getContext().getResources()
.getInteger(R.integer.color_palette_preference_default_number_of_columns);
setNumberOfColumns(typedArray
.getInteger(R.styleable.ColorPalettePreferenc... | [
"private",
"void",
"obtainNumberOfColumns",
"(",
"@",
"NonNull",
"final",
"TypedArray",
"typedArray",
")",
"{",
"int",
"defaultValue",
"=",
"getContext",
"(",
")",
".",
"getResources",
"(",
")",
".",
"getInteger",
"(",
"R",
".",
"integer",
".",
"color_palette_... | Obtains the number of columns, which should be used to preview colors in the preference's
dialog, from a specific typed array.
@param typedArray
The typed array, the number of columns should be obtained from, as an instance of the
class {@link TypedArray}. The typed array may not be null | [
"Obtains",
"the",
"number",
"of",
"columns",
"which",
"should",
"be",
"used",
"to",
"preview",
"colors",
"in",
"the",
"preference",
"s",
"dialog",
"from",
"a",
"specific",
"typed",
"array",
"."
] | 73a7e449458313bd041fc8d6038e290506b68eb1 | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/library/src/main/java/de/mrapp/android/preference/ColorPalettePreference.java#L267-L272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.