Examples of IntegerArray


Examples of org.apache.uima.jcas.cas.IntegerArray

      r2.setArrayRef(0, eos1);
      r2.setArrayRef(1, eos2);
      assertTrue(r2.getArrayRef(0).equals(eos1));
      assertTrue(r2.getArrayRef(1).equals(eos2));

      r2.setArrayInt(new IntegerArray(jcas, 1));
      r2.setArrayInt(0, 17);
      assertTrue(r2.getArrayInt(0) == 17);
      IntegerArray ia = r2.getArrayInt();
      assertTrue(ia.get(0) == 17);

      r2.setArrayString(new StringArray(jcas, 2));
      r2.setArrayString(0, "zero");
      r2.setArrayString(1, "one");
      assertTrue(r2.getArrayString(0).equals("zero"));
View Full Code Here

Examples of org.apache.uima.jcas.cas.IntegerArray

      parts.add(part);
    }
    JCas jCas = stream.getJCas();
    StringArray nameArray = UIMAUtils.toStringArray(jCas, names.toArray(new String[] {}));
    DoubleArray totalArray = UIMAUtils.toDoubleArray(jCas, getDoubleArray(totals));
    IntegerArray amountArray = UIMAUtils.toIntegerArray(jCas, getIntegerArray(amounts));
    DoubleArray partArray = UIMAUtils.toDoubleArray(jCas, getDoubleArray(parts));

    Type type = jCas.getCasType(Statistics.type);
    Feature fname = type.getFeatureByBaseName("name");
    Feature ftotal = type.getFeatureByBaseName("total");
View Full Code Here

Examples of org.apache.uima.jcas.cas.IntegerArray

    uimaSArray.copyFromArray(sArray, 0, 0, sArray.length);
    return uimaSArray;
  }

  public static IntegerArray toIntegerArray(JCas jCas, int[] sArray) {
    IntegerArray uimaSArray = new IntegerArray(jCas, sArray.length);
    uimaSArray.copyFromArray(sArray, 0, 0, sArray.length);
    return uimaSArray;
  }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

  public NodeListImpl(int[] nodes) {
      _nodes = nodes;
  }
                 
  public NodeListImpl(NodeIterator iter) {
      final IntegerArray list = new IntegerArray();
      int node;
      while ((node = iter.next()) != NodeIterator.END) {
    list.add(node);
      }        
      _nodes = list.toIntArray();        
  }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

    // Skip attribute nodes
    while (_type[attribute] == NAMESPACE) {
        attribute = _nextSibling[attribute];
    }
    if (attribute != NULL) {
        final IntegerArray attributes = new IntegerArray(4);
        do {
      attributes.add(attribute);
        }
        while ((attribute = _nextSibling[attribute]) != 0);
        return new NamedNodeMapImpl(attributes.toIntArray());
    }
    else {
        return getEmptyNamedNodeMap();
    }
      }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

      }
  }

  public NodeList getChildNodes() {
      if (hasChildNodes()) {
    final IntegerArray children = new IntegerArray(8);
    int child = _offsetOrChild[_index];
    do {
        children.add(child);
    }
    while ((child = _nextSibling[child]) != 0);
    return new NodeListImpl(children.toIntArray());
      }
      else {
    return getEmptyNodeList();
      }
  }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

    /**
     * Adds a node to the node list for a given value. Nodes will
     * always be added in document order.
     */
    public void add(Object value, int node) {
  IntegerArray nodes;
  if ((nodes = (IntegerArray) _index.get(value)) == null) {
      _index.put(value, nodes = new IntegerArray());
  }
  nodes.add(node);
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

  // Clear _nodes array
  _nodes = null;

  final StringTokenizer values = new StringTokenizer((String) value);
  while (values.hasMoreElements()) {
      final IntegerArray nodes =
    (IntegerArray) _index.get(values.nextElement());

      if (nodes == null) continue;

      if (_nodes == null) {
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

  final String string = (String)value;
  if (string.indexOf(' ') > -1) {
      final StringTokenizer values = new StringTokenizer(string);

      while (values.hasMoreElements()) {
    final IntegerArray nodes =
        (IntegerArray) _index.get(values.nextElement());

    if (nodes != null && nodes.indexOf(node) >= 0) {
        return 1;
    }
      }
      return 0;
  }
  else {
      final IntegerArray nodes = (IntegerArray) _index.get(value);
      return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
  }
    }
View Full Code Here

Examples of org.apache.xalan.xsltc.util.IntegerArray

      return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
  }
    }

    public int containsKey(int node, Object value) {
  final IntegerArray nodes = (IntegerArray) _index.get(value);
  return (nodes != null && nodes.indexOf(node) >= 0) ? 1 : 0;
    }
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.