本文整理汇总了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);
}
}
示例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;
}
示例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();
}
}
}
示例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;
}
示例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);
});
}
示例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);
});
}
示例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<>();
}
示例8: ReadOnlyLinkedMapValuesView
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public ReadOnlyLinkedMapValuesView(LinkedMap parent) {
this.parent = parent;
}
示例9: createValuesIterator
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
public static Iterator createValuesIterator(LinkedMap linkedMap) {
return new ReadOnlyValuesIterator(linkedMap);
}
示例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);
}
示例11: ResourceLineage
import org.apache.commons.collections4.map.LinkedMap; //导入依赖的package包/类
/**
* Empty lineage for objects rooted in the URL.
*/
public ResourceLineage() {
resourceMap = new LinkedMap<>();
}
示例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;
}