package run;
import java.io.*;

import run.trackwriters.GidTrackWriter;

import uka.karmi.rmi.RemoteException;

import uka.karmi.rmi.server.ReplicatedObject;

import java.util.*;

import jp.lang.RMICompatibility;

import jp.lang.RemoteObject;

public abstract class TrackWriter extends ReplicatedObject implements uka.patch.Patchable, uka.transport.Transportable {
   public void createPatch(Object _copy, uka.patch.PatchOutput po) throws java.io.IOException {
      TrackWriter copy = (TrackWriter)_copy;
      super.createPatch(copy, po);
      copy.tracker_print_types = this.tracker_print_types = (boolean[])po.writeDiff(this.tracker_print_types, copy.tracker_print_types);
      copy.trackerlist = this.trackerlist = (run.RplVector)po.writeDiff(this.trackerlist, copy.trackerlist);
   }
   public void applyPatch(Object _copy, uka.patch.PatchInput pi) throws java.io.IOException, ClassNotFoundException {
      TrackWriter copy = (TrackWriter)_copy;
      super.applyPatch(copy, pi);
      if (pi.hasDiff()) copy.tracker_print_types = this.tracker_print_types = (boolean[])pi.getDiffAsObject();
      if (pi.hasDiff()) copy.trackerlist = this.trackerlist = (run.RplVector)pi.getDiffAsObject();
   }
   public void descendReferences(uka.patch.ReferenceConsumer c) throws java.io.IOException {
      super.descendReferences(c);
      c.descend(this.tracker_print_types);
      c.descend(this.trackerlist);
   }
   public void filterReferences(uka.patch.ReferenceFilter f) {
      super.filterReferences(f);
      this.tracker_print_types = (boolean[])f.filter(this.tracker_print_types);
      this.trackerlist = (run.RplVector)f.filter(this.trackerlist);
   }
   public TrackWriter(uka.transport.UnmarshalStream _stream, int _id) throws java.io.IOException, ClassNotFoundException {
      super(_stream, _id);
   }
   public void unmarshal(uka.transport.UnmarshalStream _stream) throws java.io.IOException, ClassNotFoundException {
      super.unmarshal(_stream);
      this.tracker_print_types = (boolean[])_stream.readReference();
      this.trackerlist = (run.RplVector)_stream.readReference();
   }
   public void marshal(uka.transport.MarshalStream _stream) throws java.io.IOException {
      super.marshal(_stream);
      _stream.writeReference(this.tracker_print_types);
      _stream.writeReference(this.trackerlist);
   }
   public TrackWriter(TrackWriter _orig, int _id, uka.transport.DeepClone _helper) throws CloneNotSupportedException, java.io.IOException {
      super(_orig, _id, _helper);
   }
   public void deepCloneReferences(TrackWriter _orig, uka.transport.DeepClone _helper) throws CloneNotSupportedException {
      super.deepCloneReferences(_orig, _helper);
      this.tracker_print_types = (boolean[])_helper.internalDeepClone(_orig.tracker_print_types);
      this.trackerlist = (run.RplVector)_helper.internalDeepClone(_orig.trackerlist);
   }
   protected RplVector trackerlist;
   protected boolean[] tracker_print_types;
   public TrackWriter(RplVector tlist) throws RemoteException {
      super(null);
      run.TrackWriter.this.trackerlist = tlist;
   }
   public TrackWriter(RplVector tlist, RemoteObject[] cluster_nodes) throws RemoteException {
      super(RMICompatibility.getStubs(cluster_nodes));
      run.TrackWriter.this.trackerlist = tlist;
   }
   public static TrackWriter getTrackWriterOfType_Fembic(String type, RplVector trackerlist, RemoteObject[] cluster_nodes) throws java.lang.IllegalArgumentException, RemoteException {
      if (type.toUpperCase().equals("GIDTRACKWRITER")) {
         return new GidTrackWriter(trackerlist, cluster_nodes);
      }
      throw new IllegalArgumentException("Illegal TrackWriter Type");
   }
   public abstract void write(double time);
   public abstract void initialize();
   public abstract void checkIndata() throws Error;
}
