votorola.a.register.trust
Class TrustEdge

java.lang.Object
  extended by TrustEdge
All Implemented Interfaces:
Serializable

public final class TrustEdge
extends Object
implements Serializable

A trust connection between two voters in a neighbourhood trust network, as compiled in a voter list. Each trust edge extends from one voter (source node) to another (destination node). A source node may extend edges to any number of destination nodes (subject to the restrictions imposed by the trust script, below), but may extend at most one to each.

A destination's trust level is the highest level (T) among all immediate source nodes, such that the count of nodes at that level or higher (nT) is at least equal to T (nT >= T). In other words, to have a trust level of 3, a voter must have 3 or more immediate trust sources, each itself having a trust level of 3 or higher. See ListNode.trustLevel().

The ultimate trust source (root node) is the electoral office, which has a high (effectively unlimited) trust level. All trust edges are traceable back to the root node. Unlike an ordinary node, the root may extend any number of edges (primary edges) to the same destination.

See Also:
a/design.xht#trust-network, ListNode, Serialized Form

Nested Class Summary
static class TrustEdge.Primary
          The configuration of a primary trust edge.
static class TrustEdge.Table
          The relational store of trust edges that (in part) backs a compiled voter list.
 
Constructor Summary
TrustEdge(String voter0Email, String voter1Email)
          Creates a TrustEdge with default values.
TrustEdge(String voter0Email, String voter1Email, String bar)
          Constructs a TrustEdge.
 
Method Summary
 void commit(TrustEdge.Table table)
          Writes this edge to the table, if it has uncommitted changes.
 String getBar()
          Specifies the bar against the edge, if any.
(package private)  void setBar(String newBar)
          Sets a bar against the edge.
 String toString()
          Returns a description of the edge, including the email addresses of both voters.
 String voter0Email()
          Identifies the source voter.
 String voter1Email()
          Identifies the destination voter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrustEdge

public TrustEdge(String voter0Email,
                 String voter1Email)
Creates a TrustEdge with default values.

Parameters:
voter0Email - per voter0Email()
voter1Email - per voter1Email()

TrustEdge

TrustEdge(String voter0Email,
          String voter1Email,
          String bar)
Constructs a TrustEdge.

Parameters:
voter0Email - per voter0Email()
voter1Email - per voter1Email()
bar - per getBar()
Method Detail

commit

public void commit(TrustEdge.Table table)
            throws SQLException
Writes this edge to the table, if it has uncommitted changes.

Throws:
SQLException

getBar

public String getBar()
Specifies the bar against the edge, if any. A barred edge has no effect on the network.

Returns:
description of bar, or null if there is none
See Also:
setBar(String)

setBar

void setBar(String newBar)
Sets a bar against the edge.

See Also:
getBar()

voter0Email

public String voter0Email()
Identifies the source voter.

Returns:
canonical email address (having no personal part)

voter1Email

public String voter1Email()
Identifies the destination voter.

Returns:
canonical email address (having no personal part)

toString

public String toString()
Returns a description of the edge, including the email addresses of both voters.

Overrides:
toString in class Object