public class Shape { protected double x_ = 0.0; protected double y_ = 0.0; protected double width_ = 0.0; protected double height_ = 0.0; synchronized double x() { return x_; } synchronized double y() { return y_; } synchronized double width(){ return width_; } synchronized double height(){ return height_; } synchronized void adjustLocation() { x_ = longCalculation1(); y_ = longCalculation2(); } synchronized void adjustDimensions() { width_ = longCalculation3(); height_ = longCalculation4(); } }