1 18 19 package org.objectweb.jac.samples.ring; 20 21 public class RingElement 22 { 23 24 26 public RingElement previousElement; 27 28 29 public RingElement() {} 30 public RingElement( RingElement previousElement ) { 31 this.previousElement = previousElement; 32 } 33 34 35 40 41 public void setPrevious( RingElement previousElement ) { 42 43 System.out.println( "<<< setPrevious() called on " + 44 toString() + " >>>" ); 45 46 this.previousElement = previousElement; 47 } 48 49 54 55 public void roundTrip( int step ) { 56 57 System.out.println( "<<< roundTrip() called on "+ toString() + 58 ", step: " + step + " >>>" ); 59 60 62 63 if( step > 0 ) previousElement.roundTrip( step-1 ); 64 65 System.out.println( "<<< roundTrip() returned on " + 66 toString() + " >>>" ); 67 } 68 69 } 70 | Popular Tags |