package net.sf.jasperreports.crosstabs.base;

import java.io.Serializable;
import net.sf.jasperreports.crosstabs.JRCrosstabBucket;
import net.sf.jasperreports.engine.JRExpression;
import net.sf.jasperreports.engine.base.JRBaseObjectFactory;

public class JRBaseCrosstabBucket implements JRCrosstabBucket, Serializable {
  private static final long serialVersionUID = 10200L;
  
  protected byte order = 1;
  
  protected JRExpression expression;
  
  protected JRExpression comparatorExpression;
  
  protected JRBaseCrosstabBucket() {}
  
  public JRBaseCrosstabBucket(JRCrosstabBucket bucket, JRBaseObjectFactory factory) {
    factory.put(bucket, this);
    this.order = bucket.getOrder();
    this.expression = factory.getExpression(bucket.getExpression());
    this.comparatorExpression = factory.getExpression(bucket.getComparatorExpression());
  }
  
  public byte getOrder() {
    return this.order;
  }
  
  public JRExpression getExpression() {
    return this.expression;
  }
  
  public JRExpression getComparatorExpression() {
    return this.comparatorExpression;
  }
}
