Examples of IntegerArray


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

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

            else if (_value < 0 && Double.isInfinite(_value)) return "-Infinity";
            else if (Double.isInfinite(_value)) return "Infinity";
      else return formatNumbers((int)_value);
  }

  IntegerArray ancestors = new IntegerArray();

  // Gather all ancestors that do not match from pattern
  int next = _node;
  ancestors.add(next);    // include self
  while ((next = _document.getParent(next)) > END &&
         !matchesFrom(next)) {
      ancestors.add(next);
  }

  // Create an array of counters
  final int nAncestors = ancestors.cardinality();
  final int[] counters = new int[nAncestors];
  for (int i = 0; i < nAncestors; i++) {
      counters[i] = Integer.MIN_VALUE;
  }

  // Increment array of counters according to semantics
  for (int j = 0, i = nAncestors - 1; i >= 0 ; i--, j++) {
      final int counter = counters[j];
      final int ancestor = ancestors.at(i);

      if (matchesCount(ancestor)) {
    _precSiblings.setStartNode(ancestor);
    while ((next = _precSiblings.next()) != END) {
        if (matchesCount(next)) {
View Full Code Here

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

            _currentDocumentNode = rootNode;
            _index = new Hashtable();
            _rootToIndexMap.put(new Integer(rootNode), _index);
        }

        IntegerArray nodes = (IntegerArray) _index.get(value);

        if (nodes == null) {
             nodes = new IntegerArray();
            _index.put(value, nodes);
            nodes.add(node);

        // Because nodes are added in document order,
        // duplicates can be eliminated easily at this stage.
        } else if (node != nodes.at(nodes.cardinality() - 1)) {
            nodes.add(node);
        }
    }
View Full Code Here

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

  final StringTokenizer values = new StringTokenizer((String) value,
                                                           " \n\t");
  while (values.hasMoreElements()) {
            final String token = (String) values.nextElement();
      IntegerArray nodes = (IntegerArray) _index.get(token);

            if (nodes == null && _enhancedDOM != null
                && _enhancedDOM.hasDOMSource()) {
                nodes = getDOMNodeById(token);
            }

      if (nodes == null) continue;

      if (_nodes == null) {
     nodes = (IntegerArray)nodes.clone();
    _nodes = nodes;
      }
      else {
    _nodes.merge(nodes);
      }
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.