本文整理汇总了Java中com.sun.org.apache.xpath.internal.NodeSetDTM类的典型用法代码示例。如果您正苦于以下问题:Java NodeSetDTM类的具体用法?Java NodeSetDTM怎么用?Java NodeSetDTM使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NodeSetDTM类属于com.sun.org.apache.xpath.internal包,在下文中一共展示了NodeSetDTM类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XNodeSetForDOM
import com.sun.org.apache.xpath.internal.NodeSetDTM; //导入依赖的package包/类
public XNodeSetForDOM(Node node, DTMManager dtmMgr)
{
m_dtmMgr = dtmMgr;
m_origObj = node;
int dtmHandle = dtmMgr.getDTMHandleFromNode(node);
setObject(new NodeSetDTM(dtmMgr));
((NodeSetDTM) m_obj).addNode(dtmHandle);
}
示例2: mutableNodeset
import com.sun.org.apache.xpath.internal.NodeSetDTM; //导入依赖的package包/类
/**
* Cast result object to a nodelist. Always issues an error.
*
* @return The object as a NodeSetDTM.
*
* @throws javax.xml.transform.TransformerException
*/
public NodeSetDTM mutableNodeset()
throws javax.xml.transform.TransformerException
{
error(XPATHErrorResources.ER_CANT_CONVERT_TO_MUTABLENODELIST,
new Object[]{ getTypeString() }); //"Can not convert "+getTypeString()+" to a NodeSetDTM!");
return (NodeSetDTM) m_obj;
}
示例3: XNodeSet
import com.sun.org.apache.xpath.internal.NodeSetDTM; //导入依赖的package包/类
/**
* Construct a XNodeSet object for one node.
*
* @param n Node to add to the new XNodeSet object
*/
public XNodeSet(int n, DTMManager dtmMgr)
{
super(new NodeSetDTM(dtmMgr));
m_dtmMgr = dtmMgr;
if (DTM.NULL != n)
{
((NodeSetDTM) m_obj).addNode(n);
m_last = 1;
}
else
m_last = 0;
}
示例4: getLength
import com.sun.org.apache.xpath.internal.NodeSetDTM; //导入依赖的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;
}
}