    001    package org.maltparser.core.feature.function;
    002
    003    import org.maltparser.core.exception.MaltChainedException;
    004    import org.maltparser.core.feature.value.AddressValue;
    005
    006    /**
    007    *
    008    *
    009    * @author Johan Hall
    010    */
    011    public abstract class AddressFunction implements Function {
    012            protected AddressValue address;
    013            public AddressFunction() {
    014                    address = new AddressValue(this);
    015            }
    016
    017            public abstract void update(Object[] arguments) throws MaltChainedException;
    018
    019            /**
    020             * Returns the address value of address function
    021             *
    022             * @return the address value of address function
    023             */
    024            public AddressValue getAddressValue() {
    025                    return address;
    026            }
    027
    028            public boolean equals(Object obj) {
    029                    if (this == obj)
    030                            return true;
    031                    if (obj == null)
    032                            return false;
    033                    if (getClass() != obj.getClass())
    034                            return false;
    035
    036                    return address.equals(((AddressFunction)obj).getAddressValue());
    037            }
    038
    039            public String toString() {
    040                    return address.toString();
    041            }
    042    }