question: public boolean dateRange ( Object day1 , Object month1 , Object year1 , Object day2 , Object month2 , Object year2 , Object gmt ) { Map < String , Integer > params = new HashMap < String , Integer > ( ) ; parseDateParam ( params , day1 ) ; parseDateParam ( params , month1 ) ; parseDateParam ( params , year1 ) ; parseDateParam ( params , day2 ) ; parseDateParam ( params , month2 ) ; parseDateParam ( params , year2 ) ; parseDateParam ( params , gmt ) ; boolean useGmt = params . get ( "gmt" ) != null ; Calendar cal = getCurrentTime ( useGmt ) ; Date current = cal . getTime ( ) ; if ( params . get ( "day1" ) != null ) { cal . set ( Calendar . DAY_OF_MONTH , params . get ( "day1" ) ) ; } if ( params . get ( "month1" ) != null ) { cal . set ( Calendar . MONTH , params . get ( "month1" ) ) ; } if ( params . get ( "year1" ) != null ) { cal . set ( Calendar . YEAR , params . get ( "year1" ) ) ; } Date from = cal . getTime ( ) ; Date to ; if ( params . get ( "day2" ) != null ) { cal . set ( Calendar . DAY_OF_MONTH , params . get ( "day2" ) ) ; } if ( params . get ( "month2" ) != null ) { cal . set ( Calendar . MONTH , params . get ( "month2" ) ) ; } if ( params . get ( "year2" ) != null ) { cal . set ( Calendar . YEAR , params . get ( "year2" ) ) ; } to = cal . getTime ( ) ; if ( to . before ( from ) ) { cal . add ( Calendar . MONTH , + 1 ) ; to = cal . getTime ( ) ; } if ( to . before ( from ) ) { cal . add ( Calendar . YEAR , + 1 ) ; cal . add ( Calendar . MONTH , - 1 ) ; to = cal . getTime ( ) ; } return current . compareTo ( from ) >= 0 && current . compareTo ( to ) <= 0 ; }
target:  Only the first parameter is mandatory. All other parameters can be left out therefore the meaning of the parameters changes. The method definition shows the version with the most possible parameters filled. The real meaning of the parameters is guessed from it's value. If "from" and "to" are specified then the bounds are inclusive. If the "GMT" parameter is specified, times are taken to be in GMT, otherwise the local time zone is used.