60 likes | 190 Views
This document provides a concise overview of the `BasicSeismogram` object class. Developed by Anthony Lomax of Anthony Lomax Scientific Software, this class extends `BasicThing` and encapsulates seismogram data with methods for accessing reference time and amplitude at given offsets. Key features include inheritance, encapsulation, and the implementation of access modifiers to protect data integrity. The class is integral for handling seismic data in scientific applications. For more details, visit www.alomax.net.
E N D
A quick overview of an Object Anthony Lomax Anthony Lomax Scientific Software Mouans-Sartoux, France anthony@alomax.netwww.alomax.net
data methods object restricted access messages
/** A basic Seismogram object */ public class BasicSeismogram extends BasicThing { public BasicChannel channel; // channel info protected TimeSeries timeSeries; // seismogram data protected DateTime refTime; // reference time private double timeMin;// offset of 1st sample /** Returns the reference time. */ public DateTime getRefTime() { return(refTime); } /** Returns the amplitude at a given offset time. */ public double ampAtTime(double time) { int nsample = (int) (time - timeMin) / (double) timeSeries.getSampleInt(); amp = (double) timeSeries.sampleAt(nsample + 1); return(amp); } } // end class BasicSeismogram data “Inheritance” “Encapsulation” “Protection” object (class) methods
data methods interfacedclasses “implements” inherited classes “extends” “Polymorphism” data methods data methods object methods restricted access messages
extends implements data methods GradientVelocityModel Drawable Geometry3D Volume TravelTime Calculator VelocityModel
A quick overview of an Object References General: Developer.com - http://developer.com O'Reilly Network - http://www.oreillynet.com P. Andrews, Object Lessons: the State of the Art - http://www.developer.com/design/article.php/1439571 Scientific: Seismological: Anthony Lomax Scientific Software, Mouans-Sartoux, France anthony@alomax.netwww.alomax.net