• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java NodeVector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.org.apache.xml.internal.utils.NodeVector的典型用法代码示例。如果您正苦于以下问题:Java NodeVector类的具体用法?Java NodeVector怎么用?Java NodeVector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NodeVector类属于com.sun.org.apache.xml.internal.utils包,在下文中一共展示了NodeVector类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: NodeSequence

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * Create a new NodeSequence from a (already cloned) iterator.
 *
 * @param nodeVector
 */
public NodeSequence(Object nodeVector)
{
      super(nodeVector);
  if (nodeVector instanceof NodeVector) {
      SetVector((NodeVector) nodeVector);
  }
      if(null != nodeVector)
      {
              assertion(nodeVector instanceof NodeVector,
                      "Must have a NodeVector as the object for NodeSequence!");
              if(nodeVector instanceof DTMIterator)
              {
                      setIter((DTMIterator)nodeVector);
                      m_last = ((DTMIterator)nodeVector).getLength();
              }

      }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:NodeSequence.java


示例2: getCurrentNode

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * @see DTMIterator#getCurrentNode()
 */
public int getCurrentNode()
{
      if(hasCache())
      {
              int currentIndex = m_next-1;
              NodeVector vec = getVector();
              if((currentIndex >= 0) && (currentIndex < vec.size()))
                      return vec.elementAt(currentIndex);
              else
                      return DTM.NULL;
      }

      if(null != m_iter)
      {
      return m_iter.getCurrentNode();
      }
      else
              return DTM.NULL;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:NodeSequence.java


示例3: markCacheComplete

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * If this NodeSequence has a cache, mark that it is complete.
 * This method should be called after the iterator is exhausted.
 */
private void markCacheComplete() {
    NodeVector nv = getVector();
    if (nv != null) {
        m_cache.setCacheComplete(true);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:NodeSequence.java


示例4: setShouldCacheNodes

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
   * @see DTMIterator#setShouldCacheNodes(boolean)
   */
  public void setShouldCacheNodes(boolean b)
  {
    if (b)
    {
      if(!hasCache())
      {
        SetVector(new NodeVector());
      }
//        else
//          getVector().RemoveAllNoClear();  // Is this good?
    }
    else
      SetVector(null);
  }
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:NodeSequence.java


示例5: getLength

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * @see DTMIterator#getLength()
 */
public int getLength()
{
  IteratorCache cache = getCache();

      if(cache != null)
      {
      // Nodes from the iterator are cached
      if (cache.isComplete()) {
          // All of the nodes from the iterator are cached
          // so just return the number of nodes in the cache
          NodeVector nv = cache.getVector();
          return nv.size();
      }

      // If this NodeSequence wraps a mutable nodeset, then
      // m_last will not reflect the size of the nodeset if
      // it has been mutated...
      if (m_iter instanceof NodeSetDTM)
      {
          return m_iter.getLength();
      }

              if(-1 == m_last)
              {
                      int pos = m_next;
                      runTo(-1);
                      m_next = pos;
              }
          return m_last;
      }
      else
      {
              return (-1 == m_last) ? (m_last = m_iter.getLength()) : m_last;
      }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:NodeSequence.java


示例6: setObject

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * It used to be that many locations in the code simply
 * did an assignment to this.m_obj directly, rather than
 * calling the setObject(Object) method. The problem is
 * that our super-class would be updated on what the
 * cache associated with this NodeSequence, but
 * we wouldn't know ourselves.
 * <p>
 * All setting of m_obj is done through setObject() now,
 * and this method over-rides the super-class method.
 * So now we are in the loop have an opportunity
 * to update some caching information.
 *
 */
protected void setObject(Object obj) {
    if (obj instanceof NodeVector) {
        // Keep our superclass informed of the current NodeVector
        // ... if we don't the smoketest fails (don't know why).
        super.setObject(obj);

        // A copy of the code of what SetVector() would do.
        NodeVector v = (NodeVector)obj;
        if (m_cache != null) {
            m_cache.setVector(v);
        } else if (v!=null) {
            m_cache = new IteratorCache();
            m_cache.setVector(v);
        }
    } else if (obj instanceof IteratorCache) {
        IteratorCache cache = (IteratorCache) obj;
        m_cache = cache;
        m_cache.increaseUseCount();

        // Keep our superclass informed of the current NodeVector
        super.setObject(cache.getVector());
    } else {
        super.setObject(obj);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:NodeSequence.java


示例7: appendNodes

import com.sun.org.apache.xml.internal.utils.NodeVector; //导入依赖的package包/类
/**
 * Append the nodes to the list.
 *
 * @param nodes The nodes to be appended to this node set.
 * @throws RuntimeException thrown if this NodeSetDTM is not of
 * a mutable type.
 */
public void appendNodes(NodeVector nodes)
{

  if (!m_mutable)
    throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

  super.appendNodes(nodes);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:NodeSetDTM.java



注:本文中的com.sun.org.apache.xml.internal.utils.NodeVector类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AsyncCallback类代码示例发布时间:2022-05-23
下一篇:
Java ByteArrayBuffer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap