Returns the numeric weight for the specified input, or 1 as minimum. @param textLen array holding PRE values to text lengths @param data data reference @param i array index @return calculated weight
(final int[] textLen, final Data data, final int i)
| 111 | * @return calculated weight |
| 112 | */ |
| 113 | private double weight(final int[] textLen, final Data data, final int i) { |
| 114 | final double d; |
| 115 | if(textLen != null) { |
| 116 | d = textLen[pres.get(i)]; |
| 117 | } else { |
| 118 | final byte[] val = data.attValue(ViewData.sizeID(data), pres.get(i)); |
| 119 | d = val != null ? Token.toLong(val) : 0; |
| 120 | } |
| 121 | return d > 1 ? d : 1; |
| 122 | } |
| 123 | |
| 124 | @Override |
| 125 | public String toString() { |
no test coverage detected