Class Points

java.lang.Object
net.i2p.router.sybil.Points
All Implemented Interfaces:
Comparable<Points>

public class Points extends Object implements Comparable<Points>
A total score and a List of reason Strings
Since:
0.9.38 moved from SybilRenderer
  • Constructor Details

    • Points

      public Points(double d, String reason)
      Parameters:
      reason - may not contain '%'
  • Method Details

    • getPoints

      public double getPoints()
      Since:
      0.9.38
    • getReasons

      public List<String> getReasons()
      Since:
      0.9.38
    • addPoints

      public void addPoints(double d, String reason)
      Parameters:
      reason - may not contain '%'
      Since:
      0.9.38
    • compareTo

      public int compareTo(Points r)
      Specified by:
      compareTo in interface Comparable<Points>
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Since:
      0.9.38
    • toString

      public void toString(StringBuilder buf)
      For persistence. Total points and reasons, '%' separated, no newline. The separation character is chosen to not conflict with decimal point in various locales, or chars in reasons, including HTML links, or special chars in Pattern.
      Since:
      0.9.38
    • fromString

      public static Points fromString(String s)
      For persistence.
      Returns:
      null on failure
      Since:
      0.9.38