com.android.ide.common.resources.configuration
Class CountryCodeQualifier

java.lang.Object
  extended by com.android.ide.common.resources.configuration.ResourceQualifier
      extended by com.android.ide.common.resources.configuration.CountryCodeQualifier
All Implemented Interfaces:
java.lang.Comparable<ResourceQualifier>

public final class CountryCodeQualifier
extends ResourceQualifier

Resource Qualifier for Mobile Country Code.


Field Summary
static java.lang.String NAME
           
 
Constructor Summary
CountryCodeQualifier()
           
CountryCodeQualifier(int code)
           
 
Method Summary
 boolean checkAndSet(java.lang.String value, FolderConfiguration config)
          Check if the value is valid for this qualifier, and if so sets the value into a Folder Configuration.
 boolean equals(java.lang.Object qualifier)
          Returns true if both objects are equal.
 int getCode()
           
 java.lang.String getFolderSegment()
          Returns the string used to represent this qualifier in the folder name.
static java.lang.String getFolderSegment(int code)
          Returns the folder name segment for the given value.
 java.lang.String getLongDisplayValue()
          Returns a string formatted for display purpose.
 java.lang.String getName()
          Returns the human readable name of the qualifier.
static CountryCodeQualifier getQualifier(java.lang.String segment)
          Creates and returns a qualifier from the given folder segment.
 java.lang.String getShortDisplayValue()
          Returns a string formatted for display purpose.
 java.lang.String getShortName()
          Returns a shorter human readable name for the qualifier.
 boolean hasFakeValue()
          Returns whether the qualifier has a fake value.
 int hashCode()
          Returns a hash code value for the object.
 boolean isValid()
          Returns whether the qualifier has a valid filter value.
 int since()
          Returns when this qualifier was added to Android.
 
Methods inherited from class com.android.ide.common.resources.configuration.ResourceQualifier
compareTo, deprecated, isBetterMatchThan, isMatchFor, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values
Constructor Detail

CountryCodeQualifier

public CountryCodeQualifier()

CountryCodeQualifier

public CountryCodeQualifier(int code)
Method Detail

getQualifier

public static CountryCodeQualifier getQualifier(java.lang.String segment)
Creates and returns a qualifier from the given folder segment. If the segment is incorrect, null is returned.

Parameters:
segment - the folder segment from which to create a qualifier.
Returns:
a new CountryCodeQualifier object or null

getFolderSegment

public static java.lang.String getFolderSegment(int code)
Returns the folder name segment for the given value. This is equivalent to calling ResourceQualifier.toString() on a CountryCodeQualifier object.

Parameters:
code - the value of the qualifier, as returned by getCode().

getCode

public int getCode()

getName

public java.lang.String getName()
Description copied from class: ResourceQualifier
Returns the human readable name of the qualifier.

Specified by:
getName in class ResourceQualifier

getShortName

public java.lang.String getShortName()
Description copied from class: ResourceQualifier
Returns a shorter human readable name for the qualifier.

Specified by:
getShortName in class ResourceQualifier
See Also:
ResourceQualifier.getName()

since

public int since()
Description copied from class: ResourceQualifier
Returns when this qualifier was added to Android.

Specified by:
since in class ResourceQualifier

isValid

public boolean isValid()
Description copied from class: ResourceQualifier
Returns whether the qualifier has a valid filter value.

Specified by:
isValid in class ResourceQualifier

hasFakeValue

public boolean hasFakeValue()
Description copied from class: ResourceQualifier
Returns whether the qualifier has a fake value.

Fake values are used internally and should not be used as real qualifier value.

Specified by:
hasFakeValue in class ResourceQualifier

checkAndSet

public boolean checkAndSet(java.lang.String value,
                           FolderConfiguration config)
Description copied from class: ResourceQualifier
Check if the value is valid for this qualifier, and if so sets the value into a Folder Configuration.

Specified by:
checkAndSet in class ResourceQualifier
Parameters:
value - The value to check and set. Must not be null.
config - The folder configuration to receive the value. Must not be null.
Returns:
true if the value was valid and was set.

equals

public boolean equals(java.lang.Object qualifier)
Description copied from class: ResourceQualifier
Returns true if both objects are equal.

This is declared as abstract to force children classes to implement it.

Specified by:
equals in class ResourceQualifier

hashCode

public int hashCode()
Description copied from class: ResourceQualifier
Returns a hash code value for the object.

This is declared as abstract to force children classes to implement it.

Specified by:
hashCode in class ResourceQualifier

getFolderSegment

public java.lang.String getFolderSegment()
Returns the string used to represent this qualifier in the folder name.

Specified by:
getFolderSegment in class ResourceQualifier

getShortDisplayValue

public java.lang.String getShortDisplayValue()
Description copied from class: ResourceQualifier
Returns a string formatted for display purpose.

Specified by:
getShortDisplayValue in class ResourceQualifier

getLongDisplayValue

public java.lang.String getLongDisplayValue()
Description copied from class: ResourceQualifier
Returns a string formatted for display purpose.

Specified by:
getLongDisplayValue in class ResourceQualifier