Java Code Examples for com.sun.org.apache.xml.internal.utils.SuballocatedIntVector#indexOf()

The following examples show how to use com.sun.org.apache.xml.internal.utils.SuballocatedIntVector#indexOf() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DTMDefaultBase.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 2
Source File: DTMDefaultBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 3
Source File: DTMDefaultBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 4
Source File: DTMDefaultBase.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 5
Source File: DTMDefaultBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 6
Source File: DTMDefaultBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 7
Source File: DTMDefaultBase.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 8
Source File: DTMDefaultBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 9
Source File: DTMDefaultBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 10
Source File: DTMDefaultBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}
 
Example 11
Source File: DTMDefaultBase.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Given a namespace handle, advance to the next namespace.
 *
 * @param baseHandle handle to original node from where the first namespace
 * was relative to (needed to return nodes in document order).
 * @param nodeHandle A namespace handle for which we will find the next node.
 * @param inScope true if all namespaces that are in scope should be processed,
 * otherwise just process the nodes in the given element handle.
 * @return handle of next namespace, or DTM.NULL to indicate none exists.
 */
public int getNextNamespaceNode(int baseHandle, int nodeHandle,
                                boolean inScope)
{
      if(inScope)
        {
          //Since we've been given the base, try direct lookup
          //(could look from nodeHandle but this is at least one
          //comparison/get-parent faster)
          //SuballocatedIntVector nsContext=findNamespaceContext(nodeHandle & m_mask);

              SuballocatedIntVector nsContext=findNamespaceContext(makeNodeIdentity(baseHandle));

          if(nsContext==null)
            return NULL;
          int i=1 + nsContext.indexOf(nodeHandle);
          if(i<=0 || i==nsContext.size())
            return NULL;

          return nsContext.elementAt(i);
        }
      else
        {
          // Assume that attributes and namespace nodes immediately follow the element.
          int identity = makeNodeIdentity(nodeHandle);
          while (DTM.NULL != (identity = getNextNodeIdentity(identity)))
            {
              int type = _type(identity);
              if (type == DTM.NAMESPACE_NODE)
                {
                  return makeNodeHandle(identity);
                }
              else if (type != DTM.ATTRIBUTE_NODE)
                {
                  break;
                }
            }
        }
   return DTM.NULL;
}