File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes String Arrays, I/O, and Calendar Usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

String Arrays, I/O, and Calendar Usage

Paul Denton
Greenhorn

Joined: Apr 07, 2012
Posts: 4

Hi everyone. I'm trying to write a program that creates an employee "on call" list for hourly workers. There are four crews: each works 4 12 hour shifts in a row, then gets four days off, rotating between working days and nights. While not working, three employees are on call each day and another three each night, rotating through the two crews who are not working. My goal is to generate a list of the employees who are on call for each shift that looks like this:

2012-04-08
----------
Tim
David
Walter

2012-04-09
----------
David
Walter
Lewis


I am storing crew names in text files, then reading them into String arrays using BufferedReader. I wrote an array to cycle the next employee to the top of the list for each shift, I am using Joda Time to cycle through each date, and I have formatted the output to print out as shown above. Basically, my problem is finding a way to calculate which crews are on call and which are working for a given shift/week/month. Does anyone have a suggestion for calculating this?

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29240
    
139

Duplicate of http://www.coderanch.com/t/572866/java/java/Calendar-Scheduling


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: String Arrays, I/O, and Calendar Usage
 
Similar Threads
Understanding Multi-dimension Arrays
Accessing my object in JSP
Calendar and Scheduling
Frequency of used object in ArrayList
help with batch processing large number of db records