org.apache.slide.common
Class UriTokenizer

java.lang.Object
  |
  +--java.util.StringTokenizer
        |
        +--org.apache.slide.common.UriTokenizer
All Implemented Interfaces:
java.util.Enumeration

public final class UriTokenizer
extends java.util.StringTokenizer

Tokenizes a scope.

This tokenizer derives from StringTokenizer and tokenizes an Uri. This object is used for browsing down the main tree from the root element during retrieval and create operations.

Ex : the uri /foo/bar/bar.txt will be tokenized in the following tokens :

  • /
  • /foo
  • /foo/bar
  • /foo/bar/bar.txt

    Version:
    $Revision: 1.2 $
    Author:
    Remy Maucherat

    Field Summary
    (package private)  Namespace namespace
              Associated namespace.
    (package private)  int pos
              Position in the uri vector.
    (package private)  java.util.Vector uris
              Vector of all the scopes matched by the associated Uri.
     
    Constructor Summary
    UriTokenizer(Namespace namespace, Scope scope)
              Constructor.
    UriTokenizer(Namespace namespace, java.lang.String uri)
              Constructor.
     
    Method Summary
     Uri getParentUri()
              Get the parent uri.
     boolean hasMoreElements()
              True if the UriTokenizer contains additional scopes.
     boolean hasMoreTokens()
              True if the UriTokenizer contains additional scopes.
     java.lang.Object nextElement()
              Returns the next Uri as an Object.
     java.lang.String nextToken()
              Returns the next Uri as a String object.
     java.lang.String nextToken(java.lang.String delim)
              Returns the next Uri as an Uri object.
     Uri nextUri()
              Returns the next Uri as an Uri object.
     
    Methods inherited from class java.util.StringTokenizer
    countTokens
     
    Methods inherited from class java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    uris

    java.util.Vector uris
    Vector of all the scopes matched by the associated Uri.

    pos

    int pos
    Position in the uri vector.

    namespace

    Namespace namespace
    Associated namespace.
    Constructor Detail

    UriTokenizer

    public UriTokenizer(Namespace namespace,
                        java.lang.String uri)
    Constructor.
    Parameters:
    namespace -  
    uri -  

    UriTokenizer

    public UriTokenizer(Namespace namespace,
                        Scope scope)
    Constructor.
    Parameters:
    namespace -  
    scope -  
    Method Detail

    getParentUri

    public Uri getParentUri()
    Get the parent uri.
    Returns:
    Uri

    hasMoreElements

    public boolean hasMoreElements()
    True if the UriTokenizer contains additional scopes.
    Overrides:
    hasMoreElements in class java.util.StringTokenizer
    Returns:
    boolean

    hasMoreTokens

    public boolean hasMoreTokens()
    True if the UriTokenizer contains additional scopes.
    Overrides:
    hasMoreTokens in class java.util.StringTokenizer
    Returns:
    boolean

    nextElement

    public java.lang.Object nextElement()
                                 throws java.util.NoSuchElementException
    Returns the next Uri as an Object.
    Overrides:
    nextElement in class java.util.StringTokenizer
    Returns:
    Object
    Throws:
    java.util.NoSuchElementException -  

    nextToken

    public java.lang.String nextToken()
                               throws java.util.NoSuchElementException
    Returns the next Uri as a String object.
    Overrides:
    nextToken in class java.util.StringTokenizer
    Returns:
    String
    Throws:
    java.util.NoSuchElementException -  

    nextUri

    public Uri nextUri()
                throws java.util.NoSuchElementException
    Returns the next Uri as an Uri object.
    Returns:
    Uri
    Throws:
    java.util.NoSuchElementException -  

    nextToken

    public java.lang.String nextToken(java.lang.String delim)
                               throws java.util.NoSuchElementException
    Returns the next Uri as an Uri object.
    Overrides:
    nextToken in class java.util.StringTokenizer
    Parameters:
    delim -  
    Throws:
    java.util.NoSuchElementException -