00001 00066 package com.arcle.rmt.superwaba.model.imp.rqml; 00067 00068 import superwaba.ext.xplat.io.Storable; 00069 import superwaba.ext.xplat.io.DataStream; 00070 00071 import com.arcle.rmt.superwaba.model.imp.*; 00072 import com.arcle.rmt.rqml.*; 00073 00079 public class TaxonomyImpl extends RQMLFirstClassImpl implements Taxonomy { 00080 public GenericMemento createMemento() { 00081 return new Memento(this); 00082 } 00083 00084 public int getTypeElement() { 00085 return typeElement; 00086 } 00087 00088 00089 public void setTypeElement(int te) { 00090 typeElement = te; 00091 } 00092 00093 00094 private int typeElement = 0; 00095 00096 //----------------------------------------------------------------------- 00097 // Inner Classes 00098 00099 protected static class Memento extends RQMLFirstClassImpl.Memento { 00100 public Memento(TaxonomyImpl originator) { 00101 super(originator); 00102 } 00103 00104 public Storable getInstance() { 00105 // This memento is not directly stored in the Catalog as an 00106 // object, so this factory method is not required. 00107 return null; 00108 } 00109 00110 public byte getID() { 00111 return DocumentImpl.TAXONOMY_ID; 00112 } 00113 00114 00115 public void saveState(DataStream data) { 00116 final TaxonomyImpl org = (TaxonomyImpl) getOriginator(); 00117 super.saveState(data); 00118 data.writeInt(org.typeElement); 00119 } 00120 00121 public void loadState(DataStream data) { 00122 final TaxonomyImpl org = (TaxonomyImpl) getOriginator(); 00123 super.loadState(data); 00124 org.typeElement = data.readInt(); 00125 } 00126 } 00127 }