Package de.marcusschiesser.dbpendler.common.vo

Examples of de.marcusschiesser.dbpendler.common.vo.ConnectionVO


    List<ConnectionVO> connections = ConnectionParser.getInstance().getConnectionTime(session, start, destination, date, queryTime);

    if(connections.size()<1) {
      ExceptionUtils.throwError("Error parsing the connection.");
    }
    ConnectionVO connection = connections.get(0);
    String timeLink = connection.getLink();
    log.info("Following this connection link: " + timeLink);
    String response = session.getMethod(new URL(timeLink));

    // parse ld & ident
    InputStream inputStream = HTTPUtils.stringToStream(response);
View Full Code Here


      Collection<ConnectionVO> result = new ArrayList<ConnectionVO>();
      Date actTime = timeFormat.parse("00:00");
      final Date endTime = timeFormat.parse("23:59");
      do{
        List<ConnectionVO> connections = getConnectionTime(session, start, destination, date, actTime);
        ConnectionVO lastConnection = connections.get(connections.size()-1);
        result.addAll(connections);
        // increment one minute the actual time
        actTime = DateUtils.addMinutes(lastConnection.getStartTime(), 1);
      }while(actTime.before(endTime));
      // filter connections that are not from today
      Iterable<ConnectionVO> filteredResult = Iterables.filter(result, new Predicate<ConnectionVO>() {
        @Override
        public boolean apply(ConnectionVO connection) {
View Full Code Here

      if(startTimeDate.before(queryTime)) {
        // start time can not be before query time, must add one day
        // TODO: does only work for less than 24 hour trips!, but right now they are not in scope
        startTimeDate = DateUtils.addDay(startTimeDate, 1);
      }
      ConnectionVO connection = new ConnectionVO(start, destination,
          startTimeDate, destinationTimeDate, date, price, link);
      result.add(connection);
    }
    return result;
  }
View Full Code Here

TOP

Related Classes of de.marcusschiesser.dbpendler.common.vo.ConnectionVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.