Package com.sun.xmlsearch.util

Examples of com.sun.xmlsearch.util.IntegerArray


    public void startDocument() {
    _stackPointer = -1;
    _nsMapStack[_nsMapStackPointer = 0] = _nsMap;
    _currentText = null;
    _textBuffer = new StringBuffer(4096);
    _offsets = new IntegerArray(512);
    _textCounter = 0;
    _attributeCounter = 0;
    _tables = new Hashtable();
    _attrValTable = new Hashtable(512);
    _attributeNames = new Vector(512);
    _attributeValues = new IntegerArray(512);
    _tables = new Hashtable();
    }
View Full Code Here


      for (int i = 0; i < _size; i++)
  (_nodes[i] = new TocNode())._index = i;
      for (int i = 1; i < _size; i++) {
  int parent = _parent[i];
  if (_children[parent] == null)
    _children[parent] = new IntegerArray(4);
  _children[parent].add(i);
      }
    }
    return _nodes[index];
  }
View Full Code Here

  ContextTables contextInfo = env.getContextInfo();
  if (context == null)
      return new Query(env, nColumns, nHits, null);
  else if (context.indexOf('|') != -1) { // alternatives
      StringTokenizer alts = new StringTokenizer(context, " |");
      IntegerArray codes = new IntegerArray();
      while (alts.hasMoreTokens()) {
    String alt = alts.nextToken();
    int code = contextInfo.linkCode(alt);
    if (code != -1)
        codes.addNew(code);
    else
        System.err.println("invalid (in the collection) tag name: " + alt);
      }

      switch (codes.cardinality()) {
      case 0:
    return _emptyQueryInstance;
 
      case 1:
    return new Query1(env, nColumns, nHits, null, codes.at(0));
 
      default:
    return new Query4(env, nColumns, nHits, null,
          codes.toIntArray());
      }
  }
  else if (context.indexOf("//") != -1) { // ancestor
      StringTokenizer elements = new StringTokenizer(context, " /");
      int ancestor = contextInfo.linkCode(elements.nextToken());
      int code = contextInfo.linkCode(elements.nextToken());
      // ancestor
      return new Query3(env, nColumns, nHits, null, code, ancestor);
  }
  else if (context.indexOf("/") != -1) { // parent (or path)
      StringTokenizer elements = new StringTokenizer(context, " /");
      int nTokens = elements.countTokens();
      if (nTokens == 2) {
    int parent = contextInfo.linkCode(elements.nextToken());
    int code = contextInfo.linkCode(elements.nextToken());
    // parent
    return new Query2(env, nColumns, nHits, null, code, parent);
      }
      else if (nTokens > 2) {
    IntegerArray codes = new IntegerArray();
    while (elements.hasMoreTokens()) {

        String parentStar = elements.nextToken();
        int code = contextInfo.linkCode(parentStar);
        if (code != -1)
      codes.addNew(code);
        else
      System.err.println("invalid (in this collection) tag name: " +
             parentStar);
    }
    return new Query5(env, nColumns, nHits, null,
          codes.toIntArray());
      }
      else
    return _emptyQueryInstance;
  }
  else if (context.indexOf("@") != -1) { // attribute
View Full Code Here

    public void startDocument() {
    _stackPointer = -1;
    _nsMapStack[_nsMapStackPointer = 0] = _nsMap;
    _currentText = null;
    _textBuffer = new StringBuffer(4096);
    _offsets = new IntegerArray(512);
    _textCounter = 0;
    _attributeCounter = 0;
    _tables = new Hashtable();
    _attrValTable = new Hashtable(512);
    _attributeNames = new Vector(512);
    _attributeValues = new IntegerArray(512);
    _tables = new Hashtable();
    }
View Full Code Here

  public String fetch(int conceptID) throws Exception {
    return findID(blocks[conceptID], conceptID);
  }
 
  public IntegerArray withPrefix(String prefix) throws Exception {
    IntegerArray result = new IntegerArray();
    accessBlock(root).withPrefix(this, prefix, prefix.length(), result);
    return result;
  }
View Full Code Here

    public void startDocument() {
    _stackPointer = -1;
    _nsMapStack[_nsMapStackPointer = 0] = _nsMap;
    _currentText = null;
    _textBuffer = new StringBuffer(4096);
    _offsets = new IntegerArray(512);
    _textCounter = 0;
    _attributeCounter = 0;
    _tables = new Hashtable();
    _attrValTable = new Hashtable(512);
    _attributeNames = new Vector(512);
    _attributeValues = new IntegerArray(512);
    _tables = new Hashtable();
    }
View Full Code Here

  public String fetch(int conceptID) throws Exception {
    return findID(blocks[conceptID], conceptID);
  }
 
  public IntegerArray withPrefix(String prefix) throws Exception {
    IntegerArray result = new IntegerArray();
    accessBlock(root).withPrefix(this, prefix, prefix.length(), result);
    return result;
  }
View Full Code Here

  ContextTables contextInfo = env.getContextInfo();
  if (context == null)
      return new Query(env, nColumns, nHits, null);
  else if (context.indexOf('|') != -1) { // alternatives
      StringTokenizer alts = new StringTokenizer(context, " |");
      IntegerArray codes = new IntegerArray();
      while (alts.hasMoreTokens()) {
    String alt = alts.nextToken();
    int code = contextInfo.linkCode(alt);
    if (code != -1)
        codes.addNew(code);
    else
        System.err.println("invalid (in the collection) tag name: " + alt);
      }

      switch (codes.cardinality()) {
      case 0:
    return _emptyQueryInstance;
 
      case 1:
    return new Query1(env, nColumns, nHits, null, codes.at(0));
 
      default:
    return new Query4(env, nColumns, nHits, null,
          codes.toIntArray());
      }
  }
  else if (context.indexOf("//") != -1) { // ancestor
      StringTokenizer elements = new StringTokenizer(context, " /");
      int ancestor = contextInfo.linkCode(elements.nextToken());
      int code = contextInfo.linkCode(elements.nextToken());
      // ancestor
      return new Query3(env, nColumns, nHits, null, code, ancestor);
  }
  else if (context.indexOf("/") != -1) { // parent (or path)
      StringTokenizer elements = new StringTokenizer(context, " /");
      int nTokens = elements.countTokens();
      if (nTokens == 2) {
    int parent = contextInfo.linkCode(elements.nextToken());
    int code = contextInfo.linkCode(elements.nextToken());
    // parent
    return new Query2(env, nColumns, nHits, null, code, parent);
      }
      else if (nTokens > 2) {
    IntegerArray codes = new IntegerArray();
    while (elements.hasMoreTokens()) {

        String parentStar = elements.nextToken();
        int code = contextInfo.linkCode(parentStar);
        if (code != -1)
      codes.addNew(code);
        else
      System.err.println("invalid (in this collection) tag name: " +
             parentStar);
    }
    return new Query5(env, nColumns, nHits, null,
          codes.toIntArray());
      }
      else
    return _emptyQueryInstance;
  }
  else if (context.indexOf("@") != -1) { // attribute
View Full Code Here

      for (int i = 0; i < _size; i++)
  (_nodes[i] = new TocNode())._index = i;
      for (int i = 1; i < _size; i++) {
  int parent = _parent[i];
  if (_children[parent] == null)
    _children[parent] = new IntegerArray(4);
  _children[parent].add(i);
      }
    }
    return _nodes[index];
  }
View Full Code Here

TOP

Related Classes of com.sun.xmlsearch.util.IntegerArray

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.