@Test public void valueOf_Unit_DP() throws Exception { Dimension d = Dimension.valueOf("16dp"); assertThat(d.value, is(16d)); assertThat(d.unit, is(Dimension.DIMENSION_UNIT_DP)); }
public static Dimension valueOf(String dimension) { if (null == dimension) { return ZERO; } Dimension d = DimensionCache.cache.get(dimension); if (null == d) { d = new Dimension(dimension); DimensionCache.cache.put(dimension, d); } return d; }
Dimension extends Value { public static Dimension valueOf(String dimension) { if (null == dimension) { return ZERO; } Dimension d = DimensionCache.cache.get(dimension); if (null == d) { d = new Dimension(dimension); DimensionCache.cache.put(dimension, d); } return d; } }
Dimension extends Value { public static Dimension valueOf(String dimension) { if (null == dimension) { return ZERO; } Dimension d = DimensionCache.cache.get(dimension); if (null == d) { d = new Dimension(dimension); DimensionCache.cache.put(dimension, d); } return d; } private  Dimension(float value, int unit); private  Dimension(String dimension); }
Dimension extends Value { public static Dimension valueOf(String dimension) { if (null == dimension) { return ZERO; } Dimension d = DimensionCache.cache.get(dimension); if (null == d) { d = new Dimension(dimension); DimensionCache.cache.put(dimension, d); } return d; } private  Dimension(float value, int unit); private  Dimension(String dimension); static Dimension valueOf(String dimension); static float apply(String dimension, Context context); float apply(Context context); @Override Value copy(); @Override String toString(); }
Dimension extends Value { public static Dimension valueOf(String dimension) { if (null == dimension) { return ZERO; } Dimension d = DimensionCache.cache.get(dimension); if (null == d) { d = new Dimension(dimension); DimensionCache.cache.put(dimension, d); } return d; } private  Dimension(float value, int unit); private  Dimension(String dimension); static Dimension valueOf(String dimension); static float apply(String dimension, Context context); float apply(Context context); @Override Value copy(); @Override String toString(); static final int DIMENSION_UNIT_ENUM; static final int DIMENSION_UNIT_PX; static final int DIMENSION_UNIT_DP; static final int DIMENSION_UNIT_SP; static final int DIMENSION_UNIT_PT; static final int DIMENSION_UNIT_IN; static final int DIMENSION_UNIT_MM; static final String MATCH_PARENT; static final String FILL_PARENT; static final String WRAP_CONTENT; static final String SUFFIX_PX; static final String SUFFIX_DP; static final String SUFFIX_SP; static final String SUFFIX_PT; static final String SUFFIX_IN; static final String SUFFIX_MM; static final BiMap<String, Integer> sDimensionsMap; static final BiMap<String, Integer> sDimensionsUnitsMap; static final Dimension ZERO; final double value; final int unit; }