com.jamonapi
Class NExtremeArrayBufferHolder

java.lang.Object
  extended by com.jamonapi.utils.NExtremeBufferHolder
      extended by com.jamonapi.NExtremeArrayBufferHolder
All Implemented Interfaces:
BufferHolder, java.util.Comparator

public class NExtremeArrayBufferHolder
extends NExtremeBufferHolder

Buffer used to keep the last N recent array values based on the comparator. Note the Comparator must be thread safe. It can also stored the last n recent values of ToArray objects. By using various Comparators you can determine what should stay in the buffer and what should be removed. JAMon comes with a number of buffers based on this class.

Author:
steve souza

Constructor Summary
NExtremeArrayBufferHolder(boolean naturalOrder, int colToCompare)
          Pass true for natural order, and false for reverse order and column number in Object[] to compare starting at 0
NExtremeArrayBufferHolder(JAMonArrayComparator comparator)
          Constructor that takes a JAMonArrayComparator that can be used to determine when values should be removed from and added to the array.
 
Method Summary
 BufferHolder copy()
          Factory method that returns a usable copy of this object
 void setComparator(java.util.Comparator comparator)
          Note the only valid Comparator to be passed is JAMonArrayComparator
 
Methods inherited from class com.jamonapi.utils.NExtremeBufferHolder
add, compare, getCollection, getComparator, getOrderedCollection, remove, setCollection, shouldReplaceWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

NExtremeArrayBufferHolder

public NExtremeArrayBufferHolder(JAMonArrayComparator comparator)
Constructor that takes a JAMonArrayComparator that can be used to determine when values should be removed from and added to the array. This can be used to decide what to do to values in the buffer based on multiple columns.

Parameters:
comparator -

NExtremeArrayBufferHolder

public NExtremeArrayBufferHolder(boolean naturalOrder,
                                 int colToCompare)
Pass true for natural order, and false for reverse order and column number in Object[] to compare starting at 0

Method Detail

setComparator

public void setComparator(java.util.Comparator comparator)
Note the only valid Comparator to be passed is JAMonArrayComparator

Overrides:
setComparator in class NExtremeBufferHolder

copy

public BufferHolder copy()
Factory method that returns a usable copy of this object

Specified by:
copy in interface BufferHolder
Overrides:
copy in class NExtremeBufferHolder