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