Android Open Source - SimpleLogViewer Item






From Project

Back to project page SimpleLogViewer.

License

The source code is released under:

Apache License

If you think the Android project SimpleLogViewer 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 com.emelabs.logviewer;
/*from  ww  w.j  ava  2 s . c om*/
import java.text.SimpleDateFormat;
import java.util.Date;

import android.annotation.SuppressLint;

public class Item {
  
  /**
   * Priority code
   */
  private int priority;
  
  /**
   * Priority name
   */
  private String stringPriority;
  
  /**
   * Log timestamp
   */
  private Date timestamp;
  
  /**
   * Tag message
   */
  private String tag;
  
  /**
   * Message
   */
  private String message;
  
  @SuppressLint("SimpleDateFormat")
  private static final SimpleDateFormat formatter = new SimpleDateFormat("MM-dd HH:mm:ss.SSS");

  public Item() {
    super();
  }

  public Item(int priority, String strPriority, Date timestamp, String tag, String message) {
    super();
    this.stringPriority = strPriority;
    this.priority = priority;
    this.timestamp = timestamp;
    this.tag = tag;
    this.message = message;
  }

  public int getPriority() {
    return priority;
  }

  public String getStringPriority() {
    return stringPriority;
  }

  public Date getTimestamp() {
    return timestamp;
  }

  public String getTag() {
    return tag;
  }

  public String getMessage() {
    return message;
  }

  public String getTimestampAsString(){
    return formatter.format(timestamp);
  }

  @Override
  public String toString() {
    return "Item [priority=" + priority + ", stringPriority="
        + stringPriority + ", timestamp=" + timestamp + ", tag=" + tag
        + ", message=" + message + "]";
  }

  /**
   * @param selectedPriority
   * @return
   */
  public boolean isShowInPriority(int selectedPriority) {
    return this.priority >= selectedPriority;
  }
}




Java Source Code List

com.emelabs.logviewer.Item.java
com.emelabs.logviewer.LogAdapter.java
com.emelabs.logviewer.LogParserImp.java
com.emelabs.logviewer.LogParser.java
com.emelabs.logviewer.MainActivity.java