I don't understand the difference between setAttribute( ) and addAttribute( ) in GraphStream1.3.
In GraphStream's Element API 1.3 it's explained that setAttribute is
Like addAttribute() but for consistency.
what does it means?
I don't understand the difference between setAttribute( ) and addAttribute( ) in GraphStream1.3.
In GraphStream's Element API 1.3 it's explained that setAttribute is
Like addAttribute() but for consistency.
what does it means?
Copyright © 2021 Jogjafile Inc.
It is most likely that they mean
api consistencywith this wording; overall consistency between their own API or what developers might expect to find in general in the API of a Java library.For example
propertieson Java Beans (pojo's) are usually implemented asgetterandsettermethods by convention (rather than language features, as can be found in C#).So perhaps the
graphstreamdevs wanted to have bothgetAttributeandsetAttributein a similar fashion.This can be confirmed by checking one of the
Known Implementing Classesas listed in the javadoc; for example org.graphstream.graph.implementations.AbstractElement, where thesetAttributemethod is just callingaddAttributedirectly:Taken from the decompiled jar or the sources jar of the following artifact.