/*
 * This file is released under terms of BSD license
 * See LICENSE file for more information
 */

package cx2x.xcodeml.xelement;

import org.w3c.dom.Element;
import cx2x.xcodeml.helper.*;

/**
 * The Xbound represents the lowerBound and upperBound (8.12, 8.13) element in
 * XcodeML intermediate representation.
 *
 * Elements:
 * - exprModel
 *
 * @author clementval
 */

public class Xbound extends XbaseElement {
  private String _value = null;
  private boolean _constant = false;
  private boolean _isVar = false;
  private Xvar _var = null;
  private XexprModel _exprModel = null;

  /**
   * Xelement standard ctor. Pass the base element to the base class and read
   * inner information (elements and attributes).
   * @param baseElement The root element of the Xelement
   */
  public Xbound(Element baseElement){
    super(baseElement);
    _exprModel = XelementHelper.findExprModel(this, false);
  }

  /**
   * Get the inner element
   * @return Inner element as exprModel
   */
  public XexprModel getExprModel(){
    return _exprModel;
  }

  // TODO should be done in exprModel
  @Override
  public String getValue(){

    if(_exprModel.isVar()){
      return _exprModel.getVar().getValue();
    }
    if(_exprModel.isConstant()){
      return _exprModel.getConstant().getValue();
    }
    return null;
  }

  @Override
  public boolean equals(Object ob) {
    if (ob == null) return false;
    if (ob.getClass() != getClass()) return false;
    Xbound other = (Xbound)ob;

    return getValue() != null && other.getValue() != null
        && getValue().toLowerCase().equals(other.getValue().toLowerCase());
  }

  @Override
  public int hashCode() {
    return _value.hashCode();
  }

}

@@ -416,139 +416,8 @@
 t %7B%0A
-  private String _value = null;%0A  private boolean _constant = false;%0A  private boolean _isVar = false;%0A  private Xvar _var = null;%0A
   pr
@@ -1547,14 +1547,18 @@
 urn 
-_v
+getV
 alue
+()
 .has

Remove unused variables