Java 类java.util.List 实例源码

项目:dubbox-hystrix    文件:ConsumerServiceImpl.java   
public List<String> findAddressesByApplication(String application) {
    List<String> ret = new ArrayList<String>();
    ConcurrentMap<String, Map<Long, URL>> consumerUrls = getRegistryCache().get(Constants.CONSUMERS_CATEGORY);
    if(consumerUrls == null) return ret;

    for(Map.Entry<String, Map<Long, URL>> e1 : consumerUrls.entrySet()) {
        Map<Long, URL> value = e1.getValue();
        for(Map.Entry<Long, URL> e2 : value.entrySet()) {
            URL u = e2.getValue();
            if(application.equals(u.getParameter(Constants.APPLICATION_KEY))) {
                String addr = u.getAddress();
                if(addr != null) ret.add(addr);
            }
        }
    }

    return ret;
}
项目:NotifyTools    文件:VetoableChangeSupport.java   
public synchronized VetoableChangeListener[] getVetoableChangeListeners() {
    List<VetoableChangeListener> result = new ArrayList<VetoableChangeListener>();
    if (globalListeners != null) {
        result.addAll(globalListeners);
    }

    for (Iterator<String> iterator = children.keySet().iterator(); iterator
            .hasNext();) {
        String propertyName = iterator.next();
        VetoableChangeSupport namedListener = children
                .get(propertyName);
        VetoableChangeListener[] childListeners = namedListener
                .getVetoableChangeListeners();
        for (int i = 0; i < childListeners.length; i++) {
            result.add(new VetoableChangeListenerProxy(propertyName,
                    childListeners[i]));
        }
    }
    return (result
            .toArray(new VetoableChangeListener[result.size()]));
}
项目:PicKing    文件:MiniTokyo.java   
@Override
public Map<ContentsActivity.parameter, Object> getContent(String baseUrl, String currentUrl, byte[] result, Map<ContentsActivity.parameter, Object> resultMap) throws UnsupportedEncodingException {
    List<AlbumInfo> data = new ArrayList<>();
    Document document = Jsoup.parse(new String(result, "utf-8"));
    Elements elements = document.select("ul.scans li a:has(img)");
    for (Element element : elements) {
        AlbumInfo temp = new AlbumInfo();
        temp.setAlbumUrl(element.attr("href"));
        Elements elements1 = element.select("img");
        if (elements1.size() > 0)
            temp.setPicUrl(elements1.get(0).attr("src"));
        data.add(temp);
    }

    resultMap.put(ContentsActivity.parameter.CURRENT_URL, currentUrl);
    resultMap.put(ContentsActivity.parameter.RESULT, data);
    return resultMap;
}
项目:incubator-netbeans    文件:MemoryFileManager.java   
public List<JavaFileObject> list(Location location, String packageName, Set<Kind> kinds, boolean recurse) throws IOException {
    if (recurse) {
        throw new UnsupportedEncodingException();
    }
    final List<JavaFileObject> result = new LinkedList<JavaFileObject> ();        
    if (location == StandardLocation.SOURCE_PATH) {
        final List<Integer> pkglst = packages.get(packageName);
        if (pkglst != null) {
            for (Integer foid : pkglst) {
                InferableJavaFileObject jfo = content.get(foid);
                assert jfo != null;
                if (kinds.contains(jfo.getKind())) {
                    result.add(jfo);
                }
            }
        }
    }
    return result;
}
项目:alipay-sdk    文件:AlipaySignature.java   
/**
 * 
 * @param sortedParams
 * @return
 */
public static String getSignContent(Map<String, String> sortedParams) {
    StringBuffer content = new StringBuffer();
    List<String> keys = new ArrayList<String>(sortedParams.keySet());
    Collections.sort(keys);
    int index = 0;
    for (int i = 0; i < keys.size(); i++) {
        String key = keys.get(i);
        String value = sortedParams.get(key);
        if (StringUtils.areNotEmpty(key, value)) {
            content.append((index == 0 ? "" : "&") + key + "=" + value);
            index++;
        }
    }
    return content.toString();
}
项目:morf    文件:TestUpgradePathFinder.java   
/**
 * When providing 2 unapplied upgrade steps
 * and one unapplied upgrade with with-only constraint (AddJamAmount should be applied only with AddJamType)
 * When determining the upgrade path
 * Then all 3 steps are applied in the correct order.
 */
