Home arrow static arrow Java Programming [Archive] - converting an Integer type to an "int"
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - converting an Integer type to an "int"
This topic has 1 reply on 1 page.

Posts:8
Registered: 7/9/04
converting an Integer type to an "int"  
Jul 9, 2004 12:56 PM



 
Hi,

I'm trying to compare items in a vector( holds msg_id's, which are ints ) to see what id has previously been used. I'm doing the following:

private Vector names;
.
.
.
for( int s=0; s<names.size(); s++ )
Integer t = new Integer( s );
if( // here I want to check the contents of names to an int msg_id, but not sure how )

Your assistance is greatly appreciated.

thanks,
Lita_96
 

Posts:441
Registered: 2/25/04
Re: converting an Integer type to an "int"  
Jul 9, 2004 1:05 PM (reply 1 of 1)



 
I'm trying to compare items in a vector( holds msg_id's, which are ints ) to see what id has
previously been used. I'm doing the following:
 private Vector names; . . . for( int s=0; s<names.size(); s++ )//  Integer t = new Integer( s ); -- that creates a new integer, whose value is// but you want the one already in the vector at position s:  Integer t = (Integer)names.get(s);  if (t.intValue() == msg_id) {   . . .


Pete
 
This topic has 1 reply on 1 page.