I have a class that is backed by a
double value, and I am wondering about accessor method names that preserve abstraction. Based on my experience in Java, there seems to be at least two precedents:
toDouble(), which mirrors
doubleValue(), similar to
I need access to this value to perform some computations. Would it be most appropriate to return a double value as I've mentioned, or provide public
add(), etc. methods?
Is there any common practice or precedent for a class used in this way?