1 2 3 package SOFA.SOFAnode.Util; 4 5 6 class ProtocolUpdateStripped extends ProtocolOperator { 7 8 protected Protocol nested; 9 10 public ProtocolUpdateStripped( Protocol l ) { 11 super( "=U'" ); nested = l; 13 } 14 15 public Protocol Copy() { 16 return new ProtocolUpdateStripped( nested.Copy()); 17 } 18 19 public Machine createMachine() { 20 21 Machine m1 = nested.createMachine(); 22 23 m1.StrippedUpdateOnly(); 24 25 return m1; 26 } 27 28 public boolean Restrict( ActionTokenArray a ) { 29 ActionTokenArray h = new ActionTokenArray( a ); 30 h.tokens[1]=true; return nested.Restrict( h ); 32 } 33 34 public void Print( int level ) { 35 Debug.println( level, "Stripped update behavior"); 36 nested.Print( level ); 37 } 38 39 public Protocol Left() { 40 return nested; 41 } 42 43 public Protocol getSameType( Object p1, Object p2 ) { 44 return new ProtocolUpdateStripped( (Protocol)p1 ); 45 } 46 } 47 | Popular Tags |