org.ws4d.java.types
Class ScopeSet

java.lang.Object
  extended by org.ws4d.java.types.ScopeSet
Direct Known Subclasses:
ProbeScopeSet

public class ScopeSet
extends java.lang.Object


Constructor Summary
ScopeSet()
          Constructor.
ScopeSet(int initialCapacity)
           
ScopeSet(ScopeSet set)
          Copy Constructor.
ScopeSet(java.lang.String[] scopes)
          Constructor.
 
Method Summary
 void addAll(ScopeSet scopes)
          Adds set of scopes to this.
 void addScope(java.lang.String scope)
          Adds a single scope to set of scopes.
 void addScope(URI scope)
          Adds a single scope to set of scopes.
 void addUnknownAttribute(QName attributeName, java.lang.Object value)
          Adds unknown attribute.
static ScopeSet construct(java.lang.String scopes)
          Constructs a scope set from a string of scopes separated by ' '.
 boolean contains(java.lang.String scope)
           
 boolean containsAll(ScopeSet others)
          Checks if a given scope set is completely contained in this list.
 URI getScope(int index)
           
 java.lang.String getScopesAsString()
           
 java.lang.String[] getScopesAsStringArray()
           
 URISet getScopesAsUris()
          Gets a set of uris.
 java.lang.Object getUnknownAttribute(QName attributeName)
          Gets unknown attribute by given attribute qname.
 HashMap getUnknownAttributes()
          Gets all unknown attributes.
 boolean isEmpty()
          true - if this does not have any scopes.
 void setScopes(java.lang.String[] scopes)
          Sets scopes.
 int size()
          Gets size of scope list.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopeSet

public ScopeSet()
Constructor.


ScopeSet

public ScopeSet(int initialCapacity)

ScopeSet

public ScopeSet(java.lang.String[] scopes)
Constructor.

Parameters:
scopes - list of scopes

ScopeSet

public ScopeSet(ScopeSet set)
Copy Constructor.

Method Detail

construct

public static ScopeSet construct(java.lang.String scopes)
Constructs a scope set from a string of scopes separated by ' '.

Parameters:
scopes -
Returns:
the set of scopes gained from scopes

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getScope

public URI getScope(int index)

size

public int size()
Gets size of scope list.

Returns:
size

getScopesAsUris

public URISet getScopesAsUris()
Gets a set of uris.

Returns:
uris

getScopesAsStringArray

public java.lang.String[] getScopesAsStringArray()
Returns:
all scopes as a string array

getScopesAsString

public java.lang.String getScopesAsString()

isEmpty

public boolean isEmpty()
true - if this does not have any scopes.

Returns:
whether this scope set is empty or not

getUnknownAttribute

public java.lang.Object getUnknownAttribute(QName attributeName)
Gets unknown attribute by given attribute qname.

Parameters:
attributeName -
Returns:
the value of an unknown attribute with the given name

getUnknownAttributes

public HashMap getUnknownAttributes()
Gets all unknown attributes.

Returns:
all unknown attributes

addScope

public void addScope(java.lang.String scope)
Adds a single scope to set of scopes.

Parameters:
scope - scope to add.

addScope

public void addScope(URI scope)
Adds a single scope to set of scopes.

Parameters:
scope - scope to add.

addAll

public void addAll(ScopeSet scopes)
Adds set of scopes to this.

Parameters:
scopes - scopes to add.

addUnknownAttribute

public void addUnknownAttribute(QName attributeName,
                                java.lang.Object value)
Adds unknown attribute.

Parameters:
attributeName -
value -

containsAll

public boolean containsAll(ScopeSet others)
Checks if a given scope set is completely contained in this list. The given probe scope list defines the matching algorithm to check with.

Parameters:
others -
Returns:
whether this set contains all scopes from the passed-in probe scope set

contains

public boolean contains(java.lang.String scope)

setScopes

public void setScopes(java.lang.String[] scopes)
Sets scopes. If this contains already scopes, this scopes will be removed.

Parameters:
scopes - the scopes to set