MCPcopy Create free account
hub / github.com/BaseXdb/basex / weight

Method weight

basex-core/src/main/java/org/basex/gui/view/map/MapList.java:113–122  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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() {

Callers 1

initWeightsMethod · 0.95

Calls 4

sizeIDMethod · 0.95
toLongMethod · 0.95
attValueMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected