From: <rv...@us...> - 2010-03-15 01:00:51
|
Revision: 568 http://treebase.svn.sourceforge.net/treebase/?rev=568&view=rev Author: rvos Date: 2010-03-15 01:00:44 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-12 23:44:43 UTC (rev 567) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-15 01:00:44 UTC (rev 568) @@ -31,7 +31,9 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseUtil; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.taxon.TaxonLabel; /** @@ -931,4 +933,20 @@ @Override @Transient public boolean isCharacterMatrix() { return true; } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:type.matrix",getDataType().getDescription())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:ntax.matrix",getnTax())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:nchar.matrix",getnChar())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.matrix",getId())); + return annotations; + } + + @Transient + public String getLabel() { + return getTitle(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-06-08 14:01:47
|
Revision: 902 http://treebase.svn.sourceforge.net/treebase/?rev=902&view=rev Author: rvos Date: 2011-06-08 14:01:38 +0000 (Wed, 08 Jun 2011) Log Message: ----------- The Set that contains all CharSets associated with the matrix should be parameterized to Set<CharSet> to avoid warnings about this. I also commented out a private method that is never used locally (and therefore useless). Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2011-06-08 13:59:18 UTC (rev 901) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2011-06-08 14:01:38 UTC (rev 902) @@ -48,6 +48,11 @@ @DiscriminatorValue("C") public abstract class CharacterMatrix extends Matrix { + /** + * + */ + private static final long serialVersionUID = 1L; + protected List<MatrixRow> mRows = new ArrayList<MatrixRow>(); private AncStateSet mDefaultAncSet; @@ -58,7 +63,7 @@ private List<MatrixColumn> mColumns = new ArrayList<MatrixColumn>(); private Set<AncStateSet> mAncStateSets = new HashSet<AncStateSet>(); - private Set mCharSets = new HashSet(); + private Set<CharSet> mCharSets = new HashSet<CharSet>(); private Collection<CharWeightSet> mWeightSets = new ArrayList<CharWeightSet>(); private Collection<CodonPositionSet> mCodonPosSets = new ArrayList<CodonPositionSet>(); private Collection<GeneticCodeSet> mCodeSets = new ArrayList<GeneticCodeSet>(); @@ -158,9 +163,10 @@ * @param pExSet * @return */ - private boolean isDefaultExcludedSet(ExcludedCharSet pExSet) { - return (pExSet == getDefaultExcludedSet()); - } +// this is never used locally, so I commented it out - maybe it shouldn't be here? -- rav, 8 June '11 +// private boolean isDefaultExcludedSet(ExcludedCharSet pExSet) { +// return (pExSet == getDefaultExcludedSet()); +// } /** * Return the DefaultTypeSet field. @@ -258,14 +264,14 @@ @OneToMany(mappedBy = "matrix", cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REMOVE}, targetEntity = CharSet.class) @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "matrixCache") - public Set getCharSets() { + public Set<CharSet> getCharSets() { return mCharSets; } /** * Set the CharSets field. */ - public void setCharSets(Set pNewCharSets) { + public void setCharSets(Set<CharSet> pNewCharSets) { mCharSets = pNewCharSets; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |