    001    package org.maltparser.core.feature.value;
    002
    003    import org.maltparser.core.feature.function.Function;
    004
    005    /**
    006     *
    007     *
    008     * @author Johan Hall
    009     * @since 1.0
    010    **/
    011    public abstract class FeatureValue extends FunctionValue {
    012            protected boolean nullValue;
    013
    014            public FeatureValue(Function function) {
    015                    super(function);
    016                    setNullValue(true);
    017            }
    018
    019            public void reset() {
    020                    setNullValue(true);
    021            }
    022
    023            public boolean isNullValue() {
    024                    return nullValue;
    025            }
    026
    027            public void setNullValue(boolean nullValue) {
    028                    this.nullValue = nullValue;
    029            }
    030
    031            public abstract boolean isMultiple();
    032
    033            public boolean equals(Object obj) {
    034                    if (this == obj)
    035                            return true;
    036                    if (obj == null)
    037                            return false;
    038                    if (getClass() != obj.getClass())
    039                            return false;
    040                    return super.equals(obj);
    041            }
    042
    043            public String toString() {
    044                    StringBuilder sb = new StringBuilder();
    045                    sb.append(super.toString());
    046                    sb.append("[null=");
    047                    sb.append(nullValue);
    048                    sb.append("]");
    049                    return sb.toString();
    050            }
    051    }