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 Details

    • GraphSet

      public GraphSet()

      Creates a new empty graph set.

  • Method Details

    • getAnonymitySet

      public IdentityStoreBlock[] getAnonymitySet()
    • setAnonymitySet

      public void setAnonymitySet(IdentityStoreBlock[] anonymitySet)

      Sets the list of identities to be used for the anonymity set.

      Parameters:
      anonymitySet - a list of identities to be used
    • getAnonymity

      public IdentityStoreBlock getAnonymity(int i)
    • getSource

      public IdentityStoreBlock getSource()
    • setSource

      public void setSource(IdentityStoreBlock source)

      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 set
      NullPointerException - if the source is null
    • getTarget

      public IdentityStoreBlock getTarget()
    • setTarget

      public void setTarget(IdentityStoreBlock target)

      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 set
      NullPointerException - if the target is null
    • getAnonymitySetSize

      public int getAnonymitySetSize()
    • getAnonymityIndex

      public int getAnonymityIndex(IdentityStoreBlock isb)
    • add

      public boolean add(Edge g)
    • contains

      public boolean contains(Edge g)

      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

      public boolean addAll(Collection<? extends Edge> g)
    • getAnonIdentity

      public IdentityStoreBlock getAnonIdentity(int i)

      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

      public boolean targetReached(IdentityStoreBlock is)

      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

      public GraphSet[] getRoutes()

      Get a set of all graphs determined.

      Returns:
      the array of graphs generated
    • compare

      public int compare(GraphSet g1, GraphSet g2)

      Compares two graph sets for equality.

      Specified by:
      compare in interface Comparator<GraphSet>
      Parameters:
      g1 - the first graph set required for comparison
      g2 - the secondgraph set required for comparison
      Returns:
      0 if both sets are equal
    • compareTo

      public int compareTo(GraphSet gs)

      Compares this graph set with another graph set.

      Specified by:
      compareTo in interface Comparable<GraphSet>
      Parameters:
      gs - the second graph set for comparison
      Returns:
      0 if both sets are equal
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object g)
      Specified by:
      equals in interface Comparator<GraphSet>
      Overrides:
      equals in class Object
    • dump

      public String dump()

      Get a string representation of the graph set.

      Returns:
      the requested string representation
    • getRoutingBlock

      public RoutingCombo getRoutingBlock()
    • size

      public int size()
    • get

      public Edge get(int i)
    • iterator

      public Iterator<Edge> iterator()
      Specified by:
      iterator in interface Iterable<Edge>