@Test
public void testConditionalUpgradeStepIsExecuted() {
  // given
  List<Class<? extends UpgradeStep>> upgradeSteps = new ArrayList<>();
  upgradeSteps.add(AddJamType.class);
  upgradeSteps.add(AddDiameter.class);
  upgradeSteps.add(AddJamAmount.class); // to be executed only with AddJamType
  upgradeSteps.add(AddJamAmountUnit.class); // to be executed only with AddJamAmount

  UpgradePathFinder pathFinder = makeFinder(upgradeSteps, appliedSteps());

  Schema current = schema(sconeTable);
  Schema target = schema(upgradedSconeTableWithJamAmount);

  // when
  List<UpgradeStep> path = pathFinder.determinePath(current, target, Sets.<String>newHashSet()).getUpgradeSteps();

  // then
  assertEquals("Number of upgrades steps", 4, path.size());
  assertSame("First", AddDiameter.class, path.get(0).getClass());
  assertSame("Second", AddJamType.class, path.get(1).getClass());
  assertSame("Third", AddJamAmountUnit.class, path.get(2).getClass());
  assertSame("Last", AddJamAmount.class, path.get(3).getClass());
}
项目:Remindy    文件:RemindyDAO.java   
/**
 * Inserts a List of Attachments associated to an Task, into the database.
 * @param taskId The id of the Task associated to the Attachments
 * @param attachments The List of Attachments to be inserted
 */
