org.apache.slide.common
Class ScopeTokenizer

java.lang.Object
  |
  +--java.util.StringTokenizer
        |
        +--org.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.2 $
    Author:
    Remy Maucherat
    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.
     
    Constructor Summary
    ScopeTokenizer(Namespace namespace, Scope scope)
              Constructor.
    ScopeTokenizer(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.
    Constructor Detail

    ScopeTokenizer

    public ScopeTokenizer(Namespace namespace,
                          java.lang.String uri)
    Constructor.
    Parameters:
    uri - Uri which needs to be tokenized in Scopes.

    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.
    Overrides:
    hasMoreElements in class java.util.StringTokenizer
    Returns:
    boolean

    hasMoreTokens

    public boolean hasMoreTokens()
    True if the ScopeTokenizer 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 Scope 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 Scope as a String object.
    Overrides:
    nextToken in class java.util.StringTokenizer
    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.
    Overrides:
    nextToken in class java.util.StringTokenizer
    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