Examples of Array


Examples of anvil.core.Array

  /**
   *
   */
  public static Any readerToAnyStringArray(BufferedReader reader) throws IOException
  {
    Array array = new Array();
    String line;
    while (true) {
      line = reader.readLine();
      if (line == null) {
        break;
      }
      array.append(Any.create(line));
    }
    reader.close();
    return array;
  }
View Full Code Here

Examples of anvil.core.Array

  public abstract Any execute(Context context, Object self, Any parameters[]);

  public static final Array rest1(Any[] parameters, int start)
  {
    Array array = new Array();
    int n = parameters.length;
    while(start < n) {
      array.append(parameters[start++]);
    }
    return array;
  }
View Full Code Here

Examples of anvil.core.Array

        File[] list = _file.listFiles();
        if (list == null) {
          return BindingEnumeration.EMPTY;
        }
        int n = list.length;
        Array files = new Array(n);
        for(int i=0; i<n; i++) {
          files.append(Any.create(list[i]));
        }    
        return files.keysAndElements();
       
      } else {
        return new InputStreamEnumeration(
          new GenericInputStream(new FileInputStream(_file)));
         
View Full Code Here

Examples of anvil.core.Array

    String[] list = _file.list();
    if (list == null) {
      return NULL;
    }
    int n = list.length;
    Array files = new Array(n);
    for(int i=0; i<n; i++) {
      Any name = Any.create(list[i]);
      files.put(name, name);
    }
    return files;
  }
View Full Code Here

Examples of anvil.core.Array

    File[] list = _file.listFiles();
    if (list == null) {
      return NULL;
    }
    int n = list.length;
    Array files = new Array(n);
    for(int i=0; i<n; i++) {
      File file = list[i];
      files.put(Any.create(file.getName()), new AnyFile(file));
    }
    return files;
  }
View Full Code Here

Examples of anvil.core.Array

          if (ATTRMAP_L.containsKey(a.getID())) {
            _cache.put( new AnyString((String)ATTRMAP_L.get(id)), new AnyString(a.get().toString()) );

          } else if (OTHERS_ATTR.equals(id)) {
            try {
              Array others = (Array)Serialization.unserialize(null, a.get().toString());
              _cache.union(others);

            } catch(UnserializationException ioe) {
              throw new OperationFailedException("Data unserialization failed: "+ioe);
            }
View Full Code Here

Examples of anvil.core.Array

     
      Attributes at = new BasicAttributes();
      at.put("facsimileTelephoneNumber", password);
      at.put(objectClassAttr);
     
      Array others = new Array();
      if (params != null) {
        for (int i=0,l=params.length; i<l; i++) {
          String key = params[i][0];
          String val = params[i][1];
 
          if (LDAPCitizen.ATTRMAP_C.containsKey(key)) {
            at.put((String)LDAPCitizen.ATTRMAP_C.get(key), val);
            //System.err.println ("Save: OK attr: "+LDAPCitizen.ATTRMAP_C.get(key)+" = "+val);
          } else {
            others.put(Any.create(key), Any.create(val));
            //System.err.println ("Save: Unknown attr: "+LDAPCitizen.ATTRMAP_C.get(key)+" = "+val);
          }
        }
      }
     
      at.put("cn", username);
      if (at.get("sn") == null) {
        at.put("sn", username);
      }
      if (others.size() > 0) {
        try {
          String sothers = Serialization.serialize(null, others);
          at.put(LDAPCitizen.OTHERS_ATTR, sothers);
        } catch(IOException ioe) {
          throw new OperationFailedException("Data serialization failed: "+ioe);
View Full Code Here

Examples of anvil.core.Array

  public Any m_getAttributes()
  {
    if (_type == Node.ELEMENT_NODE) {
      NamedNodeMap map = _node.getAttributes();
      int length = map.getLength();
      Array attributes = new Array(length);
      for(int i=0; i<length; i++) {
        Attr attr = (Attr)map.item(i);
        attributes.append(attr.getName(), Any.create(attr.getValue()));
      }
      return attributes;
    } else {
      return NULL;
    }
View Full Code Here

Examples of anvil.core.Array

  public Any m_getEntities()
  { 
    if (_type == Node.DOCUMENT_TYPE_NODE) {
      NamedNodeMap map = ((DocumentType)_node).getEntities();
      int length = map.getLength();
      Array entities = new Array(length);
      for(int i=0; i<length; i++) {
        Node entity = map.item(i);
        if (entity.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
          entities.append(((DocumentType)entity).getName(), new AnyNode(entity));
        }
      }
      return entities;
    } else {
      return NULL;
View Full Code Here

Examples of anvil.core.Array

  public Any m_getNotations()
  {
    if (_type == Node.DOCUMENT_TYPE_NODE) {
      NamedNodeMap map = ((DocumentType)_node).getNotations();
      int length = map.getLength();
      Array notations = new Array(length);
      for(int i=0; i<length; i++) {
        Node entity = map.item(i);
        if (entity.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
          notations.append(((DocumentType)entity).getName(), new AnyNode(entity));
        }
      }
      return notations;
    } else {
      return NULL;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.