本文整理汇总了Java中org.apache.commons.collections4.map.LinkedMap类的典型用法代码示例。如果您正苦于以下问题:Java LinkedMap类的具体用法?Java LinkedMap怎么用?Java LinkedMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinkedMap类属于org.apache.commons.collections4.map包,在下文中一共展示了LinkedMap类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doGroup
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
protected void doGroup() {
roots = new LinkedList<>();
parents = new LinkedHashMap<>();
children = new HashMap<>();
groupItems = new HashMap<>();
itemGroups = new HashMap<>();
final Collection<K> itemIds = datasource.getItemIds();
for (final K id : itemIds) {
final T item = datasource.getItem(id);
GroupInfo<MetaPropertyPath> groupInfo = groupItems(0, null, roots, item, new LinkedMap());
if (groupInfo == null) {
throw new IllegalStateException("Item group cannot be NULL");
}
List<K> itemsIds = groupItems.computeIfAbsent(groupInfo, k -> new ArrayList<>());
itemsIds.add(id);
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:21,代码来源:GroupDelegate.java
示例2: groupItems
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
protected GroupInfo<MetaPropertyPath> groupItems(int propertyIndex, GroupInfo parent, List<GroupInfo> children,
T item, final LinkedMap groupValues) {
final MetaPropertyPath property = (MetaPropertyPath) groupProperties[propertyIndex++];
Object itemValue = getValueByProperty(item, property);
groupValues.put(property, itemValue);
GroupInfo<MetaPropertyPath> groupInfo = new GroupInfo<>(groupValues);
itemGroups.put(item.getId(), groupInfo);
if (!parents.containsKey(groupInfo)) {
parents.put(groupInfo, parent);
}
if (!children.contains(groupInfo)) {
children.add(groupInfo);
}
List<GroupInfo> groupChildren =
this.children.computeIfAbsent(groupInfo, k -> new ArrayList<>());
if (propertyIndex < groupProperties.length) {
groupInfo = groupItems(propertyIndex, groupInfo, groupChildren, item, groupValues);
}
return groupInfo;
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:27,代码来源:GroupDelegate.java
示例3: addAudit
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
void addAudit( Audit audit ) throws KettleValueException {
if ( auditSummaries == null ) {
auditSummaries = new LinkedMap<Long, ZendeskTicketAuditHistory>();
}
if ( auditSummaries.size() <= 0 ) {
auditSummaries.put( audit.getId(), new ZendeskTicketAuditHistory( audit ) );
} else {
try {
ZendeskTicketAuditHistory newAudit =
auditSummaries.get( auditSummaries.lastKey() ).createNextAudit( audit, auditSummaries );
auditSummaries.put( audit.getId(), newAudit );
} catch ( CloneNotSupportedException e ) {
e.printStackTrace();
}
}
}
开发者ID:matthewtckr,项目名称:pdi-zendesk-plugin,代码行数:17,代码来源:ZendeskInputTicketAuditData.java
示例4: transformMap
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
/**
* Transforms a map.
* <p>
* The transformer itself may throw an exception if necessary.
*
* @param map the map to transform
* @return the transformed object
*/
@SuppressWarnings("unchecked")
protected Map<K, V> transformMap(final Map<? extends J, ? extends U> map) {
if (map.isEmpty()) {
return (Map<K, V>) map;
}
final Map<K, V> result = new LinkedMap<K, V>(map.size());
for (final Map.Entry<? extends J, ? extends U> entry : map.entrySet()) {
result.put(transformKey(entry.getKey()), transformValue(entry.getValue()));
}
return result;
}
开发者ID:funkemunky,项目名称:HCFCore,代码行数:21,代码来源:TransformedSplitMap.java
示例5: addItemFirst
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
@Override
public void addItemFirst(T item) {
checkNotNullArgument(item, "item is null");
internalAddItem(item, () -> {
LinkedMap tmpMap = (LinkedMap) data.clone();
data.clear();
data.put(item.getId(), item);
data.putAll(tmpMap);
});
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CollectionDatasourceImpl.java
示例6: includeItemFirst
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
@Override
public void includeItemFirst(T item) {
checkNotNullArgument(item, "item is null");
internalIncludeItem(item, () -> {
LinkedMap tmpMap = (LinkedMap) data.clone();
data.clear();
data.put(item.getId(), item);
data.putAll(tmpMap);
});
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CollectionDatasourceImpl.java
示例7: MutableRetentionConfiguration
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public MutableRetentionConfiguration() {
// function map and strategy map need to preserve order.
this.functionMap = new LinkedMap<>();
this.readLevelsMap = new LinkedMap<>();
this.writeLevelMap = new LinkedMap<>();
this.nameRetentionMap = new LinkedMap<>();
// this.strategies = new HashMap<>();
this.levels = new HashMap<>();
}
开发者ID:Tetha,项目名称:bifroest,代码行数:11,代码来源:MutableRetentionConfiguration.java
示例8: ReadOnlyLinkedMapValuesView
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public ReadOnlyLinkedMapValuesView(LinkedMap parent) {
this.parent = parent;
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:4,代码来源:ReadOnlyLinkedMapValuesView.java
示例9: createValuesIterator
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public static Iterator createValuesIterator(LinkedMap linkedMap) {
return new ReadOnlyValuesIterator(linkedMap);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:4,代码来源:ReadOnlyLinkedMapValuesView.java
示例10: GroupInfo
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public GroupInfo(LinkedMap groupingValues) {
this.groupingValues = new LinkedMap(groupingValues);
//noinspection unchecked
groupProperty = (P) groupingValues.get(groupingValues.size() - 1);
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:6,代码来源:GroupInfo.java
示例11: ResourceLineage
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
/**
* Empty lineage for objects rooted in the URL.
*/
public ResourceLineage() {
resourceMap = new LinkedMap<>();
}
开发者ID:yahoo,项目名称:elide,代码行数:7,代码来源:ResourceLineage.java
示例12: BucketSizeInfo
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
BucketSizeInfo(int sizeIndex) {
bucketList = new LinkedMap();
freeBuckets = new LinkedMap();
completelyFreeBuckets = new LinkedMap();
this.sizeIndex = sizeIndex;
}
开发者ID:apache,项目名称:hbase,代码行数:7,代码来源:BucketAllocator.java
注:本文中的org.apache.commons.collections4.map.LinkedMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论