org.apache.slide.common
Class ScopeTokenizer

java.lang.Object
  extended byjava.util.StringTokenizer
      extended byorg.apache.slide.common.ScopeTokenizer
All Implemented Interfaces:
java.util.Enumeration

public final class ScopeTokenizer
extends java.util.StringTokenizer

Tokenizes a scope.

This tokenizer derives from StringTokenizer and tokenizes a scope in sub scopes. This object is used for Scope matching in the registry. The API of this object is the same as the StringTokenizer API.

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

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

    Version:
    $Revision: 1.7 $
    See Also:
    StringTokenizer

    Field Summary
    (package private)  Namespace namespace
              Namespace.
    (package private)  int pos
              Cursor position in the token container.
    (package private)  java.util.Vector scopes
              Tokens container.
    (package private)  SlideToken slideToken
               
     
    Constructor Summary
    ScopeTokenizer(Namespace namespace, Scope scope)
              Constructor.
    ScopeTokenizer(Namespace namespace, java.lang.String uri)
              Constructor.
    ScopeTokenizer(SlideToken slideToken, Namespace namespace, java.lang.String uri)
              Constructor.
     
    Method Summary
     java.util.Enumeration elements()
              Returns the scopes.
     Uri getParentUri()
              Get the parent Uri of the top level scope.
    (package private)  java.lang.String getUri()
              Get the parsed uri.
     boolean hasMoreElements()
              True if the ScopeTokenizer contains additional scopes.
     boolean hasMoreTokens()
              True if the ScopeTokenizer contains additional scopes.
     java.lang.Object nextElement()
              Returns the next Scope as an Object.
     Scope nextScope()
              Returns the next Scope as a Scope object.
     java.lang.String nextToken()
              Returns the next Scope as a String object.
     java.lang.String nextToken(java.lang.String delim)
              Returns the next Scope as a String 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

    scopes

    java.util.Vector scopes
    Tokens container.


    pos

    int pos
    Cursor position in the token container.


    namespace

    Namespace namespace
    Namespace.


    slideToken

    SlideToken slideToken
    Constructor Detail

    ScopeTokenizer

    public ScopeTokenizer(SlideToken slideToken,
                          Namespace namespace,
                          java.lang.String uri)
    Constructor.

    Parameters:
    uri - Uri which needs to be tokenized in Scopes.

    ScopeTokenizer

    public ScopeTokenizer(Namespace namespace,
                          java.lang.String uri)
    Constructor.

    Parameters:
    namespace -
    uri -

    ScopeTokenizer

    public ScopeTokenizer(Namespace namespace,
                          Scope scope)
    Constructor.

    Parameters:
    namespace -
    scope -
    Method Detail

    getParentUri

    public Uri getParentUri()
    Get the parent Uri of the top level scope.

    Returns:
    Uri Parent Uri

    hasMoreElements

    public boolean hasMoreElements()
    True if the ScopeTokenizer contains additional scopes.

    Returns:
    boolean

    hasMoreTokens

    public boolean hasMoreTokens()
    True if the ScopeTokenizer contains additional scopes.

    Returns:
    boolean

    nextElement

    public java.lang.Object nextElement()
                                 throws java.util.NoSuchElementException
    Returns the next Scope as an Object.

    Returns:
    Object
    Throws:
    java.util.NoSuchElementException

    nextToken

    public java.lang.String nextToken()
                               throws java.util.NoSuchElementException
    Returns the next Scope as a String object.

    Returns:
    String
    Throws:
    java.util.NoSuchElementException

    nextScope

    public Scope nextScope()
                    throws java.util.NoSuchElementException
    Returns the next Scope as a Scope object.

    Returns:
    Scope
    Throws:
    java.util.NoSuchElementException

    nextToken

    public java.lang.String nextToken(java.lang.String delim)
                               throws java.util.NoSuchElementException
    Returns the next Scope as a String object.

    Parameters:
    delim -
    Throws:
    java.util.NoSuchElementException

    elements

    public java.util.Enumeration elements()
    Returns the scopes.

    Returns:
    Enumeration

    getUri

    java.lang.String getUri()
    Get the parsed uri.

    Returns:
    String Uri