Package net.messagevortex.router
Class GraphSet
java.lang.Object
net.messagevortex.router.GraphSet
- All Implemented Interfaces:
Comparable<GraphSet>,Iterable<Edge>,Comparator<GraphSet>
public class GraphSet
extends Object
implements Comparator<GraphSet>, Comparable<GraphSet>, Iterable<Edge>
Represents the graphs between the nodes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Edge> g) booleancheck if all members of the anonymity set hve been reached at least once.intCompares two graph sets for equality.intCompares this graph set with another graph set.booleanCheck for a edge covering the mentioned points.dump()Get a string representation of the graph set.booleanget(int i) getAnonIdentity(int i) Get an identity from the specified anonymity set.getAnonymity(int i) intintGraphSet[]Get a set of all graphs determined.inthashCode()iterator()voidsetAnonymitySet(IdentityStoreBlock[] anonymitySet) Sets the list of identities to be used for the anonymity set.voidsetSource(IdentityStoreBlock source) Sets the source identity of this graph.voidsetTarget(IdentityStoreBlock target) Sets the target identity of this graph.intsize()booleanChecks if a specific identity store block is already reached by this graph.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
GraphSet
public GraphSet()Creates a new empty graph set.
-
-
Method Details
-
getAnonymitySet
-
setAnonymitySet
Sets the list of identities to be used for the anonymity set.
- Parameters:
anonymitySet- a list of identities to be used
-
getAnonymity
-
getSource
-
setSource
Sets the source identity of this graph.
- Parameters:
source- the source identity to be set- Throws:
IllegalArgumentException- if the source is not part of the anonymity setNullPointerException- if the source is null
-
getTarget
-
setTarget
Sets the target identity of this graph.
- Parameters:
target- the target identity to be set- Throws:
IllegalArgumentException- if the target is not part of the anonymity setNullPointerException- if the target is null
-
getAnonymitySetSize
public int getAnonymitySetSize() -
getAnonymityIndex
-
add
-
contains
Check for a edge covering the mentioned points.
- Parameters:
g- the edge to be searched for- Returns:
- true if the graph has been found at least once
-
addAll
-
getAnonIdentity
Get an identity from the specified anonymity set.
- Parameters:
i- the index of the identity to obtain- Returns:
- the identity store block specified
- Throws:
ArrayIndexOutOfBoundsException- if i is outside the bounds of the anonymity set
-
allTargetsReached
public boolean allTargetsReached()check if all members of the anonymity set hve been reached at least once.
- Returns:
- true if all members have been reached
-
targetReached
Checks if a specific identity store block is already reached by this graph.
- Parameters:
is- the identity store block- Returns:
- true if the identity store block has been reached already in the past
- Throws:
NullPointerException- if the specified identity stor block is null
-
getRoutes
Get a set of all graphs determined.
- Returns:
- the array of graphs generated
-
compare
Compares two graph sets for equality.
- Specified by:
comparein interfaceComparator<GraphSet>- Parameters:
g1- the first graph set required for comparisong2- the secondgraph set required for comparison- Returns:
- 0 if both sets are equal
-
compareTo
Compares this graph set with another graph set.
- Specified by:
compareToin interfaceComparable<GraphSet>- Parameters:
gs- the second graph set for comparison- Returns:
- 0 if both sets are equal
-
hashCode
public int hashCode() -
equals
- Specified by:
equalsin interfaceComparator<GraphSet>- Overrides:
equalsin classObject
-
dump
Get a string representation of the graph set.
- Returns:
- the requested string representation
-
getRoutingBlock
-
size
public int size() -
get
-
iterator
-