MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / compare

Method compare

src/java/simpledb/execution/OrderBy.java:117–126  ·  view source on GitHub ↗
(Tuple o1, Tuple o2)

Source from the content-addressed store, hash-verified

115 }
116
117 public int compare(Tuple o1, Tuple o2) {
118 Field t1 = (o1).getField(field);
119 Field t2 = (o2).getField(field);
120 if (t1.compare(Predicate.Op.EQUALS, t2))
121 return 0;
122 if (t1.compare(Predicate.Op.GREATER_THAN, t2))
123 return asc ? 1 : -1;
124 else
125 return asc ? -1 : 1;
126 }
127
128}

Callers

nothing calls this directly

Calls 2

compareMethod · 0.95
getFieldMethod · 0.45

Tested by

no test coverage detected