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

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

public final class ScreenHeightQualifier
extends ResourceQualifier

Resource Qualifier for Screen Pixel Density.


Field Summary
static java.lang.String NAME
           
 
Constructor Summary
ScreenHeightQualifier()
           
ScreenHeightQualifier(int value)
           
 
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 obj)
          Returns true if both objects are equal.
 java.lang.String getFolderSegment()
          Returns a string formatted to be used in a folder name.
 java.lang.String getLongDisplayValue()
          Returns a string formatted for display purpose.
 java.lang.String getName()
          Returns the human readable name of the qualifier.
static ScreenHeightQualifier getQualifier(java.lang.String value)
           
 java.lang.String getShortDisplayValue()
          Returns a string formatted for display purpose.
 java.lang.String getShortName()
          Returns a shorter human readable name for the qualifier.
 int getValue()
           
 boolean hasFakeValue()
          Returns whether the qualifier has a fake value.
 int hashCode()
          Returns a hash code value for the object.
 boolean isBetterMatchThan(ResourceQualifier compareTo, ResourceQualifier reference)
          Returns true if the receiver is a better match for the given reference than the given compareTo comparable.
 boolean isMatchFor(ResourceQualifier qualifier)
          Returns whether the given qualifier is a match for the receiver.
 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, 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

ScreenHeightQualifier

public ScreenHeightQualifier()

ScreenHeightQualifier

public ScreenHeightQualifier(int value)
Method Detail

getValue

public int getValue()

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

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

isValid

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

Specified by:
isValid 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.

getQualifier

public static ScreenHeightQualifier getQualifier(java.lang.String value)

isMatchFor

public boolean isMatchFor(ResourceQualifier qualifier)
Description copied from class: ResourceQualifier
Returns whether the given qualifier is a match for the receiver.

The default implementation returns the result of ResourceQualifier.equals(Object).

Children class that re-implements this must implement ResourceQualifier.isBetterMatchThan(ResourceQualifier, ResourceQualifier) too.

Overrides:
isMatchFor in class ResourceQualifier
Parameters:
qualifier - the reference qualifier
Returns:
true if the receiver is a match.

isBetterMatchThan

public boolean isBetterMatchThan(ResourceQualifier compareTo,
                                 ResourceQualifier reference)
Description copied from class: ResourceQualifier
Returns true if the receiver is a better match for the given reference than the given compareTo comparable.

Overrides:
isBetterMatchThan in class ResourceQualifier
Parameters:
compareTo - The ResourceQualifier to compare to. Can be null, in which case the method must return true.
reference - The reference qualifier value for which the match is.
Returns:
true if the receiver is a better match.

getFolderSegment

public java.lang.String getFolderSegment()
Description copied from class: ResourceQualifier
Returns a string formatted to be used in a folder name.

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

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

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

equals

public boolean equals(java.lang.Object obj)
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