git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in progress...
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
phylogeny
/
data
/
NodeData.java
diff --git
a/forester/java/src/org/forester/phylogeny/data/NodeData.java
b/forester/java/src/org/forester/phylogeny/data/NodeData.java
index
add11c9
..
3a4c670
100644
(file)
--- a/
forester/java/src/org/forester/phylogeny/data/NodeData.java
+++ b/
forester/java/src/org/forester/phylogeny/data/NodeData.java
@@
-38,20
+38,6
@@
import org.forester.util.ForesterUtil;
public class NodeData implements PhylogenyData {
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;
- }
private String _node_name;
private Event _event;
private List<Sequence> _sequences;
private String _node_name;
private Event _event;
private List<Sequence> _sequences;
@@
-59,7
+45,7
@@
public class NodeData implements PhylogenyData {
private List<Distribution> _distributions;
private Date _date;
private BinaryCharacters _binary_characters;
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;
private List<Reference> _references;
private List<Double> _vector;
private NodeVisualData _node_visual_data;
@@
-169,7
+155,7
@@
public class NodeData implements PhylogenyData {
new_data.setDate( ( Date ) getDate().copy() );
}
if ( isHasProperties() ) {
new_data.setDate( ( Date ) getDate().copy() );
}
if ( isHasProperties() ) {
- new_data.setProperties( ( PropertiesMap ) getProperties().copy() );
+ new_data.setProperties( ( PropertiesList ) getProperties().copy() );
}
return new_data;
}
}
return new_data;
}
@@
-184,7
+170,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always returns the first Distribution.
/**
* Convenience method -- always returns the first Distribution.
- *
+ *
* @return Distribution
*/
public Distribution getDistribution() {
* @return Distribution
*/
public Distribution getDistribution() {
@@
-192,6
+178,9
@@
public class NodeData implements PhylogenyData {
}
public Distribution getDistribution( final int index ) {
}
public Distribution getDistribution( final int index ) {
+ if ( _distributions == null ) {
+ return null;
+ }
return _distributions.get( index );
}
return _distributions.get( index );
}
@@
-203,21
+192,24
@@
public class NodeData implements PhylogenyData {
return _event;
}
return _event;
}
- public PropertiesMap getProperties() {
+ public PropertiesList getProperties() {
return _properties;
}
/**
* Convenience method -- always returns the first Reference.
return _properties;
}
/**
* Convenience method -- always returns the first Reference.
- *
+ *
* @return Reference
* @return Reference
- *
+ *
*/
public Reference getReference() {
return getReference( 0 );
}
public Reference getReference( final int index ) {
*/
public Reference getReference() {
return getReference( 0 );
}
public Reference getReference( final int index ) {
+ if ( _references == null ) {
+ return null;
+ }
return _references.get( index );
}
return _references.get( index );
}
@@
-227,7
+219,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always returns the first Sequence.
/**
* Convenience method -- always returns the first Sequence.
- *
+ *
* @return Sequence
*/
public Sequence getSequence() {
* @return Sequence
*/
public Sequence getSequence() {
@@
-235,6
+227,9
@@
public class NodeData implements PhylogenyData {
}
public Sequence getSequence( final int index ) {
}
public Sequence getSequence( final int index ) {
+ if ( _sequences == null ) {
+ return null;
+ }
return _sequences.get( index );
}
return _sequences.get( index );
}
@@
-248,15
+243,18
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always returns the first Taxonomy.
/**
* Convenience method -- always returns the first Taxonomy.
- *
+ *
* @return Taxonomy
* @return Taxonomy
- *
+ *
*/
public Taxonomy getTaxonomy() {
return getTaxonomy( 0 );
}
public Taxonomy getTaxonomy( final int index ) {
*/
public Taxonomy getTaxonomy() {
return getTaxonomy( 0 );
}
public Taxonomy getTaxonomy( final int index ) {
+ if ( _taxonomies == null ) {
+ return null;
+ }
return _taxonomies.get( index );
}
return _taxonomies.get( index );
}
@@
-272,7
+270,7
@@
public class NodeData implements PhylogenyData {
public boolean isEmpty() {
return ( ForesterUtil.isEmpty( _node_name ) && !isHasSequence() && !isHasTaxonomy() && !isHasBinaryCharacters()
&& !isHasDate() && !isHasDistribution() && !isHasEvent() && !isHasProperties() && !isHasReference() && ( ( _vector == null ) || _vector
public boolean isEmpty() {
return ( ForesterUtil.isEmpty( _node_name ) && !isHasSequence() && !isHasTaxonomy() && !isHasBinaryCharacters()
&& !isHasDate() && !isHasDistribution() && !isHasEvent() && !isHasProperties() && !isHasReference() && ( ( _vector == null ) || _vector
- .isEmpty() ) );
+ .isEmpty() ) );
}
public boolean isHasDate() {
}
public boolean isHasDate() {
@@
-286,7
+284,7
@@
public class NodeData implements PhylogenyData {
return ( ( ( getDistributions() != null ) && ( getDistributions().size() > 0 ) ) && ( ( !ForesterUtil
.isEmpty( getDistribution().getDesc() ) )
|| ( ( getDistribution().getPoints() != null ) && ( getDistribution().getPoints().size() > 0 ) ) || ( ( getDistribution()
return ( ( ( getDistributions() != null ) && ( getDistributions().size() > 0 ) ) && ( ( !ForesterUtil
.isEmpty( getDistribution().getDesc() ) )
|| ( ( getDistribution().getPoints() != null ) && ( getDistribution().getPoints().size() > 0 ) ) || ( ( getDistribution()
- .getPolygons() != null ) && ( getDistribution().getPolygons().size() > 0 ) ) ) );
+ .getPolygons() != null ) && ( getDistribution().getPolygons().size() > 0 ) ) ) );
}
public boolean isHasEvent() {
}
public boolean isHasEvent() {
@@
-300,7
+298,7
@@
public class NodeData implements PhylogenyData {
public boolean isHasReference() {
return ( ( getReferences() != null ) && ( getReferences().size() > 0 ) )
&& ( !ForesterUtil.isEmpty( getReference().getDoi() ) || !ForesterUtil.isEmpty( getReference()
public boolean isHasReference() {
return ( ( getReferences() != null ) && ( getReferences().size() > 0 ) )
&& ( !ForesterUtil.isEmpty( getReference().getDoi() ) || !ForesterUtil.isEmpty( getReference()
- .getDescription() ) );
+ .getDescription() ) );
}
public boolean isHasSequence() {
}
public boolean isHasSequence() {
@@
-321,7
+319,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always sets the first Distribution.
/**
* Convenience method -- always sets the first Distribution.
- *
+ *
*/
public void setDistribution( final Distribution distribution ) {
if ( _distributions == null ) {
*/
public void setDistribution( final Distribution distribution ) {
if ( _distributions == null ) {
@@
-350,7
+348,7
@@
public class NodeData implements PhylogenyData {
_event = event;
}
_event = event;
}
- public void setProperties( final PropertiesMap custom_data ) {
+ public void setProperties( final PropertiesList custom_data ) {
_properties = custom_data;
}
_properties = custom_data;
}
@@
-363,7
+361,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always sets the first Reference.
/**
* Convenience method -- always sets the first Reference.
- *
+ *
*/
public void setReference( final Reference reference ) {
if ( _references == null ) {
*/
public void setReference( final Reference reference ) {
if ( _references == null ) {
@@
-390,7
+388,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always sets the first Sequence.
/**
* Convenience method -- always sets the first Sequence.
- *
+ *
*/
public void setSequence( final Sequence sequence ) {
if ( _sequences == null ) {
*/
public void setSequence( final Sequence sequence ) {
if ( _sequences == null ) {
@@
-421,7
+419,7
@@
public class NodeData implements PhylogenyData {
/**
* Convenience method -- always sets the first Taxonomy.
/**
* Convenience method -- always sets the first Taxonomy.
- *
+ *
*/
public void setTaxonomy( final Taxonomy taxonomy ) {
if ( _taxonomies == null ) {
*/
public void setTaxonomy( final Taxonomy taxonomy ) {
if ( _taxonomies == null ) {