Qwylt

java.lang.module
Class ScopedName

java.lang.Object
  extended by java.lang.module.AttributeSource
      extended by java.lang.module.ScopedName
Direct Known Subclasses:
Export, ExportMatcher

public abstract class ScopedName
extends AttributeSource

An AttributeSource whose name is meaningful only within a specified scope.

Since:
Dec 21, 2009
Author:
Bryan Atsatt. Copyright (c) 2010 Oracle.

Nested Class Summary
static class ScopedName.Scope
          Scope in which the name is interpreted.
 
Field Summary
 
Fields inherited from class java.lang.module.AttributeSource
NO_ATTRIBUTES, SERVICE_IMPLEMENTATION_KEY
 
Constructor Summary
protected ScopedName(ScopedName.Scope scope, java.lang.String name)
          Constructor.
 
Method Summary
 java.lang.String getName()
          Returns the name of this instance.
 ScopedName.Scope getScope()
          Returns the scope.
 boolean scopedNameEquals(ScopedName.Scope scope, java.lang.String name)
          Compares the name and scope only.
 boolean scopedNameEquals(ScopedName other)
          Compares the name and scope only.
 int scopedNameHashCode()
          Returns the hash code for the name and scope only.
static int scopedNameHashCode(ScopedName.Scope scope, java.lang.String name)
          Returns a hash code for the specified name and scope.
 java.lang.String toString()
          Returns a string representation of this instance.
 
Methods inherited from class java.lang.module.AttributeSource
appendAttributes, asList, containsAttribute, containsAttributes, getAttribute, getAttributeAsList, getAttributeKeys, getAttributes, modifiableList, unmodifiableMap, unmodifiableMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScopedName

protected ScopedName(ScopedName.Scope scope,
                     java.lang.String name)
Constructor.

Parameters:
scope - The scope.
name - The name.
Method Detail

getName

public java.lang.String getName()
Returns the name of this instance.

Specified by:
getName in class AttributeSource
Returns:
the name of this instance.

getScope

public ScopedName.Scope getScope()
Returns the scope.

Returns:
the scope.

scopedNameHashCode

public static int scopedNameHashCode(ScopedName.Scope scope,
                                     java.lang.String name)
Returns a hash code for the specified name and scope.

Parameters:
scope - The scope.
name - The name.
Returns:
The hash code.

scopedNameHashCode

public int scopedNameHashCode()
Returns the hash code for the name and scope only.

Returns:
The hash code.

scopedNameEquals

public boolean scopedNameEquals(ScopedName other)
Compares the name and scope only.

Parameters:
other - The ScopedName to compare to.
Returns:
true iff the name and scope are equal.

scopedNameEquals

public boolean scopedNameEquals(ScopedName.Scope scope,
                                java.lang.String name)
Compares the name and scope only.

Parameters:
scope - The scope.
name - The name.
Returns:
true iff the name and scope are equal.

toString

public java.lang.String toString()
Returns a string representation of this instance.

Overrides:
toString in class java.lang.Object
Returns:
The string.

Qwylt

Send comments or questions to Bryan Atsatt