    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 class AddressValue extends FunctionValue {
    011            private Object address;
    012
    013            public AddressValue(Function function) {
    014                    super(function);
    015                    setAddress(null);
    016            }
    017
    018            public void reset() {
    019                    setAddress(null);
    020            }
    021
    022            public Class<?> getAddressClass() {
    023                    if (address != null) {
    024                            return address.getClass();
    025                    }
    026                    return null;
    027            }
    028
    029            public Object getAddress() {
    030                    return address;
    031            }
    032
    033            public void setAddress(Object address) {
    034                    this.address = address;
    035            }
    036
    037            public boolean equals(Object obj) {
    038                    if (this == obj)
    039                            return true;
    040                    if (obj == null)
    041                            return false;
    042                    if (getClass() != obj.getClass())
    043                            return false;
    044                    if (!address.equals(((AddressValue)obj).address)) {
    045                            return false;
    046                    }
    047                    return super.equals(obj);
    048            }
    049
    050            public String toString() {
    051                    return super.toString() + address.toString();
    052            }
    053    }