gov.sns.xal.tools.orbit
Class OrbitBuffer

java.lang.Object
  |
  +--gov.sns.xal.tools.orbit.OrbitBuffer
All Implemented Interfaces:
CorrelationNotice

public class OrbitBuffer
extends java.lang.Object
implements CorrelationNotice

OrbitBuffer maintains statistics on the orbit based on several measurements. An instance of OrbitBuffer maintains a circular buffer of orbit measurements. The size of the buffer is fixed for an instance of OrbitBuffer.


Field Summary
protected  int bufferSize
           
protected  MessageCenter messageCenter
           
protected  MutableOrbitRecord orbit
           
protected  java.util.LinkedList orbitBuffer
           
protected  OrbitListener orbitProxy
           
 
Constructor Summary
OrbitBuffer(OrbitCorrelator correlator, int size)
          Creates a new instance of OrbitBuffer
 
Method Summary
 void addOrbitListener(OrbitListener listener)
          add a listener to notify when the orbit statistics change
 int bufferSize()
          size of the circular buffer of measurements
 void newCorrelation(java.lang.Object sender, Correlation newCorrelation)
          implement CorrelationNotice interface
 void noCorrelationCaught(java.lang.Object sender)
          implement CorrelationNotice interface
 int numSamples()
          number of buffer samples
 void removeOrbitListener(OrbitListener listener)
          remove a listener of orbit statistics changes
 void reset()
          clear the buffer
 void setBufferSize(int newBufferSize)
          set the buffer size to a new size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferSize

protected int bufferSize

orbitBuffer

protected java.util.LinkedList orbitBuffer

orbit

protected MutableOrbitRecord orbit

messageCenter

protected MessageCenter messageCenter

orbitProxy

protected OrbitListener orbitProxy
Constructor Detail

OrbitBuffer

public OrbitBuffer(OrbitCorrelator correlator,
                   int size)
Creates a new instance of OrbitBuffer

Method Detail

bufferSize

public int bufferSize()
size of the circular buffer of measurements


setBufferSize

public void setBufferSize(int newBufferSize)
set the buffer size to a new size


numSamples

public int numSamples()
number of buffer samples


addOrbitListener

public void addOrbitListener(OrbitListener listener)
add a listener to notify when the orbit statistics change


removeOrbitListener

public void removeOrbitListener(OrbitListener listener)
remove a listener of orbit statistics changes


reset

public void reset()
clear the buffer


newCorrelation

public void newCorrelation(java.lang.Object sender,
                           Correlation newCorrelation)
implement CorrelationNotice interface

Specified by:
newCorrelation in interface CorrelationNotice
Parameters:
sender - The poster of the correlation event.
newCorrelation - The correlation that was posted.

noCorrelationCaught

public void noCorrelationCaught(java.lang.Object sender)
implement CorrelationNotice interface

Specified by:
noCorrelationCaught in interface CorrelationNotice
Parameters:
sender - The poster of the "no correlation" event.