1 /* 2 * This file is part of JGAP. 3 * 4 * JGAP offers a dual license model containing the LGPL as well as the MPL. 5 * 6 * For licencing information please see the file license.txt included with JGAP 7 * or have a look at the top of class org.jgap.Chromosome which representatively 8 * includes the JGAP license policy applicable for any file delivered with JGAP. 9 */ 10 package org.jgap; 11 12 /** 13 * Interface for objects that can represent themselves as a string and parse 14 * this string later on to generate a new instance of themselves. 15 * 16 * @author Klaus Meffert 17 * @since 3.2 18 */ 19 public interface IPersistentRepresentation { 20 /** String containing the CVS revision. Read out via reflection!*/ 21 final static String CVS_REVISION = "$Revision: 1.1 $"; 22 23 /** 24 * Returns a persistent representation of an entity (such as a chromosome or a 25 * gene). 26 * 27 * @return string representation of current state 28 * @throws UnsupportedOperationException 29 * 30 * @author Klaus Meffert 31 * @since 3.2 32 */ 33 public String getPersistentRepresentation(); 34 35 /** 36 * Counterpart of getPersistentRepresentation. 37 * 38 * @param a_representation the string representation retrieved from a prior 39 * call to the getPersistentRepresentation() method 40 * 41 * @throws UnsupportedRepresentationException 42 * 43 * @author Klaus Meffert 44 * @since 3.2 45 */ 46 public void setValueFromPersistentRepresentation(String a_representation) 47 throws UnsupportedRepresentationException; 48 } 49