package Analyze.Filter ; import javax.swing.* ; // This is only for filters that popup windows, import java.util.Locale ; import java.util.Vector ; //============================================================================== /** * FilterInterface-compatible conversion of bytes to 32 character * alphanumeric alphabet (a-z, 2-7), other bytes are ignored. */ //============================================================================== public class Alphanumeric32 extends FilterCore implements FilterInterface { String Name = "Alphanumeric32" ; String Description = "Bytes converted to special 32 character alphanumeric alphabet (a-z, 2-7), " + "other bytes are ignored." ; int AlphabetSize = 32 ; //----------------------------------------------------------------------------- /** * FilterInterface-compatible conversion of bytes to 32 character * alphanumeric alphabet (a-z, 2-7), other bytes are ignored. */ public Alphanumeric32(){ super() ; super.Name = Name ; super.Description = Description ; super.AlphabetSize = AlphabetSize ; } //----------------------------------------------------------------------------- /** * Gets the filtered output array. * * @return Object[] containing objects filtered from InputArray. */ public Vector getVector(){ // Demonstration of completely optional possibility of poping up windows, // based on the Frame F set by the setFrame command. The method setFrame() // is called before even the setArray method is called. JOptionPane jop = new JOptionPane("This is a demonstration of a filter popping up a window.", JOptionPane.INFORMATION_MESSAGE ) ; JDialog jd = jop.createDialog(F, "Demonstration of filter JDialog") ; jd.show() ; Vector ObjectVector = new Vector() ; for (int k = 0; k < Length; k++){ short shrt = (short) Input[k] ; char c = (char) shrt ; c = Character.toLowerCase(c) ; if (Character.isLetter(c) | Character.isDigit(c)){ if (( c != '0') & (c != '1') & (c != '8') & (c != '9')){ ObjectVector.add((Object) new Character(c) ) ; } } } return ObjectVector ; } //----------------------------------------------------------------------------- // end of class } //============================================================================== //==============================================================================