Class PersistedCollectionMemberGraphImpl
- All Implemented Interfaces:
Serializable,PersistedCollectionMemberGraph
** IMPORTANT **
For very large graphs it is the caller's responsibility to properly manage performance and memory
by inflating member references in chunks, rather than one-at-a-time or all-at-once, and deflating
each chunk before inflating the next one. The depth-first navigation iterator provided by this
class offers an inflate option to assist with memory management and performance.
Supported API: true
Extendable: false
- See Also:
-
wt.facade.persistedcollection.PersistedCollectionMemberNodewt.facade.persistedcollection.PersistedCollectionService#getMemberGraph(wt.facade.persistedcollection.PersistedCollectableHolder, java.lang.String, java.util.Locale)- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGraph node representing a single member of a persisted collection.Nested classes/interfaces inherited from interface wt.facade.persistedcollection.PersistedCollectionMemberGraph
PersistedCollectionMemberGraph.DepthIterator, PersistedCollectionMemberGraph.PersistedCollectionMemberNode -
Method Summary
Modifier and TypeMethodDescriptionvoidClear the visited state of all nodes in the member graph.depthIterator(boolean inflate, boolean skipRepeated) Get depth-first graph iterator to PersistedCollectionMemberNode objects with optionally inflated member references.Get collection of all member nodes from the graph.Get set of all members from the graph.Get the display assistant used for localizing relationship roles.Get the holder for which this member graph was created.getMemberNode(PersistedCollectable member) Get the graph node for a collection member.getMemberNode(ObjectReference memberRef) Get the graph node for a collection member.Get member nodes sorted by their maximum level in the graph.Get member nodes corresponding to the seed objects.intsize()Get member graph size.
-
Method Details
-
size
public int size()Get member graph size.
Supported API: true- Specified by:
sizein interfacePersistedCollectionMemberGraph- Returns:
- Number of nodes in member graph.
-
getMemberNode
public PersistedCollectionMemberGraph.PersistedCollectionMemberNode getMemberNode(ObjectReference memberRef) Get the graph node for a collection member.
Supported API: true- Specified by:
getMemberNodein interfacePersistedCollectionMemberGraph- Parameters:
memberRef- ObjectReference for a PersistedCollectable member object.- Returns:
- PersistedCollectionMemberNode for the specified member reference, or null if the reference is not a member of the graph.
-
getMemberNode
public PersistedCollectionMemberGraph.PersistedCollectionMemberNode getMemberNode(PersistedCollectable member) Get the graph node for a collection member.
Supported API: true- Specified by:
getMemberNodein interfacePersistedCollectionMemberGraph- Parameters:
member- PersistedCollectable member object.- Returns:
- PersistedCollectionMemberNode for the specified member object, or null if the object is not a member of the graph.
-
getAllMemberNodes
Get collection of all member nodes from the graph.
Supported API: true- Specified by:
getAllMemberNodesin interfacePersistedCollectionMemberGraph- Returns:
- Collection of all member graph Nodes.
-
getAllMembers
Get set of all members from the graph.
Supported API: true- Specified by:
getAllMembersin interfacePersistedCollectionMemberGraph- Returns:
- Set of all members (non-null, may be empty).
-
clearAllVisited
public void clearAllVisited()Clear the visited state of all nodes in the member graph.
Supported API: true- Specified by:
clearAllVisitedin interfacePersistedCollectionMemberGraph
-
getSeedNodes
Get member nodes corresponding to the seed objects. Depending on how the configuration specifications were set up for the collector, these objects may be the same as the actual seeds or may be different versions of the actual seeds.
Supported API: true- Specified by:
getSeedNodesin interfacePersistedCollectionMemberGraph- Returns:
- Set of Member graph nodes for the seed members.
-
getMemberNodesByLevel
public Map<Integer,Set<PersistedCollectionMemberGraph.PersistedCollectionMemberNode>> getMemberNodesByLevel()Get member nodes sorted by their maximum level in the graph. When navigating nodes by order of increasing level, it is guaranteed that all parents of a node will be visited before the node itself is reached.
Supported API: true- Specified by:
getMemberNodesByLevelin interfacePersistedCollectionMemberGraph- Returns:
- Map of maximum level to member nodes at that level (non-null, may be empty).
-
getHolder
Get the holder for which this member graph was created.
Supported API: true- Specified by:
getHolderin interfacePersistedCollectionMemberGraph- Returns:
- PersistedCollectableHolder object.
-
getDisplayAssistant
Get the display assistant used for localizing relationship roles.
Supported API: true- Specified by:
getDisplayAssistantin interfacePersistedCollectionMemberGraph- Returns:
- AssociationDisplayAssistant object.
-
depthIterator
public PersistedCollectionMemberGraph.DepthIterator depthIterator(boolean inflate, boolean skipRepeated) Get depth-first graph iterator to PersistedCollectionMemberNode objects with optionally inflated member references. The remove() method may not be called for this iterator.Inflating and deflated member references are handled internally to the iterator when created with inflate=true. References are inflated and deflated in chunks to maintain a balance between performance and memory usage. Do not use two or more of these iterators with inflate=true simultaneously for the same member graph (i.e., may result in slow performance or excessive memory usage).
Supported API: true- Specified by:
depthIteratorin interfacePersistedCollectionMemberGraph- Parameters:
inflate- Set true to have the iterator inflate the member references of the nodes being returned by the next() method. Set false to have the iterator return member references in whatever state they are currently in, inflated or deflated.skipRepeated- True to skip repeated branches of the graph, false to iterate over the entire graph (included repeated branches). If true the iterator will return an entire repeated branch the first time it is encountered, but will only return the root node all subsequent times.- Returns:
- Iterator to return member nodes using depth-first graph navigation.
- See Also:
-