it.could.util.location
Class Path.Element

java.lang.Object
  extended byit.could.util.location.Path.Element
All Implemented Interfaces:
Encodable, EncodingAware
Enclosing class:
Path

public static class Path.Element
extends Object
implements Encodable

The Element class represents a path element within the Path structure.

Author:
Pier Fumagalli

Field Summary
 
Fields inherited from interface it.could.util.encoding.EncodingAware
DEFAULT_ENCODING, PLATFORM_ENCODING
 
Constructor Summary
Path.Element(String name, String extra)
          Create a new Element instance given its url-decoded components name and extra.
 
Method Summary
 boolean equals(Object object)
          Check if the specified Object is equal to this Element instance.
 String getExtra()
          Return the url-decoded String extra path of this Element.
 String getName()
          Return the url-decoded String name of this Element.
 int hashCode()
          Return the hash code value of this Element instance.
 String toString()
          Return the URL-encoded String representation of this Element instance.
 String toString(String encoding)
          Return the URL-encoded String representation of this Element instance using the specified character encoding.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Path.Element

public Path.Element(String name,
                    String extra)

Create a new Element instance given its url-decoded components name and extra.

Throws:
NullPointerException - if the specified name was null.
Method Detail

getName

public String getName()

Return the url-decoded String name of this Element.


getExtra

public String getExtra()

Return the url-decoded String extra path of this Element.


toString

public String toString()

Return the URL-encoded String representation of this Element instance.

Specified by:
toString in interface Encodable

toString

public String toString(String encoding)
                throws UnsupportedEncodingException

Return the URL-encoded String representation of this Element instance using the specified character encoding.

Specified by:
toString in interface Encodable
Throws:
UnsupportedEncodingException - if the specified encoding is not supported by the platform.

hashCode

public int hashCode()

Return the hash code value of this Element instance.


equals

public boolean equals(Object object)

Check if the specified Object is equal to this Element instance.

The specified Object is considered equal to this one if it is non-null, is a Element instance and its string representation equals this one's.