public static int getIndex(ScreenRatio value) { return value == null ? -1 : value.ordinal(); }
public static int getIndex(ScreenRatio orientation) { int i = 0; for (ScreenRatio orient : values()) { if (orient == orientation) { return i; } i++; } return -1; }
} else if (DeviceSchema.NODE_SCREEN_RATIO.equals(localName)) { mHardware.getScreen().setRatio( ScreenRatio.getEnum(getString(mStringAccumulator))); } else if (DeviceSchema.NODE_X_DIMENSION.equals(localName)) { mHardware.getScreen().setXDimension(getInteger(mStringAccumulator));
addElement(doc, screen, DeviceSchema.NODE_PIXEL_DENSITY, s.getPixelDensity().getResourceValue()); addElement(doc, screen, DeviceSchema.NODE_SCREEN_RATIO, s.getRatio().getResourceValue());
public static ScreenRatio getByIndex(int index) { int i = 0; for (ScreenRatio orient : values()) { if (i == index) { return orient; } i++; } return null; }
@Override public int hashCode() { int hash = 17; hash = 31 * hash + mScreenSize.ordinal(); long f = Double.doubleToLongBits(mDiagonalLength); hash = 31 * hash + (int) (f ^ (f >>> 32)); hash = 31 * hash + mPixelDensity.ordinal(); hash = 31 * hash + mScreenRatio.ordinal(); hash = 31 * hash + mXDimension; hash = 31 * hash + mYDimension; f = Double.doubleToLongBits(mXdpi); hash = 31 * hash + (int) (f ^ (f >>> 32)); f = Double.doubleToLongBits(mYdpi); hash = 31 * hash + (int) (f ^ (f >>> 32)); hash = 31 * hash + mMultitouch.ordinal(); hash = 31 * hash + mMechanism.ordinal(); hash = 31 * hash + mScreenType.ordinal(); hash = 31 * hash + mChin; if (mScreenRound != null) { hash = 31 * hash + mScreenRound.ordinal(); } return hash; }
public static ScreenRatio getByIndex(int index) { ScreenRatio[] values = values(); if (index >= 0 && index < values.length) { return values[index]; } return null; }
/** * Returns the enum for matching the provided qualifier value. * @param value The qualifier value. * @return the enum for the qualifier value or null if no matching was found. */ public static ScreenRatio getEnum(String value) { for (ScreenRatio orient : values()) { if (orient.mValue.equals(value)) { return orient; } } return null; }
/** * Returns the enum for matching the provided qualifier value. * @param value The qualifier value. * @return the enum for the qualifier value or null if no matching was found. */ public static ScreenRatio getEnum(String value) { for (ScreenRatio orient : values()) { if (orient.mValue.equals(value)) { return orient; } } return null; }