package psoAlgoCode; import java.util.Vector; public class Coordinate { private Vector coord; public Coordinate() { coord = new Vector(); } // Getter /** * Vector for coordinates * * @return the vector of all coordinates. It's size usually depends on the * dimension constant */ public Vector getCoords() { return coord; } /** * One object within the coord vector * * @param index * coord to be founded * @return the object corresponding the index */ public T getCoord(int index) { return coord.get(index); } // Setter public void setCoords(Vector new_coords) { this.coord = new_coords; } public void setCoord(T new_coord, int index) { coord.add(index, new_coord); } @Override public String toString() { String text = ""; for (T v : coord) { text = text + v.toString(); } return text; } }