Package anvil.core

Examples of anvil.core.Any


  }


  public Any getAttribute(anvil.script.Context context, String attribute)
  {
    Any value = _citizen.getVariable(attribute);
    if (value != null) {
      return value;
    } else {
      return Any.UNDEFINED;
    }
View Full Code Here


  }


  public Any getAttribute(anvil.script.Context context, String attribute)
  {
    Any value = _tribe.getVariable(attribute);
    if (value != null) {
      return value;
    } else {
      return Any.UNDEFINED;
    }
View Full Code Here

    int n = parameters.length;
    if (n < 1) {
      throw parametersMissing(context, "attach");
    }
    for(int i=0; i<n; i++) {
      Any p = parameters[i];
      try {
        if (p instanceof AnyTribe) {
          _tribe.attach((Tribe)p.toObject());
         
        } else if (p instanceof AnyCitizen) {
          _tribe.attach((Citizen)p.toObject());
         
        } else {
          throw context.BadParameter("Tribe or citizen expected");
        }
       
View Full Code Here

    int n = parameters.length;
    if (n < 1) {
      throw parametersMissing(context, "detach");
    }
    for(int i=0; i<n; i++) {
      Any p = parameters[i];
      try {
        if (p instanceof AnyTribe) {
          _tribe.detach((Tribe)p.toObject());
         
        } else if (p instanceof AnyCitizen) {
          _tribe.detach((Citizen)p.toObject());
         
        } else {
          throw context.BadParameter("Tribe or citizen expected");
        }
       
View Full Code Here

      } catch (Throwable t) {
        throw context.exception(t);
      }
    }
       
    Any param = parameters[index];
   
    ParameterNode[] childs = _childs;
    int n = childs.length;
    if (n>1) {
      ParameterNode best = null;
View Full Code Here

  public boolean contains(Any value)
  {
    Enumeration e = _session.enumeration();
    while(e.hasMoreElements()) {
      Any elem = Any.create(e.nextElement());
      if (elem.equals(value)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

    if (_type instanceof Scope) {
      Type type = ((Scope)_type).lookupDeclaration(name);
      return (type != null) ? new AnyType(type) : UNDEFINED;
     
    } else if (_type instanceof CompilableFunction) {
      Any value = ((CompilableFunction)_type).getAttribute(name);
      if (value != null) {
        return value;
      }   
    }
    return UNDEFINED;
View Full Code Here

        }
        int length = parameters.length;
        if (length == 0) {
          throw context.NoInstance(_type.toString());
        }
        Any self = parameters[0];
        Type target = function.getParent();
        if (!self.isInstanceOf(target)) {
          throw context.BadParameter("Instance of '"+target+"' expected");
        }
        Any[] params = Any.ARRAY0;
        if (length > 1) {
          params = new Any[--length];
View Full Code Here

      } catch (Throwable t) {
        throw context.exception(t);
      }
    }
       
    Any param = parameters[index];
   
    ParameterNode[] childs = _childs;
    int n = childs.length;
    if (n>1) {
      ParameterNode best = null;
View Full Code Here

    if (_type instanceof CompilableFunction) {
      CompilableFunction function = (CompilableFunction)_type;
      int max = function.getParameterCount();
      int min = function.getMinimumParameterCount();
      Array list = new Array();
      Any value;
      int count = 0;
      boolean required;
      Doc doc;
      for(int i=0; i<max; i++) {
        switch(function.getParameterType(i)) {
View Full Code Here

TOP

Related Classes of anvil.core.Any

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.