public long[] insertAttachmentsOfTask(int taskId, List<Attachment> attachments) throws CouldNotInsertDataException {
    SQLiteDatabase db = mDatabaseHelper.getWritableDatabase();
    long[] newRowIds = new long[attachments.size()];

    for (int i = 0; i < attachments.size(); i++) {

        Attachment attachment = attachments.get(i);
        attachment.setTaskId(taskId);
        ContentValues values = getValuesFromAttachment(attachment);

        newRowIds[i] = db.insert(RemindyContract.AttachmentTable.TABLE_NAME, null, values);

        if (newRowIds[i] == -1)
            throw new CouldNotInsertDataException("There was a problem inserting the Attachment: " + attachments.toString());
    }

    return newRowIds;
}
项目:Proyecto-DASI    文件:InventoryCommandsImplementation.java   
private boolean getParameters(String parameter, List<Integer> parsedParams)
{
    String[] params = parameter.split(" ");
    if (params.length != 2)
    {
        System.out.println("Malformed parameter string (" + parameter + ") - expected <x> <y>");
        return false;   // Error - incorrect number of parameters.
    }
    Integer lhs, rhs;
    try
    {
        lhs = Integer.valueOf(params[0]);
        rhs = Integer.valueOf(params[1]);
    }
    catch (NumberFormatException e)
    {
        System.out.println("Malformed parameter string (" + parameter + ") - " + e.getMessage());
        return false;
    }
    if (lhs == null || rhs == null)
    {
        System.out.println("Malformed parameter string (" + parameter + ")");
        return false;   // Error - incorrect parameters.
    }
    InventoryPlayer inv = Minecraft.getMinecraft().thePlayer.inventory;
    if (lhs < 0 || lhs >= inv.getSizeInventory() || rhs < 0 || rhs >= inv.getSizeInventory())
    {
        System.out.println("Inventory swap parameters out of bounds - must be between 0 and " + (inv.getSizeInventory() - 1));
        return false;   // Out of bounds.
    }
    parsedParams.add(lhs);
    parsedParams.add(rhs);
    return true;
}
项目:DicomViewer    文件:SortedListTools.java   
public static Integer idOfClosest(final List<DateTime> list, final DateTime key, final int low, final int high) {
    // Cas particuliers
    if (list == null || list.isEmpty() || key == null || low > high) {
        return null;
    }
    // Evacuation des cas où la valeur serait hors de l'intervalle -----------
    if (list.size() == 1) {
        return 0;
    }
    if (list.get(low).getMillis() >= key.getMillis()) {
        return low;
    }
    if (list.get(high).getMillis() <= key.getMillis()) {
        return high;
    }

    int idx = binarySearch(list, key, low, high);
    if (idx < 0) {
        idx = -(idx) - 1;
        if (idx != 0 && idx < list.size()) {
            return (key.getMillis()  - list.get(idx - 1).getMillis()  <= list.get(idx).getMillis() - key.getMillis() ) ? idx - 1 : idx;
        }
        return null;
    }
    return idx;
}
项目:empiria.player    文件:ExpressionToResponseConnectorJUnitTest.java   
@Test
public void shouldConnectOnlyResponsesRelatedToExpression() throws Exception {
    // given
    String template = "template";
    ExpressionBean expressionBean = new ExpressionBean();
    expressionBean.setTemplate(template);

    Response relatedResponse = Mockito.mock(Response.class);
    Response unrelatedResponse = Mockito.mock(Response.class);

    when(itemResponseManager.getVariable("relatedResponse")).thenReturn(relatedResponse);
    when(itemResponseManager.getVariable("unrelatedResponse")).thenReturn(unrelatedResponse);

    when(identifiersFromExpressionExtractor.extractResponseIdentifiersFromTemplate(template)).thenReturn(
            Lists.newArrayList("relatedResponse", "notExistingId"));

    // when
    expressionToResponseConnector.connectResponsesToExpression(expressionBean, itemResponseManager);

    // then
    verify(identifiersFromExpressionExtractor).extractResponseIdentifiersFromTemplate(template);
    verify(relatedResponse).setExpression(expressionBean);
    List<Response> connectedResponses = expressionBean.getResponses();
    assertEquals(1, connectedResponses.size());
    assertEquals(relatedResponse, connectedResponses.get(0));
}
项目:Java-9-Cookbook    文件:Chapter07Concurrency02.java   
private static void demoListIterRemove(List<String> list) {
    System.out.println("list: " + list);
    try {
        Iterator iter = list.iterator();
        while (iter.hasNext()) {
            String e = (String) iter.next();
            System.out.println(e);
            if ("Two".equals(e)) {
                System.out.println("Calling iter.remove()...");
                iter.remove();
            }
        }
    } catch (Exception ex) {
        System.out.println(ex.getClass().getName());
    }
    System.out.println("list: " + list);
}
项目:Homework    文件:HOMEWORK.java   
public List<Emp> getEmpList() throws SQLException
{

    List<Emp> empList = new ArrayList<>();
    DBHelper db = DBHelper.getInstance();
    Connection conn = db.getConnection();
    ResultSet rs = conn.createStatement().executeQuery("SELECT * FROM emp");

    Emp emp = null;
    while(rs.next())
    {
        int empno = rs.getInt("empno");
        String name = rs.getString(2);
        String job = rs.getString(3);
        int mgr = rs.getInt(4);
        String hiredate = rs.getString(5);
        double sal = rs.getDouble(6);
        double comm = rs.getDouble(7);
        int deptno = rs.getInt("deptno");
        empList.add(new Emp(empno, name, job, mgr, hiredate, sal, comm, deptno));
    }   
    db.closeConnection(conn);
    return empList;
}
项目:yadaframework    文件:YadaConfiguration.java   
/**
 * Ritorna la lista di YadaClause trovate nella configurazione
 */
