本文整理汇总了Java中com.google.common.collect.Multimaps.unmodifiableMultimap方法的典型用法代码示例。如果您正苦于以下问题:Java Multimaps.unmodifiableMultimap方法的具体用法?Java Multimaps.unmodifiableMultimap怎么用?Java Multimaps.unmodifiableMultimap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Multimaps
的用法示例。
在下文中一共展示了Multimaps.unmodifiableMultimap方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateHeaderCache
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Generates the header cache.
*/
private synchronized void generateHeaderCache() {
if (headerCache != null) {
// already generated cache
return;
}
// generate the multimap
Multimap<String, String> headers = HashMultimap.create();
if (base.headers != null) {
for (Header header : base.headers) {
headers.putAll(header.name, header.value);
}
}
headerCache = Multimaps.unmodifiableMultimap(headers);
}
示例2: indexByRow
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Indexes annotation records converted from the CSV file by row.
*
* The returned multimap uses: key=annotated_name, values=[annotations_names]
*
* This allows to merge rows sharing the same key, and for all column values
* to be unique for a given line.
*
* @param records the CsvAnnotationLines parsed from file
* @return the annotation values keyed by annotated name (eg. dataset name)
*/
public static Multimap<String, String> indexByRow(Collection<CsvAnnotationLine> records) {
Multimap<String, String> result = HashMultimap.create();
if (null != records) {
for (CsvAnnotationLine line : records) {
String rowKey = line.getAnnotatedName();
Collection<String> columnValues = line.getAnnotationsValues();
if (null != rowKey && null != columnValues) {
result.putAll(rowKey, columnValues);
} else {
LOG.warn("WARNING - Null annotated name or values : {} - {}",
rowKey, columnValues);
}
}
}
return Multimaps.unmodifiableMultimap(result);
}
示例3: OnderzoekIndex
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Constructor.
* @param modelIndex modelindex van een gegeven metamodel
*/
OnderzoekIndex(final ModelIndex modelIndex) {
this.modelIndex = modelIndex;
bouwGegevenInOnderzoekenMap();
final Indexer indexer = new Indexer();
indexer.visit(modelIndex.getMetaObject());
gegevensInOnderzoek = Multimaps.unmodifiableMultimap(indexer.gegevensInOnderzoekTemp);
objectenInOnderzoek = Collections.unmodifiableMap(indexer.objectenInOnderzoekTemp);
}
示例4: bouwGegevenInOnderzoekenMap
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
private void bouwGegevenInOnderzoekenMap() {
final Multimap<ElementObject, Onderzoekbundel> tempElementNaarGegevenInOnderzoekMap = LinkedHashMultimap.create();
final Set<MetaGroep> groepen = modelIndex.geefGroepenVanElement(GEGEVENINONDERZOEK_IDENTITEIT);
for (final MetaGroep metaGroep : groepen) {
for (final MetaRecord record : metaGroep.getRecords()) {
final Onderzoekbundel onderzoekbundel = new Onderzoekbundel(record);
tempElementNaarGegevenInOnderzoekMap.put(onderzoekbundel.getElement(), onderzoekbundel);
}
}
elementNaarGegevenInOnderzoekMap = Multimaps.unmodifiableMultimap(tempElementNaarGegevenInOnderzoekMap);
}
示例5: fromIterable
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Creates a {@link MultimapView} from the provided values. The provided {@link Coder} is used
* to guarantee structural equality for keys instead of assuming Java object equality.
*/
public static <K, V> MultimapView<K, V> fromIterable(
Coder<K> keyCoder, Iterable<KV<K, V>> values) {
// We specifically use an array list multimap to allow for:
// * null keys
// * null values
// * duplicate values
Multimap<Object, Object> multimap = ArrayListMultimap.create();
for (KV<K, V> value : values) {
multimap.put(keyCoder.structuralValue(value.getKey()), value.getValue());
}
return new InMemoryMultimapSideInputView(keyCoder, Multimaps.unmodifiableMultimap(multimap));
}
示例6: inverse
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public Multimap<V, K> inverse()
{
return Multimaps.unmodifiableMultimap(reverseMap);
}
示例7: getTaskProcessorMap
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public Multimap<String, Pair<Class<?>, TaskProcessor>> getTaskProcessorMap() {
return Multimaps.unmodifiableMultimap(taskProcessorMap);
}
示例8: getPackageToBlamedResources
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/** Must first call {@link #blame}. */
public Multimap<PackageChunk, ResourceEntry> getPackageToBlamedResources() {
return Multimaps.unmodifiableMultimap(packageToBlame);
}
示例9: getTypeEntryToBlamedResources
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/** Must first call {@link #blame}. */
public Multimap<TypeChunk.Entry, ResourceEntry> getTypeEntryToBlamedResources() {
return Multimaps.unmodifiableMultimap(typeEntryToBlame);
}
示例10: getMessagesByElement
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
public Multimap<String, String> getMessagesByElement() {
return Multimaps.unmodifiableMultimap(messagesByElement);
}
示例11: inverse
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* @return an unmodifiable inverse view that will stay in sync
*/
public Multimap<V, K> inverse() {
return Multimaps.unmodifiableMultimap(mapInv);
}
示例12: getMetadata
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* @return the metadata contained.
*/
public Multimap<String, MetadataValue> getMetadata() {
return Multimaps.unmodifiableMultimap(metadata);
}
示例13: getModules
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Returns an unmodifiable map of all the registered module classes and their instances in this container.
*
* @return a map of classes and their module instances
*/
public Multimap<Class<? extends Module>, Module> getModules() {
return Multimaps.unmodifiableMultimap(this.modules);
}
示例14: getAccessorAdditionalInfo
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Returns the {@link Multimap} of JavaBean getter method names that access
* persistable properties, mapped to additional property names that the
* session {@link SPPersister} requires to convert the accessor's returned
* value into a basic persistable type. The order of this {@link Multimap}
* is guaranteed.
*
* @see Accessor#additionalInfo()
*/
public Multimap<String, String> getAccessorAdditionalInfo() {
return Multimaps.unmodifiableMultimap(accessorAdditionalInfo);
}
示例15: getMutatorExtraParameters
import com.google.common.collect.Multimaps; //导入方法依赖的package包/类
/**
* Returns the {@link Multimap} of JavaBean setter method names that mutate
* persistable properties, mapped to {@link MutatorParameterObject}s that
* contain values for an {@link SPPersister} to use. The order of this
* {@link Multimap} is guaranteed.
*/
public Multimap<String, MutatorParameterObject> getMutatorExtraParameters() {
return Multimaps.unmodifiableMultimap(mutatorExtraParameters);
}