-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: add getAtomQueryFeaturesObject #205
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@targos I could not find a good way to return a JavaScriptObject
from a Java class. I wanted to do this to expose the queryFeatures of the atoms. Could you help me ?
src/com/actelion/research/gwt/minimal/MoleculeQueryFeatures.java
Outdated
Show resolved
Hide resolved
It depends what you want to return. If you want a plain JS object, you should not create a new Java class. |
PlainJSObject moleculeQueryFeatures = PlainJSObject.create(); | ||
|
||
moleculeQueryFeatures.setPropertyBoolean("aromatic", | ||
(oclMolecule.getAtomQueryFeatures(atom) & Molecule.cAtomQFAromatic) > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be significantly faster to call getAtomQueryFeatures(atom)
only once and put the value in a local variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed good idea! The method getAtomQueryFeatures
is super small so probably small impact but the code will look any much better and we will have the possibility to optimise the part that is 'int' and not long. Thanks.
public long getAtomQueryFeatures(int atom) {
return mAtomQueryFeatures[atom];
}
No description provided.