public class BasicAmpConfig extends java.lang.Object implements AmpConfig
Constructor and Description |
---|
BasicAmpConfig() |
BasicAmpConfig(DataSetSeismogram[] seismos) |
Modifier and Type | Method and Description |
---|---|
void |
add(DataSetSeismogram[] seismos)
add is the method used to add a seismogram to this object |
void |
addListener(AmpListener listener)
addListener causes listener to receive updates when this
AmpConfig changes |
AmpEvent |
calculate() |
void |
clear()
clear removes all seismograms from this receptacle |
boolean |
contains(DataSetSeismogram seismo)
contains checks the receptacle for the presence of seismo |
void |
fireAmpEvent()
fireAmpEvent makes the AmpConfig create a new AmpEvent
reflecting its current internal state and send it to all AmpListeners |
edu.iris.Fissures.model.UnitRangeImpl |
getAmp() |
edu.iris.Fissures.model.UnitRangeImpl |
getAmp(DataSetSeismogram seis) |
AmpConfigData[] |
getAmpData() |
AmpConfigData |
getAmpData(DataSetSeismogram seis) |
AmpListener[] |
getAmpListeners() |
DataSetSeismogram[] |
getSeismograms()
returns all of the seismograms held by this receptacle
|
DataSetSeismogram[] |
getSeismograms(AmpConfigData[] ampData) |
AmpEvent |
recalculate() |
void |
remove(DataSetSeismogram[] seismos)
remove removes seismograms from this object |
void |
removeListener(AmpListener listener)
removeListener causes listener to no longer receive updates from
this AmpConfig |
void |
reset()
reset takes all of the seismograms contained in this receptacle and sets
their state as if they had just been added to the receptacle and sets the
instance varaibles of the receptacle back to their initial states
|
void |
reset(DataSetSeismogram[] seismos)
reset takes all of the seismograms in the array and sets
their state as if they had just been initially added to the receptacle |
protected boolean |
setAmpRange(AmpConfigData data) |
void |
shaleAmp(double shift,
double scale)
shaleAmp shifts then scales all the seismograms in the config. |
void |
shaleAmp(double shift,
double scale,
DataSetSeismogram[] seismos)
shaleAmp performs a shaleAmp on the seismograms in the array |
java.lang.String |
toString() |
void |
updateTime(TimeEvent timeEvent) |
public BasicAmpConfig()
public BasicAmpConfig(DataSetSeismogram[] seismos)
public java.lang.String toString()
toString
in class java.lang.Object
public void add(DataSetSeismogram[] seismos)
add
is the method used to add a seismogram to this objectadd
in interface DataSetSeismogramReceptacle
seismo
- the seismogram to be addedpublic void remove(DataSetSeismogram[] seismos)
remove
removes seismograms from this objectremove
in interface DataSetSeismogramReceptacle
seismo
- the seismograms to be removedpublic void clear()
DataSetSeismogramReceptacle
clear
removes all seismograms from this receptacleclear
in interface DataSetSeismogramReceptacle
public DataSetSeismogram[] getSeismograms()
DataSetSeismogramReceptacle
getSeismograms
in interface DataSetSeismogramReceptacle
public DataSetSeismogram[] getSeismograms(AmpConfigData[] ampData)
public edu.iris.Fissures.model.UnitRangeImpl getAmp()
public edu.iris.Fissures.model.UnitRangeImpl getAmp(DataSetSeismogram seis)
public AmpConfigData[] getAmpData()
getAmpData
in interface AmpConfig
public AmpConfigData getAmpData(DataSetSeismogram seis)
getAmpData
in interface AmpConfig
public boolean contains(DataSetSeismogram seismo)
contains
checks the receptacle for the presence of seismocontains
in interface DataSetSeismogramReceptacle
seismo
- the seismogram whose presence is to be testedpublic void reset()
DataSetSeismogramReceptacle
reset
in interface DataSetSeismogramReceptacle
public void reset(DataSetSeismogram[] seismos)
DataSetSeismogramReceptacle
reset
takes all of the seismograms in the array and sets
their state as if they had just been initially added to the receptaclereset
in interface DataSetSeismogramReceptacle
seismos
- a DataSetSeismogram[]
value containing
seismograms to be resetpublic void shaleAmp(double shift, double scale)
AmpConfig
shaleAmp
shifts then scales all the seismograms in the config.
First, the shift value is used to move the amp range by shift
*amp range.
Then the scale value is used to adjust the high amp value so that the new amp range is
scale*amp range.
So, if shift = 1 and scale = 2, the shift is applied and the new low end on the amp range is equal to the
old high value. Then the range itself is modified to be two times its original size. The new
range starts at the old low end and is twice as wide
An adjustment of shift = 0, scale = 1 will leave the seismograms unchanged. A scale value must
be greater than 0, or it will reduce the range to nothing.public void shaleAmp(double shift, double scale, DataSetSeismogram[] seismos)
AmpConfig
shaleAmp
performs a shaleAmp on the seismograms in the arraypublic void fireAmpEvent()
AmpConfig
fireAmpEvent
makes the AmpConfig create a new AmpEvent
reflecting its current internal state and send it to all AmpListenersfireAmpEvent
in interface AmpConfig
public void addListener(AmpListener listener)
AmpConfig
addListener
causes listener to receive updates when this
AmpConfig changesaddListener
in interface AmpConfig
public void removeListener(AmpListener listener)
AmpConfig
removeListener
causes listener to no longer receive updates from
this AmpConfigremoveListener
in interface AmpConfig
public AmpListener[] getAmpListeners()
public void updateTime(TimeEvent timeEvent)
updateTime
in interface TimeListener
public AmpEvent recalculate()
protected boolean setAmpRange(AmpConfigData data)