public double percentage(ConstantRange range){
  SortedSet<Constant> sorted=values();
  SortedSet<Constant> contained=new TreeSet<Constant>();
  Constant prev=null;
  for (  Constant pct : sorted) {
    if (range.contains(pct))     contained.add(pct);
 else     if (contained.isEmpty())     prev=pct;
  }
  if (contained.size() == 0)   return 0.0;
  double prevPercent=prev == null ? 0.0 : pcts.get(prev);
  return pcts.get(contained.last()) - prevPercent;
}

public double percentage ( ConstantRange range ) { SortedSet < Constant > sorted = values ( ) ; SortedSet < Constant > contained = new TreeSet < Constant > ( ) ; Constant prev = null ; for ( Constant pct : sorted ) { if ( range . contains ( pct ) ) contained . add ( pct ) ; else if ( contained . isEmpty ( ) ) prev = pct ; } if ( contained . size ( ) == 0 ) return 0.0 ; double prevPercent = prev == null ? 0.0 : pcts . get ( prev ) ; return pcts . get ( contained . last ( ) ) - prevPercent ; }
gets the percent of values within the specified value range .
