VertexType
- the type of the vertices of the input graph.public class LegacyDegreeList<VertexType>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
LegacyDegreeList.Index |
Modifier and Type | Field and Description |
---|---|
java.util.ArrayList<java.util.ArrayList<VertexType>> |
lists |
Constructor and Description |
---|
LegacyDegreeList(GraphLibrary<VertexType,?> graph,
boolean autoRefreshMaxDegree,
boolean autoRefreshMinDegree,
boolean markDeletedEdges)
Creates a new instance with the given graph and configuration
|
Modifier and Type | Method and Description |
---|---|
void |
addVertex(VertexType vt) |
boolean |
deleted(VertexType vertex)
Tells whether or not, the given vertex is considered as deleted.
|
void |
deleteDegree(int degree)
Deletes vertices with the given degree until there is no vertex with that degree anymore.
|
void |
deleteVertex(VertexType vt) |
void |
demoteNode(VertexType vt) |
void |
dropDegrees(int degree)
Clears the list of vertices with the given degree.
|
int |
getCurrentDegree(VertexType vertex)
Returns the degree of the vertex by reading its status.
|
java.util.ArrayList<VertexType> |
getDegreeList(int index)
Returns the list of vertices that have the given degree.
|
java.lang.Iterable<VertexType> |
getDegreeVertices(int degree)
Returns all vertices which have the given degree.
|
int |
getMaxDegree()
Returns the maximum degree of the graph.
|
int |
getMinDegree()
Returns the minimum degree of the graph.
|
int |
getVertexCount()
Returns the number of vertices.
|
boolean |
hasDegree(int degree)
Tells whether or not there is at least one vertex with the given degree.
|
boolean |
isEmpty()
Tells whether or not, there is at least one vertex.
|
VertexType |
peek(int degree)
Gets the first vertex with the given degree in the list
|
VertexType |
poll(int degree)
Returns one arbitrary vertex with the given degree if such vertex exists.
|
VertexType |
pollMaxDegree()
Returns a vertex with the maximum degree.
|
VertexType |
pollMinDegree()
Returns a vertex with the minimum degree.
|
void |
refreshMaxDegree()
Refreshes the maximum degree.
|
void |
refreshMinDegree()
Refreshes the minum degree
|
void |
remove(VertexType vertex)
Removes the given vertex from the degree list.
|
void |
remove2(VertexType vertex)
Removes the given vertex from the degree list.
|
void |
sort()
Initializes the list
|
void |
sort(Progress progress)
Initializes the list
|
java.lang.String |
toString() |
public java.util.ArrayList<java.util.ArrayList<VertexType>> lists
public LegacyDegreeList(GraphLibrary<VertexType,?> graph, boolean autoRefreshMaxDegree, boolean autoRefreshMinDegree, boolean markDeletedEdges)
graph
- the graphautoRefreshMaxDegree
- if true, the maximum degree is refreshed automatically after each operation on this
instanceautoRefreshMinDegree
- if true, the minimum degree is refreshed automatically after each operation on this
instancemarkDeletedEdges
- if true, a delete operation on this instance will mark the respective vertices and
edges in the graph as deletedpublic void sort(Progress progress)
progress
- a progress callback which will be updated according to the percentage of the list creationpublic void sort()
public int getMaxDegree()
public int getMinDegree()
public java.util.ArrayList<VertexType> getDegreeList(int index)
index
- the degree.public boolean hasDegree(int degree)
degree
- the degree to check.public void addVertex(VertexType vt)
public void refreshMaxDegree()
public void refreshMinDegree()
public final void demoteNode(VertexType vt)
public final void deleteVertex(VertexType vt)
public final VertexType peek(int degree)
public final VertexType poll(int degree)
degree
- the degree of the vertex to return.public java.lang.Iterable<VertexType> getDegreeVertices(int degree)
degree
- the degree of the vertices to return.public VertexType pollMaxDegree()
public VertexType pollMinDegree()
public final void remove(VertexType vertex)
vertex
- the vertex to remove.public final void remove2(VertexType vertex)
vertex
- the vertex to remove.public final void deleteDegree(int degree)
degree
- the degree of the vertices to delete.public final int getCurrentDegree(VertexType vertex)
public int getVertexCount()
public boolean isEmpty()
public boolean deleted(VertexType vertex)
vertex
- the vertex to checkpublic void dropDegrees(int degree)
degree
- the degree to droppublic java.lang.String toString()
toString
in class java.lang.Object