MaintainPrinterInfo2.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package com.epson.mobilephone.common.maintain2;
  2. public class MaintainPrinterInfo2 {
  3. private static final int EPS_INK_NUM = 20;
  4. private static final int EPS_STATUS_NUM = 3;
  5. public static final int ESCPR_INK_STATUS_END = 2;
  6. public static final int ESCPR_INK_STATUS_FAIL = -2;
  7. public static final int ESCPR_INK_STATUS_LOW = 1;
  8. public static final int ESCPR_INK_STATUS_NOREAD = -4;
  9. public static final int ESCPR_INK_STATUS_NORMAL = 0;
  10. public static final int ESCPR_INK_STATUS_NOTAVAIL = -3;
  11. public static final int ESCPR_INK_STATUS_NOTPRESENT = -1;
  12. private int[] mInkColorCode = new int[20];
  13. private int[] mInkColorName = new int[20];
  14. private int mInkNum;
  15. private int[] mInkRemeiningAmount = new int[20];
  16. private int[] mInkStatus = new int[20];
  17. private int[] mStatus = new int[3];
  18. public int[] getMStatus() {
  19. return mStatus;
  20. }
  21. public void setMStatus(int[] iArr) {
  22. mStatus = iArr;
  23. }
  24. public int getInkNum() {
  25. return mInkNum;
  26. }
  27. public int getInkCode(int i) {
  28. if (i >= 0 && i <= mInkNum) {
  29. return mInkColorCode[i];
  30. }
  31. throw new ArrayIndexOutOfBoundsException();
  32. }
  33. public int getInkName(int i) {
  34. if (i >= 0 && i <= mInkNum) {
  35. return mInkColorName[i];
  36. }
  37. throw new ArrayIndexOutOfBoundsException();
  38. }
  39. public int getInkRemainingAmount(int i) {
  40. if (i < 0 || i > mInkNum) {
  41. throw new ArrayIndexOutOfBoundsException();
  42. }
  43. int i2 = mInkRemeiningAmount[i];
  44. if (i2 < 0) {
  45. return 0;
  46. }
  47. return i2;
  48. }
  49. public int getInkStatus(int i) {
  50. if (i < 0 || i > mInkNum) {
  51. throw new ArrayIndexOutOfBoundsException();
  52. }
  53. int[] iArr = mInkStatus;
  54. if (i > iArr.length) {
  55. return -2;
  56. }
  57. return iArr[i];
  58. }
  59. }