    001    package org.maltparser.core.feature.value;
    002
    003    import org.maltparser.core.feature.function.Function;
    004    /**
    005     *
    006     *
    007     * @author Johan Hall
    008     * @since 1.0
    009    **/
    010    public abstract class FunctionValue {
    011            protected Function function;
    012
    013            public FunctionValue(Function function) {
    014                    setFunction(function);
    015            }
    016
    017            public Function getFunction() {
    018                    return function;
    019            }
    020
    021            public void setFunction(Function function) {
    022                    this.function = function;
    023            }
    024
    025            public abstract void reset();
    026
    027            public boolean equals(Object obj) {
    028                    if (this == obj)
    029                            return true;
    030                    if (obj == null)
    031                            return false;
    032                    if (getClass() != obj.getClass())
    033                            return false;
    034                    return function.equals(((FunctionValue)obj).function);
    035            }
    036
    037            public String toString() {
    038                    return function.toString() + ": ";
    039            }
    040    }