/*
 * $Source: /usr/local/cvsroot/erserver/erserver/java/src/com/postgres/replic/util/struct/USTableRow.java,v $
 * $Author: asullivan $ $Revision: 1.1.1.1 $ $Date: 2003/08/26 19:02:32 $
 *
 */

package com.postgres.replic.util.struct;

import java.util.*;

public class USTableRow implements  DataConst {
    // Class will map to: $row[0], ($row[1]) , $row[2] , $row[3], {};
    // which is         : syncid , (synctime),  minid  , maxid, active
    // Data types       : String ,           , String  , String, Hashtable of Strings

    private long syncid;
    private long minid;
    private long maxid;
    private Hashtable active = new Hashtable();

    Iterator iterator;

    public void putActive(String data) {
         active.put(data, "1");
    }

    public void getActive(String data) {
         active.get(data);
    }

    public void setActiveIterator() {
         iterator = active.keySet().iterator();
    }

    public boolean activeHasNext() {
         return iterator.hasNext();
    }

    public String getActiveKey() {
         return (String) iterator.next();
    }

    public long getSyncid() {
         return syncid;
    }

    public long getMinid() {
         return minid;
    }                                                      

    public long getMaxid() {
         return maxid;
    }


    public void setSyncid(long syncid) {
         this.syncid = syncid;
    }

    public void setMinid(long minid) {
         this.minid = minid;
    }

    public void setMaxid(long maxid) {
         this.maxid = maxid;
    }


    public boolean containsKey(String key) {
         return active.containsKey(key);
    }

}

