Examples of IntegerArray


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

    /**
     * This method must be called by the code generated by the key() function
     * prior to returning the node iterator.
     */
    public void lookupKey(Object value) {
        IntegerArray nodes = (IntegerArray) _index.get(value);
        _nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null;
        _position = 0;
    }
View Full Code Here

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

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

      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 && nodes.indexOf(node) >= 0) {
        return 1;
    }
      }
      return 0;
  }
  else {
      IntegerArray nodes = (IntegerArray) _index.get(value);
            if (nodes == null && _enhancedDOM != null && _enhancedDOM.hasDOMSource()) {
                nodes = getDOMNodeById(string);
            }
      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

            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.teavm.common.IntegerArray

    }

    void rebuildMethodTree() {
        long[] exactMethods = this.exactMethods.clone();
        Arrays.sort(exactMethods);
        IntegerArray methods = new IntegerArray(1);
        int lastClass = -1;
        for (int i = 0; i < exactMethods.length; ++i) {
            long exactMethod = exactMethods[i];
            int classIndex = (int)(exactMethod >>> 32);
            if (classIndex != lastClass) {
                if (lastClass >= 0) {
                    ClassMetadata clsData = classesMetadata.get(lastClass);
                    clsData.methods = methods.getAll();
                    methods.clear();
                }
                lastClass = classIndex;
            }
            int methodIndex = (int)exactMethod;
            methods.add(methodIndex);
        }
        if (lastClass >= 0) {
            ClassMetadata clsData = classesMetadata.get(lastClass);
            clsData.methods = methods.getAll();
            Arrays.sort(clsData.methods);
        }

        int[] start = new int[exactMethods.length];
        Arrays.fill(start, -1);
        IntegerArray data = new IntegerArray(1);
        IntegerArray next = new IntegerArray(1);
        for (int i = 0; i < classesMetadata.size(); ++i) {
            ClassMetadata clsData = classesMetadata.get(i);
            if (clsData.parentId == null || clsData.methods == null) {
                continue;
            }
            for (int methodIndex : clsData.methods) {
                ClassMetadata superclsData = classesMetadata.get(clsData.parentId);
                Integer parentId = clsData.parentId;
                while (superclsData != null) {
                    if (superclsData.methods != null && Arrays.binarySearch(superclsData.methods, methodIndex) >= 0) {
                        int childMethod = getExactMethodIndex(i, methodIndex);
                        int parentMethod = getExactMethodIndex(parentId, methodIndex);
                        int ptr = start[parentMethod];
                        start[parentMethod] = data.size();
                        data.add(childMethod);
                        next.add(ptr);
                        break;
                    }
                    parentId = superclsData.parentId;
                    superclsData = parentId != null ? classesMetadata.get(parentId) : null;
                }
            }
        }

        MethodTree methodTree = new MethodTree();
        methodTree.offsets = new int[start.length + 1];
        methodTree.data = new int[data.size()];
        int index = 0;
        for (int i = 0; i < start.length; ++i) {
            int ptr = start[i];
            while (ptr != -1) {
                methodTree.data[index++] = data.get(ptr);
                ptr = next.get(ptr);
            }
            methodTree.offsets[i + 1] = index;
        }
        this.methodTree = methodTree;
    }
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.