public boolean equals()

in wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/util/Bitmask.java [427:450]


    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Bitmask that = (Bitmask) o;
        if (this.cardinalityCache != -1 && that.cardinalityCache != -1 && this.cardinalityCache != that.cardinalityCache) {
            return false;
        }
        final Bitmask smallInstance;
        final Bitmask largeInstance;
        if (this.bits.length < that.bits.length) {
            smallInstance = this;
            largeInstance = that;
        } else {
            smallInstance = that;
            largeInstance = this;
        }
        for (int i = 0; i < smallInstance.bits.length; i++) {
            if (smallInstance.bits[i] != largeInstance.bits[i]) return false;
        }
        for (int i = smallInstance.bits.length; i < largeInstance.bits.length; i++) {
            if (largeInstance.bits[i] != 0L) return false;
        }
        return true;
    }