private static List<Integer> testArray(String label, int dateToAdd, boolean increase) {
    JAMonBufferListener jbl = (JAMonBufferListener) JAMonListenerFactory.get(label);
    BufferList bl = jbl.getBufferList();

    Calendar cal = new GregorianCalendar();
    if (increase) {
      for (int i = 1, j = -50; i <= 100; i++, j++) {
        cal.setTime(new Date());
        cal.add(dateToAdd, j);
        bl.addRow(new Object[] {"label" + i, new Integer(i), "Active" + i, cal.getTime()});
      }

    } else {
      for (int i = 100, j = 50; i >= 1; i--, j--) {
        cal.setTime(new Date());
        cal.add(dateToAdd, j);
        bl.addRow(new Object[] {"label" + i, new Integer(i), "Active" + i, cal.getTime()});
      }
    }

    // firstVal will be under date threshold, and secondVal will exceed it.
    int firstVal = -5;
    int secondVal = -10;

    if (dateToAdd == Calendar.HOUR_OF_DAY) {
      firstVal = -12;
      secondVal = -36;
    }

    cal.setTime(new Date());
    cal.add(dateToAdd, firstVal);
    bl.addRow(new Object[] {"label", new Integer(1000), "Active", cal.getTime()});

    cal.setTime(new Date());
    cal.add(dateToAdd, firstVal);
    bl.addRow(new Object[] {"label", new Integer(-1000), "Active", cal.getTime()});

    cal.setTime(new Date());
    cal.add(dateToAdd, secondVal);
    bl.addRow(new Object[] {"label", new Integer(1100), "Active", cal.getTime()});

    cal.setTime(new Date());
    cal.add(dateToAdd, secondVal);
    bl.addRow(new Object[] {"label", new Integer(-1100), "Active", cal.getTime()});

    return grabIntegers(bl.getData());
  }
Esempio n. 2
0
 public boolean hasData() {
   return list.hasData();
 }
Esempio n. 3
0
 public boolean isEmpty() {
   return list.isEmpty();
 }
Esempio n. 4
0
 public int getRowCount() {
   return list.getRowCount();
 }
Esempio n. 5
0
 /** Make a copy of this instance */
 public JAMonListener copy() {
   return new JAMonBufferListener(getName(), list.copy());
 }
Esempio n. 6
0
 /** Add a row to the buffer */
 public void addRow(Object[] row) {
   list.addRow(row);
 }
Esempio n. 7
0
 /** Add a row to the buffer */
 public void addRow(ToArray row) {
   list.addRow(row);
 }
Esempio n. 8
0
 /** When this event is fired the monitor will be added to the rolling buffer */
 public void processEvent(Monitor mon) {
   list.addRow(mon.getJAMonDetailRow());
 }