Ejemplo n.º 1
0
  RemoteIterator getSessionData(long start, long end) throws RemoteException {
    ArrayList al = new ArrayList();
    SessionData sd = null;
    for (Iterator it = history.iterator(); it.hasNext(); ) {
      sd = (SessionData) it.next();
      if (sd.getTime() >= start && sd.getTime() <= end) al.add(sd);
    }

    SessionData[] sdarray = new SessionData[al.size()];
    for (int i = 0; i < sdarray.length; i++) sdarray[i] = (SessionData) al.get(i);

    return new SessionDataIterator(sdarray);
  }
Ejemplo n.º 2
0
 void deleteSessionData(long beforeDay) {
   SessionData sd = null;
   for (Iterator it = history.iterator(); it.hasNext(); ) {
     sd = (SessionData) it.next();
     if (sd.getTime() < beforeDay) it.remove();
   }
 }