package Analyze.Filter ;
import java.awt.*;
import java.util.Locale ;
import java.awt.im.* ;
import java.util.Vector ;
//==============================================================================
/**
* Interface for Analyze filters.
*
*
* FilterInterface F = (FilterInterface) new Filter() ;
*
* System.out.println(F.getName()) ;
* System.out.println(F.getDecription()) ;
* int AlphabetSize = F.getAlphabetSize() ;
*
* F.setFrame(SuperFrame) ; // A frame to put popup windows in.
* F.setArray(Buffer, N) ;
*
* Vector Out = F.getVector() ;
*
*
*/
//==============================================================================
public interface FilterInterface{
//-----------------------------------------------------------------------------
/**
* Sets the program Frame so that the filter can popup its own
* windows, called before the setArray method is called.
*
* @param F Frame to put warning messages or controls in.
*/
public void setFrame(Frame F) ;
//-----------------------------------------------------------------------------
/**
* Sets the input byte array.
*
* @param InputArray byte[] giving input byte array.
* @param Length int giving number of bytes in InputArray.
*/
public void setArray(byte[] InputArray, int Length) ;
//-----------------------------------------------------------------------------
/**
* Gets the filtered output array.
*
* @return V Vector containing Objects filtered from InputArray.
*/
public Vector getVector() ;
//-----------------------------------------------------------------------------
/**
* Gets the name of the filter.
*
* @return String giving the name of the filter.
*/
public String getName() ;
//-----------------------------------------------------------------------------
/**
* Gets a description of the filter.
*
* @return String describing the filter in detail.
*/
public String getDescription() ;
//-----------------------------------------------------------------------------
/**
* Gets the alphabet size of the output Objects, 0 for a non-alphabetic
* filter.
*
* Filters that have non-zero AlphabetSize are NOT prunable. If AlphabetSize = 0,
* a non-alphabetic filter, then pruning is an option having a default
* value set by the isPrunable method below..
*
* @return int giving the alphabet size.
*/
public int getAlphabetSize() ;
//-----------------------------------------------------------------------------
/**
* Gets the XML parameter style for the output Objects.
**
* @return String giving the style, i.e. "font-family:Ezra SIL;font-size:20",
* can be set to "" for usual style.
*/
public String getStyle() ;
//-----------------------------------------------------------------------------
/**
* Gets the position, represented as a String, from the Object[] produced by
* the filter.
*
* Filter output objects do NOT need to contain position data. For them, this
* method can be set to be:
*
*
* return Integer.toString(Text) + "." + Integer.toString(Index) ; ** * @param Data Object[] of Vectors giving Objects. * @param Text int index of Data Vector containing the text. * @param Index int giving position of Object within Data Vector. * @return String giving position from Data[Index] */ public String getPosition( Object[] Data, int Text, int Index ) ; //----------------------------------------------------------------------------- /** * Gets the XML parameter dir (direction) for the output Objects. * * @return String giving the direction, i.e. "ltr" for left-to-right or * "rtl" for right-to-left. */ public String getDirection() ; //----------------------------------------------------------------------------- /** * Gets the XML parameter align (alignment) for the output Objects. * * @return String giving the alignment, i.e. "left" for left or * "right" for right. */ public String getAlignment() ; //----------------------------------------------------------------------------- /** * Gets the locale (language, country, and variant) for typed input text. * * If the text is from the usual locale, return Locale.getDefault(). * * @return Locale giving the desired input Locale. */ public Locale getInputLocale() ; //----------------------------------------------------------------------------- /** * Gets the font name for typed input text. * * @return String giving name of font for typed input text. */ public String getInputFontName() ; //----------------------------------------------------------------------------- /** * Indicates if the filtered text is prunable. * * Alphabets are NOT prunable. If AlphabetSize = 0, a non-alphabetic * filter, then pruning is an option having a default value set by * this method. * * @return boolean indicating if filtered text is prunable. */ public boolean isPrunable() ; //----------------------------------------------------------------------------- // end of class } //============================================================================== //==============================================================================