public static int getIndex(TouchScreen touch) { return touch == null ? -1 : touch.ordinal(); }
public static TouchScreen getByIndex(int index) { TouchScreen[] values = values(); if (index >= 0 && index < values.length) { return values[index]; } return null; }
} else if (DeviceSchema.NODE_MECHANISM.equals(localName)) { mHardware.getScreen().setMechanism( TouchScreen.getEnum(getString(mStringAccumulator))); } else if (DeviceSchema.NODE_SCREEN_TYPE.equals(localName)) { mHardware.getScreen().setScreenType(
addElement(doc, touch, DeviceSchema.NODE_MECHANISM, s.getMechanism().getResourceValue()); addElement(doc, touch, DeviceSchema.NODE_SCREEN_TYPE, s.getScreenType().toString());
public static int getIndex(TouchScreen touch) { int i = 0; for (TouchScreen t : values()) { if (t == touch) { return i; } i++; } return -1; }
@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 TouchScreen getByIndex(int index) { int i = 0; for (TouchScreen value : values()) { if (i == index) { return value; } i++; } 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 TouchScreen getEnum(String value) { for (TouchScreen 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 TouchScreen getEnum(String value) { for (TouchScreen orient : values()) { if (orient.mValue.equals(value)) { return orient; } } return null; }