Forums

F.A.Q. F.A.Q.    Register Register    Login Login    Home Home
Search Search
SBML Discussions » jsbml-development » Units inheritance in Level 3
Show: Today's Posts  :: Message Navigator
| Subscribe to topic 
Return to the default flat view Create a new topic Submit Reply
AuthorTopic
Andreas Dräger


Posts: 273
Registered:
June 2006
Re: Units inheritance in Level 3 20 Mar '12 04:56 Go to previous messageGo to previous message

Hi Sarah,

>> Yes. That's what I would like to do. It is actually very easy using a
>> filter for listOf<UnitDefinition> that accepts the first identical
>> UnitDefinition (using a call like
>> UnitDefinition.areIdentical(myJustDerivedUnit, unitNumberXXfromTheList),
>> with XX being the counter in the for-each loop).
>
> My main thought about this is to consider what the user might want to
> do with the unitDefinition returned from getDerivedUnits(). They may
> wish to change or use it somewhere else and may not actually want it
> to be part of the original model.
>

In deed, there are two different ways to go.

1. The user always receives a newly created UnitDefinition and can
manipulate it in any way, but if it is necessary to ensure that the unit
is already part of the model, the user must add it by him/herself.
Similarly, the user would have to filter the Model's list of units for
an identical unit by him/herself.

2. The user gets a unit that may already belong to the model. A check
can be done by asking myModel.getListOfUnits().contains(myUnit). If it
is already in the model and the user wants to do some change, a call to
the clone() method might be necessary.

It now depends on what the users would prefer to have. Maybe you're
right, and way #2 is less streightforward because the user does not know
if the unit belongs to the model or not. In idea #1 the returned unit
never belongs to the model.

Are there any other opinions on that topic?

Cheers
Andreas

--
Dr. Andreas Dräger
University of Tuebingen
Center for Bioinformatics Tuebingen (ZBIT)
Sand 1
72076 Tübingen
Germany

Phone: +49-7071-29-78982
Fax: +49-7071-29-5091

____________________________________________________________
To manage your jsbml-development list subscription, visit
https://utils.its.caltech.edu/mailman/listinfo/jsbml-development

For a web interface to the jsbml-development mailing list, visit
http://sbml.org/Forums/

For questions or feedback about the jsbml-development list,
contact sbml-team@caltech.edu

      

SubjectPosterDate
Read Message   Units inheritance in Level 3 Andreas Dräger15 Mar '12 09:19
Read Message   Re: Units inheritance in Level 3 Sarah Keating20 Mar '12 02:50
Read Message   Re: Units inheritance in Level 3 Andreas Dräger20 Mar '12 03:00
Read Message   Re: Units inheritance in Level 3 Sarah Keating20 Mar '12 02:50
Read Message   Re: Units inheritance in Level 3 Andreas Dräger20 Mar '12 02:55
Read Message   Re: Units inheritance in Level 3 Sarah Keating20 Mar '12 03:16
Read Message   Re: Units inheritance in Level 3  Andreas Dräger20 Mar '12 04:56
Read Message   Re: Units inheritance in Level 3 Andreas Dräger21 Mar '12 00:13
Previous Topic:Problem reading history element?
Next Topic:Unsetting substance units in Model
Go to forum:
-=] Back to Top [=-

Powered by FUDforum. (Copyright Advanced Internet Designs Inc.)

Please use our issue tracking system for any questions or suggestions about this website.