Android Open Source - logcat-activity-android Buffer






From Project

Back to project page logcat-activity-android.

License

The source code is released under:

Apache License

If you think the Android project logcat-activity-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.leftshift.logcat;
/*from   w  ww .j av a2  s. c o  m*/
import java.util.HashMap;

import android.content.Context;

public enum Buffer {
  MAIN("main", R.string.main_title),
  EVENTS("events", R.string.events_title),
  RADIO("radio", R.string.radio_title);
  
  private static Buffer[] byOrder = new Buffer[3];

  static {
    byOrder[0] = MAIN;
    byOrder[1] = EVENTS;
    byOrder[2] = RADIO;
  }
  
  private static final HashMap<String,Buffer> VALUE_MAP = new HashMap<String,Buffer>();
  
  static {
    VALUE_MAP.put(MAIN.mValue, MAIN); 
    VALUE_MAP.put(EVENTS.mValue, EVENTS); 
    VALUE_MAP.put(RADIO.mValue, RADIO); 
  }
    
  private String mValue;
  private int mTitleId;
  
  private Buffer(String value, int titleId) {
    mValue = value;
    mTitleId = titleId;
  }
  
  public String getTitle(Context context) {
    return context.getResources().getString(mTitleId);
  }  
  
  public static final Buffer byValue(String value) {
    return VALUE_MAP.get(value);
  }
  
  public static Buffer getByOrder(int order) {
    return byOrder[order];
  }
  
  public String getValue() {
    return mValue;
  }
}




Java Source Code List

io.leftshift.logcat.Buffer.java
io.leftshift.logcat.Buffer.java
io.leftshift.logcat.FilterDialog.java
io.leftshift.logcat.FilterDialog.java
io.leftshift.logcat.Format.java
io.leftshift.logcat.Format.java
io.leftshift.logcat.Level.java
io.leftshift.logcat.Level.java
io.leftshift.logcat.LogEntryAdapter.java
io.leftshift.logcat.LogEntryAdapter.java
io.leftshift.logcat.LogEntry.java
io.leftshift.logcat.LogEntry.java
io.leftshift.logcat.LogcatActivity.java
io.leftshift.logcat.LogcatActivity.java
io.leftshift.logcat.Logcat.java
io.leftshift.logcat.Logcat.java
io.leftshift.logcat.Prefs.java
io.leftshift.logcat.Prefs.java
io.leftshift.logcatsample.MainActivity.java