Results 1 to 3 of 3
  1. #1
    therealyacek is offline Member
    Join Date
    Oct 2012
    Posts
    8
    Rep Power
    0

    Default token Not Equals

    I want to do something while the token does NOT equal "("
    Java Code:
    if(token.equals(")"))
    	do {
    	    stack.pop();
    	} while(token does not equal "(")
    is there a way to do this with the StringTokenizerClass
    Last edited by therealyacek; 10-10-2012 at 02:22 AM.

  2. #2
    therealyacek is offline Member
    Join Date
    Oct 2012
    Posts
    8
    Rep Power
    0

    Default Re: token Not Equals

    i guess something like this might work, where peek is the first item in the stack

    Java Code:
    if(token.equals(")"))
    	do {
    		queue.enqueue(stack.pop());
    	} while(!token.equals(stack.peek())

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: token Not Equals

    Moved from Advanced Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Strut2 Token Interceptor
    By nickyjain89 in forum Struts
    Replies: 0
    Last Post: 07-19-2012, 09:35 AM
  2. Replies: 0
    Last Post: 12-09-2011, 10:28 PM
  3. Replies: 2
    Last Post: 11-21-2011, 11:09 AM
  4. Replies: 0
    Last Post: 01-25-2008, 11:13 PM
  5. Help with string token
    By trill in forum Advanced Java
    Replies: 1
    Last Post: 07-31-2007, 05:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •