• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a TravelTimeRow Inside a Class with Strings for Time: Hours and Minutes  RSS feed

 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application which is doing a fine job of placing the total hours on the interface.

Where I am breaking down is that I am unable to split the string into two distinct groups: hours and minutes



This class uses the following method:





I came across something which showed how to split the String but I am still very unsure how to do this. Any help appreciated. Thanks,
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I came across this but it does not work on int totalMinutesInt = Integer.valueOf(totalMinutesInt.toString()); and int minutesToDisplay = totalMinutesInt = (hours * 60);

 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I worked on this some more; I think I need to split this string, but this technique is not working:

 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michele Smith wrote:I worked on this some more; I think I need to split this string, but this technique is not working...

I think we've been through this before: You're stuck in "coding purgatory" because the only thing you're obsessing about is how you're going to code this, when what you should be doing is writing down what needs to be done before you write your first line of code.

Dates are NOT Strings, and about the only advice I can give you right now is to look at a few pages (if you haven't already): StopCoding, WhatNotHow, StringsAreBad, and UseExistingStandards. They might give you some insight into your problem but, TBH, while you're just bashing away at the keyboard, it's unlikely that a solution (particularly a good one) is going to simply "materialise".

So: Back up. What are you trying to do? And try not to mention Java or HTML when you're describing it; they're the mechanics of the problem.

Winston
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I read your information and I agree, it is hard to do this. I decided to call a stored procedure instead. The stored procedure works great, but I am having trouble integrating it into my project:



any suggestions apprecaited.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!