public List<YadaClause> getSetupClauses() {
    List<YadaClause> result = new ArrayList<YadaClause>();
    for (ImmutableHierarchicalConfiguration sub : configuration.immutableConfigurationsAt("config/setup/clauses")) {
        for (Iterator<String> names = sub.getKeys(); names.hasNext();) {
            String name = names.next();
            String content = sub.getString(name);
            YadaClause clause = new YadaClause();
            clause.setName(name);
            clause.setContent(content.trim().replaceAll("\\s+", " ")); // Collasso gli spazi multipli in spazio singolo
            clause.setClauseVersion(1);
            result.add(clause);
        }
    }
    return result;
}
项目:QueryHighlighter    文件:MainActivity.java   
@Override
protected FilterResults performFiltering(CharSequence constraint) {
    final List<String> list;

    if (TextUtils.isEmpty(constraint)) {
        list = mItems;
    } else {
        list = new ArrayList<>();
        final String normalizedConstraint = Normalizer.forSearch(constraint);
        for (String item : mItems) {
            final String normalizedItem = Normalizer.forSearch(item);
            if (normalizedItem.startsWith(normalizedConstraint) || //
                    normalizedItem.contains(" " + normalizedConstraint)) {
                list.add(item);
            }
        }
    }

    final FilterResults results = new FilterResults();
    results.values = list;
    results.count = list.size();
    return results;
}
项目:emufog    文件:BriteFormatReader.java   
@Override
public Graph readGraph(List<Path> files) throws IOException, IllegalArgumentException {
    if (files == null || files.isEmpty()) {
        throw new IllegalArgumentException("No files given to read in.");
    }
    Graph graph = new Graph(settings);

    BufferedReader reader = new BufferedReader(new FileReader(files.get(0).toFile()));

    String currentLine = reader.readLine();
    while (currentLine != null) {
        // read in the nodes of the graph
        if (currentLine.startsWith("Nodes:")) {
            extractNodes(graph, reader);
        }

        // read in the edges of the graph
        if (currentLine.startsWith("Edges:")) {
            extractEdges(graph, reader);
        }

        currentLine = reader.readLine();
    }

    return graph;
}
项目:kafka-0.11.0.0-src-with-comment    文件:ConnectorsResourceTest.java   
@Test
public void testRestartConnectorLeaderRedirect() throws Throwable {
    final Capture<Callback<Void>> cb = Capture.newInstance();
    herder.restartConnector(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb));
    expectAndCallbackNotLeaderException(cb);

    EasyMock.expect(RestServer.httpRequest(EasyMock.eq("http://leader:8083/connectors/" + CONNECTOR_NAME + "/restart?forward=true"),
            EasyMock.eq("POST"), EasyMock.isNull(), EasyMock.<TypeReference>anyObject()))
            .andReturn(new RestServer.HttpResponse<>(202, new HashMap<String, List<String>>(), null));

    PowerMock.replayAll();

    connectorsResource.restartConnector(CONNECTOR_NAME, null);

    PowerMock.verifyAll();
}
项目:metanome-algorithms    文件:FDminimizerShadowedFDFixture.java   
public List<ColumnCombinationBitset> getUCCList() {
    List<ColumnCombinationBitset> uccList = new LinkedList<>();
    uccList.add(new ColumnCombinationBitset(0));
    uccList.add(new ColumnCombinationBitset(1));
    uccList.add(new ColumnCombinationBitset(2, 3, 5));
    uccList.add(new ColumnCombinationBitset(2, 4, 5));
    uccList.add(new ColumnCombinationBitset(5, 7));
    return uccList;
}
项目:OperatieBRP    文件:ExistentieleFunctieSignatuur.java   
@Override
public boolean test(final List<Expressie> argumenten, final Context context) {
    boolean match = false;
    if (argumenten != null && argumenten.size() == AANTAL_ARGUMENTEN) {
        match = argumenten.get(1).isVariabele();
    }
    return match;
}
项目:buenojo    文件:CourseLevelSessionResource.java   
/**
 * GET  /courseLevelSessions -> get all the courseLevelSessions.
 */
