text: public int compareTo(PostingsAndFreq other) {if (position != other.position) {return position - other.position;}if (nTerms != other.nTerms) {return nTerms - other.nTerms;}if (nTerms == 0) {return 0;}for (int i=0; i<terms.length; i++) {int res = terms[i].compareTo(other.terms[i]);if (res!=0) return res;}return 0;}