/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package reportgen.math.constants.longval;
import reportgen.math.constants.MathExpressionConstAbstract;
import reportgen.utils.ReportException;
import org.jdom.Element;
import reportgen.math.constants.MathExpressionConstValueAbstract;
import reportgen.prototype.context.Context;
import reportgen.prototype.context.group.ContextGroup;
/**
*
* @author axe
*/
public class MathExpressionConstValueLong
extends MathExpressionConstValueAbstract<Long> {
public static final ContextGroup GROUP = new LongContextGroup();
public static final String TAG ="long";
public MathExpressionConstValueLong(Context context) {
super(context);
}
public MathExpressionConstValueLong(Long value, Context context) {
super(value, context);
}
public MathExpressionConstValueLong(Element element,
Context context) throws ReportException {
super(element, context);
try {
value = Long.parseLong(element.getTextTrim());
} catch (Exception ex) {
throw new ReportException("Ошибка при распозновании константы: " + ex.getLocalizedMessage());
}
}
@Override
public MathExpressionConstValueLong makeClone() throws ReportException {
return new MathExpressionConstValueLong(toXML(), getParentContext());
}
@Override
public MathExpressionConstValueLong make(Long value) {
return new MathExpressionConstValueLong(value, getParentContext());
}
@Override
public ContextGroup getContextGroup() {
return GROUP;
}
@Override
protected String getRootTag() {
return TAG;
}
@Override
protected Long initDefault() {
return new Long(0);
}
}