|
Gridarta Editor
|
The face is the appearance of an object. More...
Classes | |
| class | AbstractFaceObjects |
| Abstract base class for FaceObjects implementations. More... | |
| class | AbstractFaceProvider |
| Abstract Base class for FaceProviders which implements a memory sensitive cache. More... | |
| class | ArchFaceProvider |
| Implementation of FaceProvider which reads images from the arch directory. More... | |
| class | CollectedFaceProvider |
| Implementation of FaceProvider which reads images from the collected PNG archive. More... | |
| class | ColourFilter |
| Class to filter images by simply applying a boolean OR operation. More... | |
| class | DefaultFaceObject |
| A FaceObject stores information and meta information about a face and provides methods for accessing these. More... | |
| class | DefaultFaceObjects |
| Abstract base implementation of FaceObjects. More... | |
| class | DoubleImageFilter |
| An ImageFilter that produces double faces: the source image is drawn twice with a vertical shift. More... | |
| class | DuplicateFaceException |
| Exception that's thrown in case a face name was not unique. More... | |
| class | EmptyFaceProvider |
| A FaceProvider that does not return any faces. More... | |
| interface | FaceObject |
| Common interface for FaceObject. More... | |
| class | FaceObjectProviders |
| Provider for faces of GameObjects and Archetypes. More... | |
| interface | FaceObjectProvidersListener |
| Interface for listeners interested in FaceObjectProviders related events. More... | |
| interface | FaceObjects |
| FaceObjects is a container for FaceObjects. More... | |
| interface | FaceProvider |
| This interface represents a lazy loader that provides images on demand. More... | |
| class | FilterFaceProvider |
| A FilterFaceProvider provides modified versions of icons provided by another FaceProvider by applying a Filter. More... | |
| class | IllegalFaceException |
| Exception thrown to indicate that a face object is not acceptable. More... | |
| class | StretchedImageFilter |
| An ImageFilter that produces stretched faces. More... | |
| class | TestFaceObjects |
| A FaceObjects for regression tests. More... | |
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