Example usage for org.apache.hadoop.io ShortWritable equals

List of usage examples for org.apache.hadoop.io ShortWritable equals

Introduction

In this page you can find the example usage for org.apache.hadoop.io ShortWritable equals.

Prototype

@Override
public boolean equals(Object o) 

Source Link

Document

Returns true iff o is a ShortWritable with the same value.

Usage

From source file:com.axiomine.largecollections.turboutil.ShortWritableList.java

License:Apache License

@Override
public int indexOf(Object o) {
    int index = -1;
    int myIndex = -1;
    Iterator<ShortWritable> iter = this.iterator();
    while (iter.hasNext()) {
        index++;// ww w . j  a  va2s  .c o  m
        ShortWritable e = iter.next();
        if (e.equals(o)) {
            myIndex = index;
            break;
        }
    }
    return myIndex;
}

From source file:com.axiomine.largecollections.turboutil.ShortWritableList.java

License:Apache License

@Override
public int lastIndexOf(Object o) {
    int index = -1;
    int myIndex = -1;
    Iterator<ShortWritable> iter = this.iterator();
    while (iter.hasNext()) {
        index++;/*w  ww .  ja  va2 s  .c om*/
        ShortWritable e = iter.next();
        if (e.equals(o)) {
            myIndex = index;
        }
    }
    return myIndex;

}