com.android.ide.common.xml
Class ManifestData.SupportsScreens

java.lang.Object
  extended by com.android.ide.common.xml.ManifestData.SupportsScreens
Enclosing class:
ManifestData

public static final class ManifestData.SupportsScreens
extends java.lang.Object

Class representing the supports-screens node in the manifest. By default, all the getters will return null if there was no value defined in the manifest. To get an instance with all the actual values, use resolveSupportsScreensValues(int)


Constructor Summary
ManifestData.SupportsScreens()
           
ManifestData.SupportsScreens(java.lang.String value)
          Instantiate an instance from a string.
 
Method Summary
 int compareScreenSizesWith(ManifestData.SupportsScreens o)
          Comparison of 2 Supports-screens.
 boolean equals(java.lang.Object obj)
           
 java.lang.Boolean getAnyDensity()
          returns the value of the anyDensity attribute or null if not present.
static ManifestData.SupportsScreens getDefaultValues(int targetSdkVersion)
          Returns an instance of ManifestData.SupportsScreens initialized with the default values based on the given targetSdkVersion.
 java.lang.String getEncodedValues()
          Returns a string encoding of the content of the instance.
 java.lang.Boolean getLargeScreens()
          returns the value of the largeScreens attribute or null if not present.
 java.lang.Boolean getNormalScreens()
          returns the value of the normalScreens attribute or null if not present.
 java.lang.Boolean getResizeable()
          returns the value of the resizeable attribute or null if not present.
 java.lang.Boolean getSmallScreens()
          returns the value of the smallScreens attribute or null if not present.
 int hashCode()
           
 boolean hasSameScreenSupportAs(ManifestData.SupportsScreens support)
          Returns true if the two instances support the same screen sizes.
 boolean hasStrictlyDifferentScreenSupportAs(ManifestData.SupportsScreens support)
          Returns true if the two instances have strictly different screen size support.
 boolean overlapWith(ManifestData.SupportsScreens otherSS)
          Returns true if the two instance overlap with each other.
 ManifestData.SupportsScreens resolveSupportsScreensValues(int targetSdkVersion)
          Returns a version of the receiver for which all values have been set, even if they were not present in the manifest.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManifestData.SupportsScreens

public ManifestData.SupportsScreens()

ManifestData.SupportsScreens

public ManifestData.SupportsScreens(java.lang.String value)
Instantiate an instance from a string. The string must have been created with getEncodedValues().

Parameters:
value - the string.
Method Detail

getDefaultValues

public static ManifestData.SupportsScreens getDefaultValues(int targetSdkVersion)
Returns an instance of ManifestData.SupportsScreens initialized with the default values based on the given targetSdkVersion.

Parameters:
targetSdkVersion -

resolveSupportsScreensValues

public ManifestData.SupportsScreens resolveSupportsScreensValues(int targetSdkVersion)
Returns a version of the receiver for which all values have been set, even if they were not present in the manifest.

Parameters:
targetSdkVersion - the target api level of the app, since this has an effect on default values.

getResizeable

public java.lang.Boolean getResizeable()
returns the value of the resizeable attribute or null if not present.


getAnyDensity

public java.lang.Boolean getAnyDensity()
returns the value of the anyDensity attribute or null if not present.


getSmallScreens

public java.lang.Boolean getSmallScreens()
returns the value of the smallScreens attribute or null if not present.


getNormalScreens

public java.lang.Boolean getNormalScreens()
returns the value of the normalScreens attribute or null if not present.


getLargeScreens

public java.lang.Boolean getLargeScreens()
returns the value of the largeScreens attribute or null if not present.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

hasSameScreenSupportAs

public boolean hasSameScreenSupportAs(ManifestData.SupportsScreens support)
Returns true if the two instances support the same screen sizes. This is similar to equals(Object) except that it ignores the values of getAnyDensity() and getResizeable().

Parameters:
support - the other instance to compare to.
Returns:
true if the two instances support the same screen sizes.

hasStrictlyDifferentScreenSupportAs

public boolean hasStrictlyDifferentScreenSupportAs(ManifestData.SupportsScreens support)
Returns true if the two instances have strictly different screen size support. This means that there is no screen size that they both support.

Parameters:
support - the other instance to compare to.
Returns:
true if they are strictly different.

compareScreenSizesWith

public int compareScreenSizesWith(ManifestData.SupportsScreens o)
Comparison of 2 Supports-screens. This only uses screen sizes (ignores resizeable and anyDensity), and considers that #hasStrictlyDifferentScreenSupportAs(SupportsScreens) returns true and #overlapWith(SupportsScreens) returns false.

Throws:
java.lang.IllegalArgumentException - if the two instanced are not strictly different or overlap each other
See Also:
#hasStrictlyDifferentScreenSupportAs(SupportsScreens), #overlapWith(SupportsScreens)

getEncodedValues

public java.lang.String getEncodedValues()
Returns a string encoding of the content of the instance. This string can be used to instantiate a ManifestData.SupportsScreens object through #SupportsScreens(String).


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

overlapWith

public boolean overlapWith(ManifestData.SupportsScreens otherSS)
Returns true if the two instance overlap with each other. This can happen if one instances supports a size, when the other instance doesn't while supporting a size above and a size below.

Parameters:
otherSS - the other supports-screens to compare to.