public interface Vector {
  /** Returns the number of elements in the vector. */
  public int size();
  /** Returns whether the vector is empty. */
  public boolean isEmpty();
  /** Returns the element stored at the given rank. */
  public Object elemAtRank(int r) throws BoundaryViolationException;
  /** Replaces the element stored at the given rank. */
  public Object replaceAtRank(int r, Object e) throws BoundaryViolationException;
  /** Inserts an element at the given rank. */
  public void insertAtRank(int r, Object e) throws BoundaryViolationException;
  /** Removes the element stored at the given rank. */
  public Object removeAtRank(int r) throws BoundaryViolationException;
}