@RequestMapping(value = "/courseLevelSessions",
    method = RequestMethod.GET,
    produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public List<CourseLevelSession> getAllCourseLevelSessions() {
    log.debug("REST request to get all CourseLevelSessions");
    return courseLevelSessionRepository.findAll();
}
项目:live_master    文件:DanmakuFilters.java   
@Override
public void setData(List<T> data) {
    reset();
    if (data != null) {
        for (T i : data) {
            addToBlackList(i);
        }
    }
}
项目:Selenium-Foundation    文件:TableComponent.java   
public int[] getBodyRefreshCounts() {
    List<TableRowComponent> tableRows = getTableRows();
    int[] counts = new int[tableRows.size()];
    for (int i = 0; i < tableRows.size(); i++) {
        counts[i] = tableRows.get(i).getRefreshCount();
    }
    return counts;
}
项目:jaffa-framework    文件:TransformationHandler.java   
/**
 * Adds a new handler to the end of the list of all handlers.
 */
public void appendTransformationHandlers(List<ITransformationHandler> handlers) {
    for (ITransformationHandler handler : handlers) {
        handler.setTargetBean(this);
        transformationHandlers.add(handler);
    }
}
项目:batch-scheduler    文件:DomainServiecImpl.java   
@Override
public DomainDto findAll(String domainId) {
    List<DomainEntity> list = domainDao.findAll();
    Set<String> set = shareDomainDaoo.findShareDomain(domainId);
    for (int i = 0; i < list.size(); i++) {
        if (!set.contains(list.get(i).getDomainId())) {
            list.remove(i);
            i--;
        }
    }
    DomainDto domainDto = new DomainDto();
    domainDto.setDomainId(domainId);
    domainDto.setOwnerList(list);
    return domainDto;
}
项目:Nird2    文件:BlogManagerImpl.java   
@Override
public Collection<Blog> getBlogs(LocalAuthor localAuthor)
        throws DbException {

    Collection<Blog> allBlogs = getBlogs();
    List<Blog> blogs = new ArrayList<Blog>();
    for (Blog b : allBlogs) {
        if (b.getAuthor().equals(localAuthor)) {
            blogs.add(b);
        }
    }
    return blogs;
}
项目:avro-schema-editor    文件:SchemaUtil.java   
public static boolean isMultiChoiceUnion(Schema unionSchema) {
    List<Schema> unionTypes = unionSchema.getTypes();
    int nbrOfNoNullChild = 0;
    for (Schema unionType : unionTypes) {
        if (unionType.getType() != Type.NULL) {
            nbrOfNoNullChild++;
        }
    }
    return nbrOfNoNullChild > 1;
}
项目:alfresco-repository    文件:AlfrescoEnviroment.java   
@Override
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern,
            QNamePattern qnamePattern, int maxResults, boolean preload) throws InvalidNodeRefException
{
    NodeService nodeService = apiFacet.getNodeService();
    return nodeService.getChildAssocs(nodeRef,
                                      typeQNamePattern,
                                      qnamePattern,
                                      maxResults,
                                      preload);
}
项目:jmeter-bzm-plugins    文件:BlazeMeterBackendListenerClient.java   
@Override
public void handleSampleResults(List<SampleResult> list, BackendListenerContext backendListenerContext) {
    if (isInterruptedThroughUI) {
        return;
    }

    accumulator.addAll(list);
    JSONObject data = JSONConverter.convertToJSON(accumulator, list);

    int counter = 0;
    while (!apiClient.isTestStarted() && counter < 3) {
        log.debug("Waiting for test starting");
        makeDelay();
        counter++;
    }

    try {
        apiClient.sendOnlineData(data);
    } catch (JMeterStopTestException ex) {
        isInterruptedThroughUI = true;
        StandardJMeterEngine.stopEngineNow();
    } catch (IOException e) {
        log.warn("Failed to send data: " + data, e);
    }

    makeDelay();
}
项目:weex-uikit    文件:WXTextDomObject.java   
protected void updateSpannable(Spannable spannable, int spanFlag) {
  List<SetSpanOperation> ops = createSetSpanOperation(spannable.length(), spanFlag);
  if (mFontSize == UNSET) {
    ops.add(new SetSpanOperation(0, spannable.length(),
                                 new AbsoluteSizeSpan(WXText.sDEFAULT_SIZE), spanFlag));
  }
  Collections.reverse(ops);
  for (SetSpanOperation op : ops) {
    op.execute(spannable);
  }
}
项目:otter-G    文件:DatabaseExtractor.java   
private List<String> select(DbDialect dbDialect, String schemaName, String tableName, TableData keyTableData,
                            TableData columnTableData) throws InterruptedException {
    String selectSql = dbDialect.getSqlTemplate().getSelectSql(schemaName,
        tableName,
        keyTableData.columnNames,
        columnTableData.columnNames);
    Exception exception = null;
    for (int i = 0; i < retryTimes; i++) {
        if (Thread.currentThread().isInterrupted()) {
            throw new InterruptedException(); // 退出
        }

        try {
            List<List<String>> result = dbDialect.getJdbcTemplate().query(selectSql,
                keyTableData.columnValues,
                keyTableData.columnTypes,
                new RowDataMapper(columnTableData.columnTypes));
            if (CollectionUtils.isEmpty(result)) {
                logger.warn("the mediaName = {}.{} not has rowdate in db \n {}", new Object[] { schemaName,
                        tableName, dumpEventData(eventData, selectSql) });
                return null;
            } else {
                return result.get(0);
            }

        } catch (Exception e) {
            exception = e;
            logger.warn("retry [" + (i + 1) + "] failed", e);
        }
    }

    throw new RuntimeException("db extract failed , data:\n " + dumpEventData(eventData, selectSql), exception);
}
项目:Mod-Tools    文件:FileSystemParserTest.java   
/**
 * Test of handle method, of class FileSystemParser.
 */
