montimaj

Samples

Mar 17th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Samples {
  4.     private double mStartTime;
  5.     private double mEndTime;
  6.     private String mStatus;
  7.     private int mFirstWordIndex;
  8.     private int mLastWordIndex;
  9.  
  10.     Samples(String entry) {
  11.         Scanner sc = new Scanner(entry);
  12.         mStartTime = Double.parseDouble(sc.next());
  13.         mEndTime = Double.parseDouble(sc.next());
  14.         mStatus = sc.next();
  15.         mFirstWordIndex = Integer.parseInt(sc.next());
  16.         mLastWordIndex = Integer.parseInt(sc.next());
  17.     }
  18.  
  19.     @Override
  20.     public String toString() {
  21.         return mStartTime + " " + mEndTime + " " + mStatus + " " + mFirstWordIndex + " " + mLastWordIndex;
  22.     }
  23.  
  24.     public double getStartTime() { return mStartTime; }
  25.     public double getEndTime() { return mEndTime; }
  26.     public String getStatus() { return mStatus; }
  27.     public int getFirstWordIndex() { return mFirstWordIndex; }
  28.     public int getLastWordIndex() { return mLastWordIndex; }
  29.     public void setStatus(String status) { mStatus = status; }
  30.     public void setStartTime(Double starttime) { mStartTime = starttime; }
  31.     public void setEndTime(Double endtime) {mEndTime = endtime; }
  32.     public void setFirstWordIndex(int firstindex) { mFirstWordIndex = firstindex; }
  33.     public void setLastWordIndex(int lastindex) { mLastWordIndex = lastindex; }
  34. }
Add Comment
Please, Sign In to add comment