Package java.io

Examples of java.io.BufferedReader.readLine()


        BufferedReader bReader = new BufferedReader(reader);

        updateStatus(10);
        try {
            //1. The first line defines the number of some data:
            String numberOf[] = bReader.readLine().split(" ");
            int noOfEvents = Integer.parseInt(numberOf[0]);
            int noOfLocations = Integer.parseInt(numberOf[1]);
            int noOfFeatures = Integer.parseInt(numberOf[2]);
            int noOfPersons = Integer.parseInt(numberOf[3]);
View Full Code Here


            int noOfFeatures = Integer.parseInt(numberOf[2]);
            int noOfPersons = Integer.parseInt(numberOf[3]);

            // 2. Every line contains the capacity of one room
            for (int i = 0; i < noOfLocations; i++) {
                Location location = createLocation(Integer.parseInt(bReader.readLine()));
                location.putConstraint(newRasterConstraint());
//                EventSetConstraint esc = (EventSetConstraint) appCtx.getBean(ES_CONSTRAINT);
//                location.putConstraint(esc);
            }
View Full Code Here

                currentPerson = createPerson();
                currentPerson.putConstraint(newRasterConstraint());

                for (Event event : getEventDao().getAll()) {
                    if ((Integer.parseInt(bReader.readLine()) > 0)) {
                        currentPerson.addEvent(event, true);
                    }
                }
            }
View Full Code Here

            updateStatus(40);
            // 4. Now 'noOfFeatures'-lines describes the features of one room (room/feature)
            for (Location currentLocation : getLocationDao().getAll()) {
                for (Feature feature : getFeatureDao().getAll()) {
                    if ((Integer.parseInt(bReader.readLine()) > 0)) {
                        currentLocation.addFeature(feature);
                    }
                }
            }
View Full Code Here

            updateStatus(50);
            // 5. 'noOfFeatures'-lines describes the features-requirements of one subject (event/feature)
            for (Event currentSubject : getEventDao().getAll()) {
                for (Feature feature : getFeatureDao().getAll()) {
                    if ((Integer.parseInt(bReader.readLine()) != 0)) {
                        currentSubject.addFeature(feature);
                    }
                }
            }
View Full Code Here

                RasterConstraint rc = newRasterConstraint();
                currentEvent.putConstraint(rc);
                WeekRaster raster = rc.getRaster();
                for (int ts = 0; ts < noOfTimeSlots; ts++) {
                    //String s = reader.readLine(); sb.append(s);
                    if (Integer.parseInt(bReader.readLine()) != 0) {
                        raster.set(ts, RasterEnum.ALLOWED);
                    }
                }
            }
View Full Code Here

            updateStatus(70);
            // 7. 'noOfSubjects'-lines describes the 'follow/before'-matrix of one subject (event/event)
            for (Event firstEvent : getEventDao().getAll()) {
                for (Event secEvent : getEventDao().getAll()) {
                    int i = Integer.parseInt(bReader.readLine());
                    if (i == 1) {
                        // add the constraint to the both event
                        EventOrderConstraint firstConstraint = firstEvent.getConstraint(EventOrderConstraint.class);
                        if (firstConstraint == null) {
                            firstConstraint = new EventOrderConstraint(firstEvent);
View Full Code Here

            }

            updateStatus(80);
//            getMagicNumbersOfDataPool();

            String line = bReader.readLine();
            if (line != null) {
                logger.fatal("End of file should be reached. But content of line was:" + line);
                int counter = 0;
                while ((line = bReader.readLine()) != null) {
                    counter++;
View Full Code Here

            String line = bReader.readLine();
            if (line != null) {
                logger.fatal("End of file should be reached. But content of line was:" + line);
                int counter = 0;
                while ((line = bReader.readLine()) != null) {
                    counter++;
                }
                logger.fatal("Further " + counter + " unprocessed lines detected");
            }
        } finally {
View Full Code Here

      conn.setConnectTimeout(30000); // timeout after 30 seconds
     
      BufferedReader bi =
        new BufferedReader(new InputStreamReader(conn.getInputStream()));
     
      String n = bi.readLine();
      try {
        numPackages = Integer.parseInt(n);
      } catch (NumberFormatException ne) {
        System.err.println("[WekaPackageManager] problem parsing number " +
            "of packages from server.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.