当前位置: 首页>>代码示例>>Java>>正文


Java Pair.get1方法代码示例

本文整理汇总了Java中jloda.util.Pair.get1方法的典型用法代码示例。如果您正苦于以下问题:Java Pair.get1方法的具体用法?Java Pair.get1怎么用?Java Pair.get1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jloda.util.Pair的用法示例。


在下文中一共展示了Pair.get1方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: apply

import jloda.util.Pair; //导入方法依赖的package包/类
public void apply(NexusStreamParser np) throws Exception {
    np.matchIgnoreCase("queryServer url=");
    final String url = np.getWordFileNamePunctuation().replace("http://", "").replace("/MeganServer", "").replace("/$", "");
    np.matchIgnoreCase("query=");
    String query = np.getWordMatchesIgnoringCase("numberOfFiles listFiles");
    np.matchIgnoreCase(";");

    Pair<String, String> credentials = RemoteServiceManager.getCredentials(url);

    if (credentials == null) {
        NotificationsInSwing.showError(getViewer().getFrame(), "Server unknown to MEGAN (please first add it): " + url);
    } else {
        final String fullURL = RemoteServiceManager.getServerURL(url);
        final Megan5ServerConnector connector = new Megan5ServerConnector(fullURL, credentials.get1(), credentials.get2());
        if (query.equalsIgnoreCase("countFiles")) {
            Director.showMessageWindow();
            System.out.println("Server=" + url + ", number of files=" + connector.getAvailiableDatasets().length);
        } else if (query.equalsIgnoreCase("listFiles")) {
            Director.showMessageWindow();
            System.out.println("Server=" + url + ", available files:\n");
            RMADataset[] datasets = connector.getAvailiableDatasets();
            for (RMADataset dataset : datasets) {
                System.out.println(dataset.getDatasetName());
            }
        }
    }
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:28,代码来源:QueryServerCommand.java

示例2: getFont

import jloda.util.Pair; //导入方法依赖的package包/类
public Font getFont(String target) {
    Pair<Font, Color> pair = fonts.get(target);
    if (pair == null || pair.get1() == null)
        return getFont();
    else
        return pair.get1();
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:8,代码来源:ChartDrawerBase.java

示例3: getUser

import jloda.util.Pair; //导入方法依赖的package包/类
/**
 * get the remote user
 *
 * @param localFileName
 * @return remote user
 */
public static String getUser(String localFileName) {
    localFileName = localFileName.replaceAll("/MeganServer$", "");

    if (isRemoteFile(localFileName)) {
        final Pair<String, String> credentials = getCredentials(getServerShortName(localFileName));
        if (credentials != null)
            return credentials.get1();
    }
    return null;
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:17,代码来源:RemoteServiceManager.java

示例4: saveCredentialsToProperties

import jloda.util.Pair; //导入方法依赖的package包/类
/**
 * save all credentials to properties
 */
public static void saveCredentialsToProperties() {
    List<String> list = new LinkedList<>();

    for (String server : server2Credentials.keySet()) {
        Pair<String, String> pair = server2Credentials.get(server);
        String user = pair.get1();
        String encodedPassword = Base64.encodeBase64String(pair.get2().getBytes());
        list.add(server + "::" + user + "::" + encodedPassword);
    }
    ProgramProperties.put("MeganServerCredentials", list.toArray(new String[list.size()]));
}
 
开发者ID:danielhuson,项目名称:megan-ce,代码行数:15,代码来源:RemoteServiceManager.java


注:本文中的jloda.util.Pair.get1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。