1 50 51 package org.openlaszlo.iv.flash.util; 52 53 import java.io.*; 54 import java.util.*; 55 import org.openlaszlo.iv.flash.api.*; 56 57 74 public final class ScriptCopier { 75 76 private Hashtable hashTable = new Hashtable(); 77 78 public ScriptCopier() {} 79 80 92 public FlashDef copy( FlashDef def ) { 93 if( def == null ) return null; 94 if( def.isConstant() ) return def; 95 FlashDef myDef = (FlashDef) hashTable.get(def); 96 if( myDef != null ) return myDef; 97 myDef = (FlashDef) def.getCopy(this); 98 hashTable.put(def, myDef); 99 return myDef; 100 } 101 102 108 public FlashDef get( FlashDef def ) { 109 if( def == null ) return null; 110 FlashDef myDef = (FlashDef) hashTable.get(def); 111 if( myDef == null ) return def; 112 return myDef; 113 } 114 115 } 116 | Popular Tags |