Package org.opencms.ade.publish
Class CmsPublishRelationFinder.ResourceMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<CmsResource,java.util.Set<CmsResource>>
-
- org.opencms.ade.publish.CmsPublishRelationFinder.ResourceMap
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<CmsResource,java.util.Set<CmsResource>>
- Enclosing class:
- CmsPublishRelationFinder
public static class CmsPublishRelationFinder.ResourceMap extends java.util.HashMap<CmsResource,java.util.Set<CmsResource>>
A map from resources to sets of resources, which automtically instantiates an empty set when accessing a key that doesn't exist via get().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceMap()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsPublishRelationFinder.ResourceMap
filter(com.google.common.base.Predicate<CmsResource> pred)
Creates a new resource map based on this instance while filtering some elements out.java.util.Set<CmsResource>
get(java.lang.Object res)
int
totalSize()
Returns the sum of all sizes of set values.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
ResourceMap
public ResourceMap()
Constructor.
-
-
Method Detail
-
filter
public CmsPublishRelationFinder.ResourceMap filter(com.google.common.base.Predicate<CmsResource> pred)
Creates a new resource map based on this instance while filtering some elements out.The given predicate is used to check whether any single resource should be kept. If it returns false for a top-level resource (map key), the parent will be removed and all its children added as keys. If it returns false for a map value, the value will be removed for its key.
- Parameters:
pred
- predicate to check whether resources should be kept- Returns:
- the new filtered resource map
-
get
public java.util.Set<CmsResource> get(java.lang.Object res)
- Specified by:
get
in interfacejava.util.Map<CmsResource,java.util.Set<CmsResource>>
- Overrides:
get
in classjava.util.HashMap<CmsResource,java.util.Set<CmsResource>>
- See Also:
HashMap.get(java.lang.Object)
-
totalSize
public int totalSize()
Returns the sum of all sizes of set values.- Returns:
- the total size
-
-