Java Question Getters and Setters shown in IDE

moster67

Expert
Licensed User
Longtime User
I would really prefer that getters and setters are shown by the IDE as two separate methods instead of one unified. For instance with below methods

B4X:
/**
     * Sets video and audio playback speed
     * Speed e.g. 1.0 or 2.5, defaults to 1.0, range in [0.25-4.0]
     */
    public void setPlaybackSpeed (float speed) {
        if (speed < 0.25f || speed > 4f) {
            return;
        } else {
            getObject().setPlaybackSpeed(speed);
        }
    }

    /**
     * Gets video and audio playback speed
     * Speed e.g. 1.0 or 2.5, defaults to 1.0, range in [0.25-4.0]
     */
    public float getPlaybackSpeed(){
        return getObject().getPlaybackSpeed();
    }

I'd prefer to see in the IDE

-setPlaybackSpeed()
-getPlaybackSpeed()

instead of

-PlaybackSpeed()

Maybe this is the "VBasic way" of showing methods but is there a way to force that the methods are splitted (except of modifying the xml-file)? If not, can you implement it as an option?

Thanks
 

moster67

Expert
Licensed User
Longtime User
Thanks! Was not aware of that. It works fine.
 

moster67

Expert
Licensed User
Longtime User
You're both right of course from a B4A user's perspective. I didn't think of that because lately I've been using B4A less frequently for writing apps since I have been giving my son a helping hand with his development in Java and Swift. I have even started getting fond of case sensitivity.
For B4A, I am currently mainly just wrapping interesting stuff. It is just that I feel using setters/getters is less ambiguous.

Erel, while being on the topic to keep things nice and tidy for the end-users, can you look into this request of mine:
https://www.b4x.com/android/forum/t...ames-of-methods-in-the-ide.69772/#post-442908
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…