Java 类org.apache.commons.collections4.map.LinkedMap 实例源码

项目:cuba    文件:GroupDelegate.java   
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);
    }
}
项目:cuba    文件:GroupDelegate.java   
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;
}
项目:pdi-zendesk-plugin    文件:ZendeskInputTicketAuditData.java   
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();
    }
  }
}
项目:HCFCore    文件:TransformedSplitMap.java   
/**
 * 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;
}
项目:HCFCore    文件:TransformedSplitMap.java   
/**
 * 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;
}
项目:cuba    文件:CollectionDatasourceImpl.java   
@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);
    });
}
项目:cuba    文件:CollectionDatasourceImpl.java   
@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);
    });
}
项目:bifroest    文件:MutableRetentionConfiguration.java   
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<>();
    }
项目:cuba    文件:ReadOnlyLinkedMapValuesView.java   
public ReadOnlyLinkedMapValuesView(LinkedMap parent) {
    this.parent = parent;
}
项目:cuba    文件:ReadOnlyLinkedMapValuesView.java   
public static Iterator createValuesIterator(LinkedMap linkedMap) {
    return new ReadOnlyValuesIterator(linkedMap);
}
项目:cuba    文件:GroupInfo.java   
public GroupInfo(LinkedMap groupingValues) {
    this.groupingValues = new LinkedMap(groupingValues);
    //noinspection unchecked
    groupProperty = (P) groupingValues.get(groupingValues.size() - 1);
}
项目:elide    文件:ResourceLineage.java   
/**
 * Empty lineage for objects rooted in the URL.
 */
public ResourceLineage() {
    resourceMap = new LinkedMap<>();
}
项目:hbase    文件:BucketAllocator.java   
BucketSizeInfo(int sizeIndex) {
  bucketList = new LinkedMap();
  freeBuckets = new LinkedMap();
  completelyFreeBuckets = new LinkedMap();
  this.sizeIndex = sizeIndex;
}
项目:elide    文件:ResourceLineage.java   
/**
 * Extends a lineage with a new resource.
 * @param sharedLineage the shared lineage
 * @param next the next
 */
public ResourceLineage(ResourceLineage sharedLineage, PersistentResource next) {
    resourceMap = new LinkedMap<>(sharedLineage.resourceMap);
    addRecord(next);
}
项目:elide    文件:ResourceLineage.java   
/**
 * Extends a lineage with a new resource that has an alias.  An alias is useful if
 * there are two objects in the lineage with the same type or class.  The resource
 * lineage does not allow two resources to have the same name.  As long as one of the two
 * resources can be given an alias (by annotation), then two objects with the same type/class
 * can exist in the lineage.  This case is likely to be uncommon.
 * @param sharedLineage the shared lineage
 * @param next the next
 * @param nextAlias the next alias
 */
public ResourceLineage(ResourceLineage sharedLineage, PersistentResource next, String nextAlias) {
    resourceMap = new LinkedMap<>(sharedLineage.resourceMap);
    addRecord(next, nextAlias);
}