@Override @SuppressWarnings("unchecked") public int compareTo(TContainer other) { return tuple.compareTo(other.tuple); }
@Override @SuppressWarnings("unchecked") public int compare(Tuple t1, Tuple t2) { return t1.compareTo(t2); }
@Override @SuppressWarnings("unchecked") public int compareTo(TContainer other) { return tuple.compareTo(other.tuple); }
@Override @SuppressWarnings("unchecked") public int compareTo(Object o) { return t.compareTo(o); } }
@Override @SuppressWarnings("unchecked") public int compare(Tuple t1, Tuple t2) { return t1.compareTo(t2); }
@Override @SuppressWarnings("unchecked") public int compareTo(Object o) { return t.compareTo(o); }
@Override @SuppressWarnings("unchecked") public int compare(Tuple t1, Tuple t2) { return t1.compareTo(t2); }
@Override public int compareTo(pair o) { return this.data.compareTo(o.data); } }
@SuppressWarnings("unchecked") @Override public int compareTo(Pair o) { int r = this.data.compareTo(o.data); if (r == 0) { return index.compareTo(o.index); } else { return r; } }
@SuppressWarnings("unchecked") public Tuple next() { Tuple nextData = it.next(); // algorithm assumes data is in order if (data.compareTo(nextData) > 0) { throw new RuntimeException("Out of order!"); } this.data = nextData; return this.data; }
@SuppressWarnings("unchecked") @Override public int compareTo(Object arg0) { convertAll(); return realTuple.compareTo(arg0); }
return ((Tuple)o1).compareTo(o2);
@SuppressWarnings("unchecked") @Override public int compareTo(Object other) { if (this == other) return 0; if (other instanceof DataBag) { DataBag bOther = (DataBag) other; if (this.size() != bOther.size()) { if (this.size() > bOther.size()) return 1; else return -1; } // if we got this far, both bags should have same size // make a LimitedSortedBag for the other bag with same comparator and limit // so that both bag are sorted and we can loop through both iterators DataBag otherCloneDataBag = new LimitedSortedDataBag(mComp, limit); otherCloneDataBag.addAll((DataBag) other); Iterator<Tuple> thisIt = this.iterator(); Iterator<Tuple> otherIt = otherCloneDataBag.iterator(); while (thisIt.hasNext() && otherIt.hasNext()) { Tuple thisT = thisIt.next(); Tuple otherT = otherIt.next(); int c = thisT.compareTo(otherT); if (c != 0) return c; } return 0; // if we got this far, they must be equal } else { return DataType.compare(this, other); } }
Tuple otherT = otherIt.next(); int c = thisT.compareTo(otherT); if (c != 0) return c;
if (nextPair.data.compareTo(lastData) != 0)
@SuppressWarnings("unchecked") public int compare(PairOfWritables<Tuple, FloatWritable> e1, PairOfWritables<Tuple, FloatWritable> e2) { if (e1.getRightElement().compareTo(e2.getRightElement()) == 0) { return e1.getLeftElement().compareTo(e2.getLeftElement()); } return e2.getRightElement().compareTo(e1.getRightElement()); } });
Tuple otherT = otherIt.next(); int c = thisT.compareTo(otherT); if (c != 0) return c;
@SuppressWarnings("unchecked") public int compare(PairOfWritables<Tuple, FloatWritable> e1, PairOfWritables<Tuple, FloatWritable> e2) { if (e1.getRightElement().compareTo(e2.getRightElement()) == 0) { return e1.getLeftElement().compareTo(e2.getLeftElement()); } return e2.getRightElement().compareTo(e1.getRightElement()); } });