@Test
public void testHandle() {
    System.out.println("handle");
    try {
        EntityManager manager = new PersistenceProvider().get();
        if(!manager.getTransaction().isActive()) {
            manager.getTransaction().begin();
        }
        manager.persist(new Modification("FileSystemParserTest.mod",32));
        manager.getTransaction().commit();
        new File(getAllowedFolder()+"/commons").mkdirs();
        IOUtils.copy(getClass().getResourceAsStream("/test.txt"), FileUtils.openOutputStream(new File(getAllowedFolder()+"/commons/test.txt")));
        List <ProcessTask> result = get().handle(manager);
        Assert.assertTrue(
            "result is not of correct type",
            result instanceof List<?>
        );
        Assert.assertEquals(
            "Unexpected follow-ups",
            0,
            result.size()
        );
    } catch(Exception ex) {
        Assert.fail(ex.getMessage());
    }
}
项目:featurea    文件:FontCreator.java   
public void createFont(final File fntFile, final String name, final int size, final boolean isBold, final boolean isItalic) {
    final JFrame frame = new JFrame() {{
        pack();
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); // IMPORTANT
    }};
    frame.getContentPane().add(new MyLwjglCanvas(new ApplicationAdapter() {
        private final UnicodeFont unicodeFont = new UnicodeFont(Font.decode(name), size, isBold, isItalic);

        @Override
        public void create() {
            unicodeFont.setMono(false);
            unicodeFont.setPaddingTop(PADDING);
            unicodeFont.setPaddingRight(PADDING);
            unicodeFont.setPaddingBottom(PADDING);
            unicodeFont.setPaddingLeft(PADDING);
            unicodeFont.setPaddingAdvanceX(-2 * PADDING);
            unicodeFont.setPaddingAdvanceY(-2 * PADDING);
            unicodeFont.setGlyphPageWidth(1024);
            unicodeFont.setGlyphPageHeight(512);
            unicodeFont.setRenderType(UnicodeFont.RenderType.Java);
            List effects = unicodeFont.getEffects();
            effects.add(new ColorEffect(Color.white));
            unicodeFont.addGlyphs(CHARACTERS);
            try {
                FileUtil.createNewFile(fntFile);
                new BMFontUtil(unicodeFont).save(fntFile);
            } catch (Throwable ex) {
                ex.printStackTrace();
            }
            if ("studio".equals(System.getProperty("featurea.launcher"))) {
                frame.dispose();
            } else {
                frame.setVisible(false);
            }
        }
    }).getCanvas());
}
项目:BittrexJavaWrapper    文件:PublicAPITests.java   
@Test
public void testGetOrderBookSellOnlyQuery() {
    String url = "https://bittrex.com/api/v1.1/public/getorderbook?market=BTC-ETH&type=sell";
    String response = Bittrex.getJSONFromBittrex(url);

    GetOrderBookSellOnlyContainer getOrderBookSellOnlyContainer = gson.fromJson(response, GetOrderBookSellOnlyContainer.class);
    Assert.assertNotNull(objNullMsg("GetOrderBookSellOnlyContainer"), getOrderBookSellOnlyContainer);
    Assert.assertTrue(falseFlagMsg("GetOrderBookSellOnlyContainer"), getOrderBookSellOnlyContainer.getSuccess());

    List<OrderBookEntry> sell = getOrderBookSellOnlyContainer.getSell();
    Assert.assertNotNull("List of Sell Orders", sell);
    Assert.assertTrue("Size of sell should be > 0", sell.size() > 0);
    Assert.assertTrue("Amount of quantity on a sell order should be > 0", sell.get(0).getQuantity() > 0);
}
项目:shareNote    文件:ReadArticleActivity.java   
@Override
    protected void onListener() {
        super.onListener();
        rvComments.addOnItemTouchListener(new OnItemChildClickListener() {

            @Override
            public void SimpleOnItemChildClick(BaseQuickAdapter baseQuickAdapter, View view, int i) {
                switch (view.getId()) {
                    case R.id.btnReply:
                        List<MultiItemEntity> res = baseQuickAdapter.getData();
                        CommentFill commentFill = (CommentFill) res.get(i);
                        Comment comment = commentFill.getComment();
                        clickReply(comment.getUser(), comment);
                        break;
                    case R.id.imgHead:
//                        ToastUtil.getInstance().showLongT("点击头像,跳转用户信息界面");
                        break;
                    case R.id.tvReplyUser:
                        if (!(baseQuickAdapter.getData().get(i) instanceof ReplyFill)) {
                            break;
                        }
                        ReplyFill replyFill = (ReplyFill) baseQuickAdapter.getData().get(i);
                        Reply reply = replyFill.getReply();
                        clickReply(reply.getSpeakUser(), reply.getComment());
                        break;
                    case R.id.tvReplyWho:
                        if (!(baseQuickAdapter.getData().get(i) instanceof ReplyFill)) {
                            break;
                        }
                        ReplyFill replyFillWho = (ReplyFill) baseQuickAdapter.getData().get(i);
                        Reply replyWho = replyFillWho.getReply();
                        clickReply(replyWho.getReplyUser(), replyWho.getComment());
                        break;
                }
            }
        });
    }
