public MovingAverageProcessor(String type,double alpha){
  if (!VALID_TYPES.contains(type)) {
    throw new IllegalArgumentException(type + " is not a valid message type.\n" + "Valid message types are \"FAST\", \"MEDIUM\", and \"SLOW\".");
  }
  if ((alpha < 0.0) || (alpha > 1.0)) {
    throw new IllegalArgumentException("Alpha must be between zero and one.");
  }
  this.type=type;
  this.alpha=alpha;
}

public MovingAverageProcessor ( String type , double alpha ) { if ( ! VALID_TYPES . contains ( type ) ) { throw new IllegalArgumentException ( type + " is not a valid message type.\n" + "Valid message types are \"FAST\", \"MEDIUM\", and \"SLOW\"." ) ; } if ( ( alpha < 0.0 ) || ( alpha > 1.0 ) ) { throw new IllegalArgumentException ( "Alpha must be between zero and one." ) ; } this . type = type ; this . alpha = alpha ; }
creates an instance of the processor for the specified message type with the provided alpha value .
