比较type Compares the specified object with this TupleDesc for equality. Two TupleDescs are considered equal if they have the same number of items and if the i-th type in this TupleDesc is equal to the i-th type in o for every i. @param o the Object to be compared for equality with this Tu
(Object o)
| 224 | */ |
| 225 | |
| 226 | public boolean equals(Object o) { |
| 227 | // some code goes here |
| 228 | if (o instanceof TupleDesc){ |
| 229 | List<TDItem> tupleDescList = ((TupleDesc) o).tupleDescList; |
| 230 | if(tupleDescList.size()==this.tupleDescList.size()){ |
| 231 | for(int i=0;i<this.tupleDescList.size();i++){ |
| 232 | if(!this.tupleDescList.get(i).getFieldType().equals(tupleDescList.get(i).getFieldType())){ |
| 233 | return false; |
| 234 | } |
| 235 | } |
| 236 | return true; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | return false; |
| 241 | } |
| 242 | |
| 243 | public int hashCode() { |
| 244 | // If you want to use TupleDesc as keys for HashMap, implement this so |
nothing calls this directly
no test coverage detected