|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
Criteria | Try if an object ,meets the criteria return true if it does false if not. |
Class Summary | |
AND | |
Compare | Represents comparison operators on an attribute - attribute here means a public method of the given name. |
COMPASSIter | Need to get the obj out of Star2D and apply the criteria to it. |
CriteriaImp | This implmements the on/off part of the criteria interface sub classes must imlement match(obj) which is called only of the criteria is on. |
CritIter | Iterator throug an Iterator applying a Criterea to eachi object before deciding if to return it. |
Equal | Is obj equal value |
Greater | Is obj > value |
Less | Ist the obj to be tested less than the valu. |
Logical | Represent Logical operators with an left and right side |
Not | |
OR |
Provides a set of classes for filtering of objects in memory. Complex logical criteria may be built up for any object/interface using the provided classes. These are tied to GUI widgets in the FilterDialog for example to filter the ArchiveObjects on the display. Applying a Criteria to an object returns a boolean indicating wheter the object matches the criteria or not.A For any given method of a given Class or Interface Less, Greater or Equal criteria may be created. Whatever the method returns must implement Comparable so this will work for any object. Note that although float, int double etc. are not objects Java takes care of them as if they were Float Integer and Double (which implement Comparable). Hence methods returning these types work fine.
For example
Less muAlphaCrit = new Less(500,"muAlpha","stsci.arci.ArchiveObject");
would work fine since the method muAlpha of the interface ArchiveObject returns a double. To make use of the Criteria for any given object one simply calls apply as follow:
ArchiveObject someObject;
if (muAlphaCrit.apply(someObject) ) System.out.println("muAlpha is < 500");
The value (e.g. 500 above) in the criteria may be changed at any time by calling setValue.
Typically a single criteria will not suffice so logical AND and OR criteria are provided to build up a tree of criteria these simply have a constructor which take two criteria.
Any criteria may be turned off by calling setOff. When setOff is called a boolean value must be passed as an argument this value is returned for any apply which is called on this criteria there after.
The criteria are put to use in the FilterDialog (stsci.sky) class which filters the archive objects displayed on the screen and in the star list. RangePanel (stsci.sky) provides a generic graphical input attached to a Criteria - when the user inputs values they are plugged in the criteria.
Author: William O'Mullane
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |