Gridarta Editor
|
Classes | |
class | AbstractFaceObjects |
class | AbstractFaceProvider |
class | ArchFaceProvider |
class | CollectedFaceProvider |
class | ColourFilter |
class | DefaultFaceObject |
class | DefaultFaceObjects |
class | DoubleImageFilter |
class | DuplicateFaceException |
class | EmptyFaceProvider |
interface | FaceObject |
class | FaceObjectProviders |
interface | FaceObjectProvidersListener |
interface | FaceObjects |
interface | FaceProvider |
class | FilterFaceProvider |
class | IllegalFaceException |
class | StretchedImageFilter |
class | TestFaceObjects |
The face is the appearance of an object.
This package contains classes for managing icons in memory sensitive caches. Currently, the keys to lookup the icons are Strings (usually the facename of an archetype), and lookup is done in HashMaps.
HashMaps are fast, but, of course, never as fast as an indexed array. Though, HashMaps are easier to maintain. In case someone complains about the usage of HashMaps instead of arrays in this package, I have documented my performance considerations.
The design to generate artificial indices for faces has some flaws. Keeping several arrays in parallel to hold the same information can cause serious, eventually difficult to find bugs. Such a design also prevents the implementation of dynamic archetype handling, where arches and faces should be loadable, editable and un-loadable during editor runtime. The allocation of several large arrays also is a serious indicator for design flaws when using artificial indices, also these arrays need to be anxiously oversized to not get into ArrayIndexOutOfBounds trouble. The natural index of a face is its name, the object oriented index of a face is its own reference. Mapping face names to face references therefore is a good and clear design and very resistant against bugs or overflows.
Also, an archetype first naturally comes with a face name. To get an index for a face name, it is required to first do a linear search. Linear search is always wrong and averages to O(n * c) which is worse than HashMap performance. If the indices are sorted, a binary search with a performance of O(2*c + log2(n)*c*2), which is exactly what a HashMap does. That means, the term that best describes the usage of artificial face indices for increasing face lookup performance is "Augenauswischerei".
Conclusions