code: public long value() {
          if (isInfinity && !posOrNeg) {
              return Long.MIN_VALUE;
          } else if (isInfinity && posOrNeg) {
              return Long.MAX_VALUE;
          } else {
              return val;
          }
      }
docs: Gets the value of this weight.
  
  @return a long representing the value of this weight. If this weight has
  a value of positive infinity, <code>Long.MAX_VALUE</code> is
  returned. If this weight has a value of negative infinity,
  <code>Long.MIN_VALUE</code> is returned.