[Biojava-l] how to set date created on RichSequence

George Waldon gwaldon at geneinfinity.org
Thu May 31 15:31:38 UTC 2012


Hi Khalil,

This code should set a date:

         RichAnnotation notes = ((RichSequence)seq).getRichAnnotation();
         Date now = new Date();
         SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yyyy");
         Note n = new SimpleNote(
                 Terms.getDateCreatedTerm(),
                 format.format(now).toUpperCase(),
                 notes.getNoteSet().size()+1);
         notes.addNote(n);
         n = new SimpleNote(
                 Terms.getDateUpdatedTerm(),
                 format.format(now).toUpperCase(),
                 notes.getNoteSet().size()+1);
         notes.addNote(n);

If the notes already exist, you may have to find them and adjust the date.

Best,
George


Quoting Khalil El Mazouari <khalil.elmazouari at gmail.com>:

> Hi All,
>
> how to set a date created on RichSequence?
>
> Thanks
>
>
>
>
>
> -----
>
> Confidentiality Notice: This e-mail and any files transmitted with  
> it are private and confidential and are solely for the use of the  
> addressee. It may contain material which is legally privileged. If  
> you are not the addressee or the person responsible for delivering  
> to the addressee, please notify that you have received this e-mail  
> in error and that any use of it is strictly prohibited. It would be  
> helpful if you could notify the author by replying to it.
>
>
>
>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>



--------------------------------
George Waldon





More information about the Biojava-l mailing list