Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

boolean net::sf::linuxorg::pcal::engine::Engine::importFromFile ( final File  file ) throws IOException, ParseException [inline]

Import list of menstruation dates from a plain text file (Lorg 1.x file version)

Parameters:
fnamename of the file
Returns:
true on success
Exceptions:
IOException
ParseException

Definition at line 990 of file Engine.java.

References dateTypes, modified, and recalculate().

Referenced by net::sf::linuxorg::pcal::engine::EngineTest::testImportExport().

      {
            BufferedReader inputStream = null;

            try {
                  inputStream = 
                        new BufferedReader(new FileReader(file));
                  String l;
                  while ((l = inputStream.readLine()) != null) {
                        Date d = DATE_FORMAT.parse(l);
                        startDates.add(d);
                        dateTypes.put(d, PCAL_TYPE_MENS);
                  }
            }
            finally {
                  if (inputStream != null) {
                        inputStream.close();
                  }
            }

            modified = true;
            recalculate();
            return true;
      }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index