Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I add Vectors together?

 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have three vectors. My question is how can I make
addressVector is equal to all the cityVector+ stateVector?
I got convert Vector to int error.
Thanks.
Vector addressVector = this.getAddressList();
Vector cityVector = this.getCityList();
vector stateVector = this.getStateList();
public Vector getAddressList(){return addressList; }
public Vector getCity(){return cityList; }
public Vector getStateList(){return stateList; }
public void setAddressList(Vector arg) { addressList = arg; }
public void setCityList(Vector arg) { cityList = arg; }
public void setStateList(Vector arg) { stateList = arg; }

 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Zoe,
Have you tried addressVector.addAll( cityVector ) and then addressVector.addAll( stateVector ).
The method appends the added collection to the existing one. See the addAll() method in the API
Hope that helps.
[This message has been edited by Jane Griscti (edited November 08, 2001).]
 
Zoe Peng
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jane,
Thanks. I'll give it a try.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic