I am trying to understand a naming convention that accurately conveys what happens in the class that I am developing. On a secondary note, I'm trying to decide between two almost equivalent user APIs.
Here's the situation:
I am creating a scientific application where one of the central data structures has three phases: 1) accumulation, 2) analysis and 3) query execution.
In my case, this is a spatial modeling framework that internally uses KDTree to split a collection of points in three-dimensional space. Each point describes one or more attributes of the environment with a certain degree of confidence in the measurement itself.
After adding (potentially a large number of) measurements to the collection, the owner of the object will request it to obtain an interpolated measurement at a new data point somewhere in the corresponding field.
The API will look something like this (the code is in Java, but this is not very important, the code is divided into three sections for clarity):
ContinuousScalarField field = new ContinuousScalarField();
Collection<Measurement> measurements = getMeasurementsFromSomewhere();
foreach (Measurement m : measurements) {
field.add(m);
}
Point3d p = new Point3d(3, 4, 5);
Measurement result = field.interpolateAt(p);
In my specific problem domain during SECTION 2, you can perform a small number of additional operations (splitting points into balanced KDTree).
And there will be a little work (doing some linear interpolations) that may occur during SECTION 3.
( Fast Gauss , ), 2 3.
( interpolateAt), , "field.add()", .
, object.flip(), "append mode" " ". , , , . API . , ; .
, , ?
, , , ? , append ?
? , ?
ON EDIT:
, , "ContinuousScalarField".
, , :
, ( , ). , , - 10 .
, , , , .
, , .
, , 100%, .
: HashMap TreeMap . .
, , . HashMap , . TreeMap , - .
, , , , .