pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Class AcceptLanguages.Value

java.lang.Object
  extended by org.torweg.pulse.service.request.AcceptLanguages.Value
All Implemented Interfaces:
java.lang.Comparable<AcceptLanguages.Value>
Enclosing class:
AcceptLanguages

public static final class AcceptLanguages.Value
extends java.lang.Object
implements java.lang.Comparable<AcceptLanguages.Value>

a single comparable accept-language value.


Constructor Summary
protected AcceptLanguages.Value(java.lang.String lang, double q, int p)
          creates a new value with the given quality 1.
protected AcceptLanguages.Value(java.lang.String lang, int p)
          creates a new value with the default quality 1.
 
Method Summary
 int compareTo(AcceptLanguages.Value o)
           
 boolean equals(java.lang.Object obj)
           
 java.util.Locale getLocale()
           
 double getQuality()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AcceptLanguages.Value

protected AcceptLanguages.Value(java.lang.String lang,
                                int p)
creates a new value with the default quality 1.

Parameters:
lang - the language
p - the position

AcceptLanguages.Value

protected AcceptLanguages.Value(java.lang.String lang,
                                double q,
                                int p)
creates a new value with the given quality 1.

Parameters:
lang - the language
q - the quality
p - the position
Method Detail

getLocale

public java.util.Locale getLocale()
Returns:
the locale

getQuality

public double getQuality()
Returns:
the quality

compareTo

public int compareTo(AcceptLanguages.Value o)
Specified by:
compareTo in interface java.lang.Comparable<AcceptLanguages.Value>
Parameters:
o - the value to compare with
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
See Also:
Comparable.compareTo(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code for the value

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to check for equality
Returns:
whether the values are equal

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the value