public class NeighborList extends BoundedPriorityQueue<Neighbor> implements Serializable
Constructor and Description |
---|
NeighborList(int size)
Create a new neighborlist of given size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsNode(Node node)
Returns true if this neighborlist contains a neighbor corresponding to
this node.
|
static ArrayList<Edge> |
Convert2Edges(HashMap<Node,NeighborList> graph) |
int |
countCommonIds(NeighborList other_nl)
Count the nodes (based on node.id) that are present in both
neighborlists.
|
int |
countCommons(NeighborList other) |
int |
countCommonValues(NeighborList other_nl)
Count the values (using node.value) that are present in both
neighborlists.
|
boolean |
removeNode(Node node)
Remove from the neighborlist the neighbor corresponding to this node.
|
add
clear, comparator, contains, iterator, offer, peek, poll, remove, size, toArray, toArray
addAll, element, remove
containsAll, isEmpty, removeAll, retainAll, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, removeAll, retainAll
public NeighborList(int size)
size
- size of the neighborlistpublic static ArrayList<Edge> Convert2Edges(HashMap<Node,NeighborList> graph)
public final int countCommonValues(NeighborList other_nl)
other_nl
- public final int countCommonIds(NeighborList other_nl)
other_nl
- public final int countCommons(NeighborList other)
other
- public final boolean containsNode(Node node)
node
- public final boolean removeNode(Node node)
node
- Copyright © 2016. All rights reserved.