All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zanata.common.TransUnitCount Maven / Gradle / Ivy

There is a newer version: 4.6.2
Show newest version
package org.zanata.common;

public final class TransUnitCount extends BaseTranslationCount {

    private static final long serialVersionUID = 1L;

    public TransUnitCount() {
    }

    public TransUnitCount(int approved, int needReview, int untranslated,
            int translated, int rejected) {
        super(approved, needReview, untranslated, translated, rejected);
    }

    public TransUnitCount(int approved, int needReview, int untranslated) {
        super(approved, needReview, untranslated);
    }

    public void increment(ContentState state) {
        increment(state, 1);
    }

    public void decrement(ContentState state) {
        decrement(state, 1);
    }

    public void add(TransUnitCount other) {
        super.add(other);
    }

    public void set(TransUnitCount other) {
        super.set(other);
    }

    public int getNotApproved() {
        return getUntranslated() + getNeedReview() + getRejected() +
                getTranslated();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof TransUnitCount) {
            return super.equals(obj);
        }
        return false;
    }

    public int hashCode() {
        assert false : "hashCode not designed";
        // any arbitrary constant will do
        return 42;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy