in progress...
[jalview.git] / forester / java / src / org / forester / phylogeny / data / NodeData.java
index 9dd14e7..3a4c670 100644 (file)
@@ -38,24 +38,6 @@ import org.forester.util.ForesterUtil;
 
 public class NodeData implements PhylogenyData {
 
-    public enum NODE_DATA {
-        NODE_NAME,
-        EVENT,
-        SEQUENCE_NAME,
-        GENE_NAME,
-        SEQUENCE_SYMBOL,
-        SEQUENCE_MOL_SEQ,
-        SEQUENCE_MOL_SEQ_FASTA,
-        SEQUENCE_ACC,
-        TAXONOMY_SCIENTIFIC_NAME,
-        TAXONOMY_COMM0N_NAME,
-        TAXONOMY_CODE,
-        UNKNOWN,
-        GO_ANNOTATIONS,
-        GO_ANNOTATIONS_WITH_COUNTS,
-        DOMAINS_ALL,
-        DOMAINS_COLLAPSED_PER_PROTEIN;
-    }
     private String             _node_name;
     private Event              _event;
     private List<Sequence>     _sequences;
@@ -63,7 +45,7 @@ public class NodeData implements PhylogenyData {
     private List<Distribution> _distributions;
     private Date               _date;
     private BinaryCharacters   _binary_characters;
-    private PropertiesMap      _properties;
+    private PropertiesList      _properties;
     private List<Reference>    _references;
     private List<Double>       _vector;
     private NodeVisualData     _node_visual_data;
@@ -173,7 +155,7 @@ public class NodeData implements PhylogenyData {
             new_data.setDate( ( Date ) getDate().copy() );
         }
         if ( isHasProperties() ) {
-            new_data.setProperties( ( PropertiesMap ) getProperties().copy() );
+            new_data.setProperties( ( PropertiesList ) getProperties().copy() );
         }
         return new_data;
     }
@@ -196,6 +178,9 @@ public class NodeData implements PhylogenyData {
     }
 
     public Distribution getDistribution( final int index ) {
+        if ( _distributions == null ) {
+            return null;
+        }
         return _distributions.get( index );
     }
 
@@ -207,7 +192,7 @@ public class NodeData implements PhylogenyData {
         return _event;
     }
 
-    public PropertiesMap getProperties() {
+    public PropertiesList getProperties() {
         return _properties;
     }
 
@@ -222,6 +207,9 @@ public class NodeData implements PhylogenyData {
     }
 
     public Reference getReference( final int index ) {
+        if ( _references == null ) {
+            return null;
+        }
         return _references.get( index );
     }
 
@@ -239,6 +227,9 @@ public class NodeData implements PhylogenyData {
     }
 
     public Sequence getSequence( final int index ) {
+        if ( _sequences == null ) {
+            return null;
+        }
         return _sequences.get( index );
     }
 
@@ -261,6 +252,9 @@ public class NodeData implements PhylogenyData {
     }
 
     public Taxonomy getTaxonomy( final int index ) {
+        if ( _taxonomies == null ) {
+            return null;
+        }
         return _taxonomies.get( index );
     }
 
@@ -354,7 +348,7 @@ public class NodeData implements PhylogenyData {
         _event = event;
     }
 
-    public void setProperties( final PropertiesMap custom_data ) {
+    public void setProperties( final PropertiesList custom_data ) {
         _properties = custom_data;
     }