Module hw06

Class LastNegAcc

java.lang.Object
provided.listFW.visitors.AAccumulator
provided.listFW.visitors.LastNegAcc
All Implemented Interfaces:
IAccumulator

public class LastNegAcc extends AAccumulator
Accumulates (saves) the last negative number given to it. Base case is Double.NaN (Not a Number)
Author:
swong
  • Constructor Details

    • LastNegAcc

      public LastNegAcc()
      Constructor for the class
  • Method Details

    • accumulate

      public void accumulate(Object x)
      Description copied from interface: IAccumulator
      Accumulates the given value into the internally stored total
      Parameters:
      x - The value to process for accumulation