Package org.aoju.bus.core.map
Class GraphMap<T>
java.lang.Object
org.aoju.bus.core.map.MapWrapper<T,Collection<T>>
org.aoju.bus.core.map.AbstractCollValueMap<T,T>
org.aoju.bus.core.map.SetValueMap<T,T>
org.aoju.bus.core.map.GraphMap<T>
- Type Parameters:
T- 节点类型
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Map.Entry<T,,Collection<T>>> Map<T,,Collection<T>> XWrapper<Map<T,,Collection<T>>> MultiValueMap<T,T>
支持处理无向图结构的
Map,本质上是基于SetValueMap实现的邻接表- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.aoju.bus.core.map.AbstractCollValueMap
DEFAULT_COLLECTION_INITIAL_CAPACITYFields inherited from class org.aoju.bus.core.map.MapWrapper
DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsAssociation(T target1, T target2) 两节点是否存在直接或间接的关联booleancontainsEdge(T target1, T target2) 是否存在边getAdjacentPoints(T target) 获取节点的邻接节点getAssociatedPoints(T target, boolean includeTarget) 按广度优先,获得节点的所有直接或间接关联的节点,节点默认按添加顺序排序void添加边voidremoveEdge(T target1, T target2) 移除边voidremovePoint(T target) 移除节点,并删除该节点与其他节点之间连成的边Methods inherited from class org.aoju.bus.core.map.SetValueMap
createCollectionMethods inherited from class org.aoju.bus.core.map.AbstractCollValueMap
filterAllValues, putAllValues, putValue, removeAllValues, removeValue, replaceAllValuesMethods inherited from class org.aoju.bus.core.map.MapWrapper
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, getRaw, hashCode, isEmpty, iterator, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface org.aoju.bus.core.map.MultiValueMap
allForEach, allValues, filterAllValues, getValue, getValues, put, putAll, putAllValues, putValues, removeValues, replaceAllValues, size
-
Constructor Details
-
GraphMap
public GraphMap()
-
-
Method Details
-
putEdge
-
containsEdge
-
removeEdge
-
removePoint
-
containsAssociation
-
getAssociatedPoints
按广度优先,获得节点的所有直接或间接关联的节点,节点默认按添加顺序排序- Parameters:
target- 节点includeTarget- 是否包含查询节点- Returns:
- 节点的所有关联节点
-
getAdjacentPoints
-