public static ScreenSize getByIndex(int index) { int i = 0; for (ScreenSize orient : values()) { if (i == index) { return orient; } i++; } return null; }
public static int getIndex(@Nullable ScreenSize value) { return value == null ? -1 : value.ordinal(); }
mMeta.getFrameOffsetLandscape().y = getInteger(mStringAccumulator); } else if (DeviceSchema.NODE_SCREEN_SIZE.equals(localName)) { mHardware.getScreen().setSize(ScreenSize.getEnum(getString(mStringAccumulator))); } else if (DeviceSchema.NODE_DIAGONAL_LENGTH.equals(localName)) { mHardware.getScreen().setDiagonalLength(getDouble(mStringAccumulator));
hardware.appendChild(screen); addElement(doc, screen, DeviceSchema.NODE_SCREEN_SIZE, s.getSize().getResourceValue()); addElement(doc, screen, DeviceSchema.NODE_DIAGONAL_LENGTH, String.format(Locale.US, "%.2f",s.getDiagonalLength()));
@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 ScreenSize getByIndex(int index) { ScreenSize[] values = values(); if (index >= 0 && index < values.length) { return values[index]; } return null; }
public static int getIndex(ScreenSize orientation) { int i = 0; for (ScreenSize orient : values()) { if (orient == orientation) { return i; } i++; } return -1; }
/** * 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 ScreenSize getEnum(String value) { for (ScreenSize 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 ScreenSize getEnum(String value) { for (ScreenSize orient : values()) { if (orient.mValue.equals(value)) { return orient; } } return null; }