Class ComputedNetworkFractions

  • All Implemented Interfaces:
    Document

    public class ComputedNetworkFractions
    extends java.lang.Object
    implements Document
    Computed fraction of hidden-service activity that a single relay is assumed to observe in the network. These fractions are computed from status entries and bandwidth weights in a network status consensus.
    • Constructor Summary

      Constructors 
      Constructor Description
      ComputedNetworkFractions​(java.lang.String fingerprint, long validAfterMillis)
      Instantiates a new fractions object using fingerprint and consensus valid-after time which together uniquely identify the object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object otherObject)
      Returns whether this object contains the same fingerprint and consensus valid-after time as the passed object.
      java.lang.String[] format()
      Returns a string representation of this object, consisting of two strings: the first string contains fingerprint and valid-after date, the second string contains the concatenation of all other attributes.
      java.lang.String getFingerprint()  
      double getFractionDirOnionsSeen()  
      double getFractionRendRelayedCells()  
      long getValidAfterMillis()  
      int hashCode()
      Returns a (hopefully unique) hash code based on this object's fingerprint and consensus valid-after time.
      boolean parse​(java.lang.String[] formattedStrings)
      Initializes this fractions object using the two provided strings that have been produced by the format method earlier and returns whether this operation was successful.
      void setFractionDirOnionsSeen​(double fractionDirOnionsSeen)  
      void setFractionRendRelayedCells​(double fractionRendRelayedCells)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ComputedNetworkFractions

        public ComputedNetworkFractions​(java.lang.String fingerprint,
                                        long validAfterMillis)
        Instantiates a new fractions object using fingerprint and consensus valid-after time which together uniquely identify the object.
    • Method Detail

      • getFingerprint

        public java.lang.String getFingerprint()
      • getValidAfterMillis

        public long getValidAfterMillis()
      • setFractionRendRelayedCells

        public void setFractionRendRelayedCells​(double fractionRendRelayedCells)
      • getFractionRendRelayedCells

        public double getFractionRendRelayedCells()
      • setFractionDirOnionsSeen

        public void setFractionDirOnionsSeen​(double fractionDirOnionsSeen)
      • getFractionDirOnionsSeen

        public double getFractionDirOnionsSeen()
      • equals

        public boolean equals​(java.lang.Object otherObject)
        Returns whether this object contains the same fingerprint and consensus valid-after time as the passed object.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Returns a (hopefully unique) hash code based on this object's fingerprint and consensus valid-after time.
        Overrides:
        hashCode in class java.lang.Object
      • format

        public java.lang.String[] format()
        Returns a string representation of this object, consisting of two strings: the first string contains fingerprint and valid-after date, the second string contains the concatenation of all other attributes.
        Specified by:
        format in interface Document
      • parse

        public boolean parse​(java.lang.String[] formattedStrings)
        Initializes this fractions object using the two provided strings that have been produced by the format method earlier and returns whether this operation was successful.
        Specified by:
        parse in interface Document