Java Code Examples for org.apache.commons.collections4.map.LinkedMap#put()
The following examples show how to use
org.apache.commons.collections4.map.LinkedMap#put() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GroupDelegate.java From cuba with Apache License 2.0 | 6 votes |
protected GroupInfo<MetaPropertyPath> groupItems(int propertyIndex, GroupInfo parent, List<GroupInfo> children, T item, LinkedMap<MetaPropertyPath, Object> groupValues) { 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; }
Example 2
Source File: ContainerGroupTableItems.java From cuba with Apache License 2.0 | 5 votes |
@Nullable protected GroupInfo<MetaPropertyPath> groupItems(int propertyIndex, @Nullable GroupInfo parent, List<GroupInfo> children, E item, LinkedMap<MetaPropertyPath, Object> groupValues) { 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; }