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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
legsem/legstar.avro | legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/AbstractZosDatumReader.java | AbstractZosDatumReader.read | public int read(byte b[], int off, int len) throws IOException {
return IOUtils.read(inStream, b, off, len);
} | java | public int read(byte b[], int off, int len) throws IOException {
return IOUtils.read(inStream, b, off, len);
} | [
"public",
"int",
"read",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"return",
"IOUtils",
".",
"read",
"(",
"inStream",
",",
"b",
",",
"off",
",",
"len",
")",
";",
"}"
] | Same as above but does not throw an exception at end of file, just
returns the actual data read.
@param b the buffer to bill
@param off offset in buffer where to start filling
@param len how many bytes we should read
@return the total number of bytes read
@throws IOException if a read error occurs | [
"Same",
"as",
"above",
"but",
"does",
"not",
"throw",
"an",
"exception",
"at",
"end",
"of",
"file",
"just",
"returns",
"the",
"actual",
"data",
"read",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/AbstractZosDatumReader.java#L270-L272 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java | CommandParamsContext.addNamedParam | public void addNamedParam(final String name, final ParamInfo paramInfo) {
check(!named.containsKey(name),
"Duplicate parameter %s declaration at position %s", name, paramInfo.position);
named.put(name, paramInfo);
} | java | public void addNamedParam(final String name, final ParamInfo paramInfo) {
check(!named.containsKey(name),
"Duplicate parameter %s declaration at position %s", name, paramInfo.position);
named.put(name, paramInfo);
} | [
"public",
"void",
"addNamedParam",
"(",
"final",
"String",
"name",
",",
"final",
"ParamInfo",
"paramInfo",
")",
"{",
"check",
"(",
"!",
"named",
".",
"containsKey",
"(",
"name",
")",
",",
"\"Duplicate parameter %s declaration at position %s\"",
",",
"name",
",",
... | Register parameter as named.
@param name parameter name
@param paramInfo parameter object | [
"Register",
"parameter",
"as",
"named",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java#L48-L52 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java | CommandParamsContext.addStaticElVarValue | public void addStaticElVarValue(final String name, final String value) {
check(!staticElValues.containsKey(name),
"Duplicate el variable %s value declaration: %s (original: %s)", name, value,
staticElValues.get(name));
check(!dynamicElValues.contains(name),
... | java | public void addStaticElVarValue(final String name, final String value) {
check(!staticElValues.containsKey(name),
"Duplicate el variable %s value declaration: %s (original: %s)", name, value,
staticElValues.get(name));
check(!dynamicElValues.contains(name),
... | [
"public",
"void",
"addStaticElVarValue",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"check",
"(",
"!",
"staticElValues",
".",
"containsKey",
"(",
"name",
")",
",",
"\"Duplicate el variable %s value declaration: %s (original: %s)\"",
","... | Register static query el variable value.
@param name variable name
@param value variable value | [
"Register",
"static",
"query",
"el",
"variable",
"value",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java#L60-L68 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java | CommandParamsContext.addDynamicElVarValue | public void addDynamicElVarValue(final String name) {
check(!dynamicElValues.contains(name),
"Duplicate dynamic el variable %s declaration", name);
check(!staticElValues.containsKey(name),
"El variable %s can't be registered as dynamic, because static declaration already ... | java | public void addDynamicElVarValue(final String name) {
check(!dynamicElValues.contains(name),
"Duplicate dynamic el variable %s declaration", name);
check(!staticElValues.containsKey(name),
"El variable %s can't be registered as dynamic, because static declaration already ... | [
"public",
"void",
"addDynamicElVarValue",
"(",
"final",
"String",
"name",
")",
"{",
"check",
"(",
"!",
"dynamicElValues",
".",
"contains",
"(",
"name",
")",
",",
"\"Duplicate dynamic el variable %s declaration\"",
",",
"name",
")",
";",
"check",
"(",
"!",
"stati... | Register dynamic query el variable value. Variable will be completely handled by extension.
Registration is required to validated not handled variables.
@param name variable name | [
"Register",
"dynamic",
"query",
"el",
"variable",
"value",
".",
"Variable",
"will",
"be",
"completely",
"handled",
"by",
"extension",
".",
"Registration",
"is",
"required",
"to",
"validated",
"not",
"handled",
"variables",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/param/CommandParamsContext.java#L76-L83 | train |
legsem/legstar.avro | legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java | Cob2AvroGenerator.generateXmlSchema | private String generateXmlSchema(Reader cobolReader,
String targetNamespace, String targetXmlSchemaName,
final String xsltFileName) {
log.debug("XML schema {} generation started", targetXmlSchemaName
+ XSD_FILE_EXTENSION);
String xmlSchemaSource = cob2xsd.transla... | java | private String generateXmlSchema(Reader cobolReader,
String targetNamespace, String targetXmlSchemaName,
final String xsltFileName) {
log.debug("XML schema {} generation started", targetXmlSchemaName
+ XSD_FILE_EXTENSION);
String xmlSchemaSource = cob2xsd.transla... | [
"private",
"String",
"generateXmlSchema",
"(",
"Reader",
"cobolReader",
",",
"String",
"targetNamespace",
",",
"String",
"targetXmlSchemaName",
",",
"final",
"String",
"xsltFileName",
")",
"{",
"log",
".",
"debug",
"(",
"\"XML schema {} generation started\"",
",",
"ta... | Translate the COBOL copybook to XML Schema.
@param cobolReader the input COBOL copybook (as a reader)
@param targetNamespace the target XML schema namespace
@param targetXmlSchemaName the target XML schema name
@param xsltFileName an optional XSLT to apply on the XML schema
@return the XML schema source | [
"Translate",
"the",
"COBOL",
"copybook",
"to",
"XML",
"Schema",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java#L172-L188 | train |
legsem/legstar.avro | legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java | Cob2AvroGenerator.generateConverterClasses | private Map < String, String > generateConverterClasses(
String xmlSchemaSource, String targetPackageName) {
log.debug("Converter support classes generation started");
Map < String, String > codeMap = xsd2CobolTypes.generate(
new StringReader(xmlSchemaSource), targetPackageN... | java | private Map < String, String > generateConverterClasses(
String xmlSchemaSource, String targetPackageName) {
log.debug("Converter support classes generation started");
Map < String, String > codeMap = xsd2CobolTypes.generate(
new StringReader(xmlSchemaSource), targetPackageN... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"generateConverterClasses",
"(",
"String",
"xmlSchemaSource",
",",
"String",
"targetPackageName",
")",
"{",
"log",
".",
"debug",
"(",
"\"Converter support classes generation started\"",
")",
";",
"Map",
"<",
"Stri... | Produce the LegStar converter support classes.
@param xmlSchemaSource the XML schema source
@param targetPackageName the target Avro package name
@return a map of lass names associated with their code | [
"Produce",
"the",
"LegStar",
"converter",
"support",
"classes",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java#L197-L212 | train |
legsem/legstar.avro | legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java | Cob2AvroGenerator.generateAvroSchema | private String generateAvroSchema(String xmlSchemaSource,
String targetPackageName, String targetAvroSchemaName)
throws IOException {
log.debug("Avro schema {} generation started", targetAvroSchemaName
+ AVSC_FILE_EXTENSION);
String avroSchemaSource = cob2AvroTra... | java | private String generateAvroSchema(String xmlSchemaSource,
String targetPackageName, String targetAvroSchemaName)
throws IOException {
log.debug("Avro schema {} generation started", targetAvroSchemaName
+ AVSC_FILE_EXTENSION);
String avroSchemaSource = cob2AvroTra... | [
"private",
"String",
"generateAvroSchema",
"(",
"String",
"xmlSchemaSource",
",",
"String",
"targetPackageName",
",",
"String",
"targetAvroSchemaName",
")",
"throws",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"Avro schema {} generation started\"",
",",
"targetAvroSc... | Produce the avro schema.
@param xmlSchemaSource the XML schema source
@param targetPackageName the target Avro package name
@param targetAvroSchemaName the target Avro schema name
@return the generated Avro schema
@throws IOException if serialization fails | [
"Produce",
"the",
"avro",
"schema",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java#L232-L248 | train |
legsem/legstar.avro | legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java | Cob2AvroGenerator.avroCompile | private void avroCompile(String avroSchemaSource, File avroSchemaFile,
File javaTargetFolder) throws IOException {
log.debug("Avro compiler started for: {}", avroSchemaFile);
Schema.Parser parser = new Schema.Parser();
Schema schema = parser.parse(avroSchemaSource);
Specifi... | java | private void avroCompile(String avroSchemaSource, File avroSchemaFile,
File javaTargetFolder) throws IOException {
log.debug("Avro compiler started for: {}", avroSchemaFile);
Schema.Parser parser = new Schema.Parser();
Schema schema = parser.parse(avroSchemaSource);
Specifi... | [
"private",
"void",
"avroCompile",
"(",
"String",
"avroSchemaSource",
",",
"File",
"avroSchemaFile",
",",
"File",
"javaTargetFolder",
")",
"throws",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"Avro compiler started for: {}\"",
",",
"avroSchemaFile",
")",
";",
"S... | Given an Avro schema produce java specific classes.
@param avroSchemaFile the Avro schema file (used by avro for timestamp
checking)
@param avroSchemaSource the Avro schema source
@param javaTargetFolder the target folder for java classes
@throws IOException if compilation fails | [
"Given",
"an",
"Avro",
"schema",
"produce",
"java",
"specific",
"classes",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.generator/src/main/java/com/legstar/avro/generator/Cob2AvroGenerator.java#L259-L271 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/transaction/internal/AnnotationTxConfigBuilder.java | AnnotationTxConfigBuilder.buildConfig | public static TxConfig buildConfig(final Class<?> type, final Method method, final boolean useDefaults) {
final Transactional transactional = findAnnotation(type, method, Transactional.class, useDefaults);
TxConfig res = null;
if (transactional != null) {
final TxType txType = findAn... | java | public static TxConfig buildConfig(final Class<?> type, final Method method, final boolean useDefaults) {
final Transactional transactional = findAnnotation(type, method, Transactional.class, useDefaults);
TxConfig res = null;
if (transactional != null) {
final TxType txType = findAn... | [
"public",
"static",
"TxConfig",
"buildConfig",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Method",
"method",
",",
"final",
"boolean",
"useDefaults",
")",
"{",
"final",
"Transactional",
"transactional",
"=",
"findAnnotation",
"(",
"type",
",",... | Build transaction config for type.
@param type type to analyze
@param method method to analyze
@param useDefaults true to build default config if annotation not found
@return tx config for found annotation, null if useDefaults false and default config otherwise | [
"Build",
"transaction",
"config",
"for",
"type",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/transaction/internal/AnnotationTxConfigBuilder.java#L33-L42 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/transaction/internal/AnnotationTxConfigBuilder.java | AnnotationTxConfigBuilder.wrapExceptions | private static List<Class<? extends Exception>> wrapExceptions(final Class<? extends Exception>... list) {
return list.length == 0 ? null : Arrays.asList(list);
} | java | private static List<Class<? extends Exception>> wrapExceptions(final Class<? extends Exception>... list) {
return list.length == 0 ? null : Arrays.asList(list);
} | [
"private",
"static",
"List",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
">",
">",
"wrapExceptions",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"...",
"list",
")",
"{",
"return",
"list",
".",
"length",
"==",
"0",
"?",
"null",
":"... | Avoid creation of empty list.
@param list array of exceptions
@return converted list or null if array os empty | [
"Avoid",
"creation",
"of",
"empty",
"list",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/transaction/internal/AnnotationTxConfigBuilder.java#L67-L69 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/TitleBar.java | TitleBar.setTitleGaps | public void setTitleGaps(int gapBetweenIconAndTitle,
int gapBetweenTitleAndComponents, int gapBetweenComponents) {
gapBetweenIconAndTitle = Math.max(gapBetweenIconAndTitle, 0);
gapBetweenTitleAndComponents = Math.max(gapBetweenTitleAndComponents, 0);
gapBetweenComponents = Math.max(gapBetweenComponents,... | java | public void setTitleGaps(int gapBetweenIconAndTitle,
int gapBetweenTitleAndComponents, int gapBetweenComponents) {
gapBetweenIconAndTitle = Math.max(gapBetweenIconAndTitle, 0);
gapBetweenTitleAndComponents = Math.max(gapBetweenTitleAndComponents, 0);
gapBetweenComponents = Math.max(gapBetweenComponents,... | [
"public",
"void",
"setTitleGaps",
"(",
"int",
"gapBetweenIconAndTitle",
",",
"int",
"gapBetweenTitleAndComponents",
",",
"int",
"gapBetweenComponents",
")",
"{",
"gapBetweenIconAndTitle",
"=",
"Math",
".",
"max",
"(",
"gapBetweenIconAndTitle",
",",
"0",
")",
";",
"g... | Defines the title gaps
@param gapBetweenIconAndTitle gap between the icon and title
@param gapBetweenTitleAndComponents gap between the title and title
components
@param gapBetweenComponents gap between title components | [
"Defines",
"the",
"title",
"gaps"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/TitleBar.java#L139-L145 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/MethodExecutionException.java | MethodExecutionException.checkExec | public static void checkExec(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new MethodExecutionException(String.format(message, args));
}
} | java | public static void checkExec(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new MethodExecutionException(String.format(message, args));
}
} | [
"public",
"static",
"void",
"checkExec",
"(",
"final",
"boolean",
"condition",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"MethodExecutionException",
"(",
"String... | Shortcut to check and throw execution exception.
@param condition condition to validate
@param message fail message
@param args fail message arguments | [
"Shortcut",
"to",
"check",
"and",
"throw",
"execution",
"exception",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/MethodExecutionException.java#L28-L32 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java | ElUtils.findVars | public static List<String> findVars(final String str) {
final List<String> vars = new ArrayList<String>();
final char[] strArray = str.toCharArray();
int i = 0;
while (i < strArray.length - 1) {
if (strArray[i] == VAR_START && strArray[i + 1] == VAR_LEFT_BOUND) {
... | java | public static List<String> findVars(final String str) {
final List<String> vars = new ArrayList<String>();
final char[] strArray = str.toCharArray();
int i = 0;
while (i < strArray.length - 1) {
if (strArray[i] == VAR_START && strArray[i + 1] == VAR_LEFT_BOUND) {
... | [
"public",
"static",
"List",
"<",
"String",
">",
"findVars",
"(",
"final",
"String",
"str",
")",
"{",
"final",
"List",
"<",
"String",
">",
"vars",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"final",
"char",
"[",
"]",
"strArray",
"=",
... | Analyze string for variables.
@param str string to analyze
@return found variable names | [
"Analyze",
"string",
"for",
"variables",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java#L33-L53 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java | ElUtils.replace | public static String replace(final String str, final Map<String, String> params) {
final StringBuilder sb = new StringBuilder(str.length());
final char[] strArray = str.toCharArray();
int i = 0;
while (i < strArray.length - 1) {
if (strArray[i] == VAR_START && strArray[i + 1]... | java | public static String replace(final String str, final Map<String, String> params) {
final StringBuilder sb = new StringBuilder(str.length());
final char[] strArray = str.toCharArray();
int i = 0;
while (i < strArray.length - 1) {
if (strArray[i] == VAR_START && strArray[i + 1]... | [
"public",
"static",
"String",
"replace",
"(",
"final",
"String",
"str",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"str",
".",
"length",
"(",
")",
")",
"... | Replace placeholders in string.
@param str string to replace placeholders
@param params placeholder values map
@return string with replaced placeholders
@throws java.lang.IllegalStateException if string placeholder value is null or not provided | [
"Replace",
"placeholders",
"in",
"string",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java#L63-L88 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java | ElUtils.validate | public static void validate(final String string, final List<String> params) {
final List<String> vars = findVars(string);
for (String param : params) {
Preconditions.checkState(vars.contains(param),
"Variable '%s' not found in target string '%s'", param, string);
... | java | public static void validate(final String string, final List<String> params) {
final List<String> vars = findVars(string);
for (String param : params) {
Preconditions.checkState(vars.contains(param),
"Variable '%s' not found in target string '%s'", param, string);
... | [
"public",
"static",
"void",
"validate",
"(",
"final",
"String",
"string",
",",
"final",
"List",
"<",
"String",
">",
"params",
")",
"{",
"final",
"List",
"<",
"String",
">",
"vars",
"=",
"findVars",
"(",
"string",
")",
";",
"for",
"(",
"String",
"param"... | Validate string variables and declared values for correctness.
@param string template string
@param params provided param names | [
"Validate",
"string",
"variables",
"and",
"declared",
"values",
"for",
"correctness",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElUtils.java#L96-L106 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/CollapsiblePanel.java | CollapsiblePanel.expand | private void expand(boolean immediately) {
if (locked == false && inAction == false && collapsed) {
inAction = true;
CollapsiblePanelListener[] array =
listeners.getListeners(CollapsiblePanelListener.class);
for (CollapsiblePanelListener cpl : array) {
cpl.panelWillExpand(new CollapsiblePanelEvent(this)... | java | private void expand(boolean immediately) {
if (locked == false && inAction == false && collapsed) {
inAction = true;
CollapsiblePanelListener[] array =
listeners.getListeners(CollapsiblePanelListener.class);
for (CollapsiblePanelListener cpl : array) {
cpl.panelWillExpand(new CollapsiblePanelEvent(this)... | [
"private",
"void",
"expand",
"(",
"boolean",
"immediately",
")",
"{",
"if",
"(",
"locked",
"==",
"false",
"&&",
"inAction",
"==",
"false",
"&&",
"collapsed",
")",
"{",
"inAction",
"=",
"true",
";",
"CollapsiblePanelListener",
"[",
"]",
"array",
"=",
"liste... | Expand the panel.
@param immediately
a boolean value, where true expand immediately the panel and false
not. | [
"Expand",
"the",
"panel",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/CollapsiblePanel.java#L759-L780 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearLayoutManager.java | LinearLayoutManager.setReverseLayout | public void setReverseLayout(boolean reverseLayout) {
if (mPendingSavedState != null && mPendingSavedState.mReverseLayout != reverseLayout) {
// override pending state
mPendingSavedState.mReverseLayout = reverseLayout;
}
if (reverseLayout == mReverseLayout) {
... | java | public void setReverseLayout(boolean reverseLayout) {
if (mPendingSavedState != null && mPendingSavedState.mReverseLayout != reverseLayout) {
// override pending state
mPendingSavedState.mReverseLayout = reverseLayout;
}
if (reverseLayout == mReverseLayout) {
... | [
"public",
"void",
"setReverseLayout",
"(",
"boolean",
"reverseLayout",
")",
"{",
"if",
"(",
"mPendingSavedState",
"!=",
"null",
"&&",
"mPendingSavedState",
".",
"mReverseLayout",
"!=",
"reverseLayout",
")",
"{",
"// override pending state",
"mPendingSavedState",
".",
... | Used to reverse item traversal and layout order.
This behaves similar to the layout change for RTL views. When set to true, first item is
rendered at the end of the UI, second item is render before it etc.
For horizontal layouts, it depends on the layout direction.
When set to true, If {@link com.twotoasters.android.s... | [
"Used",
"to",
"reverse",
"item",
"traversal",
"and",
"layout",
"order",
".",
"This",
"behaves",
"similar",
"to",
"the",
"layout",
"change",
"for",
"RTL",
"views",
".",
"When",
"set",
"to",
"true",
"first",
"item",
"is",
"rendered",
"at",
"the",
"end",
"o... | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearLayoutManager.java#L296-L306 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/scheme/initializer/core/util/SchemeUtils.java | SchemeUtils.command | public static void command(final ODatabaseObject db, final String command, final Object... args) {
db.command(new OCommandSQL(String.format(command, args))).execute();
} | java | public static void command(final ODatabaseObject db, final String command, final Object... args) {
db.command(new OCommandSQL(String.format(command, args))).execute();
} | [
"public",
"static",
"void",
"command",
"(",
"final",
"ODatabaseObject",
"db",
",",
"final",
"String",
"command",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"db",
".",
"command",
"(",
"new",
"OCommandSQL",
"(",
"String",
".",
"format",
"(",
"command",... | Calls schema change sql command.
@param db database object
@param command command with string format placeholders
@param args string format placeholders args (important: not query args!) | [
"Calls",
"schema",
"change",
"sql",
"command",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/scheme/initializer/core/util/SchemeUtils.java#L82-L84 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/scheme/initializer/core/util/SchemeUtils.java | SchemeUtils.dropIndex | @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
public static void dropIndex(final ODatabaseObject db, final String indexName) {
// Separated to overcome findbugs false positive "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" for dropIndex method.
db.getMetadata().getIndexManager().dropIndex(... | java | @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT")
public static void dropIndex(final ODatabaseObject db, final String indexName) {
// Separated to overcome findbugs false positive "RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" for dropIndex method.
db.getMetadata().getIndexManager().dropIndex(... | [
"@",
"SuppressFBWarnings",
"(",
"\"RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT\"",
")",
"public",
"static",
"void",
"dropIndex",
"(",
"final",
"ODatabaseObject",
"db",
",",
"final",
"String",
"indexName",
")",
"{",
"// Separated to overcome findbugs false positive \"RV_RETURN_VALUE_... | Drops named index. Safe to call even if index not exist.
@param db database object
@param indexName index name
@see com.orientechnologies.orient.core.index.OIndexManagerProxy#dropIndex(java.lang.String) | [
"Drops",
"named",
"index",
".",
"Safe",
"to",
"call",
"even",
"if",
"index",
"not",
"exist",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/scheme/initializer/core/util/SchemeUtils.java#L93-L97 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/OrientModule.java | OrientModule.configureCustomTypes | private void configureCustomTypes() {
// empty binding is required in any case
final Multibinder<OObjectSerializer> typesBinder =
Multibinder.newSetBinder(binder(), OObjectSerializer.class);
if (!customTypes.isEmpty()) {
for (Class<? extends OObjectSerializer> type : ... | java | private void configureCustomTypes() {
// empty binding is required in any case
final Multibinder<OObjectSerializer> typesBinder =
Multibinder.newSetBinder(binder(), OObjectSerializer.class);
if (!customTypes.isEmpty()) {
for (Class<? extends OObjectSerializer> type : ... | [
"private",
"void",
"configureCustomTypes",
"(",
")",
"{",
"// empty binding is required in any case",
"final",
"Multibinder",
"<",
"OObjectSerializer",
">",
"typesBinder",
"=",
"Multibinder",
".",
"newSetBinder",
"(",
"binder",
"(",
")",
",",
"OObjectSerializer",
".",
... | Binds registered custom types as guice singletons and register them with multibinder. | [
"Binds",
"registered",
"custom",
"types",
"as",
"guice",
"singletons",
"and",
"register",
"them",
"with",
"multibinder",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/OrientModule.java#L298-L308 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/OrientModule.java | OrientModule.loadOptionalPool | protected void loadOptionalPool(final String poolBinder) {
try {
final Method bindPool = OrientModule.class.getDeclaredMethod("bindPool", Class.class, Class.class);
bindPool.setAccessible(true);
try {
Class.forName(poolBinder)
.getConst... | java | protected void loadOptionalPool(final String poolBinder) {
try {
final Method bindPool = OrientModule.class.getDeclaredMethod("bindPool", Class.class, Class.class);
bindPool.setAccessible(true);
try {
Class.forName(poolBinder)
.getConst... | [
"protected",
"void",
"loadOptionalPool",
"(",
"final",
"String",
"poolBinder",
")",
"{",
"try",
"{",
"final",
"Method",
"bindPool",
"=",
"OrientModule",
".",
"class",
".",
"getDeclaredMethod",
"(",
"\"bindPool\"",
",",
"Class",
".",
"class",
",",
"Class",
".",... | Allows to load pool only if required jars are in classpath.
For example, no need for graph dependencies if only object db is used.
@param poolBinder pool binder class
@see ru.vyarus.guice.persist.orient.support.pool.ObjectPoolBinder as example | [
"Allows",
"to",
"load",
"pool",
"only",
"if",
"required",
"jars",
"are",
"in",
"classpath",
".",
"For",
"example",
"no",
"need",
"for",
"graph",
"dependencies",
"if",
"only",
"object",
"db",
"is",
"used",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/OrientModule.java#L357-L373 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/delegate/method/TargetMethodAnalyzer.java | TargetMethodAnalyzer.isParametersCompatible | @SuppressWarnings("unchecked")
private static boolean isParametersCompatible(final List<Class<?>> params,
final List<ParamInfo> ordinalParamInfos) {
boolean resolution = params.size() == ordinalParamInfos.size();
if (resolution && !params.isEmpty()) ... | java | @SuppressWarnings("unchecked")
private static boolean isParametersCompatible(final List<Class<?>> params,
final List<ParamInfo> ordinalParamInfos) {
boolean resolution = params.size() == ordinalParamInfos.size();
if (resolution && !params.isEmpty()) ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"static",
"boolean",
"isParametersCompatible",
"(",
"final",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"params",
",",
"final",
"List",
"<",
"ParamInfo",
">",
"ordinalParamInfos",
")",
"{",
"boolean... | Checking method parameters compatibility.
@param params repository method params to check against
@param ordinalParamInfos target method ordinal params (excluding extension parameters)
@return true if method is compatible, false otherwise | [
"Checking",
"method",
"parameters",
"compatibility",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/delegate/method/TargetMethodAnalyzer.java#L127-L144 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElAnalyzer.java | ElAnalyzer.analyzeQuery | public static ElDescriptor analyzeQuery(final GenericsContext genericsContext, final String query) {
final List<String> vars = ElUtils.findVars(query);
ElDescriptor descriptor = null;
if (!vars.isEmpty()) {
descriptor = new ElDescriptor(vars);
checkGenericVars(descriptor,... | java | public static ElDescriptor analyzeQuery(final GenericsContext genericsContext, final String query) {
final List<String> vars = ElUtils.findVars(query);
ElDescriptor descriptor = null;
if (!vars.isEmpty()) {
descriptor = new ElDescriptor(vars);
checkGenericVars(descriptor,... | [
"public",
"static",
"ElDescriptor",
"analyzeQuery",
"(",
"final",
"GenericsContext",
"genericsContext",
",",
"final",
"String",
"query",
")",
"{",
"final",
"List",
"<",
"String",
">",
"vars",
"=",
"ElUtils",
".",
"findVars",
"(",
"query",
")",
";",
"ElDescript... | Analyze query string for variables.
@param genericsContext generics context (set to the method owner type)
@param query query string
@return descriptor object if variables found, null otherwise | [
"Analyze",
"query",
"string",
"for",
"variables",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/core/el/ElAnalyzer.java#L31-L39 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/MethodDefinitionException.java | MethodDefinitionException.check | public static void check(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new MethodDefinitionException(String.format(message, args));
}
} | java | public static void check(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new MethodDefinitionException(String.format(message, args));
}
} | [
"public",
"static",
"void",
"check",
"(",
"final",
"boolean",
"condition",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"MethodDefinitionException",
"(",
"String",
... | Shortcut to check and throw definition exception.
@param condition condition to validate
@param message fail message
@param args fail message arguments | [
"Shortcut",
"to",
"check",
"and",
"throw",
"definition",
"exception",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/MethodDefinitionException.java#L28-L32 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/service/result/converter/Optionals.java | Optionals.jdk8 | private static Object jdk8(final Class<?> type, final Object object) {
try {
// a bit faster than resolving it each time
if (jdk8OptionalFactory == null) {
lookupOptionalFactoryMethod(type);
}
return jdk8OptionalFactory.invoke(null, object);
... | java | private static Object jdk8(final Class<?> type, final Object object) {
try {
// a bit faster than resolving it each time
if (jdk8OptionalFactory == null) {
lookupOptionalFactoryMethod(type);
}
return jdk8OptionalFactory.invoke(null, object);
... | [
"private",
"static",
"Object",
"jdk8",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Object",
"object",
")",
"{",
"try",
"{",
"// a bit faster than resolving it each time",
"if",
"(",
"jdk8OptionalFactory",
"==",
"null",
")",
"{",
"lookupOptionalF... | Only this will cause optional class loading and fail for earlier jdk.
@param object object for conversion
@return optional instance | [
"Only",
"this",
"will",
"cause",
"optional",
"class",
"loading",
"and",
"fail",
"for",
"earlier",
"jdk",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/service/result/converter/Optionals.java#L49-L59 | train |
rythmengine/spring-rythm | src/main/java/org/rythmengine/spring/RythmEngineFactory.java | RythmEngineFactory.setEngineConfigMap | public void setEngineConfigMap(Map<String, Object> engineConfigMap) {
if (engineConfigMap != null) {
this.engineConfig.putAll(engineConfigMap);
}
} | java | public void setEngineConfigMap(Map<String, Object> engineConfigMap) {
if (engineConfigMap != null) {
this.engineConfig.putAll(engineConfigMap);
}
} | [
"public",
"void",
"setEngineConfigMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"engineConfigMap",
")",
"{",
"if",
"(",
"engineConfigMap",
"!=",
"null",
")",
"{",
"this",
".",
"engineConfig",
".",
"putAll",
"(",
"engineConfigMap",
")",
";",
"}",
"}"... | Set Rythm properties as Map, to allow for non-String values
like "ds.resource.loader.instance".
@see #setEngineConfig | [
"Set",
"Rythm",
"properties",
"as",
"Map",
"to",
"allow",
"for",
"non",
"-",
"String",
"values",
"like",
"ds",
".",
"resource",
".",
"loader",
".",
"instance",
"."
] | a654016371c72dabaea50ac9a57626da7614d236 | https://github.com/rythmengine/spring-rythm/blob/a654016371c72dabaea50ac9a57626da7614d236/src/main/java/org/rythmengine/spring/RythmEngineFactory.java#L115-L119 | train |
rythmengine/spring-rythm | src/main/java/org/rythmengine/spring/RythmEngineFactory.java | RythmEngineFactory.createRythmEngine | public RythmEngine createRythmEngine() throws IOException, RythmException {
Map<String, Object> p = new HashMap<String, Object>();
p.put(RythmConfigurationKey.ENGINE_PLUGIN_VERSION.getKey(), Version.VALUE);
// Load config file if set.
if (this.configLocation != null) {
logger.info("Loading Ryth... | java | public RythmEngine createRythmEngine() throws IOException, RythmException {
Map<String, Object> p = new HashMap<String, Object>();
p.put(RythmConfigurationKey.ENGINE_PLUGIN_VERSION.getKey(), Version.VALUE);
// Load config file if set.
if (this.configLocation != null) {
logger.info("Loading Ryth... | [
"public",
"RythmEngine",
"createRythmEngine",
"(",
")",
"throws",
"IOException",
",",
"RythmException",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"p",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"p",
".",
"put",
"(",
"... | Prepare the RythmEngine instance and return it.
@return the RythmEngine instance
@throws java.io.IOException if the config file wasn't found
@throws RythmException on Rythm initialization failure | [
"Prepare",
"the",
"RythmEngine",
"instance",
"and",
"return",
"it",
"."
] | a654016371c72dabaea50ac9a57626da7614d236 | https://github.com/rythmengine/spring-rythm/blob/a654016371c72dabaea50ac9a57626da7614d236/src/main/java/org/rythmengine/spring/RythmEngineFactory.java#L208-L276 | train |
legsem/legstar.avro | legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/ZosVarRdwDatumReader.java | ZosVarRdwDatumReader.getRecordLen | private static int getRecordLen(byte[] hostData, int start, int length) {
int len = getRawRdw(hostData, start, length);
if (len < RDW_LEN || len > hostData.length) {
throw new IllegalArgumentException(
"Record does not start with a Record Descriptor Word");
}
... | java | private static int getRecordLen(byte[] hostData, int start, int length) {
int len = getRawRdw(hostData, start, length);
if (len < RDW_LEN || len > hostData.length) {
throw new IllegalArgumentException(
"Record does not start with a Record Descriptor Word");
}
... | [
"private",
"static",
"int",
"getRecordLen",
"(",
"byte",
"[",
"]",
"hostData",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"int",
"len",
"=",
"getRawRdw",
"(",
"hostData",
",",
"start",
",",
"length",
")",
";",
"if",
"(",
"len",
"<",
"RDW_LE... | RDW is a 4 bytes numeric stored in Big Endian as a binary 2's complement.
@param hostData the mainframe data
@param start where the RDW starts
@param length the total size of the mainframe data
@return the size of the record (actual data without the rdw itself) | [
"RDW",
"is",
"a",
"4",
"bytes",
"numeric",
"stored",
"in",
"Big",
"Endian",
"as",
"a",
"binary",
"2",
"s",
"complement",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.cob2avro/src/main/java/com/legstar/avro/cob2avro/io/ZosVarRdwDatumReader.java#L96-L105 | train |
legsem/legstar.avro | legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java | Xsd2AvroTranslator.translate | public String translate(XmlSchema xmlSchema, String avroNamespace,
String avroSchemaName) throws Xsd2AvroTranslatorException {
log.debug("XML Schema to Avro Schema translator started");
final Map < QName, XmlSchemaElement > items = xmlSchema.getElements();
ObjectNode rootAvroSchema... | java | public String translate(XmlSchema xmlSchema, String avroNamespace,
String avroSchemaName) throws Xsd2AvroTranslatorException {
log.debug("XML Schema to Avro Schema translator started");
final Map < QName, XmlSchemaElement > items = xmlSchema.getElements();
ObjectNode rootAvroSchema... | [
"public",
"String",
"translate",
"(",
"XmlSchema",
"xmlSchema",
",",
"String",
"avroNamespace",
",",
"String",
"avroSchemaName",
")",
"throws",
"Xsd2AvroTranslatorException",
"{",
"log",
".",
"debug",
"(",
"\"XML Schema to Avro Schema translator started\"",
")",
";",
"f... | Translate the input XML Schema.
@param xmlSchema the input XML Schema
@param avroNamespace the target Avro namespace
@param avroSchemaName the target Avro schema name
@return the Avro schema as a JSON string
@throws Xsd2AvroTranslatorException if translation fails | [
"Translate",
"the",
"input",
"XML",
"Schema",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java#L149-L189 | train |
legsem/legstar.avro | legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java | Xsd2AvroTranslator.visit | private void visit(XmlSchema xmlSchema, final XmlSchemaElement xsdElement,
final int level, final ArrayNode avroFields)
throws Xsd2AvroTranslatorException {
/*
* If this element is referencing another, it might not be useful to
* process it.
*/
if (xsd... | java | private void visit(XmlSchema xmlSchema, final XmlSchemaElement xsdElement,
final int level, final ArrayNode avroFields)
throws Xsd2AvroTranslatorException {
/*
* If this element is referencing another, it might not be useful to
* process it.
*/
if (xsd... | [
"private",
"void",
"visit",
"(",
"XmlSchema",
"xmlSchema",
",",
"final",
"XmlSchemaElement",
"xsdElement",
",",
"final",
"int",
"level",
",",
"final",
"ArrayNode",
"avroFields",
")",
"throws",
"Xsd2AvroTranslatorException",
"{",
"/*\n * If this element is referenc... | Process a regular XML schema element.
@param xmlSchema the input XML schema
@param xsdElement the XML Schema element to process
@param level the current level in the elements hierarchy.
@param avroFields array of fields being populated
@throws Xsd2AvroTranslatorException if processing fails | [
"Process",
"a",
"regular",
"XML",
"schema",
"element",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java#L232-L269 | train |
legsem/legstar.avro | legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java | Xsd2AvroTranslator.visit | private void visit(XmlSchema xmlSchema, XmlSchemaComplexType xsdType,
final int level, final ArrayNode avroFields) {
visit(xmlSchema, xsdType.getParticle(), level, avroFields);
} | java | private void visit(XmlSchema xmlSchema, XmlSchemaComplexType xsdType,
final int level, final ArrayNode avroFields) {
visit(xmlSchema, xsdType.getParticle(), level, avroFields);
} | [
"private",
"void",
"visit",
"(",
"XmlSchema",
"xmlSchema",
",",
"XmlSchemaComplexType",
"xsdType",
",",
"final",
"int",
"level",
",",
"final",
"ArrayNode",
"avroFields",
")",
"{",
"visit",
"(",
"xmlSchema",
",",
"xsdType",
".",
"getParticle",
"(",
")",
",",
... | Create an avro complex type field using an XML schema type.
@param xsdType the XML schema complex type
@param level the depth in the hierarchy
@param avroFields array of avro fields being populated
@throws Xsd2AvroTranslatorException if something abnormal in the xsd | [
"Create",
"an",
"avro",
"complex",
"type",
"field",
"using",
"an",
"XML",
"schema",
"type",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java#L279-L284 | train |
legsem/legstar.avro | legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java | Xsd2AvroTranslator.visit | private void visit(XmlSchemaSimpleType xsdType, final int level,
final String avroFieldName, long minOccurs, long maxOccurs,
ArrayNode avroFields) throws Xsd2AvroTranslatorException {
Object avroType = getAvroPrimitiveType(avroFieldName, xsdType,
maxOccurs > 1, minOccurs... | java | private void visit(XmlSchemaSimpleType xsdType, final int level,
final String avroFieldName, long minOccurs, long maxOccurs,
ArrayNode avroFields) throws Xsd2AvroTranslatorException {
Object avroType = getAvroPrimitiveType(avroFieldName, xsdType,
maxOccurs > 1, minOccurs... | [
"private",
"void",
"visit",
"(",
"XmlSchemaSimpleType",
"xsdType",
",",
"final",
"int",
"level",
",",
"final",
"String",
"avroFieldName",
",",
"long",
"minOccurs",
",",
"long",
"maxOccurs",
",",
"ArrayNode",
"avroFields",
")",
"throws",
"Xsd2AvroTranslatorException"... | Create an avro primitive type field using an XML schema type.
@param xsdType the XML schema simple type
@param level the depth in the hierarchy
@param avroFieldName to use as the field name for this avro field
@param minOccurs lower dimension for arrays & zero for optional fields
@param maxOccurs dimension for arrays
... | [
"Create",
"an",
"avro",
"primitive",
"type",
"field",
"using",
"an",
"XML",
"schema",
"type",
"."
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.translator/src/main/java/com/legstar/avro/translator/Xsd2AvroTranslator.java#L297-L315 | train |
legsem/legstar.avro | legstar.avro.generator/src/main/java/com/legstar/avro/generator/CustomSpecificCompiler.java | CustomSpecificCompiler.isBigDecimal | public static boolean isBigDecimal(Schema schema) {
if (Type.BYTES == schema.getType()) {
JsonNode logicalTypeNode = schema.getJsonProp("logicalType");
if (logicalTypeNode != null
&& "decimal".equals(logicalTypeNode.asText())) {
return true;
... | java | public static boolean isBigDecimal(Schema schema) {
if (Type.BYTES == schema.getType()) {
JsonNode logicalTypeNode = schema.getJsonProp("logicalType");
if (logicalTypeNode != null
&& "decimal".equals(logicalTypeNode.asText())) {
return true;
... | [
"public",
"static",
"boolean",
"isBigDecimal",
"(",
"Schema",
"schema",
")",
"{",
"if",
"(",
"Type",
".",
"BYTES",
"==",
"schema",
".",
"getType",
"(",
")",
")",
"{",
"JsonNode",
"logicalTypeNode",
"=",
"schema",
".",
"getJsonProp",
"(",
"\"logicalType\"",
... | Tests whether a field is to be externalized as a BigDecimal | [
"Tests",
"whether",
"a",
"field",
"is",
"to",
"be",
"externalized",
"as",
"a",
"BigDecimal"
] | bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b | https://github.com/legsem/legstar.avro/blob/bad5e0bf41700951eee1ad6a5d6d0c47b3da8f0b/legstar.avro.generator/src/main/java/com/legstar/avro/generator/CustomSpecificCompiler.java#L36-L45 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java | RepositoryModule.configureAop | protected void configureAop() {
final RepositoryMethodInterceptor proxy = new RepositoryMethodInterceptor();
requestInjection(proxy);
// repository specific method annotations (query, function, delegate, etc.)
bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
@O... | java | protected void configureAop() {
final RepositoryMethodInterceptor proxy = new RepositoryMethodInterceptor();
requestInjection(proxy);
// repository specific method annotations (query, function, delegate, etc.)
bindInterceptor(Matchers.any(), new AbstractMatcher<Method>() {
@O... | [
"protected",
"void",
"configureAop",
"(",
")",
"{",
"final",
"RepositoryMethodInterceptor",
"proxy",
"=",
"new",
"RepositoryMethodInterceptor",
"(",
")",
";",
"requestInjection",
"(",
"proxy",
")",
";",
"// repository specific method annotations (query, function, delegate, et... | Configures repository annotations interceptor. | [
"Configures",
"repository",
"annotations",
"interceptor",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java#L108-L124 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java | RepositoryModule.bindExecutor | protected void bindExecutor(final Class<? extends RepositoryExecutor> executor) {
bind(executor).in(Singleton.class);
executorsMultibinder.addBinding().to(executor);
} | java | protected void bindExecutor(final Class<? extends RepositoryExecutor> executor) {
bind(executor).in(Singleton.class);
executorsMultibinder.addBinding().to(executor);
} | [
"protected",
"void",
"bindExecutor",
"(",
"final",
"Class",
"<",
"?",
"extends",
"RepositoryExecutor",
">",
"executor",
")",
"{",
"bind",
"(",
"executor",
")",
".",
"in",
"(",
"Singleton",
".",
"class",
")",
";",
"executorsMultibinder",
".",
"addBinding",
"(... | Register executor for specific connection type.
@param executor executor type | [
"Register",
"executor",
"for",
"specific",
"connection",
"type",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java#L142-L145 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java | RepositoryModule.loadOptionalExecutor | protected void loadOptionalExecutor(final String executorBinder) {
try {
final Method bindExecutor = RepositoryModule.class.getDeclaredMethod("bindExecutor", Class.class);
bindExecutor.setAccessible(true);
try {
Class.forName(executorBinder)
... | java | protected void loadOptionalExecutor(final String executorBinder) {
try {
final Method bindExecutor = RepositoryModule.class.getDeclaredMethod("bindExecutor", Class.class);
bindExecutor.setAccessible(true);
try {
Class.forName(executorBinder)
... | [
"protected",
"void",
"loadOptionalExecutor",
"(",
"final",
"String",
"executorBinder",
")",
"{",
"try",
"{",
"final",
"Method",
"bindExecutor",
"=",
"RepositoryModule",
".",
"class",
".",
"getDeclaredMethod",
"(",
"\"bindExecutor\"",
",",
"Class",
".",
"class",
")... | Allows to load executor only if required jars are in classpath.
For example, no need for graph dependencies if only object db is used.
@param executorBinder executor binder class
@see ru.vyarus.guice.persist.orient.support.repository.ObjectExecutorBinder as example | [
"Allows",
"to",
"load",
"executor",
"only",
"if",
"required",
"jars",
"are",
"in",
"classpath",
".",
"For",
"example",
"no",
"need",
"for",
"graph",
"dependencies",
"if",
"only",
"object",
"db",
"is",
"used",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/RepositoryModule.java#L154-L170 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.setAdapter | public void setAdapter(Adapter adapter) {
if (mAdapter != null) {
mAdapter.unregisterAdapterDataObserver(mObserver);
}
// end all running animations
if (mItemAnimator != null) {
mItemAnimator.endAnimations();
}
// Since animations are ended, mLayou... | java | public void setAdapter(Adapter adapter) {
if (mAdapter != null) {
mAdapter.unregisterAdapterDataObserver(mObserver);
}
// end all running animations
if (mItemAnimator != null) {
mItemAnimator.endAnimations();
}
// Since animations are ended, mLayou... | [
"public",
"void",
"setAdapter",
"(",
"Adapter",
"adapter",
")",
"{",
"if",
"(",
"mAdapter",
"!=",
"null",
")",
"{",
"mAdapter",
".",
"unregisterAdapterDataObserver",
"(",
"mObserver",
")",
";",
"}",
"// end all running animations",
"if",
"(",
"mItemAnimator",
"!... | Set a new adapter to provide child views on demand.
@param adapter The new adapter to set, or null to set no adapter. | [
"Set",
"a",
"new",
"adapter",
"to",
"provide",
"child",
"views",
"on",
"demand",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L290-L318 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.addAnimatingView | private void addAnimatingView(View view) {
boolean alreadyAdded = false;
if (mNumAnimatingViews > 0) {
for (int i = mAnimatingViewIndex; i < getChildCount(); ++i) {
if (getChildAt(i) == view) {
alreadyAdded = true;
break;
... | java | private void addAnimatingView(View view) {
boolean alreadyAdded = false;
if (mNumAnimatingViews > 0) {
for (int i = mAnimatingViewIndex; i < getChildCount(); ++i) {
if (getChildAt(i) == view) {
alreadyAdded = true;
break;
... | [
"private",
"void",
"addAnimatingView",
"(",
"View",
"view",
")",
"{",
"boolean",
"alreadyAdded",
"=",
"false",
";",
"if",
"(",
"mNumAnimatingViews",
">",
"0",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"mAnimatingViewIndex",
";",
"i",
"<",
"getChildCount",
"("... | Adds a view to the animatingViews list.
mAnimatingViews holds the child views that are currently being kept around
purely for the purpose of being animated out of view. They are drawn as a regular
part of the child list of the RecyclerView, but they are invisible to the LayoutManager
as they are managed separately from... | [
"Adds",
"a",
"view",
"to",
"the",
"animatingViews",
"list",
".",
"mAnimatingViews",
"holds",
"the",
"child",
"views",
"that",
"are",
"currently",
"being",
"kept",
"around",
"purely",
"for",
"the",
"purpose",
"of",
"being",
"animated",
"out",
"of",
"view",
".... | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L414-L432 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.removeAnimatingView | private void removeAnimatingView(View view) {
if (mNumAnimatingViews > 0) {
for (int i = mAnimatingViewIndex; i < getChildCount(); ++i) {
if (getChildAt(i) == view) {
removeViewAt(i);
--mNumAnimatingViews;
if (mNumAnimatingV... | java | private void removeAnimatingView(View view) {
if (mNumAnimatingViews > 0) {
for (int i = mAnimatingViewIndex; i < getChildCount(); ++i) {
if (getChildAt(i) == view) {
removeViewAt(i);
--mNumAnimatingViews;
if (mNumAnimatingV... | [
"private",
"void",
"removeAnimatingView",
"(",
"View",
"view",
")",
"{",
"if",
"(",
"mNumAnimatingViews",
">",
"0",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"mAnimatingViewIndex",
";",
"i",
"<",
"getChildCount",
"(",
")",
";",
"++",
"i",
")",
"{",
"if",
... | Removes a view from the animatingViews list.
@param view The view to be removed
@see #addAnimatingView(android.view.View) | [
"Removes",
"a",
"view",
"from",
"the",
"animatingViews",
"list",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L439-L453 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.scrollByInternal | void scrollByInternal(int x, int y) {
int overscrollX = 0, overscrollY = 0;
consumePendingUpdateOperations();
if (mAdapter != null) {
eatRequestLayout();
if (x != 0) {
final int hresult = mLayout.scrollHorizontallyBy(x, mRecycler, mState);
... | java | void scrollByInternal(int x, int y) {
int overscrollX = 0, overscrollY = 0;
consumePendingUpdateOperations();
if (mAdapter != null) {
eatRequestLayout();
if (x != 0) {
final int hresult = mLayout.scrollHorizontallyBy(x, mRecycler, mState);
... | [
"void",
"scrollByInternal",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"int",
"overscrollX",
"=",
"0",
",",
"overscrollY",
"=",
"0",
";",
"consumePendingUpdateOperations",
"(",
")",
";",
"if",
"(",
"mAdapter",
"!=",
"null",
")",
"{",
"eatRequestLayout",
... | Does not perform bounds checking. Used by internal methods that have already validated input. | [
"Does",
"not",
"perform",
"bounds",
"checking",
".",
"Used",
"by",
"internal",
"methods",
"that",
"have",
"already",
"validated",
"input",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L686-L714 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.fling | public boolean fling(int velocityX, int velocityY) {
if (Math.abs(velocityX) < mMinFlingVelocity) {
velocityX = 0;
}
if (Math.abs(velocityY) < mMinFlingVelocity) {
velocityY = 0;
}
velocityX = Math.max(-mMaxFlingVelocity, Math.min(velocityX, mMaxFlingVeloc... | java | public boolean fling(int velocityX, int velocityY) {
if (Math.abs(velocityX) < mMinFlingVelocity) {
velocityX = 0;
}
if (Math.abs(velocityY) < mMinFlingVelocity) {
velocityY = 0;
}
velocityX = Math.max(-mMaxFlingVelocity, Math.min(velocityX, mMaxFlingVeloc... | [
"public",
"boolean",
"fling",
"(",
"int",
"velocityX",
",",
"int",
"velocityY",
")",
"{",
"if",
"(",
"Math",
".",
"abs",
"(",
"velocityX",
")",
"<",
"mMinFlingVelocity",
")",
"{",
"velocityX",
"=",
"0",
";",
"}",
"if",
"(",
"Math",
".",
"abs",
"(",
... | Begin a standard fling with an initial velocity along each axis in pixels per second.
If the velocity given is below the system-defined minimum this method will return false
and no fling will occur.
@param velocityX Initial horizontal velocity in pixels per second
@param velocityY Initial vertical velocity in pixels p... | [
"Begin",
"a",
"standard",
"fling",
"with",
"an",
"initial",
"velocity",
"along",
"each",
"axis",
"in",
"pixels",
"per",
"second",
".",
"If",
"the",
"velocity",
"given",
"is",
"below",
"the",
"system",
"-",
"defined",
"minimum",
"this",
"method",
"will",
"r... | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L885-L899 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.pullGlows | private void pullGlows(int overscrollX, int overscrollY) {
if (overscrollX < 0) {
if (mLeftGlow == null) {
mLeftGlow = new EdgeEffectCompat(getContext());
mLeftGlow.setSize(getMeasuredHeight() - getPaddingTop() - getPaddingBottom(),
getMeasured... | java | private void pullGlows(int overscrollX, int overscrollY) {
if (overscrollX < 0) {
if (mLeftGlow == null) {
mLeftGlow = new EdgeEffectCompat(getContext());
mLeftGlow.setSize(getMeasuredHeight() - getPaddingTop() - getPaddingBottom(),
getMeasured... | [
"private",
"void",
"pullGlows",
"(",
"int",
"overscrollX",
",",
"int",
"overscrollY",
")",
"{",
"if",
"(",
"overscrollX",
"<",
"0",
")",
"{",
"if",
"(",
"mLeftGlow",
"==",
"null",
")",
"{",
"mLeftGlow",
"=",
"new",
"EdgeEffectCompat",
"(",
"getContext",
... | Apply a pull to relevant overscroll glow effects | [
"Apply",
"a",
"pull",
"to",
"relevant",
"overscroll",
"glow",
"effects"
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L913-L949 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.viewRangeUpdate | void viewRangeUpdate(int positionStart, int itemCount) {
final int childCount = getChildCount();
final int positionEnd = positionStart + itemCount;
for (int i = 0; i < childCount; i++) {
final ViewHolder holder = getChildViewHolderInt(getChildAt(i));
if (holder == null) ... | java | void viewRangeUpdate(int positionStart, int itemCount) {
final int childCount = getChildCount();
final int positionEnd = positionStart + itemCount;
for (int i = 0; i < childCount; i++) {
final ViewHolder holder = getChildViewHolderInt(getChildAt(i));
if (holder == null) ... | [
"void",
"viewRangeUpdate",
"(",
"int",
"positionStart",
",",
"int",
"itemCount",
")",
"{",
"final",
"int",
"childCount",
"=",
"getChildCount",
"(",
")",
";",
"final",
"int",
"positionEnd",
"=",
"positionStart",
"+",
"itemCount",
";",
"for",
"(",
"int",
"i",
... | Rebind existing views for the given range, or create as needed.
@param positionStart Adapter position to start at
@param itemCount Number of views that must explicitly be rebound | [
"Rebind",
"existing",
"views",
"for",
"the",
"given",
"range",
"or",
"create",
"as",
"needed",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1880-L1898 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.markKnownViewsInvalid | void markKnownViewsInvalid() {
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
final ViewHolder holder = getChildViewHolderInt(getChildAt(i));
if (holder != null) {
holder.addFlags(ViewHolder.FLAG_UPDATE | ViewHolder.FLAG_INVALID);
... | java | void markKnownViewsInvalid() {
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
final ViewHolder holder = getChildViewHolderInt(getChildAt(i));
if (holder != null) {
holder.addFlags(ViewHolder.FLAG_UPDATE | ViewHolder.FLAG_INVALID);
... | [
"void",
"markKnownViewsInvalid",
"(",
")",
"{",
"final",
"int",
"childCount",
"=",
"getChildCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"childCount",
";",
"i",
"++",
")",
"{",
"final",
"ViewHolder",
"holder",
"=",
"getChildV... | Mark all known views as invalid. Used in response to a, "the whole world might have changed"
data change event. | [
"Mark",
"all",
"known",
"views",
"as",
"invalid",
".",
"Used",
"in",
"response",
"to",
"a",
"the",
"whole",
"world",
"might",
"have",
"changed",
"data",
"change",
"event",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1904-L1914 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.postAdapterUpdate | void postAdapterUpdate(UpdateOp op) {
mPendingUpdates.add(op);
if (mPendingUpdates.size() == 1) {
if (mPostUpdatesOnAnimation && mHasFixedSize && mIsAttached) {
ViewCompat.postOnAnimation(this, mUpdateChildViewsRunnable);
} else {
mAdapterUpdateDur... | java | void postAdapterUpdate(UpdateOp op) {
mPendingUpdates.add(op);
if (mPendingUpdates.size() == 1) {
if (mPostUpdatesOnAnimation && mHasFixedSize && mIsAttached) {
ViewCompat.postOnAnimation(this, mUpdateChildViewsRunnable);
} else {
mAdapterUpdateDur... | [
"void",
"postAdapterUpdate",
"(",
"UpdateOp",
"op",
")",
"{",
"mPendingUpdates",
".",
"add",
"(",
"op",
")",
";",
"if",
"(",
"mPendingUpdates",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"if",
"(",
"mPostUpdatesOnAnimation",
"&&",
"mHasFixedSize",
"&&",
... | Schedule an update of data from the adapter to occur on the next frame.
On newer platform versions this happens via the postOnAnimation mechanism and RecyclerView
attempts to avoid relayouts if possible.
On older platform versions the RecyclerView requests a layout the same way ListView does. | [
"Schedule",
"an",
"update",
"of",
"data",
"from",
"the",
"adapter",
"to",
"occur",
"on",
"the",
"next",
"frame",
".",
"On",
"newer",
"platform",
"versions",
"this",
"happens",
"via",
"the",
"postOnAnimation",
"mechanism",
"and",
"RecyclerView",
"attempts",
"to... | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1922-L1932 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.getChildPosition | public int getChildPosition(View child) {
final ViewHolder holder = getChildViewHolderInt(child);
return holder != null ? holder.getPosition() : NO_POSITION;
} | java | public int getChildPosition(View child) {
final ViewHolder holder = getChildViewHolderInt(child);
return holder != null ? holder.getPosition() : NO_POSITION;
} | [
"public",
"int",
"getChildPosition",
"(",
"View",
"child",
")",
"{",
"final",
"ViewHolder",
"holder",
"=",
"getChildViewHolderInt",
"(",
"child",
")",
";",
"return",
"holder",
"!=",
"null",
"?",
"holder",
".",
"getPosition",
"(",
")",
":",
"NO_POSITION",
";"... | Return the adapter position that the given child view corresponds to.
@param child Child View to query
@return Adapter position corresponding to the given view or {@link #NO_POSITION} | [
"Return",
"the",
"adapter",
"position",
"that",
"the",
"given",
"child",
"view",
"corresponds",
"to",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1962-L1965 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.getChildItemId | public long getChildItemId(View child) {
if (mAdapter == null || !mAdapter.hasStableIds()) {
return NO_ID;
}
final ViewHolder holder = getChildViewHolderInt(child);
return holder != null ? holder.getItemId() : NO_ID;
} | java | public long getChildItemId(View child) {
if (mAdapter == null || !mAdapter.hasStableIds()) {
return NO_ID;
}
final ViewHolder holder = getChildViewHolderInt(child);
return holder != null ? holder.getItemId() : NO_ID;
} | [
"public",
"long",
"getChildItemId",
"(",
"View",
"child",
")",
"{",
"if",
"(",
"mAdapter",
"==",
"null",
"||",
"!",
"mAdapter",
".",
"hasStableIds",
"(",
")",
")",
"{",
"return",
"NO_ID",
";",
"}",
"final",
"ViewHolder",
"holder",
"=",
"getChildViewHolderI... | Return the stable item id that the given child view corresponds to.
@param child Child View to query
@return Item id corresponding to the given view or {@link #NO_ID} | [
"Return",
"the",
"stable",
"item",
"id",
"that",
"the",
"given",
"child",
"view",
"corresponds",
"to",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L1973-L1979 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java | RecyclerView.findChildViewUnder | public View findChildViewUnder(float x, float y) {
final int count = getChildCount();
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
final float translationX = ViewCompat.getTranslationX(child);
final float translationY = ViewCompat.getTransl... | java | public View findChildViewUnder(float x, float y) {
final int count = getChildCount();
for (int i = count - 1; i >= 0; i--) {
final View child = getChildAt(i);
final float translationX = ViewCompat.getTranslationX(child);
final float translationY = ViewCompat.getTransl... | [
"public",
"View",
"findChildViewUnder",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"final",
"int",
"count",
"=",
"getChildCount",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"count",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
... | Find the topmost view under the given point.
@param x Horizontal position in pixels to search
@param y Vertical position in pixels to search
@return The child view under (x, y) or null if no matching child is found | [
"Find",
"the",
"topmost",
"view",
"under",
"the",
"given",
"point",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/RecyclerView.java#L2035-L2049 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.getHorizontalSnapPreference | protected int getHorizontalSnapPreference() {
return mTargetVector == null || mTargetVector.x == 0 ? SNAP_TO_ANY :
mTargetVector.x > 0 ? SNAP_TO_END : SNAP_TO_START;
} | java | protected int getHorizontalSnapPreference() {
return mTargetVector == null || mTargetVector.x == 0 ? SNAP_TO_ANY :
mTargetVector.x > 0 ? SNAP_TO_END : SNAP_TO_START;
} | [
"protected",
"int",
"getHorizontalSnapPreference",
"(",
")",
"{",
"return",
"mTargetVector",
"==",
"null",
"||",
"mTargetVector",
".",
"x",
"==",
"0",
"?",
"SNAP_TO_ANY",
":",
"mTargetVector",
".",
"x",
">",
"0",
"?",
"SNAP_TO_END",
":",
"SNAP_TO_START",
";",
... | When scrolling towards a child view, this method defines whether we should align the left
or the right edge of the child with the parent RecyclerView.
@return SNAP_TO_START, SNAP_TO_END or SNAP_TO_ANY; depending on the current target vector
@see #SNAP_TO_START
@see #SNAP_TO_END
@see #SNAP_TO_ANY | [
"When",
"scrolling",
"towards",
"a",
"child",
"view",
"this",
"method",
"defines",
"whether",
"we",
"should",
"align",
"the",
"left",
"or",
"the",
"right",
"edge",
"of",
"the",
"child",
"with",
"the",
"parent",
"RecyclerView",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L199-L202 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.getVerticalSnapPreference | protected int getVerticalSnapPreference() {
return mTargetVector == null || mTargetVector.y == 0 ? SNAP_TO_ANY :
mTargetVector.y > 0 ? SNAP_TO_END : SNAP_TO_START;
} | java | protected int getVerticalSnapPreference() {
return mTargetVector == null || mTargetVector.y == 0 ? SNAP_TO_ANY :
mTargetVector.y > 0 ? SNAP_TO_END : SNAP_TO_START;
} | [
"protected",
"int",
"getVerticalSnapPreference",
"(",
")",
"{",
"return",
"mTargetVector",
"==",
"null",
"||",
"mTargetVector",
".",
"y",
"==",
"0",
"?",
"SNAP_TO_ANY",
":",
"mTargetVector",
".",
"y",
">",
"0",
"?",
"SNAP_TO_END",
":",
"SNAP_TO_START",
";",
... | When scrolling towards a child view, this method defines whether we should align the top
or the bottom edge of the child with the parent RecyclerView.
@return SNAP_TO_START, SNAP_TO_END or SNAP_TO_ANY; depending on the current target vector
@see #SNAP_TO_START
@see #SNAP_TO_END
@see #SNAP_TO_ANY | [
"When",
"scrolling",
"towards",
"a",
"child",
"view",
"this",
"method",
"defines",
"whether",
"we",
"should",
"align",
"the",
"top",
"or",
"the",
"bottom",
"edge",
"of",
"the",
"child",
"with",
"the",
"parent",
"RecyclerView",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L213-L216 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.updateActionForInterimTarget | protected void updateActionForInterimTarget(Action action) {
// find an interim target position
PointF scrollVector = computeScrollVectorForPosition(getTargetPosition());
if (scrollVector == null || (scrollVector.x == 0 && scrollVector.y == 0)) {
Log.e(TAG, "To support smooth scrolli... | java | protected void updateActionForInterimTarget(Action action) {
// find an interim target position
PointF scrollVector = computeScrollVectorForPosition(getTargetPosition());
if (scrollVector == null || (scrollVector.x == 0 && scrollVector.y == 0)) {
Log.e(TAG, "To support smooth scrolli... | [
"protected",
"void",
"updateActionForInterimTarget",
"(",
"Action",
"action",
")",
"{",
"// find an interim target position",
"PointF",
"scrollVector",
"=",
"computeScrollVectorForPosition",
"(",
"getTargetPosition",
"(",
")",
")",
";",
"if",
"(",
"scrollVector",
"==",
... | When the target scroll position is not a child of the RecyclerView, this method calculates
a direction vector towards that child and triggers a smooth scroll.
@see #computeScrollVectorForPosition(int) | [
"When",
"the",
"target",
"scroll",
"position",
"is",
"not",
"a",
"child",
"of",
"the",
"RecyclerView",
"this",
"method",
"calculates",
"a",
"direction",
"vector",
"towards",
"that",
"child",
"and",
"triggers",
"a",
"smooth",
"scroll",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L224-L248 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.calculateDyToMakeVisible | public int calculateDyToMakeVisible(View view, int snapPreference) {
final RecyclerView.LayoutManager layoutManager = getLayoutManager();
if (!layoutManager.canScrollVertically()) {
return 0;
}
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
... | java | public int calculateDyToMakeVisible(View view, int snapPreference) {
final RecyclerView.LayoutManager layoutManager = getLayoutManager();
if (!layoutManager.canScrollVertically()) {
return 0;
}
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
... | [
"public",
"int",
"calculateDyToMakeVisible",
"(",
"View",
"view",
",",
"int",
"snapPreference",
")",
"{",
"final",
"RecyclerView",
".",
"LayoutManager",
"layoutManager",
"=",
"getLayoutManager",
"(",
")",
";",
"if",
"(",
"!",
"layoutManager",
".",
"canScrollVertic... | Calculates the vertical scroll amount necessary to make the given view fully visible
inside the RecyclerView.
@param view The view which we want to make fully visible
@param snapPreference The edge which the view should snap to when entering the visible
area. One of {@link #SNAP_TO_START}, {@link #SNAP_TO_EN... | [
"Calculates",
"the",
"vertical",
"scroll",
"amount",
"necessary",
"to",
"make",
"the",
"given",
"view",
"fully",
"visible",
"inside",
"the",
"RecyclerView",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L298-L310 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java | LinearSmoothScroller.calculateDxToMakeVisible | public int calculateDxToMakeVisible(View view, int snapPreference) {
final RecyclerView.LayoutManager layoutManager = getLayoutManager();
if (!layoutManager.canScrollHorizontally()) {
return 0;
}
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
... | java | public int calculateDxToMakeVisible(View view, int snapPreference) {
final RecyclerView.LayoutManager layoutManager = getLayoutManager();
if (!layoutManager.canScrollHorizontally()) {
return 0;
}
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)
... | [
"public",
"int",
"calculateDxToMakeVisible",
"(",
"View",
"view",
",",
"int",
"snapPreference",
")",
"{",
"final",
"RecyclerView",
".",
"LayoutManager",
"layoutManager",
"=",
"getLayoutManager",
"(",
")",
";",
"if",
"(",
"!",
"layoutManager",
".",
"canScrollHorizo... | Calculates the horizontal scroll amount necessary to make the given view fully visible
inside the RecyclerView.
@param view The view which we want to make fully visible
@param snapPreference The edge which the view should snap to when entering the visible
area. One of {@link #SNAP_TO_START}, {@link #SNAP_TO_... | [
"Calculates",
"the",
"horizontal",
"scroll",
"amount",
"necessary",
"to",
"make",
"the",
"given",
"view",
"fully",
"visible",
"inside",
"the",
"RecyclerView",
"."
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/android/support/v7/widget/LinearSmoothScroller.java#L323-L335 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/command/ext/listen/ListenParamExtension.java | ListenParamExtension.resolveTargetType | private Class<?> resolveTargetType(final Class<?> listenerType, final Class<?> declaredTargetType) {
Class<?> target = null;
if (RequiresRecordConversion.class.isAssignableFrom(listenerType)) {
target = GenericsResolver.resolve(listenerType)
.type(RequiresRecordConversion... | java | private Class<?> resolveTargetType(final Class<?> listenerType, final Class<?> declaredTargetType) {
Class<?> target = null;
if (RequiresRecordConversion.class.isAssignableFrom(listenerType)) {
target = GenericsResolver.resolve(listenerType)
.type(RequiresRecordConversion... | [
"private",
"Class",
"<",
"?",
">",
"resolveTargetType",
"(",
"final",
"Class",
"<",
"?",
">",
"listenerType",
",",
"final",
"Class",
"<",
"?",
">",
"declaredTargetType",
")",
"{",
"Class",
"<",
"?",
">",
"target",
"=",
"null",
";",
"if",
"(",
"Requires... | Resolve target conversion type either from listener instance or, if its not possible, from
listener parameter declaration.
@param listenerType listener instance type
@param declaredTargetType listener generic declared in method declaration
@return target conversion type or null if conversion is not required | [
"Resolve",
"target",
"conversion",
"type",
"either",
"from",
"listener",
"instance",
"or",
"if",
"its",
"not",
"possible",
"from",
"listener",
"parameter",
"declaration",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/command/ext/listen/ListenParamExtension.java#L147-L159 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/util/RepositoryUtils.java | RepositoryUtils.methodToString | public static String methodToString(final Class<?> type, final Method method) {
final StringBuilder res = new StringBuilder();
res.append(type.getSimpleName()).append('#').append(method.getName()).append('(');
int i = 0;
for (Class<?> param : method.getParameterTypes()) {
if ... | java | public static String methodToString(final Class<?> type, final Method method) {
final StringBuilder res = new StringBuilder();
res.append(type.getSimpleName()).append('#').append(method.getName()).append('(');
int i = 0;
for (Class<?> param : method.getParameterTypes()) {
if ... | [
"public",
"static",
"String",
"methodToString",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"Method",
"method",
")",
"{",
"final",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"res",
".",
"append",
"(",
"type",
".",... | Converts method signature to human readable string.
@param type root type (method may be called not from declaring class)
@param method method to print
@return string representation for method | [
"Converts",
"method",
"signature",
"to",
"human",
"readable",
"string",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/util/RepositoryUtils.java#L57-L76 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java | ExtCompatibilityUtils.checkParamExtensionCompatibility | public static void checkParamExtensionCompatibility(
final Class<? extends RepositoryMethodDescriptor> descriptorType,
final Class<? extends MethodParamExtension> paramExtType) {
check(isCompatible(paramExtType, MethodParamExtension.class, descriptorType),
"Param extensio... | java | public static void checkParamExtensionCompatibility(
final Class<? extends RepositoryMethodDescriptor> descriptorType,
final Class<? extends MethodParamExtension> paramExtType) {
check(isCompatible(paramExtType, MethodParamExtension.class, descriptorType),
"Param extensio... | [
"public",
"static",
"void",
"checkParamExtensionCompatibility",
"(",
"final",
"Class",
"<",
"?",
"extends",
"RepositoryMethodDescriptor",
">",
"descriptorType",
",",
"final",
"Class",
"<",
"?",
"extends",
"MethodParamExtension",
">",
"paramExtType",
")",
"{",
"check",... | Checks that parameter extension is compatible with descriptor and throws error if extension incompatible.
@param descriptorType method descriptor type
@param paramExtType parameter extension type | [
"Checks",
"that",
"parameter",
"extension",
"is",
"compatible",
"with",
"descriptor",
"and",
"throws",
"error",
"if",
"extension",
"incompatible",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java#L43-L49 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java | ExtCompatibilityUtils.checkAmendExtensionsCompatibility | public static void checkAmendExtensionsCompatibility(
final Class<? extends RepositoryMethodDescriptor> descriptorType,
final List<Annotation> extensions) {
final List<Class<? extends AmendMethodExtension>> exts =
Lists.transform(extensions, new Function<Annotation, Class... | java | public static void checkAmendExtensionsCompatibility(
final Class<? extends RepositoryMethodDescriptor> descriptorType,
final List<Annotation> extensions) {
final List<Class<? extends AmendMethodExtension>> exts =
Lists.transform(extensions, new Function<Annotation, Class... | [
"public",
"static",
"void",
"checkAmendExtensionsCompatibility",
"(",
"final",
"Class",
"<",
"?",
"extends",
"RepositoryMethodDescriptor",
">",
"descriptorType",
",",
"final",
"List",
"<",
"Annotation",
">",
"extensions",
")",
"{",
"final",
"List",
"<",
"Class",
"... | Checks that amend extensions strictly compatible with descriptor object.
Used for amend annotations defined on method.
@param descriptorType method descriptor type
@param extensions amend extension annotations | [
"Checks",
"that",
"amend",
"extensions",
"strictly",
"compatible",
"with",
"descriptor",
"object",
".",
"Used",
"for",
"amend",
"annotations",
"defined",
"on",
"method",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java#L58-L74 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java | ExtCompatibilityUtils.filterCompatibleExtensions | public static List<AmendExecutionExtension> filterCompatibleExtensions(
final List<AmendExecutionExtension> extensions,
final Class<? extends RepositoryMethodDescriptor> descriptorType) {
@SuppressWarnings("unchecked")
final Class<? extends AmendExecutionExtension> supportedExten... | java | public static List<AmendExecutionExtension> filterCompatibleExtensions(
final List<AmendExecutionExtension> extensions,
final Class<? extends RepositoryMethodDescriptor> descriptorType) {
@SuppressWarnings("unchecked")
final Class<? extends AmendExecutionExtension> supportedExten... | [
"public",
"static",
"List",
"<",
"AmendExecutionExtension",
">",
"filterCompatibleExtensions",
"(",
"final",
"List",
"<",
"AmendExecutionExtension",
">",
"extensions",
",",
"final",
"Class",
"<",
"?",
"extends",
"RepositoryMethodDescriptor",
">",
"descriptorType",
")",
... | Checks resolved amend extensions compatibility with method specific extension type.
Extension may be universal and support some methods and doesn't support other.
@param extensions extensions to check
@param descriptorType repository method descriptor type
@return filtered extensions list (safe to use by method ex... | [
"Checks",
"resolved",
"amend",
"extensions",
"compatibility",
"with",
"method",
"specific",
"extension",
"type",
".",
"Extension",
"may",
"be",
"universal",
"and",
"support",
"some",
"methods",
"and",
"doesn",
"t",
"support",
"other",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ExtCompatibilityUtils.java#L99-L118 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/ToolTipButton.java | ToolTipButton.disposeTooltip | public void disposeTooltip() {
if (popup != null) {
timer.stop();
popup.setVisible(false);
popup = null;
}
} | java | public void disposeTooltip() {
if (popup != null) {
timer.stop();
popup.setVisible(false);
popup = null;
}
} | [
"public",
"void",
"disposeTooltip",
"(",
")",
"{",
"if",
"(",
"popup",
"!=",
"null",
")",
"{",
"timer",
".",
"stop",
"(",
")",
";",
"popup",
".",
"setVisible",
"(",
"false",
")",
";",
"popup",
"=",
"null",
";",
"}",
"}"
] | Dispose the tooltip | [
"Dispose",
"the",
"tooltip"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/ToolTipButton.java#L271-L277 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/ToolTipButton.java | ToolTipButton.showTooltip | private void showTooltip() {
Wrap tooltipLabel = new Wrap(toolTipWrapWidth);
tooltipLabel.setForeground(getForeground());
tooltipLabel.setFont(ToolTipButton.this.getFont());
tooltipLabel.setText(text);
JPanel panel = new JPanel();
panel.setBackground(toolTipBackground);
panel.setLayout(new ... | java | private void showTooltip() {
Wrap tooltipLabel = new Wrap(toolTipWrapWidth);
tooltipLabel.setForeground(getForeground());
tooltipLabel.setFont(ToolTipButton.this.getFont());
tooltipLabel.setText(text);
JPanel panel = new JPanel();
panel.setBackground(toolTipBackground);
panel.setLayout(new ... | [
"private",
"void",
"showTooltip",
"(",
")",
"{",
"Wrap",
"tooltipLabel",
"=",
"new",
"Wrap",
"(",
"toolTipWrapWidth",
")",
";",
"tooltipLabel",
".",
"setForeground",
"(",
"getForeground",
"(",
")",
")",
";",
"tooltipLabel",
".",
"setFont",
"(",
"ToolTipButton"... | Show the tooltip. | [
"Show",
"the",
"tooltip",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/ToolTipButton.java#L282-L335 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/delegate/method/MethodFilters.java | MethodFilters.filterByClosestParams | public static Collection<MatchedMethod> filterByClosestParams(
final Collection<MatchedMethod> possibilities, final int paramsCount) {
Collection<MatchedMethod> res = null;
for (int i = 0; i < paramsCount; i++) {
final Collection<MatchedMethod> filtered = filterByParam(possibilit... | java | public static Collection<MatchedMethod> filterByClosestParams(
final Collection<MatchedMethod> possibilities, final int paramsCount) {
Collection<MatchedMethod> res = null;
for (int i = 0; i < paramsCount; i++) {
final Collection<MatchedMethod> filtered = filterByParam(possibilit... | [
"public",
"static",
"Collection",
"<",
"MatchedMethod",
">",
"filterByClosestParams",
"(",
"final",
"Collection",
"<",
"MatchedMethod",
">",
"possibilities",
",",
"final",
"int",
"paramsCount",
")",
"{",
"Collection",
"<",
"MatchedMethod",
">",
"res",
"=",
"null",... | Looks for most specific type for each parameter.
@param possibilities methods to reduce
@param paramsCount repository method params count
@return possibly reduced collection or original one | [
"Looks",
"for",
"most",
"specific",
"type",
"for",
"each",
"parameter",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/delegate/method/MethodFilters.java#L45-L59 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/pool/DocumentPool.java | DocumentPool.checkAndAcquireConnection | private ODatabaseDocument checkAndAcquireConnection() {
final ODatabaseDocument res;
if (userManager.isSpecificUser()) {
// non pool-managed connection for different user
res = orientDB.get().open(database, userManager.getUser(), userManager.getPassword());
} else {
... | java | private ODatabaseDocument checkAndAcquireConnection() {
final ODatabaseDocument res;
if (userManager.isSpecificUser()) {
// non pool-managed connection for different user
res = orientDB.get().open(database, userManager.getUser(), userManager.getPassword());
} else {
... | [
"private",
"ODatabaseDocument",
"checkAndAcquireConnection",
"(",
")",
"{",
"final",
"ODatabaseDocument",
"res",
";",
"if",
"(",
"userManager",
".",
"isSpecificUser",
"(",
")",
")",
"{",
"// non pool-managed connection for different user",
"res",
"=",
"orientDB",
".",
... | Its definitely not normal that pool returns closed connections, but possible if used improperly.
@return connection itself or new valid connection | [
"Its",
"definitely",
"not",
"normal",
"that",
"pool",
"returns",
"closed",
"connections",
"but",
"possible",
"if",
"used",
"improperly",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/pool/DocumentPool.java#L171-L187 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java | RidUtils.trackIdChange | public static void trackIdChange(final ODocument document, final Object pojo) {
if (document.getIdentity().isNew()) {
ORecordInternal.addIdentityChangeListener(document, new OIdentityChangeListener() {
@Override
public void onBeforeIdentityChange(final ORecord record)... | java | public static void trackIdChange(final ODocument document, final Object pojo) {
if (document.getIdentity().isNew()) {
ORecordInternal.addIdentityChangeListener(document, new OIdentityChangeListener() {
@Override
public void onBeforeIdentityChange(final ORecord record)... | [
"public",
"static",
"void",
"trackIdChange",
"(",
"final",
"ODocument",
"document",
",",
"final",
"Object",
"pojo",
")",
"{",
"if",
"(",
"document",
".",
"getIdentity",
"(",
")",
".",
"isNew",
"(",
")",
")",
"{",
"ORecordInternal",
".",
"addIdentityChangeLis... | When just created object is detached to pure pojo it gets temporary id.
Real id is assigned only after transaction commit. This method tracks original
document, intercepts its id change and sets correct id and version into pojo.
So it become safe to use such pojo id outside of transaction.
@param document original doc... | [
"When",
"just",
"created",
"object",
"is",
"detached",
"to",
"pure",
"pojo",
"it",
"gets",
"temporary",
"id",
".",
"Real",
"id",
"is",
"assigned",
"only",
"after",
"transaction",
"commit",
".",
"This",
"method",
"tracks",
"original",
"document",
"intercepts",
... | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java#L89-L104 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java | RidUtils.findIdField | private static Field findIdField(final Object value) {
Field res = null;
final Class<?> type = value.getClass();
if (ODatabaseRecordThreadLocal.instance().isDefined()) {
res = OObjectEntitySerializer.getIdField(type);
} else {
final String idField = OObjectSeriali... | java | private static Field findIdField(final Object value) {
Field res = null;
final Class<?> type = value.getClass();
if (ODatabaseRecordThreadLocal.instance().isDefined()) {
res = OObjectEntitySerializer.getIdField(type);
} else {
final String idField = OObjectSeriali... | [
"private",
"static",
"Field",
"findIdField",
"(",
"final",
"Object",
"value",
")",
"{",
"Field",
"res",
"=",
"null",
";",
"final",
"Class",
"<",
"?",
">",
"type",
"=",
"value",
".",
"getClass",
"(",
")",
";",
"if",
"(",
"ODatabaseRecordThreadLocal",
".",... | Core orient field resolve method relies on bound connection, but it may be required to resolve
id outside of transaction. So we use orient method under transaction and do manual scan outside
of transaction.
@param value object instance (non proxy)
@return object id field or null if not found | [
"Core",
"orient",
"field",
"resolve",
"method",
"relies",
"on",
"bound",
"connection",
"but",
"it",
"may",
"be",
"required",
"to",
"resolve",
"id",
"outside",
"of",
"transaction",
".",
"So",
"we",
"use",
"orient",
"method",
"under",
"transaction",
"and",
"do... | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/util/RidUtils.java#L142-L159 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.getCurrentModal_ | private static Component getCurrentModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
if (modal.getSize() > 0) {
return modal.components.get(modal.components.size() - 1);
}
}
return null;
}
} | java | private static Component getCurrentModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
if (modal.getSize() > 0) {
return modal.components.get(modal.components.size() - 1);
}
}
return null;
}
} | [
"private",
"static",
"Component",
"getCurrentModal_",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"!=",
"null",
")",
"{... | Get the current modal component of a specific RootPaneContainer.
@param rootPane
the RootPaneContainer with a modal
@return Component or <code>NULL</code> | [
"Get",
"the",
"current",
"modal",
"component",
"of",
"a",
"specific",
"RootPaneContainer",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L120-L130 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.closeCurrentModal_ | private static void closeCurrentModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
modal.closeCurrent();
if (modal.getSize() == 0) {
modals.remove(rootPane);
}
}
}
} | java | private static void closeCurrentModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
modal.closeCurrent();
if (modal.getSize() == 0) {
modals.remove(rootPane);
}
}
}
} | [
"private",
"static",
"void",
"closeCurrentModal_",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"!=",
"null",
")",
"{",
... | Close the current modal component of a specific RootPaneContainer.
@param rootPane
the RootPaneContainer with a modal | [
"Close",
"the",
"current",
"modal",
"component",
"of",
"a",
"specific",
"RootPaneContainer",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L168-L178 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.closeModal | public static void closeModal(Component component) {
synchronized (modals) {
RootPaneContainer frame = null;
Modal modal = null;
Iterator<Entry<RootPaneContainer, Modal>> it =
modals.entrySet().iterator();
while (it.hasNext()) {
Entry<RootPaneContainer, Modal> entry = it.next();
modal = entry.getV... | java | public static void closeModal(Component component) {
synchronized (modals) {
RootPaneContainer frame = null;
Modal modal = null;
Iterator<Entry<RootPaneContainer, Modal>> it =
modals.entrySet().iterator();
while (it.hasNext()) {
Entry<RootPaneContainer, Modal> entry = it.next();
modal = entry.getV... | [
"public",
"static",
"void",
"closeModal",
"(",
"Component",
"component",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"RootPaneContainer",
"frame",
"=",
"null",
";",
"Modal",
"modal",
"=",
"null",
";",
"Iterator",
"<",
"Entry",
"<",
"RootPaneContainer",
... | Close a specific modal component.
@param component
the modal's component | [
"Close",
"a",
"specific",
"modal",
"component",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L186-L212 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.closeAllModals_ | private static void closeAllModals_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
modal.closeAll();
modals.remove(rootPane);
}
}
} | java | private static void closeAllModals_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
modal.closeAll();
modals.remove(rootPane);
}
}
} | [
"private",
"static",
"void",
"closeAllModals_",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"!=",
"null",
")",
"{",
"... | Close all modals of a specific RootPaneContainer.
@param rootPane
the RootPaneContainer with a modal | [
"Close",
"all",
"modals",
"of",
"a",
"specific",
"RootPaneContainer",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L250-L258 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.hasModal_ | private static boolean hasModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null && modal.getSize() > 0) {
return true;
}
return false;
}
} | java | private static boolean hasModal_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null && modal.getSize() > 0) {
return true;
}
return false;
}
} | [
"private",
"static",
"boolean",
"hasModal_",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"!=",
"null",
"&&",
"modal",
... | Indicates whether the RootPaneContainer has a modal.
@param rootPane
the RootPaneContainer with a modal
@return boolean | [
"Indicates",
"whether",
"the",
"RootPaneContainer",
"has",
"a",
"modal",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L300-L308 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.getModal | private static Modal getModal(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal == null) {
modal = new Modal(rootPane);
modals.put(rootPane, modal);
}
return modal;
}
} | java | private static Modal getModal(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal == null) {
modal = new Modal(rootPane);
modals.put(rootPane, modal);
}
return modal;
}
} | [
"private",
"static",
"Modal",
"getModal",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"==",
"null",
")",
"{",
"modal"... | Get the modal of a specific frame
@param rootPane
the RootPaneContainer with a modal
@return {@link Modal} | [
"Get",
"the",
"modal",
"of",
"a",
"specific",
"frame"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L317-L326 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.isModal | public static boolean isModal(Component component) {
synchronized (modals) {
Iterator<Entry<RootPaneContainer, Modal>> it =
modals.entrySet().iterator();
while (it.hasNext()) {
Entry<RootPaneContainer, Modal> entry = it.next();
if (entry.getValue().components.contains(component)) {
return true;
}
... | java | public static boolean isModal(Component component) {
synchronized (modals) {
Iterator<Entry<RootPaneContainer, Modal>> it =
modals.entrySet().iterator();
while (it.hasNext()) {
Entry<RootPaneContainer, Modal> entry = it.next();
if (entry.getValue().components.contains(component)) {
return true;
}
... | [
"public",
"static",
"boolean",
"isModal",
"(",
"Component",
"component",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"RootPaneContainer",
",",
"Modal",
">",
">",
"it",
"=",
"modals",
".",
"entrySet",
"(",
")",
".",
"... | Indicates whether the component is a modal component.
@param component
the component
@return boolean | [
"Indicates",
"whether",
"the",
"component",
"is",
"a",
"modal",
"component",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L335-L347 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.addModal | public static void addModal(JInternalFrame frame, Component component,
ModalListener listener) {
addModal_(frame, component, listener, defaultModalDepth);
} | java | public static void addModal(JInternalFrame frame, Component component,
ModalListener listener) {
addModal_(frame, component, listener, defaultModalDepth);
} | [
"public",
"static",
"void",
"addModal",
"(",
"JInternalFrame",
"frame",
",",
"Component",
"component",
",",
"ModalListener",
"listener",
")",
"{",
"addModal_",
"(",
"frame",
",",
"component",
",",
"listener",
",",
"defaultModalDepth",
")",
";",
"}"
] | Add a modal component in the internal frame.
@param frame
the internal frame
@param component
the component for modal
@param listener
the listener for modal | [
"Add",
"a",
"modal",
"component",
"in",
"the",
"internal",
"frame",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L371-L374 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.addModal | public static void addModal(JFrame frame, Component component,
ModalListener listener, Integer modalDepth) {
addModal_(frame, component, listener, modalDepth);
} | java | public static void addModal(JFrame frame, Component component,
ModalListener listener, Integer modalDepth) {
addModal_(frame, component, listener, modalDepth);
} | [
"public",
"static",
"void",
"addModal",
"(",
"JFrame",
"frame",
",",
"Component",
"component",
",",
"ModalListener",
"listener",
",",
"Integer",
"modalDepth",
")",
"{",
"addModal_",
"(",
"frame",
",",
"component",
",",
"listener",
",",
"modalDepth",
")",
";",
... | Add a modal component in the frame.
@param frame
the frame
@param component
the component for modal
@param listener
the listener for modal
@param modalDepth
the depth for modal | [
"Add",
"a",
"modal",
"component",
"in",
"the",
"frame",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L499-L502 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.addModal_ | private static void addModal_(RootPaneContainer rootPane,
Component component, ModalListener listener,
Integer modalDepth) {
synchronized (modals) {
if (isModal(component) == false) {
getModal(rootPane).addModal(component, listener, modalDepth);
}
}
} | java | private static void addModal_(RootPaneContainer rootPane,
Component component, ModalListener listener,
Integer modalDepth) {
synchronized (modals) {
if (isModal(component) == false) {
getModal(rootPane).addModal(component, listener, modalDepth);
}
}
} | [
"private",
"static",
"void",
"addModal_",
"(",
"RootPaneContainer",
"rootPane",
",",
"Component",
"component",
",",
"ModalListener",
"listener",
",",
"Integer",
"modalDepth",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"if",
"(",
"isModal",
"(",
"componen... | Add a modal component in the RootPaneContainer.
@param rootPane
the RootPaneContainer
@param component
the component for modal
@param listener
the listener for modal
@param modalDepth
the depth for modal | [
"Add",
"a",
"modal",
"component",
"in",
"the",
"RootPaneContainer",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L516-L524 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.getModalCount_ | private static int getModalCount_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
return modal.getSize();
}
return 0;
}
} | java | private static int getModalCount_(RootPaneContainer rootPane) {
synchronized (modals) {
Modal modal = modals.get(rootPane);
if (modal != null) {
return modal.getSize();
}
return 0;
}
} | [
"private",
"static",
"int",
"getModalCount_",
"(",
"RootPaneContainer",
"rootPane",
")",
"{",
"synchronized",
"(",
"modals",
")",
"{",
"Modal",
"modal",
"=",
"modals",
".",
"get",
"(",
"rootPane",
")",
";",
"if",
"(",
"modal",
"!=",
"null",
")",
"{",
"re... | Get the modal count of a specific RootPaneContainer.
@param frame
the RootPaneContainer with a modal
@return int | [
"Get",
"the",
"modal",
"count",
"of",
"a",
"specific",
"RootPaneContainer",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L590-L598 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.closeCurrent | private void closeCurrent() {
if (components.size() > 0) {
Component component = components.remove(components.size() - 1);
getModalPanel().removeAll();
fireCloseActionListener(listeners.get(component));
listeners.remove(component);
if (components.size() > 0) {
showNextComponent();
} else {
resto... | java | private void closeCurrent() {
if (components.size() > 0) {
Component component = components.remove(components.size() - 1);
getModalPanel().removeAll();
fireCloseActionListener(listeners.get(component));
listeners.remove(component);
if (components.size() > 0) {
showNextComponent();
} else {
resto... | [
"private",
"void",
"closeCurrent",
"(",
")",
"{",
"if",
"(",
"components",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"Component",
"component",
"=",
"components",
".",
"remove",
"(",
"components",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"getModalP... | Close the current modal. | [
"Close",
"the",
"current",
"modal",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L663-L676 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.close | private void close(Component component) {
if (components.size() > 0) {
if (components.contains(component) == false) {
return;
}
components.remove(component);
depths.remove(component);
getModalPanel().removeAll();
fireCloseActionListener(listeners.get(component));
listeners.remove(component);
... | java | private void close(Component component) {
if (components.size() > 0) {
if (components.contains(component) == false) {
return;
}
components.remove(component);
depths.remove(component);
getModalPanel().removeAll();
fireCloseActionListener(listeners.get(component));
listeners.remove(component);
... | [
"private",
"void",
"close",
"(",
"Component",
"component",
")",
"{",
"if",
"(",
"components",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"components",
".",
"contains",
"(",
"component",
")",
"==",
"false",
")",
"{",
"return",
";",
"}",
"... | Close a modal
@param component
- the modal's component | [
"Close",
"a",
"modal"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L719-L737 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.closeAll | private void closeAll() {
getModalPanel().removeAll();
components.clear();
depths.clear();
listeners.clear();
restoreRootPane();
} | java | private void closeAll() {
getModalPanel().removeAll();
components.clear();
depths.clear();
listeners.clear();
restoreRootPane();
} | [
"private",
"void",
"closeAll",
"(",
")",
"{",
"getModalPanel",
"(",
")",
".",
"removeAll",
"(",
")",
";",
"components",
".",
"clear",
"(",
")",
";",
"depths",
".",
"clear",
"(",
")",
";",
"listeners",
".",
"clear",
"(",
")",
";",
"restoreRootPane",
"... | Close all modals. | [
"Close",
"all",
"modals",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L760-L766 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.addModal | private void addModal(Component component, ModalListener listener,
Integer modalDepth) {
if (modalDepth == null) {
modalDepth = defaultModalDepth;
}
if (components.contains(component) == false) {
rootPane.getLayeredPane().remove(getModalPanel());
rootPane.getLayeredPane().add(getModalPanel(), modalDe... | java | private void addModal(Component component, ModalListener listener,
Integer modalDepth) {
if (modalDepth == null) {
modalDepth = defaultModalDepth;
}
if (components.contains(component) == false) {
rootPane.getLayeredPane().remove(getModalPanel());
rootPane.getLayeredPane().add(getModalPanel(), modalDe... | [
"private",
"void",
"addModal",
"(",
"Component",
"component",
",",
"ModalListener",
"listener",
",",
"Integer",
"modalDepth",
")",
"{",
"if",
"(",
"modalDepth",
"==",
"null",
")",
"{",
"modalDepth",
"=",
"defaultModalDepth",
";",
"}",
"if",
"(",
"components",
... | Add a modal component
@param component
{@link Component}
@param listener
{@link ModalListener}
@param modalDepth | [
"Add",
"a",
"modal",
"component"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L777-L798 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.getModalPanel | private ModalPanel getModalPanel() {
if (modalPanel == null) {
modalPanel = new ModalPanel();
modalPanel.setLayout(new ModalLayout());
}
return modalPanel;
} | java | private ModalPanel getModalPanel() {
if (modalPanel == null) {
modalPanel = new ModalPanel();
modalPanel.setLayout(new ModalLayout());
}
return modalPanel;
} | [
"private",
"ModalPanel",
"getModalPanel",
"(",
")",
"{",
"if",
"(",
"modalPanel",
"==",
"null",
")",
"{",
"modalPanel",
"=",
"new",
"ModalPanel",
"(",
")",
";",
"modalPanel",
".",
"setLayout",
"(",
"new",
"ModalLayout",
"(",
")",
")",
";",
"}",
"return",... | Get the transparent modal panel
@return {@link ModalPanel} | [
"Get",
"the",
"transparent",
"modal",
"panel"
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L827-L833 | train |
caduandrade/japura-gui | src/main/java/org/japura/gui/modal/Modal.java | Modal.getRootPaneContainer | public static RootPaneContainer getRootPaneContainer(Component component) {
if (component instanceof RootPaneContainer) {
return (RootPaneContainer) component;
}
for (Container p = component.getParent(); p != null; p = p.getParent()) {
if (p instanceof RootPaneContainer) {
return (RootPaneContainer) p;
}... | java | public static RootPaneContainer getRootPaneContainer(Component component) {
if (component instanceof RootPaneContainer) {
return (RootPaneContainer) component;
}
for (Container p = component.getParent(); p != null; p = p.getParent()) {
if (p instanceof RootPaneContainer) {
return (RootPaneContainer) p;
}... | [
"public",
"static",
"RootPaneContainer",
"getRootPaneContainer",
"(",
"Component",
"component",
")",
"{",
"if",
"(",
"component",
"instanceof",
"RootPaneContainer",
")",
"{",
"return",
"(",
"RootPaneContainer",
")",
"component",
";",
"}",
"for",
"(",
"Container",
... | Get the RootPaneContainer of the specific component.
@param component
@return the RootPaneContainer or <CODE>NULL</CODE> if its not exist. | [
"Get",
"the",
"RootPaneContainer",
"of",
"the",
"specific",
"component",
"."
] | 0ea556329843c978d2863d3731a6df244d18d4ca | https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/modal/Modal.java#L885-L896 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/result/ResultAnalyzer.java | ResultAnalyzer.analyzeReturnType | public static ResultDescriptor analyzeReturnType(final DescriptorContext context,
final Class<? extends Collection> returnCollectionType) {
final Method method = context.method;
final MethodGenericsContext generics = context.generics.method(method);
... | java | public static ResultDescriptor analyzeReturnType(final DescriptorContext context,
final Class<? extends Collection> returnCollectionType) {
final Method method = context.method;
final MethodGenericsContext generics = context.generics.method(method);
... | [
"public",
"static",
"ResultDescriptor",
"analyzeReturnType",
"(",
"final",
"DescriptorContext",
"context",
",",
"final",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"returnCollectionType",
")",
"{",
"final",
"Method",
"method",
"=",
"context",
".",
"method",
... | Analyze return type.
@param context repository method context
@param returnCollectionType collection implementation to convert to or null if conversion not required
@return result description object | [
"Analyze",
"return",
"type",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/result/ResultAnalyzer.java#L41-L69 | train |
twotoasters/RecyclerViewLib | library/src/main/java/com/twotoasters/layoutmanager/BaseLayoutManager.java | BaseLayoutManager.recycleByRenderState | protected void recycleByRenderState(RecyclerView.Recycler recycler, RenderState renderState) {
if (renderState.mLayoutDirection == RenderState.LAYOUT_START) {
recycleViewsFromEnd(recycler, renderState.mScrollingOffset);
} else {
recycleViewsFromStart(recycler, renderState.mScroll... | java | protected void recycleByRenderState(RecyclerView.Recycler recycler, RenderState renderState) {
if (renderState.mLayoutDirection == RenderState.LAYOUT_START) {
recycleViewsFromEnd(recycler, renderState.mScrollingOffset);
} else {
recycleViewsFromStart(recycler, renderState.mScroll... | [
"protected",
"void",
"recycleByRenderState",
"(",
"RecyclerView",
".",
"Recycler",
"recycler",
",",
"RenderState",
"renderState",
")",
"{",
"if",
"(",
"renderState",
".",
"mLayoutDirection",
"==",
"RenderState",
".",
"LAYOUT_START",
")",
"{",
"recycleViewsFromEnd",
... | Helper method to call appropriate recycle method depending on current render layout
direction
@param recycler Current recycler that is attached to RecyclerView
@param renderState Current render state. Right now, this object does not change but
we may consider moving it out of this view so passing around as a
parame... | [
"Helper",
"method",
"to",
"call",
"appropriate",
"recycle",
"method",
"depending",
"on",
"current",
"render",
"layout",
"direction"
] | 2379fd5bbf57d4dfc8b28046b7ace950905c75f0 | https://github.com/twotoasters/RecyclerViewLib/blob/2379fd5bbf57d4dfc8b28046b7ace950905c75f0/library/src/main/java/com/twotoasters/layoutmanager/BaseLayoutManager.java#L969-L975 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java | ResultUtils.check | public static void check(final Object result, final Class<?> targetType) {
if (result != null && !targetType.isAssignableFrom(result.getClass())) {
// note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may
// not work correctly for single eleme... | java | public static void check(final Object result, final Class<?> targetType) {
if (result != null && !targetType.isAssignableFrom(result.getClass())) {
// note: conversion logic may go wrong (e.g. because converter expect collection input mostly and may
// not work correctly for single eleme... | [
"public",
"static",
"void",
"check",
"(",
"final",
"Object",
"result",
",",
"final",
"Class",
"<",
"?",
">",
"targetType",
")",
"{",
"if",
"(",
"result",
"!=",
"null",
"&&",
"!",
"targetType",
".",
"isAssignableFrom",
"(",
"result",
".",
"getClass",
"(",... | Check converted result compatibility with required type.
@param result result object
@param targetType target type
@throws ResultConversionException if result doesn't match required type | [
"Check",
"converted",
"result",
"compatibility",
"with",
"required",
"type",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java#L34-L41 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java | ResultUtils.convertToCollection | @SuppressWarnings("unchecked")
public static Object convertToCollection(final Object result, final Class collectionType,
final Class targetEntity, final boolean projection) {
final Object converted;
if (collectionType.equals(Iterator.class)) {
... | java | @SuppressWarnings("unchecked")
public static Object convertToCollection(final Object result, final Class collectionType,
final Class targetEntity, final boolean projection) {
final Object converted;
if (collectionType.equals(Iterator.class)) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Object",
"convertToCollection",
"(",
"final",
"Object",
"result",
",",
"final",
"Class",
"collectionType",
",",
"final",
"Class",
"targetEntity",
",",
"final",
"boolean",
"projection",
")",
"... | Convert result object to collection. In some cases, this could be do nothing case, because orient already
returns collection. If projection is required or when collection type is different from requested type,
result will be re-packaged into the new collection.
@param result result instance
@param collectionTy... | [
"Convert",
"result",
"object",
"to",
"collection",
".",
"In",
"some",
"cases",
"this",
"could",
"be",
"do",
"nothing",
"case",
"because",
"orient",
"already",
"returns",
"collection",
".",
"If",
"projection",
"is",
"required",
"or",
"when",
"collection",
"type... | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java#L79-L97 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java | ResultUtils.convertToArray | @SuppressWarnings("PMD.LooseCoupling")
public static Object convertToArray(final Object result, final Class entityType, final boolean projection) {
final Collection res = result instanceof Collection
// no projection because its applied later
? (Collection) result : convertTo... | java | @SuppressWarnings("PMD.LooseCoupling")
public static Object convertToArray(final Object result, final Class entityType, final boolean projection) {
final Collection res = result instanceof Collection
// no projection because its applied later
? (Collection) result : convertTo... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.LooseCoupling\"",
")",
"public",
"static",
"Object",
"convertToArray",
"(",
"final",
"Object",
"result",
",",
"final",
"Class",
"entityType",
",",
"final",
"boolean",
"projection",
")",
"{",
"final",
"Collection",
"res",
"=",
... | Convert result object to array.
@param result result object
@param entityType target entity type
@param projection true to apply projection, false otherwise
@return converted result | [
"Convert",
"result",
"object",
"to",
"array",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/repository/core/ext/util/ResultUtils.java#L107-L118 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/scheme/SchemeInitializationException.java | SchemeInitializationException.check | public static void check(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new SchemeInitializationException(String.format(message, args));
}
} | java | public static void check(final boolean condition, final String message, final Object... args) {
if (!condition) {
throw new SchemeInitializationException(String.format(message, args));
}
} | [
"public",
"static",
"void",
"check",
"(",
"final",
"boolean",
"condition",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"SchemeInitializationException",
"(",
"Strin... | Shortcut to check and throw scheme exception.
@param condition condition to validate
@param message fail message
@param args fail message arguments | [
"Shortcut",
"to",
"check",
"and",
"throw",
"scheme",
"exception",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/scheme/SchemeInitializationException.java#L28-L32 | train |
xvik/guice-persist-orient | src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java | PersistentContext.doInTransaction | public <T> T doInTransaction(final TxConfig config, final TxAction<T> action) {
return txTemplate.doInTransaction(config, action);
} | java | public <T> T doInTransaction(final TxConfig config, final TxAction<T> action) {
return txTemplate.doInTransaction(config, action);
} | [
"public",
"<",
"T",
">",
"T",
"doInTransaction",
"(",
"final",
"TxConfig",
"config",
",",
"final",
"TxAction",
"<",
"T",
">",
"action",
")",
"{",
"return",
"txTemplate",
".",
"doInTransaction",
"(",
"config",
",",
"action",
")",
";",
"}"
] | Execute action within transaction.
@param config transaction config (ignored in case of ongoing transaction)
@param action action to execute within transaction (new or ongoing)
@param <T> expected return type
@return value produced by action
@see ru.vyarus.guice.persist.orient.db.transaction.template.TxTemplate | [
"Execute",
"action",
"within",
"transaction",
"."
] | 5ef06fb4f734360512e9824a3b875c4906c56b5b | https://github.com/xvik/guice-persist-orient/blob/5ef06fb4f734360512e9824a3b875c4906c56b5b/src/main/java/ru/vyarus/guice/persist/orient/db/PersistentContext.java#L93-L95 | train |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.collapsePanel | public boolean collapsePanel() {
if (mFirstLayout) {
mSlideState = SlideState.COLLAPSED;
return true;
} else {
if (mSlideState == SlideState.HIDDEN || mSlideState == SlideState.COLLAPSED)
return false;
return collapsePanel(mSlideableView, 0... | java | public boolean collapsePanel() {
if (mFirstLayout) {
mSlideState = SlideState.COLLAPSED;
return true;
} else {
if (mSlideState == SlideState.HIDDEN || mSlideState == SlideState.COLLAPSED)
return false;
return collapsePanel(mSlideableView, 0... | [
"public",
"boolean",
"collapsePanel",
"(",
")",
"{",
"if",
"(",
"mFirstLayout",
")",
"{",
"mSlideState",
"=",
"SlideState",
".",
"COLLAPSED",
";",
"return",
"true",
";",
"}",
"else",
"{",
"if",
"(",
"mSlideState",
"==",
"SlideState",
".",
"HIDDEN",
"||",
... | Collapse the sliding pane if it is currently slideable. If first layout
has already completed this will animate.
@return true if the pane was slideable and is now collapsed/in the process of collapsing | [
"Collapse",
"the",
"sliding",
"pane",
"if",
"it",
"is",
"currently",
"slideable",
".",
"If",
"first",
"layout",
"has",
"already",
"completed",
"this",
"will",
"animate",
"."
] | 14b12725f8ab9274b2499432d85e1b8b2b1850a5 | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L705-L714 | train |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.expandPanel | public boolean expandPanel(float mSlideOffset) {
if (mSlideableView == null || mSlideState == SlideState.EXPANDED) return false;
mSlideableView.setVisibility(View.VISIBLE);
return expandPanel(mSlideableView, 0, mSlideOffset);
} | java | public boolean expandPanel(float mSlideOffset) {
if (mSlideableView == null || mSlideState == SlideState.EXPANDED) return false;
mSlideableView.setVisibility(View.VISIBLE);
return expandPanel(mSlideableView, 0, mSlideOffset);
} | [
"public",
"boolean",
"expandPanel",
"(",
"float",
"mSlideOffset",
")",
"{",
"if",
"(",
"mSlideableView",
"==",
"null",
"||",
"mSlideState",
"==",
"SlideState",
".",
"EXPANDED",
")",
"return",
"false",
";",
"mSlideableView",
".",
"setVisibility",
"(",
"View",
"... | Partially expand the sliding panel up to a specific offset
@param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
@return true if the pane was slideable and is now expanded/in the process of expanding | [
"Partially",
"expand",
"the",
"sliding",
"panel",
"up",
"to",
"a",
"specific",
"offset"
] | 14b12725f8ab9274b2499432d85e1b8b2b1850a5 | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L736-L740 | train |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.showPanel | public void showPanel() {
if (mFirstLayout) {
mSlideState = SlideState.COLLAPSED;
} else {
if (mSlideableView == null || mSlideState != SlideState.HIDDEN) return;
mSlideableView.setVisibility(View.VISIBLE);
requestLayout();
smoothSlideTo(0, 0);... | java | public void showPanel() {
if (mFirstLayout) {
mSlideState = SlideState.COLLAPSED;
} else {
if (mSlideableView == null || mSlideState != SlideState.HIDDEN) return;
mSlideableView.setVisibility(View.VISIBLE);
requestLayout();
smoothSlideTo(0, 0);... | [
"public",
"void",
"showPanel",
"(",
")",
"{",
"if",
"(",
"mFirstLayout",
")",
"{",
"mSlideState",
"=",
"SlideState",
".",
"COLLAPSED",
";",
"}",
"else",
"{",
"if",
"(",
"mSlideableView",
"==",
"null",
"||",
"mSlideState",
"!=",
"SlideState",
".",
"HIDDEN",... | Shows the panel from the hidden state | [
"Shows",
"the",
"panel",
"from",
"the",
"hidden",
"state"
] | 14b12725f8ab9274b2499432d85e1b8b2b1850a5 | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L763-L772 | train |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.hidePanel | public void hidePanel() {
if (mFirstLayout) {
mSlideState = SlideState.HIDDEN;
} else {
if (mSlideState == SlideState.DRAGGING || mSlideState == SlideState.HIDDEN) return;
int newTop = computePanelTopPosition(0.0f);
smoothSlideTo(computeSlideOffset(newTop)... | java | public void hidePanel() {
if (mFirstLayout) {
mSlideState = SlideState.HIDDEN;
} else {
if (mSlideState == SlideState.DRAGGING || mSlideState == SlideState.HIDDEN) return;
int newTop = computePanelTopPosition(0.0f);
smoothSlideTo(computeSlideOffset(newTop)... | [
"public",
"void",
"hidePanel",
"(",
")",
"{",
"if",
"(",
"mFirstLayout",
")",
"{",
"mSlideState",
"=",
"SlideState",
".",
"HIDDEN",
";",
"}",
"else",
"{",
"if",
"(",
"mSlideState",
"==",
"SlideState",
".",
"DRAGGING",
"||",
"mSlideState",
"==",
"SlideState... | Hides the sliding panel entirely. | [
"Hides",
"the",
"sliding",
"panel",
"entirely",
"."
] | 14b12725f8ab9274b2499432d85e1b8b2b1850a5 | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L777-L785 | train |
baneizalfe/PullToDismissPager | PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java | PullToDismissPager.smoothSlideTo | boolean smoothSlideTo(float slideOffset, int velocity) {
if (!isSlidingEnabled()) {
// Nothing to do.
return false;
}
int panelTop = computePanelTopPosition(slideOffset);
if (mDragHelper.smoothSlideViewTo(mSlideableView, mSlideableView.getLeft(), panelTop)) {
... | java | boolean smoothSlideTo(float slideOffset, int velocity) {
if (!isSlidingEnabled()) {
// Nothing to do.
return false;
}
int panelTop = computePanelTopPosition(slideOffset);
if (mDragHelper.smoothSlideViewTo(mSlideableView, mSlideableView.getLeft(), panelTop)) {
... | [
"boolean",
"smoothSlideTo",
"(",
"float",
"slideOffset",
",",
"int",
"velocity",
")",
"{",
"if",
"(",
"!",
"isSlidingEnabled",
"(",
")",
")",
"{",
"// Nothing to do.",
"return",
"false",
";",
"}",
"int",
"panelTop",
"=",
"computePanelTopPosition",
"(",
"slideO... | Smoothly animate mDraggingPane to the target X position within its range.
@param slideOffset position to animate to
@param velocity initial velocity in case of fling, or 0. | [
"Smoothly",
"animate",
"mDraggingPane",
"to",
"the",
"target",
"X",
"position",
"within",
"its",
"range",
"."
] | 14b12725f8ab9274b2499432d85e1b8b2b1850a5 | https://github.com/baneizalfe/PullToDismissPager/blob/14b12725f8ab9274b2499432d85e1b8b2b1850a5/PullToDismissPager/src/main/java/com/mrbug/pulltodismisspager/PullToDismissPager.java#L836-L849 | train |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/message/UnsubscribeMessage.java | UnsubscribeMessage.createCleanupMessage | public static UnsubscribeMessage createCleanupMessage(WebSocketSession session) {
UnsubscribeMessage msg = new UnsubscribeMessage("**");
msg.setWebSocketSessionId(session.getId());
msg.setPrincipal(session.getPrincipal());
msg.setWampSession(new WampSession(session));
msg.cleanup = true;
return msg;
} | java | public static UnsubscribeMessage createCleanupMessage(WebSocketSession session) {
UnsubscribeMessage msg = new UnsubscribeMessage("**");
msg.setWebSocketSessionId(session.getId());
msg.setPrincipal(session.getPrincipal());
msg.setWampSession(new WampSession(session));
msg.cleanup = true;
return msg;
} | [
"public",
"static",
"UnsubscribeMessage",
"createCleanupMessage",
"(",
"WebSocketSession",
"session",
")",
"{",
"UnsubscribeMessage",
"msg",
"=",
"new",
"UnsubscribeMessage",
"(",
"\"**\"",
")",
";",
"msg",
".",
"setWebSocketSessionId",
"(",
"session",
".",
"getId",
... | Creates an internal unsubscribe message. The system creates this message when the
WebSocket session ends and sends it to the subscribed message handlers for cleaning
up
@param sessionId the WebSocket session id | [
"Creates",
"an",
"internal",
"unsubscribe",
"message",
".",
"The",
"system",
"creates",
"this",
"message",
"when",
"the",
"WebSocket",
"session",
"ends",
"and",
"sends",
"it",
"to",
"the",
"subscribed",
"message",
"handlers",
"for",
"cleaning",
"up"
] | 7571bb6773b848c580b29890587eb35397bfe5b5 | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/message/UnsubscribeMessage.java#L66-L76 | train |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/GuildWars2Utility.java | GuildWars2Utility.parseCoins | public static long[] parseCoins(long value) {
long[] result = new long[3];
if (value < 0) return result;
long temp = value;
result[2] = temp % 100;
temp = temp / 100;
result[1] = temp % 100;
result[0] = temp / 100;
return result;
} | java | public static long[] parseCoins(long value) {
long[] result = new long[3];
if (value < 0) return result;
long temp = value;
result[2] = temp % 100;
temp = temp / 100;
result[1] = temp % 100;
result[0] = temp / 100;
return result;
} | [
"public",
"static",
"long",
"[",
"]",
"parseCoins",
"(",
"long",
"value",
")",
"{",
"long",
"[",
"]",
"result",
"=",
"new",
"long",
"[",
"3",
"]",
";",
"if",
"(",
"value",
"<",
"0",
")",
"return",
"result",
";",
"long",
"temp",
"=",
"value",
";",... | parse given coin value into number of gold, sliver, and copper
@param value coin value
@return results in array: index 0 is number of gold, index 1 is number of sliver, index 2 is number of copper | [
"parse",
"given",
"coin",
"value",
"into",
"number",
"of",
"gold",
"sliver",
"and",
"copper"
] | c8a43b51f363b032074fb152ee6efe657e33e525 | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2Utility.java#L50-L60 | train |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/config/WampSubProtocolHandler.java | WampSubProtocolHandler.handleMessageFromClient | @Override
public void handleMessageFromClient(WebSocketSession session,
WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel) {
Assert.isInstanceOf(TextMessage.class, webSocketMessage);
WampMessage wampMessage = null;
try {
wampMessage = WampMessage.fromJson(session, this.jsonFactory,
(... | java | @Override
public void handleMessageFromClient(WebSocketSession session,
WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel) {
Assert.isInstanceOf(TextMessage.class, webSocketMessage);
WampMessage wampMessage = null;
try {
wampMessage = WampMessage.fromJson(session, this.jsonFactory,
(... | [
"@",
"Override",
"public",
"void",
"handleMessageFromClient",
"(",
"WebSocketSession",
"session",
",",
"WebSocketMessage",
"<",
"?",
">",
"webSocketMessage",
",",
"MessageChannel",
"outputChannel",
")",
"{",
"Assert",
".",
"isInstanceOf",
"(",
"TextMessage",
".",
"c... | Handle incoming WebSocket messages from clients. | [
"Handle",
"incoming",
"WebSocket",
"messages",
"from",
"clients",
"."
] | 7571bb6773b848c580b29890587eb35397bfe5b5 | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/config/WampSubProtocolHandler.java#L72-L117 | train |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/config/WampSubProtocolHandler.java | WampSubProtocolHandler.handleMessageToClient | @Override
public void handleMessageToClient(WebSocketSession session, Message<?> message) {
if (!(message instanceof WampMessage)) {
logger.error("Expected WampMessage. Ignoring " + message + ".");
return;
}
boolean closeWebSocketSession = false;
try {
String json = ((WampMessage) message).toJson(thi... | java | @Override
public void handleMessageToClient(WebSocketSession session, Message<?> message) {
if (!(message instanceof WampMessage)) {
logger.error("Expected WampMessage. Ignoring " + message + ".");
return;
}
boolean closeWebSocketSession = false;
try {
String json = ((WampMessage) message).toJson(thi... | [
"@",
"Override",
"public",
"void",
"handleMessageToClient",
"(",
"WebSocketSession",
"session",
",",
"Message",
"<",
"?",
">",
"message",
")",
"{",
"if",
"(",
"!",
"(",
"message",
"instanceof",
"WampMessage",
")",
")",
"{",
"logger",
".",
"error",
"(",
"\"... | Handle WAMP messages going back out to WebSocket clients. | [
"Handle",
"WAMP",
"messages",
"going",
"back",
"out",
"to",
"WebSocket",
"clients",
"."
] | 7571bb6773b848c580b29890587eb35397bfe5b5 | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/config/WampSubProtocolHandler.java#L122-L154 | train |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/helper/ItemAdapter.java | ItemAdapter.getItemFields | private Set<Field> getItemFields() {
Class next = Item.class;
Set<Field> fields = new HashSet<>(getFields(next));
while (next.getSuperclass() != Object.class) {
next = next.getSuperclass();
fields.addAll(getFields(next));
}
return fields;
} | java | private Set<Field> getItemFields() {
Class next = Item.class;
Set<Field> fields = new HashSet<>(getFields(next));
while (next.getSuperclass() != Object.class) {
next = next.getSuperclass();
fields.addAll(getFields(next));
}
return fields;
} | [
"private",
"Set",
"<",
"Field",
">",
"getItemFields",
"(",
")",
"{",
"Class",
"next",
"=",
"Item",
".",
"class",
";",
"Set",
"<",
"Field",
">",
"fields",
"=",
"new",
"HashSet",
"<>",
"(",
"getFields",
"(",
"next",
")",
")",
";",
"while",
"(",
"next... | get all fields for item class and all of it's super classes | [
"get",
"all",
"fields",
"for",
"item",
"class",
"and",
"all",
"of",
"it",
"s",
"super",
"classes"
] | c8a43b51f363b032074fb152ee6efe657e33e525 | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/helper/ItemAdapter.java#L89-L97 | train |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/helper/ItemAdapter.java | ItemAdapter.getFields | private List<Field> getFields(Class given) {
Field[] fs = given.getDeclaredFields();
return new ArrayList<>(Arrays.asList(fs));
} | java | private List<Field> getFields(Class given) {
Field[] fs = given.getDeclaredFields();
return new ArrayList<>(Arrays.asList(fs));
} | [
"private",
"List",
"<",
"Field",
">",
"getFields",
"(",
"Class",
"given",
")",
"{",
"Field",
"[",
"]",
"fs",
"=",
"given",
".",
"getDeclaredFields",
"(",
")",
";",
"return",
"new",
"ArrayList",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"fs",
")",
")",... | get field of given class | [
"get",
"field",
"of",
"given",
"class"
] | c8a43b51f363b032074fb152ee6efe657e33e525 | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/helper/ItemAdapter.java#L100-L103 | train |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java | GuildWars2.setInstance | public static void setInstance(Cache cache) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(cache);
} | java | public static void setInstance(Cache cache) throws GuildWars2Exception {
if (instance != null)
throw new GuildWars2Exception(ErrorCode.Other, "Instance already initialized");
instance = new GuildWars2(cache);
} | [
"public",
"static",
"void",
"setInstance",
"(",
"Cache",
"cache",
")",
"throws",
"GuildWars2Exception",
"{",
"if",
"(",
"instance",
"!=",
"null",
")",
"throw",
"new",
"GuildWars2Exception",
"(",
"ErrorCode",
".",
"Other",
",",
"\"Instance already initialized\"",
"... | Use this to initialize instance with custom cache
@param cache {@link Cache}
@throws GuildWars2Exception instance already exist | [
"Use",
"this",
"to",
"initialize",
"instance",
"with",
"custom",
"cache"
] | c8a43b51f363b032074fb152ee6efe657e33e525 | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/GuildWars2.java#L74-L78 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.