本文整理汇总了Java中com.beust.jcommander.internal.Maps.newLinkedHashMap方法的典型用法代码示例。如果您正苦于以下问题:Java Maps.newLinkedHashMap方法的具体用法?Java Maps.newLinkedHashMap怎么用?Java Maps.newLinkedHashMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.beust.jcommander.internal.Maps
的用法示例。
在下文中一共展示了Maps.newLinkedHashMap方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sort
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
@Override
public Map sort(Class type, Map keyedByFieldKey) {
Annotation sequence = type.getAnnotation(XMLSequence.class);
if (sequence != null) {
final String[] fieldsOrder = ((XMLSequence) sequence).value();
Map<Object, Object> result = Maps.newLinkedHashMap();
Set<Map.Entry<FieldKey, Field>> fields = keyedByFieldKey.entrySet();
for (String fieldName : fieldsOrder) {
if (fieldName != null) {
for (Map.Entry<FieldKey, Field> fieldEntry : fields) {
if (fieldName.equals(fieldEntry.getKey().getFieldName())) {
result.put(fieldEntry.getKey(), fieldEntry.getValue());
}
}
}
}
return result;
} else {
return keyedByFieldKey;
}
}
示例2: getCommands
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
public Map<String, JCommander> getCommands() {
Map<String, JCommander> res = Maps.newLinkedHashMap();
for (Map.Entry<ProgramName, JCommander> entry : commands.entrySet()) {
res.put(entry.getKey().name, entry.getValue());
}
return res;
}
示例3: init
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
public void init(Module... modules) {
if(modules == null) {
modules = new Module[0];
}
this.metricModule = new JavaTestModule.MetricModule();
injector = Guice.createInjector(Iterables.concat(ImmutableList.<Module>of(new CompilingTestModule()), Arrays.asList(modules)));
source = injector.getInstance(ASMClassSource.class);
scope = new GambitSource(source);
this.modules = Maps.newLinkedHashMap();
this.views = Maps.newHashMap();
this.sources = Maps.newLinkedHashMap();
}
示例4: getCommands
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
public Map<String, JCommander> getCommands() {
Map<String, JCommander> res = Maps.newLinkedHashMap();
for (Map.Entry<ProgramName, JCommander> entry : m_commands.entrySet()) {
res.put(entry.getKey().m_name, entry.getValue());
}
return res;
}
示例5: getDescription
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
public static AnalysisEngineDescription getDescription() throws UIMAException, IOException {
Map<String, MetaDataObject> aeDescriptions = Maps.newLinkedHashMap();
aeDescriptions.put("tokenizer", TokenizerAPI.getAEImport());
aeDescriptions.put("sentenceSplitter", SentenceSplitterAPI.getAEImport());
Import posTaggerDescImport = new Import_impl();
posTaggerDescImport.setName("com.textocat.textokit.postagger.postagger-ae");
aeDescriptions.put("pos-tagger", posTaggerDescImport);
//
return PipelineDescriptorUtils.createAggregateDescription(
ImmutableList.copyOf(aeDescriptions.values()),
ImmutableList.copyOf(aeDescriptions.keySet()));
}
示例6: getSonarProperties
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
/**
* The String key/value pairs to be passed to the Sonar Runner.
*
* {@code null} values are not permitted.
*/
@Input
public Map<String, Object> getSonarProperties() {
if (sonarProperties == null) {
sonarProperties = Maps.newLinkedHashMap();
}
return sonarProperties;
}
示例7: getCommands
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
public Map<String, JCommander> getCommands() {
Map<String, JCommander> res = Maps.newLinkedHashMap();
for (Map.Entry<ProgramName, JCommander> entry : m_commands.entrySet()) {
res.put(entry.getKey().m_name, entry.getValue());
}
return res;
}
示例8: deduplicateMedia
import com.beust.jcommander.internal.Maps; //导入方法依赖的package包/类
/**
* Merges media records if the same image URL or link is given several times.
* Remove any media that has not either a file or webpage uri.
* @return a new list
*/
private static List<MediaObject> deduplicateMedia(List<MediaObject> mediaList) {
Map<String, MediaObject> media = Maps.newLinkedHashMap();
for (MediaObject m : mediaList) {
URI uri = getPreferredURI(m);
if (uri != null) {
String url = uri.toString();
if (!media.containsKey(url)) {
media.put(url, m);
}
}
}
return Lists.newArrayList(media.values());
}