1 /******************************************************************************** 2 * InternetCafe is a software solution that helps the management of Cybercafes 3 * according with the ITALIAN DECREE LAW ON ANTI-TERROR MEASURES, 27 JULY 2005. 4 * Copyright (C) 2006 Guido Angelo Ingenito 5 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License 8 * as published by the Free Software Foundation; either version 2 9 * of the License, or (at your option) any later version. 10 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 *******************************************************************************/ 20 21 package base.user.jcard; 22 23 import java.io.Reader; 24 import java.io.Writer; 25 26 import base.user.User; 27 28 /*** 29 * This interface defines some IO methods to export and 30 * import an internet-cafe User instance to/in a JCard (vCard format). 31 * @author skunk 32 * 33 */ 34 public interface IVCard { 35 36 /*** 37 * This method should be imlemented in order 38 * to import and create a new vCard instance from a 39 * vCard file. 40 * @param reader The reader associated to the file to be loaded as a vCard. 41 */ 42 public void read(Reader reader) throws JCardException; 43 44 /*** 45 * This method should be imlemented in order 46 * to export a vCard instace to a file. 47 * @param writer The writer associated to the file where the vCard must be saved. 48 * @throws JCardException 49 */ 50 public void write(Writer writer) throws JCardException; 51 52 53 /*** 54 * This method has to be implemented in order to create a new 55 * internet-cafe User instance given a valid and alredy instanced JCard. 56 * @param jcard The JCard from wich the user must be instantiated. 57 * @return A new instance of User with parameters taken from the jcard instance. 58 */ 59 public User newUser(JCard jcard); 60 61 /*** 62 * This method has to be implemented in order to create a new 63 * JCard instance given a valid and alredy instanced internet-cafe user. 64 * @param user The internet-cafe User instance whose parameters must be exported as a JCard. 65 * @return A new instance of JCard whose parameters and properties are contained in the internet-cafe User instance passes as formal parameter. 66 */ 67 public JCard newJCard(User user); 68 69 }