public Value evaluate(
     DomainEvaluator evaluator, DomainType returnType, Value sourceVal, Value argVal)
     throws InvalidValueException {
   ValueFactory valueFactory = evaluator.getValueFactory();
   DomainType sourceType = sourceVal.getType();
   TypeValue argTypeValue = argVal.asTypeValue();
   DomainType argType = argTypeValue.getInstanceType();
   return valueFactory.booleanValueOf(
       sourceType.isEqualTo(valueFactory.getStandardLibrary(), argType));
 }
Esempio n. 2
0
  @Override
  public Iterable<? extends DomainInheritance> getInitialSuperInheritances() {
    final Iterator<? extends DomainType> iterator = domainType.getLocalSuperTypes().iterator();
    return new Iterable<DomainInheritance>() {
      public Iterator<DomainInheritance> iterator() {
        return new Iterator<DomainInheritance>() {
          public boolean hasNext() {
            return iterator.hasNext();
          }

          public DomainInheritance next() {
            return iterator.next().getInheritance(standardLibrary);
          }

          public void remove() {
            throw new UnsupportedOperationException();
          }
        };
      }
    };
  }
Esempio n. 3
0
 public String getMetaTypeName() {
   return domainType.getMetaTypeName();
 }
Esempio n. 4
0
 public Iterable<? extends DomainType> getLocalSuperTypes() {
   return domainType.getLocalSuperTypes();
 }
Esempio n. 5
0
 public Iterable<? extends DomainProperty> getLocalProperties() {
   return domainType.getLocalProperties();
 }
Esempio n. 6
0
 public Iterable<? extends DomainOperation> getLocalOperations() {
   return domainType.getLocalOperations();
 }
Esempio n. 7
0
 public DomainReflectiveType(DomainReflectivePackage evaluationPackage, DomainType domainType) {
   super(domainType.getName(), evaluationPackage, computeFlags(domainType));
   this.standardLibrary = evaluationPackage.getStandardLibrary();
   this.domainType = domainType;
 }