项目:azure-libraries-for-java    文件:CertificatesInner.java   
/**
 * Get all certificates in a resource group.
 * Get all certificates in a resource group.
 *
 * @param resourceGroupName Name of the resource group to which the resource belongs.
 * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
 * @throws IllegalArgumentException thrown if parameters fail the validation
 * @return the {@link ServiceFuture} object
 */
public ServiceFuture<List<CertificateInner>> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback<CertificateInner> serviceCallback) {
    return AzureServiceFuture.fromPageResponse(
        listByResourceGroupSinglePageAsync(resourceGroupName),
        new Func1<String, Observable<ServiceResponse<Page<CertificateInner>>>>() {
            @Override
            public Observable<ServiceResponse<Page<CertificateInner>>> call(String nextPageLink) {
                return listByResourceGroupNextSinglePageAsync(nextPageLink);
            }
        },
        serviceCallback);
}
项目:incubator-netbeans    文件:LessPreferencesValidator.java   
@Override
public LessPreferencesValidator validateMappings(@NullAllowed FileObject root, boolean enabled, List<Pair<String, String>> mappings) {
    if (enabled) {
        result.merge(new CssPreprocessorUtils.MappingsValidator("less") // NOI18N
                .validate(root, mappings)
                .getResult());
    }
    return this;
}
项目:c4sg-services    文件:OrganizationServiceImpl.java   
@Override
public List<OrganizationDTO> findByUser(Integer userId) {
  User user = userDAO.findById(userId);
  requireNonNull(user, "Invalid User Id");
  List<UserOrganization> userOrganizations = userOrganizationDAO.findByUserId(userId);
  List<OrganizationDTO> organizationDtos = new ArrayList<OrganizationDTO>();
  for (UserOrganization userOrganization : userOrganizations) {
    organizationDtos.add(organizationMapper.getOrganizationDtoFromEntity(userOrganization));
  }
  return organizationDtos;
}
项目:CXJPadProject    文件:QuoteProcessOuterItem.java   
public QuoteProcessOuterItem(Activity activity, QuoteProcessFragment bFragment, List<InquiryInfo.AccectFlag> selectList,
                             QuoteProcessModel quoteProcessModel, QuoteProcessFragment.TmpSelectModel[] tmpSelectModel,
                             Map<String, String> carrierNameMap, OnPictureBtnClickListener onPictureBtnClickListener) {
    this.activity = activity;
    this.bFragment = bFragment;
    this.selectList = selectList;
    this.quoteProcessModel = quoteProcessModel;
    this.tmpSelectModel = tmpSelectModel;
    this.carrierNameMap = carrierNameMap;
    this.onPictureBtnClickListener = onPictureBtnClickListener;
}
项目:Android-Code-Demos    文件:Features2d.java   
public static void drawMatches2(Mat img1, MatOfKeyPoint keypoints1, Mat img2, MatOfKeyPoint keypoints2, List<MatOfDMatch> matches1to2, Mat outImg, Scalar matchColor, Scalar singlePointColor, List<MatOfByte> matchesMask, int flags)
{
    Mat keypoints1_mat = keypoints1;
    Mat keypoints2_mat = keypoints2;
    List<Mat> matches1to2_tmplm = new ArrayList<Mat>((matches1to2 != null) ? matches1to2.size() : 0);
    Mat matches1to2_mat = Converters.vector_vector_DMatch_to_Mat(matches1to2, matches1to2_tmplm);
    List<Mat> matchesMask_tmplm = new ArrayList<Mat>((matchesMask != null) ? matchesMask.size() : 0);
    Mat matchesMask_mat = Converters.vector_vector_char_to_Mat(matchesMask, matchesMask_tmplm);
    drawMatches2_0(img1.nativeObj, keypoints1_mat.nativeObj, img2.nativeObj, keypoints2_mat.nativeObj, matches1to2_mat.nativeObj, outImg.nativeObj, matchColor.val[0], matchColor.val[1], matchColor.val[2], matchColor.val[3], singlePointColor.val[0], singlePointColor.val[1], singlePointColor.val[2], singlePointColor.val[3], matchesMask_mat.nativeObj, flags);

    return;
}
项目:Spring-5.0-Cookbook    文件:DeptAsyncController.java   
@GetMapping(value="/webSyncDeptList.json", produces ="application/json", headers = {"Accept=text/xml, application/json"})
public WebAsyncTask<List<Department>> websyncDeptList(){

    Callable<List<Department>> callable = new Callable<List<Department>>() {
        public List<Department> call() throws Exception {
             return departmentServiceImpl.readDepartments().get(500, TimeUnit.MILLISECONDS);
        }
    };
    return new WebAsyncTask<List<Department>>(500, callable);
}
项目:alfresco-remote-api    文件:CustomModelsImpl.java   
@Override
public CollectionWithPagingInfo<CustomType> getCustomTypes(String modelName, Parameters parameters)
{
    CustomModelDefinition modelDef = getCustomModelImpl(modelName);
    Collection<TypeDefinition> typeDefinitions = modelDef.getTypeDefinitions();
    // TODO Should we support paging?
    Paging paging = Paging.DEFAULT;

    List<CustomType> customTypes = convertToCustomTypes(typeDefinitions, false);

    return CollectionWithPagingInfo.asPaged(paging, customTypes, false, typeDefinitions.size());

}