edu.iu.cnets.klatsch.model
Class Edge

java.lang.Object
  extended by edu.iu.cnets.klatsch.model.Edge
All Implemented Interfaces:
java.lang.Comparable<Edge>
Direct Known Subclasses:
BasicEdge, GephiEdge

public abstract class Edge
extends java.lang.Object
implements java.lang.Comparable<Edge>

This is the basic class for representing an edge from a feed of social events.


Field Summary
protected  Node dst
          the destination node
protected  int endTime
          the timestamp of the latest data contributing to the weight of the edge
protected  Node src
          the source node
protected  int startTime
          the timestamp of the earliest data contributing to the weight of the edge
protected  double trust
          the trusted weight of the edge
protected  double weight
          the weight of the edge
 
Constructor Summary
protected Edge()
          Default constructor for internal use.
  Edge(Edge a, Edge b)
          Builds a new edge by merging two existing edges, which should have the same endpoints.
  Edge(Node src, Node dst)
          Simplied constructor with a default weight of 1.0, that is completely trusted.
  Edge(Node src, Node dst, double weight, double trust)
          Simplified constructor that uses "now" as a timestamp.
  Edge(Node src, Node dst, int startTime, int endTime, double weight, double trust)
          Constructor specifying all fields.
 
Method Summary
 int compareTo(Edge other)
          Implemented for Comparable.
 Node dst()
          Returns the destination node for this edge.
 int endTime()
          Returns the ending timestamp for the edge.
 boolean equals(java.lang.Object obj)
          Implemented for use with Hashtable.
 int hashCode()
          Implemented for use with Hashtable.
 Node src()
          Returns the source node for this edge.
 int startTime()
          Returns the beginning timestamp for the edge.
 double trust()
          Return the trusted weight of the edge.
 double weight()
          Return the weight of the edge.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

src

protected Node src
the source node


dst

protected Node dst
the destination node


startTime

protected int startTime
the timestamp of the earliest data contributing to the weight of the edge


endTime

protected int endTime
the timestamp of the latest data contributing to the weight of the edge


weight

protected double weight
the weight of the edge


trust

protected double trust
the trusted weight of the edge

Constructor Detail

Edge

protected Edge()
Default constructor for internal use.


Edge

public Edge(Node src,
            Node dst,
            int startTime,
            int endTime,
            double weight,
            double trust)
Constructor specifying all fields.

Parameters:
src - the source node
dst - the destination node
startTime - the start time for the edge
endTime - the end time for the edge
weight - the weight of the edge
trust - the trusted weight of the edge

Edge

public Edge(Node src,
            Node dst,
            double weight,
            double trust)
Simplified constructor that uses "now" as a timestamp.

Parameters:
src - the source node
dst - the destination node
weight - the weight of the edge
trust - the trusted weight of the edge

Edge

public Edge(Node src,
            Node dst)
Simplied constructor with a default weight of 1.0, that is completely trusted.

Parameters:
src - the source node
dst - the destination node

Edge

public Edge(Edge a,
            Edge b)
Builds a new edge by merging two existing edges, which should have the same endpoints. If the endpoints don't match, those of the first edge will be treated as the authoritative values.

Parameters:
a - the first edge
b - the second edge
Method Detail

src

public Node src()
Returns the source node for this edge.


dst

public Node dst()
Returns the destination node for this edge.


startTime

public int startTime()
Returns the beginning timestamp for the edge.


endTime

public int endTime()
Returns the ending timestamp for the edge.


weight

public double weight()
Return the weight of the edge.


trust

public double trust()
Return the trusted weight of the edge.


compareTo

public int compareTo(Edge other)
Implemented for Comparable.

Specified by:
compareTo in interface java.lang.Comparable<Edge>

equals

public boolean equals(java.lang.Object obj)
Implemented for use with Hashtable.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Implemented for use with Hashtable.

Overrides:
hashCode in class java.lang.Object