Skip to content

Commit 2d99f57

Browse files
committed
Make BioJava Structure objects serializable
1 parent 8934e94 commit 2d99f57

File tree

10 files changed

+16
-18
lines changed

10 files changed

+16
-18
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*/
2424
package org.biojava.nbio.structure;
2525

26-
import java.io.Serializable;
27-
2826
/**
2927
* AminoAcid inherits most from Hetatom. Adds a few AminoAcid
3028
* specific methods.
@@ -34,7 +32,7 @@
3432
* @version %I% %G%
3533
*
3634
*/
37-
public class AminoAcidImpl extends HetatomImpl implements AminoAcid, Serializable {
35+
public class AminoAcidImpl extends HetatomImpl implements AminoAcid {
3836

3937
private static final long serialVersionUID = -6018854413829044230L;
4038

biojava-structure/src/main/java/org/biojava/nbio/structure/Atom.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
package org.biojava.nbio.structure;
2525

26+
import java.io.Serializable;
2627
import java.util.List;
2728

2829
import javax.vecmath.Point3d;
@@ -41,7 +42,7 @@
4142
* @since 1.4
4243
*
4344
*/
44-
public interface Atom extends Cloneable, PDBRecord {
45+
public interface Atom extends Cloneable, PDBRecord, Serializable {
4546

4647
/**
4748
* Set atom name, e.g. "CA".

biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import org.biojava.nbio.structure.io.FileConvert;
2727

28-
import java.io.Serializable;
2928
import java.util.ArrayList;
3029
import java.util.List;
3130

@@ -39,7 +38,7 @@
3938
* @since 1.4
4039
* @version %I% %G%
4140
*/
42-
public class AtomImpl implements Atom, Serializable, PDBRecord {
41+
public class AtomImpl implements Atom, PDBRecord {
4342

4443
private static final long serialVersionUID = -2258364127420562883L;
4544

biojava-structure/src/main/java/org/biojava/nbio/structure/Bond.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
*/
2121
package org.biojava.nbio.structure;
2222

23+
import java.io.Serializable;
24+
2325
/**
2426
* A simple bond -- it stores information about two atoms as well as information
2527
* about its bond order.
2628
*
2729
* @author Jules Jacobsen <jacobsen@ebi.ac.uk>
2830
* @author Ulysse Carion
2931
*/
30-
public interface Bond {
32+
public interface Bond extends Serializable {
3133

3234
/**
3335
* Gets atom 'A' of this bond. There is no meaning to which atom is 'A' and

biojava-structure/src/main/java/org/biojava/nbio/structure/BondImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121
package org.biojava.nbio.structure;
2222

23-
import java.io.Serializable;
2423
import java.util.ArrayList;
2524
import java.util.List;
2625

@@ -31,7 +30,7 @@
3130
* @author Jules Jacobsen <jacobsen@ebi.ac.uk>
3231
* @author Ulysse Carion
3332
*/
34-
public class BondImpl implements Serializable, Bond {
33+
public class BondImpl implements Bond {
3534

3635
private static final long serialVersionUID = 8836120946858134380L;
3736
private Atom atomA;

biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.biojava.nbio.structure.io.FileParsingParameters;
2828
import org.biojava.nbio.structure.io.mmcif.model.ChemComp;
2929

30+
import java.io.Serializable;
3031
import java.util.List;
3132

3233
/**
@@ -48,7 +49,7 @@
4849
* @version %I% %G%
4950
* @since 1.4
5051
*/
51-
public interface Chain {
52+
public interface Chain extends Serializable {
5253

5354
/** returns an identical copy of this Chain.
5455
* @return an identical copy of this Chain

biojava-structure/src/main/java/org/biojava/nbio/structure/Group.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import org.biojava.nbio.structure.io.mmcif.model.ChemComp;
2727

28+
import java.io.Serializable;
2829
import java.util.Iterator;
2930
import java.util.List;
3031
import java.util.Map;
@@ -51,7 +52,7 @@
5152
* @version %I% %G%
5253
*
5354
*/
54-
public interface Group {
55+
public interface Group extends Serializable {
5556

5657
/** Group property key for secondary structure annotation */
5758
public static final String SEC_STRUC = "secstruc";

biojava-structure/src/main/java/org/biojava/nbio/structure/HetatomImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.slf4j.Logger;
3232
import org.slf4j.LoggerFactory;
3333

34-
import java.io.Serializable;
3534
import java.util.*;
3635

3736
/**
@@ -45,7 +44,7 @@
4544
* @version %I% %G%
4645
* @since 1.4
4746
*/
48-
public class HetatomImpl implements Group,Serializable {
47+
public class HetatomImpl implements Group {
4948

5049
private static final Logger logger = LoggerFactory.getLogger(HetatomImpl.class);
5150

biojava-structure/src/main/java/org/biojava/nbio/structure/NucleotideImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
*
2323
*/
2424
package org.biojava.nbio.structure;
25-
import java.io.Serializable;
26-
27-
2825

2926
/**
3027
* A nucleotide group is almost the same as a Hetatm group.
@@ -34,7 +31,7 @@
3431
* @since 1.4
3532
* @version %I% %G%
3633
*/
37-
public class NucleotideImpl extends HetatomImpl implements Group, Serializable, Cloneable {
34+
public class NucleotideImpl extends HetatomImpl implements Group, Cloneable {
3835

3936
private static final long serialVersionUID = -7467726932980288712L;
4037
/** this is a "nucleotide", a special occurance of a Hetatom. */

biojava-structure/src/main/java/org/biojava/nbio/structure/Structure.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.biojava.nbio.structure.io.FileConvert;
2727
import org.biojava.nbio.structure.io.PDBFileReader;
2828

29+
import java.io.Serializable;
2930
import java.util.List;
3031

3132

@@ -165,7 +166,7 @@
165166
* @since 1.4
166167
* @version %I% %G%
167168
*/
168-
public interface Structure extends Cloneable {
169+
public interface Structure extends Cloneable, Serializable {
169170

170171

171172
/**

0 commit comments

Comments
 (0)