id
int32
0
12.9k
code
sequencelengths
2
264k
8,900
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "COMPONENT_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "EDGE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "RANK_TABLE", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "junit", ".", "matchers", ".", "JUnitMatchers", ".", "hasItem", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "any", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "TreeSet", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "model", ".", "QueryAnnotation", ";", "public", "class", "TestTableJoinsInWhereClauseGenerator", "{", "private", "QueryNode", "node23", ";", "private", "TableJoinsInWhereClauseGenerator", "generator", ";", "@", "Mock", "private", "TableAccessStrategyFactory", "tableAccessStrategyFactory", ";", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "private", "static", "final", "QueryAnnotation", "annotation1", "=", "new", "QueryAnnotation", "(", "\"namespace\"", ",", "\"name1\"", ")", ";", "private", "static", "final", "QueryAnnotation", "annotation2", "=", "new", "QueryAnnotation", "(", "\"namespace\"", ",", "\"name2\"", ")", ";", "private", "static", "final", "QueryAnnotation", "annotation3", "=", "new", "QueryAnnotation", "(", "\"namespace\"", ",", "\"name3\"", ")", ";", "private", "Set", "<", "QueryAnnotation", ">", "annotations", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "node23", "=", "new", "QueryNode", "(", "23", ")", ";", "generator", "=", "new", "TableJoinsInWhereClauseGenerator", "(", ")", "{", "@", "Override", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", "}", ";", "tableAccessStrategy", "=", "new", "TableAccessStrategy", "(", "node23", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_component\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_annotation\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"\"", ")", ";", "when", "(", "tableAccessStrategyFactory", ".", "tables", "(", "any", "(", "QueryNode", ".", "class", ")", ")", ")", ".", "thenReturn", "(", "tableAccessStrategy", ")", ";", "annotations", "=", "annotationSet", "(", "annotation1", ",", "annotation2", ",", "annotation3", ")", ";", "}", "@", "Test", "public", "void", "fromClauseDefault", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesRank", "(", ")", "{", "node23", ".", "setRoot", "(", "true", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesRankAliasedToNode", "(", ")", "{", "node23", ".", "setRoot", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_node\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesRankComponentAliasedToNode", "(", ")", "{", "node23", ".", "setRoot", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_node\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "}", "@", "Test", "public", "void", "fromClauseNodeAnnotations", "(", ")", "{", "node23", ".", "setNodeAnnotations", "(", "annotations", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseNodeAnnotationsAliasedToNode", "(", ")", "{", "node23", ".", "setNodeAnnotations", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"node_ref\"", ",", "\"id\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseOfEdgeAnnotations", "(", ")", "{", "node23", ".", "setEdgeAnnotations", "(", "annotations", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseEdgeAnnotationsAliasedToRank", "(", ")", "{", "node23", ".", "setEdgeAnnotations", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"rank_ref\"", ",", "\"pre\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseAllTablesAliasedToNode", "(", ")", "{", "Set", "<", "QueryAnnotation", ">", "annotations1", "=", "annotationSet", "(", "annotation1", ",", "annotation2", ")", ";", "node23", ".", "setNodeAnnotations", "(", "annotations1", ")", ";", "Set", "<", "QueryAnnotation", ">", "annotations2", "=", "annotationSet", "(", "annotation1", ",", "annotation2", ",", "annotation3", ")", ";", "node23", ".", "setEdgeAnnotations", "(", "annotations2", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"node_ref\"", ",", "\"id\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"rank_ref\"", ",", "\"pre\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "generator", ".", "fromClauseForNode", "(", "node23", ")", ")", ";", "checkWhereCondition", "(", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "private", "TreeSet", "<", "QueryAnnotation", ">", "annotationSet", "(", "QueryAnnotation", "...", "annotations", ")", "{", "return", "new", "TreeSet", "<", "QueryAnnotation", ">", "(", "Arrays", ".", "asList", "(", "annotations", ")", ")", ";", "}", "private", "void", "checkWhereCondition", "(", "String", "...", "expected", ")", "{", "Set", "<", "String", ">", "actual", "=", "generator", ".", "whereConditionsForNode", "(", "node23", ")", ";", "for", "(", "String", "item", ":", "expected", ")", "assertThat", "(", "actual", ",", "hasItem", "(", "item", ")", ")", ";", "}", "}", "</s>" ]
8,901
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "annis", ".", "service", ".", "objects", ".", "AnnisCorpus", ";", "public", "class", "TestListCorpusHelper", "{", "private", "ListCorpusSqlHelper", "listCorpusHelper", ";", "private", "static", "final", "long", "ID1", "=", "1L", ";", "private", "static", "final", "String", "NAME1", "=", "\"NAME1\"", ";", "private", "static", "final", "int", "TEXT_COUNT1", "=", "2", ";", "private", "static", "final", "int", "TOKEN_COUNT1", "=", "3", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "listCorpusHelper", "=", "new", "ListCorpusSqlHelper", "(", ")", ";", "}", "@", "Test", "public", "void", "createSqlQuery", "(", ")", "{", "String", "expected", "=", "\"\"", "+", "\"\"", ";", "assertEquals", "(", "expected", ",", "listCorpusHelper", ".", "createSqlQuery", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "mapRow", "(", ")", "throws", "SQLException", "{", "ResultSet", "resultSet", "=", "mock", "(", "ResultSet", ".", "class", ")", ";", "when", "(", "resultSet", ".", "getLong", "(", "\"id\"", ")", ")", ".", "thenReturn", "(", "ID1", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"name\"", ")", ")", ".", "thenReturn", "(", "NAME1", ")", ";", "when", "(", "resultSet", ".", "getInt", "(", "\"text\"", ")", ")", ".", "thenReturn", "(", "TEXT_COUNT1", ")", ";", "when", "(", "resultSet", ".", "getInt", "(", "\"tokens\"", ")", ")", ".", "thenReturn", "(", "TOKEN_COUNT1", ")", ";", "AnnisCorpus", "annisCorpus", "=", "listCorpusHelper", ".", "mapRow", "(", "resultSet", ",", "0", ")", ";", "assertThat", "(", "annisCorpus", ".", "getId", "(", ")", ",", "is", "(", "ID1", ")", ")", ";", "assertThat", "(", "annisCorpus", ".", "getName", "(", ")", ",", "is", "(", "NAME1", ")", ")", ";", "assertThat", "(", "annisCorpus", ".", "getTextCount", "(", ")", ",", "is", "(", "TEXT_COUNT1", ")", ")", ";", "assertThat", "(", "annisCorpus", ".", "getTokenCount", "(", ")", ",", "is", "(", "TOKEN_COUNT1", ")", ")", ";", "}", "}", "</s>" ]
8,902
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "AbstractSqlGenerator", ".", "TABSTOP", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "COMPONENT_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "CORPUS_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "EDGE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "RANK_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueAlphaString", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyInt", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "eq", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "org", ".", "springframework", ".", "dao", ".", "DataAccessException", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "import", "org", ".", "junit", ".", "Ignore", ";", "public", "class", "TestAnnotateSqlGenerator", "{", "private", "class", "DummyAnnotateSqlGenerator", "extends", "AnnotateSqlGenerator", "<", "Integer", ">", "{", "@", "Override", "public", "Integer", "extractData", "(", "ResultSet", "arg0", ")", "throws", "SQLException", ",", "DataAccessException", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "@", "Override", "public", "String", "selectClause", "(", "QueryData", "queryData", ",", "List", "<", "QueryNode", ">", "alternative", ",", "String", "indent", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "@", "Override", "public", "String", "fromClause", "(", "QueryData", "queryData", ",", "List", "<", "QueryNode", ">", "alternative", ",", "String", "indent", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "@", "Override", "public", "String", "getTextQuery", "(", "long", "textID", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "@", "Override", "public", "String", "getDocumentQuery", "(", "String", "toplevelCorpusName", ",", "String", "documentName", ")", "{", "throw", "new", "UnsupportedOperationException", "(", ")", ";", "}", "}", ";", "private", "DummyAnnotateSqlGenerator", "generator", "=", "new", "DummyAnnotateSqlGenerator", "(", ")", "{", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", ";", "protected", "SolutionKey", "<", "?", ">", "createSolutionKey", "(", ")", "{", "return", "solutionKey", ";", "}", ";", "}", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "SolutionKey", "<", "?", ">", "solutionKey", ";", "@", "Mock", "private", "QueryData", "queryData", ";", "@", "Mock", "private", "AnnotateQueryData", "annotateQueryData", ";", "@", "Mock", "private", "LimitOffsetQueryData", "limitOffsetQueryData", ";", "private", "List", "<", "QueryNode", ">", "alternative", "=", "new", "ArrayList", "<", "QueryNode", ">", "(", ")", ";", "private", "static", "final", "String", "INDENT", "=", "TABSTOP", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "given", "(", "queryData", ".", "getExtensions", "(", "AnnotateQueryData", ".", "class", ")", ")", ".", "willReturn", "(", "asList", "(", "annotateQueryData", ")", ")", ";", "setupOuterQueryFactsTableColumnAliases", "(", "generator", ")", ";", "}", "public", "static", "void", "setupOuterQueryFactsTableColumnAliases", "(", "AnnotateExtractor", "<", "?", ">", "generator", ")", "{", "Map", "<", "String", ",", "String", ">", "nodeColumns", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "nodeColumns", ".", "put", "(", "\"namespace\"", ",", "\"\"", ")", ";", "nodeColumns", ".", "put", "(", "\"name\"", ",", "\"node_name\"", ")", ";", "Map", "<", "String", ",", "String", ">", "nodeAnnotationColumns", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "nodeAnnotationColumns", ".", "put", "(", "\"node_ref\"", ",", "\"id\"", ")", ";", "nodeAnnotationColumns", ".", "put", "(", "\"namespace\"", ",", "\"\"", ")", ";", "nodeAnnotationColumns", ".", "put", "(", "\"name\"", ",", "\"\"", ")", ";", "nodeAnnotationColumns", ".", "put", "(", "\"value\"", ",", "\"\"", ")", ";", "Map", "<", "String", ",", "String", ">", "edgeAnnotationColumns", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "nodeAnnotationColumns", ".", "put", "(", "\"rank_ref\"", ",", "\"pre\"", ")", ";", "edgeAnnotationColumns", ".", "put", "(", "\"namespace\"", ",", "\"\"", ")", ";", "edgeAnnotationColumns", ".", "put", "(", "\"name\"", ",", "\"\"", ")", ";", "edgeAnnotationColumns", ".", "put", "(", "\"value\"", ",", "\"\"", ")", ";", "Map", "<", "String", ",", "String", ">", "edgeColumns", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "edgeColumns", ".", "put", "(", "\"node_ref\"", ",", "\"id\"", ")", ";", "Map", "<", "String", ",", "String", ">", "componentColumns", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "componentColumns", ".", "put", "(", "\"id\"", ",", "\"component_id\"", ")", ";", "componentColumns", ".", "put", "(", "\"name\"", ",", "\"edge_name\"", ")", ";", "componentColumns", ".", "put", "(", "\"namespace\"", ",", "\"\"", ")", ";", "componentColumns", ".", "put", "(", "\"type\"", ",", "\"edge_type\"", ")", ";", "edgeColumns", ".", "put", "(", "\"name\"", ",", "\"edge_name\"", ")", ";", "edgeColumns", ".", "put", "(", "\"namespace\"", ",", "\"\"", ")", ";", "Map", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "columnAliases", "=", "new", "HashMap", "<", "String", ",", "Map", "<", "String", ",", "String", ">", ">", "(", ")", ";", "columnAliases", ".", "put", "(", "TableAccessStrategy", ".", "NODE_TABLE", ",", "nodeColumns", ")", ";", "columnAliases", ".", "put", "(", "TableAccessStrategy", ".", "NODE_ANNOTATION_TABLE", ",", "nodeAnnotationColumns", ")", ";", "columnAliases", ".", "put", "(", "TableAccessStrategy", ".", "EDGE_ANNOTATION_TABLE", ",", "edgeAnnotationColumns", ")", ";", "columnAliases", ".", "put", "(", "TableAccessStrategy", ".", "RANK_TABLE", ",", "edgeColumns", ")", ";", "columnAliases", ".", "put", "(", "TableAccessStrategy", ".", "COMPONENT_TABLE", ",", "componentColumns", ")", ";", "TableAccessStrategy", "outerQueryTableAccessStrategy", "=", "new", "TableAccessStrategy", "(", ")", ";", "outerQueryTableAccessStrategy", ".", "setColumnAliases", "(", "columnAliases", ")", ";", "generator", ".", "setOuterQueryTableAccessStrategy", "(", "outerQueryTableAccessStrategy", ")", ";", "}", "@", "Test", "(", "expected", "=", "UnsupportedOperationException", ".", "class", ")", "public", "void", "shouldBailIfGetAnnisKeyMethodIsNotOverwritten", "(", ")", "{", "generator", "=", "new", "DummyAnnotateSqlGenerator", "(", ")", ";", "generator", ".", "createSolutionKey", "(", ")", ";", "}", "@", "Test", "@", "Ignore", "public", "void", "shouldGenerateSelectClauseAnnoPool", "(", ")", "{", "}", "@", "Test", "@", "Ignore", "public", "void", "shouldGenerateSelectClauseFullFacts", "(", ")", "{", "}", "@", "Test", "@", "Ignore", "public", "void", "shouldGenerateSelectClauseWithIsTokenColumn", "(", ")", "{", "generator", ".", "setIncludeIsTokenColumn", "(", "true", ")", ";", "int", "offset", "=", "uniqueInt", "(", "10", ")", ";", "given", "(", "limitOffsetQueryData", ".", "getOffset", "(", ")", ")", ".", "willReturn", "(", "offset", ")", ";", "String", "keyColumn1", "=", "uniqueAlphaString", "(", ")", ";", "String", "keyColumn2", "=", "uniqueAlphaString", "(", ")", ";", "given", "(", "solutionKey", ".", "generateOuterQueryColumns", "(", "eq", "(", "tableAccessStrategy", ")", ",", "anyInt", "(", ")", ")", ")", ".", "willReturn", "(", "asList", "(", "keyColumn1", ",", "keyColumn2", ")", ")", ";", "String", "idAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"id\"", ")", ";", "String", "textRefAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"text_ref\"", ")", ";", "String", "corpusRefAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"corpus_ref\"", ")", ";", "String", "toplevelCorpusAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"\"", ")", ";", "String", "nodeNamespaceAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"namespace\"", ")", ";", "String", "nodeNameAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"name\"", ")", ";", "String", "leftAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"left\"", ")", ";", "String", "rightAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"right\"", ")", ";", "String", "tokenIndexAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"token_index\"", ")", ";", "String", "isTokenAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"is_token\"", ")", ";", "String", "continuousAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"continuous\"", ")", ";", "String", "spanAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"span\"", ")", ";", "String", "leftTokenAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"left_token\"", ")", ";", "String", "rightTokenAlias", "=", "createColumnAlias", "(", "NODE_TABLE", ",", "\"right_token\"", ")", ";", "String", "preAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"pre\"", ")", ";", "String", "postAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"post\"", ")", ";", "String", "parentAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"parent\"", ")", ";", "String", "rootAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"root\"", ")", ";", "String", "levelAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"level\"", ")", ";", "String", "componentIdAlias", "=", "createColumnAlias", "(", "COMPONENT_TABLE", ",", "\"id\"", ")", ";", "String", "componentTypeAlias", "=", "createColumnAlias", "(", "COMPONENT_TABLE", ",", "\"type\"", ")", ";", "String", "componentNameAlias", "=", "createColumnAlias", "(", "COMPONENT_TABLE", ",", "\"name\"", ")", ";", "String", "componentNamespaceAlias", "=", "createColumnAlias", "(", "COMPONENT_TABLE", ",", "\"namespace\"", ")", ";", "String", "nodeAnnotatationNamespaceAlias", "=", "createColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"namespace\"", ")", ";", "String", "nodeAnnotatationNameAlias", "=", "createColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"name\"", ")", ";", "String", "nodeAnnotatationValueAlias", "=", "createColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"value\"", ")", ";", "String", "edgeAnnotationNamespaceAlias", "=", "createColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"namespace\"", ")", ";", "String", "edgeAnnotationNameAlias", "=", "createColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"name\"", ")", ";", "String", "edgeAnnotationValueAlias", "=", "createColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"value\"", ")", ";", "String", "pathNameAlias", "=", "createColumnAlias", "(", "CORPUS_TABLE", ",", "\"path_name\"", ")", ";", "String", "actual", "=", "generator", ".", "selectClause", "(", "queryData", ",", "alternative", ",", "INDENT", ")", ";", "String", "expected", "=", "\"DISTINCT\"", "+", "\"n\"", "+", "INDENT", "+", "TABSTOP", "+", "keyColumn1", "+", "\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "keyColumn2", "+", "\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "offset", "+", "\"", "AS", "\\\"\"", "+", "\"matchstart\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "idAlias", "+", "\"", "AS", "\\\"\"", "+", "\"id\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "textRefAlias", "+", "\"", "AS", "\\\"\"", "+", "\"text_ref\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "corpusRefAlias", "+", "\"", "AS", "\\\"\"", "+", "\"corpus_ref\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "toplevelCorpusAlias", "+", "\"", "AS", "\\\"\"", "+", "\"\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "nodeNamespaceAlias", "+", "\"", "AS", "\\\"\"", "+", "\"\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "nodeNameAlias", "+", "\"", "AS", "\\\"\"", "+", "\"node_name\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "leftAlias", "+", "\"", "AS", "\\\"\"", "+", "\"left\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "rightAlias", "+", "\"", "AS", "\\\"\"", "+", "\"right\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "tokenIndexAlias", "+", "\"", "AS", "\\\"\"", "+", "\"token_index\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "isTokenAlias", "+", "\"", "AS", "\"", "+", "\"\\\"is_token\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "continuousAlias", "+", "\"", "AS", "\\\"\"", "+", "\"continuous\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "spanAlias", "+", "\"", "AS", "\\\"\"", "+", "\"span\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "leftTokenAlias", "+", "\"", "AS", "\\\"\"", "+", "\"left_token\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "rightTokenAlias", "+", "\"", "AS", "\\\"\"", "+", "\"right_token\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "preAlias", "+", "\"", "AS", "\\\"\"", "+", "\"pre\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "postAlias", "+", "\"", "AS", "\\\"\"", "+", "\"post\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "parentAlias", "+", "\"", "AS", "\\\"\"", "+", "\"parent\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "rootAlias", "+", "\"", "AS", "\\\"\"", "+", "\"root\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "levelAlias", "+", "\"", "AS", "\\\"\"", "+", "\"level\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "componentIdAlias", "+", "\"", "AS", "\\\"\"", "+", "\"component_id\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "componentTypeAlias", "+", "\"", "AS", "\\\"\"", "+", "\"edge_type\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "componentNameAlias", "+", "\"", "AS", "\\\"\"", "+", "\"edge_name\"", "+", "\"\\\",n\"", "+", "INDENT", "+", "TABSTOP", "+", "componentNamespaceAlias", "+", "\"", "AS", "\\\"\"", "+", "\"\"", "+", "\"\\\",n\"", ";", "expected", "=", "expected", "+", "INDENT", "+", "TABSTOP", "+", "pathNameAlias", "+", "\"", "AS", "\"", "+", "\"path\"", ";", "System", ".", "out", ".", "println", "(", "\"--->", "Actual\"", ")", ";", "System", ".", "out", ".", "println", "(", "actual", ".", "replace", "(", "\"t\"", ",", "\"\\\\t\"", ")", ".", "replace", "(", "\"n\"", ",", "\"\\\\nn\"", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "expected", ".", "replace", "(", "\"t\"", ",", "\"\\\\t\"", ")", ".", "replace", "(", "\"n\"", ",", "\"\\\\nn\"", ")", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldOrderByKeyComponentAndPreValue", "(", ")", "{", "String", "preAlias", "=", "createColumnAlias", "(", "RANK_TABLE", ",", "\"pre\"", ")", ";", "String", "idAlias", "=", "createColumnAlias", "(", "COMPONENT_TABLE", ",", "\"id\"", ")", ";", "String", "actual", "=", "generator", ".", "orderByClause", "(", "queryData", ",", "alternative", ",", "INDENT", ")", ";", "String", "expected", "=", "\"\"", "+", "idAlias", "+", "\",", "\"", "+", "preAlias", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "private", "String", "createColumnAlias", "(", "String", "table", ",", "String", "column", ")", "{", "String", "columnAlias", "=", "table", "+", "\".\"", "+", "column", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "table", ",", "column", ")", ")", ".", "willReturn", "(", "columnAlias", ")", ";", "return", "columnAlias", ";", "}", "}", "</s>" ]
8,903
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyListOf", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyString", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "eq", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "newSet", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "InjectMocks", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "org", ".", "mockito", ".", "Spy", ";", "import", "org", ".", "springframework", ".", "dao", ".", "DataAccessException", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "public", "class", "TestAbstractUnionSqlGenerator", "{", "@", "InjectMocks", "private", "AbstractUnionSqlGenerator", "<", "?", ">", "generator", ";", "@", "Mock", "private", "SelectClauseSqlGenerator", "<", "QueryData", ">", "selectClauseSqlGenerator", ";", "@", "Mock", "private", "FromClauseSqlGenerator", "<", "QueryData", ">", "fromClauseSqlGenerator", ";", "@", "Spy", "private", "List", "<", "FromClauseSqlGenerator", "<", "QueryData", ">", ">", "fromClauseSqlGenerators", "=", "new", "ArrayList", "<", "FromClauseSqlGenerator", "<", "QueryData", ">", ">", "(", ")", ";", "@", "Mock", "private", "WhereClauseSqlGenerator", "<", "QueryData", ">", "whereClauseSqlGenerator", ";", "@", "Spy", "private", "List", "<", "WhereClauseSqlGenerator", "<", "QueryData", ">", ">", "whereClauseSqlGenerators", "=", "new", "ArrayList", "<", "WhereClauseSqlGenerator", "<", "QueryData", ">", ">", "(", ")", ";", "@", "Mock", "private", "GroupByClauseSqlGenerator", "<", "QueryData", ">", "groupByClauseSqlGenerator", ";", "@", "Mock", "private", "OrderByClauseSqlGenerator", "<", "QueryData", ">", "orderByClauseSqlGenerator", ";", "@", "Mock", "private", "LimitOffsetClauseSqlGenerator", "<", "QueryData", ">", "limitOffsetClauseSqlGenerator", ";", "private", "QueryData", "queryData", "=", "new", "QueryData", "(", ")", ";", "private", "QueryNode", "annisNode", "=", "new", "QueryNode", "(", ")", ";", "private", "List", "<", "QueryNode", ">", "alternative", "=", "new", "ArrayList", "<", "QueryNode", ">", "(", ")", ";", "private", "List", "<", "List", "<", "QueryNode", ">", ">", "alternatives", "=", "new", "ArrayList", "<", "List", "<", "QueryNode", ">", ">", "(", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "generator", "=", "new", "AbstractUnionSqlGenerator", "<", "Object", ">", "(", ")", "{", "@", "Override", "public", "Object", "extractData", "(", "ResultSet", "rs", ")", "throws", "SQLException", ",", "DataAccessException", "{", "throw", "new", "UnsupportedOperationException", "(", "\"\"", ")", ";", "}", "}", ";", "initMocks", "(", "this", ")", ";", "fromClauseSqlGenerators", ".", "add", "(", "fromClauseSqlGenerator", ")", ";", "whereClauseSqlGenerators", ".", "add", "(", "whereClauseSqlGenerator", ")", ";", "generator", ".", "setSelectClauseSqlGenerator", "(", "selectClauseSqlGenerator", ")", ";", "generator", ".", "setFromClauseSqlGenerators", "(", "fromClauseSqlGenerators", ")", ";", "generator", ".", "setWhereClauseSqlGenerators", "(", "whereClauseSqlGenerators", ")", ";", "generator", ".", "setGroupByClauseSqlGenerator", "(", "groupByClauseSqlGenerator", ")", ";", "generator", ".", "setOrderByClauseSqlGenerator", "(", "orderByClauseSqlGenerator", ")", ";", "generator", ".", "setLimitOffsetClauseSqlGenerator", "(", "limitOffsetClauseSqlGenerator", ")", ";", "alternative", ".", "add", "(", "annisNode", ")", ";", "alternatives", ".", "add", "(", "alternative", ")", ";", "queryData", ".", "setAlternatives", "(", "alternatives", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateStatementForOneAlternative", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "String", "whereCondition", "=", "uniqueString", "(", ")", ";", "String", "orderBy", "=", "uniqueString", "(", ")", ";", "String", "groupBy", "=", "uniqueString", "(", ")", ";", "String", "limitOffset", "=", "uniqueString", "(", ")", ";", "setupClauseSqlGenerators", "(", "selectClause", ",", "fromClause", ",", "whereCondition", ",", "orderBy", ",", "groupBy", ",", "limitOffset", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "\"SELECT", "\"", "+", "selectClause", "+", "\"n\"", "+", "\"FROM\"", "+", "\"n\"", "+", "\"", "\"", "+", "fromClause", "+", "\"n\"", "+", "\"WHERE\"", "+", "\"n\"", "+", "\"", "\"", "+", "whereCondition", "+", "\"n\"", "+", "\"GROUP", "BY", "\"", "+", "groupBy", "+", "\"n\"", "+", "\"ORDER", "BY", "\"", "+", "orderBy", "+", "\"n\"", "+", "limitOffset", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateStatementForMultipleAlternatives", "(", ")", "{", "alternatives", ".", "add", "(", "alternative", ")", ";", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "String", "whereCondition", "=", "uniqueString", "(", ")", ";", "String", "orderBy", "=", "uniqueString", "(", ")", ";", "String", "groupBy", "=", "uniqueString", "(", ")", ";", "String", "limitOffset", "=", "uniqueString", "(", ")", ";", "setupClauseSqlGenerators", "(", "selectClause", ",", "fromClause", ",", "whereCondition", ",", "orderBy", ",", "groupBy", ",", "limitOffset", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "\"SELECT", "\"", "+", "selectClause", "+", "\"n\"", "+", "\"FROM\"", "+", "\"n\"", "+", "\"", "\"", "+", "fromClause", "+", "\"n\"", "+", "\"WHERE\"", "+", "\"n\"", "+", "\"", "\"", "+", "whereCondition", "+", "\"n\"", "+", "\"GROUP", "BY", "\"", "+", "groupBy", "+", "\"n\"", "+", "\"n\"", "+", "\"\"", "+", "selectClause", "+", "\"n\"", "+", "\"FROM\"", "+", "\"n\"", "+", "\"", "\"", "+", "fromClause", "+", "\"n\"", "+", "\"WHERE\"", "+", "\"n\"", "+", "\"", "\"", "+", "whereCondition", "+", "\"n\"", "+", "\"GROUP", "BY", "\"", "+", "groupBy", "+", "\"n\"", "+", "\"ORDER", "BY", "\"", "+", "orderBy", "+", "\"n\"", "+", "limitOffset", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "private", "void", "setupClauseSqlGenerators", "(", "String", "selectClause", ",", "String", "fromClause", ",", "String", "whereCondition", ",", "String", "orderBy", ",", "String", "groupBy", ",", "String", "limitOffset", ")", "{", "given", "(", "selectClauseSqlGenerator", ".", "selectClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "selectClause", ")", ";", "given", "(", "fromClauseSqlGenerator", ".", "fromClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "fromClause", ")", ";", "given", "(", "whereClauseSqlGenerator", ".", "whereConditions", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "newSet", "(", "whereCondition", ")", ")", ";", "given", "(", "groupByClauseSqlGenerator", ".", "groupByAttributes", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ")", ")", ".", "willReturn", "(", "groupBy", ")", ";", "given", "(", "orderByClauseSqlGenerator", ".", "orderByClause", "(", "eq", "(", "queryData", ")", ",", "anyListOf", "(", "QueryNode", ".", "class", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "orderBy", ")", ";", "given", "(", "limitOffsetClauseSqlGenerator", ".", "limitOffsetClause", "(", "eq", "(", "queryData", ")", ",", "anyListOf", "(", "QueryNode", ".", "class", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "limitOffset", ")", ";", "}", "}", "</s>" ]
8,904
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "COMPONENT_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "RANK_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "nullValue", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "AnnisNode", ";", "import", "annis", ".", "model", ".", "Annotation", ";", "import", "annis", ".", "model", ".", "Edge", ";", "import", "annis", ".", "model", ".", "Edge", ".", "EdgeType", ";", "public", "class", "AomAnnotateSqlGeneratorTest", "{", "private", "AomAnnotateExtractor", "generator", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "ResultSet", "resultSet", ";", "private", "static", "final", "long", "ID", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "TEXT_REF", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "CORPUS_REF", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "String", "NODE_NAMESPACE", "=", "uniqueString", "(", "\"NAMESPACE\"", ")", ";", "private", "static", "final", "String", "NODE_NAME", "=", "uniqueString", "(", "\"NAME\"", ")", ";", "private", "static", "final", "long", "LEFT", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "RIGHT", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "TOKEN_INDEX", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "LEFT_TOKEN", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "RIGHT_TOKEN", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "String", "SPAN", "=", "uniqueString", "(", "\"SPAN\"", ")", ";", "private", "static", "final", "long", "PRE", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "EdgeType", "EDGETYPE", "=", "EdgeType", ".", "UNKNOWN", ";", "private", "static", "final", "String", "EDGE_NAMESPACE", "=", "uniqueString", "(", "\"NAMESPACE\"", ")", ";", "private", "static", "final", "String", "EDGE_NAME", "=", "uniqueString", "(", "\"NAME\"", ")", ";", "private", "static", "final", "long", "PARENT", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "long", "NODE_REF", "=", "uniqueInt", "(", ")", ";", "private", "static", "final", "String", "NAMESPACE", "=", "\"NAMESPACE\"", ";", "private", "static", "final", "String", "NAME", "=", "\"NAME\"", ";", "private", "static", "final", "String", "VALUE", "=", "\"VALUE\"", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "generator", "=", "new", "AomAnnotateExtractor", "(", ")", ";", "}", "@", "Test", "public", "void", "shouldMapNode", "(", ")", "throws", "SQLException", "{", "stubNodeResultSet", "(", ")", ";", "AnnisNode", "actual", "=", "generator", ".", "mapNode", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "AnnisNode", "expected", "=", "new", "AnnisNode", "(", "ID", ",", "CORPUS_REF", ",", "TEXT_REF", ",", "LEFT", ",", "RIGHT", ",", "NODE_NAMESPACE", ",", "NODE_NAME", ",", "TOKEN_INDEX", ",", "SPAN", ",", "LEFT_TOKEN", ",", "RIGHT_TOKEN", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapNodeWithToken", "(", ")", "throws", "SQLException", "{", "stubNodeResultSet", "(", ")", ";", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "AnnisNode", "node", "=", "generator", ".", "mapNode", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "assertThat", "(", "node", ".", "isToken", "(", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapNodeWithoutToken", "(", ")", "throws", "SQLException", "{", "stubNodeResultSet", "(", ")", ";", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "false", ")", ";", "AnnisNode", "node", "=", "generator", ".", "mapNode", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "assertThat", "(", "node", ".", "isToken", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapEdge", "(", ")", "throws", "SQLException", "{", "stubEdgeResultSet", "(", ")", ";", "Edge", "actual", "=", "generator", ".", "mapEdge", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "Edge", "expected", "=", "createDefaultEdge", "(", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapEdgeWithRoot", "(", ")", "throws", "SQLException", "{", "stubEdgeResultSet", "(", ")", ";", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "Edge", "actual", "=", "generator", ".", "mapEdge", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "Edge", "expected", "=", "createDefaultEdge", "(", ")", ";", "expected", ".", "setSource", "(", "null", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapAnnotation", "(", ")", "throws", "SQLException", "{", "String", "table", "=", "uniqueString", "(", ")", ";", "stubDefaultAnnotation", "(", "table", ")", ";", "Annotation", "actual", "=", "generator", ".", "mapAnnotation", "(", "resultSet", ",", "tableAccessStrategy", ",", "table", ")", ";", "Annotation", "expected", "=", "new", "Annotation", "(", "NAMESPACE", ",", "NAME", ",", "VALUE", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldMapEmptyAnnotation", "(", ")", "throws", "SQLException", "{", "String", "table", "=", "uniqueString", "(", ")", ";", "stubDefaultAnnotation", "(", "table", ")", ";", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "Annotation", "actual", "=", "generator", ".", "mapAnnotation", "(", "resultSet", ",", "tableAccessStrategy", ",", "table", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "nullValue", "(", ")", ")", ")", ";", "}", "private", "void", "stubNodeResultSet", "(", ")", "throws", "SQLException", "{", "stubLongColumn", "(", "NODE_TABLE", ",", "\"id\"", ",", "ID", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"corpus_ref\"", ",", "CORPUS_REF", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"text_ref\"", ",", "TEXT_REF", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"left\"", ",", "LEFT", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"right\"", ",", "RIGHT", ")", ";", "stubStringColumn", "(", "NODE_TABLE", ",", "\"namespace\"", ",", "NODE_NAMESPACE", ")", ";", "stubStringColumn", "(", "NODE_TABLE", ",", "\"name\"", ",", "NODE_NAME", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"token_index\"", ",", "TOKEN_INDEX", ")", ";", "stubStringColumn", "(", "NODE_TABLE", ",", "\"span\"", ",", "SPAN", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"left_token\"", ",", "LEFT_TOKEN", ")", ";", "stubLongColumn", "(", "NODE_TABLE", ",", "\"right_token\"", ",", "RIGHT_TOKEN", ")", ";", "}", "private", "void", "stubEdgeResultSet", "(", ")", "throws", "SQLException", "{", "stubLongColumn", "(", "RANK_TABLE", ",", "\"pre\"", ",", "PRE", ")", ";", "stubLongColumn", "(", "RANK_TABLE", ",", "\"node_ref\"", ",", "NODE_REF", ")", ";", "stubLongColumn", "(", "RANK_TABLE", ",", "\"parent\"", ",", "PARENT", ")", ";", "stubStringColumn", "(", "RANK_TABLE", ",", "\"edge_type\"", ",", "EDGETYPE", ".", "getTypeChar", "(", ")", ")", ";", "stubStringColumn", "(", "COMPONENT_TABLE", ",", "\"namespace\"", ",", "EDGE_NAMESPACE", ")", ";", "stubStringColumn", "(", "COMPONENT_TABLE", ",", "\"name\"", ",", "EDGE_NAME", ")", ";", "}", "private", "Edge", "createDefaultEdge", "(", ")", "{", "Edge", "expected", "=", "new", "Edge", "(", ")", ";", "expected", ".", "setPre", "(", "PRE", ")", ";", "expected", ".", "setEdgeType", "(", "EDGETYPE", ")", ";", "expected", ".", "setNamespace", "(", "EDGE_NAMESPACE", ")", ";", "expected", ".", "setName", "(", "EDGE_NAME", ")", ";", "expected", ".", "setSource", "(", "new", "AnnisNode", "(", "PARENT", ")", ")", ";", "expected", ".", "setDestination", "(", "new", "AnnisNode", "(", "NODE_REF", ")", ")", ";", "return", "expected", ";", "}", "private", "void", "stubDefaultAnnotation", "(", "String", "table", ")", "throws", "SQLException", "{", "stubStringColumn", "(", "table", ",", "\"namespace\"", ",", "NAMESPACE", ")", ";", "stubStringColumn", "(", "table", ",", "\"name\"", ",", "NAME", ")", ";", "stubStringColumn", "(", "table", ",", "\"value\"", ",", "VALUE", ")", ";", "}", "private", "void", "stubStringColumn", "(", "String", "table", ",", "final", "String", "column", ",", "final", "String", "value", ")", "throws", "SQLException", "{", "String", "prefix", "=", "uniqueString", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "columnName", "(", "table", ",", "column", ")", ")", ".", "willReturn", "(", "prefix", "+", "column", ")", ";", "given", "(", "resultSet", ".", "getString", "(", "prefix", "+", "column", ")", ")", ".", "willReturn", "(", "value", ")", ";", "}", "private", "void", "stubLongColumn", "(", "String", "table", ",", "final", "String", "column", ",", "final", "Long", "value", ")", "throws", "SQLException", "{", "String", "prefix", "=", "uniqueString", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "columnName", "(", "table", ",", "column", ")", ")", ".", "willReturn", "(", "prefix", "+", "column", ")", ";", "given", "(", "resultSet", ".", "getLong", "(", "prefix", "+", "column", ")", ")", ".", "willReturn", "(", "value", ")", ";", "}", "}", "</s>" ]
8,905
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "annis", ".", "model", ".", "QueryAnnotation", ";", "import", "annis", ".", "model", ".", "QueryNode", ".", "TextMatching", ";", "public", "class", "TestSubQueryCorpusSelectionStrategy", "{", "private", "List", "<", "Long", ">", "corpusList", ";", "private", "List", "<", "QueryAnnotation", ">", "metaData", ";", "private", "SubQueryCorpusSelectionStrategy", "strategy", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "corpusList", "=", "new", "ArrayList", "<", "Long", ">", "(", ")", ";", "metaData", "=", "new", "ArrayList", "<", "QueryAnnotation", ">", "(", ")", ";", "strategy", "=", "new", "SubQueryCorpusSelectionStrategy", "(", ")", ";", "}", "@", "Test", "public", "void", "hasCorpusSelectionFalse", "(", ")", "{", "assertThat", "(", "strategy", ".", "hasCorpusSelection", "(", "corpusList", ",", "metaData", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "hasCorpusSelectionCorpusList", "(", ")", "{", "corpusList", "=", "Arrays", ".", "asList", "(", "23L", ")", ";", "assertThat", "(", "strategy", ".", "hasCorpusSelection", "(", "corpusList", ",", "metaData", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "hasCorpusSelectionMetaData", "(", ")", "{", "metaData", "=", "Arrays", ".", "asList", "(", "new", "QueryAnnotation", "(", "\"NAMESPACE\"", ",", "\"NAME\"", ")", ")", ";", "assertThat", "(", "strategy", ".", "hasCorpusSelection", "(", "corpusList", ",", "metaData", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "buildSubQueryOneCorpus", "(", ")", "{", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "corpusList", "=", "Arrays", ".", "asList", "(", "23L", ")", ";", "assertEquals", "(", "expected", ",", "strategy", ".", "buildSubQuery", "(", "corpusList", ",", "metaData", ")", ")", ";", "}", "@", "Test", "public", "void", "buildSubQueryManyCorpus", "(", ")", "{", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "corpusList", "=", "Arrays", ".", "asList", "(", "23L", ",", "42L", ",", "69L", ")", ";", "assertEquals", "(", "expected", ",", "strategy", ".", "buildSubQuery", "(", "corpusList", ",", "metaData", ")", ")", ";", "}", "@", "Test", "public", "void", "buildSubQueryEmptyCorpusList", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "assertEquals", "(", "expected", ",", "strategy", ".", "buildSubQuery", "(", "corpusList", ",", "metaData", ")", ")", ";", "}", "@", "Test", "public", "void", "corpusConstraintEmptyCorpusListAnnotation", "(", ")", "{", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "QueryAnnotation", "annotation1", "=", "new", "QueryAnnotation", "(", "\"namespace1\"", ",", "\"name1\"", ")", ";", "QueryAnnotation", "annotation2", "=", "new", "QueryAnnotation", "(", "\"namespace2\"", ",", "\"name2\"", ",", "\"value2\"", ",", "TextMatching", ".", "EXACT_EQUAL", ")", ";", "QueryAnnotation", "annotation3", "=", "new", "QueryAnnotation", "(", "\"namespace3\"", ",", "\"name3\"", ",", "\"value3\"", ",", "TextMatching", ".", "REGEXP_EQUAL", ")", ";", "metaData", "=", "Arrays", ".", "asList", "(", "annotation1", ",", "annotation2", ",", "annotation3", ")", ";", "assertEquals", "(", "expected", ",", "strategy", ".", "buildSubQuery", "(", "corpusList", ",", "metaData", ")", ")", ";", "}", "@", "Test", "public", "void", "corpusConstraintCorpusListAndAnnotation", "(", ")", "{", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "QueryAnnotation", "annotation1", "=", "new", "QueryAnnotation", "(", "\"namespace1\"", ",", "\"name1\"", ")", ";", "QueryAnnotation", "annotation2", "=", "new", "QueryAnnotation", "(", "\"namespace2\"", ",", "\"name2\"", ",", "\"value2\"", ",", "TextMatching", ".", "EXACT_EQUAL", ")", ";", "QueryAnnotation", "annotation3", "=", "new", "QueryAnnotation", "(", "\"namespace3\"", ",", "\"name3\"", ",", "\"value3\"", ",", "TextMatching", ".", "REGEXP_EQUAL", ")", ";", "corpusList", "=", "Arrays", ".", "asList", "(", "23L", ",", "42L", ",", "69L", ")", ";", "metaData", "=", "Arrays", ".", "asList", "(", "annotation1", ",", "annotation2", ",", "annotation3", ")", ";", "assertEquals", "(", "expected", ",", "strategy", ".", "buildSubQuery", "(", "corpusList", ",", "metaData", ")", ")", ";", "}", "}", "</s>" ]
8,906
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "annis", ".", "model", ".", "Annotation", ";", "public", "class", "TestListCorpusAnnotationsSqlHelper", "{", "private", "ListCorpusAnnotationsSqlHelper", "listCorpusAnnotationsHelper", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "listCorpusAnnotationsHelper", "=", "new", "ListCorpusAnnotationsSqlHelper", "(", ")", ";", "}", "@", "Test", "public", "void", "mapRow", "(", ")", "throws", "SQLException", "{", "ResultSet", "resultSet", "=", "mock", "(", "ResultSet", ".", "class", ")", ";", "final", "String", "NAMESPACE", "=", "\"NAMESPACE\"", ";", "final", "String", "NAME", "=", "\"NAME\"", ";", "final", "String", "VALUE", "=", "\"VALUE\"", ";", "when", "(", "resultSet", ".", "getString", "(", "\"namespace\"", ")", ")", ".", "thenReturn", "(", "NAMESPACE", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"name\"", ")", ")", ".", "thenReturn", "(", "NAME", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"value\"", ")", ")", ".", "thenReturn", "(", "VALUE", ")", ";", "Annotation", "expected", "=", "new", "Annotation", "(", "NAMESPACE", ",", "NAME", ",", "VALUE", ")", ";", "assertThat", "(", "listCorpusAnnotationsHelper", ".", "mapRow", "(", "resultSet", ",", "1", ")", ",", "is", "(", "expected", ")", ")", ";", "}", "}", "</s>" ]
8,907
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "apache", ".", "commons", ".", "lang3", ".", "StringUtils", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "CsvCorpusPathExtractorTest", "{", "CorpusPathExtractor", "extractor", "=", "new", "CsvCorpusPathExtractor", "(", ")", ";", "@", "Test", "public", "void", "shouldExtractCorpusPath", "(", ")", "throws", "SQLException", "{", "String", "pathAlias", "=", "uniqueString", "(", "5", ")", ";", "String", "path1", "=", "uniqueString", "(", "3", ")", ";", "String", "path2", "=", "uniqueString", "(", "3", ")", ";", "String", "path3", "=", "uniqueString", "(", "3", ")", ";", "ResultSet", "resultSet", "=", "mock", "(", "ResultSet", ".", "class", ")", ";", "String", "csv", "=", "StringUtils", ".", "join", "(", "asList", "(", "path1", ",", "path2", ",", "path3", ")", ",", "\",\"", ")", ";", "given", "(", "resultSet", ".", "getString", "(", "pathAlias", ")", ")", ".", "willReturn", "(", "csv", ")", ";", "List", "<", "String", ">", "path", "=", "extractor", ".", "extractCorpusPath", "(", "resultSet", ",", "pathAlias", ")", ";", "assertThat", "(", "path", ",", "is", "(", "asList", "(", "path3", ",", "path2", ",", "path1", ")", ")", ")", ";", "}", "}", "</s>" ]
8,908
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "size", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "fail", ";", "import", "static", "org", ".", "junit", ".", "matchers", ".", "JUnitMatchers", ".", "hasItems", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "annis", ".", "service", ".", "objects", ".", "AnnisAttribute", ";", "import", "annis", ".", "service", ".", "objects", ".", "AnnisAttribute", ";", "public", "class", "TestListAnnotationsSqlHelper", "{", "private", "ListAnnotationsSqlHelper", "listNodeAnnotationsSqlHelper", ";", "private", "static", "final", "String", "NULL", "=", "null", ";", "private", "static", "final", "String", "NAME1", "=", "\"NAME1\"", ";", "private", "static", "final", "String", "NAME2", "=", "\"NAME2\"", ";", "private", "static", "final", "String", "NAME3", "=", "\"NAME3\"", ";", "private", "static", "final", "String", "VALUE1", "=", "\"VALUE1\"", ";", "private", "static", "final", "String", "VALUE2", "=", "\"VALUE2\"", ";", "private", "static", "final", "String", "VALUE3", "=", "\"VALUE3\"", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "listNodeAnnotationsSqlHelper", "=", "new", "ListAnnotationsSqlHelper", "(", ")", ";", "}", "public", "void", "createSqlQueryNoEmptyCorpusList", "(", ")", "{", "try", "{", "listNodeAnnotationsSqlHelper", ".", "createSqlQuery", "(", "null", ",", "true", ",", "true", ")", ";", "}", "catch", "(", "IllegalArgumentException", "ex", ")", "{", "return", ";", "}", "fail", "(", "\"\"", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "extractDataNoValues", "(", ")", "throws", "SQLException", "{", "ResultSet", "resultSet", "=", "mock", "(", "ResultSet", ".", "class", ")", ";", "when", "(", "resultSet", ".", "next", "(", ")", ")", ".", "thenReturn", "(", "true", ",", "true", ",", "false", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"name\"", ")", ")", ".", "thenReturn", "(", "NAME1", ",", "NAME2", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"value\"", ")", ")", ".", "thenReturn", "(", "NULL", ")", ";", "AnnisAttribute", "attribute1", "=", "newNamedAnnisAttribute", "(", "NAME1", ")", ";", "AnnisAttribute", "attribute2", "=", "newNamedAnnisAttribute", "(", "NAME2", ")", ";", "List", "<", "AnnisAttribute", ">", "annotations", "=", "(", "List", "<", "AnnisAttribute", ">", ")", "listNodeAnnotationsSqlHelper", ".", "extractData", "(", "resultSet", ")", ";", "assertThat", "(", "annotations", ",", "size", "(", "2", ")", ")", ";", "assertThat", "(", "annotations", ",", "hasItems", "(", "attribute1", ",", "attribute2", ")", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "extractDataWithValues", "(", ")", "throws", "SQLException", "{", "ResultSet", "resultSet", "=", "mock", "(", "ResultSet", ".", "class", ")", ";", "when", "(", "resultSet", ".", "next", "(", ")", ")", ".", "thenReturn", "(", "true", ",", "true", ",", "true", ",", "true", ",", "true", ",", "false", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"name\"", ")", ")", ".", "thenReturn", "(", "NAME1", ",", "NAME1", ",", "NAME1", ",", "NAME2", ",", "NAME3", ")", ";", "when", "(", "resultSet", ".", "getString", "(", "\"value\"", ")", ")", ".", "thenReturn", "(", "VALUE1", ",", "VALUE2", ",", "VALUE3", ",", "VALUE1", ",", "NULL", ")", ";", "AnnisAttribute", "attribute1", "=", "newNamedAnnisAttribute", "(", "NAME1", ",", "VALUE1", ",", "VALUE2", ",", "VALUE3", ")", ";", "AnnisAttribute", "attribute2", "=", "newNamedAnnisAttribute", "(", "NAME2", ",", "VALUE1", ")", ";", "AnnisAttribute", "attribute3", "=", "newNamedAnnisAttribute", "(", "NAME3", ")", ";", "List", "<", "AnnisAttribute", ">", "annotations", "=", "(", "List", "<", "AnnisAttribute", ">", ")", "listNodeAnnotationsSqlHelper", ".", "extractData", "(", "resultSet", ")", ";", "assertThat", "(", "annotations", ",", "size", "(", "3", ")", ")", ";", "assertThat", "(", "annotations", ",", "hasItems", "(", "attribute1", ",", "attribute2", ",", "attribute3", ")", ")", ";", "}", "private", "AnnisAttribute", "newNamedAnnisAttribute", "(", "String", "name", ",", "String", "...", "values", ")", "{", "AnnisAttribute", "attribute", "=", "new", "AnnisAttribute", "(", ")", ";", "attribute", ".", "setName", "(", "name", ")", ";", "for", "(", "String", "value", ":", "values", ")", "attribute", ".", "addValue", "(", "value", ")", ";", "return", "attribute", ";", "}", "}", "</s>" ]
8,909
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "nullValue", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyString", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "Array", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "sql", ".", "Types", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "public", "class", "NodeNameAndIdPostgreSqlArraySolutionKeyTest", "{", "private", "SolutionKey", "<", "List", "<", "String", ">", ">", "key", "=", "new", "NodeNameAndIdPostgreSqlArraySolutionKey", "(", ")", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "ResultSet", "resultSet", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForInnerQuery", "(", ")", "{", "String", "idAlias", "=", "uniqueString", "(", "3", ")", ";", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"id\"", ")", ")", ".", "willReturn", "(", "idAlias", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"name\"", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "index", "=", "uniqueInt", "(", "1", ",", "10", ")", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateInnerQueryColumns", "(", "tableAccessStrategy", ",", "index", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "idAlias", "+", "\"", "AS", "id\"", "+", "index", ",", "nameAlias", "+", "\"", "AS", "name\"", "+", "index", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForOuterQuery", "(", ")", "{", "String", "idAlias", "=", "uniqueString", "(", "3", ")", ";", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "\"solutions\"", ",", "\"id\"", ")", ")", ".", "willReturn", "(", "idAlias", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "\"solutions\"", ",", "\"name\"", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "size", "=", "3", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateOuterQueryColumns", "(", "tableAccessStrategy", ",", "size", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "\"ARRAY[\"", "+", "idAlias", "+", "\"1\"", "+", "\",", "\"", "+", "idAlias", "+", "\"2\"", "+", "\",", "\"", "+", "idAlias", "+", "\"3\"", "+", "\"]", "AS", "key\"", ",", "\"ARRAY[\"", "+", "nameAlias", "+", "\"1\"", "+", "\",", "\"", "+", "nameAlias", "+", "\"2\"", "+", "\",", "\"", "+", "nameAlias", "+", "\"3\"", "+", "\"\"", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRetreiveKeyFromResultSetAndValidateIt", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "String", "key3", "=", "uniqueString", "(", "3", ")", ";", "Array", "array", "=", "createKeyJdbcArray", "(", "key1", ",", "key2", ",", "key3", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array", ")", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "key1", ",", "key2", ",", "key3", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "private", "Array", "createKeyJdbcArray", "(", "String", "...", "keys", ")", "throws", "SQLException", "{", "Array", "array", "=", "mock", "(", "Array", ".", "class", ")", ";", "given", "(", "array", ".", "getBaseType", "(", ")", ")", ".", "willReturn", "(", "Types", ".", "VARCHAR", ")", ";", "given", "(", "array", ".", "getArray", "(", ")", ")", ".", "willReturn", "(", "keys", ")", ";", "return", "array", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfResultSetThrowsSqlException", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "getArray", "(", "anyString", "(", ")", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfKeyIsNull", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalNewKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "Array", "array1", "=", "createKeyJdbcArray", "(", "key1", ")", ";", "Array", "array2", "=", "createKeyJdbcArray", "(", "key2", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array1", ",", "array2", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRecognizeOldKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "Array", "array1", "=", "createKeyJdbcArray", "(", "key1", ")", ";", "Array", "array2", "=", "createKeyJdbcArray", "(", "key1", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array1", ",", "array2", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalMatchedNodes", "(", ")", "throws", "SQLException", "{", "String", "[", "]", "keys", "=", "{", "uniqueString", "(", "3", ")", ",", "uniqueString", "(", "3", ")", ",", "uniqueString", "(", "3", ")", "}", ";", "Array", "array", "=", "createKeyJdbcArray", "(", "keys", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "{", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "keys", "[", "i", "]", ")", ",", "is", "(", "i", "+", "1", ")", ")", ";", "}", "}", "@", "Test", "public", "void", "shouldReturnNullForUnmatchedNodes", "(", ")", "throws", "SQLException", "{", "Array", "array", "=", "createKeyJdbcArray", "(", "uniqueString", "(", ")", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "uniqueString", "(", ")", ")", ",", "is", "(", "nullValue", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateStringRepresentationOfKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "String", "key3", "=", "uniqueString", "(", "3", ")", ";", "Array", "array", "=", "createKeyJdbcArray", "(", "key1", ",", "key2", ",", "key3", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "\"key_names\"", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "String", "actual", "=", "key", ".", "getCurrentKeyAsString", "(", ")", ";", "String", "expected", "=", "key1", "+", "\",\"", "+", "key2", "+", "\",\"", "+", "key3", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "}", "</s>" ]
8,910
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "createJdbcArray", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "nullValue", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyString", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "Array", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "public", "class", "PostgreSqlArraySolutionKeyTest", "{", "private", "PostgreSqlArraySolutionKey", "<", "String", ">", "key", "=", "new", "PostgreSqlArraySolutionKey", "<", "String", ">", "(", ")", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "ResultSet", "resultSet", ";", "private", "static", "String", "idColumnName", "=", "uniqueString", "(", "3", ")", ";", "private", "static", "String", "keyColumnName", "=", "uniqueString", "(", "3", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "key", ".", "setIdColumnName", "(", "idColumnName", ")", ";", "key", ".", "setKeyColumnName", "(", "keyColumnName", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForInnerQuery", "(", ")", "{", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "idColumnName", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "index", "=", "uniqueInt", "(", "1", ",", "10", ")", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateInnerQueryColumns", "(", "tableAccessStrategy", ",", "index", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "nameAlias", "+", "\"", "AS", "\"", "+", "idColumnName", "+", "index", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForOuterQuery", "(", ")", "{", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "\"solutions\"", ",", "idColumnName", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "size", "=", "3", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateOuterQueryColumns", "(", "tableAccessStrategy", ",", "size", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "\"ARRAY[\"", "+", "nameAlias", "+", "\"1\"", "+", "\",", "\"", "+", "nameAlias", "+", "\"2\"", "+", "\",", "\"", "+", "nameAlias", "+", "\"3\"", "+", "\"]", "AS", "\"", "+", "keyColumnName", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRetreiveKeyFromResultSet", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "String", "key3", "=", "uniqueString", "(", "3", ")", ";", "Array", "array", "=", "createJdbcArray", "(", "key1", ",", "key2", ",", "key3", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array", ")", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "key1", ",", "key2", ",", "key3", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfResultSetThrowsSqlExceptionInRetrieveKey", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "getArray", "(", "anyString", "(", ")", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfKeyIsNull", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "wasNull", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalNewKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "Array", "array1", "=", "createJdbcArray", "(", "key1", ")", ";", "Array", "array2", "=", "createJdbcArray", "(", "key2", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array1", ",", "array2", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRecognizeOldKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "Array", "array1", "=", "createJdbcArray", "(", "key1", ")", ";", "Array", "array2", "=", "createJdbcArray", "(", "key1", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array1", ",", "array2", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalMatchedNodes", "(", ")", "throws", "SQLException", "{", "String", "[", "]", "keys", "=", "{", "uniqueString", "(", "3", ")", ",", "uniqueString", "(", "3", ")", ",", "uniqueString", "(", "3", ")", "}", ";", "Array", "array", "=", "createJdbcArray", "(", "keys", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "{", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "keys", "[", "i", "]", ")", ",", "is", "(", "i", "+", "1", ")", ")", ";", "}", "}", "@", "Test", "public", "void", "shouldReturnNullForUnmatchedNodes", "(", ")", "throws", "SQLException", "{", "Array", "array", "=", "createJdbcArray", "(", "uniqueString", "(", ")", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "uniqueString", "(", ")", ")", ",", "is", "(", "nullValue", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateStringRepresentationOfKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "String", "key2", "=", "uniqueString", "(", "3", ")", ";", "String", "key3", "=", "uniqueString", "(", "3", ")", ";", "Array", "array", "=", "createJdbcArray", "(", "key1", ",", "key2", ",", "key3", ")", ";", "given", "(", "resultSet", ".", "getArray", "(", "keyColumnName", ")", ")", ".", "willReturn", "(", "array", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "String", "actual", "=", "key", ".", "getCurrentKeyAsString", "(", ")", ";", "String", "expected", "=", "key1", "+", "\",\"", "+", "key2", "+", "\",\"", "+", "key3", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnKeyArrayNameAsKeyColumn", "(", ")", "{", "List", "<", "String", ">", "keyColumns", "=", "key", ".", "getKeyColumns", "(", "0", ")", ";", "assertThat", "(", "keyColumns", ",", "is", "(", "asList", "(", "keyColumnName", ")", ")", ")", ";", "}", "}", "</s>" ]
8,911
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertNotNull", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "org", ".", "eclipse", ".", "emf", ".", "common", ".", "util", ".", "ECollections", ";", "import", "org", ".", "eclipse", ".", "emf", ".", "common", ".", "util", ".", "EList", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "annis", ".", "test", ".", "CsvResultSetProvider", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "SaltProject", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sCorpusStructure", ".", "SCorpusGraph", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sDocumentStructure", ".", "SDocumentGraph", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sDocumentStructure", ".", "SDominanceRelation", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sDocumentStructure", ".", "SPointingRelation", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sDocumentStructure", ".", "SSpanningRelation", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "sDocumentStructure", ".", "STextualRelation", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCore", ".", "SLayer", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCore", ".", "SNamedElement", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCore", ".", "SNode", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCore", ".", "SRelation", ";", "public", "class", "SaltAnnotateExtractorTest", "{", "private", "CsvResultSetProvider", "resultSetProvider", ";", "private", "PostgreSqlArraySolutionKey", "<", "String", ">", "solutionKey", "=", "new", "PostgreSqlArraySolutionKey", "<", "String", ">", "(", ")", ";", "private", "SaltProject", "project", ";", "@", "Before", "public", "void", "setUp", "(", ")", "throws", "SQLException", "{", "initMocks", "(", "this", ")", ";", "solutionKey", ".", "setKeyColumnName", "(", "\"key\"", ")", ";", "resultSetProvider", "=", "new", "CsvResultSetProvider", "(", "getClass", "(", ")", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ";", "ResultSet", "resultSet", "=", "resultSetProvider", ".", "getResultSet", "(", ")", ";", "SaltAnnotateExtractor", "instance", "=", "new", "SaltAnnotateExtractor", "(", ")", "{", "protected", "SolutionKey", "<", "?", ">", "createSolutionKey", "(", ")", "{", "return", "solutionKey", ";", "}", "}", ";", "CorpusPathExtractor", "corpusPathExtractor", "=", "new", "ArrayCorpusPathExtractor", "(", ")", ";", "instance", ".", "setCorpusPathExtractor", "(", "corpusPathExtractor", ")", ";", "TestAnnotateSqlGenerator", ".", "setupOuterQueryFactsTableColumnAliases", "(", "instance", ")", ";", "project", "=", "instance", ".", "extractData", "(", "resultSet", ")", ";", "assertNotNull", "(", "project", ")", ";", "}", "@", "Test", "public", "void", "testCorpusGraph", "(", ")", "throws", "Exception", "{", "assertEquals", "(", "1", ",", "project", ".", "getSCorpusGraphs", "(", ")", ".", "size", "(", ")", ")", ";", "SCorpusGraph", "corpusGraph", "=", "project", ".", "getSCorpusGraphs", "(", ")", ".", "get", "(", "0", ")", ";", "assertEquals", "(", "1", ",", "corpusGraph", ".", "getSCorpora", "(", ")", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"pcc2\"", ",", "corpusGraph", ".", "getSCorpora", "(", ")", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "1", ",", "corpusGraph", ".", "getSDocuments", "(", ")", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"4282\"", ",", "corpusGraph", ".", "getSDocuments", "(", ")", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testLayerNames", "(", ")", "{", "SDocumentGraph", "g", "=", "project", ".", "getSCorpusGraphs", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocuments", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocumentGraph", "(", ")", ";", "EList", "<", "SLayer", ">", "layers", "=", "g", ".", "getSLayers", "(", ")", ";", "ECollections", ".", "sort", "(", "layers", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "6", ",", "layers", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"dep\"", ",", "layers", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"exmaralda\"", ",", "layers", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"mmax\"", ",", "layers", ".", "get", "(", "2", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tiger\"", ",", "layers", ".", "get", "(", "3", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"token_merged\"", ",", "layers", ".", "get", "(", "4", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"urml\"", ",", "layers", ".", "get", "(", "5", ")", ".", "getSName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testLayerNodes", "(", ")", "{", "SDocumentGraph", "g", "=", "project", ".", "getSCorpusGraphs", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocuments", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocumentGraph", "(", ")", ";", "EList", "<", "SNode", ">", "n", "=", "g", ".", "getSLayerByName", "(", "\"exmaralda\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ";", "ECollections", ".", "sort", "(", "n", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "9", ",", "n", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "n", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan40\"", ",", "n", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan41\"", ",", "n", ".", "get", "(", "2", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan74\"", ",", "n", ".", "get", "(", "3", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan75\"", ",", "n", ".", "get", "(", "4", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan86\"", ",", "n", ".", "get", "(", "5", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan9\"", ",", "n", ".", "get", "(", "6", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan97\"", ",", "n", ".", "get", "(", "7", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "n", ".", "get", "(", "8", ")", ".", "getSName", "(", ")", ")", ";", "n", "=", "g", ".", "getSLayerByName", "(", "\"mmax\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ";", "ECollections", ".", "sort", "(", "n", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "5", ",", "n", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan121\"", ",", "n", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan124\"", ",", "n", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan151\"", ",", "n", ".", "get", "(", "2", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan152\"", ",", "n", ".", "get", "(", "3", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan153\"", ",", "n", ".", "get", "(", "4", ")", ".", "getSName", "(", ")", ")", ";", "n", "=", "g", ".", "getSLayerByName", "(", "\"tiger\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ";", "ECollections", ".", "sort", "(", "n", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "10", ",", "n", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"const_50\"", ",", "n", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_52\"", ",", "n", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_54\"", ",", "n", ".", "get", "(", "2", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_55\"", ",", "n", ".", "get", "(", "3", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_56\"", ",", "n", ".", "get", "(", "4", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_57\"", ",", "n", ".", "get", "(", "5", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_58\"", ",", "n", ".", "get", "(", "6", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_59\"", ",", "n", ".", "get", "(", "7", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_60\"", ",", "n", ".", "get", "(", "8", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_61\"", ",", "n", ".", "get", "(", "9", ")", ".", "getSName", "(", ")", ")", ";", "n", "=", "g", ".", "getSLayerByName", "(", "\"token_merged\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ";", "ECollections", ".", "sort", "(", "n", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "12", ",", "n", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "n", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "n", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_152\"", ",", "n", ".", "get", "(", "2", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_153\"", ",", "n", ".", "get", "(", "3", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_154\"", ",", "n", ".", "get", "(", "4", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "n", ".", "get", "(", "5", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "n", ".", "get", "(", "6", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_157\"", ",", "n", ".", "get", "(", "7", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_158\"", ",", "n", ".", "get", "(", "8", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_159\"", ",", "n", ".", "get", "(", "9", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "n", ".", "get", "(", "10", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_161\"", ",", "n", ".", "get", "(", "11", ")", ".", "getSName", "(", ")", ")", ";", "n", "=", "g", ".", "getSLayerByName", "(", "\"urml\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ";", "ECollections", ".", "sort", "(", "n", ",", "new", "NameComparator", "(", ")", ")", ";", "assertEquals", "(", "2", ",", "n", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan166\"", ",", "n", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan167\"", ",", "n", ".", "get", "(", "1", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "0", ",", "g", ".", "getSLayerByName", "(", "\"dep\"", ")", ".", "get", "(", "0", ")", ".", "getSNodes", "(", ")", ".", "size", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testLayerRelations", "(", ")", "{", "SDocumentGraph", "g", "=", "project", ".", "getSCorpusGraphs", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocuments", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocumentGraph", "(", ")", ";", "EList", "<", "SRelation", ">", "e", "=", "g", ".", "getSLayerByName", "(", "\"dep\"", ")", ".", "get", "(", "0", ")", ".", "getSRelations", "(", ")", ";", "ECollections", ".", "sort", "(", "e", ",", "new", "EdgeComparator", "(", ")", ")", ";", "assertEquals", "(", "9", ",", "e", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_152\"", ",", "e", ".", "get", "(", "1", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_153\"", ",", "e", ".", "get", "(", "1", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_154\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "4", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_157\"", ",", "e", ".", "get", "(", "4", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_157\"", ",", "e", ".", "get", "(", "5", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_158\"", ",", "e", ".", "get", "(", "5", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_158\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "7", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_159\"", ",", "e", ".", "get", "(", "7", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "8", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_161\"", ",", "e", ".", "get", "(", "8", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "e", "=", "g", ".", "getSLayerByName", "(", "\"exmaralda\"", ")", ".", "get", "(", "0", ")", ".", "getSRelations", "(", ")", ";", "ECollections", ".", "sort", "(", "e", ",", "new", "EdgeComparator", "(", ")", ")", ";", "assertEquals", "(", "30", ",", "e", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_154\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "1", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "e", ".", "get", "(", "1", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_157\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "4", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_158\"", ",", "e", ".", "get", "(", "4", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "5", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_159\"", ",", "e", ".", "get", "(", "5", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan10\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan40\"", ",", "e", ".", "get", "(", "7", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "7", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan40\"", ",", "e", ".", "get", "(", "8", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "8", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan41\"", ",", "e", ".", "get", "(", "9", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "e", ".", "get", "(", "9", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan74\"", ",", "e", ".", "get", "(", "10", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "10", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan74\"", ",", "e", ".", "get", "(", "11", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "11", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan75\"", ",", "e", ".", "get", "(", "12", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "e", ".", "get", "(", "12", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan86\"", ",", "e", ".", "get", "(", "13", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "13", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan86\"", ",", "e", ".", "get", "(", "14", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "14", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan9\"", ",", "e", ".", "get", "(", "15", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "15", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan9\"", ",", "e", ".", "get", "(", "16", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "16", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan9\"", ",", "e", ".", "get", "(", "17", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_152\"", ",", "e", ".", "get", "(", "17", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan97\"", ",", "e", ".", "get", "(", "18", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "18", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan97\"", ",", "e", ".", "get", "(", "19", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "19", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan97\"", ",", "e", ".", "get", "(", "20", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_152\"", ",", "e", ".", "get", "(", "20", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan97\"", ",", "e", ".", "get", "(", "21", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_153\"", ",", "e", ".", "get", "(", "21", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "22", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_154\"", ",", "e", ".", "get", "(", "22", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "23", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_155\"", ",", "e", ".", "get", "(", "23", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "24", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "24", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "25", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_157\"", ",", "e", ".", "get", "(", "25", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "26", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_158\"", ",", "e", ".", "get", "(", "26", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "27", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_159\"", ",", "e", ".", "get", "(", "27", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "28", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "28", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan98\"", ",", "e", ".", "get", "(", "29", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_161\"", ",", "e", ".", "get", "(", "29", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "e", "=", "g", ".", "getSLayerByName", "(", "\"mmax\"", ")", ".", "get", "(", "0", ")", ".", "getSRelations", "(", ")", ";", "ECollections", ".", "sort", "(", "e", ",", "new", "EdgeComparator", "(", ")", ")", ";", "assertEquals", "(", "14", ",", "e", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan151\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "2", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan151\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_151\"", ",", "e", ".", "get", "(", "3", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "e", "=", "g", ".", "getSLayerByName", "(", "\"tiger\"", ")", ".", "get", "(", "0", ")", ".", "getSRelations", "(", ")", ";", "ECollections", ".", "sort", "(", "e", ",", "new", "EdgeComparator", "(", ")", ")", ";", "assertEquals", "(", "34", ",", "e", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"const_59\"", ",", "e", ".", "get", "(", "19", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_160\"", ",", "e", ".", "get", "(", "19", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"const_61\"", ",", "e", ".", "get", "(", "33", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "33", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "e", "=", "g", ".", "getSLayerByName", "(", "\"urml\"", ")", ".", "get", "(", "0", ")", ".", "getSRelations", "(", ")", ";", "ECollections", ".", "sort", "(", "e", ",", "new", "EdgeComparator", "(", ")", ")", ";", "assertEquals", "(", "12", ",", "e", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan166\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_150\"", ",", "e", ".", "get", "(", "0", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"sSpan167\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "assertEquals", "(", "\"tok_156\"", ",", "e", ".", "get", "(", "6", ")", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "}", "@", "Test", "public", "void", "testRelationType", "(", ")", "{", "SDocumentGraph", "g", "=", "project", ".", "getSCorpusGraphs", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocuments", "(", ")", ".", "get", "(", "0", ")", ".", "getSDocumentGraph", "(", ")", ";", "for", "(", "SRelation", "r", ":", "g", ".", "getSRelations", "(", ")", ")", "{", "if", "(", "!", "(", "r", "instanceof", "STextualRelation", ")", ")", "{", "assertEquals", "(", "1", ",", "r", ".", "getSLayers", "(", ")", ".", "size", "(", ")", ")", ";", "String", "layerName", "=", "r", ".", "getSLayers", "(", ")", ".", "get", "(", "0", ")", ".", "getSName", "(", ")", ";", "if", "(", "\"exmaralda\"", ".", "equals", "(", "layerName", ")", "||", "\"urml\"", ".", "equals", "(", "layerName", ")", "||", "\"mmax\"", ".", "equals", "(", "layerName", ")", ")", "{", "assertTrue", "(", "\"\"", ",", "r", "instanceof", "SSpanningRelation", ")", ";", "}", "else", "if", "(", "\"dep\"", ".", "equals", "(", "layerName", ")", ")", "{", "assertTrue", "(", "\"\"", ",", "r", "instanceof", "SPointingRelation", ")", ";", "}", "else", "if", "(", "\"tiger\"", ".", "equals", "(", "layerName", ")", ")", "{", "assertTrue", "(", "\"\"", ",", "r", "instanceof", "SDominanceRelation", ")", ";", "}", "}", "}", "}", "public", "static", "class", "NameComparator", "implements", "Comparator", "<", "SNamedElement", ">", "{", "@", "Override", "public", "int", "compare", "(", "SNamedElement", "arg0", ",", "SNamedElement", "arg1", ")", "{", "return", "arg0", ".", "getSName", "(", ")", ".", "compareTo", "(", "arg1", ".", "getSName", "(", ")", ")", ";", "}", "}", "public", "static", "class", "EdgeComparator", "implements", "Comparator", "<", "SRelation", ">", "{", "@", "Override", "public", "int", "compare", "(", "SRelation", "arg0", ",", "SRelation", "arg1", ")", "{", "int", "result", "=", "arg0", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ".", "compareTo", "(", "arg1", ".", "getSSource", "(", ")", ".", "getSName", "(", ")", ")", ";", "if", "(", "result", "==", "0", ")", "{", "result", "=", "arg0", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ".", "compareTo", "(", "arg1", ".", "getSTarget", "(", ")", ".", "getSName", "(", ")", ")", ";", "}", "if", "(", "result", "==", "0", ")", "{", "String", "t0", "=", "arg0", ".", "getSTypes", "(", ")", "!=", "null", "&&", "arg0", ".", "getSTypes", "(", ")", ".", "size", "(", ")", ">", "0", "?", "arg0", ".", "getSTypes", "(", ")", ".", "get", "(", "0", ")", ":", "null", ";", "String", "t1", "=", "arg1", ".", "getSTypes", "(", ")", "!=", "null", "&&", "arg1", ".", "getSTypes", "(", ")", ".", "size", "(", ")", ">", "0", "?", "arg1", ".", "getSTypes", "(", ")", ".", "get", "(", "0", ")", ":", "null", ";", "if", "(", "t0", "==", "null", "&&", "t1", "==", "null", ")", "{", "result", "=", "0", ";", "}", "else", "if", "(", "t0", "==", "null", "&&", "t1", "!=", "null", ")", "{", "result", "=", "-", "1", ";", "}", "else", "if", "(", "t0", "!=", "null", "&&", "t1", "==", "null", ")", "{", "result", "=", "+", "1", ";", "}", "else", "{", "result", "=", "t0", ".", "compareTo", "(", "t1", ")", ";", "}", "}", "return", "result", ";", "}", "}", "}", "</s>" ]
8,912
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueLong", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "apache", ".", "commons", ".", "collections", ".", "Bag", ";", "import", "org", ".", "apache", ".", "commons", ".", "collections", ".", "bag", ".", "HashBag", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Spy", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "public", "class", "TestAbstractFromClauseGenerator", "{", "private", "AbstractFromClauseGenerator", "generator", ";", "@", "Spy", "private", "TableAccessStrategy", "tableAccessStrategy", "=", "new", "TableAccessStrategy", "(", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "generator", "=", "new", "AbstractFromClauseGenerator", "(", ")", "{", "@", "Override", "public", "String", "fromClause", "(", "QueryData", "queryData", ",", "List", "<", "QueryNode", ">", "alternative", ",", "String", "indent", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"\"", ")", ";", "}", "@", "Override", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", "}", ";", "}", "@", "Test", "public", "void", "shouldCreateTableAliasWithoutCount", "(", ")", "{", "long", "id", "=", "uniqueLong", "(", ")", ";", "QueryNode", "node", "=", "new", "QueryNode", "(", "id", ")", ";", "String", "table", "=", "uniqueString", "(", ")", ";", "String", "tableAlias", "=", "uniqueString", "(", ")", ";", "int", "count", "=", "1", ";", "setupTableAliases", "(", "table", ",", "tableAlias", ",", "count", ")", ";", "String", "alias", "=", "generator", ".", "tableAliasDefinition", "(", "node", ",", "table", ",", "count", ")", ";", "String", "expected", "=", "tableAlias", "+", "\"", "AS", "\"", "+", "tableAlias", "+", "id", ";", "assertThat", "(", "alias", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateTableAliasWithCount", "(", ")", "{", "long", "id", "=", "uniqueLong", "(", ")", ";", "QueryNode", "node", "=", "new", "QueryNode", "(", "id", ")", ";", "String", "table", "=", "uniqueString", "(", ")", ";", "String", "tableAlias", "=", "uniqueString", "(", ")", ";", "int", "count", "=", "uniqueInt", "(", ")", ";", "setupTableAliases", "(", "table", ",", "tableAlias", ",", "count", ")", ";", "String", "alias", "=", "generator", ".", "tableAliasDefinition", "(", "node", ",", "table", ",", "count", ")", ";", "String", "expected", "=", "tableAlias", "+", "\"", "AS", "\"", "+", "tableAlias", "+", "id", "+", "\"_\"", "+", "count", ";", "assertThat", "(", "alias", ",", "is", "(", "expected", ")", ")", ";", "}", "private", "void", "setupTableAliases", "(", "String", "table", ",", "String", "tableAlias", ",", "int", "count", ")", "{", "HashMap", "<", "String", ",", "String", ">", "tableAliases", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "tableAliases", ".", "put", "(", "table", ",", "tableAlias", ")", ";", "tableAccessStrategy", ".", "setTableAliases", "(", "tableAliases", ")", ";", "Bag", "tables", "=", "new", "HashBag", "(", ")", ";", "tables", ".", "add", "(", "tableAlias", ",", "count", ")", ";", "given", "(", "tableAccessStrategy", ".", "computeSourceTables", "(", ")", ")", ".", "willReturn", "(", "tables", ")", ";", "}", "}", "</s>" ]
8,913
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyString", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyInt", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "public", "class", "AbstractSolutionKeyTest", "{", "AbstractSolutionKey", "<", "Integer", ">", "key", "=", "new", "AbstractSolutionKey", "<", "Integer", ">", "(", ")", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "ResultSet", "resultSet", ";", "private", "static", "String", "idColumnName", "=", "uniqueString", "(", "3", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "key", ".", "setIdColumnName", "(", "idColumnName", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForInnerQuery", "(", ")", "{", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "idColumnName", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "index", "=", "uniqueInt", "(", "1", ",", "10", ")", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateInnerQueryColumns", "(", "tableAccessStrategy", ",", "index", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "nameAlias", "+", "\"", "AS", "\"", "+", "idColumnName", "+", "index", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnTheIdOfTheNode", "(", ")", "throws", "SQLException", "{", "Object", "expected", "=", "new", "Object", "(", ")", ";", "String", "idAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "columnName", "(", "NODE_TABLE", ",", "idColumnName", ")", ")", ".", "willReturn", "(", "idAlias", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "1", ")", ")", ".", "willReturn", "(", "expected", ")", ";", "given", "(", "resultSet", ".", "findColumn", "(", "idAlias", ")", ")", ".", "willReturn", "(", "1", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "idAlias", ")", ")", ".", "willReturn", "(", "expected", ")", ";", "Object", "actual", "=", "key", ".", "getNodeId", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfResultSetThrowsSqlExceptionInGetNodeId", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "getObject", "(", "anyString", "(", ")", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "anyInt", "(", ")", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "getNodeId", "(", "resultSet", ",", "tableAccessStrategy", ")", ";", "}", "}", "</s>" ]
8,914
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "nullValue", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Matchers", ".", "anyString", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "public", "class", "MultipleColumnsSolutionKeyTest", "{", "private", "MultipleColumnsSolutionKey", "<", "Integer", ">", "key", "=", "new", "MultipleColumnsSolutionKey", "<", "Integer", ">", "(", ")", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "ResultSet", "resultSet", ";", "private", "static", "String", "idColumnName", "=", "uniqueString", "(", "3", ")", ";", "private", "static", "String", "keyColumnName", "=", "uniqueString", "(", "3", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "key", ".", "setIdColumnName", "(", "idColumnName", ")", ";", "key", ".", "setKeyColumnName", "(", "keyColumnName", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateColumnsForOuterQuery", "(", ")", "{", "String", "nameAlias", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "\"solutions\"", ",", "idColumnName", ")", ")", ".", "willReturn", "(", "nameAlias", ")", ";", "int", "size", "=", "3", ";", "List", "<", "String", ">", "actual", "=", "key", ".", "generateOuterQueryColumns", "(", "tableAccessStrategy", ",", "size", ")", ";", "List", "<", "String", ">", "expected", "=", "asList", "(", "nameAlias", "+", "\"1\"", "+", "\"", "AS", "\"", "+", "keyColumnName", "+", "\"1\"", ",", "nameAlias", "+", "\"2\"", "+", "\"", "AS", "\"", "+", "keyColumnName", "+", "\"2\"", ",", "nameAlias", "+", "\"3\"", "+", "\"", "AS", "\"", "+", "keyColumnName", "+", "\"3\"", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRetreiveKeyFromResultSetAndValidateIt", "(", ")", "throws", "SQLException", "{", "int", "key1", "=", "uniqueInt", "(", "3", ")", ";", "int", "key2", "=", "uniqueInt", "(", "3", ")", ";", "int", "key3", "=", "uniqueInt", "(", "3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "key1", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willReturn", "(", "key2", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "3", ")", ")", ".", "willReturn", "(", "key3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "4", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "List", "<", "Integer", ">", "actual", "=", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "List", "<", "Integer", ">", "expected", "=", "asList", "(", "key1", ",", "key2", ",", "key3", ")", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalStateException", ".", "class", ")", "public", "void", "errorIfResultSetThrowsSqlExceptionInRetrieveKey", "(", ")", "throws", "SQLException", "{", "given", "(", "resultSet", ".", "getObject", "(", "anyString", "(", ")", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalNewKey", "(", ")", "throws", "SQLException", "{", "int", "key1", "=", "uniqueInt", "(", "1", ",", "3", ")", ";", "int", "key2", "=", "uniqueInt", "(", "4", ",", "6", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "key1", ",", "key2", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldRecognizeOldKey", "(", ")", "throws", "SQLException", "{", "String", "key1", "=", "uniqueString", "(", "3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "key1", ",", "key1", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "resultSet", ".", "next", "(", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "isNewKey", "(", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldSignalMatchedNodes", "(", ")", "throws", "SQLException", "{", "int", "[", "]", "keys", "=", "{", "uniqueInt", "(", "1", ",", "3", ")", ",", "uniqueInt", "(", "4", ",", "6", ")", ",", "uniqueInt", "(", "7", ",", "9", ")", "}", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "keys", "[", "0", "]", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willReturn", "(", "keys", "[", "1", "]", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "3", ")", ")", ".", "willReturn", "(", "keys", "[", "2", "]", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "4", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "{", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "keys", "[", "i", "]", ")", ",", "is", "(", "i", "+", "1", ")", ")", ";", "}", "}", "@", "Test", "public", "void", "shouldReturnNullForUnmatchedNodes", "(", ")", "throws", "SQLException", "{", "int", "key1", "=", "uniqueInt", "(", "1", ",", "3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "key1", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "assertThat", "(", "key", ".", "getMatchedNodeIndex", "(", "uniqueInt", "(", "4", ",", "6", ")", ")", ",", "is", "(", "nullValue", "(", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldCreateStringRepresentationOfKey", "(", ")", "throws", "SQLException", "{", "int", "key1", "=", "uniqueInt", "(", "3", ")", ";", "int", "key2", "=", "uniqueInt", "(", "3", ")", ";", "int", "key3", "=", "uniqueInt", "(", "3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "1", ")", ")", ".", "willReturn", "(", "key1", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "2", ")", ")", ".", "willReturn", "(", "key2", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "3", ")", ")", ".", "willReturn", "(", "key3", ")", ";", "given", "(", "resultSet", ".", "getObject", "(", "keyColumnName", "+", "4", ")", ")", ".", "willThrow", "(", "new", "SQLException", "(", ")", ")", ";", "key", ".", "retrieveKey", "(", "resultSet", ")", ";", "String", "actual", "=", "key", ".", "getCurrentKeyAsString", "(", ")", ";", "String", "expected", "=", "key1", "+", "\",\"", "+", "key2", "+", "\",\"", "+", "key3", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldReturnKeyArrayNameAsKeyColumn", "(", ")", "{", "int", "size", "=", "3", ";", "List", "<", "String", ">", "keyColumns", "=", "key", ".", "getKeyColumns", "(", "size", ")", ";", "assertThat", "(", "keyColumns", ",", "is", "(", "asList", "(", "keyColumnName", "+", "1", ",", "keyColumnName", "+", "2", ",", "keyColumnName", "+", "3", ")", ")", ")", ";", "}", "}", "</s>" ]
8,915
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "AbstractSqlGenerator", ".", "TABSTOP", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "newSet", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueAlphaString", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueInt", ";", "import", "static", "java", ".", "util", ".", "Arrays", ".", "asList", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "InjectMocks", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "public", "class", "TestAnnotateInnerQuerySqlGenerator", "{", "@", "InjectMocks", "private", "AnnotateInnerQuerySqlGenerator", "generator", "=", "new", "AnnotateInnerQuerySqlGenerator", "(", ")", "{", "@", "Override", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", "}", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "SolutionKey", "key", ";", "@", "Mock", "private", "QueryData", "queryData", ";", "@", "Mock", "private", "AnnotateQueryData", "annotateQueryData", ";", "private", "List", "<", "QueryNode", ">", "alternative", "=", "new", "ArrayList", "<", "QueryNode", ">", "(", ")", ";", "private", "static", "final", "String", "INDENT", "=", "TABSTOP", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "}", "@", "Test", "public", "void", "shouldGenerateSelectClause", "(", ")", "{", "alternative", "=", "Collections", ".", "nCopies", "(", "2", ",", "new", "QueryNode", "(", ")", ")", ";", "int", "left", "=", "uniqueInt", "(", "10", ")", ";", "int", "right", "=", "uniqueInt", "(", "20", ")", ";", "List", "extensions", "=", "new", "ArrayList", "<", "AnnotateQueryData", ">", "(", ")", ";", "extensions", ".", "add", "(", "annotateQueryData", ")", ";", "given", "(", "annotateQueryData", ".", "getLeft", "(", ")", ")", ".", "willReturn", "(", "left", ")", ";", "given", "(", "annotateQueryData", ".", "getRight", "(", ")", ")", ".", "willReturn", "(", "right", ")", ";", "given", "(", "queryData", ".", "getExtensions", "(", "AnnotateQueryData", ".", "class", ")", ")", ".", "willReturn", "(", "extensions", ")", ";", "String", "key1Column1", "=", "uniqueAlphaString", "(", ")", ";", "String", "key1Column2", "=", "uniqueAlphaString", "(", ")", ";", "String", "key2Column1", "=", "uniqueAlphaString", "(", ")", ";", "String", "key2Column2", "=", "uniqueAlphaString", "(", ")", ";", "given", "(", "key", ".", "generateInnerQueryColumns", "(", "tableAccessStrategy", ",", "1", ")", ")", ".", "willReturn", "(", "asList", "(", "key1Column1", ",", "key1Column2", ")", ")", ";", "given", "(", "key", ".", "generateInnerQueryColumns", "(", "tableAccessStrategy", ",", "2", ")", ")", ".", "willReturn", "(", "asList", "(", "key2Column1", ",", "key2Column2", ")", ")", ";", "String", "textRefAlias1", "=", "uniqueAlphaString", "(", ")", ";", "String", "leftTokenAlias1", "=", "uniqueAlphaString", "(", ")", ";", "String", "rightTokenAlias1", "=", "uniqueAlphaString", "(", ")", ";", "String", "textRefAlias2", "=", "uniqueAlphaString", "(", ")", ";", "String", "leftTokenAlias2", "=", "uniqueAlphaString", "(", ")", ";", "String", "rightTokenAlias2", "=", "uniqueAlphaString", "(", ")", ";", "String", "corpusRefAlias1", "=", "uniqueAlphaString", "(", ")", ";", "String", "corpusRefAlias2", "=", "uniqueAlphaString", "(", ")", ";", "String", "nodeNameAlias1", "=", "uniqueAlphaString", "(", ")", ";", "String", "nodeNameAlias2", "=", "uniqueAlphaString", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"text_ref\"", ")", ")", ".", "willReturn", "(", "textRefAlias1", ",", "textRefAlias2", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"left_token\"", ")", ")", ".", "willReturn", "(", "leftTokenAlias1", ",", "leftTokenAlias2", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"right_token\"", ")", ")", ".", "willReturn", "(", "rightTokenAlias1", ",", "rightTokenAlias2", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"corpus_ref\"", ")", ")", ".", "willReturn", "(", "corpusRefAlias1", ",", "corpusRefAlias2", ")", ";", "given", "(", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"name\"", ")", ")", ".", "willReturn", "(", "nodeNameAlias1", ",", "nodeNameAlias2", ")", ";", "String", "actual", "=", "generator", ".", "selectClause", "(", "queryData", ",", "alternative", ",", "INDENT", ")", ";", "String", "expected", "=", "\"DISTINCT\"", "+", "\"n\"", "+", "INDENT", "+", "TABSTOP", "+", "key1Column1", "+", "\",", "\"", "+", "key1Column2", "+", "\",", "\"", "+", "textRefAlias1", "+", "\"", "AS", "\"", "+", "\"text\"", "+", "1", "+", "\",", "\"", "+", "leftTokenAlias1", "+", "\"", "-", "\"", "+", "left", "+", "\"", "AS", "\"", "+", "\"min\"", "+", "1", "+", "\",", "\"", "+", "rightTokenAlias1", "+", "\"", "+", "\"", "+", "right", "+", "\"", "AS", "\"", "+", "\"max\"", "+", "1", "+", "\",", "\"", "+", "corpusRefAlias1", "+", "\"\"", "+", "nodeNameAlias1", "+", "\"", "AS", "name1,", "\"", "+", "\"n\"", "+", "INDENT", "+", "TABSTOP", "+", "key2Column1", "+", "\",", "\"", "+", "key2Column2", "+", "\",", "\"", "+", "textRefAlias2", "+", "\"", "AS", "\"", "+", "\"text\"", "+", "2", "+", "\",", "\"", "+", "leftTokenAlias2", "+", "\"", "-", "\"", "+", "left", "+", "\"", "AS", "\"", "+", "\"min\"", "+", "2", "+", "\",", "\"", "+", "rightTokenAlias2", "+", "\"", "+", "\"", "+", "right", "+", "\"", "AS", "\"", "+", "\"max\"", "+", "2", "+", "\",", "\"", "+", "corpusRefAlias2", "+", "\"\"", "+", "nodeNameAlias2", "+", "\"", "AS", "name2\"", ";", "assertThat", "(", "actual", ",", "is", "(", "expected", ")", ")", ";", "}", "}", "</s>" ]
8,916
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "COMPONENT_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "EDGE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "RANK_TABLE", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "model", ".", "QueryAnnotation", ";", "public", "class", "TestTableJoinsInFromClauseSqlGenerator", "{", "private", "TableJoinsInFromClauseSqlGenerator", "tableJoinsInFromClauseSqlGenerator", ";", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "private", "QueryNode", "node23", ";", "@", "Mock", "Set", "<", "QueryAnnotation", ">", "annotations", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "tableJoinsInFromClauseSqlGenerator", "=", "new", "TableJoinsInFromClauseSqlGenerator", "(", ")", "{", "@", "Override", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", "}", ";", "node23", "=", "new", "QueryNode", "(", "23L", ")", ";", "when", "(", "annotations", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "3", ")", ";", "tableAccessStrategy", "=", "new", "TableAccessStrategy", "(", "node23", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_component\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_annotation\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "fromClauseDefault", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesRank", "(", ")", "{", "node23", ".", "setRoot", "(", "true", ")", ";", "String", "expected", "=", "\"\"", "+", "\"", "\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesComponent", "(", ")", "{", "node23", ".", "setPartOfEdge", "(", "true", ")", ";", "String", "expected", "=", "\"\"", "+", "\"", "\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseUsesRankAndComponentAliasedToNode", "(", ")", "{", "node23", ".", "setRoot", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_node\"", ")", ";", "String", "expected", "=", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseNodeAnnotations", "(", ")", "{", "node23", ".", "setNodeAnnotations", "(", "annotations", ")", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseNodeAnnotationsAliasedToNode", "(", ")", "{", "node23", ".", "setNodeAnnotations", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"node_ref\"", ",", "\"id\"", ")", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseOfEdgeAnnotations", "(", ")", "{", "node23", ".", "setEdgeAnnotations", "(", "annotations", ")", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "Test", "public", "void", "fromClauseEdgeAnnotationsAliasedToNode", "(", ")", "{", "node23", ".", "setEdgeAnnotations", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"_rank\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"rank_ref\"", ",", "\"pre\"", ")", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "fromClauseTablesAliasedToNode", "(", ")", "{", "Set", "<", "QueryAnnotation", ">", "annotations1", "=", "mock", "(", "Set", ".", "class", ")", ";", "when", "(", "annotations1", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "2", ")", ";", "node23", ".", "setNodeAnnotations", "(", "annotations1", ")", ";", "Set", "<", "QueryAnnotation", ">", "annotations2", "=", "mock", "(", "Set", ".", "class", ")", ";", "when", "(", "annotations2", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "3", ")", ";", "node23", ".", "setEdgeAnnotations", "(", "annotations2", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"node_ref\"", ",", "\"id\"", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"_node\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "\"rank_ref\"", ",", "\"pre\"", ")", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertFromClause", "(", "expected", ")", ";", "}", "private", "void", "assertFromClause", "(", "String", "expected", ")", "{", "assertEquals", "(", "expected", ",", "tableJoinsInFromClauseSqlGenerator", ".", "fromClauseForNode", "(", "node23", ",", "false", ")", ")", ";", "}", "}", "</s>" ]
8,917
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "*", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "emptySetOf", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "newSet", ";", "import", "static", "annis", ".", "test", ".", "TestUtils", ".", "uniqueString", ";", "import", "java", ".", "sql", ".", "ResultSet", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "InjectMocks", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "org", ".", "mockito", ".", "Spy", ";", "import", "org", ".", "springframework", ".", "dao", ".", "DataAccessException", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "public", "class", "TestAbstractSqlGenerator", "{", "@", "InjectMocks", "private", "AbstractSqlGenerator", "<", "?", ">", "generator", ";", "@", "Mock", "private", "WithClauseSqlGenerator", "<", "QueryData", ">", "withClauseSqlGenerator", ";", "@", "Mock", "private", "SelectClauseSqlGenerator", "<", "QueryData", ">", "selectClauseSqlGenerator", ";", "@", "Mock", "private", "FromClauseSqlGenerator", "<", "QueryData", ">", "fromClauseSqlGenerator", ";", "@", "Spy", "private", "List", "<", "FromClauseSqlGenerator", "<", "QueryData", ">", ">", "fromClauseSqlGenerators", "=", "new", "ArrayList", "<", "FromClauseSqlGenerator", "<", "QueryData", ">", ">", "(", ")", ";", "@", "Mock", "private", "WhereClauseSqlGenerator", "<", "QueryData", ">", "whereClauseSqlGenerator", ";", "@", "Spy", "private", "List", "<", "WhereClauseSqlGenerator", "<", "QueryData", ">", ">", "whereClauseSqlGenerators", "=", "new", "ArrayList", "<", "WhereClauseSqlGenerator", "<", "QueryData", ">", ">", "(", ")", ";", "private", "QueryData", "queryData", "=", "new", "QueryData", "(", ")", ";", "private", "QueryNode", "annisNode", "=", "new", "QueryNode", "(", ")", ";", "private", "List", "<", "QueryNode", ">", "alternative", "=", "new", "ArrayList", "<", "QueryNode", ">", "(", ")", ";", "private", "List", "<", "List", "<", "QueryNode", ">", ">", "alternatives", "=", "new", "ArrayList", "<", "List", "<", "QueryNode", ">", ">", "(", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "generator", "=", "new", "AbstractSqlGenerator", "<", "Object", ">", "(", ")", "{", "@", "Override", "public", "Object", "extractData", "(", "ResultSet", "rs", ")", "throws", "SQLException", ",", "DataAccessException", "{", "throw", "new", "UnsupportedOperationException", "(", "\"\"", ")", ";", "}", "}", ";", "initMocks", "(", "this", ")", ";", "fromClauseSqlGenerators", ".", "add", "(", "fromClauseSqlGenerator", ")", ";", "whereClauseSqlGenerators", ".", "add", "(", "whereClauseSqlGenerator", ")", ";", "generator", ".", "setSelectClauseSqlGenerator", "(", "selectClauseSqlGenerator", ")", ";", "generator", ".", "setFromClauseSqlGenerators", "(", "fromClauseSqlGenerators", ")", ";", "generator", ".", "setWhereClauseSqlGenerators", "(", "whereClauseSqlGenerators", ")", ";", "generator", ".", "setWithClauseSqlGenerator", "(", "withClauseSqlGenerator", ")", ";", "alternative", ".", "add", "(", "annisNode", ")", ";", "alternatives", ".", "add", "(", "alternative", ")", ";", "queryData", ".", "setAlternatives", "(", "alternatives", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalArgumentException", ".", "class", ")", "public", "void", "errorIfZeroAlternativesInQueryData", "(", ")", "{", "alternatives", ".", "clear", "(", ")", ";", "generator", ".", "toSql", "(", "queryData", ")", ";", "}", "@", "Test", "public", "void", "shouldAppendSelectAndFromClauseForMinimalQuery", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldJoinMultipleFromClausesWithComma", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "fromClause2", "=", "uniqueString", "(", ")", ";", "FromClauseSqlGenerator", "fromClauseSqlGenerator2", "=", "mock", "(", "FromClauseSqlGenerator", ".", "class", ")", ";", "given", "(", "fromClauseSqlGenerator2", ".", "fromClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "fromClause2", ")", ";", "fromClauseSqlGenerators", ".", "add", "(", "fromClauseSqlGenerator2", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "=", "expected", ".", "substring", "(", "0", ",", "expected", ".", "length", "(", ")", "-", "1", ")", ";", "expected", "+=", "\",n\"", "+", "\"", "\"", "+", "fromClause2", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAppendWithClause", "(", ")", "{", "LinkedList", "<", "String", ">", "clauses", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "clauses", ".", "add", "(", "\"\"", ")", ";", "clauses", ".", "add", "(", "\"\"", ")", ";", "clauses", ".", "add", "(", "\"\"", ")", ";", "when", "(", "withClauseSqlGenerator", ".", "withClauses", "(", "any", "(", "QueryData", ".", "class", ")", ",", "anyListOf", "(", "QueryNode", ".", "class", ")", ",", "anyString", "(", ")", ")", ")", ".", "thenReturn", "(", "clauses", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "\"WITHn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAndWhereConditionsFromOneWhereClauseSqlGenerator", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "whereCondition1", "=", "\"a\"", "+", "uniqueString", "(", ")", ";", "String", "whereCondition2", "=", "\"b\"", "+", "uniqueString", "(", ")", ";", "given", "(", "whereClauseSqlGenerator", ".", "whereConditions", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "newSet", "(", "whereCondition1", ",", "whereCondition2", ")", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "+=", "\"WHEREn\"", "+", "\"", "\"", "+", "whereCondition1", "+", "\"", "ANDn\"", "+", "\"", "\"", "+", "whereCondition2", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAndWhereConditionsFromMultipeWhereClauseSqlGenerators", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "whereCondition1", "=", "\"a\"", "+", "uniqueString", "(", ")", ";", "String", "whereCondition2", "=", "\"b\"", "+", "uniqueString", "(", ")", ";", "given", "(", "whereClauseSqlGenerator", ".", "whereConditions", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "newSet", "(", "whereCondition1", ")", ")", ";", "WhereClauseSqlGenerator", "whereClauseSqlGenerator2", "=", "mock", "(", "WhereClauseSqlGenerator", ".", "class", ")", ";", "given", "(", "whereClauseSqlGenerator2", ".", "whereConditions", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "newSet", "(", "whereCondition2", ")", ")", ";", "whereClauseSqlGenerators", ".", "add", "(", "whereClauseSqlGenerator2", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "+=", "\"WHEREn\"", "+", "\"", "\"", "+", "whereCondition1", "+", "\"", "ANDn\"", "+", "\"", "\"", "+", "whereCondition2", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldNotAppendWhereConditionIfEmpty", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "given", "(", "whereClauseSqlGenerator", ".", "whereConditions", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "emptySetOf", "(", "String", ".", "class", ")", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAppendGroupByClause", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "groupBy", "=", "uniqueString", "(", ")", ";", "GroupByClauseSqlGenerator", "groupByClauseSqlGenerator", "=", "mock", "(", "GroupByClauseSqlGenerator", ".", "class", ")", ";", "generator", ".", "setGroupByClauseSqlGenerator", "(", "groupByClauseSqlGenerator", ")", ";", "given", "(", "groupByClauseSqlGenerator", ".", "groupByAttributes", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ")", ")", ".", "willReturn", "(", "groupBy", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "+=", "\"GROUP", "BY", "\"", "+", "groupBy", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAppendOrderByClause", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "orderBy", "=", "uniqueString", "(", ")", ";", "OrderByClauseSqlGenerator", "orderByClauseSqlGenerator", "=", "mock", "(", "OrderByClauseSqlGenerator", ".", "class", ")", ";", "generator", ".", "setOrderByClauseSqlGenerator", "(", "orderByClauseSqlGenerator", ")", ";", "given", "(", "orderByClauseSqlGenerator", ".", "orderByClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "orderBy", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "+=", "\"ORDER", "BY", "\"", "+", "orderBy", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldAppendLimitAndOffsetClause", "(", ")", "{", "String", "selectClause", "=", "uniqueString", "(", ")", ";", "String", "fromClause", "=", "uniqueString", "(", ")", ";", "setupSelectAndFromClause", "(", "selectClause", ",", "fromClause", ")", ";", "String", "limitOffset", "=", "uniqueString", "(", ")", ";", "LimitOffsetClauseSqlGenerator", "limitOffsetClauseSqlGenerator", "=", "mock", "(", "LimitOffsetClauseSqlGenerator", ".", "class", ")", ";", "generator", ".", "setLimitOffsetClauseSqlGenerator", "(", "limitOffsetClauseSqlGenerator", ")", ";", "given", "(", "limitOffsetClauseSqlGenerator", ".", "limitOffsetClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "limitOffset", ")", ";", "String", "sql", "=", "generator", ".", "toSql", "(", "queryData", ")", ";", "String", "expected", "=", "createMinimalSqlStatement", "(", "selectClause", ",", "fromClause", ")", ";", "expected", "+=", "limitOffset", "+", "\"n\"", ";", "assertThat", "(", "sql", ",", "is", "(", "expected", ")", ")", ";", "}", "private", "void", "setupSelectAndFromClause", "(", "String", "selectClause", ",", "String", "fromClause", ")", "{", "given", "(", "selectClauseSqlGenerator", ".", "selectClause", "(", "eq", "(", "queryData", ")", ",", "anyListOf", "(", "QueryNode", ".", "class", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "selectClause", ")", ";", "given", "(", "fromClauseSqlGenerator", ".", "fromClause", "(", "eq", "(", "queryData", ")", ",", "eq", "(", "alternative", ")", ",", "anyString", "(", ")", ")", ")", ".", "willReturn", "(", "fromClause", ")", ";", "}", "private", "String", "createMinimalSqlStatement", "(", "String", "selectClause", ",", "String", "fromClause", ")", "{", "String", "expected", "=", "\"SELECT", "\"", "+", "selectClause", "+", "\"n\"", "+", "\"FROM\"", "+", "\"n\"", "+", "\"", "\"", "+", "fromClause", "+", "\"n\"", ";", "return", "expected", ";", "}", "}", "</s>" ]
8,918
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "COMPONENT_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "EDGE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_ANNOTATION_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "NODE_TABLE", ";", "import", "static", "annis", ".", "sqlgen", ".", "TableAccessStrategy", ".", "RANK_TABLE", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "mock", ";", "import", "static", "org", ".", "mockito", ".", "Mockito", ".", "when", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "apache", ".", "commons", ".", "collections", ".", "Bag", ";", "import", "org", ".", "hamcrest", ".", "Description", ";", "import", "org", ".", "hamcrest", ".", "Matcher", ";", "import", "org", ".", "hamcrest", ".", "TypeSafeMatcher", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "model", ".", "QueryAnnotation", ";", "public", "class", "TestTableAccessStrategy", "{", "private", "Map", "<", "String", ",", "Integer", ">", "expected", ";", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "QueryNode", "node23", ";", "@", "Mock", "private", "Set", "<", "QueryAnnotation", ">", "annotations", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "when", "(", "node23", ".", "getId", "(", ")", ")", ".", "thenReturn", "(", "23L", ")", ";", "when", "(", "annotations", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "3", ")", ";", "tableAccessStrategy", "=", "new", "TableAccessStrategy", "(", "node23", ")", ";", "expected", "=", "new", "HashMap", "<", "String", ",", "Integer", ">", "(", ")", ";", "expected", ".", "put", "(", "NODE_TABLE", ",", "0", ")", ";", "expected", ".", "put", "(", "RANK_TABLE", ",", "0", ")", ";", "expected", ".", "put", "(", "COMPONENT_TABLE", ",", "0", ")", ";", "expected", ".", "put", "(", "NODE_ANNOTATION_TABLE", ",", "0", ")", ";", "expected", ".", "put", "(", "EDGE_ANNOTATION_TABLE", ",", "0", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesFreshNode", "(", ")", "{", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesRootNode", "(", ")", "{", "when", "(", "node23", ".", "isRoot", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "RANK_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "COMPONENT_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesRootNodeComponentAliasedToRank", "(", ")", "{", "when", "(", "node23", ".", "isRoot", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "RANK_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "RANK_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesRootNodeRankAndComponentAliasedToStruct", "(", ")", "{", "when", "(", "node23", ".", "isRoot", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesPartOfEdge", "(", ")", "{", "when", "(", "node23", ".", "isPartOfEdge", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "RANK_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "COMPONENT_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesPartOfEdgeRankAliasedToStruct", "(", ")", "{", "when", "(", "node23", ".", "isPartOfEdge", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "NODE_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesNodeAnnotations", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "NODE_ANNOTATION_TABLE", ",", "3", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesNodeAnnotationsAliasedToStruct", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "3", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesEdgeAnnotations", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "RANK_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "COMPONENT_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "EDGE_ANNOTATION_TABLE", ",", "3", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesEdgeAnnotationsAliasedToRank", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "RANK_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "RANK_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "1", ")", ";", "expectTableCount", "(", "RANK_TABLE", ",", "3", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesEdgeAnnotationsAliasedToStruct", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "3", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "computeSourceTablesNodeAndEdgeAnnotationsAliasedToStruct", "(", ")", "{", "when", "(", "node23", ".", "isRoot", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "when", "(", "node23", ".", "isPartOfEdge", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "COMPONENT_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "expectTableCount", "(", "NODE_TABLE", ",", "6", ")", ";", "assertUsedTables", "(", ")", ";", "}", "@", "Test", "public", "void", "tableName", "(", ")", "{", "assertEquals", "(", "\"foo\"", ",", "tableAccessStrategy", ".", "tableName", "(", "\"foo\"", ")", ")", ";", "}", "@", "Test", "public", "void", "tableNameAliased", "(", ")", "{", "tableAccessStrategy", ".", "addTableAlias", "(", "\"foo\"", ",", "\"FOO\"", ")", ";", "assertEquals", "(", "\"FOO\"", ",", "tableAccessStrategy", ".", "tableName", "(", "\"foo\"", ")", ")", ";", "}", "@", "Test", "public", "void", "columnName", "(", ")", "{", "assertEquals", "(", "\"bar\"", ",", "tableAccessStrategy", ".", "columnName", "(", "\"foo\"", ",", "\"bar\"", ")", ")", ";", "}", "@", "Test", "public", "void", "columnNameAliased", "(", ")", "{", "tableAccessStrategy", ".", "addColumnAlias", "(", "\"foo\"", ",", "\"bar\"", ",", "\"BAR\"", ")", ";", "assertEquals", "(", "\"BAR\"", ",", "tableAccessStrategy", ".", "columnName", "(", "\"foo\"", ",", "\"bar\"", ")", ")", ";", "}", "@", "Test", "public", "void", "aliasedTableStruct", "(", ")", "{", "assertSingleTable", "(", "NODE_TABLE", ")", ";", "}", "@", "Test", "public", "void", "aliasedTableNodeAnnotations", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "assertMultipleTables", "(", "NODE_ANNOTATION_TABLE", ",", "3", ")", ";", "}", "@", "Test", "public", "void", "aliasedTableEdgeAnnotations", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "assertMultipleTables", "(", "EDGE_ANNOTATION_TABLE", ",", "3", ")", ";", "}", "@", "Test", "public", "void", "aliasedTableNodeAndEdgeAnnotationsDifferentTable", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "assertMultipleTables", "(", "NODE_ANNOTATION_TABLE", ",", "3", ")", ";", "assertMultipleTables", "(", "EDGE_ANNOTATION_TABLE", ",", "3", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "aliasedTableNodeAndEdgeAnnotationsSameTable", "(", ")", "{", "final", "int", "NODE_ANNOTATION_COUNT", "=", "2", ";", "Set", "<", "QueryAnnotation", ">", "nodeAnnotations", "=", "mock", "(", "Set", ".", "class", ")", ";", "when", "(", "nodeAnnotations", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "NODE_ANNOTATION_COUNT", ")", ";", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "nodeAnnotations", ")", ";", "final", "int", "EDGE_ANNOTATION_COUNT", "=", "3", ";", "Set", "<", "QueryAnnotation", ">", "edgeAnnotations", "=", "mock", "(", "Set", ".", "class", ")", ";", "when", "(", "edgeAnnotations", ".", "size", "(", ")", ")", ".", "thenReturn", "(", "EDGE_ANNOTATION_COUNT", ")", ";", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "edgeAnnotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "EDGE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "assertMultipleAliasedTables", "(", "NODE_ANNOTATION_TABLE", ",", "NODE_ANNOTATION_COUNT", ",", "NODE_TABLE", ",", "0", ")", ";", "assertMultipleAliasedTables", "(", "EDGE_ANNOTATION_TABLE", ",", "EDGE_ANNOTATION_COUNT", ",", "NODE_TABLE", ",", "NODE_ANNOTATION_COUNT", "-", "1", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalArgumentException", ".", "class", ")", "public", "void", "onlyOneStructTable", "(", ")", "{", "tableAccessStrategy", ".", "aliasedTable", "(", "NODE_TABLE", ",", "2", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalArgumentException", ".", "class", ")", "public", "void", "onlyOneRankTable", "(", ")", "{", "tableAccessStrategy", ".", "aliasedTable", "(", "RANK_TABLE", ",", "2", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalArgumentException", ".", "class", ")", "public", "void", "nodeAnnotationsUnknownAnnotation", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "aliasedTable", "(", "NODE_ANNOTATION_TABLE", ",", "4", ")", ";", "}", "@", "Test", "(", "expected", "=", "IllegalArgumentException", ".", "class", ")", "public", "void", "edgeAnnotationsUnknownAnnotation", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "aliasedTable", "(", "EDGE_ANNOTATION_TABLE", ",", "4", ")", ";", "}", "@", "Test", "public", "void", "aliasedColumn", "(", ")", "{", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_TABLE", ",", "\"bar\"", ",", "\"BAR\"", ")", ";", "assertEquals", "(", "NODE_TABLE", "+", "\"23.BAR\"", ",", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"bar\"", ")", ")", ";", "}", "@", "Test", "public", "void", "aliasedColumnManyTables", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "tableAccessStrategy", ".", "addTableAlias", "(", "NODE_ANNOTATION_TABLE", ",", "NODE_TABLE", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_TABLE", ",", "\"foo\"", ",", "\"FOO\"", ")", ";", "tableAccessStrategy", ".", "addColumnAlias", "(", "NODE_ANNOTATION_TABLE", ",", "\"bar\"", ",", "\"BAR\"", ")", ";", "assertEquals", "(", "NODE_TABLE", "+", "\"23_1.FOO\"", ",", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_TABLE", ",", "\"foo\"", ")", ")", ";", "assertEquals", "(", "NODE_TABLE", "+", "\"23_1.BAR\"", ",", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_ANNOTATION_TABLE", ",", "\"bar\"", ",", "1", ")", ")", ";", "assertEquals", "(", "NODE_TABLE", "+", "\"23_2.BAR\"", ",", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_ANNOTATION_TABLE", ",", "\"bar\"", ",", "2", ")", ")", ";", "assertEquals", "(", "NODE_TABLE", "+", "\"23_3.BAR\"", ",", "tableAccessStrategy", ".", "aliasedColumn", "(", "NODE_ANNOTATION_TABLE", ",", "\"bar\"", ",", "3", ")", ")", ";", "}", "@", "Test", "public", "void", "usedTablesFreshNode", "(", ")", "{", "assertThat", "(", "tableAccessStrategy", ".", "usesEdgeAnnotationTable", "(", ")", ",", "is", "(", "false", ")", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesNodeAnnotationTable", "(", ")", ",", "is", "(", "false", ")", ")", ";", "}", "@", "Test", "public", "void", "usesRankTableEdge", "(", ")", "{", "when", "(", "node23", ".", "isPartOfEdge", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "usesRankTableRoot", "(", ")", "{", "when", "(", "node23", ".", "isRoot", "(", ")", ")", ".", "thenReturn", "(", "true", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "usedTableEdgeAnnotation", "(", ")", "{", "when", "(", "node23", ".", "getEdgeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ",", "is", "(", "true", ")", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesEdgeAnnotationTable", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "usedTableNodeAnnotation", "(", ")", "{", "when", "(", "node23", ".", "getNodeAnnotations", "(", ")", ")", ".", "thenReturn", "(", "annotations", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "usesNodeAnnotationTable", "(", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "isMaterializedTrue", "(", ")", "{", "tableAccessStrategy", ".", "addTableAlias", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ";", "assertThat", "(", "tableAccessStrategy", ".", "isMaterialized", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "isMaterializedFalse", "(", ")", "{", "assertThat", "(", "tableAccessStrategy", ".", "isMaterialized", "(", "RANK_TABLE", ",", "NODE_TABLE", ")", ",", "is", "(", "false", ")", ")", ";", "}", "private", "void", "expectTableCount", "(", "String", "table", ",", "int", "count", ")", "{", "expected", ".", "put", "(", "table", ",", "count", ")", ";", "}", "private", "void", "assertUsedTables", "(", ")", "{", "assertThat", "(", "tableAccessStrategy", ".", "computeSourceTables", "(", ")", ",", "hasTables", "(", "expected", ")", ")", ";", "}", "private", "void", "assertSingleTable", "(", "String", "table", ")", "{", "assertThat", "(", "tableAccessStrategy", ".", "aliasedTable", "(", "table", ",", "1", ")", ",", "is", "(", "table", "+", "node23", ".", "getId", "(", ")", ")", ")", ";", "}", "private", "void", "assertMultipleTables", "(", "String", "table", ",", "int", "count", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "count", ";", "++", "i", ")", "assertThat", "(", "tableAccessStrategy", ".", "aliasedTable", "(", "table", ",", "i", ")", ",", "is", "(", "table", "+", "node23", ".", "getId", "(", ")", "+", "\"_\"", "+", "i", ")", ")", ";", "}", "private", "void", "assertMultipleAliasedTables", "(", "String", "table", ",", "int", "count", ",", "String", "alias", ",", "int", "offset", ")", "{", "for", "(", "int", "i", "=", "2", ";", "i", "<=", "count", ";", "++", "i", ")", "assertThat", "(", "tableAccessStrategy", ".", "aliasedTable", "(", "table", ",", "i", ")", ",", "is", "(", "alias", "+", "node23", ".", "getId", "(", ")", "+", "\"_\"", "+", "(", "i", "+", "offset", ")", ")", ")", ";", "}", "private", "Matcher", "<", "Bag", ">", "hasTables", "(", "final", "Map", "<", "String", ",", "Integer", ">", "expectedTables", ")", "{", "return", "new", "TypeSafeMatcher", "<", "Bag", ">", "(", ")", "{", "@", "Override", "public", "boolean", "matchesSafely", "(", "Bag", "item", ")", "{", "for", "(", "String", "table", ":", "expectedTables", ".", "keySet", "(", ")", ")", "{", "if", "(", "item", ".", "getCount", "(", "table", ")", "!=", "expectedTables", ".", "get", "(", "table", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "public", "void", "describeTo", "(", "Description", "description", ")", "{", "description", ".", "appendValue", "(", "expectedTables", ")", ";", "}", "}", ";", "}", "}", "</s>" ]
8,919
[ "<s>", "package", "annis", ".", "sqlgen", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "not", ";", "import", "static", "org", ".", "hamcrest", ".", "text", ".", "StringStartsWith", ".", "startsWith", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "org", ".", "mockito", ".", "BDDMockito", ".", "given", ";", "import", "static", "org", ".", "mockito", ".", "MockitoAnnotations", ".", "initMocks", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "mockito", ".", "Mock", ";", "import", "annis", ".", "model", ".", "QueryNode", ";", "import", "annis", ".", "ql", ".", "parser", ".", "QueryData", ";", "public", "class", "TestFindSqlGenerator", "{", "private", "FindSqlGenerator", "generator", ";", "@", "Mock", "private", "TableAccessStrategy", "tableAccessStrategy", ";", "@", "Mock", "private", "QueryData", "queryData", ";", "@", "Mock", "private", "QueryNode", "queryNode", ";", "private", "ArrayList", "<", "QueryNode", ">", "alternative", "=", "new", "ArrayList", "<", "QueryNode", ">", "(", ")", ";", "@", "Before", "public", "void", "setup", "(", ")", "{", "initMocks", "(", "this", ")", ";", "generator", "=", "new", "FindSqlGenerator", "(", ")", "{", "protected", "TableAccessStrategy", "createTableAccessStrategy", "(", ")", "{", "return", "tableAccessStrategy", ";", "}", "}", ";", "}", "private", "void", "setupQueryData", "(", ")", "{", "alternative", ".", "add", "(", "queryNode", ")", ";", "given", "(", "queryData", ".", "getMaxWidth", "(", ")", ")", ".", "willReturn", "(", "1", ")", ";", "}", "@", "Test", "public", "void", "shouldNotOptimizeDistinct", "(", ")", "{", "generator", ".", "setOptimizeDistinct", "(", "false", ")", ";", "setupQueryData", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ")", ".", "willReturn", "(", "false", ")", ";", "String", "actual", "=", "generator", ".", "selectClause", "(", "queryData", ",", "alternative", ",", "\"\"", ")", ";", "assertThat", "(", "actual", ",", "startsWith", "(", "\"DISTINCT\"", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldSkipDistinctIfOnlyNodeTablesAreUsed", "(", ")", "{", "generator", ".", "setOptimizeDistinct", "(", "true", ")", ";", "setupQueryData", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ")", ".", "willReturn", "(", "false", ")", ";", "String", "actual", "=", "generator", ".", "selectClause", "(", "queryData", ",", "alternative", ",", "\"\"", ")", ";", "assertThat", "(", "actual", ",", "not", "(", "startsWith", "(", "\"DISTINCT\"", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "shouldUseDistinctIfEdgeTablesAreUsed", "(", ")", "{", "generator", ".", "setOptimizeDistinct", "(", "true", ")", ";", "setupQueryData", "(", ")", ";", "given", "(", "tableAccessStrategy", ".", "usesRankTable", "(", ")", ")", ".", "willReturn", "(", "true", ")", ";", "String", "actual", "=", "generator", ".", "selectClause", "(", "queryData", ",", "alternative", ",", "\"\"", ")", ";", "assertThat", "(", "actual", ",", "startsWith", "(", "\"DISTINCT\"", ")", ")", ";", "}", "}", "</s>" ]
8,920
[ "<s>", "package", "annis", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "not", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "nullValue", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "sameInstance", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "java", ".", "io", ".", "PrintStream", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "BeforeClass", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "TestAnnisBaseRunner", "{", "public", "static", "class", "MockAnnisRunner", "extends", "AnnisBaseRunner", "{", "boolean", "interactive", "=", "false", ";", "String", "args", ";", "@", "Override", "protected", "void", "runInteractive", "(", ")", "{", "interactive", "=", "true", ";", "}", "public", "void", "doKnownCommand", "(", "String", "args", ")", "{", "this", ".", "args", "=", "args", ";", "}", "}", ";", "private", "MockAnnisRunner", "instance", ";", "@", "Before", "public", "void", "setupRunnerInstance", "(", ")", "{", "instance", "=", "(", "MockAnnisRunner", ")", "MockAnnisRunner", ".", "getInstance", "(", "\"\"", ",", "false", ",", "\"\"", ")", ";", "}", "@", "Test", "public", "void", "freshInstanceOutIsSystemOut", "(", ")", "{", "PrintStream", "out", "=", "instance", ".", "getOut", "(", ")", ";", "assertThat", "(", "out", ",", "is", "(", "not", "(", "nullValue", "(", ")", ")", ")", ")", ";", "assertThat", "(", "out", ",", "is", "(", "sameInstance", "(", "System", ".", "out", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "runInteractive", "(", ")", "{", "assertThat", "(", "instance", ".", "interactive", ",", "is", "(", "false", ")", ")", ";", "String", "[", "]", "args", "=", "{", "}", ";", "instance", ".", "run", "(", "args", ")", ";", "assertThat", "(", "instance", ".", "interactive", ",", "is", "(", "true", ")", ")", ";", "}", "@", "Test", "public", "void", "runKnownCommand", "(", ")", "{", "assertThat", "(", "instance", ".", "args", ",", "is", "(", "nullValue", "(", ")", ")", ")", ";", "String", "[", "]", "args", "=", "{", "\"\"", "}", ";", "instance", ".", "run", "(", "args", ")", ";", "assertThat", "(", "instance", ".", "args", ",", "is", "(", "\"arg1", "arg2\"", ")", ")", ";", "}", "@", "Test", "(", "expected", "=", "UsageException", ".", "class", ")", "public", "void", "runCommandUnknownCommand", "(", ")", "{", "instance", ".", "runCommand", "(", "\"\"", ",", "\"\"", ")", ";", "}", "}", "</s>" ]
8,921
[ "<s>", "package", "annis", ".", "utils", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "TestUtils", "{", "@", "Test", "public", "void", "min", "(", ")", "{", "List", "<", "Long", ">", "values", "=", "Arrays", ".", "asList", "(", "23L", ",", "42L", ",", "99L", ")", ";", "assertThat", "(", "Utils", ".", "min", "(", "values", ")", ",", "is", "(", "\"23\"", ")", ")", ";", "}", "@", "Test", "public", "void", "max", "(", ")", "{", "List", "<", "Long", ">", "values", "=", "Arrays", ".", "asList", "(", "23L", ",", "42L", ",", "99L", ")", ";", "assertThat", "(", "Utils", ".", "max", "(", "values", ")", ",", "is", "(", "\"99\"", ")", ")", ";", "}", "@", "Test", "public", "void", "avg", "(", ")", "{", "List", "<", "Long", ">", "values", "=", "Arrays", ".", "asList", "(", "23L", ",", "42L", ",", "99L", ")", ";", "assertThat", "(", "Utils", ".", "avg", "(", "values", ")", ",", "is", "(", "\"54\"", ")", ")", ";", "}", "}", "</s>" ]
8,922
[ "<s>", "package", "annis", ".", "utils", ";", "import", "annis", ".", "AnnisXmlContextLoader", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "sql", ".", "SQLException", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "junit", ".", "After", ";", "import", "org", ".", "junit", ".", "AfterClass", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "BeforeClass", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "import", "org", ".", "springframework", ".", "beans", ".", "factory", ".", "annotation", ".", "Autowired", ";", "import", "org", ".", "springframework", ".", "test", ".", "context", ".", "ContextConfiguration", ";", "import", "org", ".", "springframework", ".", "test", ".", "context", ".", "junit4", ".", "SpringJUnit4ClassRunner", ";", "import", "annis", ".", "model", ".", "AnnisNode", ";", "import", "annis", ".", "model", ".", "Annotation", ";", "import", "annis", ".", "model", ".", "AnnotationGraph", ";", "import", "annis", ".", "model", ".", "Edge", ";", "import", "annis", ".", "sqlgen", ".", "*", ";", "import", "annis", ".", "test", ".", "CsvResultSetProvider", ";", "import", "de", ".", "hu_berlin", ".", "german", ".", "korpling", ".", "saltnpepper", ".", "salt", ".", "saltCommon", ".", "SaltProject", ";", "import", "org", ".", "springframework", ".", "context", ".", "annotation", ".", "PropertySource", ";", "@", "RunWith", "(", "SpringJUnit4ClassRunner", ".", "class", ")", "@", "ContextConfiguration", "(", "locations", "=", "{", "\"\"", "}", ",", "loader", "=", "AnnisXmlContextLoader", ".", "class", ")", "public", "class", "LegacyGraphConverterTest", "{", "@", "Autowired", "AomAnnotateExtractor", "aomSqlGen", ";", "public", "LegacyGraphConverterTest", "(", ")", "{", "}", "@", "BeforeClass", "public", "static", "void", "setUpClass", "(", ")", "throws", "Exception", "{", "}", "@", "AfterClass", "public", "static", "void", "tearDownClass", "(", ")", "throws", "Exception", "{", "}", "@", "Before", "public", "void", "setUp", "(", ")", "{", "}", "@", "After", "public", "void", "tearDown", "(", ")", "{", "}", "@", "Test", "public", "void", "testConvertToAOM", "(", ")", "throws", "SQLException", "{", "SaltAnnotateExtractor", "saltExtractor", "=", "new", "SaltAnnotateExtractor", "(", ")", "{", "@", "Override", "protected", "SolutionKey", "<", "?", ">", "createSolutionKey", "(", ")", "{", "PostgreSqlArraySolutionKey", "<", "Long", ">", "key", "=", "new", "PostgreSqlArraySolutionKey", "<", "Long", ">", "(", ")", ";", "key", ".", "setKeyColumnName", "(", "\"key\"", ")", ";", "key", ".", "setIdColumnName", "(", "\"id\"", ")", ";", "return", "key", ";", "}", "}", ";", "CorpusPathExtractor", "corpusPathExtractor", "=", "new", "ArrayCorpusPathExtractor", "(", ")", ";", "saltExtractor", ".", "setCorpusPathExtractor", "(", "corpusPathExtractor", ")", ";", "TestAnnotateSqlGenerator", ".", "setupOuterQueryFactsTableColumnAliases", "(", "saltExtractor", ")", ";", "SaltProject", "p", "=", "saltExtractor", ".", "extractData", "(", "new", "CsvResultSetProvider", "(", "annis", ".", "sqlgen", ".", "SaltAnnotateExtractorTest", ".", "class", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ".", "getResultSet", "(", ")", ")", ";", "List", "<", "AnnotationGraph", ">", "expected", "=", "aomSqlGen", ".", "extractData", "(", "new", "CsvResultSetProvider", "(", "annis", ".", "sqlgen", ".", "SaltAnnotateExtractorTest", ".", "class", ".", "getResourceAsStream", "(", "\"\"", ")", ")", ".", "getResultSet", "(", ")", ")", ";", "List", "<", "AnnotationGraph", ">", "result", "=", "LegacyGraphConverter", ".", "convertToAOM", "(", "p", ")", ";", "assertEquals", "(", "expected", ".", "size", "(", ")", ",", "result", ".", "size", "(", ")", ")", ";", "Iterator", "<", "AnnotationGraph", ">", "itGraphExpected", "=", "expected", ".", "iterator", "(", ")", ";", "Iterator", "<", "AnnotationGraph", ">", "itGraphResult", "=", "result", ".", "iterator", "(", ")", ";", "while", "(", "itGraphExpected", ".", "hasNext", "(", ")", "&&", "itGraphResult", ".", "hasNext", "(", ")", ")", "{", "AnnotationGraph", "graphExpected", "=", "itGraphExpected", ".", "next", "(", ")", ";", "AnnotationGraph", "graphResult", "=", "itGraphResult", ".", "next", "(", ")", ";", "List", "<", "AnnisNode", ">", "nodeListExpected", "=", "graphExpected", ".", "getNodes", "(", ")", ";", "List", "<", "AnnisNode", ">", "nodeListResult", "=", "graphResult", ".", "getNodes", "(", ")", ";", "assertEquals", "(", "nodeListExpected", ".", "size", "(", ")", ",", "nodeListResult", ".", "size", "(", ")", ")", ";", "Collections", ".", "sort", "(", "nodeListExpected", ",", "new", "Comparator", "<", "AnnisNode", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "AnnisNode", "arg0", ",", "AnnisNode", "arg1", ")", "{", "return", "Long", ".", "valueOf", "(", "arg0", ".", "getId", "(", ")", ")", ".", "compareTo", "(", "Long", ".", "valueOf", "(", "arg1", ".", "getId", "(", ")", ")", ")", ";", "}", "}", ")", ";", "Collections", ".", "sort", "(", "nodeListResult", ",", "new", "Comparator", "<", "AnnisNode", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "AnnisNode", "arg0", ",", "AnnisNode", "arg1", ")", "{", "return", "Long", ".", "valueOf", "(", "arg0", ".", "getId", "(", ")", ")", ".", "compareTo", "(", "Long", ".", "valueOf", "(", "arg1", ".", "getId", "(", ")", ")", ")", ";", "}", "}", ")", ";", "Iterator", "<", "AnnisNode", ">", "itNodeExpected", "=", "nodeListExpected", ".", "iterator", "(", ")", ";", "Iterator", "<", "AnnisNode", ">", "itNodeResult", "=", "nodeListResult", ".", "iterator", "(", ")", ";", "while", "(", "itNodeExpected", ".", "hasNext", "(", ")", "&&", "itNodeResult", ".", "hasNext", "(", ")", ")", "{", "checkAnnisNodeEqual", "(", "itNodeExpected", ".", "next", "(", ")", ",", "itNodeResult", ".", "next", "(", ")", ")", ";", "}", "}", "}", "private", "void", "checkAnnisNodeEqual", "(", "AnnisNode", "n1", ",", "AnnisNode", "n2", ")", "{", "checkAnnotationSetEqual", "(", "n1", ".", "getNodeAnnotations", "(", ")", ",", "n2", ".", "getNodeAnnotations", "(", ")", ")", ";", "checkAnnotationSetEqual", "(", "n1", ".", "getEdgeAnnotations", "(", ")", ",", "n2", ".", "getEdgeAnnotations", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getCorpus", "(", ")", ",", "n2", ".", "getCorpus", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getId", "(", ")", ",", "n2", ".", "getId", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getLeft", "(", ")", ",", "n2", ".", "getLeft", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getLeftToken", "(", ")", ",", "n2", ".", "getLeftToken", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getMatchedNodeInQuery", "(", ")", ",", "n2", ".", "getMatchedNodeInQuery", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getName", "(", ")", ",", "n2", ".", "getName", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getNamespace", "(", ")", ",", "n2", ".", "getNamespace", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getRight", "(", ")", ",", "n2", ".", "getRight", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getRightToken", "(", ")", ",", "n2", ".", "getRightToken", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getSpannedText", "(", ")", ",", "n2", ".", "getSpannedText", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getTextId", "(", ")", ",", "n2", ".", "getTextId", "(", ")", ")", ";", "assertEquals", "(", "n1", ".", "getTokenIndex", "(", ")", ",", "n2", ".", "getTokenIndex", "(", ")", ")", ";", "Set", "<", "Edge", ">", "out1", "=", "n1", ".", "getOutgoingEdges", "(", ")", ";", "Set", "<", "Edge", ">", "out2", "=", "n2", ".", "getOutgoingEdges", "(", ")", ";", "assertEquals", "(", "out1", ".", "size", "(", ")", ",", "out2", ".", "size", "(", ")", ")", ";", "for", "(", "Edge", "e1", ":", "out1", ")", "{", "assertTrue", "(", "out2", ".", "contains", "(", "e1", ")", ")", ";", "for", "(", "Edge", "e2", ":", "out2", ")", "{", "if", "(", "e1", ".", "getPre", "(", ")", "==", "e2", ".", "getPre", "(", ")", ")", "{", "checkAnnisEdgeEqual", "(", "e1", ",", "e2", ")", ";", "break", ";", "}", "}", "}", "Set", "<", "Edge", ">", "in1", "=", "n1", ".", "getIncomingEdges", "(", ")", ";", "Set", "<", "Edge", ">", "in2", "=", "n2", ".", "getIncomingEdges", "(", ")", ";", "assertEquals", "(", "in1", ".", "size", "(", ")", ",", "in2", ".", "size", "(", ")", ")", ";", "for", "(", "Edge", "e1", ":", "in1", ")", "{", "assertTrue", "(", "in2", ".", "contains", "(", "e1", ")", ")", ";", "for", "(", "Edge", "e2", ":", "in2", ")", "{", "if", "(", "e1", ".", "getPre", "(", ")", "==", "e2", ".", "getPre", "(", ")", "&&", "e1", ".", "getComponentID", "(", ")", "==", "e2", ".", "getComponentID", "(", ")", ")", "{", "checkAnnisEdgeEqual", "(", "e1", ",", "e2", ")", ";", "break", ";", "}", "}", "}", "}", "private", "void", "checkAnnisEdgeEqual", "(", "Edge", "e1", ",", "Edge", "e2", ")", "{", "checkAnnotationSetEqual", "(", "e1", ".", "getAnnotations", "(", ")", ",", "e1", ".", "getAnnotations", "(", ")", ")", ";", "assertEquals", "(", "e1", ".", "getSource", "(", ")", ".", "getId", "(", ")", ",", "e2", ".", "getSource", "(", ")", ".", "getId", "(", ")", ")", ";", "assertEquals", "(", "e1", ".", "getDestination", "(", ")", ".", "getId", "(", ")", ",", "e2", ".", "getDestination", "(", ")", ".", "getId", "(", ")", ")", ";", "}", "private", "void", "checkAnnotationSetEqual", "(", "Set", "<", "Annotation", ">", "annos1", ",", "Set", "<", "Annotation", ">", "annos2", ")", "{", "for", "(", "Annotation", "a", ":", "annos1", ")", "{", "assertTrue", "(", "\"annotation", "\"", "+", "a", ".", "getQualifiedName", "(", ")", "+", "\"->\"", "+", "a", ".", "getValue", "(", ")", "+", "\"\"", ",", "annos2", ".", "contains", "(", "a", ")", ")", ";", "}", "for", "(", "Annotation", "a", ":", "annos2", ")", "{", "assertTrue", "(", "\"annotation", "\"", "+", "a", ".", "getQualifiedName", "(", ")", "+", "\"->\"", "+", "a", ".", "getValue", "(", ")", "+", "\"\"", ",", "annos2", ".", "contains", "(", "a", ")", ")", ";", "}", "}", "}", "</s>" ]
8,923
[ "<s>", "package", "annis", ";", "import", "static", "org", ".", "hamcrest", ".", "Matchers", ".", "is", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertEquals", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "org", ".", "junit", ".", "Before", ";", "import", "org", ".", "junit", ".", "Test", ";", "public", "class", "TestTableFormatter", "{", "private", "static", "final", "String", "PRINTME1", "=", "\"PRINTME1\"", ";", "private", "static", "final", "String", "DONTPRINTME1", "=", "\"DONTPRINTME1\"", ";", "private", "static", "final", "String", "PRINTME2", "=", "\"PRINTME2\"", ";", "private", "static", "final", "String", "METO2", "=", "\"METO2\"", ";", "private", "static", "final", "String", "DONTPRINTME2", "=", "\"DONTPRINTME2\"", ";", "private", "TableFormatter", "tableFormatter", ";", "@", "SuppressWarnings", "(", "\"unused\"", ")", "private", "class", "ObjectWithTableColumns", "{", "private", "String", "printMe", ";", "private", "String", "meTo", ";", "private", "String", "dontPrintMe", ";", "public", "ObjectWithTableColumns", "(", "String", "printMe", ",", "String", "meTo", ",", "String", "dontPrintMe", ")", "{", "this", ".", "printMe", "=", "printMe", ";", "this", ".", "meTo", "=", "meTo", ";", "this", ".", "dontPrintMe", "=", "dontPrintMe", ";", "}", "}", "@", "Before", "public", "void", "setup", "(", ")", "{", "tableFormatter", "=", "new", "TableFormatter", "(", ")", ";", "}", "@", "Test", "public", "void", "formatAsTable", "(", ")", "{", "ObjectWithTableColumns", "o1", "=", "new", "ObjectWithTableColumns", "(", "PRINTME1", ",", "null", ",", "DONTPRINTME1", ")", ";", "ObjectWithTableColumns", "o2", "=", "new", "ObjectWithTableColumns", "(", "PRINTME2", ",", "METO2", ",", "DONTPRINTME2", ")", ";", "String", "[", "]", "fields", "=", "{", "\"printMe\"", ",", "\"meTo\"", "}", ";", "String", "expected", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "System", ".", "out", ".", "println", "(", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "o1", ",", "o2", ")", ",", "fields", ")", ")", ";", "assertEquals", "(", "expected", ",", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "o1", ",", "o2", ")", ",", "fields", ")", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "collection", "(", ")", "{", "Collection", "<", "String", ">", "c1", "=", "Arrays", ".", "asList", "(", "\"1\"", ")", ";", "Collection", "<", "String", ">", "c2", "=", "Arrays", ".", "asList", "(", "\"2\"", ",", "\"3\"", ")", ";", "String", "expected", "=", "\"\"", "+", "\"#0", "|", "#1n\"", "+", "\"---+---n\"", "+", "\"", "1", "|", "n\"", "+", "\"", "2", "|", "3n\"", ";", "System", ".", "out", ".", "println", "(", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "c1", ",", "c2", ")", ")", ")", ";", "assertEquals", "(", "expected", ",", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "c1", ",", "c2", ")", ")", ")", ";", "}", "@", "Test", "public", "void", "empty", "(", ")", "{", "assertThat", "(", "tableFormatter", ".", "formatAsTable", "(", "new", "ArrayList", "<", "Object", ">", "(", ")", ")", ",", "is", "(", "\"(empty)\"", ")", ")", ";", "}", "@", "Test", "public", "void", "noFields", "(", ")", "{", "assertThat", "(", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "new", "Object", "(", ")", ")", ")", ",", "is", "(", "\"\"", ")", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Test", "public", "void", "emptyCollection", "(", ")", "{", "assertThat", "(", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "new", "ArrayList", "<", "Object", ">", "(", ")", ")", ")", ",", "is", "(", "\"\"", ")", ")", ";", "}", "@", "Test", "public", "void", "unknownField", "(", ")", "{", "assertThat", "(", "tableFormatter", ".", "formatAsTable", "(", "Arrays", ".", "asList", "(", "new", "Object", "(", ")", ")", ",", "\"unknownField\"", ")", ",", "is", "(", "\"\"", ")", ")", ";", "}", "}", "</s>" ]
8,924
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VAutoHeightIFrame", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintException", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintTarget", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "Sizeable", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "AbstractComponent", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "ClientWidget", ";", "import", "java", ".", "util", ".", "Map", ";", "@", "ClientWidget", "(", "VAutoHeightIFrame", ".", "class", ")", "public", "class", "AutoHeightIFrame", "extends", "AbstractComponent", "{", "private", "String", "url", ";", "private", "boolean", "urlUpdated", "=", "false", ";", "public", "static", "final", "int", "ADDITIONAL_HEIGHT", "=", "25", ";", "public", "AutoHeightIFrame", "(", "String", "url", ")", "{", "this", ".", "url", "=", "url", ";", "urlUpdated", "=", "false", ";", "setWidth", "(", "\"100%\"", ")", ";", "}", "@", "Override", "public", "void", "paintContent", "(", "PaintTarget", "target", ")", "throws", "PaintException", "{", "super", ".", "paintContent", "(", "target", ")", ";", "if", "(", "!", "urlUpdated", ")", "{", "target", ".", "addAttribute", "(", "\"url\"", ",", "url", ")", ";", "target", ".", "addAttribute", "(", "\"\"", ",", "ADDITIONAL_HEIGHT", ")", ";", "urlUpdated", "=", "true", ";", "}", "}", "@", "Override", "public", "void", "changeVariables", "(", "Object", "source", ",", "Map", "<", "String", ",", "Object", ">", "variables", ")", "{", "if", "(", "variables", ".", "containsKey", "(", "\"height\"", ")", ")", "{", "int", "height", "=", "(", "Integer", ")", "variables", ".", "get", "(", "\"height\"", ")", ";", "this", ".", "setHeight", "(", "(", "float", ")", "height", ",", "Sizeable", ".", "UNITS_PIXELS", ")", ";", "}", "}", "}", "</s>" ]
8,925
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VAudioPlayer", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "ClientWidget", ";", "@", "ClientWidget", "(", "VAudioPlayer", ".", "class", ")", "public", "class", "AudioPlayer", "extends", "MediaPlayerBase", "{", "public", "AudioPlayer", "(", "String", "resourceURL", ",", "String", "mimeType", ")", "{", "super", "(", "resourceURL", ",", "mimeType", ")", ";", "}", "}", "</s>" ]
8,926
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VSimpleCanvas", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintException", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintTarget", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "AbstractComponent", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "ClientWidget", ";", "import", "java", ".", "awt", ".", "geom", ".", "Line2D", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "@", "ClientWidget", "(", "VSimpleCanvas", ".", "class", ")", "public", "class", "SimpleCanvas", "extends", "AbstractComponent", "{", "private", "List", "<", "Line2D", ">", "lines", ";", "public", "SimpleCanvas", "(", ")", "{", "lines", "=", "new", "LinkedList", "<", "Line2D", ">", "(", ")", ";", "}", "@", "Override", "public", "void", "paintContent", "(", "PaintTarget", "target", ")", "throws", "PaintException", "{", "super", ".", "paintContent", "(", "target", ")", ";", "target", ".", "startTag", "(", "\"clear\"", ")", ";", "target", ".", "endTag", "(", "\"clear\"", ")", ";", "for", "(", "Line2D", "l", ":", "lines", ")", "{", "target", ".", "startTag", "(", "\"line\"", ")", ";", "target", ".", "addAttribute", "(", "\"from_x\"", ",", "l", ".", "getX1", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"from_y\"", ",", "l", ".", "getY1", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"to_x\"", ",", "l", ".", "getX2", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"to_y\"", ",", "l", ".", "getY2", "(", ")", ")", ";", "target", ".", "endTag", "(", "\"line\"", ")", ";", "}", "}", "public", "List", "<", "Line2D", ">", "getLines", "(", ")", "{", "return", "lines", ";", "}", "public", "void", "setLines", "(", "List", "<", "Line2D", ">", "lines", ")", "{", "this", ".", "lines", "=", "lines", ";", "}", "}", "</s>" ]
8,927
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "gwt", ".", "canvas", ".", "client", ".", "Canvas", ";", "import", "com", ".", "google", ".", "gwt", ".", "canvas", ".", "dom", ".", "client", ".", "Context2d", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "Composite", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "Label", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ApplicationConnection", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "Paintable", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "UIDL", ";", "import", "java", ".", "util", ".", "Iterator", ";", "public", "class", "VSimpleCanvas", "extends", "Composite", "implements", "Paintable", "{", "public", "static", "final", "String", "CLASSNAME", "=", "\"\"", ";", "protected", "String", "paintableId", ";", "ApplicationConnection", "gClient", ";", "static", "final", "int", "height", "=", "2000", ";", "static", "final", "int", "width", "=", "2000", ";", "Canvas", "canvas", ";", "Context2d", "context", ";", "public", "VSimpleCanvas", "(", ")", "{", "super", "(", ")", ";", "canvas", "=", "Canvas", ".", "createIfSupported", "(", ")", ";", "if", "(", "canvas", "==", "null", ")", "{", "Label", "lblErrorMessage", "=", "new", "Label", "(", "\"\"", ")", ";", "initWidget", "(", "lblErrorMessage", ")", ";", "}", "else", "{", "initWidget", "(", "canvas", ")", ";", "canvas", ".", "setHeight", "(", "\"\"", "+", "height", "+", "\"px\"", ")", ";", "canvas", ".", "setWidth", "(", "\"\"", "+", "width", "+", "\"px\"", ")", ";", "canvas", ".", "setCoordinateSpaceHeight", "(", "height", ")", ";", "canvas", ".", "setCoordinateSpaceWidth", "(", "width", ")", ";", "context", "=", "canvas", ".", "getContext2d", "(", ")", ";", "}", "setStyleName", "(", "CLASSNAME", ")", ";", "}", "@", "Override", "public", "void", "updateFromUIDL", "(", "UIDL", "uidl", ",", "ApplicationConnection", "client", ")", "{", "if", "(", "client", ".", "updateComponent", "(", "this", ",", "uidl", ",", "true", ")", ")", "{", "return", ";", "}", "this", ".", "gClient", "=", "client", ";", "paintableId", "=", "uidl", ".", "getId", "(", ")", ";", "if", "(", "context", "!=", "null", ")", "{", "Iterator", "<", "Object", ">", "it", "=", "uidl", ".", "getChildIterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")", "{", "UIDL", "child", "=", "(", "UIDL", ")", "it", ".", "next", "(", ")", ";", "if", "(", "\"clear\"", ".", "equals", "(", "child", ".", "getTag", "(", ")", ")", ")", "{", "context", ".", "clearRect", "(", "0", ",", "0", ",", "2000", ",", "2000", ")", ";", "}", "else", "if", "(", "\"line\"", ".", "equals", "(", "child", ".", "getTag", "(", ")", ")", ")", "{", "context", ".", "beginPath", "(", ")", ";", "context", ".", "moveTo", "(", "child", ".", "getIntAttribute", "(", "\"from_x\"", ")", ",", "child", ".", "getIntAttribute", "(", "\"from_y\"", ")", ")", ";", "context", ".", "lineTo", "(", "child", ".", "getIntAttribute", "(", "\"to_x\"", ")", ",", "child", ".", "getIntAttribute", "(", "\"to_y\"", ")", ")", ";", "context", ".", "stroke", "(", ")", ";", "context", ".", "closePath", "(", ")", ";", "}", "}", "}", "}", "}", "</s>" ]
8,928
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "gwt", ".", "core", ".", "client", ".", "JavaScriptException", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "*", ";", "import", "com", ".", "google", ".", "gwt", ".", "event", ".", "dom", ".", "client", ".", "LoadEvent", ";", "import", "com", ".", "google", ".", "gwt", ".", "event", ".", "dom", ".", "client", ".", "LoadHandler", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "Timer", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "Widget", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ApplicationConnection", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "Paintable", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "UIDL", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "VConsole", ";", "public", "class", "VAutoHeightIFrame", "extends", "Widget", "implements", "Paintable", "{", "public", "static", "final", "String", "CLASSNAME", "=", "\"\"", ";", "protected", "String", "paintableId", ";", "ApplicationConnection", "gClient", ";", "private", "IFrameElement", "iframe", ";", "private", "int", "additionalHeight", ";", "public", "VAutoHeightIFrame", "(", ")", "{", "super", "(", ")", ";", "iframe", "=", "Document", ".", "get", "(", ")", ".", "createIFrameElement", "(", ")", ";", "setElement", "(", "iframe", ")", ";", "setStyleName", "(", "CLASSNAME", ")", ";", "addDomHandler", "(", "new", "LoadHandler", "(", ")", "{", "@", "Override", "public", "void", "onLoad", "(", "LoadEvent", "event", ")", "{", "if", "(", "!", "iframe", ".", "getSrc", "(", ")", ".", "endsWith", "(", "\"empty.html\"", ")", ")", "{", "try", "{", "final", "Document", "doc", "=", "iframe", ".", "getContentDocument", "(", ")", ";", "if", "(", "doc", "!=", "null", ")", "{", "Timer", "t", "=", "new", "Timer", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "checkIFrameLoaded", "(", "doc", ")", ";", "}", "}", ";", "t", ".", "schedule", "(", "100", ")", ";", "}", "}", "catch", "(", "JavaScriptException", "ex", ")", "{", "VConsole", ".", "log", "(", "\"\"", ")", ";", "}", "}", "}", "}", ",", "LoadEvent", ".", "getType", "(", ")", ")", ";", "iframe", ".", "setFrameBorder", "(", "0", ")", ";", "}", "private", "void", "checkIFrameLoaded", "(", "Document", "doc", ")", "{", "int", "newHeight", "=", "-", "1", ";", "doc", ".", "getScrollLeft", "(", ")", ";", "String", "contentType", "=", "getContentType", "(", "doc", ")", ";", "if", "(", "contentType", "!=", "null", "&&", "contentType", ".", "startsWith", "(", "\"image/\"", ")", ")", "{", "NodeList", "<", "Element", ">", "imgList", "=", "doc", ".", "getElementsByTagName", "(", "\"img\"", ")", ";", "if", "(", "imgList", ".", "getLength", "(", ")", ">", "0", ")", "{", "ImageElement", "img", "=", "(", "ImageElement", ")", "imgList", ".", "getItem", "(", "0", ")", ";", "newHeight", "=", "img", ".", "getPropertyInt", "(", "\"\"", ")", ";", "}", "}", "else", "{", "VConsole", ".", "log", "(", "\"\"", "+", "doc", ".", "getBody", "(", ")", ".", "hasAttribute", "(", "\"scrollHeight\"", ")", ")", ";", "VConsole", ".", "log", "(", "\"\"", "+", "doc", ".", "getDocumentElement", "(", ")", ".", "hasAttribute", "(", "\"scrollHeight\"", ")", ")", ";", "int", "bodyHeight", "=", "doc", ".", "getBody", "(", ")", ".", "getScrollHeight", "(", ")", ";", "int", "documentHeight", "=", "doc", ".", "getDocumentElement", "(", ")", ".", "getScrollHeight", "(", ")", ";", "int", "maxHeight", "=", "Math", ".", "max", "(", "bodyHeight", ",", "documentHeight", ")", ";", "VConsole", ".", "log", "(", "\"\"", "+", "bodyHeight", "+", "\"\"", "+", "documentHeight", ")", ";", "if", "(", "maxHeight", ">", "20", ")", "{", "newHeight", "=", "maxHeight", "+", "additionalHeight", ";", "}", "}", "VConsole", ".", "log", "(", "\"newheight:", "\"", "+", "newHeight", ")", ";", "if", "(", "newHeight", ">", "-", "1", ")", "{", "gClient", ".", "updateVariable", "(", "paintableId", ",", "\"height\"", ",", "newHeight", ",", "true", ")", ";", "}", "}", "@", "Override", "public", "void", "updateFromUIDL", "(", "UIDL", "uidl", ",", "ApplicationConnection", "client", ")", "{", "if", "(", "client", ".", "updateComponent", "(", "this", ",", "uidl", ",", "true", ")", ")", "{", "return", ";", "}", "String", "url", "=", "uidl", ".", "getStringAttribute", "(", "\"url\"", ")", ";", "if", "(", "iframe", ".", "getSrc", "(", ")", "!=", "null", "&&", "url", "!=", "null", "&&", "iframe", ".", "getSrc", "(", ")", ".", "equals", "(", "url", ")", ")", "{", "return", ";", "}", "this", ".", "gClient", "=", "client", ";", "paintableId", "=", "uidl", ".", "getId", "(", ")", ";", "if", "(", "uidl", ".", "hasAttribute", "(", "\"\"", ")", ")", "{", "additionalHeight", "=", "uidl", ".", "getIntAttribute", "(", "\"\"", ")", ";", "}", "final", "Style", "style", "=", "iframe", ".", "getStyle", "(", ")", ";", "style", ".", "setWidth", "(", "100", ",", "Style", ".", "Unit", ".", "PCT", ")", ";", "if", "(", "url", "!=", "null", ")", "{", "url", "=", "client", ".", "translateVaadinUri", "(", "url", ")", ";", "iframe", ".", "setSrc", "(", "url", ")", ";", "}", "}", "public", "final", "native", "String", "getContentType", "(", "Document", "doc", ")", ";", "}", "</s>" ]
8,929
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "BiMap", ";", "import", "com", ".", "google", ".", "common", ".", "collect", ".", "HashBiMap", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Element", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "TableCellElement", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "TableRowElement", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "Event", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "Composite", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "FlexTable", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "HTMLTable", ".", "Cell", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ApplicationConnection", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "Paintable", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "UIDL", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "VConsole", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ui", ".", "VLabel", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "public", "class", "VAnnotationGrid", "extends", "Composite", "implements", "Paintable", "{", "public", "static", "final", "String", "CLASSNAME", "=", "\"\"", ";", "protected", "String", "paintableId", ";", "ApplicationConnection", "gClient", ";", "private", "AnnotationGridTable", "table", ";", "private", "FlexTable", ".", "FlexCellFormatter", "formatter", ";", "private", "BiMap", "<", "Position", ",", "String", ">", "position2id", ";", "private", "Map", "<", "String", ",", "String", "[", "]", ">", "highlighted", ";", "private", "Map", "<", "Position", ",", "Double", ">", "startTimes", ";", "private", "Map", "<", "Position", ",", "Double", ">", "endTimes", ";", "public", "VAnnotationGrid", "(", ")", "{", "super", "(", ")", ";", "table", "=", "new", "AnnotationGridTable", "(", ")", ";", "formatter", "=", "table", ".", "getFlexCellFormatter", "(", ")", ";", "initWidget", "(", "table", ")", ";", "setStyleName", "(", "CLASSNAME", ")", ";", "highlighted", "=", "new", "HashMap", "<", "String", ",", "String", "[", "]", ">", "(", ")", ";", "position2id", "=", "HashBiMap", ".", "create", "(", ")", ";", "startTimes", "=", "new", "HashMap", "<", "Position", ",", "Double", ">", "(", ")", ";", "endTimes", "=", "new", "HashMap", "<", "Position", ",", "Double", ">", "(", ")", ";", "}", "@", "Override", "public", "void", "updateFromUIDL", "(", "UIDL", "uidl", ",", "ApplicationConnection", "client", ")", "{", "if", "(", "client", ".", "updateComponent", "(", "this", ",", "uidl", ",", "true", ")", ")", "{", "return", ";", "}", "this", ".", "gClient", "=", "client", ";", "paintableId", "=", "uidl", ".", "getId", "(", ")", ";", "try", "{", "UIDL", "rows", "=", "uidl", ".", "getChildByTagName", "(", "\"rows\"", ")", ";", "if", "(", "rows", "!=", "null", ")", "{", "table", ".", "removeAllRows", "(", ")", ";", "highlighted", ".", "clear", "(", ")", ";", "position2id", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "rows", ".", "getChildCount", "(", ")", ";", "i", "++", ")", "{", "UIDL", "row", "=", "rows", ".", "getChildUIDL", "(", "i", ")", ";", "if", "(", "\"row\"", ".", "equals", "(", "row", ".", "getTag", "(", ")", ")", ")", "{", "addRow", "(", "row", ",", "i", ")", ";", "}", "}", "}", "int", "maxCellCount", "=", "0", ";", "for", "(", "int", "row", "=", "0", ";", "row", "<", "table", ".", "getRowCount", "(", ")", ";", "row", "++", ")", "{", "maxCellCount", "=", "Math", ".", "max", "(", "maxCellCount", ",", "getRealColumnCount", "(", "row", ")", ")", ";", "}", "for", "(", "int", "row", "=", "0", ";", "row", "<", "table", ".", "getRowCount", "(", ")", ";", "row", "++", ")", "{", "int", "isValue", "=", "getRealColumnCount", "(", "row", ")", ";", "if", "(", "isValue", "<", "maxCellCount", ")", "{", "int", "diff", "=", "maxCellCount", "-", "isValue", ";", "table", ".", "setHTML", "(", "row", ",", "table", ".", "getCellCount", "(", "row", ")", "+", "diff", "-", "1", ",", "\"\"", ")", ";", "}", "}", "}", "catch", "(", "Exception", "ex", ")", "{", "VConsole", ".", "log", "(", "ex", ")", ";", "}", "}", "private", "int", "getRealColumnCount", "(", "int", "row", ")", "{", "int", "result", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "table", ".", "getCellCount", "(", "row", ")", ";", "i", "++", ")", "{", "result", "+=", "formatter", ".", "getColSpan", "(", "row", ",", "i", ")", ";", "}", "return", "result", ";", "}", "private", "void", "addRow", "(", "UIDL", "row", ",", "int", "rowNumber", ")", "{", "String", "caption", "=", "row", ".", "getStringAttribute", "(", "\"caption\"", ")", ";", "String", "[", "]", "captionSplit", "=", "caption", ".", "split", "(", "\"::\"", ")", ";", "String", "name", "=", "captionSplit", "[", "captionSplit", ".", "length", "-", "1", "]", ";", "VLabel", "lblCaption", "=", "new", "VLabel", "(", "name", ")", ";", "table", ".", "setWidget", "(", "rowNumber", ",", "0", ",", "lblCaption", ")", ";", "formatter", ".", "addStyleName", "(", "rowNumber", ",", "0", ",", "\"header\"", ")", ";", "int", "colspanOffset", "=", "0", ";", "UIDL", "events", "=", "row", ".", "getChildByTagName", "(", "\"events\"", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "events", ".", "getChildCount", "(", ")", ";", "j", "++", ")", "{", "UIDL", "event", "=", "events", ".", "getChildUIDL", "(", "j", ")", ";", "String", "id", "=", "event", ".", "getStringAttribute", "(", "\"id\"", ")", ";", "int", "left", "=", "event", ".", "getIntAttribute", "(", "\"left\"", ")", ";", "int", "right", "=", "event", ".", "getIntAttribute", "(", "\"right\"", ")", ";", "String", "value", "=", "event", ".", "getStringAttribute", "(", "\"value\"", ")", ";", "VLabel", "label", "=", "new", "VLabel", "(", "value", ")", ";", "label", ".", "setTitle", "(", "caption", ")", ";", "int", "col", "=", "left", "+", "1", "-", "colspanOffset", ";", "table", ".", "setWidget", "(", "rowNumber", ",", "col", ",", "label", ")", ";", "position2id", ".", "put", "(", "new", "Position", "(", "rowNumber", ",", "col", ")", ",", "id", ")", ";", "int", "colspan", "=", "right", "-", "left", "+", "1", ";", "formatter", ".", "setColSpan", "(", "rowNumber", ",", "col", ",", "colspan", ")", ";", "if", "(", "colspan", ">", "1", ")", "{", "colspanOffset", "+=", "(", "colspan", "-", "1", ")", ";", "}", "addStyleForEvent", "(", "event", ",", "rowNumber", ",", "col", ")", ";", "}", "}", "private", "void", "addStyleForEvent", "(", "UIDL", "event", ",", "int", "rowNumber", ",", "int", "col", ")", "{", "String", "id", "=", "event", ".", "getStringAttribute", "(", "\"id\"", ")", ";", "if", "(", "event", ".", "hasAttribute", "(", "\"style\"", ")", ")", "{", "String", "[", "]", "styles", "=", "event", ".", "getStringArrayAttribute", "(", "\"style\"", ")", ";", "for", "(", "String", "s", ":", "styles", ")", "{", "formatter", ".", "addStyleName", "(", "rowNumber", ",", "col", ",", "s", ")", ";", "}", "}", "else", "{", "formatter", ".", "addStyleName", "(", "rowNumber", ",", "col", ",", "\"single_event\"", ")", ";", "}", "if", "(", "event", ".", "hasAttribute", "(", "\"highlight\"", ")", ")", "{", "highlighted", ".", "put", "(", "id", ",", "event", ".", "getStringArrayAttribute", "(", "\"highlight\"", ")", ")", ";", "}", "if", "(", "event", ".", "hasAttribute", "(", "\"startTime\"", ")", ")", "{", "formatter", ".", "addStyleName", "(", "rowNumber", ",", "col", ",", "\"speaker\"", ")", ";", "startTimes", ".", "put", "(", "new", "Position", "(", "rowNumber", ",", "col", ")", ",", "event", ".", "getDoubleAttribute", "(", "\"startTime\"", ")", ")", ";", "if", "(", "event", ".", "hasAttribute", "(", "\"endTime\"", ")", ")", "{", "endTimes", ".", "put", "(", "new", "Position", "(", "rowNumber", ",", "col", ")", ",", "event", ".", "getDoubleAttribute", "(", "\"endTime\"", ")", ")", ";", "}", "}", "}", "public", "void", "onClick", "(", "int", "row", ",", "int", "col", ")", "{", "Position", "pos", "=", "new", "Position", "(", "row", ",", "col", ")", ";", "if", "(", "startTimes", ".", "containsKey", "(", "pos", ")", ")", "{", "if", "(", "endTimes", ".", "containsKey", "(", "pos", ")", ")", "{", "gClient", ".", "updateVariable", "(", "paintableId", ",", "\"play\"", ",", "\"\"", "+", "startTimes", ".", "get", "(", "pos", ")", "+", "\"-\"", "+", "endTimes", ".", "get", "(", "pos", ")", ",", "true", ")", ";", "}", "else", "{", "gClient", ".", "updateVariable", "(", "paintableId", ",", "\"play\"", ",", "\"\"", "+", "startTimes", ".", "get", "(", "pos", ")", ",", "true", ")", ";", "}", "}", "}", "public", "static", "class", "Position", "{", "private", "int", "column", ",", "row", ";", "public", "Position", "(", "Cell", "cell", ")", "{", "this", ".", "column", "=", "cell", ".", "getCellIndex", "(", ")", ";", "this", ".", "row", "=", "cell", ".", "getRowIndex", "(", ")", ";", "}", "public", "Position", "(", "int", "row", ",", "int", "column", ")", "{", "this", ".", "column", "=", "column", ";", "this", ".", "row", "=", "row", ";", "}", "public", "int", "getColumn", "(", ")", "{", "return", "column", ";", "}", "public", "void", "setColumn", "(", "int", "column", ")", "{", "this", ".", "column", "=", "column", ";", "}", "public", "int", "getRow", "(", ")", "{", "return", "row", ";", "}", "public", "void", "setRow", "(", "int", "row", ")", "{", "this", ".", "row", "=", "row", ";", "}", "@", "Override", "public", "int", "hashCode", "(", ")", "{", "int", "hash", "=", "7", ";", "hash", "=", "71", "*", "hash", "+", "this", ".", "column", ";", "hash", "=", "71", "*", "hash", "+", "this", ".", "row", ";", "return", "hash", ";", "}", "@", "Override", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "getClass", "(", ")", "!=", "obj", ".", "getClass", "(", ")", ")", "{", "return", "false", ";", "}", "final", "Position", "other", "=", "(", "Position", ")", "obj", ";", "if", "(", "this", ".", "column", "!=", "other", ".", "column", ")", "{", "return", "false", ";", "}", "if", "(", "this", ".", "row", "!=", "other", ".", "row", ")", "{", "return", "false", ";", "}", "return", "true", ";", "}", "}", "public", "class", "AnnotationGridTable", "extends", "FlexTable", "{", "public", "AnnotationGridTable", "(", ")", "{", "sinkEvents", "(", "Event", ".", "ONMOUSEOVER", "|", "Event", ".", "ONMOUSEOUT", "|", "Event", ".", "ONCLICK", ")", ";", "}", "@", "Override", "public", "void", "onBrowserEvent", "(", "Event", "event", ")", "{", "Element", "td", "=", "getEventTargetCell", "(", "event", ")", ";", "if", "(", "td", "==", "null", ")", "{", "return", ";", "}", "int", "row", "=", "TableRowElement", ".", "as", "(", "td", ".", "getParentElement", "(", ")", ")", ".", "getSectionRowIndex", "(", ")", ";", "int", "column", "=", "TableCellElement", ".", "as", "(", "td", ")", ".", "getCellIndex", "(", ")", ";", "String", "id", "=", "position2id", ".", "get", "(", "new", "Position", "(", "row", ",", "column", ")", ")", ";", "String", "[", "]", "targetIDs", "=", "highlighted", ".", "get", "(", "id", ")", ";", "if", "(", "targetIDs", "!=", "null", "&&", "targetIDs", ".", "length", ">", "0", ")", "{", "switch", "(", "event", ".", "getTypeInt", "(", ")", ")", "{", "case", "Event", ".", "ONMOUSEOVER", ":", "td", ".", "addClassName", "(", "\"\"", ")", ";", "for", "(", "String", "targetID", ":", "targetIDs", ")", "{", "Position", "pos", "=", "position2id", ".", "inverse", "(", ")", ".", "get", "(", "targetID", ")", ";", "if", "(", "pos", "!=", "null", ")", "{", "formatter", ".", "addStyleName", "(", "pos", ".", "getRow", "(", ")", ",", "pos", ".", "getColumn", "(", ")", ",", "\"\"", ")", ";", "}", "}", "break", ";", "case", "Event", ".", "ONMOUSEOUT", ":", "td", ".", "removeClassName", "(", "\"\"", ")", ";", "for", "(", "String", "targetID", ":", "targetIDs", ")", "{", "Position", "pos", "=", "position2id", ".", "inverse", "(", ")", ".", "get", "(", "targetID", ")", ";", "if", "(", "pos", "!=", "null", ")", "{", "formatter", ".", "removeStyleName", "(", "pos", ".", "getRow", "(", ")", ",", "pos", ".", "getColumn", "(", ")", ",", "\"\"", ")", ";", "}", "}", "break", ";", "case", "Event", ".", "ONCLICK", ":", "onClick", "(", "row", ",", "column", ")", ";", "break", ";", "default", ":", "break", ";", "}", "}", "}", "}", "}", "</s>" ]
8,930
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Element", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "MediaElement", ";", "import", "com", ".", "google", ".", "gwt", ".", "user", ".", "client", ".", "ui", ".", "Widget", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ApplicationConnection", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "Paintable", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "UIDL", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "VConsole", ";", "public", "class", "VMediaPlayerBase", "extends", "Widget", "implements", "Paintable", "{", "public", "static", "final", "String", "PLAY", "=", "\"play\"", ";", "public", "static", "final", "String", "PAUSE", "=", "\"pause\"", ";", "public", "static", "final", "String", "STOP", "=", "\"stop\"", ";", "public", "static", "final", "String", "SOURCE_URL", "=", "\"url\"", ";", "public", "static", "final", "String", "MIME_TYPE", "=", "\"mime_type\"", ";", "public", "static", "final", "String", "CANNOT_PLAY", "=", "\"cannot_play\"", ";", "public", "static", "final", "String", "PLAYER_LOADED", "=", "\"\"", ";", "private", "MediaElement", "media", ";", "protected", "String", "paintableId", ";", "ApplicationConnection", "gClient", ";", "public", "VMediaPlayerBase", "(", "MediaElement", "media", ")", "{", "this", ".", "media", "=", "media", ";", "setElement", "(", "this", ".", "media", ")", ";", "media", ".", "setControls", "(", "true", ")", ";", "media", ".", "setAutoplay", "(", "false", ")", ";", "media", ".", "setPreload", "(", "MediaElement", ".", "PRELOAD_METADATA", ")", ";", "media", ".", "setLoop", "(", "false", ")", ";", "}", "@", "Override", "protected", "void", "onUnload", "(", ")", "{", "media", ".", "pause", "(", ")", ";", "media", ".", "setSrc", "(", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "updateFromUIDL", "(", "UIDL", "uidl", ",", "ApplicationConnection", "client", ")", "{", "if", "(", "client", ".", "updateComponent", "(", "this", ",", "uidl", ",", "true", ")", ")", "{", "return", ";", "}", "this", ".", "gClient", "=", "client", ";", "paintableId", "=", "uidl", ".", "getId", "(", ")", ";", "if", "(", "media", "==", "null", ")", "{", "VConsole", ".", "error", "(", "\"\"", ")", ";", "return", ";", "}", "if", "(", "uidl", ".", "hasAttribute", "(", "SOURCE_URL", ")", ")", "{", "registerMetadataLoadedEvent", "(", "media", ")", ";", "if", "(", "uidl", ".", "hasAttribute", "(", "MIME_TYPE", ")", ")", "{", "VConsole", ".", "log", "(", "\"\"", "+", "media", ".", "canPlayType", "(", "uidl", ".", "getStringAttribute", "(", "MIME_TYPE", ")", ")", "+", "\"\\\"\"", ")", ";", "if", "(", "media", ".", "canPlayType", "(", "uidl", ".", "getStringAttribute", "(", "MIME_TYPE", ")", ")", ".", "equals", "(", "MediaElement", ".", "CANNOT_PLAY", ")", ")", "{", "VConsole", ".", "log", "(", "\"\"", ")", ";", "gClient", ".", "updateVariable", "(", "paintableId", ",", "CANNOT_PLAY", ",", "true", ",", "true", ")", ";", "}", "}", "media", ".", "setSrc", "(", "uidl", ".", "getStringAttribute", "(", "SOURCE_URL", ")", ")", ";", "}", "if", "(", "uidl", ".", "hasAttribute", "(", "PLAY", ")", ")", "{", "String", "[", "]", "time", "=", "uidl", ".", "getStringArrayAttribute", "(", "PLAY", ")", ";", "if", "(", "time", ".", "length", "==", "1", ")", "{", "media", ".", "setCurrentTime", "(", "Double", ".", "parseDouble", "(", "time", "[", "0", "]", ")", ")", ";", "}", "else", "if", "(", "time", ".", "length", "==", "2", ")", "{", "media", ".", "setCurrentTime", "(", "Double", ".", "parseDouble", "(", "time", "[", "0", "]", ")", ")", ";", "setEndTimeOnce", "(", "media", ",", "Double", ".", "parseDouble", "(", "time", "[", "1", "]", ")", ")", ";", "}", "media", ".", "play", "(", ")", ";", "}", "else", "if", "(", "uidl", ".", "hasAttribute", "(", "PAUSE", ")", ")", "{", "media", ".", "pause", "(", ")", ";", "}", "else", "if", "(", "uidl", ".", "hasAttribute", "(", "STOP", ")", ")", "{", "media", ".", "pause", "(", ")", ";", "media", ".", "setSrc", "(", "\"\"", ")", ";", "}", "}", "public", "String", "getMimeType", "(", ")", "{", "Exception", "ex", "=", "new", "UnsupportedOperationException", "(", "\"\"", ")", ";", "VConsole", ".", "error", "(", "ex", ")", ";", "return", "null", ";", "}", ";", "private", "void", "metaDataWasLoaded", "(", ")", "{", "if", "(", "gClient", "!=", "null", "&&", "paintableId", "!=", "null", ")", "{", "gClient", ".", "updateVariable", "(", "paintableId", ",", "PLAYER_LOADED", ",", "true", ",", "true", ")", ";", "}", "}", "private", "native", "void", "setEndTimeOnce", "(", "Element", "elem", ",", "double", "endTime", ")", ";", "private", "native", "void", "registerMetadataLoadedEvent", "(", "Element", "el", ")", ";", "public", "MediaElement", "getMedia", "(", ")", "{", "return", "media", ";", "}", "}", "</s>" ]
8,931
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Document", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Element", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Style", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "Util", ";", "public", "class", "VVideoPlayer", "extends", "VMediaPlayerBase", "{", "private", "static", "String", "CLASSNAME", "=", "\"\"", ";", "public", "VVideoPlayer", "(", ")", "{", "super", "(", "Document", ".", "get", "(", ")", ".", "createVideoElement", "(", ")", ")", ";", "setStyleName", "(", "CLASSNAME", ")", ";", "updateDimensionsWhenMetadataLoaded", "(", "getMedia", "(", ")", ")", ";", "}", "@", "Override", "public", "String", "getMimeType", "(", ")", "{", "return", "\"video/webm\"", ";", "}", "private", "void", "updateSizeFromMetadata", "(", "int", "width", ",", "int", "height", ")", "{", "getMedia", "(", ")", ".", "getStyle", "(", ")", ".", "setWidth", "(", "width", ",", "Style", ".", "Unit", ".", "PX", ")", ";", "getMedia", "(", ")", ".", "getStyle", "(", ")", ".", "setHeight", "(", "height", ",", "Style", ".", "Unit", ".", "PX", ")", ";", "Util", ".", "notifyParentOfSizeChange", "(", "this", ",", "true", ")", ";", "}", "private", "native", "void", "updateDimensionsWhenMetadataLoaded", "(", "Element", "el", ")", ";", "}", "</s>" ]
8,932
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Document", ";", "import", "com", ".", "google", ".", "gwt", ".", "dom", ".", "client", ".", "Style", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "ApplicationConnection", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "BrowserInfo", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "UIDL", ";", "public", "class", "VAudioPlayer", "extends", "VMediaPlayerBase", "{", "private", "static", "String", "CLASSNAME", "=", "\"\"", ";", "public", "VAudioPlayer", "(", ")", "{", "super", "(", "Document", ".", "get", "(", ")", ".", "createAudioElement", "(", ")", ")", ";", "setStyleName", "(", "CLASSNAME", ")", ";", "}", "@", "Override", "public", "void", "updateFromUIDL", "(", "UIDL", "uidl", ",", "ApplicationConnection", "client", ")", "{", "if", "(", "client", ".", "updateComponent", "(", "this", ",", "uidl", ",", "true", ")", ")", "{", "return", ";", "}", "super", ".", "updateFromUIDL", "(", "uidl", ",", "client", ")", ";", "Style", "mediaStyle", "=", "getMedia", "(", ")", ".", "getStyle", "(", ")", ";", "if", "(", "(", "mediaStyle", ".", "getHeight", "(", ")", "==", "null", "||", "\"\"", ".", "equals", "(", "mediaStyle", ".", "getHeight", "(", ")", ")", ")", ")", "{", "if", "(", "BrowserInfo", ".", "get", "(", ")", ".", "isChrome", "(", ")", ")", "{", "mediaStyle", ".", "setHeight", "(", "32", ",", "Style", ".", "Unit", ".", "PX", ")", ";", "}", "else", "{", "mediaStyle", ".", "setHeight", "(", "25", ",", "Style", ".", "Unit", ".", "PX", ")", ";", "}", "}", "}", "@", "Override", "public", "String", "getMimeType", "(", ")", "{", "return", "\"audio/ogg\"", ";", "}", "}", "</s>" ]
8,933
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VVideoPlayer", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "ClientWidget", ";", "@", "ClientWidget", "(", "VVideoPlayer", ".", "class", ")", "public", "class", "VideoPlayer", "extends", "MediaPlayerBase", "{", "public", "VideoPlayer", "(", "String", "resourceURL", ",", "String", "mimeType", ")", "{", "super", "(", "resourceURL", ",", "mimeType", ")", ";", "}", "}", "</s>" ]
8,934
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "grid", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "BitSet", ";", "public", "class", "Row", "{", "private", "ArrayList", "<", "GridEvent", ">", "events", ";", "private", "BitSet", "occupancySet", ";", "public", "Row", "(", ")", "{", "this", ".", "events", "=", "new", "ArrayList", "<", "GridEvent", ">", "(", ")", ";", "occupancySet", "=", "new", "BitSet", "(", ")", ";", "}", "public", "boolean", "addEvent", "(", "GridEvent", "e", ")", "{", "BitSet", "eventOccupance", "=", "new", "BitSet", "(", "e", ".", "getRight", "(", ")", ")", ";", "eventOccupance", ".", "set", "(", "e", ".", "getLeft", "(", ")", ",", "e", ".", "getRight", "(", ")", "+", "1", ",", "true", ")", ";", "if", "(", "occupancySet", ".", "intersects", "(", "eventOccupance", ")", ")", "{", "return", "false", ";", "}", "occupancySet", ".", "or", "(", "eventOccupance", ")", ";", "events", ".", "add", "(", "e", ")", ";", "return", "true", ";", "}", "public", "boolean", "canMerge", "(", "Row", "other", ")", "{", "return", "!", "occupancySet", ".", "intersects", "(", "other", ".", "occupancySet", ")", ";", "}", "public", "boolean", "merge", "(", "Row", "other", ")", "throws", "IllegalArgumentException", "{", "if", "(", "canMerge", "(", "other", ")", ")", "{", "occupancySet", ".", "or", "(", "other", ".", "occupancySet", ")", ";", "for", "(", "GridEvent", "e", ":", "other", ".", "events", ")", "{", "events", ".", "add", "(", "e", ")", ";", "}", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "ArrayList", "<", "GridEvent", ">", "getEvents", "(", ")", "{", "return", "events", ";", "}", "}", "</s>" ]
8,935
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "grid", ";", "import", "java", ".", "util", ".", "LinkedList", ";", "import", "java", ".", "util", ".", "List", ";", "public", "class", "GridEvent", "{", "private", "String", "id", ";", "private", "int", "left", ";", "private", "int", "right", ";", "private", "String", "value", ";", "private", "Long", "match", ";", "private", "List", "<", "String", ">", "coveredIDs", ";", "private", "Double", "startTime", ";", "private", "Double", "endTime", ";", "private", "boolean", "gap", ";", "public", "GridEvent", "(", "String", "id", ",", "int", "left", ",", "int", "right", ",", "String", "value", ")", "{", "this", ".", "id", "=", "id", ";", "this", ".", "left", "=", "left", ";", "this", ".", "right", "=", "right", ";", "this", ".", "value", "=", "value", ";", "this", ".", "coveredIDs", "=", "new", "LinkedList", "<", "String", ">", "(", ")", ";", "}", "public", "String", "getId", "(", ")", "{", "return", "id", ";", "}", "public", "void", "setId", "(", "String", "id", ")", "{", "this", ".", "id", "=", "id", ";", "}", "public", "int", "getLeft", "(", ")", "{", "return", "left", ";", "}", "public", "void", "setLeft", "(", "int", "left", ")", "{", "this", ".", "left", "=", "left", ";", "}", "public", "int", "getRight", "(", ")", "{", "return", "right", ";", "}", "public", "void", "setRight", "(", "int", "right", ")", "{", "this", ".", "right", "=", "right", ";", "}", "public", "String", "getValue", "(", ")", "{", "return", "value", ";", "}", "public", "void", "setValue", "(", "String", "value", ")", "{", "this", ".", "value", "=", "value", ";", "}", "public", "List", "<", "String", ">", "getCoveredIDs", "(", ")", "{", "return", "coveredIDs", ";", "}", "public", "Long", "getMatch", "(", ")", "{", "return", "match", ";", "}", "public", "void", "setMatch", "(", "Long", "match", ")", "{", "this", ".", "match", "=", "match", ";", "}", "public", "Double", "getStartTime", "(", ")", "{", "return", "startTime", ";", "}", "public", "void", "setStartTime", "(", "Double", "startTime", ")", "{", "this", ".", "startTime", "=", "startTime", ";", "}", "public", "Double", "getEndTime", "(", ")", "{", "return", "endTime", ";", "}", "public", "void", "setEndTime", "(", "Double", "endTime", ")", "{", "this", ".", "endTime", "=", "endTime", ";", "}", "public", "boolean", "isGap", "(", ")", "{", "return", "gap", ";", "}", "public", "void", "setGap", "(", "boolean", "gap", ")", "{", "this", ".", "gap", "=", "gap", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "id", "+", "\"", "->", "\"", "+", "value", "+", "\"", "(\"", "+", "left", "+", "\"-\"", "+", "right", "+", "\")\"", ";", "}", "}", "</s>" ]
8,936
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ".", "grid", ";", "import", "annis", ".", "gui", ".", "MatchedNodeColors", ";", "import", "annis", ".", "gui", ".", "media", ".", "MediaController", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VAnnotationGrid", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintException", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintTarget", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "AbstractComponent", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "ClientWidget", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "Map", ";", "@", "ClientWidget", "(", "VAnnotationGrid", ".", "class", ")", "public", "class", "AnnotationGrid", "extends", "AbstractComponent", "{", "private", "Map", "<", "String", ",", "ArrayList", "<", "Row", ">", ">", "rowsByAnnotation", ";", "private", "MediaController", "mediaController", ";", "private", "String", "resultID", ";", "public", "AnnotationGrid", "(", "MediaController", "mediaController", ",", "String", "resultID", ")", "{", "this", ".", "mediaController", "=", "mediaController", ";", "this", ".", "resultID", "=", "resultID", ";", "}", "@", "Override", "public", "void", "changeVariables", "(", "Object", "source", ",", "Map", "<", "String", ",", "Object", ">", "variables", ")", "{", "if", "(", "variables", ".", "containsKey", "(", "\"play\"", ")", ")", "{", "if", "(", "mediaController", "!=", "null", "&&", "resultID", "!=", "null", ")", "{", "String", "playString", "=", "(", "String", ")", "variables", ".", "get", "(", "\"play\"", ")", ";", "String", "[", "]", "split", "=", "playString", ".", "split", "(", "\"-\"", ")", ";", "if", "(", "split", ".", "length", "==", "1", ")", "{", "mediaController", ".", "play", "(", "resultID", ",", "Double", ".", "parseDouble", "(", "split", "[", "0", "]", ")", ")", ";", "}", "else", "if", "(", "split", ".", "length", "==", "2", ")", "{", "mediaController", ".", "play", "(", "resultID", ",", "Double", ".", "parseDouble", "(", "split", "[", "0", "]", ")", ",", "Double", ".", "parseDouble", "(", "split", "[", "1", "]", ")", ")", ";", "}", "}", "}", "}", "@", "Override", "public", "void", "paintContent", "(", "PaintTarget", "target", ")", "throws", "PaintException", "{", "super", ".", "paintContent", "(", "target", ")", ";", "if", "(", "rowsByAnnotation", "!=", "null", ")", "{", "target", ".", "startTag", "(", "\"rows\"", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "ArrayList", "<", "Row", ">", ">", "anno", ":", "rowsByAnnotation", ".", "entrySet", "(", ")", ")", "{", "for", "(", "Row", "row", ":", "anno", ".", "getValue", "(", ")", ")", "{", "target", ".", "startTag", "(", "\"row\"", ")", ";", "target", ".", "addAttribute", "(", "\"caption\"", ",", "anno", ".", "getKey", "(", ")", ")", ";", "ArrayList", "<", "GridEvent", ">", "rowEvents", "=", "row", ".", "getEvents", "(", ")", ";", "Collections", ".", "sort", "(", "rowEvents", ",", "new", "Comparator", "<", "GridEvent", ">", "(", ")", "{", "@", "Override", "public", "int", "compare", "(", "GridEvent", "o1", ",", "GridEvent", "o2", ")", "{", "return", "(", "(", "Integer", ")", "o1", ".", "getLeft", "(", ")", ")", ".", "compareTo", "(", "o2", ".", "getLeft", "(", ")", ")", ";", "}", "}", ")", ";", "target", ".", "startTag", "(", "\"events\"", ")", ";", "for", "(", "GridEvent", "event", ":", "rowEvents", ")", "{", "target", ".", "startTag", "(", "\"event\"", ")", ";", "target", ".", "addAttribute", "(", "\"id\"", ",", "event", ".", "getId", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"left\"", ",", "event", ".", "getLeft", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"right\"", ",", "event", ".", "getRight", "(", ")", ")", ";", "target", ".", "addAttribute", "(", "\"value\"", ",", "event", ".", "getValue", "(", ")", ")", ";", "if", "(", "event", ".", "getStartTime", "(", ")", "!=", "null", ")", "{", "target", ".", "addAttribute", "(", "\"startTime\"", ",", "event", ".", "getStartTime", "(", ")", ")", ";", "if", "(", "event", ".", "getEndTime", "(", ")", "!=", "null", ")", "{", "target", ".", "addAttribute", "(", "\"endTime\"", ",", "event", ".", "getEndTime", "(", ")", ")", ";", "}", "}", "ArrayList", "<", "String", ">", "styles", "=", "getStyles", "(", "event", ",", "anno", ".", "getKey", "(", ")", ")", ";", "if", "(", "styles", ".", "size", "(", ")", ">", "0", ")", "{", "target", ".", "addAttribute", "(", "\"style\"", ",", "styles", ".", "toArray", "(", ")", ")", ";", "}", "target", ".", "addAttribute", "(", "\"highlight\"", ",", "event", ".", "getCoveredIDs", "(", ")", ".", "toArray", "(", ")", ")", ";", "target", ".", "endTag", "(", "\"event\"", ")", ";", "}", "target", ".", "endTag", "(", "\"events\"", ")", ";", "target", ".", "endTag", "(", "\"row\"", ")", ";", "}", "}", "target", ".", "endTag", "(", "\"rows\"", ")", ";", "}", "}", "private", "ArrayList", "<", "String", ">", "getStyles", "(", "GridEvent", "event", ",", "String", "annoName", ")", "{", "ArrayList", "<", "String", ">", "styles", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "\"tok\"", ".", "equals", "(", "annoName", ")", ")", "{", "styles", ".", "add", "(", "\"token\"", ")", ";", "}", "else", "if", "(", "event", ".", "isGap", "(", ")", ")", "{", "styles", ".", "add", "(", "\"gap\"", ")", ";", "}", "else", "{", "styles", ".", "add", "(", "\"single_event\"", ")", ";", "}", "if", "(", "event", ".", "getMatch", "(", ")", "!=", "null", ")", "{", "styles", ".", "add", "(", "\"\"", "+", "MatchedNodeColors", ".", "colorClassByMatch", "(", "event", ".", "getMatch", "(", ")", ")", ")", ";", "}", "return", "styles", ";", "}", "public", "Map", "<", "String", ",", "ArrayList", "<", "Row", ">", ">", "getRowsByAnnotation", "(", ")", "{", "return", "rowsByAnnotation", ";", "}", "public", "void", "setRowsByAnnotation", "(", "Map", "<", "String", ",", "ArrayList", "<", "Row", ">", ">", "rowsByAnnotation", ")", "{", "this", ".", "rowsByAnnotation", "=", "rowsByAnnotation", ";", "}", "}", "</s>" ]
8,937
[ "<s>", "package", "annis", ".", "gui", ".", "widgets", ";", "import", "annis", ".", "gui", ".", "media", ".", "MediaPlayer", ";", "import", "annis", ".", "gui", ".", "media", ".", "MimeTypeErrorListener", ";", "import", "annis", ".", "gui", ".", "widgets", ".", "gwt", ".", "client", ".", "VMediaPlayerBase", ";", "import", "annis", ".", "visualizers", ".", "LoadableVisualizer", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintException", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "PaintTarget", ";", "import", "com", ".", "vaadin", ".", "terminal", ".", "gwt", ".", "client", ".", "VConsole", ";", "import", "com", ".", "vaadin", ".", "ui", ".", "AbstractComponent", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "public", "abstract", "class", "MediaPlayerBase", "extends", "AbstractComponent", "implements", "MediaPlayer", ",", "LoadableVisualizer", "{", "public", "enum", "PlayerAction", "{", "idle", ",", "play", ",", "pause", ",", "stop", "}", "private", "PlayerAction", "action", ";", "private", "Double", "startTime", ";", "private", "Double", "endTime", ";", "private", "boolean", "sourcesAdded", ";", "private", "String", "resourceURL", ";", "private", "String", "mimeType", ";", "private", "boolean", "wasLoaded", ";", "private", "Set", "<", "Callback", ">", "callbacks", ";", "public", "MediaPlayerBase", "(", "String", "resourceURL", ",", "String", "mimeType", ")", "{", "this", ".", "resourceURL", "=", "resourceURL", ";", "this", ".", "mimeType", "=", "mimeType", ";", "this", ".", "callbacks", "=", "new", "HashSet", "<", "Callback", ">", "(", ")", ";", "this", ".", "wasLoaded", "=", "false", ";", "}", "@", "Override", "public", "void", "play", "(", "double", "start", ")", "{", "action", "=", "PlayerAction", ".", "play", ";", "startTime", "=", "start", ";", "endTime", "=", "null", ";", "requestRepaint", "(", ")", ";", "}", "@", "Override", "public", "void", "play", "(", "double", "start", ",", "double", "end", ")", "{", "action", "=", "PlayerAction", ".", "play", ";", "startTime", "=", "start", ";", "endTime", "=", "end", ";", "requestRepaint", "(", ")", ";", "}", "@", "Override", "public", "void", "pause", "(", ")", "{", "action", "=", "PlayerAction", ".", "pause", ";", "requestRepaint", "(", ")", ";", "}", "@", "Override", "public", "void", "stop", "(", ")", "{", "action", "=", "PlayerAction", ".", "stop", ";", "requestRepaint", "(", ")", ";", "}", "@", "Override", "public", "void", "changeVariables", "(", "Object", "source", ",", "Map", "<", "String", ",", "Object", ">", "variables", ")", "{", "super", ".", "changeVariables", "(", "source", ",", "variables", ")", ";", "if", "(", "(", "Boolean", ")", "variables", ".", "get", "(", "VMediaPlayerBase", ".", "CANNOT_PLAY", ")", "==", "Boolean", ".", "TRUE", ")", "{", "if", "(", "getWindow", "(", ")", "instanceof", "MimeTypeErrorListener", ")", "{", "(", "(", "MimeTypeErrorListener", ")", "getWindow", "(", ")", ")", ".", "notifyCannotPlayMimeType", "(", "mimeType", ")", ";", "}", "}", "if", "(", "(", "Boolean", ")", "variables", ".", "get", "(", "VMediaPlayerBase", ".", "PLAYER_LOADED", ")", "==", "Boolean", ".", "TRUE", ")", "{", "wasLoaded", "=", "true", ";", "for", "(", "Callback", "c", ":", "callbacks", ")", "{", "c", ".", "visualizerLoaded", "(", "this", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "detach", "(", ")", "{", "super", ".", "detach", "(", ")", ";", "wasLoaded", "=", "false", ";", "sourcesAdded", "=", "false", ";", "startTime", "=", "null", ";", "endTime", "=", "null", ";", "}", "@", "Override", "public", "void", "paintContent", "(", "PaintTarget", "target", ")", "throws", "PaintException", "{", "super", ".", "paintContent", "(", "target", ")", ";", "if", "(", "target", ".", "isFullRepaint", "(", ")", ")", "{", "sourcesAdded", "=", "false", ";", "wasLoaded", "=", "false", ";", "}", "boolean", "sourcesNeeded", "=", "true", ";", "if", "(", "action", "==", "PlayerAction", ".", "play", ")", "{", "String", "[", "]", "args", ";", "if", "(", "endTime", "==", "null", ")", "{", "args", "=", "new", "String", "[", "]", "{", "\"\"", "+", "startTime", "}", ";", "}", "else", "{", "args", "=", "new", "String", "[", "]", "{", "\"\"", "+", "startTime", ",", "\"\"", "+", "endTime", "}", ";", "}", "target", ".", "addAttribute", "(", "VMediaPlayerBase", ".", "PLAY", ",", "args", ")", ";", "action", "=", "PlayerAction", ".", "idle", ";", "}", "else", "if", "(", "action", "==", "PlayerAction", ".", "pause", ")", "{", "target", ".", "addAttribute", "(", "VMediaPlayerBase", ".", "PAUSE", ",", "true", ")", ";", "action", "=", "PlayerAction", ".", "idle", ";", "}", "else", "if", "(", "action", "==", "PlayerAction", ".", "stop", ")", "{", "target", ".", "addAttribute", "(", "VMediaPlayerBase", ".", "STOP", ",", "true", ")", ";", "action", "=", "PlayerAction", ".", "idle", ";", "sourcesAdded", "=", "false", ";", "sourcesNeeded", "=", "false", ";", "}", "if", "(", "sourcesNeeded", "&&", "!", "sourcesAdded", ")", "{", "target", ".", "addAttribute", "(", "VMediaPlayerBase", ".", "SOURCE_URL", ",", "resourceURL", ")", ";", "target", ".", "addAttribute", "(", "VMediaPlayerBase", ".", "MIME_TYPE", ",", "mimeType", ")", ";", "sourcesAdded", "=", "true", ";", "}", "}", "@", "Override", "public", "void", "addOnLoadCallBack", "(", "Callback", "callback", ")", "{", "this", ".", "callbacks", ".", "add", "(", "callback", ")", ";", "}", "@", "Override", "public", "void", "clearCallbacks", "(", ")", "{", "this", ".", "callbacks", ".", "clear", "(", ")", ";", "}", "@", "Override", "public", "boolean", "isLoaded", "(", ")", "{", "return", "wasLoaded", ";", "}", "}", "</s>" ]
8,938
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "service", ";", "import", "java", ".", "util", ".", "List", ";", "import", "javax", ".", "inject", ".", "Inject", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ".", "Person", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "jpa", ".", "dao", ".", "PersonDao", ";", "public", "class", "PersonServerImpl", "implements", "PersonService", "{", "@", "Inject", "private", "PersonDao", "dao", ";", "public", "void", "removePerson", "(", "Person", "person", ")", "{", "dao", ".", "delete", "(", "person", ")", ";", "}", "public", "Person", "savePerson", "(", "Person", "person", ")", "{", "return", "dao", ".", "persist", "(", "person", ")", ";", "}", "public", "Person", "updatePerson", "(", "Person", "person", ")", "{", "return", "dao", ".", "update", "(", "person", ")", ";", "}", "public", "List", "<", "Person", ">", "findAllPersons", "(", ")", "{", "return", "dao", ".", "loadAll", "(", ")", ";", "}", "public", "Person", "findPersonById", "(", "String", "id", ")", "{", "return", "dao", ".", "loadById", "(", "id", ")", ";", "}", "public", "List", "<", "Person", ">", "findPersonsByLastName", "(", "String", "lastName", ")", "{", "return", "dao", ".", "findByLastName", "(", "lastName", ")", ";", "}", "}", "</s>" ]
8,939
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "service", ";", "import", "java", ".", "util", ".", "List", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ".", "Person", ";", "public", "interface", "PersonService", "{", "Person", "savePerson", "(", "Person", "person", ")", ";", "void", "removePerson", "(", "Person", "person", ")", ";", "Person", "updatePerson", "(", "Person", "person", ")", ";", "Person", "findPersonById", "(", "String", "id", ")", ";", "List", "<", "Person", ">", "findAllPersons", "(", ")", ";", "List", "<", "Person", ">", "findPersonsByLastName", "(", "String", "lastName", ")", ";", "}", "</s>" ]
8,940
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "jpa", ".", "dao", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "List", ";", "import", "javax", ".", "persistence", ".", "EntityManager", ";", "import", "javax", ".", "persistence", ".", "PersistenceContext", ";", "import", "javax", ".", "persistence", ".", "Query", ";", "import", "org", ".", "apache", ".", "myfaces", ".", "extensions", ".", "cdi", ".", "jpa", ".", "api", ".", "Transactional", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ".", "Person", ";", "public", "class", "PersonDao", "{", "@", "Transactional", "public", "void", "delete", "(", "Person", "entity", ")", "{", "em", ".", "remove", "(", "em", ".", "merge", "(", "entity", ")", ")", ";", "}", "@", "Transactional", "public", "Person", "persist", "(", "Person", "entity", ")", "{", "em", ".", "persist", "(", "entity", ")", ";", "return", "entity", ";", "}", "@", "Transactional", "public", "Person", "update", "(", "Person", "entity", ")", "{", "return", "em", ".", "merge", "(", "entity", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "List", "<", "Person", ">", "loadAll", "(", ")", "{", "return", "em", ".", "createQuery", "(", "\"\"", "+", "Person", ".", "class", ".", "getSimpleName", "(", ")", "+", "\"", "t\"", ")", ".", "getResultList", "(", ")", ";", "}", "public", "Person", "loadById", "(", "Serializable", "id", ")", "{", "return", "em", ".", "find", "(", "Person", ".", "class", ",", "id", ")", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "List", "<", "Person", ">", "findByLastName", "(", "String", "lastname", ")", "{", "if", "(", "lastname", "==", "null", ")", "return", "Collections", ".", "emptyList", "(", ")", ";", "Query", "q", "=", "em", ".", "createQuery", "(", "QUERY_BY_LASTNAME", ")", ";", "q", ".", "setParameter", "(", "\"\"", ",", "lastname", ".", "toLowerCase", "(", ")", "+", "\"%\"", ")", ";", "return", "q", ".", "getResultList", "(", ")", ";", "}", "@", "PersistenceContext", "(", "unitName", "=", "\"\"", ")", "protected", "EntityManager", "em", ";", "private", "final", "String", "QUERY_BY_LASTNAME", "=", "\"\"", ";", "}", "</s>" ]
8,941
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ";", "import", "javax", ".", "persistence", ".", "Basic", ";", "import", "javax", ".", "persistence", ".", "DiscriminatorValue", ";", "import", "javax", ".", "persistence", ".", "Entity", ";", "@", "Entity", "@", "DiscriminatorValue", "(", "\"'F'\"", ")", "public", "class", "Friend", "extends", "Person", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "@", "Basic", "private", "String", "nickname", ";", "public", "String", "getNickname", "(", ")", "{", "return", "nickname", ";", "}", "public", "void", "setNickname", "(", "String", "nickname", ")", "{", "this", ".", "nickname", "=", "nickname", ";", "}", "}", "</s>" ]
8,942
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ";", "import", "java", ".", "io", ".", "Serializable", ";", "import", "javax", ".", "persistence", ".", "GeneratedValue", ";", "import", "javax", ".", "persistence", ".", "GenerationType", ";", "import", "javax", ".", "persistence", ".", "Id", ";", "import", "javax", ".", "persistence", ".", "MappedSuperclass", ";", "import", "javax", ".", "persistence", ".", "Version", ";", "@", "MappedSuperclass", "public", "abstract", "class", "PersistentObject", "implements", "Serializable", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "@", "Id", "@", "GeneratedValue", "(", "strategy", "=", "GenerationType", ".", "AUTO", ")", "private", "String", "id", ";", "@", "Version", "private", "int", "versionId", ";", "public", "String", "getId", "(", ")", "{", "return", "id", ";", "}", "public", "void", "setId", "(", "String", "id", ")", "{", "this", ".", "id", "=", "id", ";", "}", "public", "int", "getVersionId", "(", ")", "{", "return", "versionId", ";", "}", "}", "</s>" ]
8,943
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ";", "import", "javax", ".", "persistence", ".", "DiscriminatorColumn", ";", "import", "javax", ".", "persistence", ".", "DiscriminatorType", ";", "import", "javax", ".", "persistence", ".", "Entity", ";", "import", "javax", ".", "persistence", ".", "Inheritance", ";", "import", "javax", ".", "persistence", ".", "InheritanceType", ";", "@", "Entity", "@", "DiscriminatorColumn", "(", "name", "=", "\"TYPE\"", ",", "discriminatorType", "=", "DiscriminatorType", ".", "STRING", ")", "@", "Inheritance", "(", "strategy", "=", "InheritanceType", ".", "JOINED", ")", "public", "abstract", "class", "Person", "extends", "PersistentObject", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "private", "String", "firstname", ";", "private", "String", "lastname", ";", "public", "String", "getFirstname", "(", ")", "{", "return", "firstname", ";", "}", "public", "void", "setFirstname", "(", "String", "firstname", ")", "{", "this", ".", "firstname", "=", "firstname", ";", "}", "public", "String", "getLastname", "(", ")", "{", "return", "lastname", ";", "}", "public", "void", "setLastname", "(", "String", "lastname", ")", "{", "this", ".", "lastname", "=", "lastname", ";", "}", "}", "</s>" ]
8,944
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "faces", ";", "import", "java", ".", "util", ".", "List", ";", "import", "javax", ".", "enterprise", ".", "context", ".", "RequestScoped", ";", "import", "javax", ".", "inject", ".", "Inject", ";", "import", "javax", ".", "inject", ".", "Named", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ".", "Person", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "service", ".", "PersonService", ";", "@", "Named", "(", "\"allPersons\"", ")", "@", "RequestScoped", "public", "class", "AllPersonsController", "{", "@", "Inject", "private", "PersonService", "service", ";", "private", "Person", "toDelete", ";", "public", "List", "<", "Person", ">", "getPersons", "(", ")", "{", "return", "service", ".", "findAllPersons", "(", ")", ";", "}", "public", "void", "setToDelete", "(", "Person", "toDelete", ")", "{", "this", ".", "toDelete", "=", "toDelete", ";", "}", "public", "Person", "getToDelete", "(", ")", "{", "return", "toDelete", ";", "}", "public", "String", "delete", "(", ")", "{", "service", ".", "removePerson", "(", "toDelete", ")", ";", "return", "null", ";", "}", "}", "</s>" ]
8,945
[ "<s>", "package", "net", ".", "wessendorf", ".", "enterprise", ".", "faces", ";", "import", "javax", ".", "enterprise", ".", "context", ".", "RequestScoped", ";", "import", "javax", ".", "inject", ".", "Inject", ";", "import", "javax", ".", "inject", ".", "Named", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "beans", ".", "Friend", ";", "import", "net", ".", "wessendorf", ".", "enterprise", ".", "service", ".", "PersonService", ";", "@", "Named", "(", "\"createPerson\"", ")", "@", "RequestScoped", "public", "class", "CreatePersonController", "{", "@", "Inject", "private", "PersonService", "service", ";", "private", "Friend", "person", "=", "new", "Friend", "(", ")", ";", "public", "String", "createPerson", "(", ")", "{", "service", ".", "savePerson", "(", "person", ")", ";", "return", "\"\"", ";", "}", "public", "Friend", "getPerson", "(", ")", "{", "return", "person", ";", "}", "public", "void", "setPerson", "(", "Friend", "person", ")", "{", "this", ".", "person", "=", "person", ";", "}", "}", "</s>" ]
8,946
[ "<s>", "package", "org", ".", "elasticsearch", ".", "river", ".", "redis", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "*", ";", "import", "org", ".", "junit", ".", "*", ";", "import", "static", "org", ".", "elasticsearch", ".", "common", ".", "xcontent", ".", "XContentFactory", ".", "jsonBuilder", ";", "import", "org", ".", "elasticsearch", ".", "action", ".", "admin", ".", "indices", ".", "create", ".", "CreateIndexRequest", ";", "import", "org", ".", "elasticsearch", ".", "action", ".", "admin", ".", "indices", ".", "delete", ".", "DeleteIndexRequest", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "settings", ".", "ImmutableSettings", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "xcontent", ".", "XContentBuilder", ";", "import", "org", ".", "elasticsearch", ".", "indices", ".", "IndexMissingException", ";", "import", "org", ".", "elasticsearch", ".", "node", ".", "Node", ";", "import", "org", ".", "elasticsearch", ".", "node", ".", "NodeBuilder", ";", "import", "redis", ".", "clients", ".", "jedis", ".", "Jedis", ";", "public", "class", "RedisRiverTest", "{", "private", "static", "Node", "node", ";", "private", "static", "Jedis", "jedis", ";", "@", "BeforeClass", "public", "static", "void", "setupTest", "(", ")", "throws", "Exception", "{", "jedis", "=", "new", "Jedis", "(", "\"localhost\"", ")", ";", "}", "@", "Test", "public", "void", "canConnect", "(", ")", "throws", "Exception", "{", "assertNotNull", "(", "jedis", ")", ";", "}", "@", "Test", "public", "void", "canPush", "(", ")", "throws", "Exception", "{", "assertNotNull", "(", "jedis", ")", ";", "}", "}", "</s>" ]
8,947
[ "<s>", "package", "org", ".", "elasticsearch", ".", "river", ".", "redis", ";", "import", "org", ".", "elasticsearch", ".", "ExceptionsHelper", ";", "import", "org", ".", "elasticsearch", ".", "action", ".", "ActionListener", ";", "import", "org", ".", "elasticsearch", ".", "action", ".", "bulk", ".", "BulkRequestBuilder", ";", "import", "org", ".", "elasticsearch", ".", "action", ".", "bulk", ".", "BulkResponse", ";", "import", "org", ".", "elasticsearch", ".", "client", ".", "Client", ";", "import", "org", ".", "elasticsearch", ".", "client", ".", "Requests", ";", "import", "org", ".", "elasticsearch", ".", "cluster", ".", "block", ".", "ClusterBlockException", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "Strings", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "inject", ".", "Inject", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "unit", ".", "TimeValue", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "xcontent", ".", "XContentBuilder", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "xcontent", ".", "XContentFactory", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "xcontent", ".", "support", ".", "XContentMapValues", ";", "import", "org", ".", "elasticsearch", ".", "indices", ".", "IndexAlreadyExistsException", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "AbstractRiverComponent", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "River", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "RiverName", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "RiverSettings", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "util", ".", "concurrent", ".", "EsExecutors", ";", "import", "org", ".", "elasticsearch", ".", "threadpool", ".", "ThreadPool", ";", "import", "java", ".", "util", ".", "concurrent", ".", "Executors", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ScheduledExecutorService", ";", "import", "java", ".", "util", ".", "concurrent", ".", "ScheduledFuture", ";", "import", "java", ".", "util", ".", "concurrent", ".", "TimeUnit", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "redis", ".", "clients", ".", "jedis", ".", "Jedis", ";", "import", "redis", ".", "clients", ".", "jedis", ".", "JedisPool", ";", "import", "redis", ".", "clients", ".", "jedis", ".", "JedisPubSub", ";", "public", "class", "RedisRiver", "extends", "AbstractRiverComponent", "implements", "River", "{", "private", "final", "Client", "client", ";", "private", "volatile", "Thread", "thread", ";", "private", "volatile", "boolean", "closed", "=", "false", ";", "private", "volatile", "BulkRequestBuilder", "currentRequest", ";", "private", "volatile", "JedisPool", "jedisPool", ";", "private", "final", "String", "redisHost", ";", "private", "final", "int", "redisPort", ";", "private", "final", "String", "redisKey", ";", "private", "final", "String", "redisMode", ";", "private", "final", "int", "redisDB", ";", "private", "final", "int", "bulkSize", ";", "private", "final", "int", "bulkTimeout", ";", "@", "Inject", "public", "RedisRiver", "(", "RiverName", "riverName", ",", "RiverSettings", "settings", ",", "Client", "client", ")", "{", "super", "(", "riverName", ",", "settings", ")", ";", "this", ".", "client", "=", "client", ";", "if", "(", "settings", ".", "settings", "(", ")", ".", "containsKey", "(", "\"redis\"", ")", ")", "{", "Map", "<", "String", ",", "Object", ">", "redisSettings", "=", "(", "Map", "<", "String", ",", "Object", ">", ")", "settings", ".", "settings", "(", ")", ".", "get", "(", "\"redis\"", ")", ";", "redisHost", "=", "XContentMapValues", ".", "nodeStringValue", "(", "redisSettings", ".", "get", "(", "\"host\"", ")", ",", "\"localhost\"", ")", ";", "redisPort", "=", "XContentMapValues", ".", "nodeIntegerValue", "(", "redisSettings", ".", "get", "(", "\"port\"", ")", ",", "6379", ")", ";", "redisKey", "=", "XContentMapValues", ".", "nodeStringValue", "(", "redisSettings", ".", "get", "(", "\"key\"", ")", ",", "\"redis_river\"", ")", ";", "redisMode", "=", "XContentMapValues", ".", "nodeStringValue", "(", "redisSettings", ".", "get", "(", "\"mode\"", ")", ",", "\"list\"", ")", ";", "redisDB", "=", "XContentMapValues", ".", "nodeIntegerValue", "(", "redisSettings", ".", "get", "(", "\"database\"", ")", ",", "0", ")", ";", "}", "else", "{", "redisHost", "=", "\"localhost\"", ";", "redisPort", "=", "6379", ";", "redisKey", "=", "\"redis_river\"", ";", "redisMode", "=", "\"list\"", ";", "redisDB", "=", "0", ";", "}", "if", "(", "settings", ".", "settings", "(", ")", ".", "containsKey", "(", "\"index\"", ")", ")", "{", "Map", "<", "String", ",", "Object", ">", "indexSettings", "=", "(", "Map", "<", "String", ",", "Object", ">", ")", "settings", ".", "settings", "(", ")", ".", "get", "(", "\"index\"", ")", ";", "bulkSize", "=", "XContentMapValues", ".", "nodeIntegerValue", "(", "indexSettings", ".", "get", "(", "\"bulk_size\"", ")", ",", "100", ")", ";", "bulkTimeout", "=", "XContentMapValues", ".", "nodeIntegerValue", "(", "indexSettings", ".", "get", "(", "\"bulk_timeout\"", ")", ",", "5", ")", ";", "}", "else", "{", "bulkSize", "=", "100", ";", "bulkTimeout", "=", "5", ";", "}", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "logger", ".", "info", "(", "\"\"", ",", "redisHost", ",", "redisPort", ",", "redisKey", ",", "redisDB", ",", "bulkSize", ",", "bulkTimeout", ")", ";", "}", "@", "Override", "public", "void", "start", "(", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "logger", ".", "info", "(", "\"\"", ")", ";", "try", "{", "this", ".", "jedisPool", "=", "new", "JedisPool", "(", "this", ".", "redisHost", ",", "this", ".", "redisPort", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "return", ";", "}", "currentRequest", "=", "client", ".", "prepareBulk", "(", ")", ";", "if", "(", "redisMode", ".", "equalsIgnoreCase", "(", "\"list\"", ")", ")", "{", "thread", "=", "EsExecutors", ".", "daemonThreadFactory", "(", "settings", ".", "globalSettings", "(", ")", ",", "\"\"", ")", ".", "newThread", "(", "new", "RedisListRunner", "(", ")", ")", ";", "}", "else", "if", "(", "redisMode", ".", "equalsIgnoreCase", "(", "\"pubsub\"", ")", ")", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "return", ";", "}", "else", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "return", ";", "}", "thread", ".", "start", "(", ")", ";", "}", "@", "Override", "public", "void", "close", "(", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "logger", ".", "info", "(", "\"\"", ")", ";", "closed", "=", "true", ";", "if", "(", "thread", "!=", "null", ")", "{", "thread", ".", "interrupt", "(", ")", ";", "}", "}", "private", "class", "RedisPubSubRunner", "implements", "Runnable", "{", "private", "Jedis", "jedis", ";", "private", "boolean", "updating", "=", "false", ";", "private", "final", "ScheduledExecutorService", "watchScheduler", ";", "private", "ScheduledFuture", "<", "?", ">", "watchFuture", ";", "public", "RedisPubSubRunner", "(", ")", "{", "super", "(", ")", ";", "this", ".", "watchScheduler", "=", "Executors", ".", "newScheduledThreadPool", "(", "1", ")", ";", "}", "@", "Override", "public", "void", "run", "(", ")", "{", "try", "{", "this", ".", "jedis", "=", "jedisPool", ".", "getResource", "(", ")", ";", "if", "(", "redisDB", ">", "0", ")", "{", "this", ".", "jedis", ".", "select", "(", "redisDB", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "return", ";", "}", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ",", "redisKey", ")", ";", "this", ".", "jedis", ".", "subscribe", "(", "new", "RiverListener", "(", ")", ",", "redisKey", ")", ";", "watchFuture", "=", "watchScheduler", ".", "scheduleWithFixedDelay", "(", "(", "Runnable", ")", "new", "BulkWatcher", "(", ")", ",", "5", ",", "5", ",", "TimeUnit", ".", "SECONDS", ")", ";", "}", "private", "void", "processBulkIfNeeded", "(", "Boolean", "force", ")", "{", "logger", ".", "info", "(", "\"\"", ")", ";", "if", "(", "updating", ")", "{", "return", ";", "}", "updating", "=", "true", ";", "int", "actionCount", "=", "currentRequest", ".", "numberOfActions", "(", ")", ";", "if", "(", "actionCount", "!=", "0", "&&", "(", "actionCount", ">", "bulkSize", "||", "force", "==", "true", ")", ")", "{", "try", "{", "BulkResponse", "response", "=", "currentRequest", ".", "execute", "(", ")", ".", "actionGet", "(", ")", ";", "if", "(", "response", ".", "hasFailures", "(", ")", ")", "{", "logger", ".", "error", "(", "\"\"", "+", "response", ".", "buildFailureMessage", "(", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ",", "e", ")", ";", "}", "currentRequest", "=", "client", ".", "prepareBulk", "(", ")", ";", "}", "updating", "=", "false", ";", "logger", ".", "info", "(", "\"\"", ")", ";", "}", "private", "class", "BulkWatcher", "implements", "Runnable", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "processBulkIfNeeded", "(", "true", ")", ";", "}", "}", "private", "class", "RiverListener", "extends", "JedisPubSub", "{", "private", "void", "queueMessage", "(", "String", "message", ")", "{", "try", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ")", ";", "byte", "[", "]", "data", "=", "message", ".", "getBytes", "(", ")", ";", "currentRequest", ".", "add", "(", "data", ",", "0", ",", "data", ".", "length", ",", "false", ")", ";", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"Current", "size\"", "+", "currentRequest", ".", "numberOfActions", "(", ")", ")", ";", "processBulkIfNeeded", "(", "false", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "}", "}", "public", "void", "onMessage", "(", "String", "channel", ",", "String", "message", ")", "{", "queueMessage", "(", "message", ")", ";", "}", "public", "void", "onSubscribe", "(", "String", "channel", ",", "int", "subscribedChannels", ")", "{", "}", "public", "void", "onUnsubscribe", "(", "String", "channel", ",", "int", "subscribedChannels", ")", "{", "}", "public", "void", "onPSubscribe", "(", "String", "pattern", ",", "int", "subscribedChannels", ")", "{", "}", "public", "void", "onPUnsubscribe", "(", "String", "pattern", ",", "int", "subscribedChannels", ")", "{", "}", "public", "void", "onPMessage", "(", "String", "pattern", ",", "String", "channel", ",", "String", "message", ")", "{", "}", "}", "}", "private", "class", "RedisListRunner", "implements", "Runnable", "{", "private", "Jedis", "jedis", ";", "@", "Override", "public", "void", "run", "(", ")", "{", "logger", ".", "info", "(", "\"\"", ")", ";", "while", "(", "true", ")", "{", "if", "(", "closed", ")", "{", "return", ";", "}", "loop", "(", ")", ";", "}", "}", "private", "void", "loop", "(", ")", "{", "List", "<", "String", ">", "response", ";", "try", "{", "this", ".", "jedis", "=", "jedisPool", ".", "getResource", "(", ")", ";", "if", "(", "redisDB", ">", "0", ")", "{", "jedis", ".", "select", "(", "redisDB", ")", ";", "}", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ")", ";", "response", "=", "jedis", ".", "blpop", "(", "bulkTimeout", ",", "redisKey", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "logger", ".", "isInfoEnabled", "(", ")", ")", "logger", ".", "info", "(", "\"\"", ")", ";", "jedisPool", ".", "returnBrokenResource", "(", "this", ".", "jedis", ")", ";", "try", "{", "Thread", ".", "sleep", "(", "5000", ")", ";", "}", "catch", "(", "InterruptedException", "e1", ")", "{", "}", "return", ";", "}", "if", "(", "response", "!=", "null", ")", "{", "try", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ",", "response", ")", ";", "byte", "[", "]", "data", "=", "response", ".", "get", "(", "1", ")", ".", "getBytes", "(", ")", ";", "currentRequest", ".", "add", "(", "data", ",", "0", ",", "data", ".", "length", ",", "false", ")", ";", "processBulkIfNeeded", "(", "false", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ")", ";", "}", "}", "else", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ")", ";", "processBulkIfNeeded", "(", "true", ")", ";", "}", "jedisPool", ".", "returnResource", "(", "this", ".", "jedis", ")", ";", "}", "private", "void", "processBulkIfNeeded", "(", "Boolean", "force", ")", "{", "int", "actionCount", "=", "currentRequest", ".", "numberOfActions", "(", ")", ";", "if", "(", "actionCount", "!=", "0", "&&", "(", "actionCount", ">", "bulkSize", "||", "force", "==", "true", ")", ")", "{", "try", "{", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "logger", ".", "debug", "(", "\"\"", ",", "actionCount", ",", "bulkSize", ",", "force", ")", ";", "BulkResponse", "response", "=", "currentRequest", ".", "execute", "(", ")", ".", "actionGet", "(", ")", ";", "if", "(", "response", ".", "hasFailures", "(", ")", ")", "{", "logger", ".", "error", "(", "\"\"", "+", "response", ".", "buildFailureMessage", "(", ")", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "logger", ".", "error", "(", "\"\"", ",", "e", ")", ";", "}", "currentRequest", "=", "client", ".", "prepareBulk", "(", ")", ";", "}", "else", "if", "(", "logger", ".", "isDebugEnabled", "(", ")", ")", "{", "logger", ".", "debug", "(", "\"\"", ",", "actionCount", ",", "bulkSize", ",", "force", ")", ";", "}", "}", "}", "}", "</s>" ]
8,948
[ "<s>", "package", "org", ".", "elasticsearch", ".", "river", ".", "redis", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "inject", ".", "AbstractModule", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "River", ";", "public", "class", "RedisRiverModule", "extends", "AbstractModule", "{", "@", "Override", "protected", "void", "configure", "(", ")", "{", "bind", "(", "River", ".", "class", ")", ".", "to", "(", "RedisRiver", ".", "class", ")", ".", "asEagerSingleton", "(", ")", ";", "}", "}", "</s>" ]
8,949
[ "<s>", "package", "org", ".", "elasticsearch", ".", "plugin", ".", "river", ".", "redis", ";", "import", "org", ".", "elasticsearch", ".", "common", ".", "inject", ".", "Inject", ";", "import", "org", ".", "elasticsearch", ".", "plugins", ".", "AbstractPlugin", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "RiversModule", ";", "import", "org", ".", "elasticsearch", ".", "river", ".", "redis", ".", "RedisRiverModule", ";", "public", "class", "RedisRiverPlugin", "extends", "AbstractPlugin", "{", "@", "Inject", "public", "RedisRiverPlugin", "(", ")", "{", "}", "@", "Override", "public", "String", "name", "(", ")", "{", "return", "\"river-redis\"", ";", "}", "@", "Override", "public", "String", "description", "(", ")", "{", "return", "\"\"", ";", "}", "public", "void", "onModule", "(", "RiversModule", "module", ")", "{", "module", ".", "registerRiver", "(", "\"redis\"", ",", "RedisRiverModule", ".", "class", ")", ";", "}", "}", "</s>" ]
8,950
[ "<s>", "package", "com", ".", "fuze", ".", "Roll", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "text", ".", "SimpleDateFormat", ";", "import", "java", ".", "util", ".", "Calendar", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "java", ".", "util", ".", "Random", ";", "import", "java", ".", "util", ".", "logging", ".", "Logger", ";", "import", "org", ".", "bukkit", ".", "command", ".", "Command", ";", "import", "org", ".", "bukkit", ".", "command", ".", "CommandSender", ";", "import", "org", ".", "bukkit", ".", "entity", ".", "Player", ";", "import", "org", ".", "bukkit", ".", "plugin", ".", "java", ".", "JavaPlugin", ";", "import", "org", ".", "bukkit", ".", "util", ".", "config", ".", "Configuration", ";", "public", "class", "Roll", "extends", "JavaPlugin", "{", "private", "Logger", "log", "=", "Logger", ".", "getLogger", "(", "\"Minecraft\"", ")", ";", "public", "Configuration", "config", ";", "static", "String", "mainDirectory", "=", "\"plugins/Roll\"", ";", "static", "File", "logfile", "=", "new", "File", "(", "mainDirectory", "+", "File", ".", "separator", "+", "\"rolls.log\"", ")", ";", "static", "Properties", "prop", "=", "new", "Properties", "(", ")", ";", "Random", "rnd", "=", "new", "Random", "(", ")", ";", "public", "String", "pVer", "=", "\"0.2\"", ";", "public", "String", "pName", "=", "\"Roll\"", ";", "public", "int", "default_max", "=", "100", ";", "public", "int", "max", "=", "99999", ";", "public", "String", "msg_to_player", "=", "\"\"", ";", "public", "String", "msg_to_all", "=", "\"\"", ";", "public", "String", "numbers_format", "=", "\"%1,", "%2\"", ";", "public", "String", "msg_error_first_bigger", "=", "\"\"", ";", "public", "String", "msg_error_equal", "=", "\"\"", ";", "public", "String", "msg_error_negative", "=", "\"\"", ";", "public", "String", "msg_error_max", "=", "\"\"", ";", "public", "String", "msg_error_no_perms", "=", "\"\"", ";", "public", "boolean", "allow_negative", "=", "false", ";", "public", "boolean", "allow_equal", "=", "false", ";", "public", "boolean", "msg_broadcast", "=", "true", ";", "public", "boolean", "broadcast_numbers", "=", "true", ";", "public", "static", "boolean", "msg_log", "=", "true", ";", "@", "Override", "public", "void", "onDisable", "(", ")", "{", "out", "(", "\"[\"", "+", "pName", "+", "\"", "v\"", "+", "pVer", "+", "\"]\"", "+", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "onEnable", "(", ")", "{", "out", "(", "\"[\"", "+", "pName", "+", "\"", "v\"", "+", "pVer", "+", "\"]\"", "+", "\"", "is", "enabled!\"", ")", ";", "config", "=", "getConfiguration", "(", ")", ";", "if", "(", "!", "(", "new", "File", "(", "getDataFolder", "(", ")", ",", "\"config.yml\"", ")", ")", ".", "exists", "(", ")", ")", "{", "defaultConfig", "(", ")", ";", "}", "loadConfig", "(", ")", ";", "if", "(", "!", "logfile", ".", "exists", "(", ")", ")", "{", "try", "{", "logfile", ".", "createNewFile", "(", ")", ";", "FileOutputStream", "out", "=", "new", "FileOutputStream", "(", "logfile", ")", ";", "prop", ".", "store", "(", "out", ",", "null", ")", ";", "out", ".", "flush", "(", ")", ";", "out", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "log", ".", "info", "(", "\"\"", ")", ";", "}", "}", "}", "public", "boolean", "onCommand", "(", "CommandSender", "sender", ",", "Command", "command", ",", "String", "commandLabel", ",", "String", "[", "]", "args", ")", "{", "String", "commandName", "=", "command", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ";", "Player", "player", "=", "(", "Player", ")", "sender", ";", "int", "roll", "=", "0", ";", "if", "(", "commandName", ".", "equalsIgnoreCase", "(", "\"roll\"", ")", ")", "{", "if", "(", "!", "canRoll", "(", "player", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_no_perms", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "if", "(", "args", ".", "length", "==", "0", ")", "{", "roll", "=", "rndNumber", "(", "default_max", ")", ";", "player", ".", "sendMessage", "(", "parse", "(", "msg_to_player", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "broadcast", "(", "player", ",", "parse", "(", "msg_to_all", ",", "player", ",", "roll", ",", "toString", "(", "roll", ")", ",", "\"\"", ")", ")", ";", "out", "(", "parseToConsole", "(", "msg_to_all", ",", "player", ",", "roll", ",", "toString", "(", "roll", ")", ",", "\"\"", ")", ")", ";", "write", "(", "\"[\"", "+", "date", "(", "\"\"", ")", "+", "\"]", "\"", "+", "player", ".", "getName", "(", ")", "+", "\"", "rolled", "\"", "+", "roll", "+", "\"\"", ")", ";", "}", "else", "if", "(", "args", ".", "length", "==", "1", ")", "{", "if", "(", "toInt", "(", "args", "[", "0", "]", ")", ">", "max", "&&", "!", "noLimit", "(", "player", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_max", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "if", "(", "toInt", "(", "args", "[", "0", "]", ")", "<", "0", "&&", "!", "allow_negative", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_negative", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "roll", "=", "rndNumber", "(", "toInt", "(", "args", "[", "0", "]", ")", ")", ";", "player", ".", "sendMessage", "(", "parse", "(", "msg_to_player", ",", "player", ",", "roll", ",", "args", "[", "0", "]", ",", "\"\"", ")", ")", ";", "broadcast", "(", "player", ",", "parse", "(", "msg_to_all", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "out", "(", "parseToConsole", "(", "msg_to_all", ",", "player", ",", "roll", ",", "args", "[", "0", "]", ",", "\"\"", ")", ")", ";", "write", "(", "\"[\"", "+", "date", "(", "\"\"", ")", "+", "\"]", "\"", "+", "player", ".", "getName", "(", ")", "+", "\"", "rolled", "\"", "+", "roll", "+", "\"\"", "+", "toInt", "(", "args", "[", "0", "]", ")", "+", "\"'\"", ")", ";", "}", "else", "if", "(", "args", ".", "length", "==", "2", ")", "{", "if", "(", "toInt", "(", "args", "[", "0", "]", ")", ">", "toInt", "(", "args", "[", "1", "]", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_first_bigger", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "if", "(", "toInt", "(", "args", "[", "0", "]", ")", ">", "max", "&&", "!", "noLimit", "(", "player", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_max", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "if", "(", "toInt", "(", "args", "[", "1", "]", ")", ">", "max", "&&", "!", "noLimit", "(", "player", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_max", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "if", "(", "toInt", "(", "args", "[", "0", "]", ")", "==", "toInt", "(", "args", "[", "1", "]", ")", "&&", "!", "allow_equal", "&&", "!", "noLimit", "(", "player", ")", ")", "{", "player", ".", "sendMessage", "(", "parse", "(", "msg_error_equal", ",", "player", ",", "roll", ",", "\"\"", ",", "\"\"", ")", ")", ";", "return", "true", ";", "}", "roll", "=", "rndNumber", "(", "toInt", "(", "args", "[", "1", "]", ")", "-", "toInt", "(", "args", "[", "0", "]", ")", "+", "1", ")", "+", "toInt", "(", "args", "[", "0", "]", ")", ";", "player", ".", "sendMessage", "(", "parse", "(", "msg_to_player", ",", "player", ",", "roll", ",", "args", "[", "0", "]", ",", "args", "[", "1", "]", ")", ")", ";", "broadcast", "(", "player", ",", "parse", "(", "msg_to_all", ",", "player", ",", "roll", ",", "args", "[", "0", "]", ",", "args", "[", "1", "]", ")", ")", ";", "out", "(", "parseToConsole", "(", "msg_to_all", ",", "player", ",", "roll", ",", "args", "[", "0", "]", ",", "args", "[", "1", "]", ")", ")", ";", "write", "(", "\"[\"", "+", "date", "(", "\"\"", ")", "+", "\"]", "\"", "+", "player", ".", "getName", "(", ")", "+", "\"", "rolled", "\"", "+", "roll", "+", "\"\"", "+", "toInt", "(", "args", "[", "0", "]", ")", "+", "\"", "\"", "+", "toInt", "(", "args", "[", "1", "]", ")", "+", "\"'\"", ")", ";", "}", "}", "return", "true", ";", "}", "public", "void", "broadcast", "(", "Player", "player", ",", "String", "text", ")", "{", "if", "(", "!", "msg_broadcast", ")", "{", "return", ";", "}", "for", "(", "Player", "p", ":", "getServer", "(", ")", ".", "getOnlinePlayers", "(", ")", ")", "{", "if", "(", "!", "(", "p", ".", "getName", "(", ")", "==", "player", ".", "getName", "(", ")", ")", ")", "{", "p", ".", "sendMessage", "(", "text", ")", ";", "}", "}", "}", "public", "String", "parse", "(", "String", "text", ",", "Player", "player", ",", "int", "roll", ",", "String", "first", ",", "String", "second", ")", "{", "String", "out", "=", "\"\"", ";", "out", "=", "text", ".", "replaceAll", "(", "\"%roll\"", ",", "\"\"", "+", "roll", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%player\"", ",", "player", ".", "getDisplayName", "(", ")", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%max\"", ",", "\"\"", "+", "max", ")", ";", "if", "(", "first", "==", "\"\"", "&&", "second", "!=", "\"\"", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%numbers\"", ",", "parseNumber", "(", "1", ",", "first", ")", ")", ";", "}", "else", "if", "(", "second", "==", "\"\"", "&&", "first", "!=", "\"\"", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%numbers\"", ",", "parseNumber", "(", "2", ",", "second", ")", ")", ";", "}", "else", "if", "(", "second", "==", "\"\"", "&&", "first", "==", "\"\"", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%numbers\"", ",", "\"\"", ")", ";", "}", "else", "if", "(", "first", "!=", "\"\"", "&&", "second", "!=", "\"\"", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%numbers\"", ",", "parseNumbers", "(", "first", ",", "second", ")", ")", ";", "}", "out", "=", "out", ".", "replaceAll", "(", "\"\"", ",", "\"-UNK-$2\"", ")", ";", "return", "out", ";", "}", "public", "String", "parseToConsole", "(", "String", "text", ",", "Player", "player", ",", "int", "roll", ",", "String", "first", ",", "String", "second", ")", "{", "String", "out", "=", "\"\"", ";", "out", "=", "text", ".", "replaceAll", "(", "\"%roll\"", ",", "\"\"", "+", "roll", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%player\"", ",", "player", ".", "getDisplayName", "(", ")", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%max\"", ",", "\"\"", "+", "max", ")", ";", "if", "(", "first", "!=", "\"\"", "&&", "second", "!=", "\"\"", ")", "out", "=", "out", ".", "replaceAll", "(", "\"%numbers\"", ",", "parseNumbers", "(", "first", ",", "second", ")", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"\"", ",", "\"\"", ")", ";", "return", "out", ";", "}", "public", "String", "parseNumbers", "(", "String", "first", ",", "String", "second", ")", "{", "String", "out", "=", "\"\"", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%1\"", ",", "first", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%2\"", ",", "second", ")", ";", "return", "out", ";", "}", "public", "String", "parseNumber", "(", "int", "num", ",", "String", "number", ")", "{", "String", "out", "=", "\"\"", ";", "if", "(", "num", "==", "1", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%1\"", ",", "number", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%2\"", ",", "\"\"", ")", ";", "}", "else", "if", "(", "num", "==", "2", ")", "{", "out", "=", "out", ".", "replaceAll", "(", "\"%2\"", ",", "number", ")", ";", "out", "=", "out", ".", "replaceAll", "(", "\"%1\"", ",", "\"\"", ")", ";", "}", "else", "{", "out", "=", "\"\"", ";", "}", "return", "out", ";", "}", "public", "int", "toInt", "(", "String", "string", ")", "{", "return", "Integer", ".", "parseInt", "(", "string", ")", ";", "}", "public", "int", "rndNumber", "(", "int", "max", ")", "{", "return", "rnd", ".", "nextInt", "(", "max", ")", ";", "}", "private", "void", "loadConfig", "(", ")", "{", "config", ".", "load", "(", ")", ";", "default_max", "=", "config", ".", "getInt", "(", "\"\"", ",", "default_max", ")", ";", "max", "=", "config", ".", "getInt", "(", "\"\"", ",", "max", ")", ";", "msg_to_player", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_to_player", ")", ";", "msg_to_all", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_to_all", ")", ";", "msg_to_all", "=", "config", ".", "getString", "(", "\"\"", ",", "numbers_format", ")", ";", "msg_error_first_bigger", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_error_first_bigger", ")", ";", "msg_error_equal", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_error_equal", ")", ";", "msg_error_max", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_error_max", ")", ";", "msg_error_negative", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_error_negative", ")", ";", "msg_error_no_perms", "=", "config", ".", "getString", "(", "\"\"", ",", "msg_error_no_perms", ")", ";", "msg_broadcast", "=", "config", ".", "getBoolean", "(", "\"\"", ",", "msg_broadcast", ")", ";", "msg_log", "=", "config", ".", "getBoolean", "(", "\"\"", ",", "msg_log", ")", ";", "allow_negative", "=", "config", ".", "getBoolean", "(", "\"\"", ",", "allow_negative", ")", ";", "allow_equal", "=", "config", ".", "getBoolean", "(", "\"\"", ",", "allow_equal", ")", ";", "}", "private", "void", "defaultConfig", "(", ")", "{", "config", ".", "setProperty", "(", "\"\"", ",", "default_max", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "max", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_to_player", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_to_all", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "numbers_format", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_error_first_bigger", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_error_equal", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_error_max", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_error_negative", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_error_no_perms", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_broadcast", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "msg_log", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "allow_negative", ")", ";", "config", ".", "setProperty", "(", "\"\"", ",", "allow_equal", ")", ";", "config", ".", "save", "(", ")", ";", "}", "public", "static", "void", "write", "(", "String", "warning", ")", "{", "if", "(", "!", "msg_log", ")", "{", "return", ";", "}", "PrintWriter", "outputStream", "=", "null", ";", "try", "{", "try", "{", "outputStream", "=", "new", "PrintWriter", "(", "new", "FileWriter", "(", "logfile", ",", "true", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "outputStream", ".", "println", "(", "warning", ")", ";", "}", "finally", "{", "if", "(", "outputStream", "!=", "null", ")", "{", "outputStream", ".", "close", "(", ")", ";", "}", "}", "}", "public", "static", "String", "date", "(", "String", "dateFormat", ")", "{", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateFormat", "(", "dateFormat", ")", ";", "return", "sdf", ".", "format", "(", "cal", ".", "getTime", "(", ")", ")", ";", "}", "public", "void", "out", "(", "String", "msg", ")", "{", "log", ".", "info", "(", "msg", ")", ";", "}", "public", "boolean", "canRoll", "(", "Player", "p", ")", "{", "return", "p", ".", "hasPermission", "(", "\"roll.roll\"", ")", ";", "}", "public", "boolean", "noLimit", "(", "Player", "p", ")", "{", "return", "p", ".", "hasPermission", "(", "\"roll.nolimit\"", ")", ";", "}", "public", "String", "toString", "(", "int", "i", ")", "{", "return", "Integer", ".", "toString", "(", "i", ")", ";", "}", "}", "</s>" ]
8,951
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "io", ".", "BufferedInputStream", ";", "import", "java", ".", "io", ".", "DataInputStream", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "media", ".", "AudioFormat", ";", "import", "android", ".", "media", ".", "AudioManager", ";", "import", "android", ".", "media", ".", "AudioTrack", ";", "import", "android", ".", "os", ".", "AsyncTask", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "BaseAdapter", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "public", "class", "Audio", "extends", "Activity", "{", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "private", "String", "[", "]", "audioFilePaths", ";", "boolean", "isPlaying", "=", "false", ";", "PlayAudio", "playTask", ";", "File", "recordingFile", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "audio", ")", ";", "android", ".", "widget", ".", "Gallery", "audio_gallery", "=", "(", "android", ".", "widget", ".", "Gallery", ")", "findViewById", "(", "R", ".", "id", ".", "audio_gallery", ")", ";", "audio_gallery", ".", "setAdapter", "(", "new", "AudioAdapter", "(", "this", ")", ")", ";", "audio_gallery", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "position", ",", "long", "id", ")", "{", "recordingFile", "=", "new", "File", "(", "audioFilePaths", "[", "position", "]", ")", ";", "playTask", "=", "new", "PlayAudio", "(", ")", ";", "playTask", ".", "execute", "(", ")", ";", "}", "}", ")", ";", "}", "public", "void", "recordAudio", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "AudioRecorder", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "0", ")", ";", "}", "public", "class", "AudioAdapter", "extends", "BaseAdapter", "{", "int", "mGalleryItemBackground", ";", "private", "Context", "mContext", ";", "private", "void", "getAudioPaths", "(", ")", "{", "String", "[", "]", "audioFiles", "=", "data", ".", "GetAudioURLs", "(", ")", ";", "audioFilePaths", "=", "new", "String", "[", "audioFiles", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "audioFiles", ".", "length", ";", "i", "++", ")", "{", "audioFilePaths", "[", "i", "]", "=", "audioFiles", "[", "i", "]", ";", "}", "}", "public", "AudioAdapter", "(", "Context", "c", ")", "{", "getAudioPaths", "(", ")", ";", "mContext", "=", "c", ";", "TypedArray", "a", "=", "obtainStyledAttributes", "(", "R", ".", "styleable", ".", "Gallery", ")", ";", "mGalleryItemBackground", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "Gallery_android_galleryItemBackground", ",", "0", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "int", "getCount", "(", ")", "{", "return", "audioFilePaths", ".", "length", ";", "}", "public", "Object", "getItem", "(", "int", "position", ")", "{", "return", "position", ";", "}", "public", "long", "getItemId", "(", "int", "position", ")", "{", "return", "position", ";", "}", "@", "Override", "public", "View", "getView", "(", "int", "position", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "ImageView", "musicNote", "=", "new", "ImageView", "(", "mContext", ")", ";", "Bitmap", "mBitmap", "=", "BitmapFactory", ".", "decodeResource", "(", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "sub_audio_wotext", ")", ";", "musicNote", ".", "setLayoutParams", "(", "new", "android", ".", "widget", ".", "Gallery", ".", "LayoutParams", "(", "250", ",", "250", ")", ")", ";", "musicNote", ".", "setBackgroundResource", "(", "mGalleryItemBackground", ")", ";", "musicNote", ".", "setImageBitmap", "(", "mBitmap", ")", ";", "return", "musicNote", ";", "}", "}", "private", "class", "PlayAudio", "extends", "AsyncTask", "<", "Void", ",", "Integer", ",", "Void", ">", "{", "private", "int", "frequency", "=", "11025", ";", "private", "int", "channelConfiguration", "=", "AudioFormat", ".", "CHANNEL_CONFIGURATION_MONO", ";", "private", "int", "audioEncoding", "=", "AudioFormat", ".", "ENCODING_PCM_16BIT", ";", "@", "Override", "protected", "Void", "doInBackground", "(", "Void", "...", "params", ")", "{", "isPlaying", "=", "true", ";", "int", "bufferSize", "=", "AudioTrack", ".", "getMinBufferSize", "(", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ")", ";", "short", "[", "]", "audiodata", "=", "new", "short", "[", "bufferSize", "/", "4", "]", ";", "try", "{", "DataInputStream", "dis", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "recordingFile", ")", ")", ")", ";", "AudioTrack", "audioTrack", "=", "new", "AudioTrack", "(", "AudioManager", ".", "STREAM_MUSIC", ",", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ",", "bufferSize", ",", "AudioTrack", ".", "MODE_STREAM", ")", ";", "audioTrack", ".", "play", "(", ")", ";", "while", "(", "isPlaying", "&&", "dis", ".", "available", "(", ")", ">", "0", ")", "{", "int", "i", "=", "0", ";", "while", "(", "dis", ".", "available", "(", ")", ">", "0", "&&", "i", "<", "audiodata", ".", "length", ")", "{", "audiodata", "[", "i", "]", "=", "dis", ".", "readShort", "(", ")", ";", "i", "++", ";", "}", "audioTrack", ".", "write", "(", "audiodata", ",", "0", ",", "audiodata", ".", "length", ")", ";", "}", "dis", ".", "close", "(", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "Log", ".", "e", "(", "\"AudioTrack\"", ",", "\"\"", ")", ";", "}", "return", "null", ";", "}", "}", "}", "</s>" ]
8,952
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "pm", ".", "ActivityInfo", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ";", "import", "android", ".", "view", ".", "SurfaceView", ";", "import", "android", ".", "view", ".", "Window", ";", "import", "android", ".", "view", ".", "WindowManager", ";", "import", "android", ".", "media", ".", "MediaRecorder", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "SurfaceHolder", ".", "Callback", ";", "import", "android", ".", "view", ".", "View", ".", "OnClickListener", ";", "import", "android", ".", "widget", ".", "Toast", ";", "public", "class", "VideoCapture", "extends", "Activity", "implements", "OnClickListener", ",", "Callback", "{", "private", "String", "imageFilePath", ";", "private", "boolean", "recording", "=", "false", ";", "private", "MediaRecorder", "recorder", ";", "private", "SurfaceHolder", "holder", ";", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "requestWindowFeature", "(", "Window", ".", "FEATURE_NO_TITLE", ")", ";", "getWindow", "(", ")", ".", "setFlags", "(", "WindowManager", ".", "LayoutParams", ".", "FLAG_FULLSCREEN", ",", "WindowManager", ".", "LayoutParams", ".", "FLAG_FULLSCREEN", ")", ";", "setRequestedOrientation", "(", "ActivityInfo", ".", "SCREEN_ORIENTATION_LANDSCAPE", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "cameraview", ")", ";", "imageFilePath", "=", "data", ".", "GetNewVideoURL", "(", ")", ";", "Log", ".", "d", "(", "\"VideoPath\"", ",", "imageFilePath", ")", ";", "initRecorder", "(", ")", ";", "SurfaceView", "cameraView", "=", "(", "SurfaceView", ")", "findViewById", "(", "R", ".", "id", ".", "surface", ")", ";", "holder", "=", "cameraView", ".", "getHolder", "(", ")", ";", "holder", ".", "addCallback", "(", "this", ")", ";", "holder", ".", "setType", "(", "SurfaceHolder", ".", "SURFACE_TYPE_PUSH_BUFFERS", ")", ";", "cameraView", ".", "setClickable", "(", "true", ")", ";", "cameraView", ".", "setOnClickListener", "(", "this", ")", ";", "}", "private", "void", "initRecorder", "(", ")", "{", "recorder", "=", "new", "MediaRecorder", "(", ")", ";", "recorder", ".", "setAudioSource", "(", "MediaRecorder", ".", "AudioSource", ".", "DEFAULT", ")", ";", "recorder", ".", "setVideoSource", "(", "MediaRecorder", ".", "VideoSource", ".", "DEFAULT", ")", ";", "recorder", ".", "setOutputFormat", "(", "MediaRecorder", ".", "OutputFormat", ".", "MPEG_4", ")", ";", "recorder", ".", "setAudioEncoder", "(", "MediaRecorder", ".", "AudioEncoder", ".", "DEFAULT", ")", ";", "recorder", ".", "setVideoEncoder", "(", "MediaRecorder", ".", "VideoEncoder", ".", "DEFAULT", ")", ";", "recorder", ".", "setOutputFile", "(", "imageFilePath", ")", ";", "recorder", ".", "setMaxDuration", "(", "50000", ")", ";", "recorder", ".", "setMaxFileSize", "(", "5000000", ")", ";", "}", "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "if", "(", "recording", ")", "{", "recorder", ".", "stop", "(", ")", ";", "showToast", "(", "this", ",", "\"\"", ")", ";", "recording", "=", "false", ";", "finish", "(", ")", ";", "}", "else", "{", "recording", "=", "true", ";", "recorder", ".", "start", "(", ")", ";", "showToast", "(", "this", ",", "\"\"", ")", ";", "}", "}", "@", "Override", "public", "void", "surfaceChanged", "(", "SurfaceHolder", "holder", ",", "int", "format", ",", "int", "width", ",", "int", "height", ")", "{", "}", "private", "void", "prepareRecorder", "(", ")", "{", "recorder", ".", "setPreviewDisplay", "(", "holder", ".", "getSurface", "(", ")", ")", ";", "try", "{", "recorder", ".", "prepare", "(", ")", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "finish", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "finish", "(", ")", ";", "}", "}", "@", "Override", "public", "void", "surfaceCreated", "(", "SurfaceHolder", "holder", ")", "{", "prepareRecorder", "(", ")", ";", "}", "@", "Override", "public", "void", "surfaceDestroyed", "(", "SurfaceHolder", "holder", ")", "{", "if", "(", "recording", ")", "{", "recorder", ".", "stop", "(", ")", ";", "recording", "=", "false", ";", "}", "recorder", ".", "release", "(", ")", ";", "finish", "(", ")", ";", "}", "public", "void", "captureVideo", "(", "View", "view", ")", "{", "showToast", "(", "this", ",", "imageFilePath", ")", ";", "}", "private", "void", "showToast", "(", "Context", "mContext", ",", "String", "text", ")", "{", "Toast", ".", "makeText", "(", "mContext", ",", "text", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", "</s>" ]
8,953
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "os", ".", "Handler", ";", "import", "android", ".", "os", ".", "Message", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "public", "class", "DrawableManager", "{", "private", "final", "Map", "<", "String", ",", "Drawable", ">", "drawableMap", ";", "public", "DrawableManager", "(", ")", "{", "drawableMap", "=", "new", "HashMap", "<", "String", ",", "Drawable", ">", "(", ")", ";", "}", "public", "Drawable", "fetchDrawable", "(", "String", "urlString", ")", "{", "if", "(", "drawableMap", ".", "containsKey", "(", "urlString", ")", ")", "{", "return", "drawableMap", ".", "get", "(", "urlString", ")", ";", "}", "Drawable", "drawable", "=", "Drawable", ".", "createFromPath", "(", "urlString", ")", ";", "drawableMap", ".", "put", "(", "urlString", ",", "drawable", ")", ";", "return", "drawable", ";", "}", "public", "void", "fetchDrawableOnThread", "(", "final", "String", "urlString", ",", "final", "ImageView", "imageView", ")", "{", "if", "(", "drawableMap", ".", "containsKey", "(", "urlString", ")", ")", "{", "imageView", ".", "setImageDrawable", "(", "drawableMap", ".", "get", "(", "urlString", ")", ")", ";", "}", "final", "Handler", "handler", "=", "new", "Handler", "(", ")", "{", "@", "Override", "public", "void", "handleMessage", "(", "Message", "message", ")", "{", "imageView", ".", "setImageDrawable", "(", "(", "Drawable", ")", "message", ".", "obj", ")", ";", "}", "}", ";", "Thread", "thread", "=", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "Drawable", "drawable", "=", "fetchDrawable", "(", "urlString", ")", ";", "Message", "message", "=", "handler", ".", "obtainMessage", "(", "1", ",", "drawable", ")", ";", "handler", ".", "sendMessage", "(", "message", ")", ";", "}", "}", ";", "thread", ".", "start", "(", ")", ";", "}", "}", "</s>" ]
8,954
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "io", ".", "BufferedInputStream", ";", "import", "java", ".", "io", ".", "BufferedOutputStream", ";", "import", "java", ".", "io", ".", "DataInputStream", ";", "import", "java", ".", "io", ".", "DataOutputStream", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "text", ".", "SimpleDateFormat", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "media", ".", "AudioFormat", ";", "import", "android", ".", "media", ".", "AudioManager", ";", "import", "android", ".", "media", ".", "AudioRecord", ";", "import", "android", ".", "media", ".", "AudioTrack", ";", "import", "android", ".", "media", ".", "MediaRecorder", ";", "import", "android", ".", "net", ".", "Uri", ";", "import", "android", ".", "os", ".", "AsyncTask", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "View", ".", "OnClickListener", ";", "import", "android", ".", "widget", ".", "Button", ";", "import", "android", ".", "widget", ".", "TextView", ";", "import", "android", ".", "widget", ".", "Toast", ";", "public", "class", "AudioRecorder", "extends", "Activity", "implements", "OnClickListener", "{", "private", "static", "final", "int", "CAMERA_RESULT", "=", "1", ";", "RecordAudio", "recordTask", ";", "PlayAudio", "playTask", ";", "Button", "startRecordingButton", ";", "Button", "startPlaybackButton", ",", "stopPlaybackButton", ";", "TextView", "durationText", ";", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "File", "recordingFile", ";", "boolean", "isRecording", "=", "false", ";", "boolean", "isPlaying", "=", "false", ";", "int", "frequency", "=", "11025", ";", "int", "channelConfiguration", "=", "AudioFormat", ".", "CHANNEL_CONFIGURATION_MONO", ";", "int", "audioEncoding", "=", "AudioFormat", ".", "ENCODING_PCM_16BIT", ";", "long", "startRecordTime", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "audio_recorder", ")", ";", "durationText", "=", "(", "TextView", ")", "this", ".", "findViewById", "(", "R", ".", "id", ".", "DurationTextView", ")", ";", "startRecordingButton", "=", "(", "Button", ")", "this", ".", "findViewById", "(", "R", ".", "id", ".", "StartRecordingButton", ")", ";", "startPlaybackButton", "=", "(", "Button", ")", "this", ".", "findViewById", "(", "R", ".", "id", ".", "StartPlaybackButton", ")", ";", "stopPlaybackButton", "=", "(", "Button", ")", "this", ".", "findViewById", "(", "R", ".", "id", ".", "StopPlaybackButton", ")", ";", "startRecordingButton", ".", "setOnClickListener", "(", "this", ")", ";", "startPlaybackButton", ".", "setOnClickListener", "(", "this", ")", ";", "stopPlaybackButton", ".", "setOnClickListener", "(", "this", ")", ";", "startPlaybackButton", ".", "setEnabled", "(", "false", ")", ";", "stopPlaybackButton", ".", "setEnabled", "(", "false", ")", ";", "String", "audioFilename", "=", "data", ".", "GetNewAudioURL", "(", ")", ";", "recordingFile", "=", "new", "File", "(", "audioFilename", ")", ";", "showToast", "(", "this", ",", "audioFilename", ")", ";", "startRecordTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "startRecordTime", ")", ";", "record", "(", ")", ";", "}", "public", "void", "onClick", "(", "View", "v", ")", "{", "if", "(", "v", "==", "startRecordingButton", ")", "{", "record", "(", ")", ";", "}", "else", "if", "(", "v", "==", "startPlaybackButton", ")", "{", "play", "(", ")", ";", "}", "else", "if", "(", "v", "==", "stopPlaybackButton", ")", "{", "stopPlaying", "(", ")", ";", "}", "}", "public", "void", "play", "(", ")", "{", "startPlaybackButton", ".", "setEnabled", "(", "true", ")", ";", "playTask", "=", "new", "PlayAudio", "(", ")", ";", "playTask", ".", "execute", "(", ")", ";", "stopPlaybackButton", ".", "setEnabled", "(", "true", ")", ";", "}", "public", "void", "stopPlaying", "(", ")", "{", "isPlaying", "=", "false", ";", "stopPlaybackButton", ".", "setEnabled", "(", "false", ")", ";", "startPlaybackButton", ".", "setEnabled", "(", "true", ")", ";", "}", "public", "void", "record", "(", ")", "{", "startRecordingButton", ".", "setEnabled", "(", "false", ")", ";", "recordTask", "=", "new", "RecordAudio", "(", ")", ";", "recordTask", ".", "execute", "(", ")", ";", "}", "public", "void", "stopRecording", "(", ")", "{", "isRecording", "=", "false", ";", "}", "public", "void", "stopRecording", "(", "View", "view", ")", "{", "this", ".", "stopRecording", "(", ")", ";", "}", "public", "void", "takePhoto", "(", "View", "view", ")", "{", "this", ".", "takePhoto", "(", ")", ";", "}", "public", "void", "takePhoto", "(", ")", "{", "String", "photoFilename", "=", "data", ".", "GetNewPhotoURL", "(", ")", ";", "showToast", "(", "this", ",", "photoFilename", ")", ";", "Uri", "imageFileUri", "=", "Uri", ".", "fromFile", "(", "new", "File", "(", "photoFilename", ")", ")", ";", "Intent", "intent", "=", "new", "Intent", "(", "android", ".", "provider", ".", "MediaStore", ".", "ACTION_IMAGE_CAPTURE", ")", ";", "intent", ".", "putExtra", "(", "android", ".", "provider", ".", "MediaStore", ".", "EXTRA_OUTPUT", ",", "imageFileUri", ")", ";", "startActivityForResult", "(", "intent", ",", "AudioRecorder", ".", "CAMERA_RESULT", ")", ";", "}", "private", "void", "showToast", "(", "Context", "mContext", ",", "String", "text", ")", "{", "Toast", ".", "makeText", "(", "mContext", ",", "text", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "protected", "void", "onActivityResult", "(", "int", "requestCode", ",", "int", "resultCode", ",", "Intent", "image", ")", "{", "super", ".", "onActivityResult", "(", "requestCode", ",", "resultCode", ",", "image", ")", ";", "if", "(", "requestCode", "==", "AudioRecorder", ".", "CAMERA_RESULT", ")", "{", "}", "}", "private", "class", "PlayAudio", "extends", "AsyncTask", "<", "Void", ",", "Integer", ",", "Void", ">", "{", "@", "Override", "protected", "Void", "doInBackground", "(", "Void", "...", "params", ")", "{", "isPlaying", "=", "true", ";", "int", "bufferSize", "=", "AudioTrack", ".", "getMinBufferSize", "(", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ")", ";", "short", "[", "]", "audiodata", "=", "new", "short", "[", "bufferSize", "/", "4", "]", ";", "try", "{", "DataInputStream", "dis", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "recordingFile", ")", ")", ")", ";", "AudioTrack", "audioTrack", "=", "new", "AudioTrack", "(", "AudioManager", ".", "STREAM_MUSIC", ",", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ",", "bufferSize", ",", "AudioTrack", ".", "MODE_STREAM", ")", ";", "audioTrack", ".", "play", "(", ")", ";", "while", "(", "isPlaying", "&&", "dis", ".", "available", "(", ")", ">", "0", ")", "{", "int", "i", "=", "0", ";", "while", "(", "dis", ".", "available", "(", ")", ">", "0", "&&", "i", "<", "audiodata", ".", "length", ")", "{", "audiodata", "[", "i", "]", "=", "dis", ".", "readShort", "(", ")", ";", "i", "++", ";", "}", "audioTrack", ".", "write", "(", "audiodata", ",", "0", ",", "audiodata", ".", "length", ")", ";", "}", "dis", ".", "close", "(", ")", ";", "startPlaybackButton", ".", "setEnabled", "(", "false", ")", ";", "stopPlaybackButton", ".", "setEnabled", "(", "true", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "Log", ".", "e", "(", "\"AudioTrack\"", ",", "\"\"", ")", ";", "}", "return", "null", ";", "}", "}", "private", "class", "RecordAudio", "extends", "AsyncTask", "<", "Void", ",", "Integer", ",", "Void", ">", "{", "@", "Override", "protected", "Void", "doInBackground", "(", "Void", "...", "params", ")", "{", "isRecording", "=", "true", ";", "try", "{", "DataOutputStream", "dos", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", "recordingFile", ")", ")", ")", ";", "int", "bufferSize", "=", "AudioRecord", ".", "getMinBufferSize", "(", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ")", ";", "AudioRecord", "audioRecord", "=", "new", "AudioRecord", "(", "MediaRecorder", ".", "AudioSource", ".", "MIC", ",", "frequency", ",", "channelConfiguration", ",", "audioEncoding", ",", "bufferSize", ")", ";", "short", "[", "]", "buffer", "=", "new", "short", "[", "bufferSize", "]", ";", "audioRecord", ".", "startRecording", "(", ")", ";", "int", "r", "=", "0", ";", "while", "(", "isRecording", ")", "{", "int", "bufferReadResult", "=", "audioRecord", ".", "read", "(", "buffer", ",", "0", ",", "bufferSize", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bufferReadResult", ";", "i", "++", ")", "{", "dos", ".", "writeShort", "(", "buffer", "[", "i", "]", ")", ";", "}", "publishProgress", "(", "new", "Integer", "(", "r", ")", ")", ";", "r", "++", ";", "}", "audioRecord", ".", "stop", "(", ")", ";", "dos", ".", "close", "(", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "Log", ".", "e", "(", "\"AudioRecord\"", ",", "\"\"", ")", ";", "}", "return", "null", ";", "}", "protected", "void", "onProgressUpdate", "(", "Integer", "...", "progress", ")", "{", "long", "duration", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "startRecordTime", ";", "SimpleDateFormat", "df", "=", "new", "SimpleDateFormat", "(", "\"mm:ss\"", ")", ";", "durationText", ".", "setText", "(", "\"Time:\"", "+", "df", ".", "format", "(", "new", "Date", "(", "duration", ")", ")", ")", ";", "}", "protected", "void", "onPostExecute", "(", "Void", "result", ")", "{", "startRecordingButton", ".", "setEnabled", "(", "true", ")", ";", "startPlaybackButton", ".", "setEnabled", "(", "true", ")", ";", "}", "}", "}", "</s>" ]
8,955
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ".", "utilities", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "BufferedWriter", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileReader", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "text", ".", "SimpleDateFormat", ";", "import", "java", ".", "util", ".", "Calendar", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "UUID", ";", "import", "android", ".", "os", ".", "Environment", ";", "public", "class", "Data", "{", "private", "static", "Data", "instance", "=", "null", ";", "private", "static", "String", "subject", "=", "null", ";", "private", "String", "root", "(", ")", "{", "String", "appPath", "=", "Environment", ".", "getExternalStorageDirectory", "(", ")", ".", "getAbsolutePath", "(", ")", "+", "\"/SmallBean\"", ";", "File", "appDir", "=", "new", "File", "(", "appPath", ")", ";", "if", "(", "!", "appDir", ".", "exists", "(", ")", "||", "!", "appDir", ".", "isDirectory", "(", ")", ")", "{", "createFolder", "(", "appPath", ")", ";", "}", "return", "appPath", ";", "}", "private", "String", "subjectPath", "(", ")", "{", "return", "root", "(", ")", "+", "\"/\"", "+", "Data", ".", "subject", ";", "}", "private", "String", "imageFolderPath", "(", ")", "{", "return", "subjectPath", "(", ")", "+", "\"/images\"", ";", "}", "private", "String", "videoFolderPath", "(", ")", "{", "return", "subjectPath", "(", ")", "+", "\"/videos\"", ";", "}", "private", "String", "audioFolderPath", "(", ")", "{", "return", "subjectPath", "(", ")", "+", "\"/audio\"", ";", "}", "private", "String", "noteFilePath", "(", ")", "{", "return", "subjectPath", "(", ")", "+", "\"/note.txt\"", ";", "}", "protected", "Data", "(", ")", "{", "}", "public", "static", "Data", "getInstance", "(", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "instance", "=", "new", "Data", "(", ")", ";", "}", "return", "instance", ";", "}", "public", "void", "SetSubject", "(", "String", "subject", ")", "{", "Data", ".", "subject", "=", "subject", ";", "}", "public", "String", "[", "]", "GetSubjects", "(", ")", "{", "File", "files", "=", "new", "File", "(", "root", "(", ")", ")", ";", "return", "files", ".", "list", "(", ")", ";", "}", "public", "void", "AddSubject", "(", "String", "subject", ")", "{", "Data", ".", "subject", "=", "subject", ";", "createFolder", "(", "subjectPath", "(", ")", ")", ";", "createFolder", "(", "imageFolderPath", "(", ")", ")", ";", "createFolder", "(", "videoFolderPath", "(", ")", ")", ";", "createFolder", "(", "audioFolderPath", "(", ")", ")", ";", "}", "public", "void", "DeleteSubject", "(", ")", "{", "deleteFolder", "(", "subjectPath", "(", ")", ")", ";", "}", "public", "void", "SetNote", "(", "String", "note", ")", "{", "File", "f", "=", "new", "File", "(", "noteFilePath", "(", ")", ")", ";", "try", "{", "if", "(", "!", "f", ".", "exists", "(", ")", ")", "{", "f", ".", "createNewFile", "(", ")", ";", "}", "FileWriter", "gpxwriter", "=", "new", "FileWriter", "(", "f", ")", ";", "BufferedWriter", "out", "=", "new", "BufferedWriter", "(", "gpxwriter", ")", ";", "out", ".", "write", "(", "note", ")", ";", "out", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "public", "String", "GetNote", "(", ")", "{", "String", "note", "=", "\"\"", ";", "File", "f", "=", "new", "File", "(", "noteFilePath", "(", ")", ")", ";", "try", "{", "BufferedReader", "r", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "f", ")", ")", ";", "StringBuilder", "total", "=", "new", "StringBuilder", "(", ")", ";", "String", "line", ";", "while", "(", "(", "line", "=", "r", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "total", ".", "append", "(", "line", ")", ";", "}", "note", "=", "total", ".", "toString", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "return", "note", ";", "}", "public", "String", "GetNewPhotoURL", "(", ")", "{", "return", "imageFolderPath", "(", ")", "+", "\"/image_\"", "+", "GetNewTimeAndUuid", "(", ")", "+", "\".jpg\"", ";", "}", "public", "String", "GetNewAudioURL", "(", ")", "{", "return", "audioFolderPath", "(", ")", "+", "\"/audio_\"", "+", "GetNewTimeAndUuid", "(", ")", "+", "\".3gp\"", ";", "}", "public", "String", "GetNewVideoURL", "(", ")", "{", "return", "videoFolderPath", "(", ")", "+", "\"/video_\"", "+", "GetNewTimeAndUuid", "(", ")", "+", "\".mp4\"", ";", "}", "public", "String", "[", "]", "GetPhotoURLs", "(", ")", "{", "return", "GetListOfFilesInPath", "(", "imageFolderPath", "(", ")", ")", ";", "}", "public", "String", "[", "]", "GetAudioURLs", "(", ")", "{", "return", "GetListOfFilesInPath", "(", "audioFolderPath", "(", ")", ")", ";", "}", "public", "String", "[", "]", "GetVideoURLs", "(", ")", "{", "return", "GetListOfFilesInPath", "(", "videoFolderPath", "(", ")", ")", ";", "}", "public", "void", "DeletePhoto", "(", "String", "photoUrl", ")", "{", "deleteFile", "(", "photoUrl", ")", ";", "}", "public", "void", "DeleteAudio", "(", "String", "audioUrl", ")", "{", "deleteFile", "(", "audioUrl", ")", ";", "}", "public", "void", "DeleteVideo", "(", "String", "videoUrl", ")", "{", "deleteFile", "(", "videoUrl", ")", ";", "}", "private", "void", "createFolder", "(", "String", "folderPath", ")", "{", "(", "new", "File", "(", "folderPath", ")", ")", ".", "mkdir", "(", ")", ";", "}", "private", "void", "deleteFolder", "(", "String", "folderPath", ")", "{", "File", "file", "=", "new", "File", "(", "folderPath", ")", ";", "if", "(", "file", ".", "isDirectory", "(", ")", "&&", "file", ".", "list", "(", ")", ".", "length", ">", "0", ")", "{", "deleteDirectory", "(", "file", ")", ";", "}", "else", "{", "file", ".", "delete", "(", ")", ";", "}", "}", "private", "boolean", "deleteDirectory", "(", "File", "path", ")", "{", "if", "(", "path", ".", "exists", "(", ")", ")", "{", "File", "[", "]", "files", "=", "path", ".", "listFiles", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "files", ".", "length", ";", "i", "++", ")", "{", "if", "(", "files", "[", "i", "]", ".", "isDirectory", "(", ")", ")", "{", "deleteDirectory", "(", "files", "[", "i", "]", ")", ";", "}", "else", "{", "files", "[", "i", "]", ".", "delete", "(", ")", ";", "}", "}", "}", "return", "(", "path", ".", "delete", "(", ")", ")", ";", "}", "private", "void", "deleteFile", "(", "String", "filePath", ")", "{", "File", "fileToDelete", "=", "new", "File", "(", "filePath", ")", ";", "fileToDelete", ".", "delete", "(", ")", ";", "}", "private", "String", "GetNewTimeAndUuid", "(", ")", "{", "UUID", "uuid", "=", "UUID", ".", "randomUUID", "(", ")", ";", "Calendar", "cal", "=", "Calendar", ".", "getInstance", "(", ")", ";", "Date", "date", "=", "cal", ".", "getTime", "(", ")", ";", "SimpleDateFormat", "df", "=", "new", "SimpleDateFormat", "(", "\"\"", ")", ";", "String", "dateTimeString", "=", "df", ".", "format", "(", "date", ")", "+", "\"_\"", "+", "uuid", ".", "toString", "(", ")", ";", "return", "dateTimeString", ";", "}", "private", "String", "[", "]", "GetListOfFilesInPath", "(", "String", "path", ")", "{", "File", "folder", "=", "new", "File", "(", "path", ")", ";", "String", "[", "]", "files", "=", "folder", ".", "list", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "files", ".", "length", ";", "i", "++", ")", "{", "files", "[", "i", "]", "=", "path", "+", "\"/\"", "+", "files", "[", "i", "]", ";", "}", "return", "files", ";", "}", "}", "</s>" ]
8,956
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "ActivityNotFoundException", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "net", ".", "Uri", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "BaseAdapter", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "public", "class", "VideoGallery", "extends", "Activity", "{", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "private", "String", "[", "]", "videoFilePaths", ";", "File", "videoFile", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "video", ")", ";", "android", ".", "widget", ".", "Gallery", "video_gallery", "=", "(", "android", ".", "widget", ".", "Gallery", ")", "findViewById", "(", "R", ".", "id", ".", "video_gallery", ")", ";", "video_gallery", ".", "setAdapter", "(", "new", "VideoAdapter", "(", "this", ")", ")", ";", "video_gallery", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "position", ",", "long", "id", ")", "{", "String", "videoPath", "=", "videoFilePaths", "[", "position", "]", ";", "Intent", "intent", "=", "new", "Intent", "(", "android", ".", "content", ".", "Intent", ".", "ACTION_VIEW", ")", ";", "Uri", "data", "=", "Uri", ".", "parse", "(", "videoPath", ")", ";", "intent", ".", "setDataAndType", "(", "data", ",", "\"video/mp4\"", ")", ";", "try", "{", "startActivity", "(", "intent", ")", ";", "}", "catch", "(", "ActivityNotFoundException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", ")", ";", "}", "public", "void", "recordVideo", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "VideoCapture", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "0", ")", ";", "}", "public", "class", "VideoAdapter", "extends", "BaseAdapter", "{", "int", "mGalleryItemBackground", ";", "private", "Context", "mContext", ";", "private", "void", "getVideoPaths", "(", ")", "{", "String", "[", "]", "videoFiles", "=", "data", ".", "GetVideoURLs", "(", ")", ";", "videoFilePaths", "=", "new", "String", "[", "videoFiles", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "videoFiles", ".", "length", ";", "i", "++", ")", "{", "videoFilePaths", "[", "i", "]", "=", "videoFiles", "[", "i", "]", ";", "}", "}", "public", "VideoAdapter", "(", "Context", "c", ")", "{", "getVideoPaths", "(", ")", ";", "mContext", "=", "c", ";", "TypedArray", "a", "=", "obtainStyledAttributes", "(", "R", ".", "styleable", ".", "Gallery", ")", ";", "mGalleryItemBackground", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "Gallery_android_galleryItemBackground", ",", "0", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "int", "getCount", "(", ")", "{", "return", "videoFilePaths", ".", "length", ";", "}", "public", "Object", "getItem", "(", "int", "position", ")", "{", "return", "position", ";", "}", "public", "long", "getItemId", "(", "int", "position", ")", "{", "return", "position", ";", "}", "@", "Override", "public", "View", "getView", "(", "int", "position", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "ImageView", "videoThumbNail", "=", "new", "ImageView", "(", "mContext", ")", ";", "Bitmap", "mBitmap", "=", "BitmapFactory", ".", "decodeResource", "(", "getResources", "(", ")", ",", "R", ".", "drawable", ".", "sub_vid_wotext", ")", ";", "videoThumbNail", ".", "setLayoutParams", "(", "new", "android", ".", "widget", ".", "Gallery", ".", "LayoutParams", "(", "250", ",", "250", ")", ")", ";", "videoThumbNail", ".", "setBackgroundResource", "(", "mGalleryItemBackground", ")", ";", "videoThumbNail", ".", "setImageBitmap", "(", "mBitmap", ")", ";", "return", "videoThumbNail", ";", "}", "}", "}", "</s>" ]
8,957
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapFactory", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "BitmapDrawable", ";", "import", "android", ".", "net", ".", "Uri", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "BaseAdapter", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "Toast", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "public", "class", "CameraSurface", "extends", "Activity", "{", "private", "int", "CAMERA_RESULT", "=", "1", ";", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "camera", ")", ";", "android", ".", "widget", ".", "Gallery", "camera_gallery", "=", "(", "android", ".", "widget", ".", "Gallery", ")", "findViewById", "(", "R", ".", "id", ".", "photo_gallery", ")", ";", "camera_gallery", ".", "setAdapter", "(", "new", "ImageAdapter", "(", "this", ")", ")", ";", "camera_gallery", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "position", ",", "long", "id", ")", "{", "Toast", ".", "makeText", "(", "CameraSurface", ".", "this", ",", "\"\"", "+", "position", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", ")", ";", "}", "public", "void", "goHome", "(", "View", "view", ")", "{", "}", "public", "void", "finish", "(", "View", "view", ")", "{", "this", ".", "finish", "(", ")", ";", "}", "public", "void", "takePhoto", "(", "View", "view", ")", "{", "Uri", "imageFileUri", "=", "Uri", ".", "fromFile", "(", "new", "File", "(", "data", ".", "GetNewPhotoURL", "(", ")", ")", ")", ";", "Intent", "intent", "=", "new", "Intent", "(", "android", ".", "provider", ".", "MediaStore", ".", "ACTION_IMAGE_CAPTURE", ")", ";", "intent", ".", "putExtra", "(", "android", ".", "provider", ".", "MediaStore", ".", "EXTRA_OUTPUT", ",", "imageFileUri", ")", ";", "startActivityForResult", "(", "intent", ",", "this", ".", "CAMERA_RESULT", ")", ";", "}", "protected", "void", "onActivityResult", "(", "int", "requestCode", ",", "int", "resultCode", ",", "Intent", "image", ")", "{", "super", ".", "onActivityResult", "(", "requestCode", ",", "resultCode", ",", "image", ")", ";", "if", "(", "requestCode", "==", "this", ".", "CAMERA_RESULT", ")", "{", "android", ".", "widget", ".", "Gallery", "camera_gallery", "=", "(", "android", ".", "widget", ".", "Gallery", ")", "findViewById", "(", "R", ".", "id", ".", "photo_gallery", ")", ";", "camera_gallery", ".", "setAdapter", "(", "new", "ImageAdapter", "(", "this", ")", ")", ";", "camera_gallery", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "position", ",", "long", "id", ")", "{", "Toast", ".", "makeText", "(", "CameraSurface", ".", "this", ",", "\"\"", "+", "position", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", ")", ";", "}", "}", "public", "class", "ImageAdapter", "extends", "BaseAdapter", "{", "int", "mGalleryItemBackground", ";", "private", "String", "[", "]", "imagePaths", ";", "private", "Context", "mContext", ";", "public", "ImageAdapter", "(", "Context", "c", ")", "{", "imagePaths", "=", "data", ".", "GetPhotoURLs", "(", ")", ";", "mContext", "=", "c", ";", "TypedArray", "a", "=", "obtainStyledAttributes", "(", "R", ".", "styleable", ".", "Gallery", ")", ";", "mGalleryItemBackground", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "Gallery_android_galleryItemBackground", ",", "0", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "int", "getCount", "(", ")", "{", "return", "imagePaths", ".", "length", ";", "}", "public", "Object", "getItem", "(", "int", "position", ")", "{", "return", "position", ";", "}", "public", "long", "getItemId", "(", "int", "position", ")", "{", "return", "position", ";", "}", "@", "Override", "public", "View", "getView", "(", "int", "position", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "ImageView", "i", "=", "new", "ImageView", "(", "mContext", ")", ";", "i", ".", "setImageDrawable", "(", "downSampleImage", "(", "imagePaths", "[", "position", "]", ")", ")", ";", "i", ".", "setLayoutParams", "(", "new", "android", ".", "widget", ".", "Gallery", ".", "LayoutParams", "(", "400", ",", "400", ")", ")", ";", "i", ".", "setScaleType", "(", "ImageView", ".", "ScaleType", ".", "FIT_XY", ")", ";", "i", ".", "setBackgroundResource", "(", "mGalleryItemBackground", ")", ";", "return", "i", ";", "}", "private", "BitmapDrawable", "downSampleImage", "(", "String", "imgPath", ")", "{", "BitmapFactory", ".", "Options", "options", "=", "new", "BitmapFactory", ".", "Options", "(", ")", ";", "options", ".", "inSampleSize", "=", "2", ";", "Bitmap", "bmp", "=", "BitmapFactory", ".", "decodeFile", "(", "imgPath", ",", "options", ")", ";", "BitmapDrawable", "rbmd", "=", "new", "BitmapDrawable", "(", "bmp", ")", ";", "return", "rbmd", ";", "}", "}", "}", "</s>" ]
8,958
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "import", "android", ".", "widget", ".", "ArrayAdapter", ";", "import", "android", ".", "widget", ".", "EditText", ";", "import", "android", ".", "widget", ".", "ListView", ";", "import", "android", ".", "widget", ".", "TextView", ";", "import", "android", ".", "widget", ".", "ViewFlipper", ";", "public", "class", "Interview", "extends", "Activity", "{", "private", "static", "final", "int", "TAKE_PHOTO", "=", "0", ";", "private", "static", "final", "int", "RECORD_AUDIO", "=", "1", ";", "private", "static", "final", "int", "RECORD_VIDEO", "=", "2", ";", "private", "static", "final", "int", "SHOW_GALLERY", "=", "3", ";", "private", "static", "final", "int", "TAKE_NOTE", "=", "4", ";", "private", "static", "final", "int", "SUBJECT_DASHBOARD_VIEW", "=", "0", ";", "private", "static", "final", "int", "SUBJECT_CREATE_VIEW", "=", "1", ";", "private", "static", "final", "int", "SUBJECT_LIST_VIEW", "=", "2", ";", "private", "static", "final", "int", "SUBJECT_DETAILS_VIEW", "=", "3", ";", "private", "ViewFlipper", "flipper", ";", "private", "ListView", "subjectListView", ";", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "dashboard", ")", ";", "this", ".", "flipper", "=", "(", "ViewFlipper", ")", "findViewById", "(", "R", ".", "id", ".", "subject_views", ")", ";", "this", ".", "subjectListView", "=", "(", "ListView", ")", "findViewById", "(", "R", ".", "id", ".", "subject_list_view", ")", ";", "this", ".", "populateListView", "(", "this", ".", "subjectListView", ")", ";", "subjectListView", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "view", ",", "int", "position", ",", "long", "id", ")", "{", "String", "subjectName", "=", "(", "String", ")", "(", "(", "TextView", ")", "view", ")", ".", "getText", "(", ")", ";", "data", ".", "SetSubject", "(", "subjectName", ")", ";", "TextView", "subjectview", "=", "(", "TextView", ")", "findViewById", "(", "R", ".", "id", ".", "subjectTitle", ")", ";", "subjectview", ".", "setText", "(", "subjectName", ")", ";", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_DETAILS_VIEW", ")", ";", "}", "}", ")", ";", "}", "private", "void", "populateListView", "(", "ListView", "subjectListView", ")", "{", "String", "[", "]", "subjects", "=", "this", ".", "data", ".", "GetSubjects", "(", ")", ";", "if", "(", "subjects", "==", "null", ")", "return", ";", "ArrayAdapter", "<", "String", ">", "subjectListAdapter", "=", "new", "ArrayAdapter", "<", "String", ">", "(", "this", ",", "R", ".", "layout", ".", "subject_list_item_view", ",", "subjects", ")", ";", "subjectListView", ".", "setAdapter", "(", "subjectListAdapter", ")", ";", "}", "public", "void", "createSubject", "(", "View", "view", ")", "{", "EditText", "newSubjectField", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "subject_create_name", ")", ";", "String", "currentSubjectName", "=", "newSubjectField", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "data", ".", "AddSubject", "(", "currentSubjectName", ")", ";", "TextView", "subjectview", "=", "(", "TextView", ")", "findViewById", "(", "R", ".", "id", ".", "subjectTitle", ")", ";", "subjectview", ".", "setText", "(", "currentSubjectName", ")", ";", "data", ".", "SetSubject", "(", "currentSubjectName", ")", ";", "this", ".", "populateListView", "(", "this", ".", "subjectListView", ")", ";", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_DETAILS_VIEW", ")", ";", "}", "public", "void", "newSubject", "(", "View", "view", ")", "{", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_CREATE_VIEW", ")", ";", "}", "public", "void", "listSubjects", "(", "View", "view", ")", "{", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_LIST_VIEW", ")", ";", "}", "public", "void", "takePhoto", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "CameraSurface", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "TAKE_PHOTO", ")", ";", "}", "public", "void", "takeNote", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "Note", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "TAKE_NOTE", ")", ";", "}", "public", "void", "recordAudio", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "Audio", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "RECORD_AUDIO", ")", ";", "}", "public", "void", "recordVideo", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "VideoGallery", ".", "class", ")", ";", "startActivityForResult", "(", "intent", ",", "RECORD_VIDEO", ")", ";", "}", "public", "void", "finish", "(", "View", "view", ")", "{", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_LIST_VIEW", ")", ";", "}", "public", "void", "goHome", "(", "View", "view", ")", "{", "flipper", ".", "setDisplayedChild", "(", "Interview", ".", "SUBJECT_DASHBOARD_VIEW", ")", ";", "}", "@", "Override", "protected", "void", "onActivityResult", "(", "int", "requestCode", ",", "int", "resultCode", ",", "Intent", "intent", ")", "{", "super", ".", "onActivityResult", "(", "requestCode", ",", "resultCode", ",", "intent", ")", ";", "switch", "(", "requestCode", ")", "{", "case", "TAKE_PHOTO", ":", "break", ";", "case", "RECORD_AUDIO", ":", "break", ";", "case", "RECORD_VIDEO", ":", "break", ";", "}", "}", "}", "</s>" ]
8,959
[ "<s>", "package", "org", ".", "smallbean", ".", "interview", ";", "import", "org", ".", "smallbean", ".", "interview", ".", "utilities", ".", "Data", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "Button", ";", "import", "android", ".", "widget", ".", "EditText", ";", "import", "android", ".", "widget", ".", "Toast", ";", "public", "class", "Note", "extends", "Activity", "{", "private", "Data", "data", "=", "Data", ".", "getInstance", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "notes", ")", ";", "EditText", "note", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "note_text", ")", ";", "note", ".", "setText", "(", "data", ".", "GetNote", "(", ")", ",", "EditText", ".", "BufferType", ".", "EDITABLE", ")", ";", "Button", "saveNoteButton", "=", "(", "Button", ")", "findViewById", "(", "R", ".", "id", ".", "save", ")", ";", "saveNoteButton", ".", "setOnClickListener", "(", "new", "View", ".", "OnClickListener", "(", ")", "{", "public", "void", "onClick", "(", "View", "view", ")", "{", "EditText", "note", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "note_text", ")", ";", "data", ".", "SetNote", "(", "note", ".", "getText", "(", ")", ".", "toString", "(", ")", ")", ";", "Toast", ".", "makeText", "(", "view", ".", "getContext", "(", ")", ",", "\"Text", "Saved\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", ")", ";", "}", "}", "</s>" ]
8,960
[ "<s>", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Set", ";", "public", "class", "Solution", "{", "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "BufferedReader", "stdin", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "System", ".", "in", ")", ")", ";", "String", "line", "=", "null", ";", "int", "numTests", "=", "0", ";", "try", "{", "line", "=", "stdin", ".", "readLine", "(", ")", ";", "numTests", "=", "Integer", ".", "parseInt", "(", "line", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numTests", ";", "i", "++", ")", "{", "try", "{", "line", "=", "stdin", ".", "readLine", "(", ")", ";", "int", "maxN", "=", "Integer", ".", "parseInt", "(", "line", ")", ";", "line", "=", "stdin", ".", "readLine", "(", ")", ";", "String", "numberStrs", "[", "]", "=", "line", ".", "split", "(", "\"", "\"", ")", ";", "int", "numbers", "[", "]", "=", "new", "int", "[", "numberStrs", ".", "length", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "numberStrs", ".", "length", ";", "j", "++", ")", "{", "numbers", "[", "j", "]", "=", "Integer", ".", "parseInt", "(", "numberStrs", "[", "j", "]", ")", ";", "}", "if", "(", "doesAliceToPlayWin", "(", "numbers", ",", "maxN", ")", ")", "{", "System", ".", "out", ".", "println", "(", "\"Alice\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"Bob\"", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "public", "static", "boolean", "doesAliceToPlayWin", "(", "int", "[", "]", "numbers", ",", "int", "maxN", ")", "{", "return", "aliceWins", "(", "numbers", ")", ";", "}", "private", "static", "boolean", "aliceWins", "(", "int", "[", "]", "numbers", ")", "{", "if", "(", "numbers", ".", "length", "==", "_cacheLine", ")", "{", "return", "isWinningPermutation", "(", "numbers", ")", ";", "}", "if", "(", "isSorted", "(", "numbers", ")", ")", "{", "return", "false", ";", "}", "int", "l", "=", "numbers", ".", "length", ";", "int", "[", "]", "newNums", "=", "new", "int", "[", "l", "-", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "l", ";", "i", "++", ")", "{", "copyNums", "(", "newNums", ",", "numbers", ",", "i", ")", ";", "if", "(", "!", "bobWins", "(", "newNums", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "static", "boolean", "isWinningPermutation", "(", "int", "[", "]", "numbers", ")", "{", "int", "[", "]", "sNums", "=", "numbers", ".", "clone", "(", ")", ";", "Arrays", ".", "sort", "(", "sNums", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numbers", ".", "length", ";", "i", "++", ")", "{", "numbers", "[", "i", "]", "=", "Arrays", ".", "binarySearch", "(", "sNums", ",", "numbers", "[", "i", "]", ")", "+", "1", ";", "}", "return", "winningCache", ".", "contains", "(", "stringify", "(", "numbers", ")", ")", ";", "}", "private", "static", "String", "stringify", "(", "int", "[", "]", "numbers", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "y", ":", "numbers", ")", "{", "sb", ".", "append", "(", "y", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "private", "static", "boolean", "bobWins", "(", "int", "[", "]", "numbers", ")", "{", "if", "(", "(", "numbers", ".", "length", "==", "_cacheLine", ")", "||", "(", "numbers", ".", "length", "==", "(", "_cacheLine", "+", "1", ")", ")", "||", "(", "numbers", ".", "length", "==", "(", "_cacheLine", "+", "2", ")", ")", ")", "{", "return", "isWinningPermutation", "(", "numbers", ")", ";", "}", "if", "(", "isSorted", "(", "numbers", ")", ")", "{", "return", "false", ";", "}", "int", "l", "=", "numbers", ".", "length", ";", "int", "[", "]", "newNums", "=", "new", "int", "[", "l", "-", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "l", ";", "i", "++", ")", "{", "copyNums", "(", "newNums", ",", "numbers", ",", "i", ")", ";", "if", "(", "!", "aliceWins", "(", "newNums", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "static", "void", "copyNums", "(", "int", "[", "]", "newNums", ",", "int", "[", "]", "numbers", ",", "int", "i", ")", "{", "int", "curr", "=", "0", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "i", ";", "k", "++", ")", "{", "newNums", "[", "curr", "]", "=", "numbers", "[", "k", "]", ";", "curr", "+=", "1", ";", "}", "for", "(", "int", "k", "=", "i", "+", "1", ";", "k", "<", "numbers", ".", "length", ";", "k", "++", ")", "{", "newNums", "[", "curr", "]", "=", "numbers", "[", "k", "]", ";", "curr", "+=", "1", ";", "}", "}", "private", "static", "boolean", "isSorted", "(", "int", "[", "]", "numbers", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numbers", ".", "length", "-", "1", ";", "i", "++", ")", "{", "if", "(", "numbers", "[", "i", "]", ">", "numbers", "[", "i", "+", "1", "]", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "private", "static", "int", "_cacheLine", "=", "5", ";", "@", "SuppressWarnings", "(", "\"serial\"", ")", "private", "static", "Set", "<", "String", ">", "winningCache", "=", "new", "HashSet", "<", "String", ">", "(", ")", "{", "{", "add", "(", "\"12354\"", ")", ";", "add", "(", "\"12435\"", ")", ";", "add", "(", "\"12453\"", ")", ";", "add", "(", "\"12534\"", ")", ";", "add", "(", "\"13245\"", ")", ";", "add", "(", "\"13254\"", ")", ";", "add", "(", "\"13425\"", ")", ";", "add", "(", "\"13452\"", ")", ";", "add", "(", "\"13524\"", ")", ";", "add", "(", "\"14235\"", ")", ";", "add", "(", "\"14253\"", ")", ";", "add", "(", "\"14523\"", ")", ";", "add", "(", "\"15234\"", ")", ";", "add", "(", "\"21345\"", ")", ";", "add", "(", "\"21354\"", ")", ";", "add", "(", "\"21435\"", ")", ";", "add", "(", "\"21453\"", ")", ";", "add", "(", "\"21534\"", ")", ";", "add", "(", "\"21543\"", ")", ";", "add", "(", "\"23145\"", ")", ";", "add", "(", "\"23154\"", ")", ";", "add", "(", "\"23415\"", ")", ";", "add", "(", "\"23451\"", ")", ";", "add", "(", "\"23514\"", ")", ";", "add", "(", "\"24135\"", ")", ";", "add", "(", "\"24153\"", ")", ";", "add", "(", "\"24513\"", ")", ";", "add", "(", "\"25134\"", ")", ";", "add", "(", "\"25143\"", ")", ";", "add", "(", "\"25314\"", ")", ";", "add", "(", "\"25413\"", ")", ";", "add", "(", "\"31245\"", ")", ";", "add", "(", "\"31254\"", ")", ";", "add", "(", "\"31425\"", ")", ";", "add", "(", "\"31452\"", ")", ";", "add", "(", "\"31524\"", ")", ";", "add", "(", "\"31542\"", ")", ";", "add", "(", "\"32154\"", ")", ";", "add", "(", "\"32514\"", ")", ";", "add", "(", "\"32541\"", ")", ";", "add", "(", "\"34125\"", ")", ";", "add", "(", "\"34152\"", ")", ";", "add", "(", "\"34512\"", ")", ";", "add", "(", "\"35124\"", ")", ";", "add", "(", "\"35142\"", ")", ";", "add", "(", "\"35214\"", ")", ";", "add", "(", "\"35241\"", ")", ";", "add", "(", "\"35412\"", ")", ";", "add", "(", "\"41235\"", ")", ";", "add", "(", "\"41253\"", ")", ";", "add", "(", "\"41352\"", ")", ";", "add", "(", "\"41523\"", ")", ";", "add", "(", "\"41532\"", ")", ";", "add", "(", "\"42153\"", ")", ";", "add", "(", "\"42513\"", ")", ";", "add", "(", "\"42531\"", ")", ";", "add", "(", "\"43152\"", ")", ";", "add", "(", "\"43512\"", ")", ";", "add", "(", "\"45123\"", ")", ";", "add", "(", "\"45132\"", ")", ";", "add", "(", "\"45213\"", ")", ";", "add", "(", "\"45231\"", ")", ";", "add", "(", "\"45312\"", ")", ";", "add", "(", "\"51234\"", ")", ";", "add", "(", "\"52143\"", ")", ";", "add", "(", "\"52413\"", ")", ";", "add", "(", "\"53142\"", ")", ";", "add", "(", "\"53412\"", ")", ";", "add", "(", "\"123465\"", ")", ";", "add", "(", "\"123546\"", ")", ";", "add", "(", "\"123564\"", ")", ";", "add", "(", "\"123645\"", ")", ";", "add", "(", "\"123654\"", ")", ";", "add", "(", "\"124356\"", ")", ";", "add", "(", "\"124536\"", ")", ";", "add", "(", "\"124563\"", ")", ";", "add", "(", "\"124653\"", ")", ";", "add", "(", "\"125346\"", ")", ";", "add", "(", "\"125436\"", ")", ";", "add", "(", "\"125463\"", ")", ";", "add", "(", "\"125643\"", ")", ";", "add", "(", "\"126345\"", ")", ";", "add", "(", "\"126354\"", ")", ";", "add", "(", "\"126435\"", ")", ";", "add", "(", "\"126453\"", ")", ";", "add", "(", "\"126534\"", ")", ";", "add", "(", "\"126543\"", ")", ";", "add", "(", "\"132456\"", ")", ";", "add", "(", "\"132654\"", ")", ";", "add", "(", "\"134256\"", ")", ";", "add", "(", "\"134526\"", ")", ";", "add", "(", "\"134562\"", ")", ";", "add", "(", "\"134652\"", ")", ";", "add", "(", "\"135426\"", ")", ";", "add", "(", "\"135462\"", ")", ";", "add", "(", "\"135642\"", ")", ";", "add", "(", "\"136254\"", ")", ";", "add", "(", "\"136425\"", ")", ";", "add", "(", "\"136452\"", ")", ";", "add", "(", "\"136524\"", ")", ";", "add", "(", "\"136542\"", ")", ";", "add", "(", "\"142356\"", ")", ";", "add", "(", "\"142653\"", ")", ";", "add", "(", "\"143256\"", ")", ";", "add", "(", "\"143265\"", ")", ";", "add", "(", "\"143526\"", ")", ";", "add", "(", "\"143562\"", ")", ";", "add", "(", "\"143625\"", ")", ";", "add", "(", "\"143652\"", ")", ";", "add", "(", "\"145326\"", ")", ";", "add", "(", "\"145362\"", ")", ";", "add", "(", "\"145632\"", ")", ";", "add", "(", "\"146253\"", ")", ";", "add", "(", "\"146325\"", ")", ";", "add", "(", "\"146352\"", ")", ";", "add", "(", "\"146523\"", ")", ";", "add", "(", "\"146532\"", ")", ";", "add", "(", "\"152346\"", ")", ";", "add", "(", "\"152436\"", ")", ";", "add", "(", "\"152463\"", ")", ";", "add", "(", "\"152643\"", ")", ";", "add", "(", "\"153246\"", ")", ";", "add", "(", "\"153264\"", ")", ";", "add", "(", "\"153426\"", ")", ";", "add", "(", "\"153462\"", ")", ";", "add", "(", "\"153624\"", ")", ";", "add", "(", "\"153642\"", ")", ";", "add", "(", "\"154236\"", ")", ";", "add", "(", "\"154263\"", ")", ";", "add", "(", "\"154326\"", ")", ";", "add", "(", "\"154362\"", ")", ";", "add", "(", "\"154623\"", ")", ";", "add", "(", "\"154632\"", ")", ";", "add", "(", "\"156243\"", ")", ";", "add", "(", "\"156324\"", ")", ";", "add", "(", "\"156342\"", ")", ";", "add", "(", "\"156423\"", ")", ";", "add", "(", "\"156432\"", ")", ";", "add", "(", "\"162345\"", ")", ";", "add", "(", "\"162354\"", ")", ";", "add", "(", "\"162435\"", ")", ";", "add", "(", "\"162453\"", ")", ";", "add", "(", "\"162534\"", ")", ";", "add", "(", "\"162543\"", ")", ";", "add", "(", "\"163245\"", ")", ";", "add", "(", "\"163254\"", ")", ";", "add", "(", "\"163425\"", ")", ";", "add", "(", "\"163452\"", ")", ";", "add", "(", "\"163524\"", ")", ";", "add", "(", "\"163542\"", ")", ";", "add", "(", "\"164235\"", ")", ";", "add", "(", "\"164253\"", ")", ";", "add", "(", "\"164325\"", ")", ";", "add", "(", "\"164352\"", ")", ";", "add", "(", "\"164523\"", ")", ";", "add", "(", "\"164532\"", ")", ";", "add", "(", "\"165234\"", ")", ";", "add", "(", "\"165243\"", ")", ";", "add", "(", "\"165324\"", ")", ";", "add", "(", "\"165342\"", ")", ";", "add", "(", "\"165423\"", ")", ";", "add", "(", "\"165432\"", ")", ";", "add", "(", "\"213456\"", ")", ";", "add", "(", "\"213654\"", ")", ";", "add", "(", "\"214653\"", ")", ";", "add", "(", "\"215436\"", ")", ";", "add", "(", "\"215463\"", ")", ";", "add", "(", "\"215643\"", ")", ";", "add", "(", "\"216354\"", ")", ";", "add", "(", "\"216435\"", ")", ";", "add", "(", "\"216453\"", ")", ";", "add", "(", "\"216534\"", ")", ";", "add", "(", "\"216543\"", ")", ";", "add", "(", "\"231456\"", ")", ";", "add", "(", "\"231654\"", ")", ";", "add", "(", "\"234156\"", ")", ";", "add", "(", "\"234516\"", ")", ";", "add", "(", "\"234561\"", ")", ";", "add", "(", "\"234651\"", ")", ";", "add", "(", "\"235416\"", ")", ";", "add", "(", "\"235461\"", ")", ";", "add", "(", "\"235641\"", ")", ";", "add", "(", "\"236154\"", ")", ";", "add", "(", "\"236415\"", ")", ";", "add", "(", "\"236451\"", ")", ";", "add", "(", "\"236514\"", ")", ";", "add", "(", "\"236541\"", ")", ";", "add", "(", "\"241653\"", ")", ";", "add", "(", "\"243156\"", ")", ";", "add", "(", "\"243165\"", ")", ";", "add", "(", "\"243516\"", ")", ";", "add", "(", "\"243561\"", ")", ";", "add", "(", "\"243615\"", ")", ";", "add", "(", "\"243651\"", ")", ";", "add", "(", "\"245316\"", ")", ";", "add", "(", "\"245361\"", ")", ";", "add", "(", "\"245631\"", ")", ";", "add", "(", "\"246153\"", ")", ";", "add", "(", "\"246315\"", ")", ";", "add", "(", "\"246351\"", ")", ";", "add", "(", "\"246513\"", ")", ";", "add", "(", "\"246531\"", ")", ";", "add", "(", "\"251436\"", ")", ";", "add", "(", "\"251463\"", ")", ";", "add", "(", "\"251643\"", ")", ";", "add", "(", "\"253146\"", ")", ";", "add", "(", "\"253164\"", ")", ";", "add", "(", "\"253416\"", ")", ";", "add", "(", "\"253461\"", ")", ";", "add", "(", "\"253614\"", ")", ";", "add", "(", "\"253641\"", ")", ";", "add", "(", "\"254136\"", ")", ";", "add", "(", "\"254163\"", ")", ";", "add", "(", "\"254316\"", ")", ";", "add", "(", "\"254361\"", ")", ";", "add", "(", "\"254613\"", ")", ";", "add", "(", "\"254631\"", ")", ";", "add", "(", "\"256143\"", ")", ";", "add", "(", "\"256314\"", ")", ";", "add", "(", "\"256341\"", ")", ";", "add", "(", "\"256413\"", ")", ";", "add", "(", "\"256431\"", ")", ";", "add", "(", "\"261354\"", ")", ";", "add", "(", "\"261435\"", ")", ";", "add", "(", "\"261453\"", ")", ";", "add", "(", "\"261534\"", ")", ";", "add", "(", "\"261543\"", ")", ";", "add", "(", "\"263145\"", ")", ";", "add", "(", "\"263154\"", ")", ";", "add", "(", "\"263415\"", ")", ";", "add", "(", "\"263451\"", ")", ";", "add", "(", "\"263514\"", ")", ";", "add", "(", "\"263541\"", ")", ";", "add", "(", "\"264135\"", ")", ";", "add", "(", "\"264153\"", ")", ";", "add", "(", "\"264315\"", ")", ";", "add", "(", "\"264351\"", ")", ";", "add", "(", "\"264513\"", ")", ";", "add", "(", "\"264531\"", ")", ";", "add", "(", "\"265134\"", ")", ";", "add", "(", "\"265143\"", ")", ";", "add", "(", "\"265314\"", ")", ";", "add", "(", "\"265341\"", ")", ";", "add", "(", "\"265413\"", ")", ";", "add", "(", "\"265431\"", ")", ";", "add", "(", "\"312456\"", ")", ";", "add", "(", "\"312654\"", ")", ";", "add", "(", "\"314652\"", ")", ";", "add", "(", "\"315426\"", ")", ";", "add", "(", "\"315462\"", ")", ";", "add", "(", "\"315642\"", ")", ";", "add", "(", "\"316254\"", ")", ";", "add", "(", "\"316425\"", ")", ";", "add", "(", "\"316452\"", ")", ";", "add", "(", "\"316524\"", ")", ";", "add", "(", "\"316542\"", ")", ";", "add", "(", "\"321456\"", ")", ";", "add", "(", "\"321465\"", ")", ";", "add", "(", "\"321546\"", ")", ";", "add", "(", "\"321564\"", ")", ";", "add", "(", "\"321645\"", ")", ";", "add", "(", "\"324156\"", ")", ";", "add", "(", "\"324165\"", ")", ";", "add", "(", "\"324516\"", ")", ";", "add", "(", "\"324561\"", ")", ";", "add", "(", "\"324615\"", ")", ";", "add", "(", "\"324651\"", ")", ";", "add", "(", "\"325146\"", ")", ";", "add", "(", "\"325164\"", ")", ";", "add", "(", "\"325416\"", ")", ";", "add", "(", "\"325461\"", ")", ";", "add", "(", "\"325614\"", ")", ";", "add", "(", "\"325641\"", ")", ";", "add", "(", "\"326145\"", ")", ";", "add", "(", "\"326415\"", ")", ";", "add", "(", "\"326451\"", ")", ";", "add", "(", "\"326541\"", ")", ";", "add", "(", "\"341652\"", ")", ";", "add", "(", "\"342156\"", ")", ";", "add", "(", "\"342165\"", ")", ";", "add", "(", "\"342516\"", ")", ";", "add", "(", "\"342561\"", ")", ";", "add", "(", "\"342615\"", ")", ";", "add", "(", "\"342651\"", ")", ";", "add", "(", "\"345216\"", ")", ";", "add", "(", "\"345261\"", ")", ";", "add", "(", "\"345621\"", ")", ";", "add", "(", "\"346152\"", ")", ";", "add", "(", "\"346215\"", ")", ";", "add", "(", "\"346251\"", ")", ";", "add", "(", "\"346512\"", ")", ";", "add", "(", "\"346521\"", ")", ";", "add", "(", "\"351426\"", ")", ";", "add", "(", "\"351462\"", ")", ";", "add", "(", "\"351642\"", ")", ";", "add", "(", "\"352146\"", ")", ";", "add", "(", "\"352164\"", ")", ";", "add", "(", "\"352416\"", ")", ";", "add", "(", "\"352461\"", ")", ";", "add", "(", "\"352614\"", ")", ";", "add", "(", "\"352641\"", ")", ";", "add", "(", "\"354126\"", ")", ";", "add", "(", "\"354162\"", ")", ";", "add", "(", "\"354216\"", ")", ";", "add", "(", "\"354261\"", ")", ";", "add", "(", "\"354612\"", ")", ";", "add", "(", "\"354621\"", ")", ";", "add", "(", "\"356142\"", ")", ";", "add", "(", "\"356214\"", ")", ";", "add", "(", "\"356241\"", ")", ";", "add", "(", "\"356412\"", ")", ";", "add", "(", "\"356421\"", ")", ";", "add", "(", "\"361254\"", ")", ";", "add", "(", "\"361425\"", ")", ";", "add", "(", "\"361452\"", ")", ";", "add", "(", "\"361524\"", ")", ";", "add", "(", "\"361542\"", ")", ";", "add", "(", "\"362145\"", ")", ";", "add", "(", "\"362415\"", ")", ";", "add", "(", "\"362451\"", ")", ";", "add", "(", "\"362541\"", ")", ";", "add", "(", "\"364125\"", ")", ";", "add", "(", "\"364152\"", ")", ";", "add", "(", "\"364215\"", ")", ";", "add", "(", "\"364251\"", ")", ";", "add", "(", "\"364512\"", ")", ";", "add", "(", "\"364521\"", ")", ";", "add", "(", "\"365124\"", ")", ";", "add", "(", "\"365142\"", ")", ";", "add", "(", "\"365214\"", ")", ";", "add", "(", "\"365241\"", ")", ";", "add", "(", "\"365412\"", ")", ";", "add", "(", "\"365421\"", ")", ";", "add", "(", "\"412356\"", ")", ";", "add", "(", "\"412653\"", ")", ";", "add", "(", "\"413256\"", ")", ";", "add", "(", "\"413265\"", ")", ";", "add", "(", "\"413526\"", ")", ";", "add", "(", "\"413562\"", ")", ";", "add", "(", "\"413625\"", ")", ";", "add", "(", "\"413652\"", ")", ";", "add", "(", "\"415326\"", ")", ";", "add", "(", "\"415362\"", ")", ";", "add", "(", "\"415632\"", ")", ";", "add", "(", "\"416253\"", ")", ";", "add", "(", "\"416325\"", ")", ";", "add", "(", "\"416352\"", ")", ";", "add", "(", "\"416523\"", ")", ";", "add", "(", "\"416532\"", ")", ";", "add", "(", "\"421356\"", ")", ";", "add", "(", "\"421365\"", ")", ";", "add", "(", "\"421536\"", ")", ";", "add", "(", "\"421563\"", ")", ";", "add", "(", "\"421635\"", ")", ";", "add", "(", "\"423156\"", ")", ";", "add", "(", "\"423165\"", ")", ";", "add", "(", "\"423516\"", ")", ";", "add", "(", "\"423561\"", ")", ";", "add", "(", "\"423615\"", ")", ";", "add", "(", "\"423651\"", ")", ";", "add", "(", "\"425136\"", ")", ";", "add", "(", "\"425163\"", ")", ";", "add", "(", "\"425316\"", ")", ";", "add", "(", "\"425361\"", ")", ";", "add", "(", "\"425613\"", ")", ";", "add", "(", "\"425631\"", ")", ";", "add", "(", "\"426135\"", ")", ";", "add", "(", "\"426315\"", ")", ";", "add", "(", "\"426351\"", ")", ";", "add", "(", "\"426531\"", ")", ";", "add", "(", "\"431256\"", ")", ";", "add", "(", "\"431265\"", ")", ";", "add", "(", "\"431526\"", ")", ";", "add", "(", "\"431562\"", ")", ";", "add", "(", "\"431625\"", ")", ";", "add", "(", "\"432156\"", ")", ";", "add", "(", "\"432165\"", ")", ";", "add", "(", "\"432516\"", ")", ";", "add", "(", "\"432561\"", ")", ";", "add", "(", "\"432615\"", ")", ";", "add", "(", "\"432651\"", ")", ";", "add", "(", "\"435126\"", ")", ";", "add", "(", "\"435162\"", ")", ";", "add", "(", "\"435216\"", ")", ";", "add", "(", "\"435261\"", ")", ";", "add", "(", "\"435612\"", ")", ";", "add", "(", "\"435621\"", ")", ";", "add", "(", "\"436125\"", ")", ";", "add", "(", "\"436215\"", ")", ";", "add", "(", "\"436251\"", ")", ";", "add", "(", "\"436521\"", ")", ";", "add", "(", "\"451326\"", ")", ";", "add", "(", "\"451362\"", ")", ";", "add", "(", "\"451632\"", ")", ";", "add", "(", "\"452136\"", ")", ";", "add", "(", "\"452163\"", ")", ";", "add", "(", "\"452316\"", ")", ";", "add", "(", "\"452361\"", ")", ";", "add", "(", "\"452613\"", ")", ";", "add", "(", "\"452631\"", ")", ";", "add", "(", "\"453126\"", ")", ";", "add", "(", "\"453162\"", ")", ";", "add", "(", "\"453216\"", ")", ";", "add", "(", "\"453261\"", ")", ";", "add", "(", "\"453612\"", ")", ";", "add", "(", "\"453621\"", ")", ";", "add", "(", "\"456132\"", ")", ";", "add", "(", "\"456213\"", ")", ";", "add", "(", "\"456231\"", ")", ";", "add", "(", "\"456312\"", ")", ";", "add", "(", "\"456321\"", ")", ";", "add", "(", "\"461253\"", ")", ";", "add", "(", "\"461325\"", ")", ";", "add", "(", "\"461352\"", ")", ";", "add", "(", "\"461523\"", ")", ";", "add", "(", "\"461532\"", ")", ";", "add", "(", "\"462135\"", ")", ";", "add", "(", "\"462315\"", ")", ";", "add", "(", "\"462351\"", ")", ";", "add", "(", "\"462531\"", ")", ";", "add", "(", "\"463125\"", ")", ";", "add", "(", "\"463215\"", ")", ";", "add", "(", "\"463251\"", ")", ";", "add", "(", "\"463521\"", ")", ";", "add", "(", "\"465123\"", ")", ";", "add", "(", "\"465132\"", ")", ";", "add", "(", "\"465213\"", ")", ";", "add", "(", "\"465231\"", ")", ";", "add", "(", "\"465312\"", ")", ";", "add", "(", "\"465321\"", ")", ";", "add", "(", "\"512346\"", ")", ";", "add", "(", "\"512436\"", ")", ";", "add", "(", "\"512463\"", ")", ";", "add", "(", "\"512643\"", ")", ";", "add", "(", "\"513246\"", ")", ";", "add", "(", "\"513264\"", ")", ";", "add", "(", "\"513426\"", ")", ";", "add", "(", "\"513462\"", ")", ";", "add", "(", "\"513624\"", ")", ";", "add", "(", "\"513642\"", ")", ";", "add", "(", "\"514236\"", ")", ";", "add", "(", "\"514263\"", ")", ";", "add", "(", "\"514326\"", ")", ";", "add", "(", "\"514362\"", ")", ";", "add", "(", "\"514623\"", ")", ";", "add", "(", "\"514632\"", ")", ";", "add", "(", "\"516243\"", ")", ";", "add", "(", "\"516324\"", ")", ";", "add", "(", "\"516342\"", ")", ";", "add", "(", "\"516423\"", ")", ";", "add", "(", "\"516432\"", ")", ";", "add", "(", "\"521346\"", ")", ";", "add", "(", "\"521364\"", ")", ";", "add", "(", "\"521436\"", ")", ";", "add", "(", "\"521463\"", ")", ";", "add", "(", "\"521634\"", ")", ";", "add", "(", "\"523146\"", ")", ";", "add", "(", "\"523164\"", ")", ";", "add", "(", "\"523416\"", ")", ";", "add", "(", "\"523461\"", ")", ";", "add", "(", "\"523614\"", ")", ";", "add", "(", "\"523641\"", ")", ";", "add", "(", "\"524136\"", ")", ";", "add", "(", "\"524163\"", ")", ";", "add", "(", "\"524316\"", ")", ";", "add", "(", "\"524361\"", ")", ";", "add", "(", "\"524613\"", ")", ";", "add", "(", "\"524631\"", ")", ";", "add", "(", "\"526134\"", ")", ";", "add", "(", "\"526314\"", ")", ";", "add", "(", "\"526341\"", ")", ";", "add", "(", "\"526431\"", ")", ";", "add", "(", "\"531246\"", ")", ";", "add", "(", "\"531264\"", ")", ";", "add", "(", "\"531426\"", ")", ";", "add", "(", "\"531462\"", ")", ";", "add", "(", "\"531624\"", ")", ";", "add", "(", "\"532146\"", ")", ";", "add", "(", "\"532164\"", ")", ";", "add", "(", "\"532416\"", ")", ";", "add", "(", "\"532461\"", ")", ";", "add", "(", "\"532614\"", ")", ";", "add", "(", "\"532641\"", ")", ";", "add", "(", "\"534126\"", ")", ";", "add", "(", "\"534162\"", ")", ";", "add", "(", "\"534216\"", ")", ";", "add", "(", "\"534261\"", ")", ";", "add", "(", "\"534612\"", ")", ";", "add", "(", "\"534621\"", ")", ";", "add", "(", "\"536124\"", ")", ";", "add", "(", "\"536214\"", ")", ";", "add", "(", "\"536241\"", ")", ";", "add", "(", "\"536421\"", ")", ";", "add", "(", "\"541236\"", ")", ";", "add", "(", "\"541263\"", ")", ";", "add", "(", "\"541326\"", ")", ";", "add", "(", "\"541362\"", ")", ";", "add", "(", "\"541623\"", ")", ";", "add", "(", "\"541632\"", ")", ";", "add", "(", "\"542136\"", ")", ";", "add", "(", "\"542163\"", ")", ";", "add", "(", "\"542316\"", ")", ";", "add", "(", "\"542361\"", ")", ";", "add", "(", "\"542613\"", ")", ";", "add", "(", "\"542631\"", ")", ";", "add", "(", "\"543126\"", ")", ";", "add", "(", "\"543162\"", ")", ";", "add", "(", "\"543216\"", ")", ";", "add", "(", "\"543261\"", ")", ";", "add", "(", "\"543612\"", ")", ";", "add", "(", "\"543621\"", ")", ";", "add", "(", "\"546123\"", ")", ";", "add", "(", "\"546132\"", ")", ";", "add", "(", "\"546213\"", ")", ";", "add", "(", "\"546231\"", ")", ";", "add", "(", "\"546312\"", ")", ";", "add", "(", "\"546321\"", ")", ";", "add", "(", "\"561243\"", ")", ";", "add", "(", "\"561324\"", ")", ";", "add", "(", "\"561342\"", ")", ";", "add", "(", "\"561423\"", ")", ";", "add", "(", "\"561432\"", ")", ";", "add", "(", "\"562134\"", ")", ";", "add", "(", "\"562314\"", ")", ";", "add", "(", "\"562341\"", ")", ";", "add", "(", "\"562431\"", ")", ";", "add", "(", "\"563124\"", ")", ";", "add", "(", "\"563214\"", ")", ";", "add", "(", "\"563241\"", ")", ";", "add", "(", "\"563421\"", ")", ";", "add", "(", "\"564123\"", ")", ";", "add", "(", "\"564132\"", ")", ";", "add", "(", "\"564213\"", ")", ";", "add", "(", "\"564231\"", ")", ";", "add", "(", "\"564312\"", ")", ";", "add", "(", "\"564321\"", ")", ";", "add", "(", "\"612345\"", ")", ";", "add", "(", "\"612354\"", ")", ";", "add", "(", "\"612435\"", ")", ";", "add", "(", "\"612453\"", ")", ";", "add", "(", "\"612534\"", ")", ";", "add", "(", "\"612543\"", ")", ";", "add", "(", "\"613245\"", ")", ";", "add", "(", "\"613254\"", ")", ";", "add", "(", "\"613425\"", ")", ";", "add", "(", "\"613452\"", ")", ";", "add", "(", "\"613524\"", ")", ";", "add", "(", "\"613542\"", ")", ";", "add", "(", "\"614235\"", ")", ";", "add", "(", "\"614253\"", ")", ";", "add", "(", "\"614325\"", ")", ";", "add", "(", "\"614352\"", ")", ";", "add", "(", "\"614523\"", ")", ";", "add", "(", "\"614532\"", ")", ";", "add", "(", "\"615234\"", ")", ";", "add", "(", "\"615243\"", ")", ";", "add", "(", "\"615324\"", ")", ";", "add", "(", "\"615342\"", ")", ";", "add", "(", "\"615423\"", ")", ";", "add", "(", "\"615432\"", ")", ";", "add", "(", "\"621345\"", ")", ";", "add", "(", "\"621354\"", ")", ";", "add", "(", "\"621435\"", ")", ";", "add", "(", "\"621453\"", ")", ";", "add", "(", "\"621534\"", ")", ";", "add", "(", "\"621543\"", ")", ";", "add", "(", "\"623145\"", ")", ";", "add", "(", "\"623154\"", ")", ";", "add", "(", "\"623415\"", ")", ";", "add", "(", "\"623451\"", ")", ";", "add", "(", "\"623514\"", ")", ";", "add", "(", "\"623541\"", ")", ";", "add", "(", "\"624135\"", ")", ";", "add", "(", "\"624153\"", ")", ";", "add", "(", "\"624315\"", ")", ";", "add", "(", "\"624351\"", ")", ";", "add", "(", "\"624513\"", ")", ";", "add", "(", "\"624531\"", ")", ";", "add", "(", "\"625134\"", ")", ";", "add", "(", "\"625143\"", ")", ";", "add", "(", "\"625314\"", ")", ";", "add", "(", "\"625341\"", ")", ";", "add", "(", "\"625413\"", ")", ";", "add", "(", "\"625431\"", ")", ";", "add", "(", "\"631245\"", ")", ";", "add", "(", "\"631254\"", ")", ";", "add", "(", "\"631425\"", ")", ";", "add", "(", "\"631452\"", ")", ";", "add", "(", "\"631524\"", ")", ";", "add", "(", "\"631542\"", ")", ";", "add", "(", "\"632145\"", ")", ";", "add", "(", "\"632154\"", ")", ";", "add", "(", "\"632415\"", ")", ";", "add", "(", "\"632451\"", ")", ";", "add", "(", "\"632514\"", ")", ";", "add", "(", "\"632541\"", ")", ";", "add", "(", "\"634125\"", ")", ";", "add", "(", "\"634152\"", ")", ";", "add", "(", "\"634215\"", ")", ";", "add", "(", "\"634251\"", ")", ";", "add", "(", "\"634512\"", ")", ";", "add", "(", "\"634521\"", ")", ";", "add", "(", "\"635124\"", ")", ";", "add", "(", "\"635142\"", ")", ";", "add", "(", "\"635214\"", ")", ";", "add", "(", "\"635241\"", ")", ";", "add", "(", "\"635412\"", ")", ";", "add", "(", "\"635421\"", ")", ";", "add", "(", "\"641235\"", ")", ";", "add", "(", "\"641253\"", ")", ";", "add", "(", "\"641325\"", ")", ";", "add", "(", "\"641352\"", ")", ";", "add", "(", "\"641523\"", ")", ";", "add", "(", "\"641532\"", ")", ";", "add", "(", "\"642135\"", ")", ";", "add", "(", "\"642153\"", ")", ";", "add", "(", "\"642315\"", ")", ";", "add", "(", "\"642351\"", ")", ";", "add", "(", "\"642513\"", ")", ";", "add", "(", "\"642531\"", ")", ";", "add", "(", "\"643125\"", ")", ";", "add", "(", "\"643152\"", ")", ";", "add", "(", "\"643215\"", ")", ";", "add", "(", "\"643251\"", ")", ";", "add", "(", "\"643512\"", ")", ";", "add", "(", "\"643521\"", ")", ";", "add", "(", "\"645123\"", ")", ";", "add", "(", "\"645132\"", ")", ";", "add", "(", "\"645213\"", ")", ";", "add", "(", "\"645231\"", ")", ";", "add", "(", "\"645312\"", ")", ";", "add", "(", "\"645321\"", ")", ";", "add", "(", "\"651234\"", ")", ";", "add", "(", "\"651243\"", ")", ";", "add", "(", "\"651324\"", ")", ";", "add", "(", "\"651342\"", ")", ";", "add", "(", "\"651423\"", ")", ";", "add", "(", "\"651432\"", ")", ";", "add", "(", "\"652134\"", ")", ";", "add", "(", "\"652143\"", ")", ";", "add", "(", "\"652314\"", ")", ";", "add", "(", "\"652341\"", ")", ";", "add", "(", "\"652413\"", ")", ";", "add", "(", "\"652431\"", ")", ";", "add", "(", "\"653124\"", ")", ";", "add", "(", "\"653142\"", ")", ";", "add", "(", "\"653214\"", ")", ";", "add", "(", "\"653241\"", ")", ";", "add", "(", "\"653412\"", ")", ";", "add", "(", "\"653421\"", ")", ";", "add", "(", "\"654123\"", ")", ";", "add", "(", "\"654132\"", ")", ";", "add", "(", "\"654213\"", ")", ";", "add", "(", "\"654231\"", ")", ";", "add", "(", "\"654312\"", ")", ";", "add", "(", "\"654321\"", ")", ";", "add", "(", "\"1234576\"", ")", ";", "add", "(", "\"1234657\"", ")", ";", "add", "(", "\"1234675\"", ")", ";", "add", "(", "\"1234756\"", ")", ";", "add", "(", "\"1235467\"", ")", ";", "add", "(", "\"1235476\"", ")", ";", "add", "(", "\"1235647\"", ")", ";", "add", "(", "\"1235674\"", ")", ";", "add", "(", "\"1235746\"", ")", ";", "add", "(", "\"1236457\"", ")", ";", "add", "(", "\"1236475\"", ")", ";", "add", "(", "\"1236745\"", ")", ";", "add", "(", "\"1237456\"", ")", ";", "add", "(", "\"1243567\"", ")", ";", "add", "(", "\"1243576\"", ")", ";", "add", "(", "\"1243657\"", ")", ";", "add", "(", "\"1243675\"", ")", ";", "add", "(", "\"1243756\"", ")", ";", "add", "(", "\"1243765\"", ")", ";", "add", "(", "\"1245367\"", ")", ";", "add", "(", "\"1245376\"", ")", ";", "add", "(", "\"1245637\"", ")", ";", "add", "(", "\"1245673\"", ")", ";", "add", "(", "\"1245736\"", ")", ";", "add", "(", "\"1246357\"", ")", ";", "add", "(", "\"1246375\"", ")", ";", "add", "(", "\"1246735\"", ")", ";", "add", "(", "\"1247356\"", ")", ";", "add", "(", "\"1247365\"", ")", ";", "add", "(", "\"1247536\"", ")", ";", "add", "(", "\"1247635\"", ")", ";", "add", "(", "\"1253467\"", ")", ";", "add", "(", "\"1253476\"", ")", ";", "add", "(", "\"1253647\"", ")", ";", "add", "(", "\"1253674\"", ")", ";", "add", "(", "\"1253746\"", ")", ";", "add", "(", "\"1253764\"", ")", ";", "add", "(", "\"1254376\"", ")", ";", "add", "(", "\"1254736\"", ")", ";", "add", "(", "\"1254763\"", ")", ";", "add", "(", "\"1256347\"", ")", ";", "add", "(", "\"1256374\"", ")", ";", "add", "(", "\"1256734\"", ")", ";", "add", "(", "\"1257346\"", ")", ";", "add", "(", "\"1257364\"", ")", ";", "add", "(", "\"1257436\"", ")", ";", "add", "(", "\"1257463\"", ")", ";", "add", "(", "\"1257634\"", ")", ";", "add", "(", "\"1263457\"", ")", ";", "add", "(", "\"1263475\"", ")", ";", "add", "(", "\"1263574\"", ")", ";", "add", "(", "\"1263745\"", ")", ";", "add", "(", "\"1263754\"", ")", ";", "add", "(", "\"1264375\"", ")", ";", "add", "(", "\"1264735\"", ")", ";", "add", "(", "\"1264753\"", ")", ";", "add", "(", "\"1265374\"", ")", ";", "add", "(", "\"1265734\"", ")", ";", "add", "(", "\"1267345\"", ")", ";", "add", "(", "\"1267354\"", ")", ";", "add", "(", "\"1267435\"", ")", ";", "add", "(", "\"1267453\"", ")", ";", "add", "(", "\"1267534\"", ")", ";", "add", "(", "\"1273456\"", ")", ";", "add", "(", "\"1274365\"", ")", ";", "add", "(", "\"1274635\"", ")", ";", "add", "(", "\"1275364\"", ")", ";", "add", "(", "\"1275634\"", ")", ";", "add", "(", "\"1324567\"", ")", ";", "add", "(", "\"1324576\"", ")", ";", "add", "(", "\"1324657\"", ")", ";", "add", "(", "\"1324675\"", ")", ";", "add", "(", "\"1324756\"", ")", ";", "add", "(", "\"1324765\"", ")", ";", "add", "(", "\"1325467\"", ")", ";", "add", "(", "\"1325476\"", ")", ";", "add", "(", "\"1325647\"", ")", ";", "add", "(", "\"1325674\"", ")", ";", "add", "(", "\"1325746\"", ")", ";", "add", "(", "\"1325764\"", ")", ";", "add", "(", "\"1326457\"", ")", ";", "add", "(", "\"1326475\"", ")", ";", "add", "(", "\"1326547\"", ")", ";", "add", "(", "\"1326574\"", ")", ";", "add", "(", "\"1326745\"", ")", ";", "add", "(", "\"1326754\"", ")", ";", "add", "(", "\"1327456\"", ")", ";", "add", "(", "\"1327465\"", ")", ";", "add", "(", "\"1327546\"", ")", ";", "add", "(", "\"1327564\"", ")", ";", "add", "(", "\"1327645\"", ")", ";", "add", "(", "\"1342567\"", ")", ";", "add", "(", "\"1342576\"", ")", ";", "add", "(", "\"1342657\"", ")", ";", "add", "(", "\"1342675\"", ")", ";", "add", "(", "\"1342756\"", ")", ";", "add", "(", "\"1342765\"", ")", ";", "add", "(", "\"1345267\"", ")", ";", "add", "(", "\"1345276\"", ")", ";", "add", "(", "\"1345627\"", ")", ";", "add", "(", "\"1345672\"", ")", ";", "add", "(", "\"1345726\"", ")", ";", "add", "(", "\"1346257\"", ")", ";", "add", "(", "\"1346275\"", ")", ";", "add", "(", "\"1346725\"", ")", ";", "add", "(", "\"1347256\"", ")", ";", "add", "(", "\"1347265\"", ")", ";", "add", "(", "\"1347526\"", ")", ";", "add", "(", "\"1347625\"", ")", ";", "add", "(", "\"1352467\"", ")", ";", "add", "(", "\"1352476\"", ")", ";", "add", "(", "\"1352647\"", ")", ";", "add", "(", "\"1352674\"", ")", ";", "add", "(", "\"1352746\"", ")", ";", "add", "(", "\"1352764\"", ")", ";", "add", "(", "\"1354276\"", ")", ";", "add", "(", "\"1354726\"", ")", ";", "add", "(", "\"1354762\"", ")", ";", "add", "(", "\"1356247\"", ")", ";", "add", "(", "\"1356274\"", ")", ";", "add", "(", "\"1356724\"", ")", ";", "add", "(", "\"1357246\"", ")", ";", "add", "(", "\"1357264\"", ")", ";", "add", "(", "\"1357426\"", ")", ";", "add", "(", "\"1357462\"", ")", ";", "add", "(", "\"1357624\"", ")", ";", "add", "(", "\"1362457\"", ")", ";", "add", "(", "\"1362475\"", ")", ";", "add", "(", "\"1362547\"", ")", ";", "add", "(", "\"1362574\"", ")", ";", "add", "(", "\"1362745\"", ")", ";", "add", "(", "\"1362754\"", ")", ";", "add", "(", "\"1364257\"", ")", ";", "add", "(", "\"1364275\"", ")", ";", "add", "(", "\"1364725\"", ")", ";", "add", "(", "\"1364752\"", ")", ";", "add", "(", "\"1365247\"", ")", ";", "add", "(", "\"1365274\"", ")", ";", "add", "(", "\"1365724\"", ")", ";", "add", "(", "\"1367245\"", ")", ";", "add", "(", "\"1367254\"", ")", ";", "add", "(", "\"1367425\"", ")", ";", "add", "(", "\"1367452\"", ")", ";", "add", "(", "\"1367524\"", ")", ";", "add", "(", "\"1372456\"", ")", ";", "add", "(", "\"1372465\"", ")", ";", "add", "(", "\"1372546\"", ")", ";", "add", "(", "\"1372564\"", ")", ";", "add", "(", "\"1372645\"", ")", ";", "add", "(", "\"1374256\"", ")", ";", "add", "(", "\"1374265\"", ")", ";", "add", "(", "\"1374625\"", ")", ";", "add", "(", "\"1375246\"", ")", ";", "add", "(", "\"1375264\"", ")", ";", "add", "(", "\"1375624\"", ")", ";", "add", "(", "\"1376245\"", ")", ";", "add", "(", "\"1423567\"", ")", ";", "add", "(", "\"1423576\"", ")", ";", "add", "(", "\"1423657\"", ")", ";", "add", "(", "\"1423675\"", ")", ";", "add", "(", "\"1423756\"", ")", ";", "add", "(", "\"1423765\"", ")", ";", "add", "(", "\"1425367\"", ")", ";", "add", "(", "\"1425376\"", ")", ";", "add", "(", "\"1425637\"", ")", ";", "add", "(", "\"1425673\"", ")", ";", "add", "(", "\"1425736\"", ")", ";", "add", "(", "\"1425763\"", ")", ";", "add", "(", "\"1426357\"", ")", ";", "add", "(", "\"1426375\"", ")", ";", "add", "(", "\"1426537\"", ")", ";", "add", "(", "\"1426573\"", ")", ";", "add", "(", "\"1426735\"", ")", ";", "add", "(", "\"1426753\"", ")", ";", "add", "(", "\"1427356\"", ")", ";", "add", "(", "\"1427365\"", ")", ";", "add", "(", "\"1427536\"", ")", ";", "add", "(", "\"1427563\"", ")", ";", "add", "(", "\"1427635\"", ")", ";", "add", "(", "\"1432576\"", ")", ";", "add", "(", "\"1432657\"", ")", ";", "add", "(", "\"1432675\"", ")", ";", "add", "(", "\"1432756\"", ")", ";", "add", "(", "\"1432765\"", ")", ";", "add", "(", "\"1435276\"", ")", ";", "add", "(", "\"1435726\"", ")", ";", "add", "(", "\"1435762\"", ")", ";", "add", "(", "\"1436257\"", ")", ";", "add", "(", "\"1436275\"", ")", ";", "add", "(", "\"1436527\"", ")", ";", "add", "(", "\"1436572\"", ")", ";", "add", "(", "\"1436725\"", ")", ";", "add", "(", "\"1436752\"", ")", ";", "add", "(", "\"1437256\"", ")", ";", "add", "(", "\"1437265\"", ")", ";", "add", "(", "\"1437526\"", ")", ";", "add", "(", "\"1437562\"", ")", ";", "add", "(", "\"1437625\"", ")", ";", "add", "(", "\"1452367\"", ")", ";", "add", "(", "\"1452376\"", ")", ";", "add", "(", "\"1452637\"", ")", ";", "add", "(", "\"1452673\"", ")", ";", "add", "(", "\"1452736\"", ")", ";", "add", "(", "\"1452763\"", ")", ";", "add", "(", "\"1453276\"", ")", ";", "add", "(", "\"1453726\"", ")", ";", "add", "(", "\"1453762\"", ")", ";", "add", "(", "\"1456237\"", ")", ";", "add", "(", "\"1456273\"", ")", ";", "add", "(", "\"1456723\"", ")", ";", "add", "(", "\"1457236\"", ")", ";", "add", "(", "\"1457263\"", ")", ";", "add", "(", "\"1457326\"", ")", ";", "add", "(", "\"1457362\"", ")", ";", "add", "(", "\"1457623\"", ")", ";", "add", "(", "\"1462357\"", ")", ";", "add", "(", "\"1462375\"", ")", ";", "add", "(", "\"1462537\"", ")", ";", "add", "(", "\"1462573\"", ")", ";", "add", "(", "\"1462735\"", ")", ";", "add", "(", "\"1462753\"", ")", ";", "add", "(", "\"1463257\"", ")", ";", "add", "(", "\"1463275\"", ")", ";", "add", "(", "\"1463527\"", ")", ";", "add", "(", "\"1463572\"", ")", ";", "add", "(", "\"1463725\"", ")", ";", "add", "(", "\"1463752\"", ")", ";", "add", "(", "\"1465237\"", ")", ";", "add", "(", "\"1465273\"", ")", ";", "add", "(", "\"1465723\"", ")", ";", "add", "(", "\"1467235\"", ")", ";", "add", "(", "\"1467253\"", ")", ";", "add", "(", "\"1467325\"", ")", ";", "add", "(", "\"1467352\"", ")", ";", "add", "(", "\"1467523\"", ")", ";", "add", "(", "\"1472356\"", ")", ";", "add", "(", "\"1472365\"", ")", ";", "add", "(", "\"1472536\"", ")", ";", "add", "(", "\"1472563\"", ")", ";", "add", "(", "\"1472635\"", ")", ";", "add", "(", "\"1473256\"", ")", ";", "add", "(", "\"1473265\"", ")", ";", "add", "(", "\"1473526\"", ")", ";", "add", "(", "\"1473562\"", ")", ";", "add", "(", "\"1473625\"", ")", ";", "add", "(", "\"1475236\"", ")", ";", "add", "(", "\"1475263\"", ")", ";", "add", "(", "\"1475623\"", ")", ";", "add", "(", "\"1476235\"", ")", ";", "add", "(", "\"1523467\"", ")", ";", "add", "(", "\"1523476\"", ")", ";", "add", "(", "\"1523647\"", ")", ";", "add", "(", "\"1523674\"", ")", ";", "add", "(", "\"1523746\"", ")", ";", "add", "(", "\"1523764\"", ")", ";", "add", "(", "\"1524376\"", ")", ";", "add", "(", "\"1524637\"", ")", ";", "add", "(", "\"1524673\"", ")", ";", "add", "(", "\"1524736\"", ")", ";", "add", "(", "\"1524763\"", ")", ";", "add", "(", "\"1526347\"", ")", ";", "add", "(", "\"1526374\"", ")", ";", "add", "(", "\"1526437\"", ")", ";", "add", "(", "\"1526473\"", ")", ";", "add", "(", "\"1526734\"", ")", ";", "add", "(", "\"1526743\"", ")", ";", "add", "(", "\"1527346\"", ")", ";", "add", "(", "\"1527364\"", ")", ";", "add", "(", "\"1527436\"", ")", ";", "add", "(", "\"1527463\"", ")", ";", "add", "(", "\"1527634\"", ")", ";", "add", "(", "\"1532476\"", ")", ";", "add", "(", "\"1532647\"", ")", ";", "add", "(", "\"1532674\"", ")", ";", "add", "(", "\"1532746\"", ")", ";", "add", "(", "\"1532764\"", ")", ";", "add", "(", "\"1534276\"", ")", ";", "add", "(", "\"1534726\"", ")", ";", "add", "(", "\"1534762\"", ")", ";", "add", "(", "\"1536247\"", ")", ";", "add", "(", "\"1536274\"", ")", ";", "add", "(", "\"1536427\"", ")", ";", "add", "(", "\"1536472\"", ")", ";", "add", "(", "\"1536724\"", ")", ";", "add", "(", "\"1536742\"", ")", ";", "add", "(", "\"1537246\"", ")", ";", "add", "(", "\"1537264\"", ")", ";", "add", "(", "\"1537426\"", ")", ";", "add", "(", "\"1537462\"", ")", ";", "add", "(", "\"1537624\"", ")", ";", "add", "(", "\"1542376\"", ")", ";", "add", "(", "\"1542637\"", ")", ";", "add", "(", "\"1542673\"", ")", ";", "add", "(", "\"1542736\"", ")", ";", "add", "(", "\"1542763\"", ")", ";", "add", "(", "\"1546237\"", ")", ";", "add", "(", "\"1546273\"", ")", ";", "add", "(", "\"1546723\"", ")", ";", "add", "(", "\"1547236\"", ")", ";", "add", "(", "\"1547263\"", ")", ";", "add", "(", "\"1547623\"", ")", ";", "add", "(", "\"1562347\"", ")", ";", "add", "(", "\"1562374\"", ")", ";", "add", "(", "\"1562437\"", ")", ";", "add", "(", "\"1562473\"", ")", ";", "add", "(", "\"1562734\"", ")", ";", "add", "(", "\"1562743\"", ")", ";", "add", "(", "\"1563247\"", ")", ";", "add", "(", "\"1563274\"", ")", ";", "add", "(", "\"1563427\"", ")", ";", "add", "(", "\"1563472\"", ")", ";", "add", "(", "\"1563724\"", ")", ";", "add", "(", "\"1563742\"", ")", ";", "add", "(", "\"1564237\"", ")", ";", "add", "(", "\"1564273\"", ")", ";", "add", "(", "\"1564723\"", ")", ";", "add", "(", "\"1567234\"", ")", ";", "add", "(", "\"1567243\"", ")", ";", "add", "(", "\"1567324\"", ")", ";", "add", "(", "\"1567342\"", ")", ";", "add", "(", "\"1567423\"", ")", ";", "add", "(", "\"1572346\"", ")", ";", "add", "(", "\"1572364\"", ")", ";", "add", "(", "\"1572436\"", ")", ";", "add", "(", "\"1572463\"", ")", ";", "add", "(", "\"1572634\"", ")", ";", "add", "(", "\"1573246\"", ")", ";", "add", "(", "\"1573264\"", ")", ";", "add", "(", "\"1573426\"", ")", ";", "add", "(", "\"1573462\"", ")", ";", "add", "(", "\"1573624\"", ")", ";", "add", "(", "\"1574236\"", ")", ";", "add", "(", "\"1574263\"", ")", ";", "add", "(", "\"1574623\"", ")", ";", "add", "(", "\"1576234\"", ")", ";", "add", "(", "\"1623457\"", ")", ";", "add", "(", "\"1623475\"", ")", ";", "add", "(", "\"1623574\"", ")", ";", "add", "(", "\"1623745\"", ")", ";", "add", "(", "\"1623754\"", ")", ";", "add", "(", "\"1624375\"", ")", ";", "add", "(", "\"1624735\"", ")", ";", "add", "(", "\"1624753\"", ")", ";", "add", "(", "\"1625374\"", ")", ";", "add", "(", "\"1625734\"", ")", ";", "add", "(", "\"1627345\"", ")", ";", "add", "(", "\"1627354\"", ")", ";", "add", "(", "\"1627435\"", ")", ";", "add", "(", "\"1627453\"", ")", ";", "add", "(", "\"1627534\"", ")", ";", "add", "(", "\"1632475\"", ")", ";", "add", "(", "\"1632547\"", ")", ";", "add", "(", "\"1632574\"", ")", ";", "add", "(", "\"1632745\"", ")", ";", "add", "(", "\"1632754\"", ")", ";", "add", "(", "\"1634275\"", ")", ";", "add", "(", "\"1634725\"", ")", ";", "add", "(", "\"1634752\"", ")", ";", "add", "(", "\"1635247\"", ")", ";", "add", "(", "\"1635274\"", ")", ";", "add", "(", "\"1635724\"", ")", ";", "add", "(", "\"1637245\"", ")", ";", "add", "(", "\"1637254\"", ")", ";", "add", "(", "\"1637425\"", ")", ";", "add", "(", "\"1637452\"", ")", ";", "add", "(", "\"1637524\"", ")", ";", "add", "(", "\"1642375\"", ")", ";", "add", "(", "\"1642537\"", ")", ";", "add", "(", "\"1642573\"", ")", ";", "add", "(", "\"1642735\"", ")", ";", "add", "(", "\"1642753\"", ")", ";", "add", "(", "\"1645237\"", ")", ";", "add", "(", "\"1645273\"", ")", ";", "add", "(", "\"1645723\"", ")", ";", "add", "(", "\"1647235\"", ")", ";", "add", "(", "\"1647253\"", ")", ";", "add", "(", "\"1647523\"", ")", ";", "add", "(", "\"1652374\"", ")", ";", "add", "(", "\"1652734\"", ")", ";", "add", "(", "\"1657234\"", ")", ";", "add", "(", "\"1672345\"", ")", ";", "add", "(", "\"1672354\"", ")", ";", "add", "(", "\"1672435\"", ")", ";", "add", "(", "\"1672453\"", ")", ";", "add", "(", "\"1672534\"", ")", ";", "add", "(", "\"1673245\"", ")", ";", "add", "(", "\"1673254\"", ")", ";", "add", "(", "\"1673425\"", ")", ";", "add", "(", "\"1673452\"", ")", ";", "add", "(", "\"1673524\"", ")", ";", "add", "(", "\"1674235\"", ")", ";", "add", "(", "\"1674253\"", ")", ";", "add", "(", "\"1674523\"", ")", ";", "add", "(", "\"1675234\"", ")", ";", "add", "(", "\"1723456\"", ")", ";", "add", "(", "\"1724365\"", ")", ";", "add", "(", "\"1724635\"", ")", ";", "add", "(", "\"1725364\"", ")", ";", "add", "(", "\"1725634\"", ")", ";", "add", "(", "\"1732465\"", ")", ";", "add", "(", "\"1732546\"", ")", ";", "add", "(", "\"1732564\"", ")", ";", "add", "(", "\"1732645\"", ")", ";", "add", "(", "\"1734265\"", ")", ";", "add", "(", "\"1734625\"", ")", ";", "add", "(", "\"1735246\"", ")", ";", "add", "(", "\"1735264\"", ")", ";", "add", "(", "\"1735624\"", ")", ";", "add", "(", "\"1736245\"", ")", ";", "add", "(", "\"1742365\"", ")", ";", "add", "(", "\"1742536\"", ")", ";", "add", "(", "\"1742563\"", ")", ";", "add", "(", "\"1742635\"", ")", ";", "add", "(", "\"1745236\"", ")", ";", "add", "(", "\"1745263\"", ")", ";", "add", "(", "\"1745623\"", ")", ";", "add", "(", "\"1746235\"", ")", ";", "add", "(", "\"1752364\"", ")", ";", "add", "(", "\"1752634\"", ")", ";", "add", "(", "\"1756234\"", ")", ";", "add", "(", "\"2134567\"", ")", ";", "add", "(", "\"2134576\"", ")", ";", "add", "(", "\"2134657\"", ")", ";", "add", "(", "\"2134675\"", ")", ";", "add", "(", "\"2134756\"", ")", ";", "add", "(", "\"2134765\"", ")", ";", "add", "(", "\"2135467\"", ")", ";", "add", "(", "\"2135476\"", ")", ";", "add", "(", "\"2135647\"", ")", ";", "add", "(", "\"2135674\"", ")", ";", "add", "(", "\"2135746\"", ")", ";", "add", "(", "\"2135764\"", ")", ";", "add", "(", "\"2136457\"", ")", ";", "add", "(", "\"2136475\"", ")", ";", "add", "(", "\"2136547\"", ")", ";", "add", "(", "\"2136574\"", ")", ";", "add", "(", "\"2136745\"", ")", ";", "add", "(", "\"2136754\"", ")", ";", "add", "(", "\"2137456\"", ")", ";", "add", "(", "\"2137465\"", ")", ";", "add", "(", "\"2137546\"", ")", ";", "add", "(", "\"2137564\"", ")", ";", "add", "(", "\"2137645\"", ")", ";", "add", "(", "\"2143567\"", ")", ";", "add", "(", "\"2143576\"", ")", ";", "add", "(", "\"2143657\"", ")", ";", "add", "(", "\"2143675\"", ")", ";", "add", "(", "\"2143756\"", ")", ";", "add", "(", "\"2143765\"", ")", ";", "add", "(", "\"2145367\"", ")", ";", "add", "(", "\"2145376\"", ")", ";", "add", "(", "\"2145637\"", ")", ";", "add", "(", "\"2145673\"", ")", ";", "add", "(", "\"2145736\"", ")", ";", "add", "(", "\"2145763\"", ")", ";", "add", "(", "\"2146357\"", ")", ";", "add", "(", "\"2146375\"", ")", ";", "add", "(", "\"2146537\"", ")", ";", "add", "(", "\"2146573\"", ")", ";", "add", "(", "\"2146735\"", ")", ";", "add", "(", "\"2146753\"", ")", ";", "add", "(", "\"2147356\"", ")", ";", "add", "(", "\"2147365\"", ")", ";", "add", "(", "\"2147536\"", ")", ";", "add", "(", "\"2147563\"", ")", ";", "add", "(", "\"2147635\"", ")", ";", "add", "(", "\"2153467\"", ")", ";", "add", "(", "\"2153476\"", ")", ";", "add", "(", "\"2153647\"", ")", ";", "add", "(", "\"2153674\"", ")", ";", "add", "(", "\"2153746\"", ")", ";", "add", "(", "\"2153764\"", ")", ";", "add", "(", "\"2154367\"", ")", ";", "add", "(", "\"2154376\"", ")", ";", "add", "(", "\"2154637\"", ")", ";", "add", "(", "\"2154673\"", ")", ";", "add", "(", "\"2154736\"", ")", ";", "add", "(", "\"2154763\"", ")", ";", "add", "(", "\"2156347\"", ")", ";", "add", "(", "\"2156374\"", ")", ";", "add", "(", "\"2156437\"", ")", ";", "add", "(", "\"2156473\"", ")", ";", "add", "(", "\"2156734\"", ")", ";", "add", "(", "\"2156743\"", ")", ";", "add", "(", "\"2157346\"", ")", ";", "add", "(", "\"2157364\"", ")", ";", "add", "(", "\"2157436\"", ")", ";", "add", "(", "\"2157463\"", ")", ";", "add", "(", "\"2157634\"", ")", ";", "add", "(", "\"2163457\"", ")", ";", "add", "(", "\"2163475\"", ")", ";", "add", "(", "\"2163547\"", ")", ";", "add", "(", "\"2163574\"", ")", ";", "add", "(", "\"2163745\"", ")", ";", "add", "(", "\"2163754\"", ")", ";", "add", "(", "\"2164357\"", ")", ";", "add", "(", "\"2164375\"", ")", ";", "add", "(", "\"2164537\"", ")", ";", "add", "(", "\"2164573\"", ")", ";", "add", "(", "\"2164735\"", ")", ";", "add", "(", "\"2164753\"", ")", ";", "add", "(", "\"2165347\"", ")", ";", "add", "(", "\"2165374\"", ")", ";", "add", "(", "\"2165734\"", ")", ";", "add", "(", "\"2167345\"", ")", ";", "add", "(", "\"2167354\"", ")", ";", "add", "(", "\"2167435\"", ")", ";", "add", "(", "\"2167453\"", ")", ";", "add", "(", "\"2167534\"", ")", ";", "add", "(", "\"2173456\"", ")", ";", "add", "(", "\"2173465\"", ")", ";", "add", "(", "\"2173546\"", ")", ";", "add", "(", "\"2173564\"", ")", ";", "add", "(", "\"2173645\"", ")", ";", "add", "(", "\"2174356\"", ")", ";", "add", "(", "\"2174365\"", ")", ";", "add", "(", "\"2174536\"", ")", ";", "add", "(", "\"2174563\"", ")", ";", "add", "(", "\"2174635\"", ")", ";", "add", "(", "\"2175346\"", ")", ";", "add", "(", "\"2175364\"", ")", ";", "add", "(", "\"2175634\"", ")", ";", "add", "(", "\"2176345\"", ")", ";", "add", "(", "\"2314567\"", ")", ";", "add", "(", "\"2314576\"", ")", ";", "add", "(", "\"2314657\"", ")", ";", "add", "(", "\"2314675\"", ")", ";", "add", "(", "\"2314756\"", ")", ";", "add", "(", "\"2314765\"", ")", ";", "add", "(", "\"2315467\"", ")", ";", "add", "(", "\"2315476\"", ")", ";", "add", "(", "\"2315647\"", ")", ";", "add", "(", "\"2315674\"", ")", ";", "add", "(", "\"2315746\"", ")", ";", "add", "(", "\"2315764\"", ")", ";", "add", "(", "\"2316457\"", ")", ";", "add", "(", "\"2316475\"", ")", ";", "add", "(", "\"2316547\"", ")", ";", "add", "(", "\"2316574\"", ")", ";", "add", "(", "\"2316745\"", ")", ";", "add", "(", "\"2316754\"", ")", ";", "add", "(", "\"2317456\"", ")", ";", "add", "(", "\"2317465\"", ")", ";", "add", "(", "\"2317546\"", ")", ";", "add", "(", "\"2317564\"", ")", ";", "add", "(", "\"2317645\"", ")", ";", "add", "(", "\"2341567\"", ")", ";", "add", "(", "\"2341576\"", ")", ";", "add", "(", "\"2341657\"", ")", ";", "add", "(", "\"2341675\"", ")", ";", "add", "(", "\"2341756\"", ")", ";", "add", "(", "\"2341765\"", ")", ";", "add", "(", "\"2345167\"", ")", ";", "add", "(", "\"2345176\"", ")", ";", "add", "(", "\"2345617\"", ")", ";", "add", "(", "\"2345671\"", ")", ";", "add", "(", "\"2345716\"", ")", ";", "add", "(", "\"2346157\"", ")", ";", "add", "(", "\"2346175\"", ")", ";", "add", "(", "\"2346715\"", ")", ";", "add", "(", "\"2347156\"", ")", ";", "add", "(", "\"2347165\"", ")", ";", "add", "(", "\"2347516\"", ")", ";", "add", "(", "\"2347615\"", ")", ";", "add", "(", "\"2351467\"", ")", ";", "add", "(", "\"2351476\"", ")", ";", "add", "(", "\"2351647\"", ")", ";", "add", "(", "\"2351674\"", ")", ";", "add", "(", "\"2351746\"", ")", ";", "add", "(", "\"2351764\"", ")", ";", "add", "(", "\"2354176\"", ")", ";", "add", "(", "\"2354716\"", ")", ";", "add", "(", "\"2354761\"", ")", ";", "add", "(", "\"2356147\"", ")", ";", "add", "(", "\"2356174\"", ")", ";", "add", "(", "\"2356714\"", ")", ";", "add", "(", "\"2357146\"", ")", ";", "add", "(", "\"2357164\"", ")", ";", "add", "(", "\"2357416\"", ")", ";", "add", "(", "\"2357461\"", ")", ";", "add", "(", "\"2357614\"", ")", ";", "add", "(", "\"2361457\"", ")", ";", "add", "(", "\"2361475\"", ")", ";", "add", "(", "\"2361547\"", ")", ";", "add", "(", "\"2361574\"", ")", ";", "add", "(", "\"2361745\"", ")", ";", "add", "(", "\"2361754\"", ")", ";", "add", "(", "\"2364157\"", ")", ";", "add", "(", "\"2364175\"", ")", ";", "add", "(", "\"2364715\"", ")", ";", "add", "(", "\"2364751\"", ")", ";", "add", "(", "\"2365147\"", ")", ";", "add", "(", "\"2365174\"", ")", ";", "add", "(", "\"2365714\"", ")", ";", "add", "(", "\"2367145\"", ")", ";", "add", "(", "\"2367154\"", ")", ";", "add", "(", "\"2367415\"", ")", ";", "add", "(", "\"2367451\"", ")", ";", "add", "(", "\"2367514\"", ")", ";", "add", "(", "\"2371456\"", ")", ";", "add", "(", "\"2371465\"", ")", ";", "add", "(", "\"2371546\"", ")", ";", "add", "(", "\"2371564\"", ")", ";", "add", "(", "\"2371645\"", ")", ";", "add", "(", "\"2374156\"", ")", ";", "add", "(", "\"2374165\"", ")", ";", "add", "(", "\"2374615\"", ")", ";", "add", "(", "\"2375146\"", ")", ";", "add", "(", "\"2375164\"", ")", ";", "add", "(", "\"2375614\"", ")", ";", "add", "(", "\"2376145\"", ")", ";", "add", "(", "\"2413567\"", ")", ";", "add", "(", "\"2413576\"", ")", ";", "add", "(", "\"2413657\"", ")", ";", "add", "(", "\"2413675\"", ")", ";", "add", "(", "\"2413756\"", ")", ";", "add", "(", "\"2413765\"", ")", ";", "add", "(", "\"2415367\"", ")", ";", "add", "(", "\"2415376\"", ")", ";", "add", "(", "\"2415637\"", ")", ";", "add", "(", "\"2415673\"", ")", ";", "add", "(", "\"2415736\"", ")", ";", "add", "(", "\"2415763\"", ")", ";", "add", "(", "\"2416357\"", ")", ";", "add", "(", "\"2416375\"", ")", ";", "add", "(", "\"2416537\"", ")", ";", "add", "(", "\"2416573\"", ")", ";", "add", "(", "\"2416735\"", ")", ";", "add", "(", "\"2416753\"", ")", ";", "add", "(", "\"2417356\"", ")", ";", "add", "(", "\"2417365\"", ")", ";", "add", "(", "\"2417536\"", ")", ";", "add", "(", "\"2417563\"", ")", ";", "add", "(", "\"2417635\"", ")", ";", "add", "(", "\"2431576\"", ")", ";", "add", "(", "\"2431657\"", ")", ";", "add", "(", "\"2431675\"", ")", ";", "add", "(", "\"2431756\"", ")", ";", "add", "(", "\"2431765\"", ")", ";", "add", "(", "\"2435176\"", ")", ";", "add", "(", "\"2435716\"", ")", ";", "add", "(", "\"2435761\"", ")", ";", "add", "(", "\"2436157\"", ")", ";", "add", "(", "\"2436175\"", ")", ";", "add", "(", "\"2436517\"", ")", ";", "add", "(", "\"2436571\"", ")", ";", "add", "(", "\"2436715\"", ")", ";", "add", "(", "\"2436751\"", ")", ";", "add", "(", "\"2437156\"", ")", ";", "add", "(", "\"2437165\"", ")", ";", "add", "(", "\"2437516\"", ")", ";", "add", "(", "\"2437561\"", ")", ";", "add", "(", "\"2437615\"", ")", ";", "add", "(", "\"2451367\"", ")", ";", "add", "(", "\"2451376\"", ")", ";", "add", "(", "\"2451637\"", ")", ";", "add", "(", "\"2451673\"", ")", ";", "add", "(", "\"2451736\"", ")", ";", "add", "(", "\"2451763\"", ")", ";", "add", "(", "\"2453176\"", ")", ";", "add", "(", "\"2453716\"", ")", ";", "add", "(", "\"2453761\"", ")", ";", "add", "(", "\"2456137\"", ")", ";", "add", "(", "\"2456173\"", ")", ";", "add", "(", "\"2456713\"", ")", ";", "add", "(", "\"2457136\"", ")", ";", "add", "(", "\"2457163\"", ")", ";", "add", "(", "\"2457316\"", ")", ";", "add", "(", "\"2457361\"", ")", ";", "add", "(", "\"2457613\"", ")", ";", "add", "(", "\"2461357\"", ")", ";", "add", "(", "\"2461375\"", ")", ";", "add", "(", "\"2461537\"", ")", ";", "add", "(", "\"2461573\"", ")", ";", "add", "(", "\"2461735\"", ")", ";", "add", "(", "\"2461753\"", ")", ";", "add", "(", "\"2463157\"", ")", ";", "add", "(", "\"2463175\"", ")", ";", "add", "(", "\"2463517\"", ")", ";", "add", "(", "\"2463571\"", ")", ";", "add", "(", "\"2463715\"", ")", ";", "add", "(", "\"2463751\"", ")", ";", "add", "(", "\"2465137\"", ")", ";", "add", "(", "\"2465173\"", ")", ";", "add", "(", "\"2465713\"", ")", ";", "add", "(", "\"2467135\"", ")", ";", "add", "(", "\"2467153\"", ")", ";", "add", "(", "\"2467315\"", ")", ";", "add", "(", "\"2467351\"", ")", ";", "add", "(", "\"2467513\"", ")", ";", "add", "(", "\"2471356\"", ")", ";", "add", "(", "\"2471365\"", ")", ";", "add", "(", "\"2471536\"", ")", ";", "add", "(", "\"2471563\"", ")", ";", "add", "(", "\"2471635\"", ")", ";", "add", "(", "\"2473156\"", ")", ";", "add", "(", "\"2473165\"", ")", ";", "add", "(", "\"2473516\"", ")", ";", "add", "(", "\"2473561\"", ")", ";", "add", "(", "\"2473615\"", ")", ";", "add", "(", "\"2475136\"", ")", ";", "add", "(", "\"2475163\"", ")", ";", "add", "(", "\"2475613\"", ")", ";", "add", "(", "\"2476135\"", ")", ";", "add", "(", "\"2513467\"", ")", ";", "add", "(", "\"2513476\"", ")", ";", "add", "(", "\"2513647\"", ")", ";", "add", "(", "\"2513674\"", ")", ";", "add", "(", "\"2513746\"", ")", ";", "add", "(", "\"2513764\"", ")", ";", "add", "(", "\"2514367\"", ")", ";", "add", "(", "\"2514376\"", ")", ";", "add", "(", "\"2514637\"", ")", ";", "add", "(", "\"2514673\"", ")", ";", "add", "(", "\"2514736\"", ")", ";", "add", "(", "\"2514763\"", ")", ";", "add", "(", "\"2516347\"", ")", ";", "add", "(", "\"2516374\"", ")", ";", "add", "(", "\"2516437\"", ")", ";", "add", "(", "\"2516473\"", ")", ";", "add", "(", "\"2516734\"", ")", ";", "add", "(", "\"2516743\"", ")", ";", "add", "(", "\"2517346\"", ")", ";", "add", "(", "\"2517364\"", ")", ";", "add", "(", "\"2517436\"", ")", ";", "add", "(", "\"2517463\"", ")", ";", "add", "(", "\"2517634\"", ")", ";", "add", "(", "\"2531467\"", ")", ";", "add", "(", "\"2531476\"", ")", ";", "add", "(", "\"2531647\"", ")", ";", "add", "(", "\"2531674\"", ")", ";", "add", "(", "\"2531746\"", ")", ";", "add", "(", "\"2531764\"", ")", ";", "add", "(", "\"2534176\"", ")", ";", "add", "(", "\"2534716\"", ")", ";", "add", "(", "\"2534761\"", ")", ";", "add", "(", "\"2536147\"", ")", ";", "add", "(", "\"2536174\"", ")", ";", "add", "(", "\"2536417\"", ")", ";", "add", "(", "\"2536471\"", ")", ";", "add", "(", "\"2536714\"", ")", ";", "add", "(", "\"2536741\"", ")", ";", "add", "(", "\"2537146\"", ")", ";", "add", "(", "\"2537164\"", ")", ";", "add", "(", "\"2537416\"", ")", ";", "add", "(", "\"2537461\"", ")", ";", "add", "(", "\"2537614\"", ")", ";", "add", "(", "\"2541367\"", ")", ";", "add", "(", "\"2541376\"", ")", ";", "add", "(", "\"2541637\"", ")", ";", "add", "(", "\"2541673\"", ")", ";", "add", "(", "\"2541736\"", ")", ";", "add", "(", "\"2541763\"", ")", ";", "add", "(", "\"2546137\"", ")", ";", "add", "(", "\"2546173\"", ")", ";", "add", "(", "\"2546713\"", ")", ";", "add", "(", "\"2547136\"", ")", ";", "add", "(", "\"2547163\"", ")", ";", "add", "(", "\"2547613\"", ")", ";", "add", "(", "\"2561347\"", ")", ";", "add", "(", "\"2561374\"", ")", ";", "add", "(", "\"2561437\"", ")", ";", "add", "(", "\"2561473\"", ")", ";", "add", "(", "\"2561734\"", ")", ";", "add", "(", "\"2561743\"", ")", ";", "add", "(", "\"2563147\"", ")", ";", "add", "(", "\"2563174\"", ")", ";", "add", "(", "\"2563417\"", ")", ";", "add", "(", "\"2563471\"", ")", ";", "add", "(", "\"2563714\"", ")", ";", "add", "(", "\"2563741\"", ")", ";", "add", "(", "\"2564137\"", ")", ";", "add", "(", "\"2564173\"", ")", ";", "add", "(", "\"2564713\"", ")", ";", "add", "(", "\"2567134\"", ")", ";", "add", "(", "\"2567143\"", ")", ";", "add", "(", "\"2567314\"", ")", ";", "add", "(", "\"2567341\"", ")", ";", "add", "(", "\"2567413\"", ")", ";", "add", "(", "\"2571346\"", ")", ";", "add", "(", "\"2571364\"", ")", ";", "add", "(", "\"2571436\"", ")", ";", "add", "(", "\"2571463\"", ")", ";", "add", "(", "\"2571634\"", ")", ";", "add", "(", "\"2573146\"", ")", ";", "add", "(", "\"2573164\"", ")", ";", "add", "(", "\"2573416\"", ")", ";", "add", "(", "\"2573461\"", ")", ";", "add", "(", "\"2573614\"", ")", ";", "add", "(", "\"2574136\"", ")", ";", "add", "(", "\"2574163\"", ")", ";", "add", "(", "\"2574613\"", ")", ";", "add", "(", "\"2576134\"", ")", ";", "add", "(", "\"2613457\"", ")", ";", "add", "(", "\"2613475\"", ")", ";", "add", "(", "\"2613547\"", ")", ";", "add", "(", "\"2613574\"", ")", ";", "add", "(", "\"2613745\"", ")", ";", "add", "(", "\"2613754\"", ")", ";", "add", "(", "\"2614357\"", ")", ";", "add", "(", "\"2614375\"", ")", ";", "add", "(", "\"2614537\"", ")", ";", "add", "(", "\"2614573\"", ")", ";", "add", "(", "\"2614735\"", ")", ";", "add", "(", "\"2614753\"", ")", ";", "add", "(", "\"2615347\"", ")", ";", "add", "(", "\"2615374\"", ")", ";", "add", "(", "\"2615734\"", ")", ";", "add", "(", "\"2617345\"", ")", ";", "add", "(", "\"2617354\"", ")", ";", "add", "(", "\"2617435\"", ")", ";", "add", "(", "\"2617453\"", ")", ";", "add", "(", "\"2617534\"", ")", ";", "add", "(", "\"2631457\"", ")", ";", "add", "(", "\"2631475\"", ")", ";", "add", "(", "\"2631547\"", ")", ";", "add", "(", "\"2631574\"", ")", ";", "add", "(", "\"2631745\"", ")", ";", "add", "(", "\"2631754\"", ")", ";", "add", "(", "\"2634175\"", ")", ";", "add", "(", "\"2634715\"", ")", ";", "add", "(", "\"2634751\"", ")", ";", "add", "(", "\"2635147\"", ")", ";", "add", "(", "\"2635174\"", ")", ";", "add", "(", "\"2635714\"", ")", ";", "add", "(", "\"2637145\"", ")", ";", "add", "(", "\"2637154\"", ")", ";", "add", "(", "\"2637415\"", ")", ";", "add", "(", "\"2637451\"", ")", ";", "add", "(", "\"2637514\"", ")", ";", "add", "(", "\"2641357\"", ")", ";", "add", "(", "\"2641375\"", ")", ";", "add", "(", "\"2641537\"", ")", ";", "add", "(", "\"2641573\"", ")", ";", "add", "(", "\"2641735\"", ")", ";", "add", "(", "\"2641753\"", ")", ";", "add", "(", "\"2645137\"", ")", ";", "add", "(", "\"2645173\"", ")", ";", "add", "(", "\"2645713\"", ")", ";", "add", "(", "\"2647135\"", ")", ";", "add", "(", "\"2647153\"", ")", ";", "add", "(", "\"2647513\"", ")", ";", "add", "(", "\"2651347\"", ")", ";", "add", "(", "\"2651374\"", ")", ";", "add", "(", "\"2651734\"", ")", ";", "add", "(", "\"2657134\"", ")", ";", "add", "(", "\"2671345\"", ")", ";", "add", "(", "\"2671354\"", ")", ";", "add", "(", "\"2671435\"", ")", ";", "add", "(", "\"2671453\"", ")", ";", "add", "(", "\"2671534\"", ")", ";", "add", "(", "\"2673145\"", ")", ";", "add", "(", "\"2673154\"", ")", ";", "add", "(", "\"2673415\"", ")", ";", "add", "(", "\"2673451\"", ")", ";", "add", "(", "\"2673514\"", ")", ";", "add", "(", "\"2674135\"", ")", ";", "add", "(", "\"2674153\"", ")", ";", "add", "(", "\"2674513\"", ")", ";", "add", "(", "\"2675134\"", ")", ";", "add", "(", "\"2713456\"", ")", ";", "add", "(", "\"2713465\"", ")", ";", "add", "(", "\"2713546\"", ")", ";", "add", "(", "\"2713564\"", ")", ";", "add", "(", "\"2713645\"", ")", ";", "add", "(", "\"2714356\"", ")", ";", "add", "(", "\"2714365\"", ")", ";", "add", "(", "\"2714536\"", ")", ";", "add", "(", "\"2714563\"", ")", ";", "add", "(", "\"2714635\"", ")", ";", "add", "(", "\"2715346\"", ")", ";", "add", "(", "\"2715364\"", ")", ";", "add", "(", "\"2715634\"", ")", ";", "add", "(", "\"2716345\"", ")", ";", "add", "(", "\"2731456\"", ")", ";", "add", "(", "\"2731465\"", ")", ";", "add", "(", "\"2731546\"", ")", ";", "add", "(", "\"2731564\"", ")", ";", "add", "(", "\"2731645\"", ")", ";", "add", "(", "\"2734165\"", ")", ";", "add", "(", "\"2734615\"", ")", ";", "add", "(", "\"2735146\"", ")", ";", "add", "(", "\"2735164\"", ")", ";", "add", "(", "\"2735614\"", ")", ";", "add", "(", "\"2736145\"", ")", ";", "add", "(", "\"2741356\"", ")", ";", "add", "(", "\"2741365\"", ")", ";", "add", "(", "\"2741536\"", ")", ";", "add", "(", "\"2741563\"", ")", ";", "add", "(", "\"2741635\"", ")", ";", "add", "(", "\"2745136\"", ")", ";", "add", "(", "\"2745163\"", ")", ";", "add", "(", "\"2745613\"", ")", ";", "add", "(", "\"2746135\"", ")", ";", "add", "(", "\"2751346\"", ")", ";", "add", "(", "\"2751364\"", ")", ";", "add", "(", "\"2751634\"", ")", ";", "add", "(", "\"2756134\"", ")", ";", "add", "(", "\"2761345\"", ")", ";", "add", "(", "\"3124567\"", ")", ";", "add", "(", "\"3124576\"", ")", ";", "add", "(", "\"3124657\"", ")", ";", "add", "(", "\"3124675\"", ")", ";", "add", "(", "\"3124756\"", ")", ";", "add", "(", "\"3124765\"", ")", ";", "add", "(", "\"3125467\"", ")", ";", "add", "(", "\"3125476\"", ")", ";", "add", "(", "\"3125647\"", ")", ";", "add", "(", "\"3125674\"", ")", ";", "add", "(", "\"3125746\"", ")", ";", "add", "(", "\"3125764\"", ")", ";", "add", "(", "\"3126457\"", ")", ";", "add", "(", "\"3126475\"", ")", ";", "add", "(", "\"3126547\"", ")", ";", "add", "(", "\"3126574\"", ")", ";", "add", "(", "\"3126745\"", ")", ";", "add", "(", "\"3126754\"", ")", ";", "add", "(", "\"3127456\"", ")", ";", "add", "(", "\"3127465\"", ")", ";", "add", "(", "\"3127546\"", ")", ";", "add", "(", "\"3127564\"", ")", ";", "add", "(", "\"3127645\"", ")", ";", "add", "(", "\"3142567\"", ")", ";", "add", "(", "\"3142576\"", ")", ";", "add", "(", "\"3142657\"", ")", ";", "add", "(", "\"3142675\"", ")", ";", "add", "(", "\"3142756\"", ")", ";", "add", "(", "\"3142765\"", ")", ";", "add", "(", "\"3145267\"", ")", ";", "add", "(", "\"3145276\"", ")", ";", "add", "(", "\"3145627\"", ")", ";", "add", "(", "\"3145672\"", ")", ";", "add", "(", "\"3145726\"", ")", ";", "add", "(", "\"3145762\"", ")", ";", "add", "(", "\"3146257\"", ")", ";", "add", "(", "\"3146275\"", ")", ";", "add", "(", "\"3146527\"", ")", ";", "add", "(", "\"3146572\"", ")", ";", "add", "(", "\"3146725\"", ")", ";", "add", "(", "\"3146752\"", ")", ";", "add", "(", "\"3147256\"", ")", ";", "add", "(", "\"3147265\"", ")", ";", "add", "(", "\"3147526\"", ")", ";", "add", "(", "\"3147562\"", ")", ";", "add", "(", "\"3147625\"", ")", ";", "add", "(", "\"3152467\"", ")", ";", "add", "(", "\"3152476\"", ")", ";", "add", "(", "\"3152647\"", ")", ";", "add", "(", "\"3152674\"", ")", ";", "add", "(", "\"3152746\"", ")", ";", "add", "(", "\"3152764\"", ")", ";", "add", "(", "\"3154267\"", ")", ";", "add", "(", "\"3154276\"", ")", ";", "add", "(", "\"3154627\"", ")", ";", "add", "(", "\"3154672\"", ")", ";", "add", "(", "\"3154726\"", ")", ";", "add", "(", "\"3154762\"", ")", ";", "add", "(", "\"3156247\"", ")", ";", "add", "(", "\"3156274\"", ")", ";", "add", "(", "\"3156427\"", ")", ";", "add", "(", "\"3156472\"", ")", ";", "add", "(", "\"3156724\"", ")", ";", "add", "(", "\"3156742\"", ")", ";", "add", "(", "\"3157246\"", ")", ";", "add", "(", "\"3157264\"", ")", ";", "add", "(", "\"3157426\"", ")", ";", "add", "(", "\"3157462\"", ")", ";", "add", "(", "\"3157624\"", ")", ";", "add", "(", "\"3162457\"", ")", ";", "add", "(", "\"3162475\"", ")", ";", "add", "(", "\"3162547\"", ")", ";", "add", "(", "\"3162574\"", ")", ";", "add", "(", "\"3162745\"", ")", ";", "add", "(", "\"3162754\"", ")", ";", "add", "(", "\"3164257\"", ")", ";", "add", "(", "\"3164275\"", ")", ";", "add", "(", "\"3164527\"", ")", ";", "add", "(", "\"3164572\"", ")", ";", "add", "(", "\"3164725\"", ")", ";", "add", "(", "\"3164752\"", ")", ";", "add", "(", "\"3165247\"", ")", ";", "add", "(", "\"3165274\"", ")", ";", "add", "(", "\"3165724\"", ")", ";", "add", "(", "\"3167245\"", ")", ";", "add", "(", "\"3167254\"", ")", ";", "add", "(", "\"3167425\"", ")", ";", "add", "(", "\"3167452\"", ")", ";", "add", "(", "\"3167524\"", ")", ";", "add", "(", "\"3172456\"", ")", ";", "add", "(", "\"3172465\"", ")", ";", "add", "(", "\"3172546\"", ")", ";", "add", "(", "\"3172564\"", ")", ";", "add", "(", "\"3172645\"", ")", ";", "add", "(", "\"3174256\"", ")", ";", "add", "(", "\"3174265\"", ")", ";", "add", "(", "\"3174526\"", ")", ";", "add", "(", "\"3174562\"", ")", ";", "add", "(", "\"3174625\"", ")", ";", "add", "(", "\"3175246\"", ")", ";", "add", "(", "\"3175264\"", ")", ";", "add", "(", "\"3175624\"", ")", ";", "add", "(", "\"3176245\"", ")", ";", "add", "(", "\"3214576\"", ")", ";", "add", "(", "\"3214657\"", ")", ";", "add", "(", "\"3214675\"", ")", ";", "add", "(", "\"3214756\"", ")", ";", "add", "(", "\"3214765\"", ")", ";", "add", "(", "\"3215467\"", ")", ";", "add", "(", "\"3215476\"", ")", ";", "add", "(", "\"3215647\"", ")", ";", "add", "(", "\"3215674\"", ")", ";", "add", "(", "\"3215746\"", ")", ";", "add", "(", "\"3215764\"", ")", ";", "add", "(", "\"3216457\"", ")", ";", "add", "(", "\"3216475\"", ")", ";", "add", "(", "\"3216547\"", ")", ";", "add", "(", "\"3216574\"", ")", ";", "add", "(", "\"3216745\"", ")", ";", "add", "(", "\"3216754\"", ")", ";", "add", "(", "\"3217456\"", ")", ";", "add", "(", "\"3217465\"", ")", ";", "add", "(", "\"3217546\"", ")", ";", "add", "(", "\"3217564\"", ")", ";", "add", "(", "\"3217645\"", ")", ";", "add", "(", "\"3217654\"", ")", ";", "add", "(", "\"3241576\"", ")", ";", "add", "(", "\"3241657\"", ")", ";", "add", "(", "\"3241675\"", ")", ";", "add", "(", "\"3241756\"", ")", ";", "add", "(", "\"3241765\"", ")", ";", "add", "(", "\"3245176\"", ")", ";", "add", "(", "\"3245716\"", ")", ";", "add", "(", "\"3245761\"", ")", ";", "add", "(", "\"3246157\"", ")", ";", "add", "(", "\"3246175\"", ")", ";", "add", "(", "\"3246517\"", ")", ";", "add", "(", "\"3246571\"", ")", ";", "add", "(", "\"3246715\"", ")", ";", "add", "(", "\"3246751\"", ")", ";", "add", "(", "\"3247156\"", ")", ";", "add", "(", "\"3247165\"", ")", ";", "add", "(", "\"3247516\"", ")", ";", "add", "(", "\"3247561\"", ")", ";", "add", "(", "\"3247615\"", ")", ";", "add", "(", "\"3251467\"", ")", ";", "add", "(", "\"3251476\"", ")", ";", "add", "(", "\"3251647\"", ")", ";", "add", "(", "\"3251674\"", ")", ";", "add", "(", "\"3251746\"", ")", ";", "add", "(", "\"3251764\"", ")", ";", "add", "(", "\"3254167\"", ")", ";", "add", "(", "\"3254176\"", ")", ";", "add", "(", "\"3254617\"", ")", ";", "add", "(", "\"3254671\"", ")", ";", "add", "(", "\"3254716\"", ")", ";", "add", "(", "\"3254761\"", ")", ";", "add", "(", "\"3256147\"", ")", ";", "add", "(", "\"3256174\"", ")", ";", "add", "(", "\"3256417\"", ")", ";", "add", "(", "\"3256471\"", ")", ";", "add", "(", "\"3256714\"", ")", ";", "add", "(", "\"3256741\"", ")", ";", "add", "(", "\"3257146\"", ")", ";", "add", "(", "\"3257164\"", ")", ";", "add", "(", "\"3257416\"", ")", ";", "add", "(", "\"3257461\"", ")", ";", "add", "(", "\"3257614\"", ")", ";", "add", "(", "\"3261457\"", ")", ";", "add", "(", "\"3261475\"", ")", ";", "add", "(", "\"3261547\"", ")", ";", "add", "(", "\"3261574\"", ")", ";", "add", "(", "\"3261745\"", ")", ";", "add", "(", "\"3261754\"", ")", ";", "add", "(", "\"3264157\"", ")", ";", "add", "(", "\"3264175\"", ")", ";", "add", "(", "\"3264517\"", ")", ";", "add", "(", "\"3264571\"", ")", ";", "add", "(", "\"3264715\"", ")", ";", "add", "(", "\"3264751\"", ")", ";", "add", "(", "\"3265147\"", ")", ";", "add", "(", "\"3265174\"", ")", ";", "add", "(", "\"3265714\"", ")", ";", "add", "(", "\"3267145\"", ")", ";", "add", "(", "\"3267154\"", ")", ";", "add", "(", "\"3267415\"", ")", ";", "add", "(", "\"3267451\"", ")", ";", "add", "(", "\"3267514\"", ")", ";", "add", "(", "\"3271456\"", ")", ";", "add", "(", "\"3271465\"", ")", ";", "add", "(", "\"3271546\"", ")", ";", "add", "(", "\"3271564\"", ")", ";", "add", "(", "\"3271645\"", ")", ";", "add", "(", "\"3271654\"", ")", ";", "add", "(", "\"3274156\"", ")", ";", "add", "(", "\"3274165\"", ")", ";", "add", "(", "\"3274516\"", ")", ";", "add", "(", "\"3274561\"", ")", ";", "add", "(", "\"3274615\"", ")", ";", "add", "(", "\"3275146\"", ")", ";", "add", "(", "\"3275164\"", ")", ";", "add", "(", "\"3275614\"", ")", ";", "add", "(", "\"3276145\"", ")", ";", "add", "(", "\"3276154\"", ")", ";", "add", "(", "\"3276415\"", ")", ";", "add", "(", "\"3276514\"", ")", ";", "add", "(", "\"3412567\"", ")", ";", "add", "(", "\"3412576\"", ")", ";", "add", "(", "\"3412657\"", ")", ";", "add", "(", "\"3412675\"", ")", ";", "add", "(", "\"3412756\"", ")", ";", "add", "(", "\"3412765\"", ")", ";", "add", "(", "\"3415267\"", ")", ";", "add", "(", "\"3415276\"", ")", ";", "add", "(", "\"3415627\"", ")", ";", "add", "(", "\"3415672\"", ")", ";", "add", "(", "\"3415726\"", ")", ";", "add", "(", "\"3415762\"", ")", ";", "add", "(", "\"3416257\"", ")", ";", "add", "(", "\"3416275\"", ")", ";", "add", "(", "\"3416527\"", ")", ";", "add", "(", "\"3416572\"", ")", ";", "add", "(", "\"3416725\"", ")", ";", "add", "(", "\"3416752\"", ")", ";", "add", "(", "\"3417256\"", ")", ";", "add", "(", "\"3417265\"", ")", ";", "add", "(", "\"3417526\"", ")", ";", "add", "(", "\"3417562\"", ")", ";", "add", "(", "\"3417625\"", ")", ";", "add", "(", "\"3421576\"", ")", ";", "add", "(", "\"3421657\"", ")", ";", "add", "(", "\"3421675\"", ")", ";", "add", "(", "\"3421756\"", ")", ";", "add", "(", "\"3421765\"", ")", ";", "add", "(", "\"3425176\"", ")", ";", "add", "(", "\"3425716\"", ")", ";", "add", "(", "\"3425761\"", ")", ";", "add", "(", "\"3426157\"", ")", ";", "add", "(", "\"3426175\"", ")", ";", "add", "(", "\"3426517\"", ")", ";", "add", "(", "\"3426571\"", ")", ";", "add", "(", "\"3426715\"", ")", ";", "add", "(", "\"3426751\"", ")", ";", "add", "(", "\"3427156\"", ")", ";", "add", "(", "\"3427165\"", ")", ";", "add", "(", "\"3427516\"", ")", ";", "add", "(", "\"3427561\"", ")", ";", "add", "(", "\"3427615\"", ")", ";", "add", "(", "\"3451267\"", ")", ";", "add", "(", "\"3451276\"", ")", ";", "add", "(", "\"3451627\"", ")", ";", "add", "(", "\"3451672\"", ")", ";", "add", "(", "\"3451726\"", ")", ";", "add", "(", "\"3451762\"", ")", ";", "add", "(", "\"3452176\"", ")", ";", "add", "(", "\"3452716\"", ")", ";", "add", "(", "\"3452761\"", ")", ";", "add", "(", "\"3456127\"", ")", ";", "add", "(", "\"3456172\"", ")", ";", "add", "(", "\"3456712\"", ")", ";", "add", "(", "\"3457126\"", ")", ";", "add", "(", "\"3457162\"", ")", ";", "add", "(", "\"3457216\"", ")", ";", "add", "(", "\"3457261\"", ")", ";", "add", "(", "\"3457612\"", ")", ";", "add", "(", "\"3461257\"", ")", ";", "add", "(", "\"3461275\"", ")", ";", "add", "(", "\"3461527\"", ")", ";", "add", "(", "\"3461572\"", ")", ";", "add", "(", "\"3461725\"", ")", ";", "add", "(", "\"3461752\"", ")", ";", "add", "(", "\"3462157\"", ")", ";", "add", "(", "\"3462175\"", ")", ";", "add", "(", "\"3462517\"", ")", ";", "add", "(", "\"3462571\"", ")", ";", "add", "(", "\"3462715\"", ")", ";", "add", "(", "\"3462751\"", ")", ";", "add", "(", "\"3465127\"", ")", ";", "add", "(", "\"3465172\"", ")", ";", "add", "(", "\"3465712\"", ")", ";", "add", "(", "\"3467125\"", ")", ";", "add", "(", "\"3467152\"", ")", ";", "add", "(", "\"3467215\"", ")", ";", "add", "(", "\"3467251\"", ")", ";", "add", "(", "\"3467512\"", ")", ";", "add", "(", "\"3471256\"", ")", ";", "add", "(", "\"3471265\"", ")", ";", "add", "(", "\"3471526\"", ")", ";", "add", "(", "\"3471562\"", ")", ";", "add", "(", "\"3471625\"", ")", ";", "add", "(", "\"3472156\"", ")", ";", "add", "(", "\"3472165\"", ")", ";", "add", "(", "\"3472516\"", ")", ";", "add", "(", "\"3472561\"", ")", ";", "add", "(", "\"3472615\"", ")", ";", "add", "(", "\"3475126\"", ")", ";", "add", "(", "\"3475162\"", ")", ";", "add", "(", "\"3475612\"", ")", ";", "add", "(", "\"3476125\"", ")", ";", "add", "(", "\"3512467\"", ")", ";", "add", "(", "\"3512476\"", ")", ";", "add", "(", "\"3512647\"", ")", ";", "add", "(", "\"3512674\"", ")", ";", "add", "(", "\"3512746\"", ")", ";", "add", "(", "\"3512764\"", ")", ";", "add", "(", "\"3514267\"", ")", ";", "add", "(", "\"3514276\"", ")", ";", "add", "(", "\"3514627\"", ")", ";", "add", "(", "\"3514672\"", ")", ";", "add", "(", "\"3514726\"", ")", ";", "add", "(", "\"3514762\"", ")", ";", "add", "(", "\"3516247\"", ")", ";", "add", "(", "\"3516274\"", ")", ";", "add", "(", "\"3516427\"", ")", ";", "add", "(", "\"3516472\"", ")", ";", "add", "(", "\"3516724\"", ")", ";", "add", "(", "\"3516742\"", ")", ";", "add", "(", "\"3517246\"", ")", ";", "add", "(", "\"3517264\"", ")", ";", "add", "(", "\"3517426\"", ")", ";", "add", "(", "\"3517462\"", ")", ";", "add", "(", "\"3517624\"", ")", ";", "add", "(", "\"3521467\"", ")", ";", "add", "(", "\"3521476\"", ")", ";", "add", "(", "\"3521647\"", ")", ";", "add", "(", "\"3521674\"", ")", ";", "add", "(", "\"3521746\"", ")", ";", "add", "(", "\"3521764\"", ")", ";", "add", "(", "\"3524167\"", ")", ";", "add", "(", "\"3524176\"", ")", ";", "add", "(", "\"3524617\"", ")", ";", "add", "(", "\"3524671\"", ")", ";", "add", "(", "\"3524716\"", ")", ";", "add", "(", "\"3524761\"", ")", ";", "add", "(", "\"3526147\"", ")", ";", "add", "(", "\"3526174\"", ")", ";", "add", "(", "\"3526417\"", ")", ";", "add", "(", "\"3526471\"", ")", ";", "add", "(", "\"3526714\"", ")", ";", "add", "(", "\"3526741\"", ")", ";", "add", "(", "\"3527146\"", ")", ";", "add", "(", "\"3527164\"", ")", ";", "add", "(", "\"3527416\"", ")", ";", "add", "(", "\"3527461\"", ")", ";", "add", "(", "\"3527614\"", ")", ";", "add", "(", "\"3541267\"", ")", ";", "add", "(", "\"3541276\"", ")", ";", "add", "(", "\"3541627\"", ")", ";", "add", "(", "\"3541672\"", ")", ";", "add", "(", "\"3541726\"", ")", ";", "add", "(", "\"3541762\"", ")", ";", "add", "(", "\"3546127\"", ")", ";", "add", "(", "\"3546172\"", ")", ";", "add", "(", "\"3546712\"", ")", ";", "add", "(", "\"3547126\"", ")", ";", "add", "(", "\"3547162\"", ")", ";", "add", "(", "\"3547612\"", ")", ";", "add", "(", "\"3561247\"", ")", ";", "add", "(", "\"3561274\"", ")", ";", "add", "(", "\"3561427\"", ")", ";", "add", "(", "\"3561472\"", ")", ";", "add", "(", "\"3561724\"", ")", ";", "add", "(", "\"3561742\"", ")", ";", "add", "(", "\"3562147\"", ")", ";", "add", "(", "\"3562174\"", ")", ";", "add", "(", "\"3562417\"", ")", ";", "add", "(", "\"3562471\"", ")", ";", "add", "(", "\"3562714\"", ")", ";", "add", "(", "\"3562741\"", ")", ";", "add", "(", "\"3564127\"", ")", ";", "add", "(", "\"3564172\"", ")", ";", "add", "(", "\"3564712\"", ")", ";", "add", "(", "\"3567124\"", ")", ";", "add", "(", "\"3567142\"", ")", ";", "add", "(", "\"3567214\"", ")", ";", "add", "(", "\"3567241\"", ")", ";", "add", "(", "\"3567412\"", ")", ";", "add", "(", "\"3571246\"", ")", ";", "add", "(", "\"3571264\"", ")", ";", "add", "(", "\"3571426\"", ")", ";", "add", "(", "\"3571462\"", ")", ";", "add", "(", "\"3571624\"", ")", ";", "add", "(", "\"3572146\"", ")", ";", "add", "(", "\"3572164\"", ")", ";", "add", "(", "\"3572416\"", ")", ";", "add", "(", "\"3572461\"", ")", ";", "add", "(", "\"3572614\"", ")", ";", "add", "(", "\"3574126\"", ")", ";", "add", "(", "\"3574162\"", ")", ";", "add", "(", "\"3574612\"", ")", ";", "add", "(", "\"3576124\"", ")", ";", "add", "(", "\"3612457\"", ")", ";", "add", "(", "\"3612475\"", ")", ";", "add", "(", "\"3612547\"", ")", ";", "add", "(", "\"3612574\"", ")", ";", "add", "(", "\"3612745\"", ")", ";", "add", "(", "\"3612754\"", ")", ";", "add", "(", "\"3614257\"", ")", ";", "add", "(", "\"3614275\"", ")", ";", "add", "(", "\"3614527\"", ")", ";", "add", "(", "\"3614572\"", ")", ";", "add", "(", "\"3614725\"", ")", ";", "add", "(", "\"3614752\"", ")", ";", "add", "(", "\"3615247\"", ")", ";", "add", "(", "\"3615274\"", ")", ";", "add", "(", "\"3615724\"", ")", ";", "add", "(", "\"3617245\"", ")", ";", "add", "(", "\"3617254\"", ")", ";", "add", "(", "\"3617425\"", ")", ";", "add", "(", "\"3617452\"", ")", ";", "add", "(", "\"3617524\"", ")", ";", "add", "(", "\"3621457\"", ")", ";", "add", "(", "\"3621475\"", ")", ";", "add", "(", "\"3621547\"", ")", ";", "add", "(", "\"3621574\"", ")", ";", "add", "(", "\"3621745\"", ")", ";", "add", "(", "\"3621754\"", ")", ";", "add", "(", "\"3624157\"", ")", ";", "add", "(", "\"3624175\"", ")", ";", "add", "(", "\"3624517\"", ")", ";", "add", "(", "\"3624571\"", ")", ";", "add", "(", "\"3624715\"", ")", ";", "add", "(", "\"3624751\"", ")", ";", "add", "(", "\"3625147\"", ")", ";", "add", "(", "\"3625174\"", ")", ";", "add", "(", "\"3625714\"", ")", ";", "add", "(", "\"3627145\"", ")", ";", "add", "(", "\"3627154\"", ")", ";", "add", "(", "\"3627415\"", ")", ";", "add", "(", "\"3627451\"", ")", ";", "add", "(", "\"3627514\"", ")", ";", "add", "(", "\"3641257\"", ")", ";", "add", "(", "\"3641275\"", ")", ";", "add", "(", "\"3641527\"", ")", ";", "add", "(", "\"3641572\"", ")", ";", "add", "(", "\"3641725\"", ")", ";", "add", "(", "\"3641752\"", ")", ";", "add", "(", "\"3645127\"", ")", ";", "add", "(", "\"3645172\"", ")", ";", "add", "(", "\"3645712\"", ")", ";", "add", "(", "\"3647125\"", ")", ";", "add", "(", "\"3647152\"", ")", ";", "add", "(", "\"3647512\"", ")", ";", "add", "(", "\"3651247\"", ")", ";", "add", "(", "\"3651274\"", ")", ";", "add", "(", "\"3651724\"", ")", ";", "add", "(", "\"3657124\"", ")", ";", "add", "(", "\"3671245\"", ")", ";", "add", "(", "\"3671254\"", ")", ";", "add", "(", "\"3671425\"", ")", ";", "add", "(", "\"3671452\"", ")", ";", "add", "(", "\"3671524\"", ")", ";", "add", "(", "\"3672145\"", ")", ";", "add", "(", "\"3672154\"", ")", ";", "add", "(", "\"3672415\"", ")", ";", "add", "(", "\"3672451\"", ")", ";", "add", "(", "\"3672514\"", ")", ";", "add", "(", "\"3674125\"", ")", ";", "add", "(", "\"3674152\"", ")", ";", "add", "(", "\"3674512\"", ")", ";", "add", "(", "\"3675124\"", ")", ";", "add", "(", "\"3712456\"", ")", ";", "add", "(", "\"3712465\"", ")", ";", "add", "(", "\"3712546\"", ")", ";", "add", "(", "\"3712564\"", ")", ";", "add", "(", "\"3712645\"", ")", ";", "add", "(", "\"3714256\"", ")", ";", "add", "(", "\"3714265\"", ")", ";", "add", "(", "\"3714526\"", ")", ";", "add", "(", "\"3714562\"", ")", ";", "add", "(", "\"3714625\"", ")", ";", "add", "(", "\"3715246\"", ")", ";", "add", "(", "\"3715264\"", ")", ";", "add", "(", "\"3715624\"", ")", ";", "add", "(", "\"3716245\"", ")", ";", "add", "(", "\"3721456\"", ")", ";", "add", "(", "\"3721465\"", ")", ";", "add", "(", "\"3721546\"", ")", ";", "add", "(", "\"3721564\"", ")", ";", "add", "(", "\"3721645\"", ")", ";", "add", "(", "\"3721654\"", ")", ";", "add", "(", "\"3724156\"", ")", ";", "add", "(", "\"3724165\"", ")", ";", "add", "(", "\"3724516\"", ")", ";", "add", "(", "\"3724561\"", ")", ";", "add", "(", "\"3724615\"", ")", ";", "add", "(", "\"3725146\"", ")", ";", "add", "(", "\"3725164\"", ")", ";", "add", "(", "\"3725614\"", ")", ";", "add", "(", "\"3726145\"", ")", ";", "add", "(", "\"3726154\"", ")", ";", "add", "(", "\"3726415\"", ")", ";", "add", "(", "\"3726514\"", ")", ";", "add", "(", "\"3741256\"", ")", ";", "add", "(", "\"3741265\"", ")", ";", "add", "(", "\"3741526\"", ")", ";", "add", "(", "\"3741562\"", ")", ";", "add", "(", "\"3741625\"", ")", ";", "add", "(", "\"3742165\"", ")", ";", "add", "(", "\"3742615\"", ")", ";", "add", "(", "\"3745126\"", ")", ";", "add", "(", "\"3745162\"", ")", ";", "add", "(", "\"3745612\"", ")", ";", "add", "(", "\"3746125\"", ")", ";", "add", "(", "\"3751246\"", ")", ";", "add", "(", "\"3751264\"", ")", ";", "add", "(", "\"3751624\"", ")", ";", "add", "(", "\"3752164\"", ")", ";", "add", "(", "\"3752614\"", ")", ";", "add", "(", "\"3756124\"", ")", ";", "add", "(", "\"3761245\"", ")", ";", "add", "(", "\"3762154\"", ")", ";", "add", "(", "\"3762514\"", ")", ";", "add", "(", "\"4123567\"", ")", ";", "add", "(", "\"4123576\"", ")", ";", "add", "(", "\"4123657\"", ")", ";", "add", "(", "\"4123675\"", ")", ";", "add", "(", "\"4123756\"", ")", ";", "add", "(", "\"4123765\"", ")", ";", "add", "(", "\"4125367\"", ")", ";", "add", "(", "\"4125376\"", ")", ";", "add", "(", "\"4125637\"", ")", ";", "add", "(", "\"4125673\"", ")", ";", "add", "(", "\"4125736\"", ")", ";", "add", "(", "\"4125763\"", ")", ";", "add", "(", "\"4126357\"", ")", ";", "add", "(", "\"4126375\"", ")", ";", "add", "(", "\"4126537\"", ")", ";", "add", "(", "\"4126573\"", ")", ";", "add", "(", "\"4126735\"", ")", ";", "add", "(", "\"4126753\"", ")", ";", "add", "(", "\"4127356\"", ")", ";", "add", "(", "\"4127365\"", ")", ";", "add", "(", "\"4127536\"", ")", ";", "add", "(", "\"4127563\"", ")", ";", "add", "(", "\"4127635\"", ")", ";", "add", "(", "\"4132576\"", ")", ";", "add", "(", "\"4132657\"", ")", ";", "add", "(", "\"4132675\"", ")", ";", "add", "(", "\"4132756\"", ")", ";", "add", "(", "\"4132765\"", ")", ";", "add", "(", "\"4135267\"", ")", ";", "add", "(", "\"4135276\"", ")", ";", "add", "(", "\"4135627\"", ")", ";", "add", "(", "\"4135672\"", ")", ";", "add", "(", "\"4135726\"", ")", ";", "add", "(", "\"4135762\"", ")", ";", "add", "(", "\"4136257\"", ")", ";", "add", "(", "\"4136275\"", ")", ";", "add", "(", "\"4136527\"", ")", ";", "add", "(", "\"4136572\"", ")", ";", "add", "(", "\"4136725\"", ")", ";", "add", "(", "\"4136752\"", ")", ";", "add", "(", "\"4137256\"", ")", ";", "add", "(", "\"4137265\"", ")", ";", "add", "(", "\"4137526\"", ")", ";", "add", "(", "\"4137562\"", ")", ";", "add", "(", "\"4137625\"", ")", ";", "add", "(", "\"4152367\"", ")", ";", "add", "(", "\"4152376\"", ")", ";", "add", "(", "\"4152637\"", ")", ";", "add", "(", "\"4152673\"", ")", ";", "add", "(", "\"4152736\"", ")", ";", "add", "(", "\"4152763\"", ")", ";", "add", "(", "\"4153267\"", ")", ";", "add", "(", "\"4153276\"", ")", ";", "add", "(", "\"4153627\"", ")", ";", "add", "(", "\"4153672\"", ")", ";", "add", "(", "\"4153726\"", ")", ";", "add", "(", "\"4153762\"", ")", ";", "add", "(", "\"4156237\"", ")", ";", "add", "(", "\"4156273\"", ")", ";", "add", "(", "\"4156327\"", ")", ";", "add", "(", "\"4156372\"", ")", ";", "add", "(", "\"4156723\"", ")", ";", "add", "(", "\"4156732\"", ")", ";", "add", "(", "\"4157236\"", ")", ";", "add", "(", "\"4157263\"", ")", ";", "add", "(", "\"4157326\"", ")", ";", "add", "(", "\"4157362\"", ")", ";", "add", "(", "\"4157623\"", ")", ";", "add", "(", "\"4162357\"", ")", ";", "add", "(", "\"4162375\"", ")", ";", "add", "(", "\"4162537\"", ")", ";", "add", "(", "\"4162573\"", ")", ";", "add", "(", "\"4162735\"", ")", ";", "add", "(", "\"4162753\"", ")", ";", "add", "(", "\"4163257\"", ")", ";", "add", "(", "\"4163275\"", ")", ";", "add", "(", "\"4163527\"", ")", ";", "add", "(", "\"4163572\"", ")", ";", "add", "(", "\"4163725\"", ")", ";", "add", "(", "\"4163752\"", ")", ";", "add", "(", "\"4165237\"", ")", ";", "add", "(", "\"4165273\"", ")", ";", "add", "(", "\"4165723\"", ")", ";", "add", "(", "\"4167235\"", ")", ";", "add", "(", "\"4167253\"", ")", ";", "add", "(", "\"4167325\"", ")", ";", "add", "(", "\"4167352\"", ")", ";", "add", "(", "\"4167523\"", ")", ";", "add", "(", "\"4172356\"", ")", ";", "add", "(", "\"4172365\"", ")", ";", "add", "(", "\"4172536\"", ")", ";", "add", "(", "\"4172563\"", ")", ";", "add", "(", "\"4172635\"", ")", ";", "add", "(", "\"4173256\"", ")", ";", "add", "(", "\"4173265\"", ")", ";", "add", "(", "\"4173526\"", ")", ";", "add", "(", "\"4173562\"", ")", ";", "add", "(", "\"4173625\"", ")", ";", "add", "(", "\"4175236\"", ")", ";", "add", "(", "\"4175263\"", ")", ";", "add", "(", "\"4175623\"", ")", ";", "add", "(", "\"4176235\"", ")", ";", "add", "(", "\"4213576\"", ")", ";", "add", "(", "\"4213657\"", ")", ";", "add", "(", "\"4213675\"", ")", ";", "add", "(", "\"4213756\"", ")", ";", "add", "(", "\"4213765\"", ")", ";", "add", "(", "\"4215367\"", ")", ";", "add", "(", "\"4215376\"", ")", ";", "add", "(", "\"4215637\"", ")", ";", "add", "(", "\"4215673\"", ")", ";", "add", "(", "\"4215736\"", ")", ";", "add", "(", "\"4215763\"", ")", ";", "add", "(", "\"4216357\"", ")", ";", "add", "(", "\"4216375\"", ")", ";", "add", "(", "\"4216537\"", ")", ";", "add", "(", "\"4216573\"", ")", ";", "add", "(", "\"4216735\"", ")", ";", "add", "(", "\"4216753\"", ")", ";", "add", "(", "\"4217356\"", ")", ";", "add", "(", "\"4217365\"", ")", ";", "add", "(", "\"4217536\"", ")", ";", "add", "(", "\"4217563\"", ")", ";", "add", "(", "\"4217635\"", ")", ";", "add", "(", "\"4217653\"", ")", ";", "add", "(", "\"4231576\"", ")", ";", "add", "(", "\"4231657\"", ")", ";", "add", "(", "\"4231675\"", ")", ";", "add", "(", "\"4231756\"", ")", ";", "add", "(", "\"4231765\"", ")", ";", "add", "(", "\"4235176\"", ")", ";", "add", "(", "\"4235716\"", ")", ";", "add", "(", "\"4235761\"", ")", ";", "add", "(", "\"4236157\"", ")", ";", "add", "(", "\"4236175\"", ")", ";", "add", "(", "\"4236517\"", ")", ";", "add", "(", "\"4236571\"", ")", ";", "add", "(", "\"4236715\"", ")", ";", "add", "(", "\"4236751\"", ")", ";", "add", "(", "\"4237156\"", ")", ";", "add", "(", "\"4237165\"", ")", ";", "add", "(", "\"4237516\"", ")", ";", "add", "(", "\"4237561\"", ")", ";", "add", "(", "\"4237615\"", ")", ";", "add", "(", "\"4251367\"", ")", ";", "add", "(", "\"4251376\"", ")", ";", "add", "(", "\"4251637\"", ")", ";", "add", "(", "\"4251673\"", ")", ";", "add", "(", "\"4251736\"", ")", ";", "add", "(", "\"4251763\"", ")", ";", "add", "(", "\"4253167\"", ")", ";", "add", "(", "\"4253176\"", ")", ";", "add", "(", "\"4253617\"", ")", ";", "add", "(", "\"4253671\"", ")", ";", "add", "(", "\"4253716\"", ")", ";", "add", "(", "\"4253761\"", ")", ";", "add", "(", "\"4256137\"", ")", ";", "add", "(", "\"4256173\"", ")", ";", "add", "(", "\"4256317\"", ")", ";", "add", "(", "\"4256371\"", ")", ";", "add", "(", "\"4256713\"", ")", ";", "add", "(", "\"4256731\"", ")", ";", "add", "(", "\"4257136\"", ")", ";", "add", "(", "\"4257163\"", ")", ";", "add", "(", "\"4257316\"", ")", ";", "add", "(", "\"4257361\"", ")", ";", "add", "(", "\"4257613\"", ")", ";", "add", "(", "\"4261357\"", ")", ";", "add", "(", "\"4261375\"", ")", ";", "add", "(", "\"4261537\"", ")", ";", "add", "(", "\"4261573\"", ")", ";", "add", "(", "\"4261735\"", ")", ";", "add", "(", "\"4261753\"", ")", ";", "add", "(", "\"4263157\"", ")", ";", "add", "(", "\"4263175\"", ")", ";", "add", "(", "\"4263517\"", ")", ";", "add", "(", "\"4263571\"", ")", ";", "add", "(", "\"4263715\"", ")", ";", "add", "(", "\"4263751\"", ")", ";", "add", "(", "\"4265137\"", ")", ";", "add", "(", "\"4265173\"", ")", ";", "add", "(", "\"4265713\"", ")", ";", "add", "(", "\"4267135\"", ")", ";", "add", "(", "\"4267153\"", ")", ";", "add", "(", "\"4267315\"", ")", ";", "add", "(", "\"4267351\"", ")", ";", "add", "(", "\"4267513\"", ")", ";", "add", "(", "\"4271356\"", ")", ";", "add", "(", "\"4271365\"", ")", ";", "add", "(", "\"4271536\"", ")", ";", "add", "(", "\"4271563\"", ")", ";", "add", "(", "\"4271635\"", ")", ";", "add", "(", "\"4271653\"", ")", ";", "add", "(", "\"4273156\"", ")", ";", "add", "(", "\"4273165\"", ")", ";", "add", "(", "\"4273516\"", ")", ";", "add", "(", "\"4273561\"", ")", ";", "add", "(", "\"4273615\"", ")", ";", "add", "(", "\"4275136\"", ")", ";", "add", "(", "\"4275163\"", ")", ";", "add", "(", "\"4275613\"", ")", ";", "add", "(", "\"4276135\"", ")", ";", "add", "(", "\"4276153\"", ")", ";", "add", "(", "\"4276315\"", ")", ";", "add", "(", "\"4276513\"", ")", ";", "add", "(", "\"4312576\"", ")", ";", "add", "(", "\"4312657\"", ")", ";", "add", "(", "\"4312675\"", ")", ";", "add", "(", "\"4312756\"", ")", ";", "add", "(", "\"4312765\"", ")", ";", "add", "(", "\"4315267\"", ")", ";", "add", "(", "\"4315276\"", ")", ";", "add", "(", "\"4315627\"", ")", ";", "add", "(", "\"4315672\"", ")", ";", "add", "(", "\"4315726\"", ")", ";", "add", "(", "\"4315762\"", ")", ";", "add", "(", "\"4316257\"", ")", ";", "add", "(", "\"4316275\"", ")", ";", "add", "(", "\"4316527\"", ")", ";", "add", "(", "\"4316572\"", ")", ";", "add", "(", "\"4316725\"", ")", ";", "add", "(", "\"4316752\"", ")", ";", "add", "(", "\"4317256\"", ")", ";", "add", "(", "\"4317265\"", ")", ";", "add", "(", "\"4317526\"", ")", ";", "add", "(", "\"4317562\"", ")", ";", "add", "(", "\"4317625\"", ")", ";", "add", "(", "\"4317652\"", ")", ";", "add", "(", "\"4321765\"", ")", ";", "add", "(", "\"4327165\"", ")", ";", "add", "(", "\"4327615\"", ")", ";", "add", "(", "\"4327651\"", ")", ";", "add", "(", "\"4351267\"", ")", ";", "add", "(", "\"4351276\"", ")", ";", "add", "(", "\"4351627\"", ")", ";", "add", "(", "\"4351672\"", ")", ";", "add", "(", "\"4351726\"", ")", ";", "add", "(", "\"4351762\"", ")", ";", "add", "(", "\"4356127\"", ")", ";", "add", "(", "\"4356172\"", ")", ";", "add", "(", "\"4356712\"", ")", ";", "add", "(", "\"4357126\"", ")", ";", "add", "(", "\"4357162\"", ")", ";", "add", "(", "\"4357612\"", ")", ";", "add", "(", "\"4361257\"", ")", ";", "add", "(", "\"4361275\"", ")", ";", "add", "(", "\"4361527\"", ")", ";", "add", "(", "\"4361572\"", ")", ";", "add", "(", "\"4361725\"", ")", ";", "add", "(", "\"4361752\"", ")", ";", "add", "(", "\"4365127\"", ")", ";", "add", "(", "\"4365172\"", ")", ";", "add", "(", "\"4365712\"", ")", ";", "add", "(", "\"4367125\"", ")", ";", "add", "(", "\"4367152\"", ")", ";", "add", "(", "\"4367512\"", ")", ";", "add", "(", "\"4371256\"", ")", ";", "add", "(", "\"4371265\"", ")", ";", "add", "(", "\"4371526\"", ")", ";", "add", "(", "\"4371562\"", ")", ";", "add", "(", "\"4371625\"", ")", ";", "add", "(", "\"4371652\"", ")", ";", "add", "(", "\"4372165\"", ")", ";", "add", "(", "\"4372615\"", ")", ";", "add", "(", "\"4372651\"", ")", ";", "add", "(", "\"4375126\"", ")", ";", "add", "(", "\"4375162\"", ")", ";", "add", "(", "\"4375612\"", ")", ";", "add", "(", "\"4376125\"", ")", ";", "add", "(", "\"4376152\"", ")", ";", "add", "(", "\"4376215\"", ")", ";", "add", "(", "\"4376251\"", ")", ";", "add", "(", "\"4376512\"", ")", ";", "add", "(", "\"4512367\"", ")", ";", "add", "(", "\"4512376\"", ")", ";", "add", "(", "\"4512637\"", ")", ";", "add", "(", "\"4512673\"", ")", ";", "add", "(", "\"4512736\"", ")", ";", "add", "(", "\"4512763\"", ")", ";", "add", "(", "\"4513267\"", ")", ";", "add", "(", "\"4513276\"", ")", ";", "add", "(", "\"4513627\"", ")", ";", "add", "(", "\"4513672\"", ")", ";", "add", "(", "\"4513726\"", ")", ";", "add", "(", "\"4513762\"", ")", ";", "add", "(", "\"4516237\"", ")", ";", "add", "(", "\"4516273\"", ")", ";", "add", "(", "\"4516327\"", ")", ";", "add", "(", "\"4516372\"", ")", ";", "add", "(", "\"4516723\"", ")", ";", "add", "(", "\"4516732\"", ")", ";", "add", "(", "\"4517236\"", ")", ";", "add", "(", "\"4517263\"", ")", ";", "add", "(", "\"4517326\"", ")", ";", "add", "(", "\"4517362\"", ")", ";", "add", "(", "\"4517623\"", ")", ";", "add", "(", "\"4521367\"", ")", ";", "add", "(", "\"4521376\"", ")", ";", "add", "(", "\"4521637\"", ")", ";", "add", "(", "\"4521673\"", ")", ";", "add", "(", "\"4521736\"", ")", ";", "add", "(", "\"4521763\"", ")", ";", "add", "(", "\"4523167\"", ")", ";", "add", "(", "\"4523176\"", ")", ";", "add", "(", "\"4523617\"", ")", ";", "add", "(", "\"4523671\"", ")", ";", "add", "(", "\"4523716\"", ")", ";", "add", "(", "\"4523761\"", ")", ";", "add", "(", "\"4526137\"", ")", ";", "add", "(", "\"4526173\"", ")", ";", "add", "(", "\"4526317\"", ")", ";", "add", "(", "\"4526371\"", ")", ";", "add", "(", "\"4526713\"", ")", ";", "add", "(", "\"4526731\"", ")", ";", "add", "(", "\"4527136\"", ")", ";", "add", "(", "\"4527163\"", ")", ";", "add", "(", "\"4527316\"", ")", ";", "add", "(", "\"4527361\"", ")", ";", "add", "(", "\"4527613\"", ")", ";", "add", "(", "\"4531267\"", ")", ";", "add", "(", "\"4531276\"", ")", ";", "add", "(", "\"4531627\"", ")", ";", "add", "(", "\"4531672\"", ")", ";", "add", "(", "\"4531726\"", ")", ";", "add", "(", "\"4531762\"", ")", ";", "add", "(", "\"4536127\"", ")", ";", "add", "(", "\"4536172\"", ")", ";", "add", "(", "\"4536712\"", ")", ";", "add", "(", "\"4537126\"", ")", ";", "add", "(", "\"4537162\"", ")", ";", "add", "(", "\"4537612\"", ")", ";", "add", "(", "\"4561237\"", ")", ";", "add", "(", "\"4561273\"", ")", ";", "add", "(", "\"4561327\"", ")", ";", "add", "(", "\"4561372\"", ")", ";", "add", "(", "\"4561723\"", ")", ";", "add", "(", "\"4561732\"", ")", ";", "add", "(", "\"4562137\"", ")", ";", "add", "(", "\"4562173\"", ")", ";", "add", "(", "\"4562317\"", ")", ";", "add", "(", "\"4562371\"", ")", ";", "add", "(", "\"4562713\"", ")", ";", "add", "(", "\"4562731\"", ")", ";", "add", "(", "\"4563127\"", ")", ";", "add", "(", "\"4563172\"", ")", ";", "add", "(", "\"4563712\"", ")", ";", "add", "(", "\"4567123\"", ")", ";", "add", "(", "\"4567132\"", ")", ";", "add", "(", "\"4567213\"", ")", ";", "add", "(", "\"4567231\"", ")", ";", "add", "(", "\"4567312\"", ")", ";", "add", "(", "\"4571236\"", ")", ";", "add", "(", "\"4571263\"", ")", ";", "add", "(", "\"4571326\"", ")", ";", "add", "(", "\"4571362\"", ")", ";", "add", "(", "\"4571623\"", ")", ";", "add", "(", "\"4572136\"", ")", ";", "add", "(", "\"4572163\"", ")", ";", "add", "(", "\"4572316\"", ")", ";", "add", "(", "\"4572361\"", ")", ";", "add", "(", "\"4572613\"", ")", ";", "add", "(", "\"4573126\"", ")", ";", "add", "(", "\"4573162\"", ")", ";", "add", "(", "\"4573612\"", ")", ";", "add", "(", "\"4576123\"", ")", ";", "add", "(", "\"4612357\"", ")", ";", "add", "(", "\"4612375\"", ")", ";", "add", "(", "\"4612537\"", ")", ";", "add", "(", "\"4612573\"", ")", ";", "add", "(", "\"4612735\"", ")", ";", "add", "(", "\"4612753\"", ")", ";", "add", "(", "\"4613257\"", ")", ";", "add", "(", "\"4613275\"", ")", ";", "add", "(", "\"4613527\"", ")", ";", "add", "(", "\"4613572\"", ")", ";", "add", "(", "\"4613725\"", ")", ";", "add", "(", "\"4613752\"", ")", ";", "add", "(", "\"4615237\"", ")", ";", "add", "(", "\"4615273\"", ")", ";", "add", "(", "\"4615723\"", ")", ";", "add", "(", "\"4617235\"", ")", ";", "add", "(", "\"4617253\"", ")", ";", "add", "(", "\"4617325\"", ")", ";", "add", "(", "\"4617352\"", ")", ";", "add", "(", "\"4617523\"", ")", ";", "add", "(", "\"4621357\"", ")", ";", "add", "(", "\"4621375\"", ")", ";", "add", "(", "\"4621537\"", ")", ";", "add", "(", "\"4621573\"", ")", ";", "add", "(", "\"4621735\"", ")", ";", "add", "(", "\"4621753\"", ")", ";", "add", "(", "\"4623157\"", ")", ";", "add", "(", "\"4623175\"", ")", ";", "add", "(", "\"4623517\"", ")", ";", "add", "(", "\"4623571\"", ")", ";", "add", "(", "\"4623715\"", ")", ";", "add", "(", "\"4623751\"", ")", ";", "add", "(", "\"4625137\"", ")", ";", "add", "(", "\"4625173\"", ")", ";", "add", "(", "\"4625713\"", ")", ";", "add", "(", "\"4627135\"", ")", ";", "add", "(", "\"4627153\"", ")", ";", "add", "(", "\"4627315\"", ")", ";", "add", "(", "\"4627351\"", ")", ";", "add", "(", "\"4627513\"", ")", ";", "add", "(", "\"4631257\"", ")", ";", "add", "(", "\"4631275\"", ")", ";", "add", "(", "\"4631527\"", ")", ";", "add", "(", "\"4631572\"", ")", ";", "add", "(", "\"4631725\"", ")", ";", "add", "(", "\"4631752\"", ")", ";", "add", "(", "\"4635127\"", ")", ";", "add", "(", "\"4635172\"", ")", ";", "add", "(", "\"4635712\"", ")", ";", "add", "(", "\"4637125\"", ")", ";", "add", "(", "\"4637152\"", ")", ";", "add", "(", "\"4637512\"", ")", ";", "add", "(", "\"4651237\"", ")", ";", "add", "(", "\"4651273\"", ")", ";", "add", "(", "\"4651723\"", ")", ";", "add", "(", "\"4657123\"", ")", ";", "add", "(", "\"4671235\"", ")", ";", "add", "(", "\"4671253\"", ")", ";", "add", "(", "\"4671325\"", ")", ";", "add", "(", "\"4671352\"", ")", ";", "add", "(", "\"4671523\"", ")", ";", "add", "(", "\"4672135\"", ")", ";", "add", "(", "\"4672153\"", ")", ";", "add", "(", "\"4672315\"", ")", ";", "add", "(", "\"4672351\"", ")", ";", "add", "(", "\"4672513\"", ")", ";", "add", "(", "\"4673125\"", ")", ";", "add", "(", "\"4673152\"", ")", ";", "add", "(", "\"4673512\"", ")", ";", "add", "(", "\"4675123\"", ")", ";", "add", "(", "\"4712356\"", ")", ";", "add", "(", "\"4712365\"", ")", ";", "add", "(", "\"4712536\"", ")", ";", "add", "(", "\"4712563\"", ")", ";", "add", "(", "\"4712635\"", ")", ";", "add", "(", "\"4713256\"", ")", ";", "add", "(", "\"4713265\"", ")", ";", "add", "(", "\"4713526\"", ")", ";", "add", "(", "\"4713562\"", ")", ";", "add", "(", "\"4713625\"", ")", ";", "add", "(", "\"4715236\"", ")", ";", "add", "(", "\"4715263\"", ")", ";", "add", "(", "\"4715623\"", ")", ";", "add", "(", "\"4716235\"", ")", ";", "add", "(", "\"4721356\"", ")", ";", "add", "(", "\"4721365\"", ")", ";", "add", "(", "\"4721536\"", ")", ";", "add", "(", "\"4721563\"", ")", ";", "add", "(", "\"4721635\"", ")", ";", "add", "(", "\"4721653\"", ")", ";", "add", "(", "\"4723156\"", ")", ";", "add", "(", "\"4723165\"", ")", ";", "add", "(", "\"4723516\"", ")", ";", "add", "(", "\"4723561\"", ")", ";", "add", "(", "\"4723615\"", ")", ";", "add", "(", "\"4725136\"", ")", ";", "add", "(", "\"4725163\"", ")", ";", "add", "(", "\"4725613\"", ")", ";", "add", "(", "\"4726135\"", ")", ";", "add", "(", "\"4726153\"", ")", ";", "add", "(", "\"4726315\"", ")", ";", "add", "(", "\"4726513\"", ")", ";", "add", "(", "\"4731256\"", ")", ";", "add", "(", "\"4731265\"", ")", ";", "add", "(", "\"4731526\"", ")", ";", "add", "(", "\"4731562\"", ")", ";", "add", "(", "\"4731625\"", ")", ";", "add", "(", "\"4731652\"", ")", ";", "add", "(", "\"4732165\"", ")", ";", "add", "(", "\"4732615\"", ")", ";", "add", "(", "\"4732651\"", ")", ";", "add", "(", "\"4735126\"", ")", ";", "add", "(", "\"4735162\"", ")", ";", "add", "(", "\"4735612\"", ")", ";", "add", "(", "\"4736125\"", ")", ";", "add", "(", "\"4736152\"", ")", ";", "add", "(", "\"4736215\"", ")", ";", "add", "(", "\"4736251\"", ")", ";", "add", "(", "\"4736512\"", ")", ";", "add", "(", "\"4751236\"", ")", ";", "add", "(", "\"4751263\"", ")", ";", "add", "(", "\"4751623\"", ")", ";", "add", "(", "\"4752163\"", ")", ";", "add", "(", "\"4752613\"", ")", ";", "add", "(", "\"4753162\"", ")", ";", "add", "(", "\"4753612\"", ")", ";", "add", "(", "\"4756123\"", ")", ";", "add", "(", "\"4761235\"", ")", ";", "add", "(", "\"4762153\"", ")", ";", "add", "(", "\"4762513\"", ")", ";", "add", "(", "\"4763152\"", ")", ";", "add", "(", "\"4763512\"", ")", ";", "add", "(", "\"5123467\"", ")", ";", "add", "(", "\"5123476\"", ")", ";", "add", "(", "\"5123647\"", ")", ";", "add", "(", "\"5123674\"", ")", ";", "add", "(", "\"5123746\"", ")", ";", "add", "(", "\"5123764\"", ")", ";", "add", "(", "\"5124376\"", ")", ";", "add", "(", "\"5124637\"", ")", ";", "add", "(", "\"5124673\"", ")", ";", "add", "(", "\"5124736\"", ")", ";", "add", "(", "\"5124763\"", ")", ";", "add", "(", "\"5126347\"", ")", ";", "add", "(", "\"5126374\"", ")", ";", "add", "(", "\"5126437\"", ")", ";", "add", "(", "\"5126473\"", ")", ";", "add", "(", "\"5126734\"", ")", ";", "add", "(", "\"5126743\"", ")", ";", "add", "(", "\"5127346\"", ")", ";", "add", "(", "\"5127364\"", ")", ";", "add", "(", "\"5127436\"", ")", ";", "add", "(", "\"5127463\"", ")", ";", "add", "(", "\"5127634\"", ")", ";", "add", "(", "\"5132476\"", ")", ";", "add", "(", "\"5132647\"", ")", ";", "add", "(", "\"5132674\"", ")", ";", "add", "(", "\"5132746\"", ")", ";", "add", "(", "\"5132764\"", ")", ";", "add", "(", "\"5134276\"", ")", ";", "add", "(", "\"5134726\"", ")", ";", "add", "(", "\"5134762\"", ")", ";", "add", "(", "\"5136247\"", ")", ";", "add", "(", "\"5136274\"", ")", ";", "add", "(", "\"5136427\"", ")", ";", "add", "(", "\"5136472\"", ")", ";", "add", "(", "\"5136724\"", ")", ";", "add", "(", "\"5136742\"", ")", ";", "add", "(", "\"5137246\"", ")", ";", "add", "(", "\"5137264\"", ")", ";", "add", "(", "\"5137426\"", ")", ";", "add", "(", "\"5137462\"", ")", ";", "add", "(", "\"5137624\"", ")", ";", "add", "(", "\"5142376\"", ")", ";", "add", "(", "\"5142637\"", ")", ";", "add", "(", "\"5142673\"", ")", ";", "add", "(", "\"5142736\"", ")", ";", "add", "(", "\"5142763\"", ")", ";", "add", "(", "\"5146237\"", ")", ";", "add", "(", "\"5146273\"", ")", ";", "add", "(", "\"5146723\"", ")", ";", "add", "(", "\"5147236\"", ")", ";", "add", "(", "\"5147263\"", ")", ";", "add", "(", "\"5147623\"", ")", ";", "add", "(", "\"5162347\"", ")", ";", "add", "(", "\"5162374\"", ")", ";", "add", "(", "\"5162437\"", ")", ";", "add", "(", "\"5162473\"", ")", ";", "add", "(", "\"5162734\"", ")", ";", "add", "(", "\"5162743\"", ")", ";", "add", "(", "\"5163247\"", ")", ";", "add", "(", "\"5163274\"", ")", ";", "add", "(", "\"5163427\"", ")", ";", "add", "(", "\"5163472\"", ")", ";", "add", "(", "\"5163724\"", ")", ";", "add", "(", "\"5163742\"", ")", ";", "add", "(", "\"5164237\"", ")", ";", "add", "(", "\"5164273\"", ")", ";", "add", "(", "\"5164723\"", ")", ";", "add", "(", "\"5167234\"", ")", ";", "add", "(", "\"5167243\"", ")", ";", "add", "(", "\"5167324\"", ")", ";", "add", "(", "\"5167342\"", ")", ";", "add", "(", "\"5167423\"", ")", ";", "add", "(", "\"5172346\"", ")", ";", "add", "(", "\"5172364\"", ")", ";", "add", "(", "\"5172436\"", ")", ";", "add", "(", "\"5172463\"", ")", ";", "add", "(", "\"5172634\"", ")", ";", "add", "(", "\"5173246\"", ")", ";", "add", "(", "\"5173264\"", ")", ";", "add", "(", "\"5173426\"", ")", ";", "add", "(", "\"5173462\"", ")", ";", "add", "(", "\"5173624\"", ")", ";", "add", "(", "\"5174236\"", ")", ";", "add", "(", "\"5174263\"", ")", ";", "add", "(", "\"5174623\"", ")", ";", "add", "(", "\"5176234\"", ")", ";", "add", "(", "\"5213476\"", ")", ";", "add", "(", "\"5213647\"", ")", ";", "add", "(", "\"5213674\"", ")", ";", "add", "(", "\"5213746\"", ")", ";", "add", "(", "\"5213764\"", ")", ";", "add", "(", "\"5214367\"", ")", ";", "add", "(", "\"5214376\"", ")", ";", "add", "(", "\"5214637\"", ")", ";", "add", "(", "\"5214673\"", ")", ";", "add", "(", "\"5214736\"", ")", ";", "add", "(", "\"5214763\"", ")", ";", "add", "(", "\"5216347\"", ")", ";", "add", "(", "\"5216374\"", ")", ";", "add", "(", "\"5216437\"", ")", ";", "add", "(", "\"5216473\"", ")", ";", "add", "(", "\"5216734\"", ")", ";", "add", "(", "\"5216743\"", ")", ";", "add", "(", "\"5217346\"", ")", ";", "add", "(", "\"5217364\"", ")", ";", "add", "(", "\"5217436\"", ")", ";", "add", "(", "\"5217463\"", ")", ";", "add", "(", "\"5217634\"", ")", ";", "add", "(", "\"5217643\"", ")", ";", "add", "(", "\"5231476\"", ")", ";", "add", "(", "\"5231647\"", ")", ";", "add", "(", "\"5231674\"", ")", ";", "add", "(", "\"5231746\"", ")", ";", "add", "(", "\"5231764\"", ")", ";", "add", "(", "\"5234176\"", ")", ";", "add", "(", "\"5234716\"", ")", ";", "add", "(", "\"5234761\"", ")", ";", "add", "(", "\"5236147\"", ")", ";", "add", "(", "\"5236174\"", ")", ";", "add", "(", "\"5236417\"", ")", ";", "add", "(", "\"5236471\"", ")", ";", "add", "(", "\"5236714\"", ")", ";", "add", "(", "\"5236741\"", ")", ";", "add", "(", "\"5237146\"", ")", ";", "add", "(", "\"5237164\"", ")", ";", "add", "(", "\"5237416\"", ")", ";", "add", "(", "\"5237461\"", ")", ";", "add", "(", "\"5237614\"", ")", ";", "add", "(", "\"5241367\"", ")", ";", "add", "(", "\"5241376\"", ")", ";", "add", "(", "\"5241637\"", ")", ";", "add", "(", "\"5241673\"", ")", ";", "add", "(", "\"5241736\"", ")", ";", "add", "(", "\"5241763\"", ")", ";", "add", "(", "\"5246137\"", ")", ";", "add", "(", "\"5246173\"", ")", ";", "add", "(", "\"5246713\"", ")", ";", "add", "(", "\"5247136\"", ")", ";", "add", "(", "\"5247163\"", ")", ";", "add", "(", "\"5247613\"", ")", ";", "add", "(", "\"5261347\"", ")", ";", "add", "(", "\"5261374\"", ")", ";", "add", "(", "\"5261437\"", ")", ";", "add", "(", "\"5261473\"", ")", ";", "add", "(", "\"5261734\"", ")", ";", "add", "(", "\"5261743\"", ")", ";", "add", "(", "\"5263147\"", ")", ";", "add", "(", "\"5263174\"", ")", ";", "add", "(", "\"5263417\"", ")", ";", "add", "(", "\"5263471\"", ")", ";", "add", "(", "\"5263714\"", ")", ";", "add", "(", "\"5263741\"", ")", ";", "add", "(", "\"5264137\"", ")", ";", "add", "(", "\"5264173\"", ")", ";", "add", "(", "\"5264713\"", ")", ";", "add", "(", "\"5267134\"", ")", ";", "add", "(", "\"5267143\"", ")", ";", "add", "(", "\"5267314\"", ")", ";", "add", "(", "\"5267341\"", ")", ";", "add", "(", "\"5267413\"", ")", ";", "add", "(", "\"5271346\"", ")", ";", "add", "(", "\"5271364\"", ")", ";", "add", "(", "\"5271436\"", ")", ";", "add", "(", "\"5271463\"", ")", ";", "add", "(", "\"5271634\"", ")", ";", "add", "(", "\"5271643\"", ")", ";", "add", "(", "\"5273146\"", ")", ";", "add", "(", "\"5273164\"", ")", ";", "add", "(", "\"5273416\"", ")", ";", "add", "(", "\"5273461\"", ")", ";", "add", "(", "\"5273614\"", ")", ";", "add", "(", "\"5274136\"", ")", ";", "add", "(", "\"5274163\"", ")", ";", "add", "(", "\"5274613\"", ")", ";", "add", "(", "\"5276134\"", ")", ";", "add", "(", "\"5276143\"", ")", ";", "add", "(", "\"5276314\"", ")", ";", "add", "(", "\"5276413\"", ")", ";", "add", "(", "\"5312476\"", ")", ";", "add", "(", "\"5312647\"", ")", ";", "add", "(", "\"5312674\"", ")", ";", "add", "(", "\"5312746\"", ")", ";", "add", "(", "\"5312764\"", ")", ";", "add", "(", "\"5314267\"", ")", ";", "add", "(", "\"5314276\"", ")", ";", "add", "(", "\"5314627\"", ")", ";", "add", "(", "\"5314672\"", ")", ";", "add", "(", "\"5314726\"", ")", ";", "add", "(", "\"5314762\"", ")", ";", "add", "(", "\"5316247\"", ")", ";", "add", "(", "\"5316274\"", ")", ";", "add", "(", "\"5316427\"", ")", ";", "add", "(", "\"5316472\"", ")", ";", "add", "(", "\"5316724\"", ")", ";", "add", "(", "\"5316742\"", ")", ";", "add", "(", "\"5317246\"", ")", ";", "add", "(", "\"5317264\"", ")", ";", "add", "(", "\"5317426\"", ")", ";", "add", "(", "\"5317462\"", ")", ";", "add", "(", "\"5317624\"", ")", ";", "add", "(", "\"5317642\"", ")", ";", "add", "(", "\"5321764\"", ")", ";", "add", "(", "\"5327164\"", ")", ";", "add", "(", "\"5327614\"", ")", ";", "add", "(", "\"5327641\"", ")", ";", "add", "(", "\"5341267\"", ")", ";", "add", "(", "\"5341276\"", ")", ";", "add", "(", "\"5341627\"", ")", ";", "add", "(", "\"5341672\"", ")", ";", "add", "(", "\"5341726\"", ")", ";", "add", "(", "\"5341762\"", ")", ";", "add", "(", "\"5346127\"", ")", ";", "add", "(", "\"5346172\"", ")", ";", "add", "(", "\"5346712\"", ")", ";", "add", "(", "\"5347126\"", ")", ";", "add", "(", "\"5347162\"", ")", ";", "add", "(", "\"5347612\"", ")", ";", "add", "(", "\"5361247\"", ")", ";", "add", "(", "\"5361274\"", ")", ";", "add", "(", "\"5361427\"", ")", ";", "add", "(", "\"5361472\"", ")", ";", "add", "(", "\"5361724\"", ")", ";", "add", "(", "\"5361742\"", ")", ";", "add", "(", "\"5364127\"", ")", ";", "add", "(", "\"5364172\"", ")", ";", "add", "(", "\"5364712\"", ")", ";", "add", "(", "\"5367124\"", ")", ";", "add", "(", "\"5367142\"", ")", ";", "add", "(", "\"5367412\"", ")", ";", "add", "(", "\"5371246\"", ")", ";", "add", "(", "\"5371264\"", ")", ";", "add", "(", "\"5371426\"", ")", ";", "add", "(", "\"5371462\"", ")", ";", "add", "(", "\"5371624\"", ")", ";", "add", "(", "\"5371642\"", ")", ";", "add", "(", "\"5372164\"", ")", ";", "add", "(", "\"5372614\"", ")", ";", "add", "(", "\"5372641\"", ")", ";", "add", "(", "\"5374126\"", ")", ";", "add", "(", "\"5374162\"", ")", ";", "add", "(", "\"5374612\"", ")", ";", "add", "(", "\"5376124\"", ")", ";", "add", "(", "\"5376142\"", ")", ";", "add", "(", "\"5376214\"", ")", ";", "add", "(", "\"5376241\"", ")", ";", "add", "(", "\"5376412\"", ")", ";", "add", "(", "\"5412376\"", ")", ";", "add", "(", "\"5412637\"", ")", ";", "add", "(", "\"5412673\"", ")", ";", "add", "(", "\"5412736\"", ")", ";", "add", "(", "\"5412763\"", ")", ";", "add", "(", "\"5413762\"", ")", ";", "add", "(", "\"5416237\"", ")", ";", "add", "(", "\"5416273\"", ")", ";", "add", "(", "\"5416723\"", ")", ";", "add", "(", "\"5417236\"", ")", ";", "add", "(", "\"5417263\"", ")", ";", "add", "(", "\"5417362\"", ")", ";", "add", "(", "\"5417623\"", ")", ";", "add", "(", "\"5417632\"", ")", ";", "add", "(", "\"5421763\"", ")", ";", "add", "(", "\"5427163\"", ")", ";", "add", "(", "\"5427613\"", ")", ";", "add", "(", "\"5427631\"", ")", ";", "add", "(", "\"5431762\"", ")", ";", "add", "(", "\"5437162\"", ")", ";", "add", "(", "\"5437612\"", ")", ";", "add", "(", "\"5461237\"", ")", ";", "add", "(", "\"5461273\"", ")", ";", "add", "(", "\"5461723\"", ")", ";", "add", "(", "\"5467123\"", ")", ";", "add", "(", "\"5471236\"", ")", ";", "add", "(", "\"5471263\"", ")", ";", "add", "(", "\"5471362\"", ")", ";", "add", "(", "\"5471623\"", ")", ";", "add", "(", "\"5471632\"", ")", ";", "add", "(", "\"5472163\"", ")", ";", "add", "(", "\"5472613\"", ")", ";", "add", "(", "\"5472631\"", ")", ";", "add", "(", "\"5473162\"", ")", ";", "add", "(", "\"5473612\"", ")", ";", "add", "(", "\"5476123\"", ")", ";", "add", "(", "\"5476132\"", ")", ";", "add", "(", "\"5476213\"", ")", ";", "add", "(", "\"5476231\"", ")", ";", "add", "(", "\"5476312\"", ")", ";", "add", "(", "\"5612347\"", ")", ";", "add", "(", "\"5612374\"", ")", ";", "add", "(", "\"5612437\"", ")", ";", "add", "(", "\"5612473\"", ")", ";", "add", "(", "\"5612734\"", ")", ";", "add", "(", "\"5612743\"", ")", ";", "add", "(", "\"5613247\"", ")", ";", "add", "(", "\"5613274\"", ")", ";", "add", "(", "\"5613427\"", ")", ";", "add", "(", "\"5613472\"", ")", ";", "add", "(", "\"5613724\"", ")", ";", "add", "(", "\"5613742\"", ")", ";", "add", "(", "\"5614237\"", ")", ";", "add", "(", "\"5614273\"", ")", ";", "add", "(", "\"5614723\"", ")", ";", "add", "(", "\"5617234\"", ")", ";", "add", "(", "\"5617243\"", ")", ";", "add", "(", "\"5617324\"", ")", ";", "add", "(", "\"5617342\"", ")", ";", "add", "(", "\"5617423\"", ")", ";", "add", "(", "\"5621347\"", ")", ";", "add", "(", "\"5621374\"", ")", ";", "add", "(", "\"5621437\"", ")", ";", "add", "(", "\"5621473\"", ")", ";", "add", "(", "\"5621734\"", ")", ";", "add", "(", "\"5621743\"", ")", ";", "add", "(", "\"5623147\"", ")", ";", "add", "(", "\"5623174\"", ")", ";", "add", "(", "\"5623417\"", ")", ";", "add", "(", "\"5623471\"", ")", ";", "add", "(", "\"5623714\"", ")", ";", "add", "(", "\"5623741\"", ")", ";", "add", "(", "\"5624137\"", ")", ";", "add", "(", "\"5624173\"", ")", ";", "add", "(", "\"5624713\"", ")", ";", "add", "(", "\"5627134\"", ")", ";", "add", "(", "\"5627143\"", ")", ";", "add", "(", "\"5627314\"", ")", ";", "add", "(", "\"5627341\"", ")", ";", "add", "(", "\"5627413\"", ")", ";", "add", "(", "\"5631247\"", ")", ";", "add", "(", "\"5631274\"", ")", ";", "add", "(", "\"5631427\"", ")", ";", "add", "(", "\"5631472\"", ")", ";", "add", "(", "\"5631724\"", ")", ";", "add", "(", "\"5631742\"", ")", ";", "add", "(", "\"5634127\"", ")", ";", "add", "(", "\"5634172\"", ")", ";", "add", "(", "\"5634712\"", ")", ";", "add", "(", "\"5637124\"", ")", ";", "add", "(", "\"5637142\"", ")", ";", "add", "(", "\"5637412\"", ")", ";", "add", "(", "\"5641237\"", ")", ";", "add", "(", "\"5641273\"", ")", ";", "add", "(", "\"5641723\"", ")", ";", "add", "(", "\"5647123\"", ")", ";", "add", "(", "\"5671234\"", ")", ";", "add", "(", "\"5671243\"", ")", ";", "add", "(", "\"5671324\"", ")", ";", "add", "(", "\"5671342\"", ")", ";", "add", "(", "\"5671423\"", ")", ";", "add", "(", "\"5672134\"", ")", ";", "add", "(", "\"5672143\"", ")", ";", "add", "(", "\"5672314\"", ")", ";", "add", "(", "\"5672341\"", ")", ";", "add", "(", "\"5672413\"", ")", ";", "add", "(", "\"5673124\"", ")", ";", "add", "(", "\"5673142\"", ")", ";", "add", "(", "\"5673412\"", ")", ";", "add", "(", "\"5674123\"", ")", ";", "add", "(", "\"5712346\"", ")", ";", "add", "(", "\"5712364\"", ")", ";", "add", "(", "\"5712436\"", ")", ";", "add", "(", "\"5712463\"", ")", ";", "add", "(", "\"5712634\"", ")", ";", "add", "(", "\"5713246\"", ")", ";", "add", "(", "\"5713264\"", ")", ";", "add", "(", "\"5713426\"", ")", ";", "add", "(", "\"5713462\"", ")", ";", "add", "(", "\"5713624\"", ")", ";", "add", "(", "\"5714236\"", ")", ";", "add", "(", "\"5714263\"", ")", ";", "add", "(", "\"5714623\"", ")", ";", "add", "(", "\"5716234\"", ")", ";", "add", "(", "\"5721346\"", ")", ";", "add", "(", "\"5721364\"", ")", ";", "add", "(", "\"5721436\"", ")", ";", "add", "(", "\"5721463\"", ")", ";", "add", "(", "\"5721634\"", ")", ";", "add", "(", "\"5721643\"", ")", ";", "add", "(", "\"5723146\"", ")", ";", "add", "(", "\"5723164\"", ")", ";", "add", "(", "\"5723416\"", ")", ";", "add", "(", "\"5723461\"", ")", ";", "add", "(", "\"5723614\"", ")", ";", "add", "(", "\"5724136\"", ")", ";", "add", "(", "\"5724163\"", ")", ";", "add", "(", "\"5724613\"", ")", ";", "add", "(", "\"5726134\"", ")", ";", "add", "(", "\"5726143\"", ")", ";", "add", "(", "\"5726314\"", ")", ";", "add", "(", "\"5726413\"", ")", ";", "add", "(", "\"5731246\"", ")", ";", "add", "(", "\"5731264\"", ")", ";", "add", "(", "\"5731426\"", ")", ";", "add", "(", "\"5731462\"", ")", ";", "add", "(", "\"5731624\"", ")", ";", "add", "(", "\"5731642\"", ")", ";", "add", "(", "\"5732164\"", ")", ";", "add", "(", "\"5732614\"", ")", ";", "add", "(", "\"5732641\"", ")", ";", "add", "(", "\"5734126\"", ")", ";", "add", "(", "\"5734162\"", ")", ";", "add", "(", "\"5734612\"", ")", ";", "add", "(", "\"5736124\"", ")", ";", "add", "(", "\"5736142\"", ")", ";", "add", "(", "\"5736214\"", ")", ";", "add", "(", "\"5736241\"", ")", ";", "add", "(", "\"5736412\"", ")", ";", "add", "(", "\"5741236\"", ")", ";", "add", "(", "\"5741263\"", ")", ";", "add", "(", "\"5741362\"", ")", ";", "add", "(", "\"5741623\"", ")", ";", "add", "(", "\"5741632\"", ")", ";", "add", "(", "\"5742163\"", ")", ";", "add", "(", "\"5742613\"", ")", ";", "add", "(", "\"5742631\"", ")", ";", "add", "(", "\"5743162\"", ")", ";", "add", "(", "\"5743612\"", ")", ";", "add", "(", "\"5746123\"", ")", ";", "add", "(", "\"5746132\"", ")", ";", "add", "(", "\"5746213\"", ")", ";", "add", "(", "\"5746231\"", ")", ";", "add", "(", "\"5746312\"", ")", ";", "add", "(", "\"5761234\"", ")", ";", "add", "(", "\"5762143\"", ")", ";", "add", "(", "\"5762413\"", ")", ";", "add", "(", "\"5763142\"", ")", ";", "add", "(", "\"5763412\"", ")", ";", "add", "(", "\"6123457\"", ")", ";", "add", "(", "\"6123475\"", ")", ";", "add", "(", "\"6123574\"", ")", ";", "add", "(", "\"6123745\"", ")", ";", "add", "(", "\"6123754\"", ")", ";", "add", "(", "\"6124375\"", ")", ";", "add", "(", "\"6124735\"", ")", ";", "add", "(", "\"6124753\"", ")", ";", "add", "(", "\"6125374\"", ")", ";", "add", "(", "\"6125734\"", ")", ";", "add", "(", "\"6127345\"", ")", ";", "add", "(", "\"6127354\"", ")", ";", "add", "(", "\"6127435\"", ")", ";", "add", "(", "\"6127453\"", ")", ";", "add", "(", "\"6127534\"", ")", ";", "add", "(", "\"6132475\"", ")", ";", "add", "(", "\"6132547\"", ")", ";", "add", "(", "\"6132574\"", ")", ";", "add", "(", "\"6132745\"", ")", ";", "add", "(", "\"6132754\"", ")", ";", "add", "(", "\"6134275\"", ")", ";", "add", "(", "\"6134725\"", ")", ";", "add", "(", "\"6134752\"", ")", ";", "add", "(", "\"6135247\"", ")", ";", "add", "(", "\"6135274\"", ")", ";", "add", "(", "\"6135724\"", ")", ";", "add", "(", "\"6137245\"", ")", ";", "add", "(", "\"6137254\"", ")", ";", "add", "(", "\"6137425\"", ")", ";", "add", "(", "\"6137452\"", ")", ";", "add", "(", "\"6137524\"", ")", ";", "add", "(", "\"6142375\"", ")", ";", "add", "(", "\"6142537\"", ")", ";", "add", "(", "\"6142573\"", ")", ";", "add", "(", "\"6142735\"", ")", ";", "add", "(", "\"6142753\"", ")", ";", "add", "(", "\"6145237\"", ")", ";", "add", "(", "\"6145273\"", ")", ";", "add", "(", "\"6145723\"", ")", ";", "add", "(", "\"6147235\"", ")", ";", "add", "(", "\"6147253\"", ")", ";", "add", "(", "\"6147523\"", ")", ";", "add", "(", "\"6152374\"", ")", ";", "add", "(", "\"6152734\"", ")", ";", "add", "(", "\"6157234\"", ")", ";", "add", "(", "\"6172345\"", ")", ";", "add", "(", "\"6172354\"", ")", ";", "add", "(", "\"6172435\"", ")", ";", "add", "(", "\"6172453\"", ")", ";", "add", "(", "\"6172534\"", ")", ";", "add", "(", "\"6173245\"", ")", ";", "add", "(", "\"6173254\"", ")", ";", "add", "(", "\"6173425\"", ")", ";", "add", "(", "\"6173452\"", ")", ";", "add", "(", "\"6173524\"", ")", ";", "add", "(", "\"6174235\"", ")", ";", "add", "(", "\"6174253\"", ")", ";", "add", "(", "\"6174523\"", ")", ";", "add", "(", "\"6175234\"", ")", ";", "add", "(", "\"6213475\"", ")", ";", "add", "(", "\"6213547\"", ")", ";", "add", "(", "\"6213574\"", ")", ";", "add", "(", "\"6213745\"", ")", ";", "add", "(", "\"6213754\"", ")", ";", "add", "(", "\"6214357\"", ")", ";", "add", "(", "\"6214375\"", ")", ";", "add", "(", "\"6214537\"", ")", ";", "add", "(", "\"6214573\"", ")", ";", "add", "(", "\"6214735\"", ")", ";", "add", "(", "\"6214753\"", ")", ";", "add", "(", "\"6215347\"", ")", ";", "add", "(", "\"6215374\"", ")", ";", "add", "(", "\"6215734\"", ")", ";", "add", "(", "\"6215743\"", ")", ";", "add", "(", "\"6217345\"", ")", ";", "add", "(", "\"6217354\"", ")", ";", "add", "(", "\"6217435\"", ")", ";", "add", "(", "\"6217453\"", ")", ";", "add", "(", "\"6217534\"", ")", ";", "add", "(", "\"6217543\"", ")", ";", "add", "(", "\"6231475\"", ")", ";", "add", "(", "\"6231547\"", ")", ";", "add", "(", "\"6231574\"", ")", ";", "add", "(", "\"6231745\"", ")", ";", "add", "(", "\"6231754\"", ")", ";", "add", "(", "\"6234175\"", ")", ";", "add", "(", "\"6234715\"", ")", ";", "add", "(", "\"6234751\"", ")", ";", "add", "(", "\"6235147\"", ")", ";", "add", "(", "\"6235174\"", ")", ";", "add", "(", "\"6235714\"", ")", ";", "add", "(", "\"6237145\"", ")", ";", "add", "(", "\"6237154\"", ")", ";", "add", "(", "\"6237415\"", ")", ";", "add", "(", "\"6237451\"", ")", ";", "add", "(", "\"6237514\"", ")", ";", "add", "(", "\"6241357\"", ")", ";", "add", "(", "\"6241375\"", ")", ";", "add", "(", "\"6241537\"", ")", ";", "add", "(", "\"6241573\"", ")", ";", "add", "(", "\"6241735\"", ")", ";", "add", "(", "\"6241753\"", ")", ";", "add", "(", "\"6245137\"", ")", ";", "add", "(", "\"6245173\"", ")", ";", "add", "(", "\"6245713\"", ")", ";", "add", "(", "\"6247135\"", ")", ";", "add", "(", "\"6247153\"", ")", ";", "add", "(", "\"6247513\"", ")", ";", "add", "(", "\"6251347\"", ")", ";", "add", "(", "\"6251374\"", ")", ";", "add", "(", "\"6251734\"", ")", ";", "add", "(", "\"6251743\"", ")", ";", "add", "(", "\"6257134\"", ")", ";", "add", "(", "\"6257143\"", ")", ";", "add", "(", "\"6257413\"", ")", ";", "add", "(", "\"6271345\"", ")", ";", "add", "(", "\"6271354\"", ")", ";", "add", "(", "\"6271435\"", ")", ";", "add", "(", "\"6271453\"", ")", ";", "add", "(", "\"6271534\"", ")", ";", "add", "(", "\"6271543\"", ")", ";", "add", "(", "\"6273145\"", ")", ";", "add", "(", "\"6273154\"", ")", ";", "add", "(", "\"6273415\"", ")", ";", "add", "(", "\"6273451\"", ")", ";", "add", "(", "\"6273514\"", ")", ";", "add", "(", "\"6274135\"", ")", ";", "add", "(", "\"6274153\"", ")", ";", "add", "(", "\"6274513\"", ")", ";", "add", "(", "\"6275134\"", ")", ";", "add", "(", "\"6275143\"", ")", ";", "add", "(", "\"6275314\"", ")", ";", "add", "(", "\"6275413\"", ")", ";", "add", "(", "\"6312475\"", ")", ";", "add", "(", "\"6312547\"", ")", ";", "add", "(", "\"6312574\"", ")", ";", "add", "(", "\"6312745\"", ")", ";", "add", "(", "\"6312754\"", ")", ";", "add", "(", "\"6314257\"", ")", ";", "add", "(", "\"6314275\"", ")", ";", "add", "(", "\"6314527\"", ")", ";", "add", "(", "\"6314572\"", ")", ";", "add", "(", "\"6314725\"", ")", ";", "add", "(", "\"6314752\"", ")", ";", "add", "(", "\"6315247\"", ")", ";", "add", "(", "\"6315274\"", ")", ";", "add", "(", "\"6315724\"", ")", ";", "add", "(", "\"6315742\"", ")", ";", "add", "(", "\"6317245\"", ")", ";", "add", "(", "\"6317254\"", ")", ";", "add", "(", "\"6317425\"", ")", ";", "add", "(", "\"6317452\"", ")", ";", "add", "(", "\"6317524\"", ")", ";", "add", "(", "\"6317542\"", ")", ";", "add", "(", "\"6321754\"", ")", ";", "add", "(", "\"6327154\"", ")", ";", "add", "(", "\"6327514\"", ")", ";", "add", "(", "\"6327541\"", ")", ";", "add", "(", "\"6341257\"", ")", ";", "add", "(", "\"6341275\"", ")", ";", "add", "(", "\"6341527\"", ")", ";", "add", "(", "\"6341572\"", ")", ";", "add", "(", "\"6341725\"", ")", ";", "add", "(", "\"6341752\"", ")", ";", "add", "(", "\"6345127\"", ")", ";", "add", "(", "\"6345172\"", ")", ";", "add", "(", "\"6345712\"", ")", ";", "add", "(", "\"6347125\"", ")", ";", "add", "(", "\"6347152\"", ")", ";", "add", "(", "\"6347512\"", ")", ";", "add", "(", "\"6351247\"", ")", ";", "add", "(", "\"6351274\"", ")", ";", "add", "(", "\"6351724\"", ")", ";", "add", "(", "\"6351742\"", ")", ";", "add", "(", "\"6357124\"", ")", ";", "add", "(", "\"6357142\"", ")", ";", "add", "(", "\"6357412\"", ")", ";", "add", "(", "\"6371245\"", ")", ";", "add", "(", "\"6371254\"", ")", ";", "add", "(", "\"6371425\"", ")", ";", "add", "(", "\"6371452\"", ")", ";", "add", "(", "\"6371524\"", ")", ";", "add", "(", "\"6371542\"", ")", ";", "add", "(", "\"6372154\"", ")", ";", "add", "(", "\"6372514\"", ")", ";", "add", "(", "\"6372541\"", ")", ";", "add", "(", "\"6374125\"", ")", ";", "add", "(", "\"6374152\"", ")", ";", "add", "(", "\"6374512\"", ")", ";", "add", "(", "\"6375124\"", ")", ";", "add", "(", "\"6375142\"", ")", ";", "add", "(", "\"6375214\"", ")", ";", "add", "(", "\"6375241\"", ")", ";", "add", "(", "\"6375412\"", ")", ";", "add", "(", "\"6412375\"", ")", ";", "add", "(", "\"6412537\"", ")", ";", "add", "(", "\"6412573\"", ")", ";", "add", "(", "\"6412735\"", ")", ";", "add", "(", "\"6412753\"", ")", ";", "add", "(", "\"6413752\"", ")", ";", "add", "(", "\"6415237\"", ")", ";", "add", "(", "\"6415273\"", ")", ";", "add", "(", "\"6415723\"", ")", ";", "add", "(", "\"6417235\"", ")", ";", "add", "(", "\"6417253\"", ")", ";", "add", "(", "\"6417352\"", ")", ";", "add", "(", "\"6417523\"", ")", ";", "add", "(", "\"6417532\"", ")", ";", "add", "(", "\"6421753\"", ")", ";", "add", "(", "\"6427153\"", ")", ";", "add", "(", "\"6427513\"", ")", ";", "add", "(", "\"6427531\"", ")", ";", "add", "(", "\"6431752\"", ")", ";", "add", "(", "\"6437152\"", ")", ";", "add", "(", "\"6437512\"", ")", ";", "add", "(", "\"6451237\"", ")", ";", "add", "(", "\"6451273\"", ")", ";", "add", "(", "\"6451723\"", ")", ";", "add", "(", "\"6457123\"", ")", ";", "add", "(", "\"6471235\"", ")", ";", "add", "(", "\"6471253\"", ")", ";", "add", "(", "\"6471352\"", ")", ";", "add", "(", "\"6471523\"", ")", ";", "add", "(", "\"6471532\"", ")", ";", "add", "(", "\"6472153\"", ")", ";", "add", "(", "\"6472513\"", ")", ";", "add", "(", "\"6472531\"", ")", ";", "add", "(", "\"6473152\"", ")", ";", "add", "(", "\"6473512\"", ")", ";", "add", "(", "\"6475123\"", ")", ";", "add", "(", "\"6475132\"", ")", ";", "add", "(", "\"6475213\"", ")", ";", "add", "(", "\"6475231\"", ")", ";", "add", "(", "\"6475312\"", ")", ";", "add", "(", "\"6512374\"", ")", ";", "add", "(", "\"6512734\"", ")", ";", "add", "(", "\"6517234\"", ")", ";", "add", "(", "\"6521743\"", ")", ";", "add", "(", "\"6527143\"", ")", ";", "add", "(", "\"6527413\"", ")", ";", "add", "(", "\"6531742\"", ")", ";", "add", "(", "\"6537142\"", ")", ";", "add", "(", "\"6537412\"", ")", ";", "add", "(", "\"6571234\"", ")", ";", "add", "(", "\"6572143\"", ")", ";", "add", "(", "\"6572413\"", ")", ";", "add", "(", "\"6573142\"", ")", ";", "add", "(", "\"6573412\"", ")", ";", "add", "(", "\"6712345\"", ")", ";", "add", "(", "\"6712354\"", ")", ";", "add", "(", "\"6712435\"", ")", ";", "add", "(", "\"6712453\"", ")", ";", "add", "(", "\"6712534\"", ")", ";", "add", "(", "\"6713245\"", ")", ";", "add", "(", "\"6713254\"", ")", ";", "add", "(", "\"6713425\"", ")", ";", "add", "(", "\"6713452\"", ")", ";", "add", "(", "\"6713524\"", ")", ";", "add", "(", "\"6714235\"", ")", ";", "add", "(", "\"6714253\"", ")", ";", "add", "(", "\"6714523\"", ")", ";", "add", "(", "\"6715234\"", ")", ";", "add", "(", "\"6721345\"", ")", ";", "add", "(", "\"6721354\"", ")", ";", "add", "(", "\"6721435\"", ")", ";", "add", "(", "\"6721453\"", ")", ";", "add", "(", "\"6721534\"", ")", ";", "add", "(", "\"6721543\"", ")", ";", "add", "(", "\"6723145\"", ")", ";", "add", "(", "\"6723154\"", ")", ";", "add", "(", "\"6723415\"", ")", ";", "add", "(", "\"6723451\"", ")", ";", "add", "(", "\"6723514\"", ")", ";", "add", "(", "\"6724135\"", ")", ";", "add", "(", "\"6724153\"", ")", ";", "add", "(", "\"6724513\"", ")", ";", "add", "(", "\"6725134\"", ")", ";", "add", "(", "\"6725143\"", ")", ";", "add", "(", "\"6725314\"", ")", ";", "add", "(", "\"6725413\"", ")", ";", "add", "(", "\"6731245\"", ")", ";", "add", "(", "\"6731254\"", ")", ";", "add", "(", "\"6731425\"", ")", ";", "add", "(", "\"6731452\"", ")", ";", "add", "(", "\"6731524\"", ")", ";", "add", "(", "\"6731542\"", ")", ";", "add", "(", "\"6732154\"", ")", ";", "add", "(", "\"6732514\"", ")", ";", "add", "(", "\"6732541\"", ")", ";", "add", "(", "\"6734125\"", ")", ";", "add", "(", "\"6734152\"", ")", ";", "add", "(", "\"6734512\"", ")", ";", "add", "(", "\"6735124\"", ")", ";", "add", "(", "\"6735142\"", ")", ";", "add", "(", "\"6735214\"", ")", ";", "add", "(", "\"6735241\"", ")", ";", "add", "(", "\"6735412\"", ")", ";", "add", "(", "\"6741235\"", ")", ";", "add", "(", "\"6741253\"", ")", ";", "add", "(", "\"6741352\"", ")", ";", "add", "(", "\"6741523\"", ")", ";", "add", "(", "\"6741532\"", ")", ";", "add", "(", "\"6742153\"", ")", ";", "add", "(", "\"6742513\"", ")", ";", "add", "(", "\"6742531\"", ")", ";", "add", "(", "\"6743152\"", ")", ";", "add", "(", "\"6743512\"", ")", ";", "add", "(", "\"6745123\"", ")", ";", "add", "(", "\"6745132\"", ")", ";", "add", "(", "\"6745213\"", ")", ";", "add", "(", "\"6745231\"", ")", ";", "add", "(", "\"6745312\"", ")", ";", "add", "(", "\"6751234\"", ")", ";", "add", "(", "\"6752143\"", ")", ";", "add", "(", "\"6752413\"", ")", ";", "add", "(", "\"6753142\"", ")", ";", "add", "(", "\"6753412\"", ")", ";", "add", "(", "\"7123456\"", ")", ";", "add", "(", "\"7124365\"", ")", ";", "add", "(", "\"7124635\"", ")", ";", "add", "(", "\"7125364\"", ")", ";", "add", "(", "\"7125634\"", ")", ";", "add", "(", "\"7132465\"", ")", ";", "add", "(", "\"7132546\"", ")", ";", "add", "(", "\"7132564\"", ")", ";", "add", "(", "\"7132645\"", ")", ";", "add", "(", "\"7134265\"", ")", ";", "add", "(", "\"7134625\"", ")", ";", "add", "(", "\"7135246\"", ")", ";", "add", "(", "\"7135264\"", ")", ";", "add", "(", "\"7135624\"", ")", ";", "add", "(", "\"7136245\"", ")", ";", "add", "(", "\"7142365\"", ")", ";", "add", "(", "\"7142536\"", ")", ";", "add", "(", "\"7142563\"", ")", ";", "add", "(", "\"7142635\"", ")", ";", "add", "(", "\"7145236\"", ")", ";", "add", "(", "\"7145263\"", ")", ";", "add", "(", "\"7145623\"", ")", ";", "add", "(", "\"7146235\"", ")", ";", "add", "(", "\"7152364\"", ")", ";", "add", "(", "\"7152634\"", ")", ";", "add", "(", "\"7156234\"", ")", ";", "add", "(", "\"7213465\"", ")", ";", "add", "(", "\"7213546\"", ")", ";", "add", "(", "\"7213564\"", ")", ";", "add", "(", "\"7213645\"", ")", ";", "add", "(", "\"7214356\"", ")", ";", "add", "(", "\"7214365\"", ")", ";", "add", "(", "\"7214536\"", ")", ";", "add", "(", "\"7214563\"", ")", ";", "add", "(", "\"7214635\"", ")", ";", "add", "(", "\"7215346\"", ")", ";", "add", "(", "\"7215364\"", ")", ";", "add", "(", "\"7215634\"", ")", ";", "add", "(", "\"7216345\"", ")", ";", "add", "(", "\"7231465\"", ")", ";", "add", "(", "\"7231546\"", ")", ";", "add", "(", "\"7231564\"", ")", ";", "add", "(", "\"7231645\"", ")", ";", "add", "(", "\"7234165\"", ")", ";", "add", "(", "\"7234615\"", ")", ";", "add", "(", "\"7235146\"", ")", ";", "add", "(", "\"7235164\"", ")", ";", "add", "(", "\"7235614\"", ")", ";", "add", "(", "\"7236145\"", ")", ";", "add", "(", "\"7241356\"", ")", ";", "add", "(", "\"7241365\"", ")", ";", "add", "(", "\"7241536\"", ")", ";", "add", "(", "\"7241563\"", ")", ";", "add", "(", "\"7241635\"", ")", ";", "add", "(", "\"7245136\"", ")", ";", "add", "(", "\"7245163\"", ")", ";", "add", "(", "\"7245613\"", ")", ";", "add", "(", "\"7246135\"", ")", ";", "add", "(", "\"7251346\"", ")", ";", "add", "(", "\"7251364\"", ")", ";", "add", "(", "\"7251634\"", ")", ";", "add", "(", "\"7256134\"", ")", ";", "add", "(", "\"7261345\"", ")", ";", "add", "(", "\"7312465\"", ")", ";", "add", "(", "\"7312546\"", ")", ";", "add", "(", "\"7312564\"", ")", ";", "add", "(", "\"7312645\"", ")", ";", "add", "(", "\"7314256\"", ")", ";", "add", "(", "\"7314265\"", ")", ";", "add", "(", "\"7314526\"", ")", ";", "add", "(", "\"7314562\"", ")", ";", "add", "(", "\"7314625\"", ")", ";", "add", "(", "\"7315246\"", ")", ";", "add", "(", "\"7315264\"", ")", ";", "add", "(", "\"7315624\"", ")", ";", "add", "(", "\"7316245\"", ")", ";", "add", "(", "\"7321654\"", ")", ";", "add", "(", "\"7326154\"", ")", ";", "add", "(", "\"7326514\"", ")", ";", "add", "(", "\"7341256\"", ")", ";", "add", "(", "\"7341265\"", ")", ";", "add", "(", "\"7341526\"", ")", ";", "add", "(", "\"7341562\"", ")", ";", "add", "(", "\"7341625\"", ")", ";", "add", "(", "\"7345126\"", ")", ";", "add", "(", "\"7345162\"", ")", ";", "add", "(", "\"7345612\"", ")", ";", "add", "(", "\"7346125\"", ")", ";", "add", "(", "\"7351246\"", ")", ";", "add", "(", "\"7351264\"", ")", ";", "add", "(", "\"7351624\"", ")", ";", "add", "(", "\"7356124\"", ")", ";", "add", "(", "\"7361245\"", ")", ";", "add", "(", "\"7362154\"", ")", ";", "add", "(", "\"7362514\"", ")", ";", "add", "(", "\"7412365\"", ")", ";", "add", "(", "\"7412536\"", ")", ";", "add", "(", "\"7412563\"", ")", ";", "add", "(", "\"7412635\"", ")", ";", "add", "(", "\"7415236\"", ")", ";", "add", "(", "\"7415263\"", ")", ";", "add", "(", "\"7415623\"", ")", ";", "add", "(", "\"7416235\"", ")", ";", "add", "(", "\"7421653\"", ")", ";", "add", "(", "\"7426153\"", ")", ";", "add", "(", "\"7426513\"", ")", ";", "add", "(", "\"7431652\"", ")", ";", "add", "(", "\"7436152\"", ")", ";", "add", "(", "\"7436512\"", ")", ";", "add", "(", "\"7451236\"", ")", ";", "add", "(", "\"7451263\"", ")", ";", "add", "(", "\"7451623\"", ")", ";", "add", "(", "\"7456123\"", ")", ";", "add", "(", "\"7461235\"", ")", ";", "add", "(", "\"7462153\"", ")", ";", "add", "(", "\"7462513\"", ")", ";", "add", "(", "\"7463152\"", ")", ";", "add", "(", "\"7463512\"", ")", ";", "add", "(", "\"7512364\"", ")", ";", "add", "(", "\"7512634\"", ")", ";", "add", "(", "\"7516234\"", ")", ";", "add", "(", "\"7521643\"", ")", ";", "add", "(", "\"7526143\"", ")", ";", "add", "(", "\"7526413\"", ")", ";", "add", "(", "\"7531642\"", ")", ";", "add", "(", "\"7536142\"", ")", ";", "add", "(", "\"7536412\"", ")", ";", "add", "(", "\"7561234\"", ")", ";", "add", "(", "\"7562143\"", ")", ";", "add", "(", "\"7562413\"", ")", ";", "add", "(", "\"7563142\"", ")", ";", "add", "(", "\"7563412\"", ")", ";", "}", "}", ";", "}", "</s>" ]
8,961
[ "<s>", "package", "com", ".", "facebook", ".", "android", ";", "public", "final", "class", "R", "{", "public", "static", "final", "class", "array", "{", "public", "static", "final", "int", "encryption", "=", "0x7f050002", ";", "public", "static", "final", "int", "encryption_values", "=", "0x7f050003", ";", "public", "static", "final", "int", "messages", "=", "0x7f050004", ";", "public", "static", "final", "int", "messages_values", "=", "0x7f050005", ";", "public", "static", "final", "int", "poly_method", "=", "0x7f050000", ";", "public", "static", "final", "int", "poly_method_values", "=", "0x7f050001", ";", "}", "public", "static", "final", "class", "attr", "{", "}", "public", "static", "final", "class", "dimen", "{", "public", "static", "final", "int", "padding_large", "=", "0x7f060002", ";", "public", "static", "final", "int", "padding_medium", "=", "0x7f060001", ";", "public", "static", "final", "int", "padding_small", "=", "0x7f060000", ";", "}", "public", "static", "final", "class", "drawable", "{", "public", "static", "final", "int", "black", "=", "0x7f020009", ";", "public", "static", "final", "int", "close", "=", "0x7f020000", ";", "public", "static", "final", "int", "facebook_icon", "=", "0x7f020001", ";", "public", "static", "final", "int", "happy", "=", "0x7f020002", ";", "public", "static", "final", "int", "ic_action_search", "=", "0x7f020003", ";", "public", "static", "final", "int", "ic_launcher", "=", "0x7f020004", ";", "public", "static", "final", "int", "query", "=", "0x7f020005", ";", "public", "static", "final", "int", "sad", "=", "0x7f020006", ";", "public", "static", "final", "int", "waiting", "=", "0x7f020007", ";", "public", "static", "final", "int", "white", "=", "0x7f020008", ";", "}", "public", "static", "final", "class", "id", "{", "public", "static", "final", "int", "bit_strength", "=", "0x7f0a000d", ";", "public", "static", "final", "int", "bt_query", "=", "0x7f0a0004", ";", "public", "static", "final", "int", "certainty", "=", "0x7f0a000e", ";", "public", "static", "final", "int", "enc_test", "=", "0x7f0a000f", ";", "public", "static", "final", "int", "fb_chat", "=", "0x7f0a0005", ";", "public", "static", "final", "int", "gen_message_butt", "=", "0x7f0a0008", ";", "public", "static", "final", "int", "length", "=", "0x7f0a0007", ";", "public", "static", "final", "int", "ll", "=", "0x7f0a0000", ";", "public", "static", "final", "int", "mainListView", "=", "0x7f0a000c", ";", "public", "static", "final", "int", "message", "=", "0x7f0a0006", ";", "public", "static", "final", "int", "names", "=", "0x7f0a0013", ";", "public", "static", "final", "int", "other_user", "=", "0x7f0a0003", ";", "public", "static", "final", "int", "output", "=", "0x7f0a000b", ";", "public", "static", "final", "int", "query", "=", "0x7f0a0002", ";", "public", "static", "final", "int", "rec", "=", "0x7f0a0009", ";", "public", "static", "final", "int", "rowTextView", "=", "0x7f0a0011", ";", "public", "static", "final", "int", "send_message_butt", "=", "0x7f0a000a", ";", "public", "static", "final", "int", "settings", "=", "0x7f0a0012", ";", "public", "static", "final", "int", "test_encryption", "=", "0x7f0a0014", ";", "public", "static", "final", "int", "test_message", "=", "0x7f0a0015", ";", "public", "static", "final", "int", "text_view", "=", "0x7f0a0001", ";", "public", "static", "final", "int", "waiting", "=", "0x7f0a0010", ";", "}", "public", "static", "final", "class", "layout", "{", "public", "static", "final", "int", "activity_main", "=", "0x7f030000", ";", "public", "static", "final", "int", "activity_message_test", "=", "0x7f030001", ";", "public", "static", "final", "int", "activity_names", "=", "0x7f030002", ";", "public", "static", "final", "int", "activity_processed_queries", "=", "0x7f030003", ";", "public", "static", "final", "int", "activity_test", "=", "0x7f030004", ";", "public", "static", "final", "int", "activity_wait", "=", "0x7f030005", ";", "public", "static", "final", "int", "simplerow", "=", "0x7f030006", ";", "public", "static", "final", "int", "smallfont", "=", "0x7f030007", ";", "}", "public", "static", "final", "class", "menu", "{", "public", "static", "final", "int", "activity_main", "=", "0x7f090000", ";", "}", "public", "static", "final", "class", "string", "{", "public", "static", "final", "int", "app_name", "=", "0x7f070000", ";", "public", "static", "final", "int", "bit_strength", "=", "0x7f070008", ";", "public", "static", "final", "int", "butt_query", "=", "0x7f070004", ";", "public", "static", "final", "int", "certainty", "=", "0x7f070009", ";", "public", "static", "final", "int", "hello", "=", "0x7f070010", ";", "public", "static", "final", "int", "hello_world", "=", "0x7f070001", ";", "public", "static", "final", "int", "menu_settings", "=", "0x7f070002", ";", "public", "static", "final", "int", "mess", "=", "0x7f070013", ";", "public", "static", "final", "int", "message", "=", "0x7f07000a", ";", "public", "static", "final", "int", "names", "=", "0x7f070012", ";", "public", "static", "final", "int", "other_user_hint", "=", "0x7f070015", ";", "public", "static", "final", "int", "query", "=", "0x7f070014", ";", "public", "static", "final", "int", "request", "=", "0x7f07000f", ";", "public", "static", "final", "int", "s10", "=", "0x7f070007", ";", "public", "static", "final", "int", "settings", "=", "0x7f07000d", ";", "public", "static", "final", "int", "test", "=", "0x7f07000e", ";", "public", "static", "final", "int", "test_enc", "=", "0x7f07000b", ";", "public", "static", "final", "int", "test_waiting", "=", "0x7f07000c", ";", "public", "static", "final", "int", "title_activity_main", "=", "0x7f070003", ";", "public", "static", "final", "int", "upload", "=", "0x7f070011", ";", "public", "static", "final", "int", "wait", "=", "0x7f070005", ";", "public", "static", "final", "int", "waiting", "=", "0x7f070006", ";", "}", "public", "static", "final", "class", "style", "{", "public", "static", "final", "int", "AppTheme", "=", "0x7f080000", ";", "public", "static", "final", "int", "preferences", "=", "0x7f080001", ";", "}", "public", "static", "final", "class", "xml", "{", "public", "static", "final", "int", "preferences", "=", "0x7f040000", ";", "}", "}", "</s>" ]
8,962
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "public", "final", "class", "R", "{", "public", "static", "final", "class", "array", "{", "public", "static", "final", "int", "encryption", "=", "0x7f050002", ";", "public", "static", "final", "int", "encryption_values", "=", "0x7f050003", ";", "public", "static", "final", "int", "messages", "=", "0x7f050004", ";", "public", "static", "final", "int", "messages_values", "=", "0x7f050005", ";", "public", "static", "final", "int", "poly_method", "=", "0x7f050000", ";", "public", "static", "final", "int", "poly_method_values", "=", "0x7f050001", ";", "}", "public", "static", "final", "class", "attr", "{", "}", "public", "static", "final", "class", "dimen", "{", "public", "static", "final", "int", "padding_large", "=", "0x7f060002", ";", "public", "static", "final", "int", "padding_medium", "=", "0x7f060001", ";", "public", "static", "final", "int", "padding_small", "=", "0x7f060000", ";", "}", "public", "static", "final", "class", "drawable", "{", "public", "static", "final", "int", "black", "=", "0x7f020009", ";", "public", "static", "final", "int", "close", "=", "0x7f020000", ";", "public", "static", "final", "int", "facebook_icon", "=", "0x7f020001", ";", "public", "static", "final", "int", "happy", "=", "0x7f020002", ";", "public", "static", "final", "int", "ic_action_search", "=", "0x7f020003", ";", "public", "static", "final", "int", "ic_launcher", "=", "0x7f020004", ";", "public", "static", "final", "int", "query", "=", "0x7f020005", ";", "public", "static", "final", "int", "sad", "=", "0x7f020006", ";", "public", "static", "final", "int", "waiting", "=", "0x7f020007", ";", "public", "static", "final", "int", "white", "=", "0x7f020008", ";", "}", "public", "static", "final", "class", "id", "{", "public", "static", "final", "int", "bit_strength", "=", "0x7f0a000d", ";", "public", "static", "final", "int", "bt_query", "=", "0x7f0a0004", ";", "public", "static", "final", "int", "certainty", "=", "0x7f0a000e", ";", "public", "static", "final", "int", "enc_test", "=", "0x7f0a000f", ";", "public", "static", "final", "int", "fb_chat", "=", "0x7f0a0005", ";", "public", "static", "final", "int", "gen_message_butt", "=", "0x7f0a0008", ";", "public", "static", "final", "int", "length", "=", "0x7f0a0007", ";", "public", "static", "final", "int", "ll", "=", "0x7f0a0000", ";", "public", "static", "final", "int", "mainListView", "=", "0x7f0a000c", ";", "public", "static", "final", "int", "message", "=", "0x7f0a0006", ";", "public", "static", "final", "int", "names", "=", "0x7f0a0013", ";", "public", "static", "final", "int", "other_user", "=", "0x7f0a0003", ";", "public", "static", "final", "int", "output", "=", "0x7f0a000b", ";", "public", "static", "final", "int", "query", "=", "0x7f0a0002", ";", "public", "static", "final", "int", "rec", "=", "0x7f0a0009", ";", "public", "static", "final", "int", "rowTextView", "=", "0x7f0a0011", ";", "public", "static", "final", "int", "send_message_butt", "=", "0x7f0a000a", ";", "public", "static", "final", "int", "settings", "=", "0x7f0a0012", ";", "public", "static", "final", "int", "test_encryption", "=", "0x7f0a0014", ";", "public", "static", "final", "int", "test_message", "=", "0x7f0a0015", ";", "public", "static", "final", "int", "text_view", "=", "0x7f0a0001", ";", "public", "static", "final", "int", "waiting", "=", "0x7f0a0010", ";", "}", "public", "static", "final", "class", "layout", "{", "public", "static", "final", "int", "activity_main", "=", "0x7f030000", ";", "public", "static", "final", "int", "activity_message_test", "=", "0x7f030001", ";", "public", "static", "final", "int", "activity_names", "=", "0x7f030002", ";", "public", "static", "final", "int", "activity_processed_queries", "=", "0x7f030003", ";", "public", "static", "final", "int", "activity_test", "=", "0x7f030004", ";", "public", "static", "final", "int", "activity_wait", "=", "0x7f030005", ";", "public", "static", "final", "int", "simplerow", "=", "0x7f030006", ";", "public", "static", "final", "int", "smallfont", "=", "0x7f030007", ";", "}", "public", "static", "final", "class", "menu", "{", "public", "static", "final", "int", "activity_main", "=", "0x7f090000", ";", "}", "public", "static", "final", "class", "string", "{", "public", "static", "final", "int", "app_name", "=", "0x7f070000", ";", "public", "static", "final", "int", "bit_strength", "=", "0x7f070008", ";", "public", "static", "final", "int", "butt_query", "=", "0x7f070004", ";", "public", "static", "final", "int", "certainty", "=", "0x7f070009", ";", "public", "static", "final", "int", "hello", "=", "0x7f070010", ";", "public", "static", "final", "int", "hello_world", "=", "0x7f070001", ";", "public", "static", "final", "int", "menu_settings", "=", "0x7f070002", ";", "public", "static", "final", "int", "mess", "=", "0x7f070013", ";", "public", "static", "final", "int", "message", "=", "0x7f07000a", ";", "public", "static", "final", "int", "names", "=", "0x7f070012", ";", "public", "static", "final", "int", "other_user_hint", "=", "0x7f070015", ";", "public", "static", "final", "int", "query", "=", "0x7f070014", ";", "public", "static", "final", "int", "request", "=", "0x7f07000f", ";", "public", "static", "final", "int", "s10", "=", "0x7f070007", ";", "public", "static", "final", "int", "settings", "=", "0x7f07000d", ";", "public", "static", "final", "int", "test", "=", "0x7f07000e", ";", "public", "static", "final", "int", "test_enc", "=", "0x7f07000b", ";", "public", "static", "final", "int", "test_waiting", "=", "0x7f07000c", ";", "public", "static", "final", "int", "title_activity_main", "=", "0x7f070003", ";", "public", "static", "final", "int", "upload", "=", "0x7f070011", ";", "public", "static", "final", "int", "wait", "=", "0x7f070005", ";", "public", "static", "final", "int", "waiting", "=", "0x7f070006", ";", "}", "public", "static", "final", "class", "style", "{", "public", "static", "final", "int", "AppTheme", "=", "0x7f080000", ";", "public", "static", "final", "int", "preferences", "=", "0x7f080001", ";", "}", "public", "static", "final", "class", "xml", "{", "public", "static", "final", "int", "preferences", "=", "0x7f040000", ";", "}", "}", "</s>" ]
8,963
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "public", "final", "class", "BuildConfig", "{", "public", "final", "static", "boolean", "DEBUG", "=", "true", ";", "}", "</s>" ]
8,964
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "public", "class", "tree", "{", "public", "int", "value", ";", "public", "char", "[", "]", "path", ";", "public", "String", "special", ";", "public", "tree", "left", ";", "public", "tree", "right", ";", "private", "tree", "parent", ";", "public", "String", "treeType", ";", "public", "int", "height", ";", "public", "String", "type", ";", "private", "int", "magic", ";", "public", "tree", "(", "int", "newValue", ",", "char", "[", "]", "newPath", ",", "tree", "newLeft", ",", "tree", "newRight", ",", "int", "nHeight", ",", "String", "nType", ")", "{", "value", "=", "newValue", ";", "path", "=", "newPath", ";", "special", "=", "null", ";", "left", "=", "newLeft", ";", "right", "=", "newRight", ";", "height", "=", "nHeight", ";", "type", "=", "nType", ";", "if", "(", "type", ".", "equals", "(", "\"lat\"", ")", ")", "{", "magic", "=", "4003003", ";", "}", "else", "if", "(", "type", ".", "equals", "(", "\"lon\"", ")", ")", "{", "magic", "=", "4003017", ";", "}", "}", "public", "void", "setType", "(", "String", "type", ")", "{", "if", "(", "type", ".", "equals", "(", "\"lat\"", ")", ")", "{", "magic", "=", "4003003", ";", "}", "else", "if", "(", "type", ".", "equals", "(", "\"lon\"", ")", ")", "{", "magic", "=", "4003017", ";", "}", "}", "public", "tree", "rightLeaf", "(", ")", "{", "tree", "cur", "=", "this", ";", "while", "(", "cur", ".", "right", "!=", "null", ")", "{", "cur", "=", "cur", ".", "right", ";", "}", "if", "(", "cur", ".", "value", ">", "magic", ")", "{", "return", "null", ";", "}", "return", "cur", ";", "}", "public", "tree", "leftLeaf", "(", ")", "{", "tree", "cur", "=", "this", ";", "while", "(", "cur", ".", "left", "!=", "null", ")", "{", "cur", "=", "cur", ".", "left", ";", "}", "if", "(", "cur", ".", "value", ">", "magic", ")", "{", "return", "null", ";", "}", "return", "cur", ";", "}", "public", "tree", "createParent", "(", ")", "{", "tree", "parent", ";", "if", "(", "path", ".", "length", "==", "0", ")", "{", "path", "=", "new", "char", "[", "1", "]", ";", "path", "[", "0", "]", "=", "'0'", ";", "}", "char", "[", "]", "nPath", "=", "new", "char", "[", "path", ".", "length", "-", "1", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "nPath", ".", "length", ";", "j", "++", ")", "{", "nPath", "[", "j", "]", "=", "path", "[", "j", "]", ";", "}", "if", "(", "this", ".", "upRightward", "(", ")", ")", "{", "int", "nValue", "=", "value", "+", "magic", ";", "parent", "=", "new", "tree", "(", "nValue", ",", "nPath", ",", "this", ",", "null", ",", "height", "+", "1", ",", "type", ")", ";", "}", "else", "{", "int", "nValue", "=", "value", "+", "(", "magic", "-", "(", "int", ")", "(", "Math", ".", "pow", "(", "2.0", ",", "(", "double", ")", "(", "height", ")", ")", ")", ")", ";", "parent", "=", "new", "tree", "(", "nValue", ",", "nPath", ",", "null", ",", "this", ",", "height", "+", "1", ",", "type", ")", ";", "}", "return", "parent", ";", "}", "public", "tree", "getParent", "(", ")", "{", "return", "parent", ";", "}", "public", "void", "setParent", "(", "tree", "t", ")", "{", "parent", "=", "t", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "String", "s", "=", "\"\"", "+", "value", "+", "\"nmap:", "\"", "+", "new", "String", "(", "path", ")", ";", "if", "(", "special", "!=", "null", ")", "{", "s", "+=", "\"nspecial:", "\"", "+", "special", ";", "}", "if", "(", "left", "!=", "null", ")", "{", "s", "+=", "\"\"", "+", "left", ".", "value", ";", "}", "if", "(", "right", "!=", "null", ")", "{", "s", "+=", "\"\"", "+", "right", ".", "value", ";", "}", "if", "(", "parent", "!=", "null", ")", "{", "s", "+=", "\"nparent:", "\"", "+", "parent", ".", "value", ";", "}", "return", "s", ";", "}", "public", "int", "count", "(", ")", "{", "int", "sum", "=", "0", ";", "treeQueue", "top", "=", "new", "treeQueue", "(", ")", ";", "treeQueue", "bottom", "=", "new", "treeQueue", "(", ")", ";", "top", ".", "push", "(", "this", ")", ";", "while", "(", "top", ".", "length", "!=", "0", ")", "{", "sum", "=", "sum", "+", "top", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "top", ".", "length", ";", "i", "++", ")", "{", "tree", "cur", "=", "top", ".", "peek", "(", "i", ")", ".", "left", ";", "if", "(", "cur", "!=", "null", ")", "{", "bottom", ".", "push", "(", "cur", ")", ";", "}", "cur", "=", "top", ".", "peek", "(", "i", ")", ".", "right", ";", "if", "(", "cur", "!=", "null", ")", "{", "bottom", ".", "push", "(", "cur", ")", ";", "}", "}", "top", "=", "bottom", ";", "bottom", "=", "new", "treeQueue", "(", ")", ";", "}", "return", "sum", ";", "}", "public", "void", "setNullChild", "(", "tree", "t", ")", "{", "if", "(", "left", "==", "null", ")", "{", "left", "=", "t", ";", "}", "else", "if", "(", "right", "==", "null", ")", "{", "right", "=", "t", ";", "}", "}", "public", "boolean", "upRightward", "(", ")", "{", "return", "path", "[", "path", ".", "length", "-", "1", "]", "==", "'0'", ";", "}", "}", "</s>" ]
8,965
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "BroadcastReceiver", ";", "import", "android", ".", "content", ".", "ComponentName", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "IntentFilter", ";", "import", "android", ".", "content", ".", "ServiceConnection", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "location", ".", "Location", ";", "import", "android", ".", "location", ".", "LocationManager", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "os", ".", "IBinder", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "Menu", ";", "import", "android", ".", "view", ".", "MenuInflater", ";", "import", "android", ".", "view", ".", "MenuItem", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "EditText", ";", "import", "android", ".", "widget", ".", "Toast", ";", "import", "android", ".", "widget", ".", "ToggleButton", ";", "public", "class", "MainActivity", "extends", "Activity", "{", "public", "final", "static", "String", "EXTRA_MESSAGE", "=", "\"\"", ";", "private", "lListener", "myListener", "=", "new", "lListener", "(", ")", ";", "private", "LocationManager", "lManager", ";", "private", "logInReceiver", "rec", ";", "private", "ToggleButton", "chatButton", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_main", ")", ";", "lManager", "=", "(", "LocationManager", ")", "this", ".", "getSystemService", "(", "Context", ".", "LOCATION_SERVICE", ")", ";", "lManager", ".", "requestLocationUpdates", "(", "LocationManager", ".", "GPS_PROVIDER", ",", "1000", ",", "10000", ",", "myListener", ")", ";", "try", "{", "lManager", ".", "requestLocationUpdates", "(", "LocationManager", ".", "NETWORK_PROVIDER", ",", "1000", ",", "10000", ",", "myListener", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "chatButton", "=", "(", "ToggleButton", ")", "findViewById", "(", "R", ".", "id", ".", "fb_chat", ")", ";", "}", "protected", "void", "onActivityResult", "(", "int", "requestCode", ",", "int", "resultCode", ",", "Intent", "intent", ")", "{", "switch", "(", "requestCode", ")", "{", "case", "1", ":", "if", "(", "resultCode", "==", "RESULT_OK", ")", "{", "String", "name", "=", "intent", ".", "getStringExtra", "(", "\"other_user\"", ")", ";", "EditText", "rec", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "other_user", ")", ";", "rec", ".", "setText", "(", "name", ")", ";", "break", ";", "}", "}", "}", "@", "Override", "public", "boolean", "onCreateOptionsMenu", "(", "Menu", "menu", ")", "{", "MenuInflater", "inflater", "=", "getMenuInflater", "(", ")", ";", "inflater", ".", "inflate", "(", "R", ".", "menu", ".", "activity_main", ",", "menu", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "boolean", "onOptionsItemSelected", "(", "MenuItem", "item", ")", "{", "Log", ".", "d", "(", "\"main\"", ",", "\"Selected:", "\"", "+", "item", ".", "toString", "(", ")", ")", ";", "switch", "(", "item", ".", "getItemId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "settings", ":", "startActivity", "(", "new", "Intent", "(", "this", ",", "settings", ".", "class", ")", ")", ";", "return", "true", ";", "case", "R", ".", "id", ".", "names", ":", "if", "(", "xmppService", ".", "in", ")", "{", "startActivityForResult", "(", "new", "Intent", "(", "this", ",", "names", ".", "class", ")", ",", "1", ")", ";", "return", "true", ";", "}", "else", "{", "Toast", ".", "makeText", "(", "this", ",", "\"\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "return", "false", ";", "}", "case", "R", ".", "id", ".", "test_encryption", ":", "startActivity", "(", "new", "Intent", "(", "this", ",", "paillierTest", ".", "class", ")", ")", ";", "return", "true", ";", "case", "R", ".", "id", ".", "test_message", ":", "if", "(", "xmppService", ".", "in", ")", "{", "startActivity", "(", "new", "Intent", "(", "this", ",", "messageTest", ".", "class", ")", ")", ";", "return", "true", ";", "}", "else", "{", "Toast", ".", "makeText", "(", "this", ",", "\"\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "return", "false", ";", "}", "default", ":", "return", "super", ".", "onOptionsItemSelected", "(", "item", ")", ";", "}", "}", "@", "Override", "public", "void", "onResume", "(", ")", "{", "super", ".", "onResume", "(", ")", ";", "if", "(", "rec", "==", "null", ")", "{", "IntentFilter", "logInFilter", ";", "logInFilter", "=", "new", "IntentFilter", "(", "xmppService", ".", "LOGIN_UPDATE", ")", ";", "rec", "=", "new", "logInReceiver", "(", ")", ";", "registerReceiver", "(", "rec", ",", "logInFilter", ")", ";", "}", "}", "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "super", ".", "onDestroy", "(", ")", ";", "if", "(", "xmppService", ".", "in", ")", "{", "unbindService", "(", "mConnection", ")", ";", "}", "try", "{", "unregisterReceiver", "(", "rec", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "}", "}", "public", "void", "query", "(", "View", "view", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "this", ",", "displayMessageAct", ".", "class", ")", ";", "shareSingleton", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "EditText", "otherUser", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "other_user", ")", ";", "String", "rec", "=", "otherUser", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "share", ".", "rec", "=", "rec", ";", "Context", "context", "=", "getApplicationContext", "(", ")", ";", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "this", ")", ";", "Log", ".", "d", "(", "\"main\"", ",", "\"\"", "+", "prefs", ".", "contains", "(", "\"\"", ")", ")", ";", "boolean", "it", "=", "prefs", ".", "getBoolean", "(", "\"\"", ",", "false", ")", ";", "if", "(", "it", ")", "{", "myListener", ".", "plugFake", "(", "context", ")", ";", "}", "if", "(", "rec", ".", "length", "(", ")", "!=", "0", "&&", "rec", "!=", "null", ")", "{", "if", "(", "!", "myListener", ".", "listening", "(", ")", ")", "{", "lManager", ".", "removeUpdates", "(", "myListener", ")", ";", "protocol", "p", "=", "new", "protocol", "(", ")", ";", "Location", "l", "=", "p", ".", "locSimple", "(", "this", ")", ";", "share", ".", "lon", "=", "l", ".", "getLongitude", "(", ")", ";", "share", ".", "lat", "=", "l", ".", "getLatitude", "(", ")", ";", "intent", ".", "putExtra", "(", "\"rec\"", ",", "rec", ")", ";", "share", ".", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "startActivity", "(", "intent", ")", ";", "}", "else", "{", "Toast", ".", "makeText", "(", "context", ",", "\"\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", "else", "{", "Toast", ".", "makeText", "(", "context", ",", "\"\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "}", "private", "ServiceConnection", "mConnection", "=", "new", "ServiceConnection", "(", ")", "{", "@", "Override", "public", "void", "onServiceConnected", "(", "ComponentName", "className", ",", "IBinder", "service", ")", "{", "}", "@", "Override", "public", "void", "onServiceDisconnected", "(", "ComponentName", "name", ")", "{", "chatButton", ".", "setChecked", "(", "false", ")", ";", "}", "}", ";", "public", "void", "fbChatConnect", "(", "View", "view", ")", "{", "if", "(", "xmppService", ".", "in", ")", "{", "Log", ".", "d", "(", "\"main\"", ",", "\"\"", ")", ";", "unbindService", "(", "mConnection", ")", ";", "stopService", "(", "new", "Intent", "(", "this", ",", "xmppService", ".", "class", ")", ")", ";", "chatButton", ".", "setChecked", "(", "false", ")", ";", "}", "else", "{", "chatButton", ".", "setChecked", "(", "false", ")", ";", "chatButton", ".", "setText", "(", "\"\"", ")", ";", "Log", ".", "d", "(", "\"main\"", ",", "\"\"", ")", ";", "Intent", "bindIntent", "=", "new", "Intent", "(", "this", ",", "xmppService", ".", "class", ")", ";", "SharedPreferences", "sp", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "this", ")", ";", "String", "user", "=", "sp", ".", "getString", "(", "\"fb_user\"", ",", "\"None\"", ")", ";", "String", "pass", "=", "sp", ".", "getString", "(", "\"fb_pass\"", ",", "\"None\"", ")", ";", "bindIntent", ".", "putExtra", "(", "\"user\"", ",", "user", ")", ";", "bindIntent", ".", "putExtra", "(", "\"pass\"", ",", "pass", ")", ";", "bindService", "(", "bindIntent", ",", "mConnection", ",", "Context", ".", "BIND_AUTO_CREATE", ")", ";", "}", "}", "public", "class", "logInReceiver", "extends", "BroadcastReceiver", "{", "@", "Override", "public", "void", "onReceive", "(", "Context", "context", ",", "Intent", "intent", ")", "{", "boolean", "light", "=", "intent", ".", "getBooleanExtra", "(", "\"connection\"", ",", "false", ")", ";", "chatButton", ".", "setChecked", "(", "light", ")", ";", "}", "}", "}", "</s>" ]
8,966
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "preference", ".", "PreferenceActivity", ";", "public", "class", "settings", "extends", "PreferenceActivity", "{", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "addPreferencesFromResource", "(", "R", ".", "xml", ".", "preferences", ")", ";", "}", "}", "</s>" ]
8,967
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "Roster", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "RosterEntry", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "ComponentName", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "ServiceConnection", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "os", ".", "IBinder", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "import", "android", ".", "widget", ".", "ArrayAdapter", ";", "import", "android", ".", "widget", ".", "ListView", ";", "import", "android", ".", "widget", ".", "TextView", ";", "public", "class", "names", "extends", "Activity", "{", "private", "ServiceConnection", "mConnection", "=", "new", "ServiceConnection", "(", ")", "{", "@", "Override", "public", "void", "onServiceConnected", "(", "ComponentName", "className", ",", "IBinder", "service", ")", "{", "fillList", "(", "xmppService", ".", "getRoster", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "onServiceDisconnected", "(", "ComponentName", "name", ")", "{", "}", "}", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_names", ")", ";", "Log", ".", "d", "(", "\"names\"", ",", "\"\"", ")", ";", "Intent", "bindIntent", "=", "new", "Intent", "(", "this", ",", "xmppService", ".", "class", ")", ";", "SharedPreferences", "sp", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "this", ")", ";", "String", "user", "=", "sp", ".", "getString", "(", "\"fb_user\"", ",", "\"None\"", ")", ";", "String", "pass", "=", "sp", ".", "getString", "(", "\"fb_pass\"", ",", "\"None\"", ")", ";", "bindIntent", ".", "putExtra", "(", "\"user\"", ",", "user", ")", ";", "bindIntent", ".", "putExtra", "(", "\"pass\"", ",", "pass", ")", ";", "bindService", "(", "bindIntent", ",", "mConnection", ",", "Context", ".", "BIND_AUTO_CREATE", ")", ";", "}", "public", "void", "onDestroy", "(", ")", "{", "super", ".", "onDestroy", "(", ")", ";", "unbindService", "(", "mConnection", ")", ";", "}", "public", "void", "fillList", "(", "Roster", "roster", ")", "{", "ListView", "main", "=", "(", "ListView", ")", "findViewById", "(", "R", ".", "id", ".", "mainListView", ")", ";", "Collection", "<", "RosterEntry", ">", "entries", "=", "roster", ".", "getEntries", "(", ")", ";", "ArrayList", "<", "String", ">", "entriesList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "RosterEntry", "entry", ":", "entries", ")", "{", "entriesList", ".", "add", "(", "entry", ".", "getName", "(", ")", ")", ";", "}", "ArrayAdapter", "<", "String", ">", "listAdapter", "=", "new", "ArrayAdapter", "<", "String", ">", "(", "this", ",", "R", ".", "layout", ".", "simplerow", ",", "entriesList", ")", ";", "main", ".", "setAdapter", "(", "listAdapter", ")", ";", "main", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "@", "Override", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "view", ",", "int", "position", ",", "long", "id", ")", "{", "String", "s", "=", "(", "(", "TextView", ")", "view", ")", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "Log", ".", "d", "(", "\"names\"", ",", "\"\"", "+", "s", ")", ";", "Intent", "rIntent", "=", "new", "Intent", "(", ")", ";", "rIntent", ".", "putExtra", "(", "\"other_user\"", ",", "s", ")", ";", "setResult", "(", "RESULT_OK", ",", "rIntent", ")", ";", "finish", "(", ")", ";", "}", "}", ")", ";", "}", "}", "</s>" ]
8,968
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "java", ".", "util", ".", "Random", ";", "import", "android", ".", "app", ".", "Notification", ";", "import", "android", ".", "app", ".", "NotificationManager", ";", "import", "android", ".", "app", ".", "PendingIntent", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "location", ".", "Location", ";", "import", "android", ".", "location", ".", "LocationManager", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "public", "class", "protocol", "{", "tree", "user", ";", "public", "protocol", "(", ")", "{", "}", "public", "BigInteger", "homoAdd", "(", "BigInteger", "em1", ",", "BigInteger", "em2", ",", "BigInteger", "n", ")", "{", "return", "(", "em1", ".", "multiply", "(", "em2", ")", ")", ".", "mod", "(", "n", ".", "multiply", "(", "n", ")", ")", ";", "}", "public", "BigInteger", "homoMult", "(", "BigInteger", "em1", ",", "BigInteger", "m2", ",", "BigInteger", "n", ")", "{", "return", "em1", ".", "modPow", "(", "m2", ",", "n", ".", "multiply", "(", "n", ")", ")", ";", "}", "public", "BigInteger", "homoExpo", "(", "BigInteger", "em1", ",", "BigInteger", "m1", ",", "BigInteger", "m2", ",", "BigInteger", "n", ")", "{", "BigInteger", "cur", "=", "homoMult", "(", "em1", ",", "m1", ",", "n", ")", ";", "int", "intM2", "=", "m2", ".", "intValue", "(", ")", "-", "2", ";", "while", "(", "intM2", ">", "0", ")", "{", "cur", "=", "homoMult", "(", "cur", ",", "m1", ",", "n", ")", ";", "intM2", "--", ";", "}", "return", "cur", ";", "}", "public", "BigInteger", "homoEval", "(", "BigInteger", "b", ",", "BigInteger", "[", "]", "poly", ",", "BigInteger", "n", ")", "{", "BigInteger", "[", "]", "terms", "=", "new", "BigInteger", "[", "poly", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "poly", ".", "length", ";", "i", "++", ")", "{", "BigInteger", "tmp", "=", "b", ".", "pow", "(", "i", ")", ";", "terms", "[", "i", "]", "=", "homoMult", "(", "poly", "[", "i", "]", ",", "tmp", ",", "n", ")", ";", "}", "BigInteger", "sum", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "terms", "[", "0", "]", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "terms", ".", "length", ";", "i", "++", ")", "{", "sum", "=", "homoAdd", "(", "sum", ",", "terms", "[", "i", "]", ",", "n", ")", ";", "}", "return", "sum", ";", "}", "public", "treeQueue", "genLeaves", "(", "int", "left", ",", "int", "right", ",", "int", "x", ",", "String", "type", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "treeQueue", "leaves", "=", "new", "treeQueue", "(", ")", ";", "int", "cur", "=", "left", ";", "while", "(", "cur", "<=", "right", ")", "{", "String", "mapString", "=", "new", "StringBuffer", "(", "Integer", ".", "toBinaryString", "(", "cur", ")", ")", ".", "toString", "(", ")", ";", "leaves", ".", "push", "(", "new", "tree", "(", "cur", ",", "mapString", ".", "toCharArray", "(", ")", ",", "null", ",", "null", ",", "0", ",", "type", ")", ")", ";", "if", "(", "cur", "==", "x", ")", "{", "leaves", ".", "peek", "(", "-", "1", ")", ".", "special", "=", "\"User!\"", ";", "user", "=", "leaves", ".", "peek", "(", "-", "1", ")", ";", "}", "cur", "++", ";", "}", "return", "leaves", ";", "}", "public", "int", "latitudeToLeaf", "(", "double", "latitude", ")", "{", "if", "(", "latitude", "<", "-", "90", "||", "latitude", ">", "90", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "latitude", ")", ";", "System", ".", "exit", "(", "102", ")", ";", "}", "latitude", "=", "latitude", "+", "90", ";", "return", "(", "int", ")", "Math", ".", "round", "(", "(", "latitude", "/", "0.000044966242717", ")", ")", ";", "}", "public", "int", "longitudeToLeaf", "(", "double", "longitude", ")", "{", "if", "(", "longitude", "<", "-", "180", "||", "longitude", ">", "180", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "longitude", ")", ";", "System", ".", "exit", "(", "101", ")", ";", "}", "longitude", "=", "longitude", "+", "180", ";", "return", "(", "int", ")", "Math", ".", "round", "(", "(", "longitude", "/", "0.000089932161921", ")", ")", ";", "}", "public", "double", "findLat", "(", "double", "orig_lon_1", ",", "double", "orig_lat_1", ",", "int", "distance", ")", "{", "double", "d", "=", "(", "double", ")", "distance", "/", "1000", ";", "double", "dist", "=", "d", "/", "6371.0", ";", "double", "brng", "=", "0", "*", "(", "Math", ".", "PI", "/", "180", ")", ";", "double", "lat1", "=", "orig_lat_1", "*", "(", "Math", ".", "PI", "/", "180", ")", ";", "double", "lat2", "=", "Math", ".", "asin", "(", "Math", ".", "sin", "(", "lat1", ")", "*", "Math", ".", "cos", "(", "dist", ")", "+", "Math", ".", "cos", "(", "lat1", ")", "*", "Math", ".", "sin", "(", "dist", ")", "*", "Math", ".", "cos", "(", "brng", ")", ")", ";", "lat2", "=", "lat2", "*", "(", "180", "/", "Math", ".", "PI", ")", ";", "return", "lat2", ";", "}", "public", "double", "findLong", "(", "double", "orig_lon_1", ",", "double", "orig_lat_1", ",", "int", "distance", ")", "{", "double", "d", "=", "(", "double", ")", "distance", "/", "1000", ";", "double", "dist", "=", "d", "/", "6371.0", ";", "double", "brng", "=", "90", "*", "(", "Math", ".", "PI", "/", "180", ")", ";", "double", "lat1", "=", "orig_lat_1", "*", "(", "Math", ".", "PI", "/", "180", ")", ";", "double", "lon1", "=", "orig_lon_1", "*", "(", "Math", ".", "PI", "/", "180", ")", ";", "double", "lat2", "=", "Math", ".", "asin", "(", "Math", ".", "sin", "(", "lat1", ")", "*", "Math", ".", "cos", "(", "dist", ")", "+", "Math", ".", "cos", "(", "lat1", ")", "*", "Math", ".", "sin", "(", "dist", ")", "*", "Math", ".", "cos", "(", "brng", ")", ")", ";", "double", "lon2", "=", "lon1", "+", "Math", ".", "atan2", "(", "Math", ".", "sin", "(", "brng", ")", "*", "Math", ".", "sin", "(", "dist", ")", "*", "Math", ".", "cos", "(", "lat1", ")", ",", "Math", ".", "cos", "(", "dist", ")", "-", "Math", ".", "sin", "(", "lat1", ")", "*", "Math", ".", "sin", "(", "lat2", ")", ")", ";", "lon2", "=", "(", "lon2", "+", "3", "*", "Math", ".", "PI", ")", "%", "(", "2", "*", "Math", ".", "PI", ")", "-", "Math", ".", "PI", ";", "lon2", "=", "lon2", "*", "(", "180", "/", "Math", ".", "PI", ")", ";", "Log", ".", "d", "(", "\"location\"", ",", "\"lon2:", "\"", "+", "lon2", ")", ";", "return", "lon2", ";", "}", "public", "int", "policyToWidth", "(", "int", "policy", ")", "{", "return", "policy", "/", "10", ";", "}", "private", "BigInteger", "[", "]", "multPolys", "(", "BigInteger", "[", "]", "a", ",", "BigInteger", "[", "]", "b", ")", "{", "int", "cLength", "=", "(", "a", ".", "length", "-", "1", ")", "+", "(", "b", ".", "length", "-", "1", ")", "+", "1", ";", "BigInteger", "[", "]", "c", "=", "new", "BigInteger", "[", "cLength", "]", ";", "BigInteger", "[", "]", "newA", "=", "new", "BigInteger", "[", "cLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newA", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "<", "a", ".", "length", ")", "{", "newA", "[", "i", "]", "=", "a", "[", "i", "]", ";", "}", "else", "{", "newA", "[", "i", "]", "=", "new", "BigInteger", "(", "\"0\"", ")", ";", "}", "}", "BigInteger", "[", "]", "newB", "=", "new", "BigInteger", "[", "cLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newB", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", "<", "b", ".", "length", ")", "{", "newB", "[", "i", "]", "=", "b", "[", "i", "]", ";", "}", "else", "{", "newB", "[", "i", "]", "=", "new", "BigInteger", "(", "\"0\"", ")", ";", "}", "}", "for", "(", "int", "n", "=", "0", ";", "n", "<", "c", ".", "length", ";", "n", "++", ")", "{", "BigInteger", "tmp", "=", "new", "BigInteger", "(", "\"0\"", ")", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<=", "n", ";", "k", "++", ")", "{", "tmp", "=", "tmp", ".", "add", "(", "newA", "[", "k", "]", ".", "multiply", "(", "newB", "[", "n", "-", "k", "]", ")", ")", ";", "}", "c", "[", "n", "]", "=", "tmp", ";", "}", "return", "c", ";", "}", "private", "treeQueue", "buildRow", "(", "treeQueue", "bottom", ")", "{", "treeQueue", "newRow", "=", "new", "treeQueue", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bottom", ".", "length", ";", "i", "++", ")", "{", "tree", "cur", "=", "bottom", ".", "peek", "(", "i", ")", ";", "tree", "parent", "=", "cur", ".", "createParent", "(", ")", ";", "newRow", ".", "push", "(", "parent", ")", ";", "cur", ".", "setParent", "(", "parent", ")", ";", "if", "(", "cur", ".", "upRightward", "(", ")", ")", "{", "parent", ".", "left", "=", "cur", ";", "if", "(", "i", "+", "1", "<", "bottom", ".", "length", ")", "{", "parent", ".", "right", "=", "bottom", ".", "peek", "(", "i", "+", "1", ")", ";", "bottom", ".", "peek", "(", "i", "+", "1", ")", ".", "setParent", "(", "parent", ")", ";", "}", "i", "=", "i", "+", "1", ";", "}", "else", "{", "parent", ".", "right", "=", "cur", ";", "if", "(", "i", "-", "1", ">=", "0", ")", "{", "parent", ".", "left", "=", "bottom", ".", "peek", "(", "i", "-", "1", ")", ";", "bottom", ".", "peek", "(", "i", "-", "1", ")", ".", "setParent", "(", "parent", ")", ";", "}", "}", "}", "return", "newRow", ";", "}", "public", "tree", "buildUp", "(", "treeQueue", "leaves", ")", "{", "treeQueue", "top", "=", "new", "treeQueue", "(", ")", ";", "treeQueue", "bottom", "=", "leaves", ";", "while", "(", "top", ".", "length", "!=", "1", ")", "{", "top", "=", "buildRow", "(", "bottom", ")", ";", "bottom", "=", "top", ";", "}", "return", "top", ".", "peek", "(", "0", ")", ";", "}", "public", "treeQueue", "findPath", "(", "tree", "leaf", ",", "int", "height", ")", "{", "treeQueue", "answer", "=", "new", "treeQueue", "(", ")", ";", "tree", "cur", "=", "leaf", ";", "while", "(", "cur", ".", "height", "<", "height", ")", "{", "answer", ".", "push", "(", "cur", ")", ";", "cur", "=", "cur", ".", "createParent", "(", ")", ";", "}", "return", "answer", ";", "}", "public", "treeQueue", "findWall", "(", "tree", "leftEnd", ",", "tree", "rightEnd", ",", "tree", "root", ")", "{", "treeQueue", "answer", "=", "new", "treeQueue", "(", ")", ";", "treeQueue", "bottom", "=", "new", "treeQueue", "(", ")", ";", "treeQueue", "top", "=", "new", "treeQueue", "(", ")", ";", "top", ".", "push", "(", "root", ")", ";", "while", "(", "top", ".", "length", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "top", ".", "length", ";", "i", "++", ")", "{", "tree", "cur", "=", "top", ".", "peek", "(", "i", ")", ";", "if", "(", "cur", ".", "leftLeaf", "(", ")", "==", "null", "||", "cur", ".", "rightLeaf", "(", ")", "==", "null", ")", "{", "if", "(", "cur", ".", "left", "!=", "null", ")", "{", "bottom", ".", "push", "(", "cur", ".", "left", ")", ";", "}", "if", "(", "cur", ".", "right", "!=", "null", ")", "{", "bottom", ".", "push", "(", "cur", ".", "right", ")", ";", "}", "}", "else", "{", "answer", ".", "push", "(", "cur", ")", ";", "}", "}", "top", "=", "bottom", ";", "bottom", "=", "new", "treeQueue", "(", ")", ";", "}", "return", "answer", ";", "}", "private", "BigInteger", "[", "]", "[", "]", "genPolysFromRoots", "(", "treeQueue", "trees", ")", "{", "BigInteger", "result", "[", "]", "[", "]", "=", "new", "BigInteger", "[", "trees", ".", "length", "]", "[", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "trees", ".", "length", ";", "i", "++", ")", "{", "BigInteger", "[", "]", "tmp", "=", "new", "BigInteger", "[", "2", "]", ";", "tmp", "[", "0", "]", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "trees", ".", "peek", "(", "i", ")", ".", "value", "*", "-", "1", ")", ")", ";", "tmp", "[", "1", "]", "=", "new", "BigInteger", "(", "\"1\"", ")", ";", "result", "[", "i", "]", "=", "tmp", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "result", ".", "length", ";", "i", "++", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "result", "[", "i", "]", ".", "length", ";", "j", "++", ")", "{", "}", "}", "return", "result", ";", "}", "public", "BigInteger", "[", "]", "makeCoefficientsTwo", "(", "treeQueue", "repSet", ")", "{", "BigInteger", "polys", "[", "]", "[", "]", "=", "genPolysFromRoots", "(", "repSet", ")", ";", "BigInteger", "[", "]", "cur", "=", "multPolys", "(", "polys", "[", "0", "]", ",", "polys", "[", "1", "]", ")", ";", "for", "(", "int", "i", "=", "2", ";", "i", "<", "polys", ".", "length", ";", "i", "++", ")", "{", "cur", "=", "multPolys", "(", "cur", ",", "polys", "[", "i", "]", ")", ";", "}", "return", "cur", ";", "}", "public", "BigInteger", "[", "]", "makeCoefficientsOne", "(", "treeQueue", "repSet", ")", "{", "BigInteger", "[", "]", "answer", "=", "new", "BigInteger", "[", "repSet", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "repSet", ".", "length", ";", "i", "++", ")", "{", "answer", "[", "i", "]", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "repSet", ".", "peek", "(", "i", ")", ".", "value", "*", "-", "1", ")", ")", ";", "}", "return", "answer", ";", "}", "public", "BigInteger", "[", "]", "makeCoefficients", "(", "treeQueue", "repSet", ",", "int", "method", ")", "{", "if", "(", "method", "==", "1", ")", "{", "Log", ".", "d", "(", "\"poly\"", ",", "\"\"", ")", ";", "return", "makeCoefficientsOne", "(", "repSet", ")", ";", "}", "else", "if", "(", "method", "==", "2", ")", "{", "Log", ".", "d", "(", "\"poly\"", ",", "\"\"", ")", ";", "return", "makeCoefficientsTwo", "(", "repSet", ")", ";", "}", "else", "{", "Log", ".", "d", "(", "\"poly\"", ",", "\"\"", ")", ";", "return", "null", ";", "}", "}", "public", "BigInteger", "[", "]", "computation", "(", "treeQueue", "coveringSet", ",", "BigInteger", "[", "]", "encCoe", ",", "int", "bits", ",", "BigInteger", "g", ",", "BigInteger", "n", ",", "int", "method", ")", "{", "BigInteger", "[", "]", "results", "=", "null", ";", "Random", "rand", "=", "new", "Random", "(", ")", ";", "Paillier", "paillierE", "=", "new", "Paillier", "(", "false", ")", ";", "paillierE", ".", "loadPublicKey", "(", "g", ",", "n", ")", ";", "if", "(", "method", "==", "1", ")", "{", "results", "=", "new", "BigInteger", "[", "encCoe", ".", "length", "*", "coveringSet", ".", "length", "]", ";", "int", "k", "=", "0", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "coveringSet", ".", "length", ";", "j", "++", ")", "{", "int", "tmp", "=", "coveringSet", ".", "peek", "(", "j", ")", ".", "value", ";", "BigInteger", "bob", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "tmp", ")", ")", ";", "bob", "=", "paillierE", ".", "Encryption", "(", "bob", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "BigInteger", "alice", "=", "encCoe", "[", "i", "]", ";", "BigInteger", "c", "=", "bob", ".", "multiply", "(", "alice", ")", ".", "mod", "(", "paillierE", ".", "nsquare", ")", ";", "results", "[", "k", "]", "=", "c", ";", "BigInteger", "r", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "rand", ".", "nextInt", "(", "9999999", ")", ")", ")", ";", "results", "[", "k", "]", "=", "homoMult", "(", "results", "[", "k", "]", ",", "r", ",", "n", ")", ";", "k", "++", ";", "}", "}", "}", "else", "if", "(", "method", "==", "2", ")", "{", "results", "=", "new", "BigInteger", "[", "coveringSet", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "coveringSet", ".", "length", ";", "i", "++", ")", "{", "BigInteger", "b", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "coveringSet", ".", "peek", "(", "i", ")", ".", "value", ")", ")", ";", "results", "[", "i", "]", "=", "homoEval", "(", "b", ",", "encCoe", ",", "n", ")", ";", "BigInteger", "r", "=", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "rand", ".", "nextInt", "(", "9999999", ")", ")", ")", ";", "results", "[", "i", "]", "=", "homoMult", "(", "results", "[", "i", "]", ",", "r", ",", "n", ")", ";", "}", "}", "Collections", ".", "shuffle", "(", "Arrays", ".", "asList", "(", "results", ")", ")", ";", "return", "results", ";", "}", "public", "Paillier", "getKey", "(", "int", "bits", ")", "{", "shareSingleton", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "if", "(", "share", ".", "pKey", "==", "null", ")", "{", "share", ".", "pKey", "=", "new", "Paillier", "(", "bits", ",", "64", ")", ";", "}", "return", "share", ".", "pKey", ";", "}", "public", "BigInteger", "[", "]", "encryptArray", "(", "BigInteger", "[", "]", "clear", ",", "Context", "context", ")", "{", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "context", ")", ";", "int", "bits", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"bits\"", ",", "\"1024\"", ")", ")", ";", "Paillier", "p", "=", "getKey", "(", "bits", ")", ";", "BigInteger", "[", "]", "priv", "=", "p", ".", "privateKey", "(", ")", ";", "BigInteger", "[", "]", "encCoe", "=", "new", "BigInteger", "[", "clear", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "encCoe", "[", "i", "]", "=", "p", ".", "Encryption", "(", "clear", "[", "i", "]", ")", ";", "}", "return", "encCoe", ";", "}", "public", "int", "[", "]", "makeSpan", "(", "int", "stage", ",", "Location", "loc", ",", "int", "policy", ")", "{", "double", "edge", "=", "0.0", ";", "int", "edgeLeafNumber", "=", "0", ";", "int", "userLeafNumber", "=", "0", ";", "if", "(", "stage", "==", "2", "||", "stage", "==", "3", ")", "{", "edge", "=", "findLong", "(", "loc", ".", "getLongitude", "(", ")", ",", "loc", ".", "getLatitude", "(", ")", ",", "policy", ")", ";", "edgeLeafNumber", "=", "longitudeToLeaf", "(", "edge", ")", ";", "userLeafNumber", "=", "longitudeToLeaf", "(", "loc", ".", "getLongitude", "(", ")", ")", ";", "}", "else", "if", "(", "stage", "==", "5", "||", "stage", "==", "6", ")", "{", "edge", "=", "findLat", "(", "loc", ".", "getLongitude", "(", ")", ",", "loc", ".", "getLatitude", "(", ")", ",", "policy", ")", ";", "edgeLeafNumber", "=", "latitudeToLeaf", "(", "edge", ")", ";", "userLeafNumber", "=", "latitudeToLeaf", "(", "loc", ".", "getLatitude", "(", ")", ")", ";", "}", "int", "spanLength", "=", "(", "Math", ".", "abs", "(", "edgeLeafNumber", "-", "userLeafNumber", ")", "*", "2", ")", "+", "1", ";", "Log", ".", "d", "(", "\"stats\"", ",", "\"\"", "+", "spanLength", ")", ";", "int", "left", "=", "userLeafNumber", "-", "(", "spanLength", "/", "2", ")", ";", "int", "right", "=", "userLeafNumber", "+", "(", "spanLength", "/", "2", ")", ";", "Log", ".", "d", "(", "\"stage", "\"", "+", "stage", ",", "\"\"", "+", "left", "+", "\"", "to", "\"", "+", "right", "+", "\".", "That's:", "\"", "+", "spanLength", "+", "\"\"", "+", "userLeafNumber", ")", ";", "return", "new", "int", "[", "]", "{", "left", ",", "userLeafNumber", ",", "right", "}", ";", "}", "public", "boolean", "check", "(", "String", "[", "]", "tokens", ",", "Context", "context", ",", "int", "bits", ")", "{", "Paillier", "paillierD", "=", "getKey", "(", "bits", ")", ";", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "boolean", "found", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tokens", ".", "length", ";", "i", "++", ")", "{", "BigInteger", "val", "=", "new", "BigInteger", "(", "tokens", "[", "i", "]", ",", "32", ")", ";", "String", "clear", "=", "paillierD", ".", "Decryption", "(", "val", ")", ".", "toString", "(", ")", ";", "Log", ".", "d", "(", "\"prot\"", ",", "\"unenc:", "\"", "+", "clear", ")", ";", "if", "(", "clear", ".", "equals", "(", "\"0\"", ")", ")", "{", "Log", ".", "d", "(", "\"hooray!\"", ",", "\"It", "was", "0\"", ")", ";", "found", "=", "true", ";", "break", ";", "}", "}", "long", "end", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "total_checkTime", "=", "end", "-", "start", ";", "Log", ".", "d", "(", "\"stats\"", ",", "\"\"", "+", "total_checkTime", "+", "\"ms\"", ")", ";", "return", "found", ";", "}", "public", "String", "sendFBMessage", "(", "String", "rec", ",", "String", "message", ",", "Context", "context", ")", "{", "Random", "gen", "=", "new", "Random", "(", ")", ";", "String", "session_id", "=", "String", ".", "format", "(", "\"%05d\"", ",", "gen", ".", "nextInt", "(", "9000", ")", ")", ";", "xmppService", ".", "sendMessage", "(", "rec", ",", "message", ",", "1", ",", "session_id", ",", "context", ")", ";", "return", "session_id", ";", "}", "public", "void", "sendFBMessage", "(", "String", "rec", ",", "String", "message", ",", "int", "stage", ",", "String", "session", ",", "Context", "context", ")", "{", "xmppService", ".", "sendMessage", "(", "rec", ",", "message", ",", "stage", ",", "session", ",", "context", ")", ";", "}", "public", "Location", "locSimple", "(", "Context", "context", ")", "{", "LocationManager", "lManager", "=", "(", "LocationManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "LOCATION_SERVICE", ")", ";", "Location", "lastKnownLocation", "=", "lManager", ".", "getLastKnownLocation", "(", "LocationManager", ".", "GPS_PROVIDER", ")", ";", "if", "(", "lastKnownLocation", "==", "null", ")", "{", "lastKnownLocation", "=", "lManager", ".", "getLastKnownLocation", "(", "LocationManager", ".", "NETWORK_PROVIDER", ")", ";", "}", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "context", ")", ";", "if", "(", "prefs", ".", "getBoolean", "(", "\"\"", ",", "false", ")", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", ")", ";", "Double", "fake_lat", "=", "Double", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"fake_lat\"", ",", "\"37.2708\"", ")", ")", ";", "Double", "fake_lon", "=", "Double", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"fake_lon\"", ",", "\"-76.7113\"", ")", ")", ";", "Log", ".", "d", "(", "\"location\"", ",", "\"fake_lat:", "\"", "+", "fake_lat", "+", "\"\"", "+", "fake_lon", ")", ";", "lastKnownLocation", "=", "new", "Location", "(", "\"\"", ")", ";", "lastKnownLocation", ".", "setLatitude", "(", "fake_lat", ")", ";", "lastKnownLocation", ".", "setLongitude", "(", "fake_lon", ")", ";", "lastKnownLocation", ".", "setTime", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "}", "if", "(", "lastKnownLocation", "==", "null", ")", "{", "Log", ".", "d", "(", "\"recieve\"", ",", "\"\"", ")", ";", "}", "return", "lastKnownLocation", ";", "}", "public", "void", "notification", "(", "String", "ticker", ",", "String", "title", ",", "String", "content", ",", "Context", "context", ",", "Intent", "notificationIntent", ")", "{", "NotificationManager", "mNM", "=", "(", "NotificationManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "NOTIFICATION_SERVICE", ")", ";", "Notification", "notification", "=", "new", "Notification", "(", "R", ".", "drawable", ".", "ic_launcher", ",", "ticker", ",", "System", ".", "currentTimeMillis", "(", ")", ")", ";", "PendingIntent", "contentIntent", "=", "PendingIntent", ".", "getActivity", "(", "context", ",", "0", ",", "notificationIntent", ",", "PendingIntent", ".", "FLAG_UPDATE_CURRENT", ")", ";", "notification", ".", "setLatestEventInfo", "(", "context", ",", "title", ",", "content", ",", "contentIntent", ")", ";", "mNM", ".", "notify", "(", "1", ",", "notification", ")", ";", "}", "public", "int", "getPathLength", "(", "int", "policy", ")", "{", "double", "top", "=", "Math", ".", "log", "(", "(", "double", ")", "policy", "*", "2.0", "/", "10.0", ")", ";", "double", "real", "=", "top", "/", "Math", ".", "log", "(", "2", ")", ";", "return", "Math", ".", "min", "(", "15", ",", "(", "int", ")", "Math", ".", "round", "(", "real", ")", "+", "1", ")", ";", "}", "}", "</s>" ]
8,969
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "public", "class", "buffer", "{", "public", "String", "session", ";", "public", "String", "message", "=", "\"\"", ";", "public", "long", "start", ";", "public", "String", "sender", ";", "public", "buffer", "(", "String", "nSender", ",", "long", "nStart", ",", "String", "nSession", ")", "{", "sender", "=", "nSender", ";", "start", "=", "nStart", ";", "session", "=", "nSession", ";", "}", "public", "void", "append", "(", "String", "m", ")", "{", "message", "=", "message", "+", "m", ";", "}", "}", "</s>" ]
8,970
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "public", "class", "messageQueue", "{", "private", "String", "[", "]", "arr", "=", "new", "String", "[", "2", "]", ";", "private", "int", "end", "=", "0", ";", "public", "int", "length", "=", "end", ";", "public", "void", "push", "(", "String", "newMessage", ")", "{", "if", "(", "end", "==", "arr", ".", "length", "-", "1", ")", "{", "String", "[", "]", "tmp", "=", "new", "String", "[", "arr", ".", "length", "*", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";", "i", "++", ")", "{", "tmp", "[", "i", "]", "=", "arr", "[", "i", "]", ";", "}", "arr", "=", "tmp", ";", "}", "arr", "[", "end", "]", "=", "newMessage", ";", "end", "++", ";", "length", "=", "end", ";", "}", "public", "String", "peek", "(", "int", "spot", ")", "{", "if", "(", "spot", ">=", "end", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "spot", ")", ";", "System", ".", "exit", "(", "401", ")", ";", "}", "if", "(", "spot", "==", "-", "1", ")", "{", "return", "arr", "[", "end", "-", "1", "]", ";", "}", "return", "arr", "[", "spot", "]", ";", "}", "public", "int", "length", "(", ")", "{", "return", "end", ";", "}", "}", "</s>" ]
8,971
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "Chat", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "MessageListener", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "packet", ".", "Message", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "location", ".", "Location", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "public", "class", "nearbyListener", "implements", "MessageListener", "{", "private", "Context", "context", ";", "private", "ArrayList", "<", "buffer", ">", "buffs", "=", "new", "ArrayList", "<", "buffer", ">", "(", ")", ";", "public", "nearbyListener", "(", "Context", "nContext", ")", "{", "context", "=", "nContext", ";", "}", "@", "Override", "public", "void", "processMessage", "(", "Chat", "chat", ",", "Message", "message", ")", "{", "Log", ".", "d", "(", "\"xmpp\"", ",", "\"\"", ")", ";", "buffer", "buff", "=", "parseIncoming", "(", "message", ")", ";", "if", "(", "buff", "!=", "null", ")", "{", "protocol", "p", "=", "new", "protocol", "(", ")", ";", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "context", ")", ";", "long", "end", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "total_recTime", "=", "end", "-", "buff", ".", "start", ";", "Log", ".", "d", "(", "\"stats\"", ",", "\"It", "took:", "\"", "+", "total_recTime", "+", "\"\"", ")", ";", "String", "sender", "=", "buff", ".", "sender", ";", "String", "[", "]", "parts", "=", "buff", ".", "message", ".", "split", "(", "\":\"", ")", ";", "int", "stage", "=", "Integer", ".", "valueOf", "(", "parts", "[", "0", "]", ")", ";", "shareSingleton", "share", ";", "switch", "(", "stage", ")", "{", "case", "1", ":", "if", "(", "parts", "[", "2", "]", ".", "equals", "(", "\"\"", ")", ")", "{", "int", "bits", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"bits\"", ",", "\"1024\"", ")", ")", ";", "int", "policy", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"policy\"", ",", "\"160000\"", ")", ")", ";", "int", "method", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"poly_method\"", ",", "\"1\"", ")", ")", ";", "Log", ".", "d", "(", "\"test\"", ",", "\"method:", "\"", "+", "method", "+", "\"", "policy:", "\"", "+", "policy", "+", "\"", "bits:", "\"", "+", "bits", ")", ";", "int", "[", "]", "span", "=", "new", "int", "[", "3", "]", ";", "span", "=", "p", ".", "makeSpan", "(", "2", ",", "p", ".", "locSimple", "(", "context", ")", ",", "policy", ")", ";", "treeQueue", "leaves", "=", "p", ".", "genLeaves", "(", "span", "[", "0", "]", ",", "span", "[", "2", "]", ",", "span", "[", "1", "]", ",", "\"lon\"", ")", ";", "Log", ".", "d", "(", "\"bob-stats\"", ",", "\"\"", "+", "leaves", ".", "length", ")", ";", "tree", "root", "=", "p", ".", "buildUp", "(", "leaves", ")", ";", "Log", ".", "d", "(", "\"bob-stats\"", ",", "\"\"", "+", "root", ".", "count", "(", ")", "+", "\"", "nodes\"", ")", ";", "treeQueue", "wall", "=", "p", ".", "findWall", "(", "leaves", ".", "peek", "(", "0", ")", ",", "leaves", ".", "peek", "(", "-", "1", ")", ",", "root", ")", ";", "BigInteger", "[", "]", "coefficients", "=", "p", ".", "makeCoefficients", "(", "wall", ",", "method", ")", ";", "Log", ".", "d", "(", "\"bob-stats\"", ",", "\"\"", "+", "coefficients", ".", "length", ")", ";", "BigInteger", "[", "]", "encCoe", "=", "p", ".", "encryptArray", "(", "coefficients", ",", "context", ")", ";", "Log", ".", "d", "(", "\"curious\"", ",", "\"\"", "+", "Character", ".", "MAX_RADIX", ")", ";", "StringBuffer", "txt", "=", "new", "StringBuffer", "(", ")", ";", "txt", ".", "append", "(", "encCoe", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "txt", ".", "append", "(", "\":\"", "+", "encCoe", "[", "i", "]", ".", "toString", "(", "32", ")", ")", ";", "}", "BigInteger", "[", "]", "key", "=", "p", ".", "getKey", "(", "1024", ")", ".", "publicKey", "(", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "policy", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "bits", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "key", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "key", "[", "1", "]", ".", "toString", "(", "32", ")", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "method", ")", ";", "p", ".", "sendFBMessage", "(", "sender", ",", "txt", ".", "toString", "(", ")", ",", "3", ",", "buff", ".", "session", ",", "context", ")", ";", "break", ";", "}", "case", "3", ":", "int", "policy", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "5", "]", ")", ";", "int", "bits", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "4", "]", ")", ";", "BigInteger", "g", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "3", "]", ",", "32", ")", ";", "BigInteger", "n", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "2", "]", ",", "32", ")", ";", "int", "method", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "1", "]", ")", ";", "int", "[", "]", "span", "=", "p", ".", "makeSpan", "(", "3", ",", "p", ".", "locSimple", "(", "context", ")", ",", "160934", ")", ";", "String", "mapString", "=", "new", "StringBuffer", "(", "Integer", ".", "toBinaryString", "(", "span", "[", "1", "]", ")", ")", ".", "toString", "(", ")", ";", "tree", "alice", "=", "new", "tree", "(", "span", "[", "1", "]", ",", "mapString", ".", "toCharArray", "(", ")", ",", "null", ",", "null", ",", "0", ",", "\"lon\"", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "alice", ".", "value", ")", ";", "long", "pathStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "treeQueue", "path", "=", "p", ".", "findPath", "(", "alice", ",", "p", ".", "getPathLength", "(", "policy", ")", ")", ";", "long", "pathEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "(", "pathEnd", "-", "pathStart", ")", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "path", ".", "length", ")", ";", "BigInteger", "[", "]", "encCoe", "=", "new", "BigInteger", "[", "parts", ".", "length", "-", "7", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "encCoe", "[", "i", "]", "=", "new", "BigInteger", "(", "parts", "[", "i", "+", "2", "]", ",", "32", ")", ";", "}", "Log", ".", "d", "(", "\"test\"", ",", "\"\"", ")", ";", "long", "compStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "BigInteger", "[", "]", "results", "=", "p", ".", "computation", "(", "path", ",", "encCoe", ",", "bits", ",", "g", ",", "n", ",", "method", ")", ";", "long", "compEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "(", "compEnd", "-", "compStart", ")", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "results", ".", "length", ")", ";", "StringBuffer", "txt", "=", "new", "StringBuffer", "(", ")", ";", "txt", ".", "append", "(", "results", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "results", ".", "length", ";", "i", "++", ")", "{", "txt", ".", "append", "(", "\":\"", "+", "results", "[", "i", "]", ".", "toString", "(", "32", ")", ")", ";", "}", "p", ".", "sendFBMessage", "(", "sender", ",", "txt", ".", "toString", "(", ")", ",", "4", ",", "buff", ".", "session", ",", "context", ")", ";", "break", ";", "case", "4", ":", "Log", ".", "d", "(", "\"test\"", ",", "\"checking!\"", ")", ";", "String", "[", "]", "cValues", "=", "new", "String", "[", "parts", ".", "length", "-", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cValues", ".", "length", ";", "i", "++", ")", "{", "cValues", "[", "i", "]", "=", "parts", "[", "i", "+", "2", "]", ";", "}", "bits", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"bits\"", ",", "\"1024\"", ")", ")", ";", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "foundLon", "=", "p", ".", "check", "(", "cValues", ",", "context", ",", "bits", ")", ";", "Log", ".", "d", "(", "\"output\"", ",", "\"\"", "+", "share", ".", "foundLon", ")", ";", "bits", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"bits\"", ",", "\"1024\"", ")", ")", ";", "policy", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"policy\"", ",", "\"160000\"", ")", ")", ";", "method", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"poly_method\"", ",", "\"1\"", ")", ")", ";", "span", "=", "p", ".", "makeSpan", "(", "5", ",", "p", ".", "locSimple", "(", "context", ")", ",", "policy", ")", ";", "treeQueue", "leaves", "=", "p", ".", "genLeaves", "(", "span", "[", "0", "]", ",", "span", "[", "2", "]", ",", "span", "[", "1", "]", ",", "\"lat\"", ")", ";", "Log", ".", "d", "(", "\"checking\"", ",", "\"\"", "+", "span", "[", "1", "]", ")", ";", "tree", "root", "=", "p", ".", "buildUp", "(", "leaves", ")", ";", "treeQueue", "wall", "=", "p", ".", "findWall", "(", "leaves", ".", "peek", "(", "0", ")", ",", "leaves", ".", "peek", "(", "-", "1", ")", ",", "root", ")", ";", "BigInteger", "[", "]", "coefficients", "=", "p", ".", "makeCoefficients", "(", "wall", ",", "method", ")", ";", "encCoe", "=", "p", ".", "encryptArray", "(", "coefficients", ",", "context", ")", ";", "txt", "=", "new", "StringBuffer", "(", ")", ";", "txt", ".", "append", "(", "encCoe", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "txt", ".", "append", "(", "\":\"", "+", "encCoe", "[", "i", "]", ".", "toString", "(", "32", ")", ")", ";", "}", "BigInteger", "[", "]", "key", "=", "p", ".", "getKey", "(", "1024", ")", ".", "publicKey", "(", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "policy", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "bits", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "key", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "key", "[", "1", "]", ".", "toString", "(", "32", ")", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "method", ")", ";", "p", ".", "sendFBMessage", "(", "sender", ",", "txt", ".", "toString", "(", ")", ",", "6", ",", "buff", ".", "session", ",", "context", ")", ";", "break", ";", "case", "6", ":", "policy", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "5", "]", ")", ";", "bits", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "4", "]", ")", ";", "g", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "3", "]", ",", "32", ")", ";", "n", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "2", "]", ",", "32", ")", ";", "method", "=", "Integer", ".", "valueOf", "(", "parts", "[", "parts", ".", "length", "-", "1", "]", ")", ";", "span", "=", "p", ".", "makeSpan", "(", "6", ",", "p", ".", "locSimple", "(", "context", ")", ",", "160934", ")", ";", "mapString", "=", "new", "StringBuffer", "(", "Integer", ".", "toBinaryString", "(", "span", "[", "1", "]", ")", ")", ".", "toString", "(", ")", ";", "alice", "=", "new", "tree", "(", "span", "[", "1", "]", ",", "mapString", ".", "toCharArray", "(", ")", ",", "null", ",", "null", ",", "0", ",", "\"lat\"", ")", ";", "Log", ".", "d", "(", "\"checking\"", ",", "\"alice:", "\"", "+", "alice", ".", "value", ")", ";", "path", "=", "p", ".", "findPath", "(", "alice", ",", "p", ".", "getPathLength", "(", "policy", ")", ")", ";", "Log", ".", "d", "(", "\"stats\"", ",", "\"\"", "+", "path", ".", "length", ")", ";", "encCoe", "=", "new", "BigInteger", "[", "parts", ".", "length", "-", "7", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "encCoe", ".", "length", ";", "i", "++", ")", "{", "encCoe", "[", "i", "]", "=", "new", "BigInteger", "(", "parts", "[", "i", "+", "2", "]", ",", "32", ")", ";", "}", "Log", ".", "d", "(", "\"test\"", ",", "\"\"", ")", ";", "results", "=", "p", ".", "computation", "(", "path", ",", "encCoe", ",", "bits", ",", "g", ",", "n", ",", "method", ")", ";", "txt", "=", "new", "StringBuffer", "(", ")", ";", "txt", ".", "append", "(", "results", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "results", ".", "length", ";", "i", "++", ")", "{", "txt", ".", "append", "(", "\":\"", "+", "results", "[", "i", "]", ".", "toString", "(", "32", ")", ")", ";", "}", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "pKey", "=", "null", ";", "Paillier", "last", "=", "p", ".", "getKey", "(", "1024", ")", ";", "BigInteger", "[", "]", "pub", "=", "last", ".", "publicKey", "(", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "pub", "[", "0", "]", ".", "toString", "(", "32", ")", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "pub", "[", "1", "]", ".", "toString", "(", "32", ")", ")", ";", "p", ".", "sendFBMessage", "(", "sender", ",", "txt", ".", "toString", "(", ")", ",", "7", ",", "buff", ".", "session", ",", "context", ")", ";", "break", ";", "case", "7", ":", "Log", ".", "d", "(", "\"test\"", ",", "\"checking!\"", ")", ";", "cValues", "=", "new", "String", "[", "parts", ".", "length", "-", "4", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cValues", ".", "length", ";", "i", "++", ")", "{", "cValues", "[", "i", "]", "=", "parts", "[", "i", "+", "2", "]", ";", "}", "bits", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"bits\"", ",", "\"1024\"", ")", ")", ";", "boolean", "latResult", "=", "p", ".", "check", "(", "cValues", ",", "context", ",", "bits", ")", ";", "Log", ".", "d", "(", "\"output\"", ",", "\"\"", "+", "latResult", ")", ";", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "pKey", "=", "null", ";", "boolean", "near", "=", "latResult", "&&", "share", ".", "foundLon", ";", "String", "contentTitle", "=", "sender", "+", "\"", "queried", "you\"", ";", "String", "contentText", ";", "Location", "l", "=", "p", ".", "locSimple", "(", "context", ")", ";", "if", "(", "near", ")", "{", "contentText", "=", "\"\"", ";", "}", "else", "{", "contentText", "=", "\"\"", ";", "l", ".", "setLatitude", "(", "0.0", ")", ";", "l", ".", "setLongitude", "(", "0.0", ")", ";", "}", "Intent", "intent", "=", "new", "Intent", "(", "context", ",", "MainActivity", ".", "class", ")", ";", "p", ".", "notification", "(", "\"\"", ",", "contentTitle", ",", "contentText", ",", "context", ",", "intent", ")", ";", "g", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "2", "]", ",", "32", ")", ";", "n", "=", "new", "BigInteger", "(", "parts", "[", "parts", ".", "length", "-", "1", "]", ",", "32", ")", ";", "last", "=", "p", ".", "getKey", "(", "1024", ")", ";", "last", ".", "loadPublicKey", "(", "g", ",", "n", ")", ";", "double", "[", "]", "orig", "=", "{", "l", ".", "getLatitude", "(", ")", ",", "l", ".", "getLongitude", "(", ")", "}", ";", "String", "[", "]", "sendingLocation", "=", "new", "String", "[", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "orig", ".", "length", ";", "i", "++", ")", "{", "orig", "[", "i", "]", "=", "orig", "[", "i", "]", "*", "10000", ";", "orig", "[", "i", "]", "=", "Math", ".", "abs", "(", "orig", "[", "i", "]", ")", ";", "sendingLocation", "[", "i", "]", "=", "last", ".", "Encryption", "(", "new", "BigInteger", "(", "String", ".", "valueOf", "(", "(", "int", ")", "orig", "[", "i", "]", ")", ")", ")", ".", "toString", "(", "32", ")", ";", "}", "share", ".", "pKey", "=", "null", ";", "txt", "=", "new", "StringBuffer", "(", ")", ";", "txt", ".", "append", "(", "sendingLocation", "[", "0", "]", ")", ";", "txt", ".", "append", "(", "\":\"", "+", "sendingLocation", "[", "1", "]", ")", ";", "String", "sign", "=", "\"+\"", ";", "if", "(", "l", ".", "getLatitude", "(", ")", "<", "0", ")", "{", "sign", "=", "\"-\"", ";", "}", "txt", ".", "append", "(", "\":\"", "+", "sign", ")", ";", "sign", "=", "\"+\"", ";", "if", "(", "l", ".", "getLongitude", "(", ")", "<", "0", ")", "{", "sign", "=", "\"-\"", ";", "}", "txt", ".", "append", "(", "\":\"", "+", "sign", ")", ";", "p", ".", "sendFBMessage", "(", "sender", ",", "txt", ".", "toString", "(", ")", ",", "8", ",", "buff", ".", "session", ",", "context", ")", ";", "break", ";", "case", "8", ":", "last", "=", "p", ".", "getKey", "(", "1024", ")", ";", "double", "lat", "=", "last", ".", "Decryption", "(", "new", "BigInteger", "(", "parts", "[", "2", "]", ",", "32", ")", ")", ".", "doubleValue", "(", ")", ";", "double", "lon", "=", "last", ".", "Decryption", "(", "new", "BigInteger", "(", "parts", "[", "3", "]", ",", "32", ")", ")", ".", "doubleValue", "(", ")", ";", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "pKey", "=", "null", ";", "String", "latString", "=", "parts", "[", "4", "]", "+", "(", "lat", "/", "10000", ")", ";", "String", "lonString", "=", "parts", "[", "5", "]", "+", "(", "lon", "/", "10000", ")", ";", "long", "totalEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "latString", "+", "\":\"", "+", "lonString", ")", ";", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "Log", ".", "d", "(", "\"stats-alice\"", ",", "\"\"", "+", "(", "totalEnd", "-", "share", ".", "start", ")", ")", ";", "Intent", "i", "=", "new", "Intent", "(", "context", ",", "processedQueries", ".", "class", ")", ";", "i", ".", "setFlags", "(", "Intent", ".", "FLAG_ACTIVITY_NEW_TASK", ")", ";", "i", ".", "putExtra", "(", "\"lat\"", ",", "latString", ")", ";", "i", ".", "putExtra", "(", "\"lon\"", ",", "lonString", ")", ";", "i", ".", "putExtra", "(", "\"name\"", ",", "sender", ")", ";", "context", ".", "startActivity", "(", "i", ")", ";", "}", "}", "}", "private", "buffer", "searchBuff", "(", "String", "session", ")", "{", "for", "(", "buffer", "b", ":", "buffs", ")", "{", "if", "(", "b", ".", "session", ".", "equals", "(", "session", ")", ")", "{", "return", "b", ";", "}", "}", "return", "null", ";", "}", "private", "void", "clearBuff", "(", "buffer", "b", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "buffs", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "buffs", ".", "get", "(", "i", ")", "==", "b", ")", "{", "buffs", ".", "remove", "(", "i", ")", ";", "}", "}", "b", ".", "message", "=", "b", ".", "message", ".", "substring", "(", "0", ",", "b", ".", "message", ".", "length", "(", ")", "-", "2", ")", ";", "}", "private", "buffer", "parseIncoming", "(", "Message", "packet", ")", "{", "boolean", "lastPacket", "=", "false", ";", "if", "(", "packet", ".", "getBody", "(", ")", ".", "substring", "(", "0", ",", "2", ")", ".", "equals", "(", "\"@@\"", ")", ")", "{", "String", "[", "]", "parts", "=", "packet", ".", "getBody", "(", ")", ".", "split", "(", "\":\"", ")", ";", "String", "session", "=", "parts", "[", "1", "]", ";", "buffer", "buff", ";", "buff", "=", "searchBuff", "(", "session", ")", ";", "if", "(", "buff", "==", "null", ")", "{", "String", "sender", "=", "xmppService", ".", "getRoster", "(", ")", ".", "getEntry", "(", "packet", ".", "getFrom", "(", ")", ".", "toString", "(", ")", ")", ".", "getName", "(", ")", ";", "buff", "=", "new", "buffer", "(", "sender", ",", "System", ".", "currentTimeMillis", "(", ")", ",", "session", ")", ";", "buffs", ".", "add", "(", "buff", ")", ";", "buff", ".", "append", "(", "packet", ".", "getBody", "(", ")", ".", "substring", "(", "2", ",", "10", ")", ")", ";", "}", "String", "tmpMess", "=", "packet", ".", "getBody", "(", ")", ".", "substring", "(", "10", ")", ";", "buff", ".", "append", "(", "tmpMess", ")", ";", "lastPacket", "=", "packet", ".", "getBody", "(", ")", ".", "substring", "(", "packet", ".", "getBody", "(", ")", ".", "length", "(", ")", "-", "2", ")", ".", "equals", "(", "\"@@\"", ")", ";", "if", "(", "lastPacket", ")", "{", "clearBuff", "(", "buff", ")", ";", "return", "buff", ";", "}", "}", "return", "null", ";", "}", "}", "</s>" ]
8,972
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "Paillier", "{", "private", "BigInteger", "p", ",", "q", ",", "lambda", ";", "public", "BigInteger", "n", ";", "public", "BigInteger", "nsquare", ";", "public", "BigInteger", "g", ";", "private", "int", "bitLength", ";", "public", "Paillier", "(", "int", "bitLengthVal", ",", "int", "certainty", ")", "{", "KeyGeneration", "(", "bitLengthVal", ",", "certainty", ")", ";", "}", "public", "Paillier", "(", ")", "{", "KeyGeneration", "(", "32", ",", "16", ")", ";", "}", "public", "Paillier", "(", "boolean", "genKey", ")", "{", "if", "(", "genKey", ")", "{", "KeyGeneration", "(", "1024", ",", "64", ")", ";", "}", "else", "{", "}", "}", "public", "void", "loadPublicKey", "(", "BigInteger", "newG", ",", "BigInteger", "newN", ")", "{", "g", "=", "newG", ";", "n", "=", "newN", ";", "nsquare", "=", "newN", ".", "multiply", "(", "newN", ")", ";", "}", "public", "void", "loadPrivateKey", "(", "BigInteger", "newG", ",", "BigInteger", "newLambda", ",", "BigInteger", "newN", ")", "{", "g", "=", "newG", ";", "lambda", "=", "newLambda", ";", "n", "=", "newN", ";", "nsquare", "=", "newN", ".", "multiply", "(", "newN", ")", ";", "}", "public", "void", "KeyGeneration", "(", "int", "bitLengthVal", ",", "int", "certainty", ")", "{", "bitLength", "=", "bitLengthVal", ";", "p", "=", "new", "BigInteger", "(", "bitLength", "/", "2", ",", "certainty", ",", "new", "Random", "(", ")", ")", ";", "q", "=", "new", "BigInteger", "(", "bitLength", "/", "2", ",", "certainty", ",", "new", "Random", "(", ")", ")", ";", "n", "=", "p", ".", "multiply", "(", "q", ")", ";", "nsquare", "=", "n", ".", "multiply", "(", "n", ")", ";", "g", "=", "new", "BigInteger", "(", "\"2\"", ")", ";", "lambda", "=", "p", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ".", "multiply", "(", "q", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ")", ".", "divide", "(", "p", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ".", "gcd", "(", "q", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ")", ")", ";", "if", "(", "g", ".", "modPow", "(", "lambda", ",", "nsquare", ")", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ".", "divide", "(", "n", ")", ".", "gcd", "(", "n", ")", ".", "intValue", "(", ")", "!=", "1", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "exit", "(", "1", ")", ";", "}", "}", "public", "BigInteger", "Encryption", "(", "BigInteger", "m", ",", "BigInteger", "r", ")", "{", "return", "g", ".", "modPow", "(", "m", ",", "nsquare", ")", ".", "multiply", "(", "r", ".", "modPow", "(", "n", ",", "nsquare", ")", ")", ".", "mod", "(", "nsquare", ")", ";", "}", "public", "BigInteger", "Encryption", "(", "BigInteger", "m", ")", "{", "BigInteger", "r", "=", "new", "BigInteger", "(", "bitLength", ",", "new", "Random", "(", ")", ")", ";", "return", "g", ".", "modPow", "(", "m", ",", "nsquare", ")", ".", "multiply", "(", "r", ".", "modPow", "(", "n", ",", "nsquare", ")", ")", ".", "mod", "(", "nsquare", ")", ";", "}", "public", "BigInteger", "Decryption", "(", "BigInteger", "c", ")", "{", "BigInteger", "u", "=", "g", ".", "modPow", "(", "lambda", ",", "nsquare", ")", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ".", "divide", "(", "n", ")", ".", "modInverse", "(", "n", ")", ";", "return", "c", ".", "modPow", "(", "lambda", ",", "nsquare", ")", ".", "subtract", "(", "BigInteger", ".", "ONE", ")", ".", "divide", "(", "n", ")", ".", "multiply", "(", "u", ")", ".", "mod", "(", "n", ")", ";", "}", "public", "BigInteger", "[", "]", "privateKey", "(", ")", "{", "BigInteger", "[", "]", "k", "=", "{", "g", ",", "lambda", ",", "n", "}", ";", "return", "k", ";", "}", "public", "BigInteger", "[", "]", "publicKey", "(", ")", "{", "BigInteger", "[", "]", "k", "=", "{", "g", ",", "n", "}", ";", "return", "k", ";", "}", "public", "static", "void", "main", "(", "String", "[", "]", "str", ")", "{", "Paillier", "paillier", "=", "new", "Paillier", "(", ")", ";", "BigInteger", "m1", "=", "new", "BigInteger", "(", "\"20\"", ")", ";", "BigInteger", "m2", "=", "new", "BigInteger", "(", "\"60\"", ")", ";", "BigInteger", "em1", "=", "paillier", ".", "Encryption", "(", "m1", ")", ";", "BigInteger", "em2", "=", "paillier", ".", "Encryption", "(", "m2", ")", ";", "System", ".", "out", ".", "println", "(", "em1", ")", ";", "System", ".", "out", ".", "println", "(", "em2", ")", ";", "System", ".", "out", ".", "println", "(", "paillier", ".", "Decryption", "(", "em1", ")", ".", "toString", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "paillier", ".", "Decryption", "(", "em2", ")", ".", "toString", "(", ")", ")", ";", "BigInteger", "product_em1em2", "=", "em1", ".", "multiply", "(", "em2", ")", ".", "mod", "(", "paillier", ".", "nsquare", ")", ";", "BigInteger", "sum_m1m2", "=", "m1", ".", "add", "(", "m2", ")", ".", "mod", "(", "paillier", ".", "n", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "sum_m1m2", ".", "toString", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "paillier", ".", "Decryption", "(", "product_em1em2", ")", ".", "toString", "(", ")", ")", ";", "BigInteger", "expo_em1m2", "=", "em1", ".", "modPow", "(", "m2", ",", "paillier", ".", "nsquare", ")", ";", "BigInteger", "prod_m1m2", "=", "m1", ".", "multiply", "(", "m2", ")", ".", "mod", "(", "paillier", ".", "n", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "prod_m1m2", ".", "toString", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "paillier", ".", "Decryption", "(", "expo_em1m2", ")", ".", "toString", "(", ")", ")", ";", "}", "}", "</s>" ]
8,973
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "java", ".", "util", ".", "Random", ";", "public", "class", "displayMessageAct", "extends", "Activity", "{", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_wait", ")", ";", "shareSingleton", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "protocol", "p", "=", "new", "protocol", "(", ")", ";", "Intent", "intent", "=", "getIntent", "(", ")", ";", "String", "rec", "=", "intent", ".", "getStringExtra", "(", "\"rec\"", ")", ";", "String", "session", "=", "p", ".", "sendFBMessage", "(", "rec", ",", "\"\"", ",", "this", ")", ";", "}", "}", "</s>" ]
8,974
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "util", ".", "Random", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "EditText", ";", "public", "class", "messageTest", "extends", "Activity", "{", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_message_test", ")", ";", "}", "public", "void", "genMessage", "(", "View", "view", ")", "{", "EditText", "lengthEditText", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "length", ")", ";", "int", "length", "=", "Integer", ".", "valueOf", "(", "lengthEditText", ".", "getText", "(", ")", ".", "toString", "(", ")", ")", ";", "Random", "rng", "=", "new", "Random", "(", ")", ";", "String", "characters", "=", "\"\"", ";", "char", "[", "]", "message", "=", "new", "char", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "message", ".", "length", ";", "i", "++", ")", "{", "message", "[", "i", "]", "=", "characters", ".", "charAt", "(", "rng", ".", "nextInt", "(", "characters", ".", "length", "(", ")", ")", ")", ";", "}", "EditText", "messageEditText", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "message", ")", ";", "messageEditText", ".", "setText", "(", "new", "String", "(", "message", ")", ")", ";", "}", "public", "void", "sendMessage", "(", "View", "view", ")", "{", "EditText", "messageEditText", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "message", ")", ";", "String", "message", "=", "messageEditText", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "EditText", "recEditText", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "rec", ")", ";", "String", "rec", "=", "recEditText", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "protocol", "p", "=", "new", "protocol", "(", ")", ";", "p", ".", "sendFBMessage", "(", "rec", ",", "message", ",", "this", ")", ";", "}", "}", "</s>" ]
8,975
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "location", ".", "Location", ";", "import", "android", ".", "location", ".", "LocationListener", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "public", "class", "lListener", "implements", "LocationListener", "{", "public", "double", "lon", "=", "-", "190.0", ";", "public", "double", "lat", "=", "-", "190.0", ";", "public", "lListener", "(", ")", "{", "}", "public", "void", "plugFake", "(", "Context", "context", ")", "{", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "context", ")", ";", "if", "(", "prefs", ".", "getBoolean", "(", "\"\"", ",", "false", ")", ")", "{", "Double", "fake_lat", "=", "Double", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"fake_lat\"", ",", "\"37.2708\"", ")", ")", ";", "Double", "fake_lon", "=", "Double", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"fake_lon\"", ",", "\"-76.7113\"", ")", ")", ";", "lat", "=", "fake_lat", ";", "lon", "=", "fake_lon", ";", "}", "}", "@", "Override", "public", "void", "onLocationChanged", "(", "Location", "location", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", "+", "location", ")", ";", "if", "(", "location", ".", "hasAccuracy", "(", ")", ")", "{", "if", "(", "location", ".", "getAccuracy", "(", ")", "<", "1.0", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", ")", ";", "updateCurrent", "(", "location", ")", ";", "}", "}", "else", "{", "updateCurrent", "(", "location", ")", ";", "}", "}", "private", "void", "updateCurrent", "(", "Location", "loc", ")", "{", "lon", "=", "loc", ".", "getLongitude", "(", ")", ";", "lat", "=", "loc", ".", "getLatitude", "(", ")", ";", "shareSingleton", "share", "=", "shareSingleton", ".", "getInstance", "(", ")", ";", "share", ".", "lon", "=", "loc", ".", "getLongitude", "(", ")", ";", "share", ".", "lat", "=", "loc", ".", "getLatitude", "(", ")", ";", "}", "public", "boolean", "listening", "(", ")", "{", "if", "(", "lat", "==", "-", "190.0", "||", "lon", "==", "-", "190.0", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}", "@", "Override", "public", "void", "onStatusChanged", "(", "String", "provider", ",", "int", "status", ",", "Bundle", "extra", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "onProviderEnabled", "(", "String", "provider", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", ")", ";", "}", "@", "Override", "public", "void", "onProviderDisabled", "(", "String", "provider", ")", "{", "Log", ".", "d", "(", "\"location\"", ",", "\"\"", ")", ";", "}", "}", "</s>" ]
8,976
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "EditText", ";", "import", "android", ".", "widget", ".", "TextView", ";", "public", "class", "paillierTest", "extends", "Activity", "{", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_test", ")", ";", "}", "public", "void", "encryptionTest", "(", "View", "view", ")", "{", "EditText", "et1", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "bit_strength", ")", ";", "EditText", "et2", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "certainty", ")", ";", "EditText", "et3", "=", "(", "EditText", ")", "findViewById", "(", "R", ".", "id", ".", "message", ")", ";", "int", "bitStrength", "=", "Integer", ".", "valueOf", "(", "et1", ".", "getText", "(", ")", ".", "toString", "(", ")", ")", ";", "int", "certainty", "=", "Integer", ".", "valueOf", "(", "et2", ".", "getText", "(", ")", ".", "toString", "(", ")", ")", ";", "BigInteger", "message", "=", "new", "BigInteger", "(", "et3", ".", "getText", "(", ")", ".", "toString", "(", ")", ")", ";", "TextView", "tv", "=", "(", "TextView", ")", "findViewById", "(", "R", ".", "id", ".", "output", ")", ";", "tv", ".", "setText", "(", "\"Working...n\"", ")", ";", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "tv", ".", "append", "(", "\"Generating", "\"", "+", "et1", ".", "getText", "(", ")", ".", "toString", "(", ")", "+", "\"", "bit", "key...n\"", ")", ";", "long", "keyStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "Paillier", "paillier", "=", "new", "Paillier", "(", "bitStrength", ",", "certainty", ")", ";", "long", "keyEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "tv", ".", "append", "(", "\"Encrypting", "'\"", "+", "message", ".", "toString", "(", ")", "+", "\"'...n\"", ")", ";", "long", "encStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "BigInteger", "enc", "=", "paillier", ".", "Encryption", "(", "message", ")", ";", "long", "encEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "tv", ".", "append", "(", "\"Encrypted:", "\"", "+", "enc", ".", "toString", "(", "16", ")", ",", "0", ",", "30", ")", ";", "tv", ".", "append", "(", "\"...n\"", ")", ";", "tv", ".", "append", "(", "\"\"", ")", ";", "long", "decStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "BigInteger", "clear", "=", "paillier", ".", "Decryption", "(", "enc", ")", ";", "long", "decEnd", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "tv", ".", "append", "(", "\"Clear:", "\"", "+", "clear", "+", "\"n\"", ")", ";", "long", "end", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "totalKey", "=", "keyEnd", "-", "keyStart", ";", "long", "totalEnc", "=", "encEnd", "-", "encStart", ";", "long", "totalDec", "=", "decEnd", "-", "decStart", ";", "long", "totalTime", "=", "end", "-", "start", ";", "tv", ".", "append", "(", "\"Test", "Donen\"", ")", ";", "tv", ".", "append", "(", "\"\"", "+", "totalKey", "+", "\"msn\"", ")", ";", "tv", ".", "append", "(", "\"\"", "+", "totalEnc", "+", "\"msn\"", ")", ";", "tv", ".", "append", "(", "\"\"", "+", "totalDec", "+", "\"msn\"", ")", ";", "tv", ".", "append", "(", "\"Total", "Time:", "\"", "+", "totalTime", "+", "\"msn\"", ")", ";", "}", "}", "</s>" ]
8,977
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "math", ".", "BigInteger", ";", "public", "class", "shareSingleton", "{", "private", "static", "shareSingleton", "instance", "=", "null", ";", "public", "double", "lon", ";", "public", "double", "lat", ";", "public", "String", "rec", ";", "public", "xmppService", "serv", ";", "public", "int", "bits", ";", "public", "int", "method", ";", "public", "long", "start", ";", "int", "session", ";", "public", "Paillier", "pKey", ";", "public", "boolean", "foundLon", ";", "public", "boolean", "longitude", "=", "false", ";", "public", "BigInteger", "[", "]", "last", ";", "protected", "shareSingleton", "(", ")", "{", "}", "public", "static", "shareSingleton", "getInstance", "(", ")", "{", "if", "(", "instance", "==", "null", ")", "{", "instance", "=", "new", "shareSingleton", "(", ")", ";", "}", "return", "instance", ";", "}", "}", "</s>" ]
8,978
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "android", ".", "app", ".", "ListActivity", ";", "import", "android", ".", "content", ".", "ActivityNotFoundException", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "net", ".", "Uri", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemClickListener", ";", "import", "android", ".", "widget", ".", "AdapterView", ".", "OnItemLongClickListener", ";", "import", "android", ".", "widget", ".", "ArrayAdapter", ";", "import", "android", ".", "widget", ".", "ListView", ";", "import", "android", ".", "widget", ".", "TextView", ";", "import", "android", ".", "widget", ".", "Toast", ";", "public", "class", "processedQueries", "extends", "ListActivity", "{", "private", "static", "ArrayList", "<", "String", ">", "data", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_processed_queries", ")", ";", "Intent", "i", "=", "getIntent", "(", ")", ";", "String", "lat", "=", "i", ".", "getStringExtra", "(", "\"lat\"", ")", ";", "String", "lon", "=", "i", ".", "getStringExtra", "(", "\"lon\"", ")", ";", "String", "name", "=", "i", ".", "getStringExtra", "(", "\"name\"", ")", ";", "ListView", "list", "=", "(", "ListView", ")", "findViewById", "(", "android", ".", "R", ".", "id", ".", "list", ")", ";", "data", ".", "add", "(", "0", ",", "name", "+", "\":", "\"", "+", "lat", "+", "\",", "\"", "+", "lon", ")", ";", "ArrayAdapter", "<", "String", ">", "AA", "=", "new", "ArrayAdapter", "<", "String", ">", "(", "this", ",", "R", ".", "layout", ".", "smallfont", ",", "data", ")", ";", "list", ".", "setAdapter", "(", "AA", ")", ";", "list", ".", "setOnItemClickListener", "(", "new", "OnItemClickListener", "(", ")", "{", "@", "Override", "public", "void", "onItemClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "pos", ",", "long", "id", ")", "{", "String", "s", "=", "(", "(", "TextView", ")", "v", ")", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "s", "=", "s", ".", "split", "(", "\":\"", ")", "[", "1", "]", ";", "String", "url", "=", "\"\"", "+", "s", ";", "Intent", "i", "=", "new", "Intent", "(", "Intent", ".", "ACTION_VIEW", ")", ";", "i", ".", "setData", "(", "Uri", ".", "parse", "(", "url", ")", ")", ";", "startActivity", "(", "i", ")", ";", "}", "}", ")", ";", "list", ".", "setOnItemLongClickListener", "(", "new", "OnItemLongClickListener", "(", ")", "{", "@", "Override", "public", "boolean", "onItemLongClick", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "v", ",", "int", "pos", ",", "long", "id", ")", "{", "String", "s", "=", "(", "(", "TextView", ")", "v", ")", ".", "getText", "(", ")", ".", "toString", "(", ")", ";", "s", "=", "s", ".", "split", "(", "\":\"", ")", "[", "1", "]", ";", "String", "url", "=", "\"geo:\"", "+", "s", ";", "Intent", "i", "=", "new", "Intent", "(", "Intent", ".", "ACTION_VIEW", ")", ";", "i", ".", "setData", "(", "Uri", ".", "parse", "(", "url", ")", ")", ";", "try", "{", "startActivity", "(", "i", ")", ";", "}", "catch", "(", "ActivityNotFoundException", "e", ")", "{", "Toast", ".", "makeText", "(", "getApplicationContext", "(", ")", ",", "\"\"", ",", "Toast", ".", "LENGTH_SHORT", ")", ".", "show", "(", ")", ";", "}", "return", "true", ";", "}", "}", ")", ";", "}", "}", "</s>" ]
8,979
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "util", ".", "Log", ";", "public", "class", "treeQueue", "{", "private", "tree", "[", "]", "arr", "=", "new", "tree", "[", "2", "]", ";", "private", "int", "end", "=", "0", ";", "public", "int", "length", "=", "end", ";", "public", "treeQueue", "union", "(", "treeQueue", "other", ")", "{", "treeQueue", "tmp", "=", "new", "treeQueue", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";", "i", "++", ")", "{", "tmp", ".", "push", "(", "arr", "[", "i", "]", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "other", ".", "length", ";", "i", "++", ")", "{", "tmp", ".", "push", "(", "other", ".", "peek", "(", "i", ")", ")", ";", "}", "return", "tmp", ";", "}", "public", "void", "push", "(", "tree", "newTree", ")", "{", "if", "(", "end", "==", "arr", ".", "length", "-", "1", ")", "{", "tree", "[", "]", "tmp", "=", "new", "tree", "[", "arr", ".", "length", "*", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arr", ".", "length", ";", "i", "++", ")", "{", "tmp", "[", "i", "]", "=", "arr", "[", "i", "]", ";", "}", "arr", "=", "tmp", ";", "}", "arr", "[", "end", "]", "=", "newTree", ";", "end", "++", ";", "length", "=", "end", ";", "}", "public", "tree", "peek", "(", "int", "spot", ")", "{", "if", "(", "spot", ">=", "end", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "spot", ")", ";", "System", ".", "exit", "(", "401", ")", ";", "}", "if", "(", "spot", "==", "-", "1", ")", "{", "return", "arr", "[", "end", "-", "1", "]", ";", "}", "return", "arr", "[", "spot", "]", ";", "}", "public", "int", "length", "(", ")", "{", "return", "end", ";", "}", "public", "tree", "findUserLeaf", "(", ")", "{", "tree", "user", "=", "null", ";", "for", "(", "tree", "t", ":", "arr", ")", "{", "if", "(", "t", ".", "special", "!=", "null", ")", "{", "if", "(", "user", "!=", "null", ")", "{", "Log", ".", "d", "(", "\"Err\"", ",", "\"\"", ")", ";", "}", "user", "=", "t", ";", "}", "}", "return", "user", ";", "}", "public", "int", "uniquePush", "(", "tree", "nTree", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "arr", "[", "i", "]", ".", "value", "==", "nTree", ".", "value", ")", "{", "return", "-", "1", ";", "}", "}", "Log", ".", "d", "(", "\"tree\"", ",", "\"\"", "+", "nTree", ".", "value", ")", ";", "this", ".", "push", "(", "nTree", ")", ";", "return", "0", ";", "}", "public", "tree", "find", "(", "int", "value", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "arr", "[", "i", "]", ".", "value", "==", "value", ")", "{", "return", "arr", "[", "i", "]", ";", "}", "}", "return", "new", "tree", "(", "0", ",", "new", "char", "[", "0", "]", ",", "null", ",", "null", ",", "0", ",", "\"lon\"", ")", ";", "}", "}", "</s>" ]
8,980
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "Chat", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "ChatManager", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "ChatManagerListener", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "Connection", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "ConnectionConfiguration", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "Roster", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "RosterEntry", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "XMPPConnection", ";", "import", "org", ".", "jivesoftware", ".", "smack", ".", "XMPPException", ";", "import", "android", ".", "app", ".", "Service", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "content", ".", "SharedPreferences", ";", "import", "android", ".", "os", ".", "Binder", ";", "import", "android", ".", "os", ".", "IBinder", ";", "import", "android", ".", "preference", ".", "PreferenceManager", ";", "import", "android", ".", "util", ".", "Log", ";", "public", "class", "xmppService", "extends", "Service", "{", "public", "static", "final", "String", "LOGIN_UPDATE", "=", "\"\"", ";", "public", "static", "Connection", "conn", ";", "public", "static", "Boolean", "in", "=", "false", ";", "IBinder", "xmppBinder", "=", "new", "LocalBinder", "(", ")", ";", "@", "Override", "public", "void", "onCreate", "(", ")", "{", "super", ".", "onCreate", "(", ")", ";", "}", "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "super", ".", "onDestroy", "(", ")", ";", "if", "(", "conn", "!=", "null", ")", "{", "conn", ".", "disconnect", "(", ")", ";", "conn", "=", "null", ";", "in", "=", "false", ";", "}", "}", "@", "Override", "public", "int", "onStartCommand", "(", "Intent", "intent", ",", "int", "flags", ",", "int", "startID", ")", "{", "String", "user", "=", "intent", ".", "getStringExtra", "(", "\"user\"", ")", ";", "String", "pass", "=", "intent", ".", "getStringExtra", "(", "\"pass\"", ")", ";", "Runnable", "r", "=", "new", "xmppThread", "(", "user", ",", "pass", ",", "getApplicationContext", "(", ")", ")", ";", "new", "Thread", "(", "r", ")", ".", "start", "(", ")", ";", "return", "START_REDELIVER_INTENT", ";", "}", "private", "static", "List", "<", "String", ">", "make_packets", "(", "String", "msg", ",", "int", "stage", ",", "String", "session", ",", "int", "chunk", ")", "{", "List", "<", "String", ">", "packets", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "int", "cur", "=", "0", ";", "int", "end", "=", "0", ";", "int", "total", "=", "0", ";", "while", "(", "end", "<", "msg", ".", "length", "(", ")", ")", "{", "total", "+=", "1", ";", "end", "=", "Math", ".", "min", "(", "msg", ".", "length", "(", ")", ",", "cur", "+", "chunk", ")", ";", "packets", ".", "add", "(", "\"@@\"", "+", "stage", "+", "\":\"", "+", "session", "+", "\":\"", "+", "msg", ".", "substring", "(", "cur", ",", "end", ")", ")", ";", "cur", "=", "end", ";", "}", "packets", ".", "set", "(", "packets", ".", "size", "(", ")", "-", "1", ",", "packets", ".", "get", "(", "packets", ".", "size", "(", ")", "-", "1", ")", "+", "\"@@\"", ")", ";", "Log", ".", "d", "(", "\"stats\"", ",", "\"\"", "+", "total", ")", ";", "return", "packets", ";", "}", "private", "static", "void", "real_send", "(", "Chat", "chat", ",", "String", "msg", ",", "int", "stage", ",", "String", "session", ",", "int", "chunk", ")", "{", "List", "<", "String", ">", "parts", "=", "make_packets", "(", "msg", ",", "stage", ",", "session", ",", "chunk", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parts", ".", "size", "(", ")", ";", "i", "++", ")", "{", "try", "{", "chat", ".", "sendMessage", "(", "parts", ".", "get", "(", "i", ")", ")", ";", "}", "catch", "(", "XMPPException", "e", ")", "{", "Log", ".", "d", "(", "\"xmpp\"", ",", "\"\"", "+", "e", ".", "toString", "(", ")", ")", ";", "}", "}", "Log", ".", "d", "(", "\"xmpp\"", ",", "\"Message", "sent\"", ")", ";", "}", "public", "static", "void", "sendMessage", "(", "String", "rec", ",", "String", "msg", ",", "int", "stage", ",", "String", "session", ",", "final", "Context", "context", ")", "{", "Collection", "<", "RosterEntry", ">", "entries", "=", "getRoster", "(", ")", ".", "getEntries", "(", ")", ";", "if", "(", "entries", "!=", "null", ")", "{", "for", "(", "RosterEntry", "entry", ":", "entries", ")", "{", "if", "(", "entry", ".", "getName", "(", ")", ".", "equals", "(", "rec", ")", ")", "{", "Chat", "newChat", "=", "conn", ".", "getChatManager", "(", ")", ".", "createChat", "(", "entry", ".", "getUser", "(", ")", ",", "null", ")", ";", "Log", ".", "d", "(", "\"xmpp\"", ",", "\"\"", "+", "entry", ".", "getName", "(", ")", ")", ";", "SharedPreferences", "prefs", "=", "PreferenceManager", ".", "getDefaultSharedPreferences", "(", "context", ")", ";", "int", "chunk", "=", "Integer", ".", "valueOf", "(", "prefs", ".", "getString", "(", "\"chunk\"", ",", "\"500\"", ")", ")", ";", "real_send", "(", "newChat", ",", "msg", ",", "stage", ",", "session", ",", "chunk", ")", ";", "}", "}", "}", "else", "{", "Log", ".", "d", "(", "\"xmpp\"", ",", "\"\"", ")", ";", "}", "}", "@", "Override", "public", "IBinder", "onBind", "(", "Intent", "intent", ")", "{", "if", "(", "conn", "==", "null", ")", "{", "String", "user", "=", "intent", ".", "getStringExtra", "(", "\"user\"", ")", ";", "String", "pass", "=", "intent", ".", "getStringExtra", "(", "\"pass\"", ")", ";", "Runnable", "r", "=", "new", "xmppThread", "(", "user", ",", "pass", ",", "this", ")", ";", "new", "Thread", "(", "r", ")", ".", "start", "(", ")", ";", "}", "return", "xmppBinder", ";", "}", "public", "class", "LocalBinder", "extends", "Binder", "{", "xmppService", "getService", "(", ")", "{", "return", "xmppService", ".", "this", ";", "}", "}", "public", "static", "Roster", "getRoster", "(", ")", "{", "return", "conn", ".", "getRoster", "(", ")", ";", "}", "private", "void", "announceLogin", "(", "boolean", "in", ")", "{", "Intent", "intent", "=", "new", "Intent", "(", "LOGIN_UPDATE", ")", ";", "intent", ".", "putExtra", "(", "\"connection\"", ",", "in", ")", ";", "sendBroadcast", "(", "intent", ")", ";", "}", "public", "class", "xmppThread", "implements", "Runnable", "{", "private", "String", "username", ";", "private", "String", "password", ";", "private", "Context", "context", ";", "public", "xmppThread", "(", "String", "nUsername", ",", "String", "nPassword", ",", "Context", "nContext", ")", "{", "username", "=", "nUsername", ";", "password", "=", "nPassword", ";", "context", "=", "nContext", ";", "}", "public", "void", "run", "(", ")", "{", "Connection", "connection", "=", "null", ";", "try", "{", "ConnectionConfiguration", "config", "=", "new", "ConnectionConfiguration", "(", "\"\"", ",", "5222", ")", ";", "config", ".", "setSecurityMode", "(", "ConnectionConfiguration", ".", "SecurityMode", ".", "disabled", ")", ";", "connection", "=", "new", "XMPPConnection", "(", "config", ")", ";", "connection", ".", "connect", "(", ")", ";", "connection", ".", "login", "(", "username", ",", "password", ")", ";", "Log", ".", "d", "(", "\"chat\"", ",", "\"\"", "+", "username", ")", ";", "in", "=", "true", ";", "conn", "=", "connection", ";", "announceLogin", "(", "in", ")", ";", "}", "catch", "(", "XMPPException", "e", ")", "{", "Log", ".", "d", "(", "\"chat\"", ",", "\"\"", ")", ";", "Log", ".", "d", "(", "\"chat\"", ",", "e", ".", "toString", "(", ")", ")", ";", "}", "ChatManager", "cManager", "=", "connection", ".", "getChatManager", "(", ")", ";", "cManager", ".", "addChatListener", "(", "new", "ChatManagerListener", "(", ")", "{", "public", "void", "chatCreated", "(", "Chat", "chat", ",", "boolean", "createdLocally", ")", "{", "if", "(", "!", "createdLocally", "||", "createdLocally", ")", "{", "chat", ".", "addMessageListener", "(", "new", "nearbyListener", "(", "context", ")", ")", ";", "}", "}", "}", ")", ";", "}", "}", "}", "</s>" ]
8,981
[ "<s>", "package", "net", ".", "ednovak", ".", "nearby", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "os", ".", "Bundle", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "TextView", ";", "public", "class", "answerAct", "extends", "Activity", "{", "@", "Override", "public", "void", "onCreate", "(", "Bundle", "savedInstanceState", ")", "{", "super", ".", "onCreate", "(", "savedInstanceState", ")", ";", "setContentView", "(", "R", ".", "layout", ".", "activity_wait", ")", ";", "Intent", "intent", "=", "getIntent", "(", ")", ";", "String", "text", "=", "intent", ".", "getStringExtra", "(", "\"answer\"", ")", ";", "boolean", "answer", "=", "intent", ".", "getBooleanExtra", "(", "\"found\"", ",", "false", ")", ";", "TextView", "tv", "=", "(", "TextView", ")", "findViewById", "(", "R", ".", "id", ".", "text_view", ")", ";", "tv", ".", "setText", "(", "text", ")", ";", "ImageView", "iv", "=", "(", "ImageView", ")", "findViewById", "(", "R", ".", "id", ".", "waiting", ")", ";", "if", "(", "answer", ")", "{", "iv", ".", "setImageResource", "(", "R", ".", "drawable", ".", "happy", ")", ";", "}", "else", "{", "iv", ".", "setImageResource", "(", "R", ".", "drawable", ".", "sad", ")", ";", "}", "}", "}", "</s>" ]
8,982
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ";", "import", "static", "org", ".", "hamcrest", ".", "CoreMatchers", ".", "equalTo", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertThat", ";", "import", "static", "com", ".", "actionbarsherlock", ".", "internal", ".", "ActionBarSherlockCompat", ".", "cleanActivityName", ";", "import", "com", ".", "xtremelabs", ".", "robolectric", ".", "RobolectricTestRunner", ";", "import", "org", ".", "junit", ".", "Test", ";", "import", "org", ".", "junit", ".", "runner", ".", "RunWith", ";", "@", "RunWith", "(", "RobolectricTestRunner", ".", "class", ")", "public", "class", "ManifestParsingTest", "{", "@", "Test", "public", "void", "testFullyQualifiedClassName", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "String", "actual", "=", "cleanActivityName", "(", "\"\"", ",", "\"\"", ")", ";", "assertThat", "(", "expected", ",", "equalTo", "(", "actual", ")", ")", ";", "}", "@", "Test", "public", "void", "testFullyQualifiedClassNameSamePackage", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "String", "actual", "=", "cleanActivityName", "(", "\"\"", ",", "\"\"", ")", ";", "assertThat", "(", "expected", ",", "equalTo", "(", "actual", ")", ")", ";", "}", "@", "Test", "public", "void", "testUnqualifiedClassName", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "String", "actual", "=", "cleanActivityName", "(", "\"\"", ",", "\"SomeClass\"", ")", ";", "assertThat", "(", "expected", ",", "equalTo", "(", "actual", ")", ")", ";", "}", "@", "Test", "public", "void", "testRelativeClassName", "(", ")", "{", "String", "expected", "=", "\"\"", ";", "String", "actual", "=", "cleanActivityName", "(", "\"\"", ",", "\"\"", ")", ";", "assertThat", "(", "expected", ",", "equalTo", "(", "actual", ")", ")", ";", "}", "}", "</s>" ]
8,983
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "content", ".", "ComponentName", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "view", ".", "KeyEvent", ";", "public", "interface", "Menu", "{", "static", "final", "int", "USER_MASK", "=", "0x0000ffff", ";", "static", "final", "int", "USER_SHIFT", "=", "0", ";", "static", "final", "int", "CATEGORY_MASK", "=", "0xffff0000", ";", "static", "final", "int", "CATEGORY_SHIFT", "=", "16", ";", "static", "final", "int", "NONE", "=", "0", ";", "static", "final", "int", "FIRST", "=", "1", ";", "static", "final", "int", "CATEGORY_CONTAINER", "=", "0x00010000", ";", "static", "final", "int", "CATEGORY_SYSTEM", "=", "0x00020000", ";", "static", "final", "int", "CATEGORY_SECONDARY", "=", "0x00030000", ";", "static", "final", "int", "CATEGORY_ALTERNATIVE", "=", "0x00040000", ";", "static", "final", "int", "FLAG_APPEND_TO_GROUP", "=", "0x0001", ";", "static", "final", "int", "FLAG_PERFORM_NO_CLOSE", "=", "0x0001", ";", "static", "final", "int", "FLAG_ALWAYS_PERFORM_CLOSE", "=", "0x0002", ";", "public", "MenuItem", "add", "(", "CharSequence", "title", ")", ";", "public", "MenuItem", "add", "(", "int", "titleRes", ")", ";", "public", "MenuItem", "add", "(", "int", "groupId", ",", "int", "itemId", ",", "int", "order", ",", "CharSequence", "title", ")", ";", "public", "MenuItem", "add", "(", "int", "groupId", ",", "int", "itemId", ",", "int", "order", ",", "int", "titleRes", ")", ";", "SubMenu", "addSubMenu", "(", "final", "CharSequence", "title", ")", ";", "SubMenu", "addSubMenu", "(", "final", "int", "titleRes", ")", ";", "SubMenu", "addSubMenu", "(", "final", "int", "groupId", ",", "final", "int", "itemId", ",", "int", "order", ",", "final", "CharSequence", "title", ")", ";", "SubMenu", "addSubMenu", "(", "int", "groupId", ",", "int", "itemId", ",", "int", "order", ",", "int", "titleRes", ")", ";", "public", "int", "addIntentOptions", "(", "int", "groupId", ",", "int", "itemId", ",", "int", "order", ",", "ComponentName", "caller", ",", "Intent", "[", "]", "specifics", ",", "Intent", "intent", ",", "int", "flags", ",", "MenuItem", "[", "]", "outSpecificItems", ")", ";", "public", "void", "removeItem", "(", "int", "id", ")", ";", "public", "void", "removeGroup", "(", "int", "groupId", ")", ";", "public", "void", "clear", "(", ")", ";", "public", "void", "setGroupCheckable", "(", "int", "group", ",", "boolean", "checkable", ",", "boolean", "exclusive", ")", ";", "public", "void", "setGroupVisible", "(", "int", "group", ",", "boolean", "visible", ")", ";", "public", "void", "setGroupEnabled", "(", "int", "group", ",", "boolean", "enabled", ")", ";", "public", "boolean", "hasVisibleItems", "(", ")", ";", "public", "MenuItem", "findItem", "(", "int", "id", ")", ";", "public", "int", "size", "(", ")", ";", "public", "MenuItem", "getItem", "(", "int", "index", ")", ";", "public", "void", "close", "(", ")", ";", "public", "boolean", "performShortcut", "(", "int", "keyCode", ",", "KeyEvent", "event", ",", "int", "flags", ")", ";", "boolean", "isShortcutKey", "(", "int", "keyCode", ",", "KeyEvent", "event", ")", ";", "public", "boolean", "performIdentifierAction", "(", "int", "id", ",", "int", "flags", ")", ";", "public", "void", "setQwertyMode", "(", "boolean", "isQwerty", ")", ";", "}", "</s>" ]
8,984
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "view", ".", "View", ";", "public", "interface", "SubMenu", "extends", "Menu", "{", "public", "SubMenu", "setHeaderTitle", "(", "int", "titleRes", ")", ";", "public", "SubMenu", "setHeaderTitle", "(", "CharSequence", "title", ")", ";", "public", "SubMenu", "setHeaderIcon", "(", "int", "iconRes", ")", ";", "public", "SubMenu", "setHeaderIcon", "(", "Drawable", "icon", ")", ";", "public", "SubMenu", "setHeaderView", "(", "View", "view", ")", ";", "public", "void", "clearHeader", "(", ")", ";", "public", "SubMenu", "setIcon", "(", "int", "iconRes", ")", ";", "public", "SubMenu", "setIcon", "(", "Drawable", "icon", ")", ";", "public", "MenuItem", "getItem", "(", ")", ";", "}", "</s>" ]
8,985
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "view", ".", "View", ";", "public", "abstract", "class", "ActionMode", "{", "private", "Object", "mTag", ";", "public", "void", "setTag", "(", "Object", "tag", ")", "{", "mTag", "=", "tag", ";", "}", "public", "Object", "getTag", "(", ")", "{", "return", "mTag", ";", "}", "public", "abstract", "void", "setTitle", "(", "CharSequence", "title", ")", ";", "public", "abstract", "void", "setTitle", "(", "int", "resId", ")", ";", "public", "abstract", "void", "setSubtitle", "(", "CharSequence", "subtitle", ")", ";", "public", "abstract", "void", "setSubtitle", "(", "int", "resId", ")", ";", "public", "abstract", "void", "setCustomView", "(", "View", "view", ")", ";", "public", "abstract", "void", "invalidate", "(", ")", ";", "public", "abstract", "void", "finish", "(", ")", ";", "public", "abstract", "Menu", "getMenu", "(", ")", ";", "public", "abstract", "CharSequence", "getTitle", "(", ")", ";", "public", "abstract", "CharSequence", "getSubtitle", "(", ")", ";", "public", "abstract", "View", "getCustomView", "(", ")", ";", "public", "abstract", "MenuInflater", "getMenuInflater", "(", ")", ";", "public", "boolean", "isUiFocusable", "(", ")", "{", "return", "true", ";", "}", "public", "interface", "Callback", "{", "public", "boolean", "onCreateActionMode", "(", "ActionMode", "mode", ",", "Menu", "menu", ")", ";", "public", "boolean", "onPrepareActionMode", "(", "ActionMode", "mode", ",", "Menu", "menu", ")", ";", "public", "boolean", "onActionItemClicked", "(", "ActionMode", "mode", ",", "MenuItem", "item", ")", ";", "public", "void", "onDestroyActionMode", "(", "ActionMode", "mode", ")", ";", "}", "}", "</s>" ]
8,986
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "content", ".", "Context", ";", "public", "abstract", "class", "Window", "extends", "android", ".", "view", ".", "Window", "{", "public", "static", "final", "long", "FEATURE_ACTION_BAR", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_ACTION_BAR", ";", "public", "static", "final", "long", "FEATURE_ACTION_BAR_OVERLAY", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_ACTION_BAR_OVERLAY", ";", "public", "static", "final", "long", "FEATURE_ACTION_MODE_OVERLAY", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_ACTION_MODE_OVERLAY", ";", "public", "static", "final", "long", "FEATURE_NO_TITLE", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_NO_TITLE", ";", "public", "static", "final", "long", "FEATURE_PROGRESS", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_PROGRESS", ";", "public", "static", "final", "long", "FEATURE_INDETERMINATE_PROGRESS", "=", "android", ".", "view", ".", "Window", ".", "FEATURE_INDETERMINATE_PROGRESS", ";", "private", "Window", "(", "Context", "context", ")", "{", "super", "(", "context", ")", ";", "}", "public", "interface", "Callback", "{", "public", "boolean", "onMenuItemSelected", "(", "int", "featureId", ",", "MenuItem", "item", ")", ";", "}", "}", "</s>" ]
8,987
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "view", ".", "View", ";", "public", "abstract", "class", "ActionProvider", "{", "private", "SubUiVisibilityListener", "mSubUiVisibilityListener", ";", "public", "ActionProvider", "(", "Context", "context", ")", "{", "}", "public", "abstract", "View", "onCreateActionView", "(", ")", ";", "public", "boolean", "onPerformDefaultAction", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "hasSubMenu", "(", ")", "{", "return", "false", ";", "}", "public", "void", "onPrepareSubMenu", "(", "SubMenu", "subMenu", ")", "{", "}", "public", "void", "subUiVisibilityChanged", "(", "boolean", "isVisible", ")", "{", "if", "(", "mSubUiVisibilityListener", "!=", "null", ")", "{", "mSubUiVisibilityListener", ".", "onSubUiVisibilityChanged", "(", "isVisible", ")", ";", "}", "}", "public", "void", "setSubUiVisibilityListener", "(", "SubUiVisibilityListener", "listener", ")", "{", "mSubUiVisibilityListener", "=", "listener", ";", "}", "public", "interface", "SubUiVisibilityListener", "{", "public", "void", "onSubUiVisibilityChanged", "(", "boolean", "isVisible", ")", ";", "}", "}", "</s>" ]
8,988
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Constructor", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "org", ".", "xmlpull", ".", "v1", ".", "XmlPullParser", ";", "import", "org", ".", "xmlpull", ".", "v1", ".", "XmlPullParserException", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "content", ".", "res", ".", "XmlResourceParser", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "util", ".", "TypedValue", ";", "import", "android", ".", "util", ".", "Xml", ";", "import", "android", ".", "view", ".", "InflateException", ";", "import", "android", ".", "view", ".", "View", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "MenuItemImpl", ";", "public", "class", "MenuInflater", "{", "private", "static", "final", "String", "LOG_TAG", "=", "\"MenuInflater\"", ";", "private", "static", "final", "String", "XML_MENU", "=", "\"menu\"", ";", "private", "static", "final", "String", "XML_GROUP", "=", "\"group\"", ";", "private", "static", "final", "String", "XML_ITEM", "=", "\"item\"", ";", "private", "static", "final", "int", "NO_ID", "=", "0", ";", "private", "static", "final", "Class", "<", "?", ">", "[", "]", "ACTION_VIEW_CONSTRUCTOR_SIGNATURE", "=", "new", "Class", "[", "]", "{", "Context", ".", "class", "}", ";", "private", "static", "final", "Class", "<", "?", ">", "[", "]", "ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE", "=", "ACTION_VIEW_CONSTRUCTOR_SIGNATURE", ";", "private", "final", "Object", "[", "]", "mActionViewConstructorArguments", ";", "private", "final", "Object", "[", "]", "mActionProviderConstructorArguments", ";", "private", "Context", "mContext", ";", "public", "MenuInflater", "(", "Context", "context", ")", "{", "mContext", "=", "context", ";", "mActionViewConstructorArguments", "=", "new", "Object", "[", "]", "{", "context", "}", ";", "mActionProviderConstructorArguments", "=", "mActionViewConstructorArguments", ";", "}", "public", "void", "inflate", "(", "int", "menuRes", ",", "Menu", "menu", ")", "{", "XmlResourceParser", "parser", "=", "null", ";", "try", "{", "parser", "=", "mContext", ".", "getResources", "(", ")", ".", "getLayout", "(", "menuRes", ")", ";", "AttributeSet", "attrs", "=", "Xml", ".", "asAttributeSet", "(", "parser", ")", ";", "parseMenu", "(", "parser", ",", "attrs", ",", "menu", ")", ";", "}", "catch", "(", "XmlPullParserException", "e", ")", "{", "throw", "new", "InflateException", "(", "\"\"", ",", "e", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "InflateException", "(", "\"\"", ",", "e", ")", ";", "}", "finally", "{", "if", "(", "parser", "!=", "null", ")", "parser", ".", "close", "(", ")", ";", "}", "}", "private", "void", "parseMenu", "(", "XmlPullParser", "parser", ",", "AttributeSet", "attrs", ",", "Menu", "menu", ")", "throws", "XmlPullParserException", ",", "IOException", "{", "MenuState", "menuState", "=", "new", "MenuState", "(", "menu", ")", ";", "int", "eventType", "=", "parser", ".", "getEventType", "(", ")", ";", "String", "tagName", ";", "boolean", "lookingForEndOfUnknownTag", "=", "false", ";", "String", "unknownTagName", "=", "null", ";", "do", "{", "if", "(", "eventType", "==", "XmlPullParser", ".", "START_TAG", ")", "{", "tagName", "=", "parser", ".", "getName", "(", ")", ";", "if", "(", "tagName", ".", "equals", "(", "XML_MENU", ")", ")", "{", "eventType", "=", "parser", ".", "next", "(", ")", ";", "break", ";", "}", "throw", "new", "RuntimeException", "(", "\"\"", "+", "tagName", ")", ";", "}", "eventType", "=", "parser", ".", "next", "(", ")", ";", "}", "while", "(", "eventType", "!=", "XmlPullParser", ".", "END_DOCUMENT", ")", ";", "boolean", "reachedEndOfMenu", "=", "false", ";", "while", "(", "!", "reachedEndOfMenu", ")", "{", "switch", "(", "eventType", ")", "{", "case", "XmlPullParser", ".", "START_TAG", ":", "if", "(", "lookingForEndOfUnknownTag", ")", "{", "break", ";", "}", "tagName", "=", "parser", ".", "getName", "(", ")", ";", "if", "(", "tagName", ".", "equals", "(", "XML_GROUP", ")", ")", "{", "menuState", ".", "readGroup", "(", "attrs", ")", ";", "}", "else", "if", "(", "tagName", ".", "equals", "(", "XML_ITEM", ")", ")", "{", "menuState", ".", "readItem", "(", "attrs", ")", ";", "}", "else", "if", "(", "tagName", ".", "equals", "(", "XML_MENU", ")", ")", "{", "SubMenu", "subMenu", "=", "menuState", ".", "addSubMenuItem", "(", ")", ";", "parseMenu", "(", "parser", ",", "attrs", ",", "subMenu", ")", ";", "}", "else", "{", "lookingForEndOfUnknownTag", "=", "true", ";", "unknownTagName", "=", "tagName", ";", "}", "break", ";", "case", "XmlPullParser", ".", "END_TAG", ":", "tagName", "=", "parser", ".", "getName", "(", ")", ";", "if", "(", "lookingForEndOfUnknownTag", "&&", "tagName", ".", "equals", "(", "unknownTagName", ")", ")", "{", "lookingForEndOfUnknownTag", "=", "false", ";", "unknownTagName", "=", "null", ";", "}", "else", "if", "(", "tagName", ".", "equals", "(", "XML_GROUP", ")", ")", "{", "menuState", ".", "resetGroup", "(", ")", ";", "}", "else", "if", "(", "tagName", ".", "equals", "(", "XML_ITEM", ")", ")", "{", "if", "(", "!", "menuState", ".", "hasAddedItem", "(", ")", ")", "{", "if", "(", "menuState", ".", "itemActionProvider", "!=", "null", "&&", "menuState", ".", "itemActionProvider", ".", "hasSubMenu", "(", ")", ")", "{", "menuState", ".", "addSubMenuItem", "(", ")", ";", "}", "else", "{", "menuState", ".", "addItem", "(", ")", ";", "}", "}", "}", "else", "if", "(", "tagName", ".", "equals", "(", "XML_MENU", ")", ")", "{", "reachedEndOfMenu", "=", "true", ";", "}", "break", ";", "case", "XmlPullParser", ".", "END_DOCUMENT", ":", "throw", "new", "RuntimeException", "(", "\"\"", ")", ";", "}", "eventType", "=", "parser", ".", "next", "(", ")", ";", "}", "}", "private", "static", "class", "InflatedOnMenuItemClickListener", "implements", "MenuItem", ".", "OnMenuItemClickListener", "{", "private", "static", "final", "Class", "<", "?", ">", "[", "]", "PARAM_TYPES", "=", "new", "Class", "[", "]", "{", "MenuItem", ".", "class", "}", ";", "private", "Context", "mContext", ";", "private", "Method", "mMethod", ";", "public", "InflatedOnMenuItemClickListener", "(", "Context", "context", ",", "String", "methodName", ")", "{", "mContext", "=", "context", ";", "Class", "<", "?", ">", "c", "=", "context", ".", "getClass", "(", ")", ";", "try", "{", "mMethod", "=", "c", ".", "getMethod", "(", "methodName", ",", "PARAM_TYPES", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "InflateException", "ex", "=", "new", "InflateException", "(", "\"\"", "+", "methodName", "+", "\"", "in", "class", "\"", "+", "c", ".", "getName", "(", ")", ")", ";", "ex", ".", "initCause", "(", "e", ")", ";", "throw", "ex", ";", "}", "}", "public", "boolean", "onMenuItemClick", "(", "MenuItem", "item", ")", "{", "try", "{", "if", "(", "mMethod", ".", "getReturnType", "(", ")", "==", "Boolean", ".", "TYPE", ")", "{", "return", "(", "Boolean", ")", "mMethod", ".", "invoke", "(", "mContext", ",", "item", ")", ";", "}", "else", "{", "mMethod", ".", "invoke", "(", "mContext", ",", "item", ")", ";", "return", "true", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "}", "}", "private", "class", "MenuState", "{", "private", "Menu", "menu", ";", "private", "int", "groupId", ";", "private", "int", "groupCategory", ";", "private", "int", "groupOrder", ";", "private", "int", "groupCheckable", ";", "private", "boolean", "groupVisible", ";", "private", "boolean", "groupEnabled", ";", "private", "boolean", "itemAdded", ";", "private", "int", "itemId", ";", "private", "int", "itemCategoryOrder", ";", "private", "CharSequence", "itemTitle", ";", "private", "CharSequence", "itemTitleCondensed", ";", "private", "int", "itemIconResId", ";", "private", "char", "itemAlphabeticShortcut", ";", "private", "char", "itemNumericShortcut", ";", "private", "int", "itemCheckable", ";", "private", "boolean", "itemChecked", ";", "private", "boolean", "itemVisible", ";", "private", "boolean", "itemEnabled", ";", "private", "int", "itemShowAsAction", ";", "private", "int", "itemActionViewLayout", ";", "private", "String", "itemActionViewClassName", ";", "private", "String", "itemActionProviderClassName", ";", "private", "String", "itemListenerMethodName", ";", "private", "ActionProvider", "itemActionProvider", ";", "private", "static", "final", "int", "defaultGroupId", "=", "NO_ID", ";", "private", "static", "final", "int", "defaultItemId", "=", "NO_ID", ";", "private", "static", "final", "int", "defaultItemCategory", "=", "0", ";", "private", "static", "final", "int", "defaultItemOrder", "=", "0", ";", "private", "static", "final", "int", "defaultItemCheckable", "=", "0", ";", "private", "static", "final", "boolean", "defaultItemChecked", "=", "false", ";", "private", "static", "final", "boolean", "defaultItemVisible", "=", "true", ";", "private", "static", "final", "boolean", "defaultItemEnabled", "=", "true", ";", "public", "MenuState", "(", "final", "Menu", "menu", ")", "{", "this", ".", "menu", "=", "menu", ";", "resetGroup", "(", ")", ";", "}", "public", "void", "resetGroup", "(", ")", "{", "groupId", "=", "defaultGroupId", ";", "groupCategory", "=", "defaultItemCategory", ";", "groupOrder", "=", "defaultItemOrder", ";", "groupCheckable", "=", "defaultItemCheckable", ";", "groupVisible", "=", "defaultItemVisible", ";", "groupEnabled", "=", "defaultItemEnabled", ";", "}", "public", "void", "readGroup", "(", "AttributeSet", "attrs", ")", "{", "TypedArray", "a", "=", "mContext", ".", "obtainStyledAttributes", "(", "attrs", ",", "R", ".", "styleable", ".", "SherlockMenuGroup", ")", ";", "groupId", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_id", ",", "defaultGroupId", ")", ";", "groupCategory", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_menuCategory", ",", "defaultItemCategory", ")", ";", "groupOrder", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_orderInCategory", ",", "defaultItemOrder", ")", ";", "groupCheckable", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_checkableBehavior", ",", "defaultItemCheckable", ")", ";", "groupVisible", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_visible", ",", "defaultItemVisible", ")", ";", "groupEnabled", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuGroup_android_enabled", ",", "defaultItemEnabled", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "void", "readItem", "(", "AttributeSet", "attrs", ")", "{", "TypedArray", "a", "=", "mContext", ".", "obtainStyledAttributes", "(", "attrs", ",", "R", ".", "styleable", ".", "SherlockMenuItem", ")", ";", "itemId", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_id", ",", "defaultItemId", ")", ";", "final", "int", "category", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_menuCategory", ",", "groupCategory", ")", ";", "final", "int", "order", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_orderInCategory", ",", "groupOrder", ")", ";", "itemCategoryOrder", "=", "(", "category", "&", "Menu", ".", "CATEGORY_MASK", ")", "|", "(", "order", "&", "Menu", ".", "USER_MASK", ")", ";", "itemTitle", "=", "a", ".", "getText", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_title", ")", ";", "itemTitleCondensed", "=", "a", ".", "getText", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_titleCondensed", ")", ";", "itemIconResId", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_icon", ",", "0", ")", ";", "itemAlphabeticShortcut", "=", "getShortcut", "(", "a", ".", "getString", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_alphabeticShortcut", ")", ")", ";", "itemNumericShortcut", "=", "getShortcut", "(", "a", ".", "getString", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_numericShortcut", ")", ")", ";", "if", "(", "a", ".", "hasValue", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_checkable", ")", ")", "{", "itemCheckable", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_checkable", ",", "false", ")", "?", "1", ":", "0", ";", "}", "else", "{", "itemCheckable", "=", "groupCheckable", ";", "}", "itemChecked", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_checked", ",", "defaultItemChecked", ")", ";", "itemVisible", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_visible", ",", "groupVisible", ")", ";", "itemEnabled", "=", "a", ".", "getBoolean", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_enabled", ",", "groupEnabled", ")", ";", "TypedValue", "value", "=", "new", "TypedValue", "(", ")", ";", "a", ".", "getValue", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_showAsAction", ",", "value", ")", ";", "itemShowAsAction", "=", "value", ".", "type", "==", "TypedValue", ".", "TYPE_INT_HEX", "?", "value", ".", "data", ":", "-", "1", ";", "itemListenerMethodName", "=", "a", ".", "getString", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_onClick", ")", ";", "itemActionViewLayout", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_actionLayout", ",", "0", ")", ";", "itemActionViewClassName", "=", "a", ".", "getString", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_actionViewClass", ")", ";", "itemActionProviderClassName", "=", "a", ".", "getString", "(", "R", ".", "styleable", ".", "SherlockMenuItem_android_actionProviderClass", ")", ";", "final", "boolean", "hasActionProvider", "=", "itemActionProviderClassName", "!=", "null", ";", "if", "(", "hasActionProvider", "&&", "itemActionViewLayout", "==", "0", "&&", "itemActionViewClassName", "==", "null", ")", "{", "itemActionProvider", "=", "newInstance", "(", "itemActionProviderClassName", ",", "ACTION_PROVIDER_CONSTRUCTOR_SIGNATURE", ",", "mActionProviderConstructorArguments", ")", ";", "}", "else", "{", "if", "(", "hasActionProvider", ")", "{", "Log", ".", "w", "(", "LOG_TAG", ",", "\"\"", "+", "\"\"", ")", ";", "}", "itemActionProvider", "=", "null", ";", "}", "a", ".", "recycle", "(", ")", ";", "itemAdded", "=", "false", ";", "}", "private", "char", "getShortcut", "(", "String", "shortcutString", ")", "{", "if", "(", "shortcutString", "==", "null", ")", "{", "return", "0", ";", "}", "else", "{", "return", "shortcutString", ".", "charAt", "(", "0", ")", ";", "}", "}", "private", "void", "setItem", "(", "MenuItem", "item", ")", "{", "item", ".", "setChecked", "(", "itemChecked", ")", ".", "setVisible", "(", "itemVisible", ")", ".", "setEnabled", "(", "itemEnabled", ")", ".", "setCheckable", "(", "itemCheckable", ">=", "1", ")", ".", "setTitleCondensed", "(", "itemTitleCondensed", ")", ".", "setIcon", "(", "itemIconResId", ")", ".", "setAlphabeticShortcut", "(", "itemAlphabeticShortcut", ")", ".", "setNumericShortcut", "(", "itemNumericShortcut", ")", ";", "if", "(", "itemShowAsAction", ">=", "0", ")", "{", "item", ".", "setShowAsAction", "(", "itemShowAsAction", ")", ";", "}", "if", "(", "itemListenerMethodName", "!=", "null", ")", "{", "if", "(", "mContext", ".", "isRestricted", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"\"", "+", "\"\"", ")", ";", "}", "item", ".", "setOnMenuItemClickListener", "(", "new", "InflatedOnMenuItemClickListener", "(", "mContext", ",", "itemListenerMethodName", ")", ")", ";", "}", "if", "(", "itemCheckable", ">=", "2", ")", "{", "if", "(", "item", "instanceof", "MenuItemImpl", ")", "{", "MenuItemImpl", "impl", "=", "(", "MenuItemImpl", ")", "item", ";", "impl", ".", "setExclusiveCheckable", "(", "true", ")", ";", "}", "else", "{", "menu", ".", "setGroupCheckable", "(", "groupId", ",", "true", ",", "true", ")", ";", "}", "}", "boolean", "actionViewSpecified", "=", "false", ";", "if", "(", "itemActionViewClassName", "!=", "null", ")", "{", "View", "actionView", "=", "(", "View", ")", "newInstance", "(", "itemActionViewClassName", ",", "ACTION_VIEW_CONSTRUCTOR_SIGNATURE", ",", "mActionViewConstructorArguments", ")", ";", "item", ".", "setActionView", "(", "actionView", ")", ";", "actionViewSpecified", "=", "true", ";", "}", "if", "(", "itemActionViewLayout", ">", "0", ")", "{", "if", "(", "!", "actionViewSpecified", ")", "{", "item", ".", "setActionView", "(", "itemActionViewLayout", ")", ";", "actionViewSpecified", "=", "true", ";", "}", "else", "{", "Log", ".", "w", "(", "LOG_TAG", ",", "\"\"", "+", "\"\"", ")", ";", "}", "}", "if", "(", "itemActionProvider", "!=", "null", ")", "{", "item", ".", "setActionProvider", "(", "itemActionProvider", ")", ";", "}", "}", "public", "void", "addItem", "(", ")", "{", "itemAdded", "=", "true", ";", "setItem", "(", "menu", ".", "add", "(", "groupId", ",", "itemId", ",", "itemCategoryOrder", ",", "itemTitle", ")", ")", ";", "}", "public", "SubMenu", "addSubMenuItem", "(", ")", "{", "itemAdded", "=", "true", ";", "SubMenu", "subMenu", "=", "menu", ".", "addSubMenu", "(", "groupId", ",", "itemId", ",", "itemCategoryOrder", ",", "itemTitle", ")", ";", "setItem", "(", "subMenu", ".", "getItem", "(", ")", ")", ";", "return", "subMenu", ";", "}", "public", "boolean", "hasAddedItem", "(", ")", "{", "return", "itemAdded", ";", "}", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "T", "newInstance", "(", "String", "className", ",", "Class", "<", "?", ">", "[", "]", "constructorSignature", ",", "Object", "[", "]", "arguments", ")", "{", "try", "{", "Class", "<", "?", ">", "clazz", "=", "mContext", ".", "getClassLoader", "(", ")", ".", "loadClass", "(", "className", ")", ";", "Constructor", "<", "?", ">", "constructor", "=", "clazz", ".", "getConstructor", "(", "constructorSignature", ")", ";", "return", "(", "T", ")", "constructor", ".", "newInstance", "(", "arguments", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "Log", ".", "w", "(", "LOG_TAG", ",", "\"\"", "+", "className", ",", "e", ")", ";", "}", "return", "null", ";", "}", "}", "}", "</s>" ]
8,989
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "import", "android", ".", "content", ".", "Intent", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "view", ".", "ContextMenu", ".", "ContextMenuInfo", ";", "import", "android", ".", "view", ".", "View", ";", "public", "interface", "MenuItem", "{", "public", "static", "final", "int", "SHOW_AS_ACTION_NEVER", "=", "android", ".", "view", ".", "MenuItem", ".", "SHOW_AS_ACTION_NEVER", ";", "public", "static", "final", "int", "SHOW_AS_ACTION_IF_ROOM", "=", "android", ".", "view", ".", "MenuItem", ".", "SHOW_AS_ACTION_IF_ROOM", ";", "public", "static", "final", "int", "SHOW_AS_ACTION_ALWAYS", "=", "android", ".", "view", ".", "MenuItem", ".", "SHOW_AS_ACTION_ALWAYS", ";", "public", "static", "final", "int", "SHOW_AS_ACTION_WITH_TEXT", "=", "android", ".", "view", ".", "MenuItem", ".", "SHOW_AS_ACTION_WITH_TEXT", ";", "public", "static", "final", "int", "SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW", "=", "android", ".", "view", ".", "MenuItem", ".", "SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW", ";", "public", "interface", "OnMenuItemClickListener", "{", "public", "boolean", "onMenuItemClick", "(", "MenuItem", "item", ")", ";", "}", "public", "interface", "OnActionExpandListener", "{", "public", "boolean", "onMenuItemActionExpand", "(", "MenuItem", "item", ")", ";", "public", "boolean", "onMenuItemActionCollapse", "(", "MenuItem", "item", ")", ";", "}", "public", "int", "getItemId", "(", ")", ";", "public", "int", "getGroupId", "(", ")", ";", "public", "int", "getOrder", "(", ")", ";", "public", "MenuItem", "setTitle", "(", "CharSequence", "title", ")", ";", "public", "MenuItem", "setTitle", "(", "int", "title", ")", ";", "public", "CharSequence", "getTitle", "(", ")", ";", "public", "MenuItem", "setTitleCondensed", "(", "CharSequence", "title", ")", ";", "public", "CharSequence", "getTitleCondensed", "(", ")", ";", "public", "MenuItem", "setIcon", "(", "Drawable", "icon", ")", ";", "public", "MenuItem", "setIcon", "(", "int", "iconRes", ")", ";", "public", "Drawable", "getIcon", "(", ")", ";", "public", "MenuItem", "setIntent", "(", "Intent", "intent", ")", ";", "public", "Intent", "getIntent", "(", ")", ";", "public", "MenuItem", "setShortcut", "(", "char", "numericChar", ",", "char", "alphaChar", ")", ";", "public", "MenuItem", "setNumericShortcut", "(", "char", "numericChar", ")", ";", "public", "char", "getNumericShortcut", "(", ")", ";", "public", "MenuItem", "setAlphabeticShortcut", "(", "char", "alphaChar", ")", ";", "public", "char", "getAlphabeticShortcut", "(", ")", ";", "public", "MenuItem", "setCheckable", "(", "boolean", "checkable", ")", ";", "public", "boolean", "isCheckable", "(", ")", ";", "public", "MenuItem", "setChecked", "(", "boolean", "checked", ")", ";", "public", "boolean", "isChecked", "(", ")", ";", "public", "MenuItem", "setVisible", "(", "boolean", "visible", ")", ";", "public", "boolean", "isVisible", "(", ")", ";", "public", "MenuItem", "setEnabled", "(", "boolean", "enabled", ")", ";", "public", "boolean", "isEnabled", "(", ")", ";", "public", "boolean", "hasSubMenu", "(", ")", ";", "public", "SubMenu", "getSubMenu", "(", ")", ";", "public", "MenuItem", "setOnMenuItemClickListener", "(", "MenuItem", ".", "OnMenuItemClickListener", "menuItemClickListener", ")", ";", "public", "ContextMenuInfo", "getMenuInfo", "(", ")", ";", "public", "void", "setShowAsAction", "(", "int", "actionEnum", ")", ";", "public", "MenuItem", "setShowAsActionFlags", "(", "int", "actionEnum", ")", ";", "public", "MenuItem", "setActionView", "(", "View", "view", ")", ";", "public", "MenuItem", "setActionView", "(", "int", "resId", ")", ";", "public", "View", "getActionView", "(", ")", ";", "public", "MenuItem", "setActionProvider", "(", "ActionProvider", "actionProvider", ")", ";", "public", "ActionProvider", "getActionProvider", "(", ")", ";", "public", "boolean", "expandActionView", "(", ")", ";", "public", "boolean", "collapseActionView", "(", ")", ";", "public", "boolean", "isActionViewExpanded", "(", ")", ";", "public", "MenuItem", "setOnActionExpandListener", "(", "OnActionExpandListener", "listener", ")", ";", "}", "</s>" ]
8,990
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "view", ";", "public", "interface", "CollapsibleActionView", "{", "public", "void", "onActionViewExpanded", "(", ")", ";", "public", "void", "onActionViewCollapsed", "(", ")", ";", "}", "</s>" ]
8,991
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "org", ".", "xmlpull", ".", "v1", ".", "XmlPullParser", ";", "import", "android", ".", "app", ".", "Activity", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "pm", ".", "ApplicationInfo", ";", "import", "android", ".", "content", ".", "pm", ".", "PackageManager", ";", "import", "android", ".", "content", ".", "pm", ".", "PackageManager", ".", "NameNotFoundException", ";", "import", "android", ".", "content", ".", "res", ".", "AssetManager", ";", "import", "android", ".", "content", ".", "res", ".", "Configuration", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "content", ".", "res", ".", "XmlResourceParser", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "os", ".", "Parcel", ";", "import", "android", ".", "os", ".", "Parcelable", ";", "import", "android", ".", "text", ".", "TextUtils", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "util", ".", "Log", ";", "import", "android", ".", "view", ".", "Gravity", ";", "import", "android", ".", "view", ".", "LayoutInflater", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "view", ".", "ViewParent", ";", "import", "android", ".", "view", ".", "accessibility", ".", "AccessibilityEvent", ";", "import", "android", ".", "widget", ".", "FrameLayout", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "LinearLayout", ";", "import", "android", ".", "widget", ".", "SpinnerAdapter", ";", "import", "android", ".", "widget", ".", "TextView", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "com", ".", "actionbarsherlock", ".", "app", ".", "ActionBar", ";", "import", "com", ".", "actionbarsherlock", ".", "app", ".", "ActionBar", ".", "OnNavigationListener", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "ActionBarSherlockCompat", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "ActionMenuItem", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "ActionMenuPresenter", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "ActionMenuView", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "MenuBuilder", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "MenuItemImpl", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "MenuPresenter", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "MenuView", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "SubMenuBuilder", ";", "import", "com", ".", "actionbarsherlock", ".", "view", ".", "CollapsibleActionView", ";", "import", "com", ".", "actionbarsherlock", ".", "view", ".", "Menu", ";", "import", "com", ".", "actionbarsherlock", ".", "view", ".", "MenuItem", ";", "import", "com", ".", "actionbarsherlock", ".", "view", ".", "Window", ";", "import", "static", "com", ".", "actionbarsherlock", ".", "internal", ".", "ResourcesCompat", ".", "getResources_getBoolean", ";", "public", "class", "ActionBarView", "extends", "AbsActionBarView", "{", "private", "static", "final", "String", "TAG", "=", "\"\"", ";", "private", "static", "final", "boolean", "DEBUG", "=", "false", ";", "public", "static", "final", "int", "DISPLAY_DEFAULT", "=", "0", ";", "private", "static", "final", "int", "DISPLAY_RELAYOUT_MASK", "=", "ActionBar", ".", "DISPLAY_SHOW_HOME", "|", "ActionBar", ".", "DISPLAY_USE_LOGO", "|", "ActionBar", ".", "DISPLAY_HOME_AS_UP", "|", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", "|", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ";", "private", "static", "final", "int", "DEFAULT_CUSTOM_GRAVITY", "=", "Gravity", ".", "LEFT", "|", "Gravity", ".", "CENTER_VERTICAL", ";", "private", "int", "mNavigationMode", ";", "private", "int", "mDisplayOptions", "=", "-", "1", ";", "private", "CharSequence", "mTitle", ";", "private", "CharSequence", "mSubtitle", ";", "private", "Drawable", "mIcon", ";", "private", "Drawable", "mLogo", ";", "private", "HomeView", "mHomeLayout", ";", "private", "HomeView", "mExpandedHomeLayout", ";", "private", "LinearLayout", "mTitleLayout", ";", "private", "TextView", "mTitleView", ";", "private", "TextView", "mSubtitleView", ";", "private", "View", "mTitleUpView", ";", "private", "IcsSpinner", "mSpinner", ";", "private", "IcsLinearLayout", "mListNavLayout", ";", "private", "ScrollingTabContainerView", "mTabScrollView", ";", "private", "View", "mCustomNavView", ";", "private", "IcsProgressBar", "mProgressView", ";", "private", "IcsProgressBar", "mIndeterminateProgressView", ";", "private", "int", "mProgressBarPadding", ";", "private", "int", "mItemPadding", ";", "private", "int", "mTitleStyleRes", ";", "private", "int", "mSubtitleStyleRes", ";", "private", "int", "mProgressStyle", ";", "private", "int", "mIndeterminateProgressStyle", ";", "private", "boolean", "mUserTitle", ";", "private", "boolean", "mIncludeTabs", ";", "private", "boolean", "mIsCollapsable", ";", "private", "boolean", "mIsCollapsed", ";", "private", "MenuBuilder", "mOptionsMenu", ";", "private", "ActionBarContextView", "mContextView", ";", "private", "ActionMenuItem", "mLogoNavItem", ";", "private", "SpinnerAdapter", "mSpinnerAdapter", ";", "private", "OnNavigationListener", "mCallback", ";", "private", "ExpandedActionViewMenuPresenter", "mExpandedMenuPresenter", ";", "View", "mExpandedActionView", ";", "Window", ".", "Callback", "mWindowCallback", ";", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "private", "final", "IcsAdapterView", ".", "OnItemSelectedListener", "mNavItemSelectedListener", "=", "new", "IcsAdapterView", ".", "OnItemSelectedListener", "(", ")", "{", "public", "void", "onItemSelected", "(", "IcsAdapterView", "parent", ",", "View", "view", ",", "int", "position", ",", "long", "id", ")", "{", "if", "(", "mCallback", "!=", "null", ")", "{", "mCallback", ".", "onNavigationItemSelected", "(", "position", ",", "id", ")", ";", "}", "}", "public", "void", "onNothingSelected", "(", "IcsAdapterView", "parent", ")", "{", "}", "}", ";", "private", "final", "OnClickListener", "mExpandedActionViewUpListener", "=", "new", "OnClickListener", "(", ")", "{", "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "final", "MenuItemImpl", "item", "=", "mExpandedMenuPresenter", ".", "mCurrentExpandedItem", ";", "if", "(", "item", "!=", "null", ")", "{", "item", ".", "collapseActionView", "(", ")", ";", "}", "}", "}", ";", "private", "final", "OnClickListener", "mUpClickListener", "=", "new", "OnClickListener", "(", ")", "{", "public", "void", "onClick", "(", "View", "v", ")", "{", "mWindowCallback", ".", "onMenuItemSelected", "(", "Window", ".", "FEATURE_OPTIONS_PANEL", ",", "mLogoNavItem", ")", ";", "}", "}", ";", "public", "ActionBarView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "setBackgroundResource", "(", "0", ")", ";", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", "(", "attrs", ",", "R", ".", "styleable", ".", "SherlockActionBar", ",", "R", ".", "attr", ".", "actionBarStyle", ",", "0", ")", ";", "ApplicationInfo", "appInfo", "=", "context", ".", "getApplicationInfo", "(", ")", ";", "PackageManager", "pm", "=", "context", ".", "getPackageManager", "(", ")", ";", "mNavigationMode", "=", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockActionBar_navigationMode", ",", "ActionBar", ".", "NAVIGATION_MODE_STANDARD", ")", ";", "mTitle", "=", "a", ".", "getText", "(", "R", ".", "styleable", ".", "SherlockActionBar_title", ")", ";", "mSubtitle", "=", "a", ".", "getText", "(", "R", ".", "styleable", ".", "SherlockActionBar_subtitle", ")", ";", "mLogo", "=", "a", ".", "getDrawable", "(", "R", ".", "styleable", ".", "SherlockActionBar_logo", ")", ";", "if", "(", "mLogo", "==", "null", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", "<", "Build", ".", "VERSION_CODES", ".", "HONEYCOMB", ")", "{", "if", "(", "context", "instanceof", "Activity", ")", "{", "final", "int", "resId", "=", "loadLogoFromManifest", "(", "(", "Activity", ")", "context", ")", ";", "if", "(", "resId", "!=", "0", ")", "{", "mLogo", "=", "context", ".", "getResources", "(", ")", ".", "getDrawable", "(", "resId", ")", ";", "}", "}", "}", "else", "{", "if", "(", "context", "instanceof", "Activity", ")", "{", "try", "{", "mLogo", "=", "pm", ".", "getActivityLogo", "(", "(", "(", "Activity", ")", "context", ")", ".", "getComponentName", "(", ")", ")", ";", "}", "catch", "(", "NameNotFoundException", "e", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"\"", ",", "e", ")", ";", "}", "}", "if", "(", "mLogo", "==", "null", ")", "{", "mLogo", "=", "appInfo", ".", "loadLogo", "(", "pm", ")", ";", "}", "}", "}", "mIcon", "=", "a", ".", "getDrawable", "(", "R", ".", "styleable", ".", "SherlockActionBar_icon", ")", ";", "if", "(", "mIcon", "==", "null", ")", "{", "if", "(", "context", "instanceof", "Activity", ")", "{", "try", "{", "mIcon", "=", "pm", ".", "getActivityIcon", "(", "(", "(", "Activity", ")", "context", ")", ".", "getComponentName", "(", ")", ")", ";", "}", "catch", "(", "NameNotFoundException", "e", ")", "{", "Log", ".", "e", "(", "TAG", ",", "\"\"", ",", "e", ")", ";", "}", "}", "if", "(", "mIcon", "==", "null", ")", "{", "mIcon", "=", "appInfo", ".", "loadIcon", "(", "pm", ")", ";", "}", "}", "final", "LayoutInflater", "inflater", "=", "LayoutInflater", ".", "from", "(", "context", ")", ";", "final", "int", "homeResId", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_homeLayout", ",", "R", ".", "layout", ".", "abs__action_bar_home", ")", ";", "mHomeLayout", "=", "(", "HomeView", ")", "inflater", ".", "inflate", "(", "homeResId", ",", "this", ",", "false", ")", ";", "mExpandedHomeLayout", "=", "(", "HomeView", ")", "inflater", ".", "inflate", "(", "homeResId", ",", "this", ",", "false", ")", ";", "mExpandedHomeLayout", ".", "setUp", "(", "true", ")", ";", "mExpandedHomeLayout", ".", "setOnClickListener", "(", "mExpandedActionViewUpListener", ")", ";", "mExpandedHomeLayout", ".", "setContentDescription", "(", "getResources", "(", ")", ".", "getText", "(", "R", ".", "string", ".", "abs__action_bar_up_description", ")", ")", ";", "mTitleStyleRes", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_titleTextStyle", ",", "0", ")", ";", "mSubtitleStyleRes", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_subtitleTextStyle", ",", "0", ")", ";", "mProgressStyle", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_progressBarStyle", ",", "0", ")", ";", "mIndeterminateProgressStyle", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_indeterminateProgressStyle", ",", "0", ")", ";", "mProgressBarPadding", "=", "a", ".", "getDimensionPixelOffset", "(", "R", ".", "styleable", ".", "SherlockActionBar_progressBarPadding", ",", "0", ")", ";", "mItemPadding", "=", "a", ".", "getDimensionPixelOffset", "(", "R", ".", "styleable", ".", "SherlockActionBar_itemPadding", ",", "0", ")", ";", "setDisplayOptions", "(", "a", ".", "getInt", "(", "R", ".", "styleable", ".", "SherlockActionBar_displayOptions", ",", "DISPLAY_DEFAULT", ")", ")", ";", "final", "int", "customNavId", "=", "a", ".", "getResourceId", "(", "R", ".", "styleable", ".", "SherlockActionBar_customNavigationLayout", ",", "0", ")", ";", "if", "(", "customNavId", "!=", "0", ")", "{", "mCustomNavView", "=", "inflater", ".", "inflate", "(", "customNavId", ",", "this", ",", "false", ")", ";", "mNavigationMode", "=", "ActionBar", ".", "NAVIGATION_MODE_STANDARD", ";", "setDisplayOptions", "(", "mDisplayOptions", "|", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", ";", "}", "mContentHeight", "=", "a", ".", "getLayoutDimension", "(", "R", ".", "styleable", ".", "SherlockActionBar_height", ",", "0", ")", ";", "a", ".", "recycle", "(", ")", ";", "mLogoNavItem", "=", "new", "ActionMenuItem", "(", "context", ",", "0", ",", "android", ".", "R", ".", "id", ".", "home", ",", "0", ",", "0", ",", "mTitle", ")", ";", "mHomeLayout", ".", "setOnClickListener", "(", "mUpClickListener", ")", ";", "mHomeLayout", ".", "setClickable", "(", "true", ")", ";", "mHomeLayout", ".", "setFocusable", "(", "true", ")", ";", "}", "private", "static", "int", "loadLogoFromManifest", "(", "Activity", "activity", ")", "{", "int", "logo", "=", "0", ";", "try", "{", "final", "String", "thisPackage", "=", "activity", ".", "getClass", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "DEBUG", ")", "Log", ".", "i", "(", "TAG", ",", "\"\"", "+", "thisPackage", ")", ";", "final", "String", "packageName", "=", "activity", ".", "getApplicationInfo", "(", ")", ".", "packageName", ";", "final", "AssetManager", "am", "=", "activity", ".", "createPackageContext", "(", "packageName", ",", "0", ")", ".", "getAssets", "(", ")", ";", "final", "XmlResourceParser", "xml", "=", "am", ".", "openXmlResourceParser", "(", "\"\"", ")", ";", "int", "eventType", "=", "xml", ".", "getEventType", "(", ")", ";", "while", "(", "eventType", "!=", "XmlPullParser", ".", "END_DOCUMENT", ")", "{", "if", "(", "eventType", "==", "XmlPullParser", ".", "START_TAG", ")", "{", "String", "name", "=", "xml", ".", "getName", "(", ")", ";", "if", "(", "\"application\"", ".", "equals", "(", "name", ")", ")", "{", "if", "(", "DEBUG", ")", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "for", "(", "int", "i", "=", "xml", ".", "getAttributeCount", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "DEBUG", ")", "Log", ".", "d", "(", "TAG", ",", "xml", ".", "getAttributeName", "(", "i", ")", "+", "\":", "\"", "+", "xml", ".", "getAttributeValue", "(", "i", ")", ")", ";", "if", "(", "\"logo\"", ".", "equals", "(", "xml", ".", "getAttributeName", "(", "i", ")", ")", ")", "{", "logo", "=", "xml", ".", "getAttributeResourceValue", "(", "i", ",", "0", ")", ";", "break", ";", "}", "}", "}", "else", "if", "(", "\"activity\"", ".", "equals", "(", "name", ")", ")", "{", "if", "(", "DEBUG", ")", "Log", ".", "d", "(", "TAG", ",", "\"\"", ")", ";", "Integer", "activityLogo", "=", "null", ";", "String", "activityPackage", "=", "null", ";", "boolean", "isOurActivity", "=", "false", ";", "for", "(", "int", "i", "=", "xml", ".", "getAttributeCount", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "DEBUG", ")", "Log", ".", "d", "(", "TAG", ",", "xml", ".", "getAttributeName", "(", "i", ")", "+", "\":", "\"", "+", "xml", ".", "getAttributeValue", "(", "i", ")", ")", ";", "String", "attrName", "=", "xml", ".", "getAttributeName", "(", "i", ")", ";", "if", "(", "\"logo\"", ".", "equals", "(", "attrName", ")", ")", "{", "activityLogo", "=", "xml", ".", "getAttributeResourceValue", "(", "i", ",", "0", ")", ";", "}", "else", "if", "(", "\"name\"", ".", "equals", "(", "attrName", ")", ")", "{", "activityPackage", "=", "ActionBarSherlockCompat", ".", "cleanActivityName", "(", "packageName", ",", "xml", ".", "getAttributeValue", "(", "i", ")", ")", ";", "if", "(", "!", "thisPackage", ".", "equals", "(", "activityPackage", ")", ")", "{", "break", ";", "}", "isOurActivity", "=", "true", ";", "}", "if", "(", "(", "activityLogo", "!=", "null", ")", "&&", "(", "activityPackage", "!=", "null", ")", ")", "{", "logo", "=", "activityLogo", ".", "intValue", "(", ")", ";", "}", "}", "if", "(", "isOurActivity", ")", "{", "break", ";", "}", "}", "}", "eventType", "=", "xml", ".", "nextToken", "(", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "if", "(", "DEBUG", ")", "Log", ".", "i", "(", "TAG", ",", "\"Returning", "\"", "+", "Integer", ".", "toHexString", "(", "logo", ")", ")", ";", "return", "logo", ";", "}", "@", "Override", "public", "void", "onConfigurationChanged", "(", "Configuration", "newConfig", ")", "{", "super", ".", "onConfigurationChanged", "(", "newConfig", ")", ";", "mTitleView", "=", "null", ";", "mSubtitleView", "=", "null", ";", "mTitleUpView", "=", "null", ";", "if", "(", "mTitleLayout", "!=", "null", "&&", "mTitleLayout", ".", "getParent", "(", ")", "==", "this", ")", "{", "removeView", "(", "mTitleLayout", ")", ";", "}", "mTitleLayout", "=", "null", ";", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ")", "{", "initTitle", "(", ")", ";", "}", "if", "(", "mTabScrollView", "!=", "null", "&&", "mIncludeTabs", ")", "{", "ViewGroup", ".", "LayoutParams", "lp", "=", "mTabScrollView", ".", "getLayoutParams", "(", ")", ";", "if", "(", "lp", "!=", "null", ")", "{", "lp", ".", "width", "=", "LayoutParams", ".", "WRAP_CONTENT", ";", "lp", ".", "height", "=", "LayoutParams", ".", "MATCH_PARENT", ";", "}", "mTabScrollView", ".", "setAllowCollapse", "(", "true", ")", ";", "}", "}", "public", "void", "setWindowCallback", "(", "Window", ".", "Callback", "cb", ")", "{", "mWindowCallback", "=", "cb", ";", "}", "@", "Override", "public", "void", "onDetachedFromWindow", "(", ")", "{", "super", ".", "onDetachedFromWindow", "(", ")", ";", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "mActionMenuPresenter", ".", "hideOverflowMenu", "(", ")", ";", "mActionMenuPresenter", ".", "hideSubMenus", "(", ")", ";", "}", "}", "@", "Override", "public", "boolean", "shouldDelayChildPressedState", "(", ")", "{", "return", "false", ";", "}", "public", "void", "initProgress", "(", ")", "{", "mProgressView", "=", "new", "IcsProgressBar", "(", "mContext", ",", "null", ",", "0", ",", "mProgressStyle", ")", ";", "mProgressView", ".", "setId", "(", "R", ".", "id", ".", "abs__progress_horizontal", ")", ";", "mProgressView", ".", "setMax", "(", "10000", ")", ";", "addView", "(", "mProgressView", ")", ";", "}", "public", "void", "initIndeterminateProgress", "(", ")", "{", "mIndeterminateProgressView", "=", "new", "IcsProgressBar", "(", "mContext", ",", "null", ",", "0", ",", "mIndeterminateProgressStyle", ")", ";", "mIndeterminateProgressView", ".", "setId", "(", "R", ".", "id", ".", "abs__progress_circular", ")", ";", "addView", "(", "mIndeterminateProgressView", ")", ";", "}", "@", "Override", "public", "void", "setSplitActionBar", "(", "boolean", "splitActionBar", ")", "{", "if", "(", "mSplitActionBar", "!=", "splitActionBar", ")", "{", "if", "(", "mMenuView", "!=", "null", ")", "{", "final", "ViewGroup", "oldParent", "=", "(", "ViewGroup", ")", "mMenuView", ".", "getParent", "(", ")", ";", "if", "(", "oldParent", "!=", "null", ")", "{", "oldParent", ".", "removeView", "(", "mMenuView", ")", ";", "}", "if", "(", "splitActionBar", ")", "{", "if", "(", "mSplitView", "!=", "null", ")", "{", "mSplitView", ".", "addView", "(", "mMenuView", ")", ";", "}", "}", "else", "{", "addView", "(", "mMenuView", ")", ";", "}", "}", "if", "(", "mSplitView", "!=", "null", ")", "{", "mSplitView", ".", "setVisibility", "(", "splitActionBar", "?", "VISIBLE", ":", "GONE", ")", ";", "}", "super", ".", "setSplitActionBar", "(", "splitActionBar", ")", ";", "}", "}", "public", "boolean", "isSplitActionBar", "(", ")", "{", "return", "mSplitActionBar", ";", "}", "public", "boolean", "hasEmbeddedTabs", "(", ")", "{", "return", "mIncludeTabs", ";", "}", "public", "void", "setEmbeddedTabView", "(", "ScrollingTabContainerView", "tabs", ")", "{", "if", "(", "mTabScrollView", "!=", "null", ")", "{", "removeView", "(", "mTabScrollView", ")", ";", "}", "mTabScrollView", "=", "tabs", ";", "mIncludeTabs", "=", "tabs", "!=", "null", ";", "if", "(", "mIncludeTabs", "&&", "mNavigationMode", "==", "ActionBar", ".", "NAVIGATION_MODE_TABS", ")", "{", "addView", "(", "mTabScrollView", ")", ";", "ViewGroup", ".", "LayoutParams", "lp", "=", "mTabScrollView", ".", "getLayoutParams", "(", ")", ";", "lp", ".", "width", "=", "LayoutParams", ".", "WRAP_CONTENT", ";", "lp", ".", "height", "=", "LayoutParams", ".", "MATCH_PARENT", ";", "tabs", ".", "setAllowCollapse", "(", "true", ")", ";", "}", "}", "public", "void", "setCallback", "(", "OnNavigationListener", "callback", ")", "{", "mCallback", "=", "callback", ";", "}", "public", "void", "setMenu", "(", "Menu", "menu", ",", "MenuPresenter", ".", "Callback", "cb", ")", "{", "if", "(", "menu", "==", "mOptionsMenu", ")", "return", ";", "if", "(", "mOptionsMenu", "!=", "null", ")", "{", "mOptionsMenu", ".", "removeMenuPresenter", "(", "mActionMenuPresenter", ")", ";", "mOptionsMenu", ".", "removeMenuPresenter", "(", "mExpandedMenuPresenter", ")", ";", "}", "MenuBuilder", "builder", "=", "(", "MenuBuilder", ")", "menu", ";", "mOptionsMenu", "=", "builder", ";", "if", "(", "mMenuView", "!=", "null", ")", "{", "final", "ViewGroup", "oldParent", "=", "(", "ViewGroup", ")", "mMenuView", ".", "getParent", "(", ")", ";", "if", "(", "oldParent", "!=", "null", ")", "{", "oldParent", ".", "removeView", "(", "mMenuView", ")", ";", "}", "}", "if", "(", "mActionMenuPresenter", "==", "null", ")", "{", "mActionMenuPresenter", "=", "new", "ActionMenuPresenter", "(", "mContext", ")", ";", "mActionMenuPresenter", ".", "setCallback", "(", "cb", ")", ";", "mActionMenuPresenter", ".", "setId", "(", "R", ".", "id", ".", "abs__action_menu_presenter", ")", ";", "mExpandedMenuPresenter", "=", "new", "ExpandedActionViewMenuPresenter", "(", ")", ";", "}", "ActionMenuView", "menuView", ";", "final", "LayoutParams", "layoutParams", "=", "new", "LayoutParams", "(", "LayoutParams", ".", "WRAP_CONTENT", ",", "LayoutParams", ".", "MATCH_PARENT", ")", ";", "if", "(", "!", "mSplitActionBar", ")", "{", "mActionMenuPresenter", ".", "setExpandedActionViewsExclusive", "(", "getResources_getBoolean", "(", "getContext", "(", ")", ",", "R", ".", "bool", ".", "abs__action_bar_expanded_action_views_exclusive", ")", ")", ";", "configPresenters", "(", "builder", ")", ";", "menuView", "=", "(", "ActionMenuView", ")", "mActionMenuPresenter", ".", "getMenuView", "(", "this", ")", ";", "final", "ViewGroup", "oldParent", "=", "(", "ViewGroup", ")", "menuView", ".", "getParent", "(", ")", ";", "if", "(", "oldParent", "!=", "null", "&&", "oldParent", "!=", "this", ")", "{", "oldParent", ".", "removeView", "(", "menuView", ")", ";", "}", "addView", "(", "menuView", ",", "layoutParams", ")", ";", "}", "else", "{", "mActionMenuPresenter", ".", "setExpandedActionViewsExclusive", "(", "false", ")", ";", "mActionMenuPresenter", ".", "setWidthLimit", "(", "getContext", "(", ")", ".", "getResources", "(", ")", ".", "getDisplayMetrics", "(", ")", ".", "widthPixels", ",", "true", ")", ";", "mActionMenuPresenter", ".", "setItemLimit", "(", "Integer", ".", "MAX_VALUE", ")", ";", "layoutParams", ".", "width", "=", "LayoutParams", ".", "MATCH_PARENT", ";", "configPresenters", "(", "builder", ")", ";", "menuView", "=", "(", "ActionMenuView", ")", "mActionMenuPresenter", ".", "getMenuView", "(", "this", ")", ";", "if", "(", "mSplitView", "!=", "null", ")", "{", "final", "ViewGroup", "oldParent", "=", "(", "ViewGroup", ")", "menuView", ".", "getParent", "(", ")", ";", "if", "(", "oldParent", "!=", "null", "&&", "oldParent", "!=", "mSplitView", ")", "{", "oldParent", ".", "removeView", "(", "menuView", ")", ";", "}", "menuView", ".", "setVisibility", "(", "getAnimatedVisibility", "(", ")", ")", ";", "mSplitView", ".", "addView", "(", "menuView", ",", "layoutParams", ")", ";", "}", "else", "{", "menuView", ".", "setLayoutParams", "(", "layoutParams", ")", ";", "}", "}", "mMenuView", "=", "menuView", ";", "}", "private", "void", "configPresenters", "(", "MenuBuilder", "builder", ")", "{", "if", "(", "builder", "!=", "null", ")", "{", "builder", ".", "addMenuPresenter", "(", "mActionMenuPresenter", ")", ";", "builder", ".", "addMenuPresenter", "(", "mExpandedMenuPresenter", ")", ";", "}", "else", "{", "mActionMenuPresenter", ".", "initForMenu", "(", "mContext", ",", "null", ")", ";", "mExpandedMenuPresenter", ".", "initForMenu", "(", "mContext", ",", "null", ")", ";", "mActionMenuPresenter", ".", "updateMenuView", "(", "true", ")", ";", "mExpandedMenuPresenter", ".", "updateMenuView", "(", "true", ")", ";", "}", "}", "public", "boolean", "hasExpandedActionView", "(", ")", "{", "return", "mExpandedMenuPresenter", "!=", "null", "&&", "mExpandedMenuPresenter", ".", "mCurrentExpandedItem", "!=", "null", ";", "}", "public", "void", "collapseActionView", "(", ")", "{", "final", "MenuItemImpl", "item", "=", "mExpandedMenuPresenter", "==", "null", "?", "null", ":", "mExpandedMenuPresenter", ".", "mCurrentExpandedItem", ";", "if", "(", "item", "!=", "null", ")", "{", "item", ".", "collapseActionView", "(", ")", ";", "}", "}", "public", "void", "setCustomNavigationView", "(", "View", "view", ")", "{", "final", "boolean", "showCustom", "=", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", ";", "if", "(", "mCustomNavView", "!=", "null", "&&", "showCustom", ")", "{", "removeView", "(", "mCustomNavView", ")", ";", "}", "mCustomNavView", "=", "view", ";", "if", "(", "mCustomNavView", "!=", "null", "&&", "showCustom", ")", "{", "addView", "(", "mCustomNavView", ")", ";", "}", "}", "public", "CharSequence", "getTitle", "(", ")", "{", "return", "mTitle", ";", "}", "public", "void", "setTitle", "(", "CharSequence", "title", ")", "{", "mUserTitle", "=", "true", ";", "setTitleImpl", "(", "title", ")", ";", "}", "public", "void", "setWindowTitle", "(", "CharSequence", "title", ")", "{", "if", "(", "!", "mUserTitle", ")", "{", "setTitleImpl", "(", "title", ")", ";", "}", "}", "private", "void", "setTitleImpl", "(", "CharSequence", "title", ")", "{", "mTitle", "=", "title", ";", "if", "(", "mTitleView", "!=", "null", ")", "{", "mTitleView", ".", "setText", "(", "title", ")", ";", "final", "boolean", "visible", "=", "mExpandedActionView", "==", "null", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", "&&", "(", "!", "TextUtils", ".", "isEmpty", "(", "mTitle", ")", "||", "!", "TextUtils", ".", "isEmpty", "(", "mSubtitle", ")", ")", ";", "mTitleLayout", ".", "setVisibility", "(", "visible", "?", "VISIBLE", ":", "GONE", ")", ";", "}", "if", "(", "mLogoNavItem", "!=", "null", ")", "{", "mLogoNavItem", ".", "setTitle", "(", "title", ")", ";", "}", "}", "public", "CharSequence", "getSubtitle", "(", ")", "{", "return", "mSubtitle", ";", "}", "public", "void", "setSubtitle", "(", "CharSequence", "subtitle", ")", "{", "mSubtitle", "=", "subtitle", ";", "if", "(", "mSubtitleView", "!=", "null", ")", "{", "mSubtitleView", ".", "setText", "(", "subtitle", ")", ";", "mSubtitleView", ".", "setVisibility", "(", "subtitle", "!=", "null", "?", "VISIBLE", ":", "GONE", ")", ";", "final", "boolean", "visible", "=", "mExpandedActionView", "==", "null", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", "&&", "(", "!", "TextUtils", ".", "isEmpty", "(", "mTitle", ")", "||", "!", "TextUtils", ".", "isEmpty", "(", "mSubtitle", ")", ")", ";", "mTitleLayout", ".", "setVisibility", "(", "visible", "?", "VISIBLE", ":", "GONE", ")", ";", "}", "}", "public", "void", "setHomeButtonEnabled", "(", "boolean", "enable", ")", "{", "mHomeLayout", ".", "setEnabled", "(", "enable", ")", ";", "mHomeLayout", ".", "setFocusable", "(", "enable", ")", ";", "if", "(", "!", "enable", ")", "{", "mHomeLayout", ".", "setContentDescription", "(", "null", ")", ";", "}", "else", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ")", "{", "mHomeLayout", ".", "setContentDescription", "(", "mContext", ".", "getResources", "(", ")", ".", "getText", "(", "R", ".", "string", ".", "abs__action_bar_up_description", ")", ")", ";", "}", "else", "{", "mHomeLayout", ".", "setContentDescription", "(", "mContext", ".", "getResources", "(", ")", ".", "getText", "(", "R", ".", "string", ".", "abs__action_bar_home_description", ")", ")", ";", "}", "}", "public", "void", "setDisplayOptions", "(", "int", "options", ")", "{", "final", "int", "flagsChanged", "=", "mDisplayOptions", "==", "-", "1", "?", "-", "1", ":", "options", "^", "mDisplayOptions", ";", "mDisplayOptions", "=", "options", ";", "if", "(", "(", "flagsChanged", "&", "DISPLAY_RELAYOUT_MASK", ")", "!=", "0", ")", "{", "final", "boolean", "showHome", "=", "(", "options", "&", "ActionBar", ".", "DISPLAY_SHOW_HOME", ")", "!=", "0", ";", "final", "int", "vis", "=", "showHome", "&&", "mExpandedActionView", "==", "null", "?", "VISIBLE", ":", "GONE", ";", "mHomeLayout", ".", "setVisibility", "(", "vis", ")", ";", "if", "(", "(", "flagsChanged", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ")", "{", "final", "boolean", "setUp", "=", "(", "options", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ";", "mHomeLayout", ".", "setUp", "(", "setUp", ")", ";", "if", "(", "setUp", ")", "{", "setHomeButtonEnabled", "(", "true", ")", ";", "}", "}", "if", "(", "(", "flagsChanged", "&", "ActionBar", ".", "DISPLAY_USE_LOGO", ")", "!=", "0", ")", "{", "final", "boolean", "logoVis", "=", "mLogo", "!=", "null", "&&", "(", "options", "&", "ActionBar", ".", "DISPLAY_USE_LOGO", ")", "!=", "0", ";", "mHomeLayout", ".", "setIcon", "(", "logoVis", "?", "mLogo", ":", "mIcon", ")", ";", "}", "if", "(", "(", "flagsChanged", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ")", "{", "if", "(", "(", "options", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ")", "{", "initTitle", "(", ")", ";", "}", "else", "{", "removeView", "(", "mTitleLayout", ")", ";", "}", "}", "if", "(", "mTitleLayout", "!=", "null", "&&", "(", "flagsChanged", "&", "(", "ActionBar", ".", "DISPLAY_HOME_AS_UP", "|", "ActionBar", ".", "DISPLAY_SHOW_HOME", ")", ")", "!=", "0", ")", "{", "final", "boolean", "homeAsUp", "=", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ";", "mTitleUpView", ".", "setVisibility", "(", "!", "showHome", "?", "(", "homeAsUp", "?", "VISIBLE", ":", "INVISIBLE", ")", ":", "GONE", ")", ";", "mTitleLayout", ".", "setEnabled", "(", "!", "showHome", "&&", "homeAsUp", ")", ";", "}", "if", "(", "(", "flagsChanged", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", "&&", "mCustomNavView", "!=", "null", ")", "{", "if", "(", "(", "options", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", ")", "{", "addView", "(", "mCustomNavView", ")", ";", "}", "else", "{", "removeView", "(", "mCustomNavView", ")", ";", "}", "}", "requestLayout", "(", ")", ";", "}", "else", "{", "invalidate", "(", ")", ";", "}", "if", "(", "!", "mHomeLayout", ".", "isEnabled", "(", ")", ")", "{", "mHomeLayout", ".", "setContentDescription", "(", "null", ")", ";", "}", "else", "if", "(", "(", "options", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ")", "{", "mHomeLayout", ".", "setContentDescription", "(", "mContext", ".", "getResources", "(", ")", ".", "getText", "(", "R", ".", "string", ".", "abs__action_bar_up_description", ")", ")", ";", "}", "else", "{", "mHomeLayout", ".", "setContentDescription", "(", "mContext", ".", "getResources", "(", ")", ".", "getText", "(", "R", ".", "string", ".", "abs__action_bar_home_description", ")", ")", ";", "}", "}", "public", "void", "setIcon", "(", "Drawable", "icon", ")", "{", "mIcon", "=", "icon", ";", "if", "(", "icon", "!=", "null", "&&", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_USE_LOGO", ")", "==", "0", "||", "mLogo", "==", "null", ")", ")", "{", "mHomeLayout", ".", "setIcon", "(", "icon", ")", ";", "}", "}", "public", "void", "setIcon", "(", "int", "resId", ")", "{", "setIcon", "(", "mContext", ".", "getResources", "(", ")", ".", "getDrawable", "(", "resId", ")", ")", ";", "}", "public", "void", "setLogo", "(", "Drawable", "logo", ")", "{", "mLogo", "=", "logo", ";", "if", "(", "logo", "!=", "null", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_USE_LOGO", ")", "!=", "0", ")", "{", "mHomeLayout", ".", "setIcon", "(", "logo", ")", ";", "}", "}", "public", "void", "setLogo", "(", "int", "resId", ")", "{", "setLogo", "(", "mContext", ".", "getResources", "(", ")", ".", "getDrawable", "(", "resId", ")", ")", ";", "}", "public", "void", "setNavigationMode", "(", "int", "mode", ")", "{", "final", "int", "oldMode", "=", "mNavigationMode", ";", "if", "(", "mode", "!=", "oldMode", ")", "{", "switch", "(", "oldMode", ")", "{", "case", "ActionBar", ".", "NAVIGATION_MODE_LIST", ":", "if", "(", "mListNavLayout", "!=", "null", ")", "{", "removeView", "(", "mListNavLayout", ")", ";", "}", "break", ";", "case", "ActionBar", ".", "NAVIGATION_MODE_TABS", ":", "if", "(", "mTabScrollView", "!=", "null", "&&", "mIncludeTabs", ")", "{", "removeView", "(", "mTabScrollView", ")", ";", "}", "}", "switch", "(", "mode", ")", "{", "case", "ActionBar", ".", "NAVIGATION_MODE_LIST", ":", "if", "(", "mSpinner", "==", "null", ")", "{", "mSpinner", "=", "new", "IcsSpinner", "(", "mContext", ",", "null", ",", "R", ".", "attr", ".", "actionDropDownStyle", ")", ";", "mListNavLayout", "=", "(", "IcsLinearLayout", ")", "LayoutInflater", ".", "from", "(", "mContext", ")", ".", "inflate", "(", "R", ".", "layout", ".", "abs__action_bar_tab_bar_view", ",", "null", ")", ";", "LinearLayout", ".", "LayoutParams", "params", "=", "new", "LinearLayout", ".", "LayoutParams", "(", "LayoutParams", ".", "WRAP_CONTENT", ",", "LayoutParams", ".", "MATCH_PARENT", ")", ";", "params", ".", "gravity", "=", "Gravity", ".", "CENTER", ";", "mListNavLayout", ".", "addView", "(", "mSpinner", ",", "params", ")", ";", "}", "if", "(", "mSpinner", ".", "getAdapter", "(", ")", "!=", "mSpinnerAdapter", ")", "{", "mSpinner", ".", "setAdapter", "(", "mSpinnerAdapter", ")", ";", "}", "mSpinner", ".", "setOnItemSelectedListener", "(", "mNavItemSelectedListener", ")", ";", "addView", "(", "mListNavLayout", ")", ";", "break", ";", "case", "ActionBar", ".", "NAVIGATION_MODE_TABS", ":", "if", "(", "mTabScrollView", "!=", "null", "&&", "mIncludeTabs", ")", "{", "addView", "(", "mTabScrollView", ")", ";", "}", "break", ";", "}", "mNavigationMode", "=", "mode", ";", "requestLayout", "(", ")", ";", "}", "}", "public", "void", "setDropdownAdapter", "(", "SpinnerAdapter", "adapter", ")", "{", "mSpinnerAdapter", "=", "adapter", ";", "if", "(", "mSpinner", "!=", "null", ")", "{", "mSpinner", ".", "setAdapter", "(", "adapter", ")", ";", "}", "}", "public", "SpinnerAdapter", "getDropdownAdapter", "(", ")", "{", "return", "mSpinnerAdapter", ";", "}", "public", "void", "setDropdownSelectedPosition", "(", "int", "position", ")", "{", "mSpinner", ".", "setSelection", "(", "position", ")", ";", "}", "public", "int", "getDropdownSelectedPosition", "(", ")", "{", "return", "mSpinner", ".", "getSelectedItemPosition", "(", ")", ";", "}", "public", "View", "getCustomNavigationView", "(", ")", "{", "return", "mCustomNavView", ";", "}", "public", "int", "getNavigationMode", "(", ")", "{", "return", "mNavigationMode", ";", "}", "public", "int", "getDisplayOptions", "(", ")", "{", "return", "mDisplayOptions", ";", "}", "@", "Override", "protected", "ViewGroup", ".", "LayoutParams", "generateDefaultLayoutParams", "(", ")", "{", "return", "new", "ActionBar", ".", "LayoutParams", "(", "DEFAULT_CUSTOM_GRAVITY", ")", ";", "}", "@", "Override", "protected", "void", "onFinishInflate", "(", ")", "{", "super", ".", "onFinishInflate", "(", ")", ";", "addView", "(", "mHomeLayout", ")", ";", "if", "(", "mCustomNavView", "!=", "null", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", ")", "{", "final", "ViewParent", "parent", "=", "mCustomNavView", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "this", ")", "{", "if", "(", "parent", "instanceof", "ViewGroup", ")", "{", "(", "(", "ViewGroup", ")", "parent", ")", ".", "removeView", "(", "mCustomNavView", ")", ";", "}", "addView", "(", "mCustomNavView", ")", ";", "}", "}", "}", "private", "void", "initTitle", "(", ")", "{", "if", "(", "mTitleLayout", "==", "null", ")", "{", "LayoutInflater", "inflater", "=", "LayoutInflater", ".", "from", "(", "getContext", "(", ")", ")", ";", "mTitleLayout", "=", "(", "LinearLayout", ")", "inflater", ".", "inflate", "(", "R", ".", "layout", ".", "abs__action_bar_title_item", ",", "this", ",", "false", ")", ";", "mTitleView", "=", "(", "TextView", ")", "mTitleLayout", ".", "findViewById", "(", "R", ".", "id", ".", "abs__action_bar_title", ")", ";", "mSubtitleView", "=", "(", "TextView", ")", "mTitleLayout", ".", "findViewById", "(", "R", ".", "id", ".", "abs__action_bar_subtitle", ")", ";", "mTitleUpView", "=", "mTitleLayout", ".", "findViewById", "(", "R", ".", "id", ".", "abs__up", ")", ";", "mTitleLayout", ".", "setOnClickListener", "(", "mUpClickListener", ")", ";", "if", "(", "mTitleStyleRes", "!=", "0", ")", "{", "mTitleView", ".", "setTextAppearance", "(", "mContext", ",", "mTitleStyleRes", ")", ";", "}", "if", "(", "mTitle", "!=", "null", ")", "{", "mTitleView", ".", "setText", "(", "mTitle", ")", ";", "}", "if", "(", "mSubtitleStyleRes", "!=", "0", ")", "{", "mSubtitleView", ".", "setTextAppearance", "(", "mContext", ",", "mSubtitleStyleRes", ")", ";", "}", "if", "(", "mSubtitle", "!=", "null", ")", "{", "mSubtitleView", ".", "setText", "(", "mSubtitle", ")", ";", "mSubtitleView", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "final", "boolean", "homeAsUp", "=", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_HOME_AS_UP", ")", "!=", "0", ";", "final", "boolean", "showHome", "=", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_HOME", ")", "!=", "0", ";", "mTitleUpView", ".", "setVisibility", "(", "!", "showHome", "?", "(", "homeAsUp", "?", "VISIBLE", ":", "INVISIBLE", ")", ":", "GONE", ")", ";", "mTitleLayout", ".", "setEnabled", "(", "homeAsUp", "&&", "!", "showHome", ")", ";", "}", "addView", "(", "mTitleLayout", ")", ";", "if", "(", "mExpandedActionView", "!=", "null", "||", "(", "TextUtils", ".", "isEmpty", "(", "mTitle", ")", "&&", "TextUtils", ".", "isEmpty", "(", "mSubtitle", ")", ")", ")", "{", "mTitleLayout", ".", "setVisibility", "(", "GONE", ")", ";", "}", "}", "public", "void", "setContextView", "(", "ActionBarContextView", "view", ")", "{", "mContextView", "=", "view", ";", "}", "public", "void", "setCollapsable", "(", "boolean", "collapsable", ")", "{", "mIsCollapsable", "=", "collapsable", ";", "}", "public", "boolean", "isCollapsed", "(", ")", "{", "return", "mIsCollapsed", ";", "}", "@", "Override", "protected", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "final", "int", "childCount", "=", "getChildCount", "(", ")", ";", "if", "(", "mIsCollapsable", ")", "{", "int", "visibleChildren", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "childCount", ";", "i", "++", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "i", ")", ";", "if", "(", "child", ".", "getVisibility", "(", ")", "!=", "GONE", "&&", "!", "(", "child", "==", "mMenuView", "&&", "mMenuView", ".", "getChildCount", "(", ")", "==", "0", ")", ")", "{", "visibleChildren", "++", ";", "}", "}", "if", "(", "visibleChildren", "==", "0", ")", "{", "setMeasuredDimension", "(", "0", ",", "0", ")", ";", "mIsCollapsed", "=", "true", ";", "return", ";", "}", "}", "mIsCollapsed", "=", "false", ";", "int", "widthMode", "=", "MeasureSpec", ".", "getMode", "(", "widthMeasureSpec", ")", ";", "if", "(", "widthMode", "!=", "MeasureSpec", ".", "EXACTLY", ")", "{", "throw", "new", "IllegalStateException", "(", "getClass", "(", ")", ".", "getSimpleName", "(", ")", "+", "\"\"", "+", "\"\"", ")", ";", "}", "int", "heightMode", "=", "MeasureSpec", ".", "getMode", "(", "heightMeasureSpec", ")", ";", "if", "(", "heightMode", "!=", "MeasureSpec", ".", "AT_MOST", ")", "{", "throw", "new", "IllegalStateException", "(", "getClass", "(", ")", ".", "getSimpleName", "(", ")", "+", "\"\"", "+", "\"\"", ")", ";", "}", "int", "contentWidth", "=", "MeasureSpec", ".", "getSize", "(", "widthMeasureSpec", ")", ";", "int", "maxHeight", "=", "mContentHeight", ">", "0", "?", "mContentHeight", ":", "MeasureSpec", ".", "getSize", "(", "heightMeasureSpec", ")", ";", "final", "int", "verticalPadding", "=", "getPaddingTop", "(", ")", "+", "getPaddingBottom", "(", ")", ";", "final", "int", "paddingLeft", "=", "getPaddingLeft", "(", ")", ";", "final", "int", "paddingRight", "=", "getPaddingRight", "(", ")", ";", "final", "int", "height", "=", "maxHeight", "-", "verticalPadding", ";", "final", "int", "childSpecHeight", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "height", ",", "MeasureSpec", ".", "AT_MOST", ")", ";", "int", "availableWidth", "=", "contentWidth", "-", "paddingLeft", "-", "paddingRight", ";", "int", "leftOfCenter", "=", "availableWidth", "/", "2", ";", "int", "rightOfCenter", "=", "leftOfCenter", ";", "HomeView", "homeLayout", "=", "mExpandedActionView", "!=", "null", "?", "mExpandedHomeLayout", ":", "mHomeLayout", ";", "if", "(", "homeLayout", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "final", "ViewGroup", ".", "LayoutParams", "lp", "=", "homeLayout", ".", "getLayoutParams", "(", ")", ";", "int", "homeWidthSpec", ";", "if", "(", "lp", ".", "width", "<", "0", ")", "{", "homeWidthSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "availableWidth", ",", "MeasureSpec", ".", "AT_MOST", ")", ";", "}", "else", "{", "homeWidthSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "lp", ".", "width", ",", "MeasureSpec", ".", "EXACTLY", ")", ";", "}", "homeLayout", ".", "measure", "(", "homeWidthSpec", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "height", ",", "MeasureSpec", ".", "EXACTLY", ")", ")", ";", "final", "int", "homeWidth", "=", "homeLayout", ".", "getMeasuredWidth", "(", ")", "+", "homeLayout", ".", "getLeftOffset", "(", ")", ";", "availableWidth", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "homeWidth", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "homeWidth", ")", ";", "}", "if", "(", "mMenuView", "!=", "null", "&&", "mMenuView", ".", "getParent", "(", ")", "==", "this", ")", "{", "availableWidth", "=", "measureChildView", "(", "mMenuView", ",", "availableWidth", ",", "childSpecHeight", ",", "0", ")", ";", "rightOfCenter", "=", "Math", ".", "max", "(", "0", ",", "rightOfCenter", "-", "mMenuView", ".", "getMeasuredWidth", "(", ")", ")", ";", "}", "if", "(", "mIndeterminateProgressView", "!=", "null", "&&", "mIndeterminateProgressView", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "availableWidth", "=", "measureChildView", "(", "mIndeterminateProgressView", ",", "availableWidth", ",", "childSpecHeight", ",", "0", ")", ";", "rightOfCenter", "=", "Math", ".", "max", "(", "0", ",", "rightOfCenter", "-", "mIndeterminateProgressView", ".", "getMeasuredWidth", "(", ")", ")", ";", "}", "final", "boolean", "showTitle", "=", "mTitleLayout", "!=", "null", "&&", "mTitleLayout", ".", "getVisibility", "(", ")", "!=", "GONE", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ";", "if", "(", "mExpandedActionView", "==", "null", ")", "{", "switch", "(", "mNavigationMode", ")", "{", "case", "ActionBar", ".", "NAVIGATION_MODE_LIST", ":", "if", "(", "mListNavLayout", "!=", "null", ")", "{", "final", "int", "itemPaddingSize", "=", "showTitle", "?", "mItemPadding", "*", "2", ":", "mItemPadding", ";", "availableWidth", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "itemPaddingSize", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "leftOfCenter", "-", "itemPaddingSize", ")", ";", "mListNavLayout", ".", "measure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "availableWidth", ",", "MeasureSpec", ".", "AT_MOST", ")", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "height", ",", "MeasureSpec", ".", "EXACTLY", ")", ")", ";", "final", "int", "listNavWidth", "=", "mListNavLayout", ".", "getMeasuredWidth", "(", ")", ";", "availableWidth", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "listNavWidth", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "leftOfCenter", "-", "listNavWidth", ")", ";", "}", "break", ";", "case", "ActionBar", ".", "NAVIGATION_MODE_TABS", ":", "if", "(", "mTabScrollView", "!=", "null", ")", "{", "final", "int", "itemPaddingSize", "=", "showTitle", "?", "mItemPadding", "*", "2", ":", "mItemPadding", ";", "availableWidth", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "itemPaddingSize", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "leftOfCenter", "-", "itemPaddingSize", ")", ";", "mTabScrollView", ".", "measure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "availableWidth", ",", "MeasureSpec", ".", "AT_MOST", ")", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "height", ",", "MeasureSpec", ".", "EXACTLY", ")", ")", ";", "final", "int", "tabWidth", "=", "mTabScrollView", ".", "getMeasuredWidth", "(", ")", ";", "availableWidth", "=", "Math", ".", "max", "(", "0", ",", "availableWidth", "-", "tabWidth", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "leftOfCenter", "-", "tabWidth", ")", ";", "}", "break", ";", "}", "}", "View", "customView", "=", "null", ";", "if", "(", "mExpandedActionView", "!=", "null", ")", "{", "customView", "=", "mExpandedActionView", ";", "}", "else", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", "&&", "mCustomNavView", "!=", "null", ")", "{", "customView", "=", "mCustomNavView", ";", "}", "if", "(", "customView", "!=", "null", ")", "{", "final", "ViewGroup", ".", "LayoutParams", "lp", "=", "generateLayoutParams", "(", "customView", ".", "getLayoutParams", "(", ")", ")", ";", "final", "ActionBar", ".", "LayoutParams", "ablp", "=", "lp", "instanceof", "ActionBar", ".", "LayoutParams", "?", "(", "ActionBar", ".", "LayoutParams", ")", "lp", ":", "null", ";", "int", "horizontalMargin", "=", "0", ";", "int", "verticalMargin", "=", "0", ";", "if", "(", "ablp", "!=", "null", ")", "{", "horizontalMargin", "=", "ablp", ".", "leftMargin", "+", "ablp", ".", "rightMargin", ";", "verticalMargin", "=", "ablp", ".", "topMargin", "+", "ablp", ".", "bottomMargin", ";", "}", "int", "customNavHeightMode", ";", "if", "(", "mContentHeight", "<=", "0", ")", "{", "customNavHeightMode", "=", "MeasureSpec", ".", "AT_MOST", ";", "}", "else", "{", "customNavHeightMode", "=", "lp", ".", "height", "!=", "LayoutParams", ".", "WRAP_CONTENT", "?", "MeasureSpec", ".", "EXACTLY", ":", "MeasureSpec", ".", "AT_MOST", ";", "}", "final", "int", "customNavHeight", "=", "Math", ".", "max", "(", "0", ",", "(", "lp", ".", "height", ">=", "0", "?", "Math", ".", "min", "(", "lp", ".", "height", ",", "height", ")", ":", "height", ")", "-", "verticalMargin", ")", ";", "final", "int", "customNavWidthMode", "=", "lp", ".", "width", "!=", "LayoutParams", ".", "WRAP_CONTENT", "?", "MeasureSpec", ".", "EXACTLY", ":", "MeasureSpec", ".", "AT_MOST", ";", "int", "customNavWidth", "=", "Math", ".", "max", "(", "0", ",", "(", "lp", ".", "width", ">=", "0", "?", "Math", ".", "min", "(", "lp", ".", "width", ",", "availableWidth", ")", ":", "availableWidth", ")", "-", "horizontalMargin", ")", ";", "final", "int", "hgrav", "=", "(", "ablp", "!=", "null", "?", "ablp", ".", "gravity", ":", "DEFAULT_CUSTOM_GRAVITY", ")", "&", "Gravity", ".", "HORIZONTAL_GRAVITY_MASK", ";", "if", "(", "hgrav", "==", "Gravity", ".", "CENTER_HORIZONTAL", "&&", "lp", ".", "width", "==", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "customNavWidth", "=", "Math", ".", "min", "(", "leftOfCenter", ",", "rightOfCenter", ")", "*", "2", ";", "}", "customView", ".", "measure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "customNavWidth", ",", "customNavWidthMode", ")", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "customNavHeight", ",", "customNavHeightMode", ")", ")", ";", "availableWidth", "-=", "horizontalMargin", "+", "customView", ".", "getMeasuredWidth", "(", ")", ";", "}", "if", "(", "mExpandedActionView", "==", "null", "&&", "showTitle", ")", "{", "availableWidth", "=", "measureChildView", "(", "mTitleLayout", ",", "availableWidth", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "mContentHeight", ",", "MeasureSpec", ".", "EXACTLY", ")", ",", "0", ")", ";", "leftOfCenter", "=", "Math", ".", "max", "(", "0", ",", "leftOfCenter", "-", "mTitleLayout", ".", "getMeasuredWidth", "(", ")", ")", ";", "}", "if", "(", "mContentHeight", "<=", "0", ")", "{", "int", "measuredHeight", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "childCount", ";", "i", "++", ")", "{", "View", "v", "=", "getChildAt", "(", "i", ")", ";", "int", "paddedViewHeight", "=", "v", ".", "getMeasuredHeight", "(", ")", "+", "verticalPadding", ";", "if", "(", "paddedViewHeight", ">", "measuredHeight", ")", "{", "measuredHeight", "=", "paddedViewHeight", ";", "}", "}", "setMeasuredDimension", "(", "contentWidth", ",", "measuredHeight", ")", ";", "}", "else", "{", "setMeasuredDimension", "(", "contentWidth", ",", "maxHeight", ")", ";", "}", "if", "(", "mContextView", "!=", "null", ")", "{", "mContextView", ".", "setContentHeight", "(", "getMeasuredHeight", "(", ")", ")", ";", "}", "if", "(", "mProgressView", "!=", "null", "&&", "mProgressView", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "mProgressView", ".", "measure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "contentWidth", "-", "mProgressBarPadding", "*", "2", ",", "MeasureSpec", ".", "EXACTLY", ")", ",", "MeasureSpec", ".", "makeMeasureSpec", "(", "getMeasuredHeight", "(", ")", ",", "MeasureSpec", ".", "AT_MOST", ")", ")", ";", "}", "}", "@", "Override", "protected", "void", "onLayout", "(", "boolean", "changed", ",", "int", "l", ",", "int", "t", ",", "int", "r", ",", "int", "b", ")", "{", "int", "x", "=", "getPaddingLeft", "(", ")", ";", "final", "int", "y", "=", "getPaddingTop", "(", ")", ";", "final", "int", "contentHeight", "=", "b", "-", "t", "-", "getPaddingTop", "(", ")", "-", "getPaddingBottom", "(", ")", ";", "if", "(", "contentHeight", "<=", "0", ")", "{", "return", ";", "}", "HomeView", "homeLayout", "=", "mExpandedActionView", "!=", "null", "?", "mExpandedHomeLayout", ":", "mHomeLayout", ";", "if", "(", "homeLayout", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "final", "int", "leftOffset", "=", "homeLayout", ".", "getLeftOffset", "(", ")", ";", "x", "+=", "positionChild", "(", "homeLayout", ",", "x", "+", "leftOffset", ",", "y", ",", "contentHeight", ")", "+", "leftOffset", ";", "}", "if", "(", "mExpandedActionView", "==", "null", ")", "{", "final", "boolean", "showTitle", "=", "mTitleLayout", "!=", "null", "&&", "mTitleLayout", ".", "getVisibility", "(", ")", "!=", "GONE", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ";", "if", "(", "showTitle", ")", "{", "x", "+=", "positionChild", "(", "mTitleLayout", ",", "x", ",", "y", ",", "contentHeight", ")", ";", "}", "switch", "(", "mNavigationMode", ")", "{", "case", "ActionBar", ".", "NAVIGATION_MODE_STANDARD", ":", "break", ";", "case", "ActionBar", ".", "NAVIGATION_MODE_LIST", ":", "if", "(", "mListNavLayout", "!=", "null", ")", "{", "if", "(", "showTitle", ")", "x", "+=", "mItemPadding", ";", "x", "+=", "positionChild", "(", "mListNavLayout", ",", "x", ",", "y", ",", "contentHeight", ")", "+", "mItemPadding", ";", "}", "break", ";", "case", "ActionBar", ".", "NAVIGATION_MODE_TABS", ":", "if", "(", "mTabScrollView", "!=", "null", ")", "{", "if", "(", "showTitle", ")", "x", "+=", "mItemPadding", ";", "x", "+=", "positionChild", "(", "mTabScrollView", ",", "x", ",", "y", ",", "contentHeight", ")", "+", "mItemPadding", ";", "}", "break", ";", "}", "}", "int", "menuLeft", "=", "r", "-", "l", "-", "getPaddingRight", "(", ")", ";", "if", "(", "mMenuView", "!=", "null", "&&", "mMenuView", ".", "getParent", "(", ")", "==", "this", ")", "{", "positionChildInverse", "(", "mMenuView", ",", "menuLeft", ",", "y", ",", "contentHeight", ")", ";", "menuLeft", "-=", "mMenuView", ".", "getMeasuredWidth", "(", ")", ";", "}", "if", "(", "mIndeterminateProgressView", "!=", "null", "&&", "mIndeterminateProgressView", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "positionChildInverse", "(", "mIndeterminateProgressView", ",", "menuLeft", ",", "y", ",", "contentHeight", ")", ";", "menuLeft", "-=", "mIndeterminateProgressView", ".", "getMeasuredWidth", "(", ")", ";", "}", "View", "customView", "=", "null", ";", "if", "(", "mExpandedActionView", "!=", "null", ")", "{", "customView", "=", "mExpandedActionView", ";", "}", "else", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", "&&", "mCustomNavView", "!=", "null", ")", "{", "customView", "=", "mCustomNavView", ";", "}", "if", "(", "customView", "!=", "null", ")", "{", "ViewGroup", ".", "LayoutParams", "lp", "=", "customView", ".", "getLayoutParams", "(", ")", ";", "final", "ActionBar", ".", "LayoutParams", "ablp", "=", "lp", "instanceof", "ActionBar", ".", "LayoutParams", "?", "(", "ActionBar", ".", "LayoutParams", ")", "lp", ":", "null", ";", "final", "int", "gravity", "=", "ablp", "!=", "null", "?", "ablp", ".", "gravity", ":", "DEFAULT_CUSTOM_GRAVITY", ";", "final", "int", "navWidth", "=", "customView", ".", "getMeasuredWidth", "(", ")", ";", "int", "topMargin", "=", "0", ";", "int", "bottomMargin", "=", "0", ";", "if", "(", "ablp", "!=", "null", ")", "{", "x", "+=", "ablp", ".", "leftMargin", ";", "menuLeft", "-=", "ablp", ".", "rightMargin", ";", "topMargin", "=", "ablp", ".", "topMargin", ";", "bottomMargin", "=", "ablp", ".", "bottomMargin", ";", "}", "int", "hgravity", "=", "gravity", "&", "Gravity", ".", "HORIZONTAL_GRAVITY_MASK", ";", "if", "(", "hgravity", "==", "Gravity", ".", "CENTER_HORIZONTAL", ")", "{", "final", "int", "centeredLeft", "=", "(", "(", "getRight", "(", ")", "-", "getLeft", "(", ")", ")", "-", "navWidth", ")", "/", "2", ";", "if", "(", "centeredLeft", "<", "x", ")", "{", "hgravity", "=", "Gravity", ".", "LEFT", ";", "}", "else", "if", "(", "centeredLeft", "+", "navWidth", ">", "menuLeft", ")", "{", "hgravity", "=", "Gravity", ".", "RIGHT", ";", "}", "}", "else", "if", "(", "gravity", "==", "-", "1", ")", "{", "hgravity", "=", "Gravity", ".", "LEFT", ";", "}", "int", "xpos", "=", "0", ";", "switch", "(", "hgravity", ")", "{", "case", "Gravity", ".", "CENTER_HORIZONTAL", ":", "xpos", "=", "(", "(", "getRight", "(", ")", "-", "getLeft", "(", ")", ")", "-", "navWidth", ")", "/", "2", ";", "break", ";", "case", "Gravity", ".", "LEFT", ":", "xpos", "=", "x", ";", "break", ";", "case", "Gravity", ".", "RIGHT", ":", "xpos", "=", "menuLeft", "-", "navWidth", ";", "break", ";", "}", "int", "vgravity", "=", "gravity", "&", "Gravity", ".", "VERTICAL_GRAVITY_MASK", ";", "if", "(", "gravity", "==", "-", "1", ")", "{", "vgravity", "=", "Gravity", ".", "CENTER_VERTICAL", ";", "}", "int", "ypos", "=", "0", ";", "switch", "(", "vgravity", ")", "{", "case", "Gravity", ".", "CENTER_VERTICAL", ":", "final", "int", "paddedTop", "=", "getPaddingTop", "(", ")", ";", "final", "int", "paddedBottom", "=", "getBottom", "(", ")", "-", "getTop", "(", ")", "-", "getPaddingBottom", "(", ")", ";", "ypos", "=", "(", "(", "paddedBottom", "-", "paddedTop", ")", "-", "customView", ".", "getMeasuredHeight", "(", ")", ")", "/", "2", ";", "break", ";", "case", "Gravity", ".", "TOP", ":", "ypos", "=", "getPaddingTop", "(", ")", "+", "topMargin", ";", "break", ";", "case", "Gravity", ".", "BOTTOM", ":", "ypos", "=", "getHeight", "(", ")", "-", "getPaddingBottom", "(", ")", "-", "customView", ".", "getMeasuredHeight", "(", ")", "-", "bottomMargin", ";", "break", ";", "}", "final", "int", "customWidth", "=", "customView", ".", "getMeasuredWidth", "(", ")", ";", "customView", ".", "layout", "(", "xpos", ",", "ypos", ",", "xpos", "+", "customWidth", ",", "ypos", "+", "customView", ".", "getMeasuredHeight", "(", ")", ")", ";", "x", "+=", "customWidth", ";", "}", "if", "(", "mProgressView", "!=", "null", ")", "{", "mProgressView", ".", "bringToFront", "(", ")", ";", "final", "int", "halfProgressHeight", "=", "mProgressView", ".", "getMeasuredHeight", "(", ")", "/", "2", ";", "mProgressView", ".", "layout", "(", "mProgressBarPadding", ",", "-", "halfProgressHeight", ",", "mProgressBarPadding", "+", "mProgressView", ".", "getMeasuredWidth", "(", ")", ",", "halfProgressHeight", ")", ";", "}", "}", "@", "Override", "public", "ViewGroup", ".", "LayoutParams", "generateLayoutParams", "(", "AttributeSet", "attrs", ")", "{", "return", "new", "ActionBar", ".", "LayoutParams", "(", "getContext", "(", ")", ",", "attrs", ")", ";", "}", "@", "Override", "public", "ViewGroup", ".", "LayoutParams", "generateLayoutParams", "(", "ViewGroup", ".", "LayoutParams", "lp", ")", "{", "if", "(", "lp", "==", "null", ")", "{", "lp", "=", "generateDefaultLayoutParams", "(", ")", ";", "}", "return", "lp", ";", "}", "@", "Override", "public", "Parcelable", "onSaveInstanceState", "(", ")", "{", "Parcelable", "superState", "=", "super", ".", "onSaveInstanceState", "(", ")", ";", "SavedState", "state", "=", "new", "SavedState", "(", "superState", ")", ";", "if", "(", "mExpandedMenuPresenter", "!=", "null", "&&", "mExpandedMenuPresenter", ".", "mCurrentExpandedItem", "!=", "null", ")", "{", "state", ".", "expandedMenuItemId", "=", "mExpandedMenuPresenter", ".", "mCurrentExpandedItem", ".", "getItemId", "(", ")", ";", "}", "state", ".", "isOverflowOpen", "=", "isOverflowMenuShowing", "(", ")", ";", "return", "state", ";", "}", "@", "Override", "public", "void", "onRestoreInstanceState", "(", "Parcelable", "p", ")", "{", "SavedState", "state", "=", "(", "SavedState", ")", "p", ";", "super", ".", "onRestoreInstanceState", "(", "state", ".", "getSuperState", "(", ")", ")", ";", "if", "(", "state", ".", "expandedMenuItemId", "!=", "0", "&&", "mExpandedMenuPresenter", "!=", "null", "&&", "mOptionsMenu", "!=", "null", ")", "{", "final", "MenuItem", "item", "=", "mOptionsMenu", ".", "findItem", "(", "state", ".", "expandedMenuItemId", ")", ";", "if", "(", "item", "!=", "null", ")", "{", "item", ".", "expandActionView", "(", ")", ";", "}", "}", "if", "(", "state", ".", "isOverflowOpen", ")", "{", "postShowOverflowMenu", "(", ")", ";", "}", "}", "static", "class", "SavedState", "extends", "BaseSavedState", "{", "int", "expandedMenuItemId", ";", "boolean", "isOverflowOpen", ";", "SavedState", "(", "Parcelable", "superState", ")", "{", "super", "(", "superState", ")", ";", "}", "private", "SavedState", "(", "Parcel", "in", ")", "{", "super", "(", "in", ")", ";", "expandedMenuItemId", "=", "in", ".", "readInt", "(", ")", ";", "isOverflowOpen", "=", "in", ".", "readInt", "(", ")", "!=", "0", ";", "}", "@", "Override", "public", "void", "writeToParcel", "(", "Parcel", "out", ",", "int", "flags", ")", "{", "super", ".", "writeToParcel", "(", "out", ",", "flags", ")", ";", "out", ".", "writeInt", "(", "expandedMenuItemId", ")", ";", "out", ".", "writeInt", "(", "isOverflowOpen", "?", "1", ":", "0", ")", ";", "}", "public", "static", "final", "Parcelable", ".", "Creator", "<", "SavedState", ">", "CREATOR", "=", "new", "Parcelable", ".", "Creator", "<", "SavedState", ">", "(", ")", "{", "public", "SavedState", "createFromParcel", "(", "Parcel", "in", ")", "{", "return", "new", "SavedState", "(", "in", ")", ";", "}", "public", "SavedState", "[", "]", "newArray", "(", "int", "size", ")", "{", "return", "new", "SavedState", "[", "size", "]", ";", "}", "}", ";", "}", "public", "static", "class", "HomeView", "extends", "FrameLayout", "{", "private", "View", "mUpView", ";", "private", "ImageView", "mIconView", ";", "private", "int", "mUpWidth", ";", "public", "HomeView", "(", "Context", "context", ")", "{", "this", "(", "context", ",", "null", ")", ";", "}", "public", "HomeView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "}", "public", "void", "setUp", "(", "boolean", "isUp", ")", "{", "mUpView", ".", "setVisibility", "(", "isUp", "?", "VISIBLE", ":", "GONE", ")", ";", "}", "public", "void", "setIcon", "(", "Drawable", "icon", ")", "{", "mIconView", ".", "setImageDrawable", "(", "icon", ")", ";", "}", "@", "Override", "public", "boolean", "dispatchPopulateAccessibilityEvent", "(", "AccessibilityEvent", "event", ")", "{", "onPopulateAccessibilityEvent", "(", "event", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "void", "onPopulateAccessibilityEvent", "(", "AccessibilityEvent", "event", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "ICE_CREAM_SANDWICH", ")", "{", "super", ".", "onPopulateAccessibilityEvent", "(", "event", ")", ";", "}", "final", "CharSequence", "cdesc", "=", "getContentDescription", "(", ")", ";", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "cdesc", ")", ")", "{", "event", ".", "getText", "(", ")", ".", "add", "(", "cdesc", ")", ";", "}", "}", "@", "Override", "public", "boolean", "dispatchHoverEvent", "(", "MotionEvent", "event", ")", "{", "return", "onHoverEvent", "(", "event", ")", ";", "}", "@", "Override", "protected", "void", "onFinishInflate", "(", ")", "{", "mUpView", "=", "findViewById", "(", "R", ".", "id", ".", "abs__up", ")", ";", "mIconView", "=", "(", "ImageView", ")", "findViewById", "(", "R", ".", "id", ".", "abs__home", ")", ";", "}", "public", "int", "getLeftOffset", "(", ")", "{", "return", "mUpView", ".", "getVisibility", "(", ")", "==", "GONE", "?", "mUpWidth", ":", "0", ";", "}", "@", "Override", "protected", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "measureChildWithMargins", "(", "mUpView", ",", "widthMeasureSpec", ",", "0", ",", "heightMeasureSpec", ",", "0", ")", ";", "final", "LayoutParams", "upLp", "=", "(", "LayoutParams", ")", "mUpView", ".", "getLayoutParams", "(", ")", ";", "mUpWidth", "=", "upLp", ".", "leftMargin", "+", "mUpView", ".", "getMeasuredWidth", "(", ")", "+", "upLp", ".", "rightMargin", ";", "int", "width", "=", "mUpView", ".", "getVisibility", "(", ")", "==", "GONE", "?", "0", ":", "mUpWidth", ";", "int", "height", "=", "upLp", ".", "topMargin", "+", "mUpView", ".", "getMeasuredHeight", "(", ")", "+", "upLp", ".", "bottomMargin", ";", "measureChildWithMargins", "(", "mIconView", ",", "widthMeasureSpec", ",", "width", ",", "heightMeasureSpec", ",", "0", ")", ";", "final", "LayoutParams", "iconLp", "=", "(", "LayoutParams", ")", "mIconView", ".", "getLayoutParams", "(", ")", ";", "width", "+=", "iconLp", ".", "leftMargin", "+", "mIconView", ".", "getMeasuredWidth", "(", ")", "+", "iconLp", ".", "rightMargin", ";", "height", "=", "Math", ".", "max", "(", "height", ",", "iconLp", ".", "topMargin", "+", "mIconView", ".", "getMeasuredHeight", "(", ")", "+", "iconLp", ".", "bottomMargin", ")", ";", "final", "int", "widthMode", "=", "MeasureSpec", ".", "getMode", "(", "widthMeasureSpec", ")", ";", "final", "int", "heightMode", "=", "MeasureSpec", ".", "getMode", "(", "heightMeasureSpec", ")", ";", "final", "int", "widthSize", "=", "MeasureSpec", ".", "getSize", "(", "widthMeasureSpec", ")", ";", "final", "int", "heightSize", "=", "MeasureSpec", ".", "getSize", "(", "heightMeasureSpec", ")", ";", "switch", "(", "widthMode", ")", "{", "case", "MeasureSpec", ".", "AT_MOST", ":", "width", "=", "Math", ".", "min", "(", "width", ",", "widthSize", ")", ";", "break", ";", "case", "MeasureSpec", ".", "EXACTLY", ":", "width", "=", "widthSize", ";", "break", ";", "case", "MeasureSpec", ".", "UNSPECIFIED", ":", "default", ":", "break", ";", "}", "switch", "(", "heightMode", ")", "{", "case", "MeasureSpec", ".", "AT_MOST", ":", "height", "=", "Math", ".", "min", "(", "height", ",", "heightSize", ")", ";", "break", ";", "case", "MeasureSpec", ".", "EXACTLY", ":", "height", "=", "heightSize", ";", "break", ";", "case", "MeasureSpec", ".", "UNSPECIFIED", ":", "default", ":", "break", ";", "}", "setMeasuredDimension", "(", "width", ",", "height", ")", ";", "}", "@", "Override", "protected", "void", "onLayout", "(", "boolean", "changed", ",", "int", "l", ",", "int", "t", ",", "int", "r", ",", "int", "b", ")", "{", "final", "int", "vCenter", "=", "(", "b", "-", "t", ")", "/", "2", ";", "int", "upOffset", "=", "0", ";", "if", "(", "mUpView", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "final", "LayoutParams", "upLp", "=", "(", "LayoutParams", ")", "mUpView", ".", "getLayoutParams", "(", ")", ";", "final", "int", "upHeight", "=", "mUpView", ".", "getMeasuredHeight", "(", ")", ";", "final", "int", "upWidth", "=", "mUpView", ".", "getMeasuredWidth", "(", ")", ";", "final", "int", "upTop", "=", "vCenter", "-", "upHeight", "/", "2", ";", "mUpView", ".", "layout", "(", "0", ",", "upTop", ",", "upWidth", ",", "upTop", "+", "upHeight", ")", ";", "upOffset", "=", "upLp", ".", "leftMargin", "+", "upWidth", "+", "upLp", ".", "rightMargin", ";", "l", "+=", "upOffset", ";", "}", "final", "LayoutParams", "iconLp", "=", "(", "LayoutParams", ")", "mIconView", ".", "getLayoutParams", "(", ")", ";", "final", "int", "iconHeight", "=", "mIconView", ".", "getMeasuredHeight", "(", ")", ";", "final", "int", "iconWidth", "=", "mIconView", ".", "getMeasuredWidth", "(", ")", ";", "final", "int", "hCenter", "=", "(", "r", "-", "l", ")", "/", "2", ";", "final", "int", "iconLeft", "=", "upOffset", "+", "Math", ".", "max", "(", "iconLp", ".", "leftMargin", ",", "hCenter", "-", "iconWidth", "/", "2", ")", ";", "final", "int", "iconTop", "=", "Math", ".", "max", "(", "iconLp", ".", "topMargin", ",", "vCenter", "-", "iconHeight", "/", "2", ")", ";", "mIconView", ".", "layout", "(", "iconLeft", ",", "iconTop", ",", "iconLeft", "+", "iconWidth", ",", "iconTop", "+", "iconHeight", ")", ";", "}", "}", "private", "class", "ExpandedActionViewMenuPresenter", "implements", "MenuPresenter", "{", "MenuBuilder", "mMenu", ";", "MenuItemImpl", "mCurrentExpandedItem", ";", "@", "Override", "public", "void", "initForMenu", "(", "Context", "context", ",", "MenuBuilder", "menu", ")", "{", "if", "(", "mMenu", "!=", "null", "&&", "mCurrentExpandedItem", "!=", "null", ")", "{", "mMenu", ".", "collapseItemActionView", "(", "mCurrentExpandedItem", ")", ";", "}", "mMenu", "=", "menu", ";", "}", "@", "Override", "public", "MenuView", "getMenuView", "(", "ViewGroup", "root", ")", "{", "return", "null", ";", "}", "@", "Override", "public", "void", "updateMenuView", "(", "boolean", "cleared", ")", "{", "if", "(", "mCurrentExpandedItem", "!=", "null", ")", "{", "boolean", "found", "=", "false", ";", "if", "(", "mMenu", "!=", "null", ")", "{", "final", "int", "count", "=", "mMenu", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "final", "MenuItem", "item", "=", "mMenu", ".", "getItem", "(", "i", ")", ";", "if", "(", "item", "==", "mCurrentExpandedItem", ")", "{", "found", "=", "true", ";", "break", ";", "}", "}", "}", "if", "(", "!", "found", ")", "{", "collapseItemActionView", "(", "mMenu", ",", "mCurrentExpandedItem", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "setCallback", "(", "Callback", "cb", ")", "{", "}", "@", "Override", "public", "boolean", "onSubMenuSelected", "(", "SubMenuBuilder", "subMenu", ")", "{", "return", "false", ";", "}", "@", "Override", "public", "void", "onCloseMenu", "(", "MenuBuilder", "menu", ",", "boolean", "allMenusAreClosing", ")", "{", "}", "@", "Override", "public", "boolean", "flagActionItems", "(", ")", "{", "return", "false", ";", "}", "@", "Override", "public", "boolean", "expandItemActionView", "(", "MenuBuilder", "menu", ",", "MenuItemImpl", "item", ")", "{", "mExpandedActionView", "=", "item", ".", "getActionView", "(", ")", ";", "mExpandedHomeLayout", ".", "setIcon", "(", "mIcon", ".", "getConstantState", "(", ")", ".", "newDrawable", "(", ")", ")", ";", "mCurrentExpandedItem", "=", "item", ";", "if", "(", "mExpandedActionView", ".", "getParent", "(", ")", "!=", "ActionBarView", ".", "this", ")", "{", "addView", "(", "mExpandedActionView", ")", ";", "}", "if", "(", "mExpandedHomeLayout", ".", "getParent", "(", ")", "!=", "ActionBarView", ".", "this", ")", "{", "addView", "(", "mExpandedHomeLayout", ")", ";", "}", "mHomeLayout", ".", "setVisibility", "(", "GONE", ")", ";", "if", "(", "mTitleLayout", "!=", "null", ")", "mTitleLayout", ".", "setVisibility", "(", "GONE", ")", ";", "if", "(", "mTabScrollView", "!=", "null", ")", "mTabScrollView", ".", "setVisibility", "(", "GONE", ")", ";", "if", "(", "mSpinner", "!=", "null", ")", "mSpinner", ".", "setVisibility", "(", "GONE", ")", ";", "if", "(", "mCustomNavView", "!=", "null", ")", "mCustomNavView", ".", "setVisibility", "(", "GONE", ")", ";", "requestLayout", "(", ")", ";", "item", ".", "setActionViewExpanded", "(", "true", ")", ";", "if", "(", "mExpandedActionView", "instanceof", "CollapsibleActionView", ")", "{", "(", "(", "CollapsibleActionView", ")", "mExpandedActionView", ")", ".", "onActionViewExpanded", "(", ")", ";", "}", "return", "true", ";", "}", "@", "Override", "public", "boolean", "collapseItemActionView", "(", "MenuBuilder", "menu", ",", "MenuItemImpl", "item", ")", "{", "if", "(", "mExpandedActionView", "instanceof", "CollapsibleActionView", ")", "{", "(", "(", "CollapsibleActionView", ")", "mExpandedActionView", ")", ".", "onActionViewCollapsed", "(", ")", ";", "}", "removeView", "(", "mExpandedActionView", ")", ";", "removeView", "(", "mExpandedHomeLayout", ")", ";", "mExpandedActionView", "=", "null", ";", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_HOME", ")", "!=", "0", ")", "{", "mHomeLayout", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "if", "(", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_TITLE", ")", "!=", "0", ")", "{", "if", "(", "mTitleLayout", "==", "null", ")", "{", "initTitle", "(", ")", ";", "}", "else", "{", "mTitleLayout", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "}", "if", "(", "mTabScrollView", "!=", "null", "&&", "mNavigationMode", "==", "ActionBar", ".", "NAVIGATION_MODE_TABS", ")", "{", "mTabScrollView", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "if", "(", "mSpinner", "!=", "null", "&&", "mNavigationMode", "==", "ActionBar", ".", "NAVIGATION_MODE_LIST", ")", "{", "mSpinner", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "if", "(", "mCustomNavView", "!=", "null", "&&", "(", "mDisplayOptions", "&", "ActionBar", ".", "DISPLAY_SHOW_CUSTOM", ")", "!=", "0", ")", "{", "mCustomNavView", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "mExpandedHomeLayout", ".", "setIcon", "(", "null", ")", ";", "mCurrentExpandedItem", "=", "null", ";", "requestLayout", "(", ")", ";", "item", ".", "setActionViewExpanded", "(", "false", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "int", "getId", "(", ")", "{", "return", "0", ";", "}", "@", "Override", "public", "Parcelable", "onSaveInstanceState", "(", ")", "{", "return", "null", ";", "}", "@", "Override", "public", "void", "onRestoreInstanceState", "(", "Parcelable", "state", ")", "{", "}", "}", "}", "</s>" ]
8,992
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "View", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "widget", ".", "NineLinearLayout", ";", "public", "class", "IcsLinearLayout", "extends", "NineLinearLayout", "{", "private", "static", "final", "int", "[", "]", "LinearLayout", "=", "new", "int", "[", "]", "{", "android", ".", "R", ".", "attr", ".", "divider", ",", "android", ".", "R", ".", "attr", ".", "showDividers", ",", "android", ".", "R", ".", "attr", ".", "dividerPadding", ",", "}", ";", "private", "static", "final", "int", "LinearLayout_divider", "=", "0", ";", "private", "static", "final", "int", "LinearLayout_showDividers", "=", "1", ";", "private", "static", "final", "int", "LinearLayout_dividerPadding", "=", "2", ";", "public", "static", "final", "int", "SHOW_DIVIDER_NONE", "=", "0", ";", "public", "static", "final", "int", "SHOW_DIVIDER_BEGINNING", "=", "1", ";", "public", "static", "final", "int", "SHOW_DIVIDER_MIDDLE", "=", "2", ";", "public", "static", "final", "int", "SHOW_DIVIDER_END", "=", "4", ";", "private", "Drawable", "mDivider", ";", "private", "int", "mDividerWidth", ";", "private", "int", "mDividerHeight", ";", "private", "int", "mShowDividers", ";", "private", "int", "mDividerPadding", ";", "public", "IcsLinearLayout", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", "(", "attrs", ",", "LinearLayout", ")", ";", "setDividerDrawable", "(", "a", ".", "getDrawable", "(", "LinearLayout_divider", ")", ")", ";", "mShowDividers", "=", "a", ".", "getInt", "(", "LinearLayout_showDividers", ",", "SHOW_DIVIDER_NONE", ")", ";", "mDividerPadding", "=", "a", ".", "getDimensionPixelSize", "(", "LinearLayout_dividerPadding", ",", "0", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "void", "setShowDividers", "(", "int", "showDividers", ")", "{", "if", "(", "showDividers", "!=", "mShowDividers", ")", "{", "requestLayout", "(", ")", ";", "invalidate", "(", ")", ";", "}", "mShowDividers", "=", "showDividers", ";", "}", "public", "int", "getShowDividers", "(", ")", "{", "return", "mShowDividers", ";", "}", "public", "void", "setDividerDrawable", "(", "Drawable", "divider", ")", "{", "if", "(", "divider", "==", "mDivider", ")", "{", "return", ";", "}", "mDivider", "=", "divider", ";", "if", "(", "divider", "!=", "null", ")", "{", "mDividerWidth", "=", "divider", ".", "getIntrinsicWidth", "(", ")", ";", "mDividerHeight", "=", "divider", ".", "getIntrinsicHeight", "(", ")", ";", "}", "else", "{", "mDividerWidth", "=", "0", ";", "mDividerHeight", "=", "0", ";", "}", "setWillNotDraw", "(", "divider", "==", "null", ")", ";", "requestLayout", "(", ")", ";", "}", "public", "void", "setDividerPadding", "(", "int", "padding", ")", "{", "mDividerPadding", "=", "padding", ";", "}", "public", "int", "getDividerPadding", "(", ")", "{", "return", "mDividerPadding", ";", "}", "public", "int", "getDividerWidth", "(", ")", "{", "return", "mDividerWidth", ";", "}", "@", "Override", "protected", "void", "measureChildWithMargins", "(", "View", "child", ",", "int", "parentWidthMeasureSpec", ",", "int", "widthUsed", ",", "int", "parentHeightMeasureSpec", ",", "int", "heightUsed", ")", "{", "final", "int", "index", "=", "indexOfChild", "(", "child", ")", ";", "final", "int", "orientation", "=", "getOrientation", "(", ")", ";", "final", "LayoutParams", "params", "=", "(", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "if", "(", "hasDividerBeforeChildAt", "(", "index", ")", ")", "{", "if", "(", "orientation", "==", "VERTICAL", ")", "{", "params", ".", "topMargin", "=", "mDividerHeight", ";", "}", "else", "{", "params", ".", "leftMargin", "=", "mDividerWidth", ";", "}", "}", "final", "int", "count", "=", "getChildCount", "(", ")", ";", "if", "(", "index", "==", "count", "-", "1", ")", "{", "if", "(", "hasDividerBeforeChildAt", "(", "count", ")", ")", "{", "if", "(", "orientation", "==", "VERTICAL", ")", "{", "params", ".", "bottomMargin", "=", "mDividerHeight", ";", "}", "else", "{", "params", ".", "rightMargin", "=", "mDividerWidth", ";", "}", "}", "}", "super", ".", "measureChildWithMargins", "(", "child", ",", "parentWidthMeasureSpec", ",", "widthUsed", ",", "parentHeightMeasureSpec", ",", "heightUsed", ")", ";", "}", "@", "Override", "protected", "void", "onDraw", "(", "Canvas", "canvas", ")", "{", "if", "(", "mDivider", "!=", "null", ")", "{", "if", "(", "getOrientation", "(", ")", "==", "VERTICAL", ")", "{", "drawDividersVertical", "(", "canvas", ")", ";", "}", "else", "{", "drawDividersHorizontal", "(", "canvas", ")", ";", "}", "}", "super", ".", "onDraw", "(", "canvas", ")", ";", "}", "void", "drawDividersVertical", "(", "Canvas", "canvas", ")", "{", "final", "int", "count", "=", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "i", ")", ";", "if", "(", "child", "!=", "null", "&&", "child", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "if", "(", "hasDividerBeforeChildAt", "(", "i", ")", ")", "{", "final", "LayoutParams", "lp", "=", "(", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "final", "int", "top", "=", "child", ".", "getTop", "(", ")", "-", "lp", ".", "topMargin", ";", "drawHorizontalDivider", "(", "canvas", ",", "top", ")", ";", "}", "}", "}", "if", "(", "hasDividerBeforeChildAt", "(", "count", ")", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "count", "-", "1", ")", ";", "int", "bottom", "=", "0", ";", "if", "(", "child", "==", "null", ")", "{", "bottom", "=", "getHeight", "(", ")", "-", "getPaddingBottom", "(", ")", "-", "mDividerHeight", ";", "}", "else", "{", "final", "LayoutParams", "lp", "=", "(", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "bottom", "=", "child", ".", "getBottom", "(", ")", ";", "}", "drawHorizontalDivider", "(", "canvas", ",", "bottom", ")", ";", "}", "}", "void", "drawDividersHorizontal", "(", "Canvas", "canvas", ")", "{", "final", "int", "count", "=", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "i", ")", ";", "if", "(", "child", "!=", "null", "&&", "child", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "if", "(", "hasDividerBeforeChildAt", "(", "i", ")", ")", "{", "final", "LayoutParams", "lp", "=", "(", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "final", "int", "left", "=", "child", ".", "getLeft", "(", ")", "-", "lp", ".", "leftMargin", ";", "drawVerticalDivider", "(", "canvas", ",", "left", ")", ";", "}", "}", "}", "if", "(", "hasDividerBeforeChildAt", "(", "count", ")", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "count", "-", "1", ")", ";", "int", "right", "=", "0", ";", "if", "(", "child", "==", "null", ")", "{", "right", "=", "getWidth", "(", ")", "-", "getPaddingRight", "(", ")", "-", "mDividerWidth", ";", "}", "else", "{", "final", "LayoutParams", "lp", "=", "(", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "right", "=", "child", ".", "getRight", "(", ")", ";", "}", "drawVerticalDivider", "(", "canvas", ",", "right", ")", ";", "}", "}", "void", "drawHorizontalDivider", "(", "Canvas", "canvas", ",", "int", "top", ")", "{", "mDivider", ".", "setBounds", "(", "getPaddingLeft", "(", ")", "+", "mDividerPadding", ",", "top", ",", "getWidth", "(", ")", "-", "getPaddingRight", "(", ")", "-", "mDividerPadding", ",", "top", "+", "mDividerHeight", ")", ";", "mDivider", ".", "draw", "(", "canvas", ")", ";", "}", "void", "drawVerticalDivider", "(", "Canvas", "canvas", ",", "int", "left", ")", "{", "mDivider", ".", "setBounds", "(", "left", ",", "getPaddingTop", "(", ")", "+", "mDividerPadding", ",", "left", "+", "mDividerWidth", ",", "getHeight", "(", ")", "-", "getPaddingBottom", "(", ")", "-", "mDividerPadding", ")", ";", "mDivider", ".", "draw", "(", "canvas", ")", ";", "}", "protected", "boolean", "hasDividerBeforeChildAt", "(", "int", "childIndex", ")", "{", "if", "(", "childIndex", "==", "0", ")", "{", "return", "(", "mShowDividers", "&", "SHOW_DIVIDER_BEGINNING", ")", "!=", "0", ";", "}", "else", "if", "(", "childIndex", "==", "getChildCount", "(", ")", ")", "{", "return", "(", "mShowDividers", "&", "SHOW_DIVIDER_END", ")", "!=", "0", ";", "}", "else", "if", "(", "(", "mShowDividers", "&", "SHOW_DIVIDER_MIDDLE", ")", "!=", "0", ")", "{", "boolean", "hasVisibleViewBefore", "=", "false", ";", "for", "(", "int", "i", "=", "childIndex", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "getChildAt", "(", "i", ")", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "hasVisibleViewBefore", "=", "true", ";", "break", ";", "}", "}", "return", "hasVisibleViewBefore", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
8,993
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "widget", ".", "TextView", ";", "public", "class", "CapitalizingTextView", "extends", "TextView", "{", "private", "static", "final", "boolean", "SANS_ICE_CREAM", "=", "Build", ".", "VERSION", ".", "SDK_INT", "<", "Build", ".", "VERSION_CODES", ".", "ICE_CREAM_SANDWICH", ";", "private", "static", "final", "boolean", "IS_GINGERBREAD", "=", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "GINGERBREAD", ";", "private", "static", "final", "int", "[", "]", "R_styleable_TextView", "=", "new", "int", "[", "]", "{", "android", ".", "R", ".", "attr", ".", "textAllCaps", "}", ";", "private", "static", "final", "int", "R_styleable_TextView_textAllCaps", "=", "0", ";", "private", "boolean", "mAllCaps", ";", "public", "CapitalizingTextView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "this", "(", "context", ",", "attrs", ",", "0", ")", ";", "}", "public", "CapitalizingTextView", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyle", ")", "{", "super", "(", "context", ",", "attrs", ",", "defStyle", ")", ";", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", "(", "attrs", ",", "R_styleable_TextView", ",", "defStyle", ",", "0", ")", ";", "mAllCaps", "=", "a", ".", "getBoolean", "(", "R_styleable_TextView_textAllCaps", ",", "true", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "void", "setTextCompat", "(", "CharSequence", "text", ")", "{", "if", "(", "SANS_ICE_CREAM", "&&", "mAllCaps", "&&", "text", "!=", "null", ")", "{", "if", "(", "IS_GINGERBREAD", ")", "{", "setText", "(", "text", ".", "toString", "(", ")", ".", "toUpperCase", "(", "Locale", ".", "ROOT", ")", ")", ";", "}", "else", "{", "setText", "(", "text", ".", "toString", "(", ")", ".", "toUpperCase", "(", ")", ")", ";", "}", "}", "else", "{", "setText", "(", "text", ")", ";", "}", "}", "}", "</s>" ]
8,994
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Bitmap", ";", "import", "android", ".", "graphics", ".", "BitmapShader", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "Rect", ";", "import", "android", ".", "graphics", ".", "Shader", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Animatable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "AnimationDrawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "BitmapDrawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "ClipDrawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "LayerDrawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "ShapeDrawable", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "shapes", ".", "RoundRectShape", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "shapes", ".", "Shape", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "os", ".", "Parcel", ";", "import", "android", ".", "os", ".", "Parcelable", ";", "import", "android", ".", "os", ".", "SystemClock", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "Gravity", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewDebug", ";", "import", "android", ".", "view", ".", "accessibility", ".", "AccessibilityEvent", ";", "import", "android", ".", "view", ".", "accessibility", ".", "AccessibilityManager", ";", "import", "android", ".", "view", ".", "animation", ".", "AlphaAnimation", ";", "import", "android", ".", "view", ".", "animation", ".", "Animation", ";", "import", "android", ".", "view", ".", "animation", ".", "AnimationUtils", ";", "import", "android", ".", "view", ".", "animation", ".", "Interpolator", ";", "import", "android", ".", "view", ".", "animation", ".", "LinearInterpolator", ";", "import", "android", ".", "view", ".", "animation", ".", "Transformation", ";", "import", "android", ".", "widget", ".", "RemoteViews", ".", "RemoteView", ";", "@", "RemoteView", "public", "class", "IcsProgressBar", "extends", "View", "{", "private", "static", "final", "boolean", "IS_HONEYCOMB", "=", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "HONEYCOMB", ";", "private", "static", "final", "int", "MAX_LEVEL", "=", "10000", ";", "private", "static", "final", "int", "ANIMATION_RESOLUTION", "=", "200", ";", "private", "static", "final", "int", "TIMEOUT_SEND_ACCESSIBILITY_EVENT", "=", "200", ";", "private", "static", "final", "int", "[", "]", "ProgressBar", "=", "new", "int", "[", "]", "{", "android", ".", "R", ".", "attr", ".", "maxWidth", ",", "android", ".", "R", ".", "attr", ".", "maxHeight", ",", "android", ".", "R", ".", "attr", ".", "max", ",", "android", ".", "R", ".", "attr", ".", "progress", ",", "android", ".", "R", ".", "attr", ".", "secondaryProgress", ",", "android", ".", "R", ".", "attr", ".", "indeterminate", ",", "android", ".", "R", ".", "attr", ".", "indeterminateOnly", ",", "android", ".", "R", ".", "attr", ".", "indeterminateDrawable", ",", "android", ".", "R", ".", "attr", ".", "progressDrawable", ",", "android", ".", "R", ".", "attr", ".", "indeterminateDuration", ",", "android", ".", "R", ".", "attr", ".", "indeterminateBehavior", ",", "android", ".", "R", ".", "attr", ".", "minWidth", ",", "android", ".", "R", ".", "attr", ".", "minHeight", ",", "android", ".", "R", ".", "attr", ".", "interpolator", ",", "android", ".", "R", ".", "attr", ".", "animationResolution", ",", "}", ";", "private", "static", "final", "int", "ProgressBar_maxWidth", "=", "0", ";", "private", "static", "final", "int", "ProgressBar_maxHeight", "=", "1", ";", "private", "static", "final", "int", "ProgressBar_max", "=", "2", ";", "private", "static", "final", "int", "ProgressBar_progress", "=", "3", ";", "private", "static", "final", "int", "ProgressBar_secondaryProgress", "=", "4", ";", "private", "static", "final", "int", "ProgressBar_indeterminate", "=", "5", ";", "private", "static", "final", "int", "ProgressBar_indeterminateOnly", "=", "6", ";", "private", "static", "final", "int", "ProgressBar_indeterminateDrawable", "=", "7", ";", "private", "static", "final", "int", "ProgressBar_progressDrawable", "=", "8", ";", "private", "static", "final", "int", "ProgressBar_indeterminateDuration", "=", "9", ";", "private", "static", "final", "int", "ProgressBar_indeterminateBehavior", "=", "10", ";", "private", "static", "final", "int", "ProgressBar_minWidth", "=", "11", ";", "private", "static", "final", "int", "ProgressBar_minHeight", "=", "12", ";", "private", "static", "final", "int", "ProgressBar_interpolator", "=", "13", ";", "private", "static", "final", "int", "ProgressBar_animationResolution", "=", "14", ";", "int", "mMinWidth", ";", "int", "mMaxWidth", ";", "int", "mMinHeight", ";", "int", "mMaxHeight", ";", "private", "int", "mProgress", ";", "private", "int", "mSecondaryProgress", ";", "private", "int", "mMax", ";", "private", "int", "mBehavior", ";", "private", "int", "mDuration", ";", "private", "boolean", "mIndeterminate", ";", "private", "boolean", "mOnlyIndeterminate", ";", "private", "Transformation", "mTransformation", ";", "private", "AlphaAnimation", "mAnimation", ";", "private", "Drawable", "mIndeterminateDrawable", ";", "private", "int", "mIndeterminateRealLeft", ";", "private", "int", "mIndeterminateRealTop", ";", "private", "Drawable", "mProgressDrawable", ";", "private", "Drawable", "mCurrentDrawable", ";", "Bitmap", "mSampleTile", ";", "private", "boolean", "mNoInvalidate", ";", "private", "Interpolator", "mInterpolator", ";", "private", "RefreshProgressRunnable", "mRefreshProgressRunnable", ";", "private", "long", "mUiThreadId", ";", "private", "boolean", "mShouldStartAnimationDrawable", ";", "private", "long", "mLastDrawTime", ";", "private", "boolean", "mInDrawing", ";", "private", "int", "mAnimationResolution", ";", "private", "AccessibilityManager", "mAccessibilityManager", ";", "private", "AccessibilityEventSender", "mAccessibilityEventSender", ";", "public", "IcsProgressBar", "(", "Context", "context", ")", "{", "this", "(", "context", ",", "null", ")", ";", "}", "public", "IcsProgressBar", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "this", "(", "context", ",", "attrs", ",", "android", ".", "R", ".", "attr", ".", "progressBarStyle", ")", ";", "}", "public", "IcsProgressBar", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyle", ")", "{", "this", "(", "context", ",", "attrs", ",", "defStyle", ",", "0", ")", ";", "}", "public", "IcsProgressBar", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyle", ",", "int", "styleRes", ")", "{", "super", "(", "context", ",", "attrs", ",", "defStyle", ")", ";", "mUiThreadId", "=", "Thread", ".", "currentThread", "(", ")", ".", "getId", "(", ")", ";", "initProgressBar", "(", ")", ";", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", "(", "attrs", ",", "ProgressBar", ",", "defStyle", ",", "styleRes", ")", ";", "mNoInvalidate", "=", "true", ";", "Drawable", "drawable", "=", "a", ".", "getDrawable", "(", "ProgressBar_progressDrawable", ")", ";", "if", "(", "drawable", "!=", "null", ")", "{", "drawable", "=", "tileify", "(", "drawable", ",", "false", ")", ";", "setProgressDrawable", "(", "drawable", ")", ";", "}", "mDuration", "=", "a", ".", "getInt", "(", "ProgressBar_indeterminateDuration", ",", "mDuration", ")", ";", "mMinWidth", "=", "a", ".", "getDimensionPixelSize", "(", "ProgressBar_minWidth", ",", "mMinWidth", ")", ";", "mMaxWidth", "=", "a", ".", "getDimensionPixelSize", "(", "ProgressBar_maxWidth", ",", "mMaxWidth", ")", ";", "mMinHeight", "=", "a", ".", "getDimensionPixelSize", "(", "ProgressBar_minHeight", ",", "mMinHeight", ")", ";", "mMaxHeight", "=", "a", ".", "getDimensionPixelSize", "(", "ProgressBar_maxHeight", ",", "mMaxHeight", ")", ";", "mBehavior", "=", "a", ".", "getInt", "(", "ProgressBar_indeterminateBehavior", ",", "mBehavior", ")", ";", "final", "int", "resID", "=", "a", ".", "getResourceId", "(", "ProgressBar_interpolator", ",", "android", ".", "R", ".", "anim", ".", "linear_interpolator", ")", ";", "if", "(", "resID", ">", "0", ")", "{", "setInterpolator", "(", "context", ",", "resID", ")", ";", "}", "setMax", "(", "a", ".", "getInt", "(", "ProgressBar_max", ",", "mMax", ")", ")", ";", "setProgress", "(", "a", ".", "getInt", "(", "ProgressBar_progress", ",", "mProgress", ")", ")", ";", "setSecondaryProgress", "(", "a", ".", "getInt", "(", "ProgressBar_secondaryProgress", ",", "mSecondaryProgress", ")", ")", ";", "drawable", "=", "a", ".", "getDrawable", "(", "ProgressBar_indeterminateDrawable", ")", ";", "if", "(", "drawable", "!=", "null", ")", "{", "drawable", "=", "tileifyIndeterminate", "(", "drawable", ")", ";", "setIndeterminateDrawable", "(", "drawable", ")", ";", "}", "mOnlyIndeterminate", "=", "a", ".", "getBoolean", "(", "ProgressBar_indeterminateOnly", ",", "mOnlyIndeterminate", ")", ";", "mNoInvalidate", "=", "false", ";", "setIndeterminate", "(", "mOnlyIndeterminate", "||", "a", ".", "getBoolean", "(", "ProgressBar_indeterminate", ",", "mIndeterminate", ")", ")", ";", "mAnimationResolution", "=", "a", ".", "getInteger", "(", "ProgressBar_animationResolution", ",", "ANIMATION_RESOLUTION", ")", ";", "a", ".", "recycle", "(", ")", ";", "mAccessibilityManager", "=", "(", "AccessibilityManager", ")", "context", ".", "getSystemService", "(", "Context", ".", "ACCESSIBILITY_SERVICE", ")", ";", "}", "private", "Drawable", "tileify", "(", "Drawable", "drawable", ",", "boolean", "clip", ")", "{", "if", "(", "drawable", "instanceof", "LayerDrawable", ")", "{", "LayerDrawable", "background", "=", "(", "LayerDrawable", ")", "drawable", ";", "final", "int", "N", "=", "background", ".", "getNumberOfLayers", "(", ")", ";", "Drawable", "[", "]", "outDrawables", "=", "new", "Drawable", "[", "N", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "int", "id", "=", "background", ".", "getId", "(", "i", ")", ";", "outDrawables", "[", "i", "]", "=", "tileify", "(", "background", ".", "getDrawable", "(", "i", ")", ",", "(", "id", "==", "android", ".", "R", ".", "id", ".", "progress", "||", "id", "==", "android", ".", "R", ".", "id", ".", "secondaryProgress", ")", ")", ";", "}", "LayerDrawable", "newBg", "=", "new", "LayerDrawable", "(", "outDrawables", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "newBg", ".", "setId", "(", "i", ",", "background", ".", "getId", "(", "i", ")", ")", ";", "}", "return", "newBg", ";", "}", "else", "if", "(", "drawable", "instanceof", "BitmapDrawable", ")", "{", "final", "Bitmap", "tileBitmap", "=", "(", "(", "BitmapDrawable", ")", "drawable", ")", ".", "getBitmap", "(", ")", ";", "if", "(", "mSampleTile", "==", "null", ")", "{", "mSampleTile", "=", "tileBitmap", ";", "}", "final", "ShapeDrawable", "shapeDrawable", "=", "new", "ShapeDrawable", "(", "getDrawableShape", "(", ")", ")", ";", "final", "BitmapShader", "bitmapShader", "=", "new", "BitmapShader", "(", "tileBitmap", ",", "Shader", ".", "TileMode", ".", "REPEAT", ",", "Shader", ".", "TileMode", ".", "CLAMP", ")", ";", "shapeDrawable", ".", "getPaint", "(", ")", ".", "setShader", "(", "bitmapShader", ")", ";", "return", "(", "clip", ")", "?", "new", "ClipDrawable", "(", "shapeDrawable", ",", "Gravity", ".", "LEFT", ",", "ClipDrawable", ".", "HORIZONTAL", ")", ":", "shapeDrawable", ";", "}", "return", "drawable", ";", "}", "Shape", "getDrawableShape", "(", ")", "{", "final", "float", "[", "]", "roundedCorners", "=", "new", "float", "[", "]", "{", "5", ",", "5", ",", "5", ",", "5", ",", "5", ",", "5", ",", "5", ",", "5", "}", ";", "return", "new", "RoundRectShape", "(", "roundedCorners", ",", "null", ",", "null", ")", ";", "}", "private", "Drawable", "tileifyIndeterminate", "(", "Drawable", "drawable", ")", "{", "if", "(", "drawable", "instanceof", "AnimationDrawable", ")", "{", "AnimationDrawable", "background", "=", "(", "AnimationDrawable", ")", "drawable", ";", "final", "int", "N", "=", "background", ".", "getNumberOfFrames", "(", ")", ";", "AnimationDrawable", "newBg", "=", "new", "AnimationDrawable", "(", ")", ";", "newBg", ".", "setOneShot", "(", "background", ".", "isOneShot", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i", "++", ")", "{", "Drawable", "frame", "=", "tileify", "(", "background", ".", "getFrame", "(", "i", ")", ",", "true", ")", ";", "frame", ".", "setLevel", "(", "10000", ")", ";", "newBg", ".", "addFrame", "(", "frame", ",", "background", ".", "getDuration", "(", "i", ")", ")", ";", "}", "newBg", ".", "setLevel", "(", "10000", ")", ";", "drawable", "=", "newBg", ";", "}", "return", "drawable", ";", "}", "private", "void", "initProgressBar", "(", ")", "{", "mMax", "=", "100", ";", "mProgress", "=", "0", ";", "mSecondaryProgress", "=", "0", ";", "mIndeterminate", "=", "false", ";", "mOnlyIndeterminate", "=", "false", ";", "mDuration", "=", "4000", ";", "mBehavior", "=", "AlphaAnimation", ".", "RESTART", ";", "mMinWidth", "=", "24", ";", "mMaxWidth", "=", "48", ";", "mMinHeight", "=", "24", ";", "mMaxHeight", "=", "48", ";", "}", "@", "ViewDebug", ".", "ExportedProperty", "(", "category", "=", "\"progress\"", ")", "public", "synchronized", "boolean", "isIndeterminate", "(", ")", "{", "return", "mIndeterminate", ";", "}", "public", "synchronized", "void", "setIndeterminate", "(", "boolean", "indeterminate", ")", "{", "if", "(", "(", "!", "mOnlyIndeterminate", "||", "!", "mIndeterminate", ")", "&&", "indeterminate", "!=", "mIndeterminate", ")", "{", "mIndeterminate", "=", "indeterminate", ";", "if", "(", "indeterminate", ")", "{", "mCurrentDrawable", "=", "mIndeterminateDrawable", ";", "startAnimation", "(", ")", ";", "}", "else", "{", "mCurrentDrawable", "=", "mProgressDrawable", ";", "stopAnimation", "(", ")", ";", "}", "}", "}", "public", "Drawable", "getIndeterminateDrawable", "(", ")", "{", "return", "mIndeterminateDrawable", ";", "}", "public", "void", "setIndeterminateDrawable", "(", "Drawable", "d", ")", "{", "if", "(", "d", "!=", "null", ")", "{", "d", ".", "setCallback", "(", "this", ")", ";", "}", "mIndeterminateDrawable", "=", "d", ";", "if", "(", "mIndeterminate", ")", "{", "mCurrentDrawable", "=", "d", ";", "postInvalidate", "(", ")", ";", "}", "}", "public", "Drawable", "getProgressDrawable", "(", ")", "{", "return", "mProgressDrawable", ";", "}", "public", "void", "setProgressDrawable", "(", "Drawable", "d", ")", "{", "boolean", "needUpdate", ";", "if", "(", "mProgressDrawable", "!=", "null", "&&", "d", "!=", "mProgressDrawable", ")", "{", "mProgressDrawable", ".", "setCallback", "(", "null", ")", ";", "needUpdate", "=", "true", ";", "}", "else", "{", "needUpdate", "=", "false", ";", "}", "if", "(", "d", "!=", "null", ")", "{", "d", ".", "setCallback", "(", "this", ")", ";", "int", "drawableHeight", "=", "d", ".", "getMinimumHeight", "(", ")", ";", "if", "(", "mMaxHeight", "<", "drawableHeight", ")", "{", "mMaxHeight", "=", "drawableHeight", ";", "requestLayout", "(", ")", ";", "}", "}", "mProgressDrawable", "=", "d", ";", "if", "(", "!", "mIndeterminate", ")", "{", "mCurrentDrawable", "=", "d", ";", "postInvalidate", "(", ")", ";", "}", "if", "(", "needUpdate", ")", "{", "updateDrawableBounds", "(", "getWidth", "(", ")", ",", "getHeight", "(", ")", ")", ";", "updateDrawableState", "(", ")", ";", "doRefreshProgress", "(", "android", ".", "R", ".", "id", ".", "progress", ",", "mProgress", ",", "false", ",", "false", ")", ";", "doRefreshProgress", "(", "android", ".", "R", ".", "id", ".", "secondaryProgress", ",", "mSecondaryProgress", ",", "false", ",", "false", ")", ";", "}", "}", "Drawable", "getCurrentDrawable", "(", ")", "{", "return", "mCurrentDrawable", ";", "}", "@", "Override", "protected", "boolean", "verifyDrawable", "(", "Drawable", "who", ")", "{", "return", "who", "==", "mProgressDrawable", "||", "who", "==", "mIndeterminateDrawable", "||", "super", ".", "verifyDrawable", "(", "who", ")", ";", "}", "@", "Override", "public", "void", "jumpDrawablesToCurrentState", "(", ")", "{", "super", ".", "jumpDrawablesToCurrentState", "(", ")", ";", "if", "(", "mProgressDrawable", "!=", "null", ")", "mProgressDrawable", ".", "jumpToCurrentState", "(", ")", ";", "if", "(", "mIndeterminateDrawable", "!=", "null", ")", "mIndeterminateDrawable", ".", "jumpToCurrentState", "(", ")", ";", "}", "@", "Override", "public", "void", "postInvalidate", "(", ")", "{", "if", "(", "!", "mNoInvalidate", ")", "{", "super", ".", "postInvalidate", "(", ")", ";", "}", "}", "private", "class", "RefreshProgressRunnable", "implements", "Runnable", "{", "private", "int", "mId", ";", "private", "int", "mProgress", ";", "private", "boolean", "mFromUser", ";", "RefreshProgressRunnable", "(", "int", "id", ",", "int", "progress", ",", "boolean", "fromUser", ")", "{", "mId", "=", "id", ";", "mProgress", "=", "progress", ";", "mFromUser", "=", "fromUser", ";", "}", "public", "void", "run", "(", ")", "{", "doRefreshProgress", "(", "mId", ",", "mProgress", ",", "mFromUser", ",", "true", ")", ";", "mRefreshProgressRunnable", "=", "this", ";", "}", "public", "void", "setup", "(", "int", "id", ",", "int", "progress", ",", "boolean", "fromUser", ")", "{", "mId", "=", "id", ";", "mProgress", "=", "progress", ";", "mFromUser", "=", "fromUser", ";", "}", "}", "private", "synchronized", "void", "doRefreshProgress", "(", "int", "id", ",", "int", "progress", ",", "boolean", "fromUser", ",", "boolean", "callBackToApp", ")", "{", "float", "scale", "=", "mMax", ">", "0", "?", "(", "float", ")", "progress", "/", "(", "float", ")", "mMax", ":", "0", ";", "final", "Drawable", "d", "=", "mCurrentDrawable", ";", "if", "(", "d", "!=", "null", ")", "{", "Drawable", "progressDrawable", "=", "null", ";", "if", "(", "d", "instanceof", "LayerDrawable", ")", "{", "progressDrawable", "=", "(", "(", "LayerDrawable", ")", "d", ")", ".", "findDrawableByLayerId", "(", "id", ")", ";", "}", "final", "int", "level", "=", "(", "int", ")", "(", "scale", "*", "MAX_LEVEL", ")", ";", "(", "progressDrawable", "!=", "null", "?", "progressDrawable", ":", "d", ")", ".", "setLevel", "(", "level", ")", ";", "}", "else", "{", "invalidate", "(", ")", ";", "}", "if", "(", "callBackToApp", "&&", "id", "==", "android", ".", "R", ".", "id", ".", "progress", ")", "{", "onProgressRefresh", "(", "scale", ",", "fromUser", ")", ";", "}", "}", "void", "onProgressRefresh", "(", "float", "scale", ",", "boolean", "fromUser", ")", "{", "if", "(", "mAccessibilityManager", ".", "isEnabled", "(", ")", ")", "{", "scheduleAccessibilityEventSender", "(", ")", ";", "}", "}", "private", "synchronized", "void", "refreshProgress", "(", "int", "id", ",", "int", "progress", ",", "boolean", "fromUser", ")", "{", "if", "(", "mUiThreadId", "==", "Thread", ".", "currentThread", "(", ")", ".", "getId", "(", ")", ")", "{", "doRefreshProgress", "(", "id", ",", "progress", ",", "fromUser", ",", "true", ")", ";", "}", "else", "{", "RefreshProgressRunnable", "r", ";", "if", "(", "mRefreshProgressRunnable", "!=", "null", ")", "{", "r", "=", "mRefreshProgressRunnable", ";", "mRefreshProgressRunnable", "=", "null", ";", "r", ".", "setup", "(", "id", ",", "progress", ",", "fromUser", ")", ";", "}", "else", "{", "r", "=", "new", "RefreshProgressRunnable", "(", "id", ",", "progress", ",", "fromUser", ")", ";", "}", "post", "(", "r", ")", ";", "}", "}", "public", "synchronized", "void", "setProgress", "(", "int", "progress", ")", "{", "setProgress", "(", "progress", ",", "false", ")", ";", "}", "synchronized", "void", "setProgress", "(", "int", "progress", ",", "boolean", "fromUser", ")", "{", "if", "(", "mIndeterminate", ")", "{", "return", ";", "}", "if", "(", "progress", "<", "0", ")", "{", "progress", "=", "0", ";", "}", "if", "(", "progress", ">", "mMax", ")", "{", "progress", "=", "mMax", ";", "}", "if", "(", "progress", "!=", "mProgress", ")", "{", "mProgress", "=", "progress", ";", "refreshProgress", "(", "android", ".", "R", ".", "id", ".", "progress", ",", "mProgress", ",", "fromUser", ")", ";", "}", "}", "public", "synchronized", "void", "setSecondaryProgress", "(", "int", "secondaryProgress", ")", "{", "if", "(", "mIndeterminate", ")", "{", "return", ";", "}", "if", "(", "secondaryProgress", "<", "0", ")", "{", "secondaryProgress", "=", "0", ";", "}", "if", "(", "secondaryProgress", ">", "mMax", ")", "{", "secondaryProgress", "=", "mMax", ";", "}", "if", "(", "secondaryProgress", "!=", "mSecondaryProgress", ")", "{", "mSecondaryProgress", "=", "secondaryProgress", ";", "refreshProgress", "(", "android", ".", "R", ".", "id", ".", "secondaryProgress", ",", "mSecondaryProgress", ",", "false", ")", ";", "}", "}", "@", "ViewDebug", ".", "ExportedProperty", "(", "category", "=", "\"progress\"", ")", "public", "synchronized", "int", "getProgress", "(", ")", "{", "return", "mIndeterminate", "?", "0", ":", "mProgress", ";", "}", "@", "ViewDebug", ".", "ExportedProperty", "(", "category", "=", "\"progress\"", ")", "public", "synchronized", "int", "getSecondaryProgress", "(", ")", "{", "return", "mIndeterminate", "?", "0", ":", "mSecondaryProgress", ";", "}", "@", "ViewDebug", ".", "ExportedProperty", "(", "category", "=", "\"progress\"", ")", "public", "synchronized", "int", "getMax", "(", ")", "{", "return", "mMax", ";", "}", "public", "synchronized", "void", "setMax", "(", "int", "max", ")", "{", "if", "(", "max", "<", "0", ")", "{", "max", "=", "0", ";", "}", "if", "(", "max", "!=", "mMax", ")", "{", "mMax", "=", "max", ";", "postInvalidate", "(", ")", ";", "if", "(", "mProgress", ">", "max", ")", "{", "mProgress", "=", "max", ";", "}", "refreshProgress", "(", "android", ".", "R", ".", "id", ".", "progress", ",", "mProgress", ",", "false", ")", ";", "}", "}", "public", "synchronized", "final", "void", "incrementProgressBy", "(", "int", "diff", ")", "{", "setProgress", "(", "mProgress", "+", "diff", ")", ";", "}", "public", "synchronized", "final", "void", "incrementSecondaryProgressBy", "(", "int", "diff", ")", "{", "setSecondaryProgress", "(", "mSecondaryProgress", "+", "diff", ")", ";", "}", "void", "startAnimation", "(", ")", "{", "if", "(", "getVisibility", "(", ")", "!=", "VISIBLE", ")", "{", "return", ";", "}", "if", "(", "mIndeterminateDrawable", "instanceof", "Animatable", ")", "{", "mShouldStartAnimationDrawable", "=", "true", ";", "mAnimation", "=", "null", ";", "}", "else", "{", "if", "(", "mInterpolator", "==", "null", ")", "{", "mInterpolator", "=", "new", "LinearInterpolator", "(", ")", ";", "}", "mTransformation", "=", "new", "Transformation", "(", ")", ";", "mAnimation", "=", "new", "AlphaAnimation", "(", "0.0f", ",", "1.0f", ")", ";", "mAnimation", ".", "setRepeatMode", "(", "mBehavior", ")", ";", "mAnimation", ".", "setRepeatCount", "(", "Animation", ".", "INFINITE", ")", ";", "mAnimation", ".", "setDuration", "(", "mDuration", ")", ";", "mAnimation", ".", "setInterpolator", "(", "mInterpolator", ")", ";", "mAnimation", ".", "setStartTime", "(", "Animation", ".", "START_ON_FIRST_FRAME", ")", ";", "}", "postInvalidate", "(", ")", ";", "}", "void", "stopAnimation", "(", ")", "{", "mAnimation", "=", "null", ";", "mTransformation", "=", "null", ";", "if", "(", "mIndeterminateDrawable", "instanceof", "Animatable", ")", "{", "(", "(", "Animatable", ")", "mIndeterminateDrawable", ")", ".", "stop", "(", ")", ";", "mShouldStartAnimationDrawable", "=", "false", ";", "}", "postInvalidate", "(", ")", ";", "}", "public", "void", "setInterpolator", "(", "Context", "context", ",", "int", "resID", ")", "{", "setInterpolator", "(", "AnimationUtils", ".", "loadInterpolator", "(", "context", ",", "resID", ")", ")", ";", "}", "public", "void", "setInterpolator", "(", "Interpolator", "interpolator", ")", "{", "mInterpolator", "=", "interpolator", ";", "}", "public", "Interpolator", "getInterpolator", "(", ")", "{", "return", "mInterpolator", ";", "}", "@", "Override", "public", "void", "setVisibility", "(", "int", "v", ")", "{", "if", "(", "getVisibility", "(", ")", "!=", "v", ")", "{", "super", ".", "setVisibility", "(", "v", ")", ";", "if", "(", "mIndeterminate", ")", "{", "if", "(", "v", "==", "GONE", "||", "v", "==", "INVISIBLE", ")", "{", "stopAnimation", "(", ")", ";", "}", "else", "{", "startAnimation", "(", ")", ";", "}", "}", "}", "}", "@", "Override", "protected", "void", "onVisibilityChanged", "(", "View", "changedView", ",", "int", "visibility", ")", "{", "super", ".", "onVisibilityChanged", "(", "changedView", ",", "visibility", ")", ";", "if", "(", "mIndeterminate", ")", "{", "if", "(", "visibility", "==", "GONE", "||", "visibility", "==", "INVISIBLE", ")", "{", "stopAnimation", "(", ")", ";", "}", "else", "{", "startAnimation", "(", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "invalidateDrawable", "(", "Drawable", "dr", ")", "{", "if", "(", "!", "mInDrawing", ")", "{", "if", "(", "verifyDrawable", "(", "dr", ")", ")", "{", "final", "Rect", "dirty", "=", "dr", ".", "getBounds", "(", ")", ";", "final", "int", "scrollX", "=", "getScrollX", "(", ")", "+", "getPaddingLeft", "(", ")", ";", "final", "int", "scrollY", "=", "getScrollY", "(", ")", "+", "getPaddingTop", "(", ")", ";", "invalidate", "(", "dirty", ".", "left", "+", "scrollX", ",", "dirty", ".", "top", "+", "scrollY", ",", "dirty", ".", "right", "+", "scrollX", ",", "dirty", ".", "bottom", "+", "scrollY", ")", ";", "}", "else", "{", "super", ".", "invalidateDrawable", "(", "dr", ")", ";", "}", "}", "}", "@", "Override", "protected", "void", "onSizeChanged", "(", "int", "w", ",", "int", "h", ",", "int", "oldw", ",", "int", "oldh", ")", "{", "updateDrawableBounds", "(", "w", ",", "h", ")", ";", "}", "private", "void", "updateDrawableBounds", "(", "int", "w", ",", "int", "h", ")", "{", "int", "right", "=", "w", "-", "getPaddingRight", "(", ")", "-", "getPaddingLeft", "(", ")", ";", "int", "bottom", "=", "h", "-", "getPaddingBottom", "(", ")", "-", "getPaddingTop", "(", ")", ";", "int", "top", "=", "0", ";", "int", "left", "=", "0", ";", "if", "(", "mIndeterminateDrawable", "!=", "null", ")", "{", "if", "(", "mOnlyIndeterminate", "&&", "!", "(", "mIndeterminateDrawable", "instanceof", "AnimationDrawable", ")", ")", "{", "final", "int", "intrinsicWidth", "=", "mIndeterminateDrawable", ".", "getIntrinsicWidth", "(", ")", ";", "final", "int", "intrinsicHeight", "=", "mIndeterminateDrawable", ".", "getIntrinsicHeight", "(", ")", ";", "final", "float", "intrinsicAspect", "=", "(", "float", ")", "intrinsicWidth", "/", "intrinsicHeight", ";", "final", "float", "boundAspect", "=", "(", "float", ")", "w", "/", "h", ";", "if", "(", "intrinsicAspect", "!=", "boundAspect", ")", "{", "if", "(", "boundAspect", ">", "intrinsicAspect", ")", "{", "final", "int", "width", "=", "(", "int", ")", "(", "h", "*", "intrinsicAspect", ")", ";", "left", "=", "(", "w", "-", "width", ")", "/", "2", ";", "right", "=", "left", "+", "width", ";", "}", "else", "{", "final", "int", "height", "=", "(", "int", ")", "(", "w", "*", "(", "1", "/", "intrinsicAspect", ")", ")", ";", "top", "=", "(", "h", "-", "height", ")", "/", "2", ";", "bottom", "=", "top", "+", "height", ";", "}", "}", "}", "mIndeterminateDrawable", ".", "setBounds", "(", "0", ",", "0", ",", "right", "-", "left", ",", "bottom", "-", "top", ")", ";", "mIndeterminateRealLeft", "=", "left", ";", "mIndeterminateRealTop", "=", "top", ";", "}", "if", "(", "mProgressDrawable", "!=", "null", ")", "{", "mProgressDrawable", ".", "setBounds", "(", "0", ",", "0", ",", "right", ",", "bottom", ")", ";", "}", "}", "@", "Override", "protected", "synchronized", "void", "onDraw", "(", "Canvas", "canvas", ")", "{", "super", ".", "onDraw", "(", "canvas", ")", ";", "Drawable", "d", "=", "mCurrentDrawable", ";", "if", "(", "d", "!=", "null", ")", "{", "canvas", ".", "save", "(", ")", ";", "canvas", ".", "translate", "(", "getPaddingLeft", "(", ")", "+", "mIndeterminateRealLeft", ",", "getPaddingTop", "(", ")", "+", "mIndeterminateRealTop", ")", ";", "long", "time", "=", "getDrawingTime", "(", ")", ";", "if", "(", "mAnimation", "!=", "null", ")", "{", "mAnimation", ".", "getTransformation", "(", "time", ",", "mTransformation", ")", ";", "float", "scale", "=", "mTransformation", ".", "getAlpha", "(", ")", ";", "try", "{", "mInDrawing", "=", "true", ";", "d", ".", "setLevel", "(", "(", "int", ")", "(", "scale", "*", "MAX_LEVEL", ")", ")", ";", "}", "finally", "{", "mInDrawing", "=", "false", ";", "}", "if", "(", "SystemClock", ".", "uptimeMillis", "(", ")", "-", "mLastDrawTime", ">=", "mAnimationResolution", ")", "{", "mLastDrawTime", "=", "SystemClock", ".", "uptimeMillis", "(", ")", ";", "postInvalidateDelayed", "(", "mAnimationResolution", ")", ";", "}", "}", "d", ".", "draw", "(", "canvas", ")", ";", "canvas", ".", "restore", "(", ")", ";", "if", "(", "mShouldStartAnimationDrawable", "&&", "d", "instanceof", "Animatable", ")", "{", "(", "(", "Animatable", ")", "d", ")", ".", "start", "(", ")", ";", "mShouldStartAnimationDrawable", "=", "false", ";", "}", "}", "}", "@", "Override", "protected", "synchronized", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "Drawable", "d", "=", "mCurrentDrawable", ";", "int", "dw", "=", "0", ";", "int", "dh", "=", "0", ";", "if", "(", "d", "!=", "null", ")", "{", "dw", "=", "Math", ".", "max", "(", "mMinWidth", ",", "Math", ".", "min", "(", "mMaxWidth", ",", "d", ".", "getIntrinsicWidth", "(", ")", ")", ")", ";", "dh", "=", "Math", ".", "max", "(", "mMinHeight", ",", "Math", ".", "min", "(", "mMaxHeight", ",", "d", ".", "getIntrinsicHeight", "(", ")", ")", ")", ";", "}", "updateDrawableState", "(", ")", ";", "dw", "+=", "getPaddingLeft", "(", ")", "+", "getPaddingRight", "(", ")", ";", "dh", "+=", "getPaddingTop", "(", ")", "+", "getPaddingBottom", "(", ")", ";", "if", "(", "IS_HONEYCOMB", ")", "{", "setMeasuredDimension", "(", "View", ".", "resolveSizeAndState", "(", "dw", ",", "widthMeasureSpec", ",", "0", ")", ",", "View", ".", "resolveSizeAndState", "(", "dh", ",", "heightMeasureSpec", ",", "0", ")", ")", ";", "}", "else", "{", "setMeasuredDimension", "(", "View", ".", "resolveSize", "(", "dw", ",", "widthMeasureSpec", ")", ",", "View", ".", "resolveSize", "(", "dh", ",", "heightMeasureSpec", ")", ")", ";", "}", "}", "@", "Override", "protected", "void", "drawableStateChanged", "(", ")", "{", "super", ".", "drawableStateChanged", "(", ")", ";", "updateDrawableState", "(", ")", ";", "}", "private", "void", "updateDrawableState", "(", ")", "{", "int", "[", "]", "state", "=", "getDrawableState", "(", ")", ";", "if", "(", "mProgressDrawable", "!=", "null", "&&", "mProgressDrawable", ".", "isStateful", "(", ")", ")", "{", "mProgressDrawable", ".", "setState", "(", "state", ")", ";", "}", "if", "(", "mIndeterminateDrawable", "!=", "null", "&&", "mIndeterminateDrawable", ".", "isStateful", "(", ")", ")", "{", "mIndeterminateDrawable", ".", "setState", "(", "state", ")", ";", "}", "}", "static", "class", "SavedState", "extends", "BaseSavedState", "{", "int", "progress", ";", "int", "secondaryProgress", ";", "SavedState", "(", "Parcelable", "superState", ")", "{", "super", "(", "superState", ")", ";", "}", "private", "SavedState", "(", "Parcel", "in", ")", "{", "super", "(", "in", ")", ";", "progress", "=", "in", ".", "readInt", "(", ")", ";", "secondaryProgress", "=", "in", ".", "readInt", "(", ")", ";", "}", "@", "Override", "public", "void", "writeToParcel", "(", "Parcel", "out", ",", "int", "flags", ")", "{", "super", ".", "writeToParcel", "(", "out", ",", "flags", ")", ";", "out", ".", "writeInt", "(", "progress", ")", ";", "out", ".", "writeInt", "(", "secondaryProgress", ")", ";", "}", "public", "static", "final", "Parcelable", ".", "Creator", "<", "SavedState", ">", "CREATOR", "=", "new", "Parcelable", ".", "Creator", "<", "SavedState", ">", "(", ")", "{", "public", "SavedState", "createFromParcel", "(", "Parcel", "in", ")", "{", "return", "new", "SavedState", "(", "in", ")", ";", "}", "public", "SavedState", "[", "]", "newArray", "(", "int", "size", ")", "{", "return", "new", "SavedState", "[", "size", "]", ";", "}", "}", ";", "}", "@", "Override", "public", "Parcelable", "onSaveInstanceState", "(", ")", "{", "Parcelable", "superState", "=", "super", ".", "onSaveInstanceState", "(", ")", ";", "SavedState", "ss", "=", "new", "SavedState", "(", "superState", ")", ";", "ss", ".", "progress", "=", "mProgress", ";", "ss", ".", "secondaryProgress", "=", "mSecondaryProgress", ";", "return", "ss", ";", "}", "@", "Override", "public", "void", "onRestoreInstanceState", "(", "Parcelable", "state", ")", "{", "SavedState", "ss", "=", "(", "SavedState", ")", "state", ";", "super", ".", "onRestoreInstanceState", "(", "ss", ".", "getSuperState", "(", ")", ")", ";", "setProgress", "(", "ss", ".", "progress", ")", ";", "setSecondaryProgress", "(", "ss", ".", "secondaryProgress", ")", ";", "}", "@", "Override", "protected", "void", "onAttachedToWindow", "(", ")", "{", "super", ".", "onAttachedToWindow", "(", ")", ";", "if", "(", "mIndeterminate", ")", "{", "startAnimation", "(", ")", ";", "}", "}", "@", "Override", "protected", "void", "onDetachedFromWindow", "(", ")", "{", "if", "(", "mIndeterminate", ")", "{", "stopAnimation", "(", ")", ";", "}", "if", "(", "mRefreshProgressRunnable", "!=", "null", ")", "{", "removeCallbacks", "(", "mRefreshProgressRunnable", ")", ";", "}", "if", "(", "mAccessibilityEventSender", "!=", "null", ")", "{", "removeCallbacks", "(", "mAccessibilityEventSender", ")", ";", "}", "super", ".", "onDetachedFromWindow", "(", ")", ";", "}", "@", "Override", "public", "void", "onInitializeAccessibilityEvent", "(", "AccessibilityEvent", "event", ")", "{", "super", ".", "onInitializeAccessibilityEvent", "(", "event", ")", ";", "event", ".", "setItemCount", "(", "mMax", ")", ";", "event", ".", "setCurrentItemIndex", "(", "mProgress", ")", ";", "}", "private", "void", "scheduleAccessibilityEventSender", "(", ")", "{", "if", "(", "mAccessibilityEventSender", "==", "null", ")", "{", "mAccessibilityEventSender", "=", "new", "AccessibilityEventSender", "(", ")", ";", "}", "else", "{", "removeCallbacks", "(", "mAccessibilityEventSender", ")", ";", "}", "postDelayed", "(", "mAccessibilityEventSender", ",", "TIMEOUT_SEND_ACCESSIBILITY_EVENT", ")", ";", "}", "private", "class", "AccessibilityEventSender", "implements", "Runnable", "{", "public", "void", "run", "(", ")", "{", "sendAccessibilityEvent", "(", "AccessibilityEvent", ".", "TYPE_VIEW_SELECTED", ")", ";", "}", "}", "}", "</s>" ]
8,995
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "Configuration", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "text", ".", "TextUtils", ".", "TruncateAt", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "Gravity", ";", "import", "android", ".", "view", ".", "LayoutInflater", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "view", ".", "ViewParent", ";", "import", "android", ".", "view", ".", "animation", ".", "DecelerateInterpolator", ";", "import", "android", ".", "view", ".", "animation", ".", "Interpolator", ";", "import", "android", ".", "widget", ".", "BaseAdapter", ";", "import", "android", ".", "widget", ".", "ImageView", ";", "import", "android", ".", "widget", ".", "LinearLayout", ";", "import", "android", ".", "widget", ".", "ListView", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "com", ".", "actionbarsherlock", ".", "app", ".", "ActionBar", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "animation", ".", "Animator", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "animation", ".", "ObjectAnimator", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "widget", ".", "NineHorizontalScrollView", ";", "public", "class", "ScrollingTabContainerView", "extends", "NineHorizontalScrollView", "implements", "IcsAdapterView", ".", "OnItemSelectedListener", "{", "Runnable", "mTabSelector", ";", "private", "TabClickListener", "mTabClickListener", ";", "private", "IcsLinearLayout", "mTabLayout", ";", "private", "IcsSpinner", "mTabSpinner", ";", "private", "boolean", "mAllowCollapse", ";", "private", "LayoutInflater", "mInflater", ";", "int", "mMaxTabWidth", ";", "private", "int", "mContentHeight", ";", "private", "int", "mSelectedTabIndex", ";", "protected", "Animator", "mVisibilityAnim", ";", "protected", "final", "VisibilityAnimListener", "mVisAnimListener", "=", "new", "VisibilityAnimListener", "(", ")", ";", "private", "static", "final", "Interpolator", "sAlphaInterpolator", "=", "new", "DecelerateInterpolator", "(", ")", ";", "private", "static", "final", "int", "FADE_DURATION", "=", "200", ";", "public", "ScrollingTabContainerView", "(", "Context", "context", ")", "{", "super", "(", "context", ")", ";", "setHorizontalScrollBarEnabled", "(", "false", ")", ";", "TypedArray", "a", "=", "getContext", "(", ")", ".", "obtainStyledAttributes", "(", "null", ",", "R", ".", "styleable", ".", "SherlockActionBar", ",", "R", ".", "attr", ".", "actionBarStyle", ",", "0", ")", ";", "setContentHeight", "(", "a", ".", "getLayoutDimension", "(", "R", ".", "styleable", ".", "SherlockActionBar_height", ",", "0", ")", ")", ";", "a", ".", "recycle", "(", ")", ";", "mInflater", "=", "LayoutInflater", ".", "from", "(", "context", ")", ";", "mTabLayout", "=", "createTabLayout", "(", ")", ";", "addView", "(", "mTabLayout", ",", "new", "ViewGroup", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ")", ";", "}", "@", "Override", "public", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "final", "int", "widthMode", "=", "MeasureSpec", ".", "getMode", "(", "widthMeasureSpec", ")", ";", "final", "boolean", "lockedExpanded", "=", "widthMode", "==", "MeasureSpec", ".", "EXACTLY", ";", "setFillViewport", "(", "lockedExpanded", ")", ";", "final", "int", "childCount", "=", "mTabLayout", ".", "getChildCount", "(", ")", ";", "if", "(", "childCount", ">", "1", "&&", "(", "widthMode", "==", "MeasureSpec", ".", "EXACTLY", "||", "widthMode", "==", "MeasureSpec", ".", "AT_MOST", ")", ")", "{", "if", "(", "childCount", ">", "2", ")", "{", "mMaxTabWidth", "=", "(", "int", ")", "(", "MeasureSpec", ".", "getSize", "(", "widthMeasureSpec", ")", "*", "0.4f", ")", ";", "}", "else", "{", "mMaxTabWidth", "=", "MeasureSpec", ".", "getSize", "(", "widthMeasureSpec", ")", "/", "2", ";", "}", "}", "else", "{", "mMaxTabWidth", "=", "-", "1", ";", "}", "heightMeasureSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "mContentHeight", ",", "MeasureSpec", ".", "EXACTLY", ")", ";", "final", "boolean", "canCollapse", "=", "!", "lockedExpanded", "&&", "mAllowCollapse", ";", "if", "(", "canCollapse", ")", "{", "mTabLayout", ".", "measure", "(", "MeasureSpec", ".", "UNSPECIFIED", ",", "heightMeasureSpec", ")", ";", "if", "(", "mTabLayout", ".", "getMeasuredWidth", "(", ")", ">", "MeasureSpec", ".", "getSize", "(", "widthMeasureSpec", ")", ")", "{", "performCollapse", "(", ")", ";", "}", "else", "{", "performExpand", "(", ")", ";", "}", "}", "else", "{", "performExpand", "(", ")", ";", "}", "final", "int", "oldWidth", "=", "getMeasuredWidth", "(", ")", ";", "super", ".", "onMeasure", "(", "widthMeasureSpec", ",", "heightMeasureSpec", ")", ";", "final", "int", "newWidth", "=", "getMeasuredWidth", "(", ")", ";", "if", "(", "lockedExpanded", "&&", "oldWidth", "!=", "newWidth", ")", "{", "setTabSelected", "(", "mSelectedTabIndex", ")", ";", "}", "}", "private", "boolean", "isCollapsed", "(", ")", "{", "return", "mTabSpinner", "!=", "null", "&&", "mTabSpinner", ".", "getParent", "(", ")", "==", "this", ";", "}", "public", "void", "setAllowCollapse", "(", "boolean", "allowCollapse", ")", "{", "mAllowCollapse", "=", "allowCollapse", ";", "}", "private", "void", "performCollapse", "(", ")", "{", "if", "(", "isCollapsed", "(", ")", ")", "return", ";", "if", "(", "mTabSpinner", "==", "null", ")", "{", "mTabSpinner", "=", "createSpinner", "(", ")", ";", "}", "removeView", "(", "mTabLayout", ")", ";", "addView", "(", "mTabSpinner", ",", "new", "ViewGroup", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ")", ";", "if", "(", "mTabSpinner", ".", "getAdapter", "(", ")", "==", "null", ")", "{", "mTabSpinner", ".", "setAdapter", "(", "new", "TabAdapter", "(", ")", ")", ";", "}", "if", "(", "mTabSelector", "!=", "null", ")", "{", "removeCallbacks", "(", "mTabSelector", ")", ";", "mTabSelector", "=", "null", ";", "}", "mTabSpinner", ".", "setSelection", "(", "mSelectedTabIndex", ")", ";", "}", "private", "boolean", "performExpand", "(", ")", "{", "if", "(", "!", "isCollapsed", "(", ")", ")", "return", "false", ";", "removeView", "(", "mTabSpinner", ")", ";", "addView", "(", "mTabLayout", ",", "new", "ViewGroup", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ")", ";", "setTabSelected", "(", "mTabSpinner", ".", "getSelectedItemPosition", "(", ")", ")", ";", "return", "false", ";", "}", "public", "void", "setTabSelected", "(", "int", "position", ")", "{", "mSelectedTabIndex", "=", "position", ";", "final", "int", "tabCount", "=", "mTabLayout", ".", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tabCount", ";", "i", "++", ")", "{", "final", "View", "child", "=", "mTabLayout", ".", "getChildAt", "(", "i", ")", ";", "final", "boolean", "isSelected", "=", "i", "==", "position", ";", "child", ".", "setSelected", "(", "isSelected", ")", ";", "if", "(", "isSelected", ")", "{", "animateToTab", "(", "position", ")", ";", "}", "}", "}", "public", "void", "setContentHeight", "(", "int", "contentHeight", ")", "{", "mContentHeight", "=", "contentHeight", ";", "requestLayout", "(", ")", ";", "}", "private", "IcsLinearLayout", "createTabLayout", "(", ")", "{", "final", "IcsLinearLayout", "tabLayout", "=", "(", "IcsLinearLayout", ")", "LayoutInflater", ".", "from", "(", "getContext", "(", ")", ")", ".", "inflate", "(", "R", ".", "layout", ".", "abs__action_bar_tab_bar_view", ",", "null", ")", ";", "tabLayout", ".", "setLayoutParams", "(", "new", "LinearLayout", ".", "LayoutParams", "(", "LinearLayout", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "LinearLayout", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ")", ";", "return", "tabLayout", ";", "}", "private", "IcsSpinner", "createSpinner", "(", ")", "{", "final", "IcsSpinner", "spinner", "=", "new", "IcsSpinner", "(", "getContext", "(", ")", ",", "null", ",", "R", ".", "attr", ".", "actionDropDownStyle", ")", ";", "spinner", ".", "setLayoutParams", "(", "new", "LinearLayout", ".", "LayoutParams", "(", "LinearLayout", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "LinearLayout", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ")", ";", "spinner", ".", "setOnItemSelectedListener", "(", "this", ")", ";", "return", "spinner", ";", "}", "@", "Override", "protected", "void", "onConfigurationChanged", "(", "Configuration", "newConfig", ")", "{", "super", ".", "onConfigurationChanged", "(", "newConfig", ")", ";", "TypedArray", "a", "=", "getContext", "(", ")", ".", "obtainStyledAttributes", "(", "null", ",", "R", ".", "styleable", ".", "SherlockActionBar", ",", "R", ".", "attr", ".", "actionBarStyle", ",", "0", ")", ";", "setContentHeight", "(", "a", ".", "getLayoutDimension", "(", "R", ".", "styleable", ".", "SherlockActionBar_height", ",", "0", ")", ")", ";", "a", ".", "recycle", "(", ")", ";", "}", "public", "void", "animateToVisibility", "(", "int", "visibility", ")", "{", "if", "(", "mVisibilityAnim", "!=", "null", ")", "{", "mVisibilityAnim", ".", "cancel", "(", ")", ";", "}", "if", "(", "visibility", "==", "VISIBLE", ")", "{", "if", "(", "getVisibility", "(", ")", "!=", "VISIBLE", ")", "{", "setAlpha", "(", "0", ")", ";", "}", "ObjectAnimator", "anim", "=", "ObjectAnimator", ".", "ofFloat", "(", "this", ",", "\"alpha\"", ",", "1", ")", ";", "anim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "anim", ".", "setInterpolator", "(", "sAlphaInterpolator", ")", ";", "anim", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "anim", ".", "start", "(", ")", ";", "}", "else", "{", "ObjectAnimator", "anim", "=", "ObjectAnimator", ".", "ofFloat", "(", "this", ",", "\"alpha\"", ",", "0", ")", ";", "anim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "anim", ".", "setInterpolator", "(", "sAlphaInterpolator", ")", ";", "anim", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "anim", ".", "start", "(", ")", ";", "}", "}", "public", "void", "animateToTab", "(", "final", "int", "position", ")", "{", "final", "View", "tabView", "=", "mTabLayout", ".", "getChildAt", "(", "position", ")", ";", "if", "(", "mTabSelector", "!=", "null", ")", "{", "removeCallbacks", "(", "mTabSelector", ")", ";", "}", "mTabSelector", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "final", "int", "scrollPos", "=", "tabView", ".", "getLeft", "(", ")", "-", "(", "getWidth", "(", ")", "-", "tabView", ".", "getWidth", "(", ")", ")", "/", "2", ";", "smoothScrollTo", "(", "scrollPos", ",", "0", ")", ";", "mTabSelector", "=", "null", ";", "}", "}", ";", "post", "(", "mTabSelector", ")", ";", "}", "@", "Override", "public", "void", "onAttachedToWindow", "(", ")", "{", "super", ".", "onAttachedToWindow", "(", ")", ";", "if", "(", "mTabSelector", "!=", "null", ")", "{", "post", "(", "mTabSelector", ")", ";", "}", "}", "@", "Override", "public", "void", "onDetachedFromWindow", "(", ")", "{", "super", ".", "onDetachedFromWindow", "(", ")", ";", "if", "(", "mTabSelector", "!=", "null", ")", "{", "removeCallbacks", "(", "mTabSelector", ")", ";", "}", "}", "private", "TabView", "createTabView", "(", "ActionBar", ".", "Tab", "tab", ",", "boolean", "forAdapter", ")", "{", "final", "TabView", "tabView", "=", "(", "TabView", ")", "mInflater", ".", "inflate", "(", "R", ".", "layout", ".", "abs__action_bar_tab", ",", "null", ")", ";", "tabView", ".", "init", "(", "this", ",", "tab", ",", "forAdapter", ")", ";", "if", "(", "forAdapter", ")", "{", "tabView", ".", "setBackgroundDrawable", "(", "null", ")", ";", "tabView", ".", "setLayoutParams", "(", "new", "ListView", ".", "LayoutParams", "(", "ListView", ".", "LayoutParams", ".", "MATCH_PARENT", ",", "mContentHeight", ")", ")", ";", "}", "else", "{", "tabView", ".", "setFocusable", "(", "true", ")", ";", "if", "(", "mTabClickListener", "==", "null", ")", "{", "mTabClickListener", "=", "new", "TabClickListener", "(", ")", ";", "}", "tabView", ".", "setOnClickListener", "(", "mTabClickListener", ")", ";", "}", "return", "tabView", ";", "}", "public", "void", "addTab", "(", "ActionBar", ".", "Tab", "tab", ",", "boolean", "setSelected", ")", "{", "TabView", "tabView", "=", "createTabView", "(", "tab", ",", "false", ")", ";", "mTabLayout", ".", "addView", "(", "tabView", ",", "new", "IcsLinearLayout", ".", "LayoutParams", "(", "0", ",", "LayoutParams", ".", "MATCH_PARENT", ",", "1", ")", ")", ";", "if", "(", "mTabSpinner", "!=", "null", ")", "{", "(", "(", "TabAdapter", ")", "mTabSpinner", ".", "getAdapter", "(", ")", ")", ".", "notifyDataSetChanged", "(", ")", ";", "}", "if", "(", "setSelected", ")", "{", "tabView", ".", "setSelected", "(", "true", ")", ";", "}", "if", "(", "mAllowCollapse", ")", "{", "requestLayout", "(", ")", ";", "}", "}", "public", "void", "addTab", "(", "ActionBar", ".", "Tab", "tab", ",", "int", "position", ",", "boolean", "setSelected", ")", "{", "final", "TabView", "tabView", "=", "createTabView", "(", "tab", ",", "false", ")", ";", "mTabLayout", ".", "addView", "(", "tabView", ",", "position", ",", "new", "IcsLinearLayout", ".", "LayoutParams", "(", "0", ",", "LayoutParams", ".", "MATCH_PARENT", ",", "1", ")", ")", ";", "if", "(", "mTabSpinner", "!=", "null", ")", "{", "(", "(", "TabAdapter", ")", "mTabSpinner", ".", "getAdapter", "(", ")", ")", ".", "notifyDataSetChanged", "(", ")", ";", "}", "if", "(", "setSelected", ")", "{", "tabView", ".", "setSelected", "(", "true", ")", ";", "}", "if", "(", "mAllowCollapse", ")", "{", "requestLayout", "(", ")", ";", "}", "}", "public", "void", "updateTab", "(", "int", "position", ")", "{", "(", "(", "TabView", ")", "mTabLayout", ".", "getChildAt", "(", "position", ")", ")", ".", "update", "(", ")", ";", "if", "(", "mTabSpinner", "!=", "null", ")", "{", "(", "(", "TabAdapter", ")", "mTabSpinner", ".", "getAdapter", "(", ")", ")", ".", "notifyDataSetChanged", "(", ")", ";", "}", "if", "(", "mAllowCollapse", ")", "{", "requestLayout", "(", ")", ";", "}", "}", "public", "void", "removeTabAt", "(", "int", "position", ")", "{", "mTabLayout", ".", "removeViewAt", "(", "position", ")", ";", "if", "(", "mTabSpinner", "!=", "null", ")", "{", "(", "(", "TabAdapter", ")", "mTabSpinner", ".", "getAdapter", "(", ")", ")", ".", "notifyDataSetChanged", "(", ")", ";", "}", "if", "(", "mAllowCollapse", ")", "{", "requestLayout", "(", ")", ";", "}", "}", "public", "void", "removeAllTabs", "(", ")", "{", "mTabLayout", ".", "removeAllViews", "(", ")", ";", "if", "(", "mTabSpinner", "!=", "null", ")", "{", "(", "(", "TabAdapter", ")", "mTabSpinner", ".", "getAdapter", "(", ")", ")", ".", "notifyDataSetChanged", "(", ")", ";", "}", "if", "(", "mAllowCollapse", ")", "{", "requestLayout", "(", ")", ";", "}", "}", "@", "Override", "public", "void", "onItemSelected", "(", "IcsAdapterView", "<", "?", ">", "parent", ",", "View", "view", ",", "int", "position", ",", "long", "id", ")", "{", "TabView", "tabView", "=", "(", "TabView", ")", "view", ";", "tabView", ".", "getTab", "(", ")", ".", "select", "(", ")", ";", "}", "@", "Override", "public", "void", "onNothingSelected", "(", "IcsAdapterView", "<", "?", ">", "parent", ")", "{", "}", "public", "static", "class", "TabView", "extends", "LinearLayout", "{", "private", "ScrollingTabContainerView", "mParent", ";", "private", "ActionBar", ".", "Tab", "mTab", ";", "private", "CapitalizingTextView", "mTextView", ";", "private", "ImageView", "mIconView", ";", "private", "View", "mCustomView", ";", "public", "TabView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "}", "public", "void", "init", "(", "ScrollingTabContainerView", "parent", ",", "ActionBar", ".", "Tab", "tab", ",", "boolean", "forList", ")", "{", "mParent", "=", "parent", ";", "mTab", "=", "tab", ";", "if", "(", "forList", ")", "{", "setGravity", "(", "Gravity", ".", "LEFT", "|", "Gravity", ".", "CENTER_VERTICAL", ")", ";", "}", "update", "(", ")", ";", "}", "public", "void", "bindTab", "(", "ActionBar", ".", "Tab", "tab", ")", "{", "mTab", "=", "tab", ";", "update", "(", ")", ";", "}", "@", "Override", "public", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "super", ".", "onMeasure", "(", "widthMeasureSpec", ",", "heightMeasureSpec", ")", ";", "if", "(", "mParent", ".", "mMaxTabWidth", ">", "0", "&&", "getMeasuredWidth", "(", ")", ">", "mParent", ".", "mMaxTabWidth", ")", "{", "super", ".", "onMeasure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "mParent", ".", "mMaxTabWidth", ",", "MeasureSpec", ".", "EXACTLY", ")", ",", "heightMeasureSpec", ")", ";", "}", "}", "public", "void", "update", "(", ")", "{", "final", "ActionBar", ".", "Tab", "tab", "=", "mTab", ";", "final", "View", "custom", "=", "tab", ".", "getCustomView", "(", ")", ";", "if", "(", "custom", "!=", "null", ")", "{", "final", "ViewParent", "customParent", "=", "custom", ".", "getParent", "(", ")", ";", "if", "(", "customParent", "!=", "this", ")", "{", "if", "(", "customParent", "!=", "null", ")", "(", "(", "ViewGroup", ")", "customParent", ")", ".", "removeView", "(", "custom", ")", ";", "addView", "(", "custom", ")", ";", "}", "mCustomView", "=", "custom", ";", "if", "(", "mTextView", "!=", "null", ")", "mTextView", ".", "setVisibility", "(", "GONE", ")", ";", "if", "(", "mIconView", "!=", "null", ")", "{", "mIconView", ".", "setVisibility", "(", "GONE", ")", ";", "mIconView", ".", "setImageDrawable", "(", "null", ")", ";", "}", "}", "else", "{", "if", "(", "mCustomView", "!=", "null", ")", "{", "removeView", "(", "mCustomView", ")", ";", "mCustomView", "=", "null", ";", "}", "final", "Drawable", "icon", "=", "tab", ".", "getIcon", "(", ")", ";", "final", "CharSequence", "text", "=", "tab", ".", "getText", "(", ")", ";", "if", "(", "icon", "!=", "null", ")", "{", "if", "(", "mIconView", "==", "null", ")", "{", "ImageView", "iconView", "=", "new", "ImageView", "(", "getContext", "(", ")", ")", ";", "LayoutParams", "lp", "=", "new", "LayoutParams", "(", "LayoutParams", ".", "WRAP_CONTENT", ",", "LayoutParams", ".", "WRAP_CONTENT", ")", ";", "lp", ".", "gravity", "=", "Gravity", ".", "CENTER_VERTICAL", ";", "iconView", ".", "setLayoutParams", "(", "lp", ")", ";", "addView", "(", "iconView", ",", "0", ")", ";", "mIconView", "=", "iconView", ";", "}", "mIconView", ".", "setImageDrawable", "(", "icon", ")", ";", "mIconView", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "else", "if", "(", "mIconView", "!=", "null", ")", "{", "mIconView", ".", "setVisibility", "(", "GONE", ")", ";", "mIconView", ".", "setImageDrawable", "(", "null", ")", ";", "}", "if", "(", "text", "!=", "null", ")", "{", "if", "(", "mTextView", "==", "null", ")", "{", "CapitalizingTextView", "textView", "=", "new", "CapitalizingTextView", "(", "getContext", "(", ")", ",", "null", ",", "R", ".", "attr", ".", "actionBarTabTextStyle", ")", ";", "textView", ".", "setEllipsize", "(", "TruncateAt", ".", "END", ")", ";", "LayoutParams", "lp", "=", "new", "LayoutParams", "(", "LayoutParams", ".", "WRAP_CONTENT", ",", "LayoutParams", ".", "WRAP_CONTENT", ")", ";", "lp", ".", "gravity", "=", "Gravity", ".", "CENTER_VERTICAL", ";", "textView", ".", "setLayoutParams", "(", "lp", ")", ";", "addView", "(", "textView", ")", ";", "mTextView", "=", "textView", ";", "}", "mTextView", ".", "setTextCompat", "(", "text", ")", ";", "mTextView", ".", "setVisibility", "(", "VISIBLE", ")", ";", "}", "else", "if", "(", "mTextView", "!=", "null", ")", "{", "mTextView", ".", "setVisibility", "(", "GONE", ")", ";", "mTextView", ".", "setText", "(", "null", ")", ";", "}", "if", "(", "mIconView", "!=", "null", ")", "{", "mIconView", ".", "setContentDescription", "(", "tab", ".", "getContentDescription", "(", ")", ")", ";", "}", "}", "}", "public", "ActionBar", ".", "Tab", "getTab", "(", ")", "{", "return", "mTab", ";", "}", "}", "private", "class", "TabAdapter", "extends", "BaseAdapter", "{", "@", "Override", "public", "int", "getCount", "(", ")", "{", "return", "mTabLayout", ".", "getChildCount", "(", ")", ";", "}", "@", "Override", "public", "Object", "getItem", "(", "int", "position", ")", "{", "return", "(", "(", "TabView", ")", "mTabLayout", ".", "getChildAt", "(", "position", ")", ")", ".", "getTab", "(", ")", ";", "}", "@", "Override", "public", "long", "getItemId", "(", "int", "position", ")", "{", "return", "position", ";", "}", "@", "Override", "public", "View", "getView", "(", "int", "position", ",", "View", "convertView", ",", "ViewGroup", "parent", ")", "{", "if", "(", "convertView", "==", "null", ")", "{", "convertView", "=", "createTabView", "(", "(", "ActionBar", ".", "Tab", ")", "getItem", "(", "position", ")", ",", "true", ")", ";", "}", "else", "{", "(", "(", "TabView", ")", "convertView", ")", ".", "bindTab", "(", "(", "ActionBar", ".", "Tab", ")", "getItem", "(", "position", ")", ")", ";", "}", "return", "convertView", ";", "}", "}", "private", "class", "TabClickListener", "implements", "OnClickListener", "{", "public", "void", "onClick", "(", "View", "view", ")", "{", "TabView", "tabView", "=", "(", "TabView", ")", "view", ";", "tabView", ".", "getTab", "(", ")", ".", "select", "(", ")", ";", "final", "int", "tabCount", "=", "mTabLayout", ".", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tabCount", ";", "i", "++", ")", "{", "final", "View", "child", "=", "mTabLayout", ".", "getChildAt", "(", "i", ")", ";", "child", ".", "setSelected", "(", "child", "==", "view", ")", ";", "}", "}", "}", "protected", "class", "VisibilityAnimListener", "implements", "Animator", ".", "AnimatorListener", "{", "private", "boolean", "mCanceled", "=", "false", ";", "private", "int", "mFinalVisibility", ";", "public", "VisibilityAnimListener", "withFinalVisibility", "(", "int", "visibility", ")", "{", "mFinalVisibility", "=", "visibility", ";", "return", "this", ";", "}", "@", "Override", "public", "void", "onAnimationStart", "(", "Animator", "animation", ")", "{", "setVisibility", "(", "VISIBLE", ")", ";", "mVisibilityAnim", "=", "animation", ";", "mCanceled", "=", "false", ";", "}", "@", "Override", "public", "void", "onAnimationEnd", "(", "Animator", "animation", ")", "{", "if", "(", "mCanceled", ")", "return", ";", "mVisibilityAnim", "=", "null", ";", "setVisibility", "(", "mFinalVisibility", ")", ";", "}", "@", "Override", "public", "void", "onAnimationCancel", "(", "Animator", "animation", ")", "{", "mCanceled", "=", "true", ";", "}", "@", "Override", "public", "void", "onAnimationRepeat", "(", "Animator", "animation", ")", "{", "}", "}", "}", "</s>" ]
8,996
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "database", ".", "DataSetObserver", ";", "import", "android", ".", "graphics", ".", "Rect", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "os", ".", "Parcel", ";", "import", "android", ".", "os", ".", "Parcelable", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "util", ".", "SparseArray", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "widget", ".", "SpinnerAdapter", ";", "public", "abstract", "class", "IcsAbsSpinner", "extends", "IcsAdapterView", "<", "SpinnerAdapter", ">", "{", "private", "static", "final", "boolean", "IS_HONEYCOMB", "=", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "HONEYCOMB", ";", "SpinnerAdapter", "mAdapter", ";", "int", "mHeightMeasureSpec", ";", "int", "mWidthMeasureSpec", ";", "boolean", "mBlockLayoutRequests", ";", "int", "mSelectionLeftPadding", "=", "0", ";", "int", "mSelectionTopPadding", "=", "0", ";", "int", "mSelectionRightPadding", "=", "0", ";", "int", "mSelectionBottomPadding", "=", "0", ";", "final", "Rect", "mSpinnerPadding", "=", "new", "Rect", "(", ")", ";", "final", "RecycleBin", "mRecycler", "=", "new", "RecycleBin", "(", ")", ";", "private", "DataSetObserver", "mDataSetObserver", ";", "private", "Rect", "mTouchFrame", ";", "public", "IcsAbsSpinner", "(", "Context", "context", ")", "{", "super", "(", "context", ")", ";", "initAbsSpinner", "(", ")", ";", "}", "public", "IcsAbsSpinner", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "this", "(", "context", ",", "attrs", ",", "0", ")", ";", "}", "public", "IcsAbsSpinner", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyle", ")", "{", "super", "(", "context", ",", "attrs", ",", "defStyle", ")", ";", "initAbsSpinner", "(", ")", ";", "}", "private", "void", "initAbsSpinner", "(", ")", "{", "setFocusable", "(", "true", ")", ";", "setWillNotDraw", "(", "false", ")", ";", "}", "@", "Override", "public", "void", "setAdapter", "(", "SpinnerAdapter", "adapter", ")", "{", "if", "(", "null", "!=", "mAdapter", ")", "{", "mAdapter", ".", "unregisterDataSetObserver", "(", "mDataSetObserver", ")", ";", "resetList", "(", ")", ";", "}", "mAdapter", "=", "adapter", ";", "mOldSelectedPosition", "=", "INVALID_POSITION", ";", "mOldSelectedRowId", "=", "INVALID_ROW_ID", ";", "if", "(", "mAdapter", "!=", "null", ")", "{", "mOldItemCount", "=", "mItemCount", ";", "mItemCount", "=", "mAdapter", ".", "getCount", "(", ")", ";", "checkFocus", "(", ")", ";", "mDataSetObserver", "=", "new", "AdapterDataSetObserver", "(", ")", ";", "mAdapter", ".", "registerDataSetObserver", "(", "mDataSetObserver", ")", ";", "int", "position", "=", "mItemCount", ">", "0", "?", "0", ":", "INVALID_POSITION", ";", "setSelectedPositionInt", "(", "position", ")", ";", "setNextSelectedPositionInt", "(", "position", ")", ";", "if", "(", "mItemCount", "==", "0", ")", "{", "checkSelectionChanged", "(", ")", ";", "}", "}", "else", "{", "checkFocus", "(", ")", ";", "resetList", "(", ")", ";", "checkSelectionChanged", "(", ")", ";", "}", "requestLayout", "(", ")", ";", "}", "void", "resetList", "(", ")", "{", "mDataChanged", "=", "false", ";", "mNeedSync", "=", "false", ";", "removeAllViewsInLayout", "(", ")", ";", "mOldSelectedPosition", "=", "INVALID_POSITION", ";", "mOldSelectedRowId", "=", "INVALID_ROW_ID", ";", "setSelectedPositionInt", "(", "INVALID_POSITION", ")", ";", "setNextSelectedPositionInt", "(", "INVALID_POSITION", ")", ";", "invalidate", "(", ")", ";", "}", "@", "Override", "protected", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "int", "widthMode", "=", "MeasureSpec", ".", "getMode", "(", "widthMeasureSpec", ")", ";", "int", "widthSize", ";", "int", "heightSize", ";", "final", "int", "mPaddingLeft", "=", "getPaddingLeft", "(", ")", ";", "final", "int", "mPaddingTop", "=", "getPaddingTop", "(", ")", ";", "final", "int", "mPaddingRight", "=", "getPaddingRight", "(", ")", ";", "final", "int", "mPaddingBottom", "=", "getPaddingBottom", "(", ")", ";", "mSpinnerPadding", ".", "left", "=", "mPaddingLeft", ">", "mSelectionLeftPadding", "?", "mPaddingLeft", ":", "mSelectionLeftPadding", ";", "mSpinnerPadding", ".", "top", "=", "mPaddingTop", ">", "mSelectionTopPadding", "?", "mPaddingTop", ":", "mSelectionTopPadding", ";", "mSpinnerPadding", ".", "right", "=", "mPaddingRight", ">", "mSelectionRightPadding", "?", "mPaddingRight", ":", "mSelectionRightPadding", ";", "mSpinnerPadding", ".", "bottom", "=", "mPaddingBottom", ">", "mSelectionBottomPadding", "?", "mPaddingBottom", ":", "mSelectionBottomPadding", ";", "if", "(", "mDataChanged", ")", "{", "handleDataChanged", "(", ")", ";", "}", "int", "preferredHeight", "=", "0", ";", "int", "preferredWidth", "=", "0", ";", "boolean", "needsMeasuring", "=", "true", ";", "int", "selectedPosition", "=", "getSelectedItemPosition", "(", ")", ";", "if", "(", "selectedPosition", ">=", "0", "&&", "mAdapter", "!=", "null", "&&", "selectedPosition", "<", "mAdapter", ".", "getCount", "(", ")", ")", "{", "View", "view", "=", "mRecycler", ".", "get", "(", "selectedPosition", ")", ";", "if", "(", "view", "==", "null", ")", "{", "view", "=", "mAdapter", ".", "getView", "(", "selectedPosition", ",", "null", ",", "this", ")", ";", "}", "if", "(", "view", "!=", "null", ")", "{", "mRecycler", ".", "put", "(", "selectedPosition", ",", "view", ")", ";", "}", "if", "(", "view", "!=", "null", ")", "{", "if", "(", "view", ".", "getLayoutParams", "(", ")", "==", "null", ")", "{", "mBlockLayoutRequests", "=", "true", ";", "view", ".", "setLayoutParams", "(", "generateDefaultLayoutParams", "(", ")", ")", ";", "mBlockLayoutRequests", "=", "false", ";", "}", "measureChild", "(", "view", ",", "widthMeasureSpec", ",", "heightMeasureSpec", ")", ";", "preferredHeight", "=", "getChildHeight", "(", "view", ")", "+", "mSpinnerPadding", ".", "top", "+", "mSpinnerPadding", ".", "bottom", ";", "preferredWidth", "=", "getChildWidth", "(", "view", ")", "+", "mSpinnerPadding", ".", "left", "+", "mSpinnerPadding", ".", "right", ";", "needsMeasuring", "=", "false", ";", "}", "}", "if", "(", "needsMeasuring", ")", "{", "preferredHeight", "=", "mSpinnerPadding", ".", "top", "+", "mSpinnerPadding", ".", "bottom", ";", "if", "(", "widthMode", "==", "MeasureSpec", ".", "UNSPECIFIED", ")", "{", "preferredWidth", "=", "mSpinnerPadding", ".", "left", "+", "mSpinnerPadding", ".", "right", ";", "}", "}", "preferredHeight", "=", "Math", ".", "max", "(", "preferredHeight", ",", "getSuggestedMinimumHeight", "(", ")", ")", ";", "preferredWidth", "=", "Math", ".", "max", "(", "preferredWidth", ",", "getSuggestedMinimumWidth", "(", ")", ")", ";", "if", "(", "IS_HONEYCOMB", ")", "{", "heightSize", "=", "resolveSizeAndState", "(", "preferredHeight", ",", "heightMeasureSpec", ",", "0", ")", ";", "widthSize", "=", "resolveSizeAndState", "(", "preferredWidth", ",", "widthMeasureSpec", ",", "0", ")", ";", "}", "else", "{", "heightSize", "=", "resolveSize", "(", "preferredHeight", ",", "heightMeasureSpec", ")", ";", "widthSize", "=", "resolveSize", "(", "preferredWidth", ",", "widthMeasureSpec", ")", ";", "}", "setMeasuredDimension", "(", "widthSize", ",", "heightSize", ")", ";", "mHeightMeasureSpec", "=", "heightMeasureSpec", ";", "mWidthMeasureSpec", "=", "widthMeasureSpec", ";", "}", "int", "getChildHeight", "(", "View", "child", ")", "{", "return", "child", ".", "getMeasuredHeight", "(", ")", ";", "}", "int", "getChildWidth", "(", "View", "child", ")", "{", "return", "child", ".", "getMeasuredWidth", "(", ")", ";", "}", "@", "Override", "protected", "ViewGroup", ".", "LayoutParams", "generateDefaultLayoutParams", "(", ")", "{", "return", "new", "ViewGroup", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ",", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ")", ";", "}", "void", "recycleAllViews", "(", ")", "{", "final", "int", "childCount", "=", "getChildCount", "(", ")", ";", "final", "IcsAbsSpinner", ".", "RecycleBin", "recycleBin", "=", "mRecycler", ";", "final", "int", "position", "=", "mFirstPosition", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "childCount", ";", "i", "++", ")", "{", "View", "v", "=", "getChildAt", "(", "i", ")", ";", "int", "index", "=", "position", "+", "i", ";", "recycleBin", ".", "put", "(", "index", ",", "v", ")", ";", "}", "}", "public", "void", "setSelection", "(", "int", "position", ",", "boolean", "animate", ")", "{", "boolean", "shouldAnimate", "=", "animate", "&&", "mFirstPosition", "<=", "position", "&&", "position", "<=", "mFirstPosition", "+", "getChildCount", "(", ")", "-", "1", ";", "setSelectionInt", "(", "position", ",", "shouldAnimate", ")", ";", "}", "@", "Override", "public", "void", "setSelection", "(", "int", "position", ")", "{", "setNextSelectedPositionInt", "(", "position", ")", ";", "requestLayout", "(", ")", ";", "invalidate", "(", ")", ";", "}", "void", "setSelectionInt", "(", "int", "position", ",", "boolean", "animate", ")", "{", "if", "(", "position", "!=", "mOldSelectedPosition", ")", "{", "mBlockLayoutRequests", "=", "true", ";", "int", "delta", "=", "position", "-", "mSelectedPosition", ";", "setNextSelectedPositionInt", "(", "position", ")", ";", "layout", "(", "delta", ",", "animate", ")", ";", "mBlockLayoutRequests", "=", "false", ";", "}", "}", "abstract", "void", "layout", "(", "int", "delta", ",", "boolean", "animate", ")", ";", "@", "Override", "public", "View", "getSelectedView", "(", ")", "{", "if", "(", "mItemCount", ">", "0", "&&", "mSelectedPosition", ">=", "0", ")", "{", "return", "getChildAt", "(", "mSelectedPosition", "-", "mFirstPosition", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "@", "Override", "public", "void", "requestLayout", "(", ")", "{", "if", "(", "!", "mBlockLayoutRequests", ")", "{", "super", ".", "requestLayout", "(", ")", ";", "}", "}", "@", "Override", "public", "SpinnerAdapter", "getAdapter", "(", ")", "{", "return", "mAdapter", ";", "}", "@", "Override", "public", "int", "getCount", "(", ")", "{", "return", "mItemCount", ";", "}", "public", "int", "pointToPosition", "(", "int", "x", ",", "int", "y", ")", "{", "Rect", "frame", "=", "mTouchFrame", ";", "if", "(", "frame", "==", "null", ")", "{", "mTouchFrame", "=", "new", "Rect", "(", ")", ";", "frame", "=", "mTouchFrame", ";", "}", "final", "int", "count", "=", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "count", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "View", "child", "=", "getChildAt", "(", "i", ")", ";", "if", "(", "child", ".", "getVisibility", "(", ")", "==", "View", ".", "VISIBLE", ")", "{", "child", ".", "getHitRect", "(", "frame", ")", ";", "if", "(", "frame", ".", "contains", "(", "x", ",", "y", ")", ")", "{", "return", "mFirstPosition", "+", "i", ";", "}", "}", "}", "return", "INVALID_POSITION", ";", "}", "static", "class", "SavedState", "extends", "BaseSavedState", "{", "long", "selectedId", ";", "int", "position", ";", "SavedState", "(", "Parcelable", "superState", ")", "{", "super", "(", "superState", ")", ";", "}", "private", "SavedState", "(", "Parcel", "in", ")", "{", "super", "(", "in", ")", ";", "selectedId", "=", "in", ".", "readLong", "(", ")", ";", "position", "=", "in", ".", "readInt", "(", ")", ";", "}", "@", "Override", "public", "void", "writeToParcel", "(", "Parcel", "out", ",", "int", "flags", ")", "{", "super", ".", "writeToParcel", "(", "out", ",", "flags", ")", ";", "out", ".", "writeLong", "(", "selectedId", ")", ";", "out", ".", "writeInt", "(", "position", ")", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "Integer", ".", "toHexString", "(", "System", ".", "identityHashCode", "(", "this", ")", ")", "+", "\"", "selectedId=\"", "+", "selectedId", "+", "\"", "position=\"", "+", "position", "+", "\"}\"", ";", "}", "public", "static", "final", "Parcelable", ".", "Creator", "<", "SavedState", ">", "CREATOR", "=", "new", "Parcelable", ".", "Creator", "<", "SavedState", ">", "(", ")", "{", "public", "SavedState", "createFromParcel", "(", "Parcel", "in", ")", "{", "return", "new", "SavedState", "(", "in", ")", ";", "}", "public", "SavedState", "[", "]", "newArray", "(", "int", "size", ")", "{", "return", "new", "SavedState", "[", "size", "]", ";", "}", "}", ";", "}", "@", "Override", "public", "Parcelable", "onSaveInstanceState", "(", ")", "{", "Parcelable", "superState", "=", "super", ".", "onSaveInstanceState", "(", ")", ";", "SavedState", "ss", "=", "new", "SavedState", "(", "superState", ")", ";", "ss", ".", "selectedId", "=", "getSelectedItemId", "(", ")", ";", "if", "(", "ss", ".", "selectedId", ">=", "0", ")", "{", "ss", ".", "position", "=", "getSelectedItemPosition", "(", ")", ";", "}", "else", "{", "ss", ".", "position", "=", "INVALID_POSITION", ";", "}", "return", "ss", ";", "}", "@", "Override", "public", "void", "onRestoreInstanceState", "(", "Parcelable", "state", ")", "{", "SavedState", "ss", "=", "(", "SavedState", ")", "state", ";", "super", ".", "onRestoreInstanceState", "(", "ss", ".", "getSuperState", "(", ")", ")", ";", "if", "(", "ss", ".", "selectedId", ">=", "0", ")", "{", "mDataChanged", "=", "true", ";", "mNeedSync", "=", "true", ";", "mSyncRowId", "=", "ss", ".", "selectedId", ";", "mSyncPosition", "=", "ss", ".", "position", ";", "mSyncMode", "=", "SYNC_SELECTED_POSITION", ";", "requestLayout", "(", ")", ";", "}", "}", "class", "RecycleBin", "{", "private", "final", "SparseArray", "<", "View", ">", "mScrapHeap", "=", "new", "SparseArray", "<", "View", ">", "(", ")", ";", "public", "void", "put", "(", "int", "position", ",", "View", "v", ")", "{", "mScrapHeap", ".", "put", "(", "position", ",", "v", ")", ";", "}", "View", "get", "(", "int", "position", ")", "{", "View", "result", "=", "mScrapHeap", ".", "get", "(", "position", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "mScrapHeap", ".", "delete", "(", "position", ")", ";", "}", "else", "{", "}", "return", "result", ";", "}", "void", "clear", "(", ")", "{", "final", "SparseArray", "<", "View", ">", "scrapHeap", "=", "mScrapHeap", ";", "final", "int", "count", "=", "scrapHeap", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "final", "View", "view", "=", "scrapHeap", ".", "valueAt", "(", "i", ")", ";", "if", "(", "view", "!=", "null", ")", "{", "removeDetachedView", "(", "view", ",", "true", ")", ";", "}", "}", "scrapHeap", ".", "clear", "(", ")", ";", "}", "}", "}", "</s>" ]
8,997
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "Configuration", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "animation", ".", "DecelerateInterpolator", ";", "import", "android", ".", "view", ".", "animation", ".", "Interpolator", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "animation", ".", "Animator", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "animation", ".", "AnimatorSet", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "animation", ".", "ObjectAnimator", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "view", ".", "NineViewGroup", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "ActionMenuPresenter", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "view", ".", "menu", ".", "ActionMenuView", ";", "import", "static", "com", ".", "actionbarsherlock", ".", "internal", ".", "ResourcesCompat", ".", "getResources_getBoolean", ";", "public", "abstract", "class", "AbsActionBarView", "extends", "NineViewGroup", "{", "protected", "ActionMenuView", "mMenuView", ";", "protected", "ActionMenuPresenter", "mActionMenuPresenter", ";", "protected", "ActionBarContainer", "mSplitView", ";", "protected", "boolean", "mSplitActionBar", ";", "protected", "boolean", "mSplitWhenNarrow", ";", "protected", "int", "mContentHeight", ";", "final", "Context", "mContext", ";", "protected", "Animator", "mVisibilityAnim", ";", "protected", "final", "VisibilityAnimListener", "mVisAnimListener", "=", "new", "VisibilityAnimListener", "(", ")", ";", "private", "static", "final", "Interpolator", "sAlphaInterpolator", "=", "new", "DecelerateInterpolator", "(", ")", ";", "private", "static", "final", "int", "FADE_DURATION", "=", "200", ";", "public", "AbsActionBarView", "(", "Context", "context", ")", "{", "super", "(", "context", ")", ";", "mContext", "=", "context", ";", "}", "public", "AbsActionBarView", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "mContext", "=", "context", ";", "}", "public", "AbsActionBarView", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyle", ")", "{", "super", "(", "context", ",", "attrs", ",", "defStyle", ")", ";", "mContext", "=", "context", ";", "}", "@", "Override", "public", "void", "onConfigurationChanged", "(", "Configuration", "newConfig", ")", "{", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", ">=", "Build", ".", "VERSION_CODES", ".", "FROYO", ")", "{", "super", ".", "onConfigurationChanged", "(", "newConfig", ")", ";", "}", "else", "if", "(", "mMenuView", "!=", "null", ")", "{", "mMenuView", ".", "onConfigurationChanged", "(", "newConfig", ")", ";", "}", "TypedArray", "a", "=", "getContext", "(", ")", ".", "obtainStyledAttributes", "(", "null", ",", "R", ".", "styleable", ".", "SherlockActionBar", ",", "R", ".", "attr", ".", "actionBarStyle", ",", "0", ")", ";", "setContentHeight", "(", "a", ".", "getLayoutDimension", "(", "R", ".", "styleable", ".", "SherlockActionBar_height", ",", "0", ")", ")", ";", "a", ".", "recycle", "(", ")", ";", "if", "(", "mSplitWhenNarrow", ")", "{", "setSplitActionBar", "(", "getResources_getBoolean", "(", "getContext", "(", ")", ",", "R", ".", "bool", ".", "abs__split_action_bar_is_narrow", ")", ")", ";", "}", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "mActionMenuPresenter", ".", "onConfigurationChanged", "(", "newConfig", ")", ";", "}", "}", "public", "void", "setSplitActionBar", "(", "boolean", "split", ")", "{", "mSplitActionBar", "=", "split", ";", "}", "public", "void", "setSplitWhenNarrow", "(", "boolean", "splitWhenNarrow", ")", "{", "mSplitWhenNarrow", "=", "splitWhenNarrow", ";", "}", "public", "void", "setContentHeight", "(", "int", "height", ")", "{", "mContentHeight", "=", "height", ";", "requestLayout", "(", ")", ";", "}", "public", "int", "getContentHeight", "(", ")", "{", "return", "mContentHeight", ";", "}", "public", "void", "setSplitView", "(", "ActionBarContainer", "splitView", ")", "{", "mSplitView", "=", "splitView", ";", "}", "public", "int", "getAnimatedVisibility", "(", ")", "{", "if", "(", "mVisibilityAnim", "!=", "null", ")", "{", "return", "mVisAnimListener", ".", "mFinalVisibility", ";", "}", "return", "getVisibility", "(", ")", ";", "}", "public", "void", "animateToVisibility", "(", "int", "visibility", ")", "{", "if", "(", "mVisibilityAnim", "!=", "null", ")", "{", "mVisibilityAnim", ".", "cancel", "(", ")", ";", "}", "if", "(", "visibility", "==", "VISIBLE", ")", "{", "if", "(", "getVisibility", "(", ")", "!=", "VISIBLE", ")", "{", "setAlpha", "(", "0", ")", ";", "if", "(", "mSplitView", "!=", "null", "&&", "mMenuView", "!=", "null", ")", "{", "mMenuView", ".", "setAlpha", "(", "0", ")", ";", "}", "}", "ObjectAnimator", "anim", "=", "ObjectAnimator", ".", "ofFloat", "(", "this", ",", "\"alpha\"", ",", "1", ")", ";", "anim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "anim", ".", "setInterpolator", "(", "sAlphaInterpolator", ")", ";", "if", "(", "mSplitView", "!=", "null", "&&", "mMenuView", "!=", "null", ")", "{", "AnimatorSet", "set", "=", "new", "AnimatorSet", "(", ")", ";", "ObjectAnimator", "splitAnim", "=", "ObjectAnimator", ".", "ofFloat", "(", "mMenuView", ",", "\"alpha\"", ",", "1", ")", ";", "splitAnim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "set", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "set", ".", "play", "(", "anim", ")", ".", "with", "(", "splitAnim", ")", ";", "set", ".", "start", "(", ")", ";", "}", "else", "{", "anim", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "anim", ".", "start", "(", ")", ";", "}", "}", "else", "{", "ObjectAnimator", "anim", "=", "ObjectAnimator", ".", "ofFloat", "(", "this", ",", "\"alpha\"", ",", "0", ")", ";", "anim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "anim", ".", "setInterpolator", "(", "sAlphaInterpolator", ")", ";", "if", "(", "mSplitView", "!=", "null", "&&", "mMenuView", "!=", "null", ")", "{", "AnimatorSet", "set", "=", "new", "AnimatorSet", "(", ")", ";", "ObjectAnimator", "splitAnim", "=", "ObjectAnimator", ".", "ofFloat", "(", "mMenuView", ",", "\"alpha\"", ",", "0", ")", ";", "splitAnim", ".", "setDuration", "(", "FADE_DURATION", ")", ";", "set", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "set", ".", "play", "(", "anim", ")", ".", "with", "(", "splitAnim", ")", ";", "set", ".", "start", "(", ")", ";", "}", "else", "{", "anim", ".", "addListener", "(", "mVisAnimListener", ".", "withFinalVisibility", "(", "visibility", ")", ")", ";", "anim", ".", "start", "(", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "setVisibility", "(", "int", "visibility", ")", "{", "if", "(", "mVisibilityAnim", "!=", "null", ")", "{", "mVisibilityAnim", ".", "end", "(", ")", ";", "}", "super", ".", "setVisibility", "(", "visibility", ")", ";", "}", "public", "boolean", "showOverflowMenu", "(", ")", "{", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "return", "mActionMenuPresenter", ".", "showOverflowMenu", "(", ")", ";", "}", "return", "false", ";", "}", "public", "void", "postShowOverflowMenu", "(", ")", "{", "post", "(", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", "{", "showOverflowMenu", "(", ")", ";", "}", "}", ")", ";", "}", "public", "boolean", "hideOverflowMenu", "(", ")", "{", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "return", "mActionMenuPresenter", ".", "hideOverflowMenu", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "isOverflowMenuShowing", "(", ")", "{", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "return", "mActionMenuPresenter", ".", "isOverflowMenuShowing", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "isOverflowReserved", "(", ")", "{", "return", "mActionMenuPresenter", "!=", "null", "&&", "mActionMenuPresenter", ".", "isOverflowReserved", "(", ")", ";", "}", "public", "void", "dismissPopupMenus", "(", ")", "{", "if", "(", "mActionMenuPresenter", "!=", "null", ")", "{", "mActionMenuPresenter", ".", "dismissPopupMenus", "(", ")", ";", "}", "}", "protected", "int", "measureChildView", "(", "View", "child", ",", "int", "availableWidth", ",", "int", "childSpecHeight", ",", "int", "spacing", ")", "{", "child", ".", "measure", "(", "MeasureSpec", ".", "makeMeasureSpec", "(", "availableWidth", ",", "MeasureSpec", ".", "AT_MOST", ")", ",", "childSpecHeight", ")", ";", "availableWidth", "-=", "child", ".", "getMeasuredWidth", "(", ")", ";", "availableWidth", "-=", "spacing", ";", "return", "Math", ".", "max", "(", "0", ",", "availableWidth", ")", ";", "}", "protected", "int", "positionChild", "(", "View", "child", ",", "int", "x", ",", "int", "y", ",", "int", "contentHeight", ")", "{", "int", "childWidth", "=", "child", ".", "getMeasuredWidth", "(", ")", ";", "int", "childHeight", "=", "child", ".", "getMeasuredHeight", "(", ")", ";", "int", "childTop", "=", "y", "+", "(", "contentHeight", "-", "childHeight", ")", "/", "2", ";", "child", ".", "layout", "(", "x", ",", "childTop", ",", "x", "+", "childWidth", ",", "childTop", "+", "childHeight", ")", ";", "return", "childWidth", ";", "}", "protected", "int", "positionChildInverse", "(", "View", "child", ",", "int", "x", ",", "int", "y", ",", "int", "contentHeight", ")", "{", "int", "childWidth", "=", "child", ".", "getMeasuredWidth", "(", ")", ";", "int", "childHeight", "=", "child", ".", "getMeasuredHeight", "(", ")", ";", "int", "childTop", "=", "y", "+", "(", "contentHeight", "-", "childHeight", ")", "/", "2", ";", "child", ".", "layout", "(", "x", "-", "childWidth", ",", "childTop", ",", "x", ",", "childTop", "+", "childHeight", ")", ";", "return", "childWidth", ";", "}", "protected", "class", "VisibilityAnimListener", "implements", "Animator", ".", "AnimatorListener", "{", "private", "boolean", "mCanceled", "=", "false", ";", "int", "mFinalVisibility", ";", "public", "VisibilityAnimListener", "withFinalVisibility", "(", "int", "visibility", ")", "{", "mFinalVisibility", "=", "visibility", ";", "return", "this", ";", "}", "@", "Override", "public", "void", "onAnimationStart", "(", "Animator", "animation", ")", "{", "setVisibility", "(", "VISIBLE", ")", ";", "mVisibilityAnim", "=", "animation", ";", "mCanceled", "=", "false", ";", "}", "@", "Override", "public", "void", "onAnimationEnd", "(", "Animator", "animation", ")", "{", "if", "(", "mCanceled", ")", "return", ";", "mVisibilityAnim", "=", "null", ";", "setVisibility", "(", "mFinalVisibility", ")", ";", "if", "(", "mSplitView", "!=", "null", "&&", "mMenuView", "!=", "null", ")", "{", "mMenuView", ".", "setVisibility", "(", "mFinalVisibility", ")", ";", "}", "}", "@", "Override", "public", "void", "onAnimationCancel", "(", "Animator", "animation", ")", "{", "mCanceled", "=", "true", ";", "}", "@", "Override", "public", "void", "onAnimationRepeat", "(", "Animator", "animation", ")", "{", "}", "}", "}", "</s>" ]
8,998
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "TypedArray", ";", "import", "android", ".", "graphics", ".", "Canvas", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "com", ".", "actionbarsherlock", ".", "app", ".", "ActionBar", ";", "import", "com", ".", "actionbarsherlock", ".", "internal", ".", "nineoldandroids", ".", "widget", ".", "NineFrameLayout", ";", "public", "class", "ActionBarContainer", "extends", "NineFrameLayout", "{", "private", "boolean", "mIsTransitioning", ";", "private", "View", "mTabContainer", ";", "private", "ActionBarView", "mActionBarView", ";", "private", "Drawable", "mBackground", ";", "private", "Drawable", "mStackedBackground", ";", "private", "Drawable", "mSplitBackground", ";", "private", "boolean", "mIsSplit", ";", "private", "boolean", "mIsStacked", ";", "public", "ActionBarContainer", "(", "Context", "context", ")", "{", "this", "(", "context", ",", "null", ")", ";", "}", "public", "ActionBarContainer", "(", "Context", "context", ",", "AttributeSet", "attrs", ")", "{", "super", "(", "context", ",", "attrs", ")", ";", "setBackgroundDrawable", "(", "null", ")", ";", "TypedArray", "a", "=", "context", ".", "obtainStyledAttributes", "(", "attrs", ",", "R", ".", "styleable", ".", "SherlockActionBar", ")", ";", "mBackground", "=", "a", ".", "getDrawable", "(", "R", ".", "styleable", ".", "SherlockActionBar_background", ")", ";", "mStackedBackground", "=", "a", ".", "getDrawable", "(", "R", ".", "styleable", ".", "SherlockActionBar_backgroundStacked", ")", ";", "if", "(", "getId", "(", ")", "==", "R", ".", "id", ".", "abs__split_action_bar", ")", "{", "mIsSplit", "=", "true", ";", "mSplitBackground", "=", "a", ".", "getDrawable", "(", "R", ".", "styleable", ".", "SherlockActionBar_backgroundSplit", ")", ";", "}", "a", ".", "recycle", "(", ")", ";", "setWillNotDraw", "(", "mIsSplit", "?", "mSplitBackground", "==", "null", ":", "mBackground", "==", "null", "&&", "mStackedBackground", "==", "null", ")", ";", "}", "@", "Override", "public", "void", "onFinishInflate", "(", ")", "{", "super", ".", "onFinishInflate", "(", ")", ";", "mActionBarView", "=", "(", "ActionBarView", ")", "findViewById", "(", "R", ".", "id", ".", "abs__action_bar", ")", ";", "}", "public", "void", "setPrimaryBackground", "(", "Drawable", "bg", ")", "{", "mBackground", "=", "bg", ";", "invalidate", "(", ")", ";", "}", "public", "void", "setStackedBackground", "(", "Drawable", "bg", ")", "{", "mStackedBackground", "=", "bg", ";", "invalidate", "(", ")", ";", "}", "public", "void", "setSplitBackground", "(", "Drawable", "bg", ")", "{", "mSplitBackground", "=", "bg", ";", "invalidate", "(", ")", ";", "}", "public", "void", "setTransitioning", "(", "boolean", "isTransitioning", ")", "{", "mIsTransitioning", "=", "isTransitioning", ";", "setDescendantFocusability", "(", "isTransitioning", "?", "FOCUS_BLOCK_DESCENDANTS", ":", "FOCUS_AFTER_DESCENDANTS", ")", ";", "}", "@", "Override", "public", "boolean", "onInterceptTouchEvent", "(", "MotionEvent", "ev", ")", "{", "return", "mIsTransitioning", "||", "super", ".", "onInterceptTouchEvent", "(", "ev", ")", ";", "}", "@", "Override", "public", "boolean", "onTouchEvent", "(", "MotionEvent", "ev", ")", "{", "super", ".", "onTouchEvent", "(", "ev", ")", ";", "return", "true", ";", "}", "@", "Override", "public", "boolean", "onHoverEvent", "(", "MotionEvent", "ev", ")", "{", "super", ".", "onHoverEvent", "(", "ev", ")", ";", "return", "true", ";", "}", "public", "void", "setTabContainer", "(", "ScrollingTabContainerView", "tabView", ")", "{", "if", "(", "mTabContainer", "!=", "null", ")", "{", "removeView", "(", "mTabContainer", ")", ";", "}", "mTabContainer", "=", "tabView", ";", "if", "(", "tabView", "!=", "null", ")", "{", "addView", "(", "tabView", ")", ";", "final", "ViewGroup", ".", "LayoutParams", "lp", "=", "tabView", ".", "getLayoutParams", "(", ")", ";", "lp", ".", "width", "=", "LayoutParams", ".", "MATCH_PARENT", ";", "lp", ".", "height", "=", "LayoutParams", ".", "WRAP_CONTENT", ";", "tabView", ".", "setAllowCollapse", "(", "false", ")", ";", "}", "}", "public", "View", "getTabContainer", "(", ")", "{", "return", "mTabContainer", ";", "}", "@", "Override", "public", "void", "onDraw", "(", "Canvas", "canvas", ")", "{", "if", "(", "getWidth", "(", ")", "==", "0", "||", "getHeight", "(", ")", "==", "0", ")", "{", "return", ";", "}", "if", "(", "mIsSplit", ")", "{", "if", "(", "mSplitBackground", "!=", "null", ")", "mSplitBackground", ".", "draw", "(", "canvas", ")", ";", "}", "else", "{", "if", "(", "mBackground", "!=", "null", ")", "{", "mBackground", ".", "draw", "(", "canvas", ")", ";", "}", "if", "(", "mStackedBackground", "!=", "null", "&&", "mIsStacked", ")", "{", "mStackedBackground", ".", "draw", "(", "canvas", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "onMeasure", "(", "int", "widthMeasureSpec", ",", "int", "heightMeasureSpec", ")", "{", "super", ".", "onMeasure", "(", "widthMeasureSpec", ",", "heightMeasureSpec", ")", ";", "if", "(", "mActionBarView", "==", "null", ")", "return", ";", "final", "LayoutParams", "lp", "=", "(", "LayoutParams", ")", "mActionBarView", ".", "getLayoutParams", "(", ")", ";", "final", "int", "actionBarViewHeight", "=", "mActionBarView", ".", "isCollapsed", "(", ")", "?", "0", ":", "mActionBarView", ".", "getMeasuredHeight", "(", ")", "+", "lp", ".", "topMargin", "+", "lp", ".", "bottomMargin", ";", "if", "(", "mTabContainer", "!=", "null", "&&", "mTabContainer", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "final", "int", "mode", "=", "MeasureSpec", ".", "getMode", "(", "heightMeasureSpec", ")", ";", "if", "(", "mode", "==", "MeasureSpec", ".", "AT_MOST", ")", "{", "final", "int", "maxHeight", "=", "MeasureSpec", ".", "getSize", "(", "heightMeasureSpec", ")", ";", "setMeasuredDimension", "(", "getMeasuredWidth", "(", ")", ",", "Math", ".", "min", "(", "actionBarViewHeight", "+", "mTabContainer", ".", "getMeasuredHeight", "(", ")", ",", "maxHeight", ")", ")", ";", "}", "}", "}", "@", "Override", "public", "void", "onLayout", "(", "boolean", "changed", ",", "int", "l", ",", "int", "t", ",", "int", "r", ",", "int", "b", ")", "{", "super", ".", "onLayout", "(", "changed", ",", "l", ",", "t", ",", "r", ",", "b", ")", ";", "final", "boolean", "hasTabs", "=", "mTabContainer", "!=", "null", "&&", "mTabContainer", ".", "getVisibility", "(", ")", "!=", "GONE", ";", "if", "(", "mTabContainer", "!=", "null", "&&", "mTabContainer", ".", "getVisibility", "(", ")", "!=", "GONE", ")", "{", "final", "int", "containerHeight", "=", "getMeasuredHeight", "(", ")", ";", "final", "int", "tabHeight", "=", "mTabContainer", ".", "getMeasuredHeight", "(", ")", ";", "if", "(", "(", "mActionBarView", ".", "getDisplayOptions", "(", ")", "&", "ActionBar", ".", "DISPLAY_SHOW_HOME", ")", "==", "0", ")", "{", "final", "int", "count", "=", "getChildCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "final", "View", "child", "=", "getChildAt", "(", "i", ")", ";", "if", "(", "child", "==", "mTabContainer", ")", "continue", ";", "if", "(", "!", "mActionBarView", ".", "isCollapsed", "(", ")", ")", "{", "child", ".", "offsetTopAndBottom", "(", "tabHeight", ")", ";", "}", "}", "mTabContainer", ".", "layout", "(", "l", ",", "0", ",", "r", ",", "tabHeight", ")", ";", "}", "else", "{", "mTabContainer", ".", "layout", "(", "l", ",", "containerHeight", "-", "tabHeight", ",", "r", ",", "containerHeight", ")", ";", "}", "}", "boolean", "needsInvalidate", "=", "false", ";", "if", "(", "mIsSplit", ")", "{", "if", "(", "mSplitBackground", "!=", "null", ")", "{", "mSplitBackground", ".", "setBounds", "(", "0", ",", "0", ",", "getMeasuredWidth", "(", ")", ",", "getMeasuredHeight", "(", ")", ")", ";", "needsInvalidate", "=", "true", ";", "}", "}", "else", "{", "if", "(", "mBackground", "!=", "null", ")", "{", "mBackground", ".", "setBounds", "(", "mActionBarView", ".", "getLeft", "(", ")", ",", "mActionBarView", ".", "getTop", "(", ")", ",", "mActionBarView", ".", "getRight", "(", ")", ",", "mActionBarView", ".", "getBottom", "(", ")", ")", ";", "needsInvalidate", "=", "true", ";", "}", "if", "(", "(", "mIsStacked", "=", "hasTabs", "&&", "mStackedBackground", "!=", "null", ")", ")", "{", "mStackedBackground", ".", "setBounds", "(", "mTabContainer", ".", "getLeft", "(", ")", ",", "mTabContainer", ".", "getTop", "(", ")", ",", "mTabContainer", ".", "getRight", "(", ")", ",", "mTabContainer", ".", "getBottom", "(", ")", ")", ";", "needsInvalidate", "=", "true", ";", "}", "}", "if", "(", "needsInvalidate", ")", "{", "invalidate", "(", ")", ";", "}", "}", "}", "</s>" ]
8,999
[ "<s>", "package", "com", ".", "actionbarsherlock", ".", "internal", ".", "widget", ";", "import", "com", ".", "actionbarsherlock", ".", "R", ";", "import", "android", ".", "content", ".", "Context", ";", "import", "android", ".", "content", ".", "res", ".", "Resources", ";", "import", "android", ".", "database", ".", "DataSetObserver", ";", "import", "android", ".", "graphics", ".", "Rect", ";", "import", "android", ".", "graphics", ".", "drawable", ".", "Drawable", ";", "import", "android", ".", "os", ".", "Build", ";", "import", "android", ".", "os", ".", "Handler", ";", "import", "android", ".", "util", ".", "AttributeSet", ";", "import", "android", ".", "view", ".", "ContextThemeWrapper", ";", "import", "android", ".", "view", ".", "MotionEvent", ";", "import", "android", ".", "view", ".", "View", ";", "import", "android", ".", "view", ".", "View", ".", "MeasureSpec", ";", "import", "android", ".", "view", ".", "View", ".", "OnTouchListener", ";", "import", "android", ".", "view", ".", "ViewGroup", ";", "import", "android", ".", "view", ".", "ViewParent", ";", "import", "android", ".", "widget", ".", "AbsListView", ";", "import", "android", ".", "widget", ".", "AdapterView", ";", "import", "android", ".", "widget", ".", "LinearLayout", ";", "import", "android", ".", "widget", ".", "ListAdapter", ";", "import", "android", ".", "widget", ".", "ListView", ";", "import", "android", ".", "widget", ".", "PopupWindow", ";", "public", "class", "IcsListPopupWindow", "{", "private", "static", "final", "int", "EXPAND_LIST_TIMEOUT", "=", "250", ";", "private", "Context", "mContext", ";", "private", "PopupWindow", "mPopup", ";", "private", "ListAdapter", "mAdapter", ";", "private", "DropDownListView", "mDropDownList", ";", "private", "int", "mDropDownHeight", "=", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ";", "private", "int", "mDropDownWidth", "=", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ";", "private", "int", "mDropDownHorizontalOffset", ";", "private", "int", "mDropDownVerticalOffset", ";", "private", "boolean", "mDropDownVerticalOffsetSet", ";", "private", "int", "mListItemExpandMaximum", "=", "Integer", ".", "MAX_VALUE", ";", "private", "View", "mPromptView", ";", "private", "int", "mPromptPosition", "=", "POSITION_PROMPT_ABOVE", ";", "private", "DataSetObserver", "mObserver", ";", "private", "View", "mDropDownAnchorView", ";", "private", "Drawable", "mDropDownListHighlight", ";", "private", "AdapterView", ".", "OnItemClickListener", "mItemClickListener", ";", "private", "AdapterView", ".", "OnItemSelectedListener", "mItemSelectedListener", ";", "private", "final", "ResizePopupRunnable", "mResizePopupRunnable", "=", "new", "ResizePopupRunnable", "(", ")", ";", "private", "final", "PopupTouchInterceptor", "mTouchInterceptor", "=", "new", "PopupTouchInterceptor", "(", ")", ";", "private", "final", "PopupScrollListener", "mScrollListener", "=", "new", "PopupScrollListener", "(", ")", ";", "private", "final", "ListSelectorHider", "mHideSelector", "=", "new", "ListSelectorHider", "(", ")", ";", "private", "Handler", "mHandler", "=", "new", "Handler", "(", ")", ";", "private", "Rect", "mTempRect", "=", "new", "Rect", "(", ")", ";", "private", "boolean", "mModal", ";", "public", "static", "final", "int", "POSITION_PROMPT_ABOVE", "=", "0", ";", "public", "static", "final", "int", "POSITION_PROMPT_BELOW", "=", "1", ";", "public", "IcsListPopupWindow", "(", "Context", "context", ")", "{", "this", "(", "context", ",", "null", ",", "R", ".", "attr", ".", "listPopupWindowStyle", ")", ";", "}", "public", "IcsListPopupWindow", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyleAttr", ")", "{", "mContext", "=", "context", ";", "mPopup", "=", "new", "PopupWindow", "(", "context", ",", "attrs", ",", "defStyleAttr", ")", ";", "mPopup", ".", "setInputMethodMode", "(", "PopupWindow", ".", "INPUT_METHOD_NEEDED", ")", ";", "}", "public", "IcsListPopupWindow", "(", "Context", "context", ",", "AttributeSet", "attrs", ",", "int", "defStyleAttr", ",", "int", "defStyleRes", ")", "{", "mContext", "=", "context", ";", "if", "(", "Build", ".", "VERSION", ".", "SDK_INT", "<", "Build", ".", "VERSION_CODES", ".", "HONEYCOMB", ")", "{", "Context", "wrapped", "=", "new", "ContextThemeWrapper", "(", "context", ",", "defStyleRes", ")", ";", "mPopup", "=", "new", "PopupWindow", "(", "wrapped", ",", "attrs", ",", "defStyleAttr", ")", ";", "}", "else", "{", "mPopup", "=", "new", "PopupWindow", "(", "context", ",", "attrs", ",", "defStyleAttr", ",", "defStyleRes", ")", ";", "}", "mPopup", ".", "setInputMethodMode", "(", "PopupWindow", ".", "INPUT_METHOD_NEEDED", ")", ";", "}", "public", "void", "setAdapter", "(", "ListAdapter", "adapter", ")", "{", "if", "(", "mObserver", "==", "null", ")", "{", "mObserver", "=", "new", "PopupDataSetObserver", "(", ")", ";", "}", "else", "if", "(", "mAdapter", "!=", "null", ")", "{", "mAdapter", ".", "unregisterDataSetObserver", "(", "mObserver", ")", ";", "}", "mAdapter", "=", "adapter", ";", "if", "(", "mAdapter", "!=", "null", ")", "{", "adapter", ".", "registerDataSetObserver", "(", "mObserver", ")", ";", "}", "if", "(", "mDropDownList", "!=", "null", ")", "{", "mDropDownList", ".", "setAdapter", "(", "mAdapter", ")", ";", "}", "}", "public", "void", "setPromptPosition", "(", "int", "position", ")", "{", "mPromptPosition", "=", "position", ";", "}", "public", "void", "setModal", "(", "boolean", "modal", ")", "{", "mModal", "=", "true", ";", "mPopup", ".", "setFocusable", "(", "modal", ")", ";", "}", "public", "void", "setBackgroundDrawable", "(", "Drawable", "d", ")", "{", "mPopup", ".", "setBackgroundDrawable", "(", "d", ")", ";", "}", "public", "void", "setAnchorView", "(", "View", "anchor", ")", "{", "mDropDownAnchorView", "=", "anchor", ";", "}", "public", "void", "setHorizontalOffset", "(", "int", "offset", ")", "{", "mDropDownHorizontalOffset", "=", "offset", ";", "}", "public", "void", "setVerticalOffset", "(", "int", "offset", ")", "{", "mDropDownVerticalOffset", "=", "offset", ";", "mDropDownVerticalOffsetSet", "=", "true", ";", "}", "public", "void", "setContentWidth", "(", "int", "width", ")", "{", "Drawable", "popupBackground", "=", "mPopup", ".", "getBackground", "(", ")", ";", "if", "(", "popupBackground", "!=", "null", ")", "{", "popupBackground", ".", "getPadding", "(", "mTempRect", ")", ";", "mDropDownWidth", "=", "mTempRect", ".", "left", "+", "mTempRect", ".", "right", "+", "width", ";", "}", "else", "{", "mDropDownWidth", "=", "width", ";", "}", "}", "public", "void", "setOnItemClickListener", "(", "AdapterView", ".", "OnItemClickListener", "clickListener", ")", "{", "mItemClickListener", "=", "clickListener", ";", "}", "public", "void", "show", "(", ")", "{", "int", "height", "=", "buildDropDown", "(", ")", ";", "int", "widthSpec", "=", "0", ";", "int", "heightSpec", "=", "0", ";", "boolean", "noInputMethod", "=", "isInputMethodNotNeeded", "(", ")", ";", "if", "(", "mPopup", ".", "isShowing", "(", ")", ")", "{", "if", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "widthSpec", "=", "-", "1", ";", "}", "else", "if", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ")", "{", "widthSpec", "=", "mDropDownAnchorView", ".", "getWidth", "(", ")", ";", "}", "else", "{", "widthSpec", "=", "mDropDownWidth", ";", "}", "if", "(", "mDropDownHeight", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "heightSpec", "=", "noInputMethod", "?", "height", ":", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ";", "if", "(", "noInputMethod", ")", "{", "mPopup", ".", "setWindowLayoutMode", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", "?", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ":", "0", ",", "0", ")", ";", "}", "else", "{", "mPopup", ".", "setWindowLayoutMode", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", "?", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ":", "0", ",", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", ";", "}", "}", "else", "if", "(", "mDropDownHeight", "==", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ")", "{", "heightSpec", "=", "height", ";", "}", "else", "{", "heightSpec", "=", "mDropDownHeight", ";", "}", "mPopup", ".", "setOutsideTouchable", "(", "true", ")", ";", "mPopup", ".", "update", "(", "mDropDownAnchorView", ",", "mDropDownHorizontalOffset", ",", "mDropDownVerticalOffset", ",", "widthSpec", ",", "heightSpec", ")", ";", "}", "else", "{", "if", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "widthSpec", "=", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ";", "}", "else", "{", "if", "(", "mDropDownWidth", "==", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ")", "{", "mPopup", ".", "setWidth", "(", "mDropDownAnchorView", ".", "getWidth", "(", ")", ")", ";", "}", "else", "{", "mPopup", ".", "setWidth", "(", "mDropDownWidth", ")", ";", "}", "}", "if", "(", "mDropDownHeight", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "heightSpec", "=", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ";", "}", "else", "{", "if", "(", "mDropDownHeight", "==", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ")", "{", "mPopup", ".", "setHeight", "(", "height", ")", ";", "}", "else", "{", "mPopup", ".", "setHeight", "(", "mDropDownHeight", ")", ";", "}", "}", "mPopup", ".", "setWindowLayoutMode", "(", "widthSpec", ",", "heightSpec", ")", ";", "mPopup", ".", "setOutsideTouchable", "(", "true", ")", ";", "mPopup", ".", "setTouchInterceptor", "(", "mTouchInterceptor", ")", ";", "mPopup", ".", "showAsDropDown", "(", "mDropDownAnchorView", ",", "mDropDownHorizontalOffset", ",", "mDropDownVerticalOffset", ")", ";", "mDropDownList", ".", "setSelection", "(", "ListView", ".", "INVALID_POSITION", ")", ";", "if", "(", "!", "mModal", "||", "mDropDownList", ".", "isInTouchMode", "(", ")", ")", "{", "clearListSelection", "(", ")", ";", "}", "if", "(", "!", "mModal", ")", "{", "mHandler", ".", "post", "(", "mHideSelector", ")", ";", "}", "}", "}", "public", "void", "dismiss", "(", ")", "{", "mPopup", ".", "dismiss", "(", ")", ";", "if", "(", "mPromptView", "!=", "null", ")", "{", "final", "ViewParent", "parent", "=", "mPromptView", ".", "getParent", "(", ")", ";", "if", "(", "parent", "instanceof", "ViewGroup", ")", "{", "final", "ViewGroup", "group", "=", "(", "ViewGroup", ")", "parent", ";", "group", ".", "removeView", "(", "mPromptView", ")", ";", "}", "}", "mPopup", ".", "setContentView", "(", "null", ")", ";", "mDropDownList", "=", "null", ";", "mHandler", ".", "removeCallbacks", "(", "mResizePopupRunnable", ")", ";", "}", "public", "void", "setOnDismissListener", "(", "PopupWindow", ".", "OnDismissListener", "listener", ")", "{", "mPopup", ".", "setOnDismissListener", "(", "listener", ")", ";", "}", "public", "void", "setInputMethodMode", "(", "int", "mode", ")", "{", "mPopup", ".", "setInputMethodMode", "(", "mode", ")", ";", "}", "public", "void", "clearListSelection", "(", ")", "{", "final", "DropDownListView", "list", "=", "mDropDownList", ";", "if", "(", "list", "!=", "null", ")", "{", "list", ".", "mListSelectionHidden", "=", "true", ";", "list", ".", "requestLayout", "(", ")", ";", "}", "}", "public", "boolean", "isShowing", "(", ")", "{", "return", "mPopup", ".", "isShowing", "(", ")", ";", "}", "private", "boolean", "isInputMethodNotNeeded", "(", ")", "{", "return", "mPopup", ".", "getInputMethodMode", "(", ")", "==", "PopupWindow", ".", "INPUT_METHOD_NOT_NEEDED", ";", "}", "public", "ListView", "getListView", "(", ")", "{", "return", "mDropDownList", ";", "}", "private", "int", "buildDropDown", "(", ")", "{", "ViewGroup", "dropDownView", ";", "int", "otherHeights", "=", "0", ";", "if", "(", "mDropDownList", "==", "null", ")", "{", "Context", "context", "=", "mContext", ";", "mDropDownList", "=", "new", "DropDownListView", "(", "context", ",", "!", "mModal", ")", ";", "if", "(", "mDropDownListHighlight", "!=", "null", ")", "{", "mDropDownList", ".", "setSelector", "(", "mDropDownListHighlight", ")", ";", "}", "mDropDownList", ".", "setAdapter", "(", "mAdapter", ")", ";", "mDropDownList", ".", "setOnItemClickListener", "(", "mItemClickListener", ")", ";", "mDropDownList", ".", "setFocusable", "(", "true", ")", ";", "mDropDownList", ".", "setFocusableInTouchMode", "(", "true", ")", ";", "mDropDownList", ".", "setOnItemSelectedListener", "(", "new", "AdapterView", ".", "OnItemSelectedListener", "(", ")", "{", "public", "void", "onItemSelected", "(", "AdapterView", "<", "?", ">", "parent", ",", "View", "view", ",", "int", "position", ",", "long", "id", ")", "{", "if", "(", "position", "!=", "-", "1", ")", "{", "DropDownListView", "dropDownList", "=", "mDropDownList", ";", "if", "(", "dropDownList", "!=", "null", ")", "{", "dropDownList", ".", "mListSelectionHidden", "=", "false", ";", "}", "}", "}", "public", "void", "onNothingSelected", "(", "AdapterView", "<", "?", ">", "parent", ")", "{", "}", "}", ")", ";", "mDropDownList", ".", "setOnScrollListener", "(", "mScrollListener", ")", ";", "if", "(", "mItemSelectedListener", "!=", "null", ")", "{", "mDropDownList", ".", "setOnItemSelectedListener", "(", "mItemSelectedListener", ")", ";", "}", "dropDownView", "=", "mDropDownList", ";", "View", "hintView", "=", "mPromptView", ";", "if", "(", "hintView", "!=", "null", ")", "{", "LinearLayout", "hintContainer", "=", "new", "LinearLayout", "(", "context", ")", ";", "hintContainer", ".", "setOrientation", "(", "LinearLayout", ".", "VERTICAL", ")", ";", "LinearLayout", ".", "LayoutParams", "hintParams", "=", "new", "LinearLayout", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ",", "0", ",", "1.0f", ")", ";", "switch", "(", "mPromptPosition", ")", "{", "case", "POSITION_PROMPT_BELOW", ":", "hintContainer", ".", "addView", "(", "dropDownView", ",", "hintParams", ")", ";", "hintContainer", ".", "addView", "(", "hintView", ")", ";", "break", ";", "case", "POSITION_PROMPT_ABOVE", ":", "hintContainer", ".", "addView", "(", "hintView", ")", ";", "hintContainer", ".", "addView", "(", "dropDownView", ",", "hintParams", ")", ";", "break", ";", "default", ":", "break", ";", "}", "int", "widthSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "mDropDownWidth", ",", "MeasureSpec", ".", "AT_MOST", ")", ";", "int", "heightSpec", "=", "MeasureSpec", ".", "UNSPECIFIED", ";", "hintView", ".", "measure", "(", "widthSpec", ",", "heightSpec", ")", ";", "hintParams", "=", "(", "LinearLayout", ".", "LayoutParams", ")", "hintView", ".", "getLayoutParams", "(", ")", ";", "otherHeights", "=", "hintView", ".", "getMeasuredHeight", "(", ")", "+", "hintParams", ".", "topMargin", "+", "hintParams", ".", "bottomMargin", ";", "dropDownView", "=", "hintContainer", ";", "}", "mPopup", ".", "setContentView", "(", "dropDownView", ")", ";", "}", "else", "{", "dropDownView", "=", "(", "ViewGroup", ")", "mPopup", ".", "getContentView", "(", ")", ";", "final", "View", "view", "=", "mPromptView", ";", "if", "(", "view", "!=", "null", ")", "{", "LinearLayout", ".", "LayoutParams", "hintParams", "=", "(", "LinearLayout", ".", "LayoutParams", ")", "view", ".", "getLayoutParams", "(", ")", ";", "otherHeights", "=", "view", ".", "getMeasuredHeight", "(", ")", "+", "hintParams", ".", "topMargin", "+", "hintParams", ".", "bottomMargin", ";", "}", "}", "int", "padding", "=", "0", ";", "Drawable", "background", "=", "mPopup", ".", "getBackground", "(", ")", ";", "if", "(", "background", "!=", "null", ")", "{", "background", ".", "getPadding", "(", "mTempRect", ")", ";", "padding", "=", "mTempRect", ".", "top", "+", "mTempRect", ".", "bottom", ";", "if", "(", "!", "mDropDownVerticalOffsetSet", ")", "{", "mDropDownVerticalOffset", "=", "-", "mTempRect", ".", "top", ";", "}", "}", "boolean", "ignoreBottomDecorations", "=", "mPopup", ".", "getInputMethodMode", "(", ")", "==", "PopupWindow", ".", "INPUT_METHOD_NOT_NEEDED", ";", "final", "int", "maxHeight", "=", "getMaxAvailableHeight", "(", "mDropDownAnchorView", ",", "mDropDownVerticalOffset", ",", "ignoreBottomDecorations", ")", ";", "if", "(", "mDropDownHeight", "==", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ")", "{", "return", "maxHeight", "+", "padding", ";", "}", "final", "int", "listContent", "=", "measureHeightOfChildren", "(", "MeasureSpec", ".", "UNSPECIFIED", ",", "0", ",", "-", "1", ",", "maxHeight", "-", "otherHeights", ",", "-", "1", ")", ";", "if", "(", "listContent", ">", "0", ")", "otherHeights", "+=", "padding", ";", "return", "listContent", "+", "otherHeights", ";", "}", "private", "int", "getMaxAvailableHeight", "(", "View", "anchor", ",", "int", "yOffset", ",", "boolean", "ignoreBottomDecorations", ")", "{", "final", "Rect", "displayFrame", "=", "new", "Rect", "(", ")", ";", "anchor", ".", "getWindowVisibleDisplayFrame", "(", "displayFrame", ")", ";", "final", "int", "[", "]", "anchorPos", "=", "new", "int", "[", "2", "]", ";", "anchor", ".", "getLocationOnScreen", "(", "anchorPos", ")", ";", "int", "bottomEdge", "=", "displayFrame", ".", "bottom", ";", "if", "(", "ignoreBottomDecorations", ")", "{", "Resources", "res", "=", "anchor", ".", "getContext", "(", ")", ".", "getResources", "(", ")", ";", "bottomEdge", "=", "res", ".", "getDisplayMetrics", "(", ")", ".", "heightPixels", ";", "}", "final", "int", "distanceToBottom", "=", "bottomEdge", "-", "(", "anchorPos", "[", "1", "]", "+", "anchor", ".", "getHeight", "(", ")", ")", "-", "yOffset", ";", "final", "int", "distanceToTop", "=", "anchorPos", "[", "1", "]", "-", "displayFrame", ".", "top", "+", "yOffset", ";", "int", "returnedHeight", "=", "Math", ".", "max", "(", "distanceToBottom", ",", "distanceToTop", ")", ";", "if", "(", "mPopup", ".", "getBackground", "(", ")", "!=", "null", ")", "{", "mPopup", ".", "getBackground", "(", ")", ".", "getPadding", "(", "mTempRect", ")", ";", "returnedHeight", "-=", "mTempRect", ".", "top", "+", "mTempRect", ".", "bottom", ";", "}", "return", "returnedHeight", ";", "}", "private", "int", "measureHeightOfChildren", "(", "int", "widthMeasureSpec", ",", "int", "startPosition", ",", "int", "endPosition", ",", "final", "int", "maxHeight", ",", "int", "disallowPartialChildPosition", ")", "{", "final", "ListAdapter", "adapter", "=", "mAdapter", ";", "if", "(", "adapter", "==", "null", ")", "{", "return", "mDropDownList", ".", "getListPaddingTop", "(", ")", "+", "mDropDownList", ".", "getListPaddingBottom", "(", ")", ";", "}", "int", "returnedHeight", "=", "mDropDownList", ".", "getListPaddingTop", "(", ")", "+", "mDropDownList", ".", "getListPaddingBottom", "(", ")", ";", "final", "int", "dividerHeight", "=", "(", "(", "mDropDownList", ".", "getDividerHeight", "(", ")", ">", "0", ")", "&&", "mDropDownList", ".", "getDivider", "(", ")", "!=", "null", ")", "?", "mDropDownList", ".", "getDividerHeight", "(", ")", ":", "0", ";", "int", "prevHeightWithoutPartialChild", "=", "0", ";", "int", "i", ";", "View", "child", ";", "endPosition", "=", "(", "endPosition", "==", "-", "1", ")", "?", "adapter", ".", "getCount", "(", ")", "-", "1", ":", "endPosition", ";", "for", "(", "i", "=", "startPosition", ";", "i", "<=", "endPosition", ";", "++", "i", ")", "{", "child", "=", "mAdapter", ".", "getView", "(", "i", ",", "null", ",", "mDropDownList", ")", ";", "if", "(", "mDropDownList", ".", "getCacheColorHint", "(", ")", "!=", "0", ")", "{", "child", ".", "setDrawingCacheBackgroundColor", "(", "mDropDownList", ".", "getCacheColorHint", "(", ")", ")", ";", "}", "measureScrapChild", "(", "child", ",", "i", ",", "widthMeasureSpec", ")", ";", "if", "(", "i", ">", "0", ")", "{", "returnedHeight", "+=", "dividerHeight", ";", "}", "returnedHeight", "+=", "child", ".", "getMeasuredHeight", "(", ")", ";", "if", "(", "returnedHeight", ">=", "maxHeight", ")", "{", "return", "(", "disallowPartialChildPosition", ">=", "0", ")", "&&", "(", "i", ">", "disallowPartialChildPosition", ")", "&&", "(", "prevHeightWithoutPartialChild", ">", "0", ")", "&&", "(", "returnedHeight", "!=", "maxHeight", ")", "?", "prevHeightWithoutPartialChild", ":", "maxHeight", ";", "}", "if", "(", "(", "disallowPartialChildPosition", ">=", "0", ")", "&&", "(", "i", ">=", "disallowPartialChildPosition", ")", ")", "{", "prevHeightWithoutPartialChild", "=", "returnedHeight", ";", "}", "}", "return", "returnedHeight", ";", "}", "private", "void", "measureScrapChild", "(", "View", "child", ",", "int", "position", ",", "int", "widthMeasureSpec", ")", "{", "ListView", ".", "LayoutParams", "p", "=", "(", "ListView", ".", "LayoutParams", ")", "child", ".", "getLayoutParams", "(", ")", ";", "if", "(", "p", "==", "null", ")", "{", "p", "=", "new", "ListView", ".", "LayoutParams", "(", "ViewGroup", ".", "LayoutParams", ".", "MATCH_PARENT", ",", "ViewGroup", ".", "LayoutParams", ".", "WRAP_CONTENT", ",", "0", ")", ";", "child", ".", "setLayoutParams", "(", "p", ")", ";", "}", "int", "childWidthSpec", "=", "ViewGroup", ".", "getChildMeasureSpec", "(", "widthMeasureSpec", ",", "mDropDownList", ".", "getPaddingLeft", "(", ")", "+", "mDropDownList", ".", "getPaddingRight", "(", ")", ",", "p", ".", "width", ")", ";", "int", "lpHeight", "=", "p", ".", "height", ";", "int", "childHeightSpec", ";", "if", "(", "lpHeight", ">", "0", ")", "{", "childHeightSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "lpHeight", ",", "MeasureSpec", ".", "EXACTLY", ")", ";", "}", "else", "{", "childHeightSpec", "=", "MeasureSpec", ".", "makeMeasureSpec", "(", "0", ",", "MeasureSpec", ".", "UNSPECIFIED", ")", ";", "}", "child", ".", "measure", "(", "childWidthSpec", ",", "childHeightSpec", ")", ";", "}", "private", "static", "class", "DropDownListView", "extends", "ListView", "{", "private", "boolean", "mListSelectionHidden", ";", "private", "boolean", "mHijackFocus", ";", "public", "DropDownListView", "(", "Context", "context", ",", "boolean", "hijackFocus", ")", "{", "super", "(", "context", ",", "null", ",", "R", ".", "attr", ".", "dropDownListViewStyle", ")", ";", "mHijackFocus", "=", "hijackFocus", ";", "setCacheColorHint", "(", "0", ")", ";", "}", "@", "Override", "public", "boolean", "isInTouchMode", "(", ")", "{", "return", "(", "mHijackFocus", "&&", "mListSelectionHidden", ")", "||", "super", ".", "isInTouchMode", "(", ")", ";", "}", "@", "Override", "public", "boolean", "hasWindowFocus", "(", ")", "{", "return", "mHijackFocus", "||", "super", ".", "hasWindowFocus", "(", ")", ";", "}", "@", "Override", "public", "boolean", "isFocused", "(", ")", "{", "return", "mHijackFocus", "||", "super", ".", "isFocused", "(", ")", ";", "}", "@", "Override", "public", "boolean", "hasFocus", "(", ")", "{", "return", "mHijackFocus", "||", "super", ".", "hasFocus", "(", ")", ";", "}", "}", "private", "class", "PopupDataSetObserver", "extends", "DataSetObserver", "{", "@", "Override", "public", "void", "onChanged", "(", ")", "{", "if", "(", "isShowing", "(", ")", ")", "{", "show", "(", ")", ";", "}", "}", "@", "Override", "public", "void", "onInvalidated", "(", ")", "{", "dismiss", "(", ")", ";", "}", "}", "private", "class", "ListSelectorHider", "implements", "Runnable", "{", "public", "void", "run", "(", ")", "{", "clearListSelection", "(", ")", ";", "}", "}", "private", "class", "ResizePopupRunnable", "implements", "Runnable", "{", "public", "void", "run", "(", ")", "{", "if", "(", "mDropDownList", "!=", "null", "&&", "mDropDownList", ".", "getCount", "(", ")", ">", "mDropDownList", ".", "getChildCount", "(", ")", "&&", "mDropDownList", ".", "getChildCount", "(", ")", "<=", "mListItemExpandMaximum", ")", "{", "mPopup", ".", "setInputMethodMode", "(", "PopupWindow", ".", "INPUT_METHOD_NOT_NEEDED", ")", ";", "show", "(", ")", ";", "}", "}", "}", "private", "class", "PopupTouchInterceptor", "implements", "OnTouchListener", "{", "public", "boolean", "onTouch", "(", "View", "v", ",", "MotionEvent", "event", ")", "{", "final", "int", "action", "=", "event", ".", "getAction", "(", ")", ";", "final", "int", "x", "=", "(", "int", ")", "event", ".", "getX", "(", ")", ";", "final", "int", "y", "=", "(", "int", ")", "event", ".", "getY", "(", ")", ";", "if", "(", "action", "==", "MotionEvent", ".", "ACTION_DOWN", "&&", "mPopup", "!=", "null", "&&", "mPopup", ".", "isShowing", "(", ")", "&&", "(", "x", ">=", "0", "&&", "x", "<", "mPopup", ".", "getWidth", "(", ")", "&&", "y", ">=", "0", "&&", "y", "<", "mPopup", ".", "getHeight", "(", ")", ")", ")", "{", "mHandler", ".", "postDelayed", "(", "mResizePopupRunnable", ",", "EXPAND_LIST_TIMEOUT", ")", ";", "}", "else", "if", "(", "action", "==", "MotionEvent", ".", "ACTION_UP", ")", "{", "mHandler", ".", "removeCallbacks", "(", "mResizePopupRunnable", ")", ";", "}", "return", "false", ";", "}", "}", "private", "class", "PopupScrollListener", "implements", "ListView", ".", "OnScrollListener", "{", "public", "void", "onScroll", "(", "AbsListView", "view", ",", "int", "firstVisibleItem", ",", "int", "visibleItemCount", ",", "int", "totalItemCount", ")", "{", "}", "public", "void", "onScrollStateChanged", "(", "AbsListView", "view", ",", "int", "scrollState", ")", "{", "if", "(", "scrollState", "==", "SCROLL_STATE_TOUCH_SCROLL", "&&", "!", "isInputMethodNotNeeded", "(", ")", "&&", "mPopup", ".", "getContentView", "(", ")", "!=", "null", ")", "{", "mHandler", ".", "removeCallbacks", "(", "mResizePopupRunnable", ")", ";", "mResizePopupRunnable", ".", "run", "(", ")", ";", "}", "}", "}", "}", "</s>" ]