Code example for HashMap

Methods: size

1
    private static final String ATTR_NAME = "name";
 
    public PowerProfile(Context context) {
        // Read the XML file for the given profile (normally only one per 
        // device) 
        if (sPowerMap.size() == 0) {
            readPowerValuesFromXml(context);
        } 
    } 
 
    private void readPowerValuesFromXml(Context context) {
        int id = com.android.internal.R.xml.power_profile;
        XmlResourceParser parser = context.getResources().getXml(id);
        boolean parsingArray = false;
        ArrayList<Double> array = new ArrayList<Double>();
        String arrayName = null;
 
        try { 
            XmlUtils.beginDocument(parser, TAG_DEVICE);
 
            while (true) {