implements vector in java