FileDocCategorySizeDatePackage
EventLogTags.javaAPI DocAndroid 1.5 API2887Wed May 06 22:41:56 BST 2009android.util

EventLogTags

public class EventLogTags extends Object
Parsed representation of /etc/event-log-tags.

Fields Summary
private static final String
TAG
private static final String
TAGS_FILE
private static final Pattern
COMMENT_PATTERN
private static final Pattern
TAG_PATTERN
private final HashMap
mNameMap
private final HashMap
mTagMap
Constructors Summary
public EventLogTags()


        
        this(new BufferedReader(new FileReader(TAGS_FILE), 256));
    
public EventLogTags(BufferedReader input)

        String line;
        while ((line = input.readLine()) != null) {
            Matcher m = COMMENT_PATTERN.matcher(line);
            if (m.matches()) continue;

            m = TAG_PATTERN.matcher(line);
            if (m.matches()) {
                try {
                    int tag = Integer.parseInt(m.group(1));
                    Description d = new Description(tag, m.group(2));
                    mNameMap.put(d.mName, d);
                    mTagMap.put(d.mTag, d);
                } catch (NumberFormatException e) {
                    Log.e(TAG, "Error in event log tags entry: " + line, e);
                }
            } else {
                Log.e(TAG, "Can't parse event log tags entry: " + line);
            }
        }
    
Methods Summary
public android.util.EventLogTags$Descriptionget(java.lang.String name)

        return mNameMap.get(name);
    
public android.util.EventLogTags$Descriptionget(int tag)

        return mTagMap.get(tag);