Package heart.exceptions

Examples of heart.exceptions.NotInTheDomainException


        if(attr.getXTTClass().equals(Attribute.CLASS_SIMPLE)){
          if(value instanceof SimpleNumeric && attr.getType().getBase().endsWith(Type.BASE_SYMBOLIC)){
            // Add casting between symbolic and numeric if ordered
            this.value = SimpleSymbolic.findInTheDomain((SimpleNumeric) value, attr.getType());
            if(this.value == null){
              throw new NotInTheDomainException(attr.getType().getDomain(), value,
                  "Setting value of attribute '"+attr.getName()+
                  "' for a value '"+value+"' that is not in the domain that is not 'Null'.");
            }
          }else if(value instanceof SimpleSymbolic && attr.getType().getBase().endsWith(Type.BASE_NUMERIC)){
            this.value = SimpleSymbolic.findInTheDomain((SimpleNumeric) value, attr.getType());
            if(this.value == null){
              throw new NotInTheDomainException(attr.getType().getDomain(), value,
                  "Setting value of attribute '"+attr.getName()+
                  "' for a value '"+value+"' that is not in the domain that is not 'Null'.");
            }
          }else{
            this.value = value;
          }
        }else if(attr.getXTTClass().equals(Attribute.CLASS_GENERAL)){
          this.value = value;
        }
      }else{
        throw new NotInTheDomainException(attr.getType().getDomain(), value,
            "Setting value of attribute '"+attr.getName()+
            "' for a value '"+value+"' that is not in the domain that is not 'Null'.");
      }
    }
View Full Code Here


*/
public class Null extends Value{

  @Override
  public boolean eq(Value v, Type t) throws UnsupportedOperationException, NotInTheDomainException {
    if(t != null && !v.isInTheDomain(t))  throw new NotInTheDomainException(t.getDomain(), v, "Value "+v+" not in the domain");
    return (v instanceof Null);
  }
View Full Code Here

    return (v instanceof Null);
  }

  @Override
  public boolean neq(Value v, Type t) throws UnsupportedOperationException, NotInTheDomainException {
    if(t != null && !v.isInTheDomain(t))  throw new NotInTheDomainException(t.getDomain(), v, "Value "+v+" not in the domain");
    return (v instanceof Null);
  }
View Full Code Here

   * @param t - a type with respect to witch the operator should work.
   * @throws NotInTheDomainException thrown if either this instance or v param is not in the domain
   */
  protected void checkDomain(Value v, Type t) throws NotInTheDomainException {
    if(t != null){
      if(!this.isInTheDomain(t)) throw new NotInTheDomainException(t.getDomain(), this, "Value "+this+" not in the domain");
      if(!v.isInTheDomain(t)) throw new NotInTheDomainException(t.getDomain(), v, "Value "+v+" not in the domain");
    }
  }
View Full Code Here

  @Override
  public boolean eq(Value v, Type t) throws UnsupportedOperationException, NotInTheDomainException {
    if(v instanceof Any) throw new UnsupportedOperationException("Error while evaluating "+this+" eq "+v+". Operator not supported for this types.");
    if(v instanceof Null) return false;
    if(t != null && !v.isInTheDomain(t)) throw new NotInTheDomainException(t.getDomain(), v, "Value "+v+" not in the domain");
   
    return true; // If the type is from the domain, than it equals any
  }
View Full Code Here

  @Override
  public boolean neq(Value v, Type t) throws UnsupportedOperationException, NotInTheDomainException {
    if(v instanceof Any) throw new UnsupportedOperationException("Error while evaluating "+this+" neq "+v+". Operator not supported for this types.");
    if(v instanceof Null) return true;
    if(t != null && !v.isInTheDomain(t)) throw new NotInTheDomainException(t.getDomain(), v, "Value "+v+" not in the domain");
   
    return false; // If the type is from the domain, than it equals any
  }
View Full Code Here

      NotInTheDomainException {
    checkNullAndAny(v);   
    try {
      if (t != null) {
        if (!this.isInTheDomain(t))
          throw new NotInTheDomainException(t.getDomain(), this,
              "Value " + this + " not in the domain");
        if (!v.isInTheDomain(t))
          throw new NotInTheDomainException(t.getDomain(), v,
              "Value " + v + " not in the domain");
      }     
      SetValue sv = (SetValue) v;
      for (Value subset : sv.getValues()) {
        if (subset instanceof SimpleSymbolic
View Full Code Here

    }
    Value temp = value;
    value = findInTheDomain(value, type);   
    // not in the domain
    if (value == null) {
      throw new NotInTheDomainException(type.getDomain(),temp,
          "Value " + temp + " not in the domain");
    }
   
    return (SimpleSymbolic) value;
  }
View Full Code Here

TOP

Related Classes of heart.exceptions.NotInTheDomainException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.