60 likes | 180 Views
A quick overview of an Object. Anthony Lomax Anthony Lomax Scientific Software Mouans-Sartoux, France anthony@alomax.net www.alomax.net. data methods. object. restricted access. messages. /** A basic Seismogram object */
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