//***********************************************************
//*
//* File:           Vertex.java
//* Author:         Srikant Krishna
//* Contact:        srikant@cs.columbia.edu
//* Update:         10/16/2002
//*
//* Description:    Vertex class for Project 3.
//*
//***********************************************************


package Rectangles;

import java.io.*;

public class Vertex implements Serializable {

    int _xpos;
    int _ypos;
    static final String _CERROR_STRING = "[Error]";
    
    public Vertex(int __xpos, int __ypos) throws Exception {
        _xpos = __xpos;
        _ypos = __ypos;
    }

    public int xpos() throws Exception {
        return _xpos;
    }
    
    public void setXpos(int __xpos) throws Exception {
        _xpos = __xpos;
    }

    public int ypos() throws Exception {
        return _ypos;
    }

    public void setYpos(int __ypos) throws Exception {
        _ypos = __ypos;
    }
    
    public Vertex copy() throws Exception {
        return new Vertex(_xpos, _ypos);
    }
    
    public String toString() {
        try {
            return new String("["+_xpos+", "+_ypos+"]");
            
        } catch (Exception EXC) {
            return _CERROR_STRING;
        }
    }
}
