01: /*
02: * This file is part of JGAP.
03: *
04: * JGAP offers a dual license model containing the LGPL as well as the MPL.
05: *
06: * For licensing information please see the file license.txt included with JGAP
07: * or have a look at the top of class org.jgap.Chromosome which representatively
08: * includes the JGAP license policy applicable for any file delivered with JGAP.
09: */
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.2 $";
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(
47: String a_representation)
48: throws UnsupportedRepresentationException;
49: }
|