本文整理汇总了Java中jloda.util.Pair.get2方法的典型用法代码示例。如果您正苦于以下问题:Java Pair.get2方法的具体用法?Java Pair.get2怎么用?Java Pair.get2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jloda.util.Pair
的用法示例。
在下文中一共展示了Pair.get2方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
}
}
示例2: getFontColor
import jloda.util.Pair; //导入方法依赖的package包/类
public Color getFontColor(String target, Color defaultColor) {
Pair<Font, Color> pair = fonts.get(target);
if (pair == null || pair.get2() == null)
return defaultColor;
else
return pair.get2();
}
示例3: getPassword
import jloda.util.Pair; //导入方法依赖的package包/类
/**
* get remote password
*
* @param localFileName
* @return password
*/
public static String getPassword(String localFileName) {
localFileName = localFileName.replaceAll("/MeganServer$", "");
if (isRemoteFile(localFileName)) {
final Pair<String, String> credentials = getCredentials(getServerShortName(localFileName));
if (credentials != null)
return credentials.get2();
}
return null;
}