Sorting times with not dates - java

I am trying my hands on this questions:https://www.codeeval.com/browse/214/ and below is my code and ouput:
CODE
public class TimeSort implements Comparable<TimeSort>{
public int hour;
public int minutes;
public int seconds;
public TimeSort(int hour, int minutes, int seconds) {
this.hour = hour;
this.minutes = minutes;
this.seconds = seconds;
}
public TimeSort(String str){
/*DateFormat formatter = new SimpleDateFormat("HH:mm:ss");
final String x = str;
try {
Date time = sdf.parse(x);
//Time time = new Time(new SimpleDateFormat("HH:mm:ss").parse(x).getTime());
this.hour = time.getHours();
this.minutes = time.getMinutes();
this.seconds = time.getSeconds();
} catch (ParseException e) {
e.printStackTrace();
}*/
String[] parts = str.split(":");
int hour = Integer.parseInt(parts[0]);
int minutes = Integer.parseInt(parts[1]);
int seconds = Integer.parseInt(parts[2]);
this.hour = hour;
this.minutes = minutes;
this.seconds = seconds;
}
public int getHour() {
return hour;
}
public void setHour(int hour) {
this.hour = hour;
}
public int getMinutes() {
return minutes;
}
public void setMinutes(int minutes) {
this.minutes = minutes;
}
public int getSeconds() {
return seconds;
}
public void setSeconds(int seconds) {
this.seconds = seconds;
}
#Override
public String toString() {
if(this.getHour() < 10){
return "0"+this.getHour()+":"+this.getSeconds()+":"+this.getSeconds();
}
return this.getHour()+":"+this.getSeconds()+":"+this.getSeconds();
}
public static void main(String[] args){
List<String> inputs = new ArrayList<>();
inputs.add("02:26:31 14:44:45 09:53:27");
inputs.add("05:33:44 21:25:41");
inputs.add("02:26:31 14:44:45 09:53:27 02:26:31 01:44:45 19:53:27");
for (String input : inputs){
sortTimes(input);
}
}
#Override
public int compareTo(TimeSort timeSort) {
if(this.getHour() > timeSort.getHour()){
return -1;
}
else if(this.getHour() < timeSort.getHour()){
return 1;
}
else if(this.getHour() == timeSort.getHour()) {
if(this.getMinutes() > timeSort.getMinutes()){
return -1;
}
else if(this.getMinutes() < timeSort.getMinutes()){
return 1;
}
}
else if(this.getSeconds() > timeSort.getSeconds()){
return 1;
}
return 0;
}
public static void sortTimes(String str){
List<TimeSort> list = new ArrayList<>();
String[] times = str.split(" ");
for (String time : times){
list.add(new TimeSort(time));
}
System.out.print("Before Sorting: ");
for (TimeSort t : list){
System.out.print(t + " ");
}
System.out.println();
Collections.sort(list);
System.out.print("After Sorting: ");
for (TimeSort t : list){
System.out.print(t + " ");
}
System.out.println();
System.out.println("==============================================================");
}
}
OUTPUT
Before Sorting: 02:31:31 14:45:45 09:27:27
After Sorting: 14:45:45 09:27:27 02:31:31
==============================================================
Before Sorting: 05:44:44 21:41:41
After Sorting: 21:41:41 05:44:44
==============================================================
Before Sorting: 02:31:31 14:45:45 09:27:27 02:31:31 01:45:45 19:27:27
After Sorting: 19:27:27 14:45:45 09:27:27 02:31:31 02:31:31 01:45:45
==============================================================
The weird thing I am seeing is the times do not print correctly. For example 02:26:31 is print as 02:31:31. And it's the same even if I tried to parse the string time(commented part of the code)
Any help is appreciated. Thanks

Your toString() method has a bug:
#Override
public String toString() {
if(this.getHour() < 10){
return "0"+this.getHour()+":"+this.getSeconds()+":"+this.getSeconds();
}
return this.getHour()+":"+this.getSeconds()+":"+this.getSeconds();
}
Note that the 2nd field is getSeconds() instead of getMinutes().

Your toString()-method does not print the minutes!

The other Answers found the bug in your code.
java.time
FYI, all of that code in unnecessary. Java 8 and later has the java.time framework built-in. Amongst its classes is LocalTime for representing a time-of-day-only value without a date and without a time zone. This class already knows how to compare and sort its values and how to parse/print its values. Printing follows standard ISO 8601 formats by default.
List<LocalTime> times = new ArrayList<>();
times.add( LocalTime.parse( "02:26:31" );
times.add( LocalTime.parse( "14:44:45" );
times.add( LocalTime.parse( "09:53:27" );
Collections.sort( times );
Dump to console.
System.out.println( times );

Related

Is there something wrong with the setZone method?

I'm making a program that extends the clock to feature the names of the time zones. The derived class needs to have a static String array data member with values: EST, CST, MST, PST, EDT, CDT, MDT, PDT, a zone data member, a default constructor, a constructor with parameters, the setZone() method, the getZone() method, the printTime() method, the toString(), the equals() method, a makeCopy() method, and a getCopy() method.
public class Clock {
private int hr;
private int min;
private int sec;
public Clock() {
hr = 0;
min = 0;
sec = 0;
}
public Clock(int hours, int minutes, int seconds) {
if (0 <= hours && hours < 24) {
hr = hours;
}
else {
hr = 0;
}
if (0 <= minutes && minutes < 60) {
min = minutes;
}
else {
min = 0;
}
if (0 <= seconds && seconds < 60) {
sec = seconds;
}
else {
sec = 0;
}
}
public Clock(Clock otherClock) {
hr = otherClock.hr;
min = otherClock.min;
sec = otherClock.sec;
}
public void setTime(int hours, int minutes, int seconds) {
if (0 <= hours && hours < 24) {
hr = hours;
}
else {
hr = 0;
}
if (0 <= minutes && minutes < 60) {
min = minutes;
}
else {
min = 0;
}
if (0 <= seconds && seconds < 60) {
sec = seconds;
}
else {
sec = 0;
}
}
public int getHours() {
return hr;
}
public int getMinutes() {
return min;
}
public int getSeconds() {
return sec;
}
public void printTime() {
if (hr < 10) {
System.out.print("0");
}
System.out.print(hr + ":");
if (min < 10) {
System.out.print("0");
}
System.out.print(min + ":");
if (sec < 10) {
System.out.print("0");
}
System.out.print(sec);
}
public void incrementHours() {
hr++;
if (hr > 23) {
hr = 0;
}
}
public void incrementMinutes() {
min++;
if (min > 59) {
min = 0;
incrementHours();
}
}
public void incrementSeconds() {
sec++;
if (sec > 59) {
sec = 0;
incrementMinutes();
}
}
public boolean equals(Clock otherClock) {
return (hr == otherClock.hr && min == otherClock.min && sec == otherClock.sec);
}
public void makeCopy(Clock otherClock) {
hr = otherClock.hr;
min = otherClock.min;
sec = otherClock.sec;
}
public Clock getCopy() {
Clock temp = new Clock();
temp.hr = hr;
temp.min = min;
temp.sec = sec;
return temp;
}
public String toString() {
String str = "";
if (hr < 10) {
str = "0";
}
str += hr + ":";
if (min < 10) {
str += "0";
}
str += min + ":";
if (sec < 10) {
str += "0";
}
str += sec;
return str;
}
}
class ExtClock extends Clock {
static String[] timeZone = {"EST", "CST", "MST", "PST", "EDT", "CDT", "MDT", "PDT"};
private String zone;
public ExtClock() {
super();
zone = "";
}
public ExtClock(int hours, int minutes, int seconds, String tz) {
super(hours, minutes, seconds);
zone = tz;
}
public void setZone(int hours, int minutes, int seconds, String tz) {
setTime(hours, minutes, seconds);
zone = tz;
}
public String getZone() {
return zone;
}
public void printTime() {
super.printTime();
System.out.println(" " + zone);
}
public String toString() {
return super.toString() + " " + zone;
}
public boolean equals(ExtClock otherClock) {
return super.equals(otherClock) && zone.equalsIgnoreCase(otherClock.zone);
}
}
public class ExtClockTest {
public static void main(String[] args) {
ExtClock myExtClock = new ExtClock(5,4,30,"EST");
ExtClock yourExtClock = new ExtClock(0,0,0,"");
setZone.yourExtClock(5,45,16,"CDT");
}
}
The derived class compiles fine, but the ExtClockTest program wouldn't compile because it says that it cannot find the symbol. Am I doing something wrong?
You have put the method before the object.
setZone.yourExtClock(5,45,16,"CDT");
It should be:
Obj.method()
yourExtClock.setZone(5,45,16,"CDT");

How do I call one constructor from another in Java? (beginner example)

First of all, I have read this question which i am aware is dealing with the same fundamental problem I am having.
Nevertheless, I am unable to apply the solution to my own particular problem.
in the following example i have a few overloaded Clock constructors. The error occurs in the case where I am trying to create a Clock from string input.
Does anyone have any tips for the correct implementation of the constructor call?
Code:
public class Clock
{
public static void main(String[] args)
{
Clock testClock = new Clock(153, 26);
System.out.println("Input: Clock(153, 26)");
System.out.println(testClock.toString());
Clock testClock2 = new Clock(9000);
System.out.println("Input: Clock(9000)");
System.out.println(testClock2.toString());
Clock testClock3 = new Clock(23:59);
System.out.println("Input: Clock(23:59)");
System.out.println(testClock3.toString());
System.out.println("Input: testClock2.add(20)");
System.out.println(testClock2.add(20));
System.out.println("input: testClock.add(testClock2)");
System.out.println(testClock.add(testClock2).toString());
}
// Constructors
public Clock(int min, int h)
{
this.min += min%60;
h += min/60;
this.h += h%24;
}
public Clock(int min)
{
this.min += min%60;
this.h += (min/60)%24;
}
public Clock (String theTime)
{
int minutes = Integer.parseInt(theTime.substring(0,1));
int hours = Integer.parseInt(theTime.substring(3,4));
Clock stringClock = new Clock(minutes, hours);
return stringClock; //error occurs *********************
}
private int h;
private int min;
public int getMin() {
return min;
}
public int getH() {
return h;
}
public Clock add(int min)
{
int newMin = this.min + min;
int newH = this.h;
Clock newClock = new Clock(newMin, newH);
return newClock;
}
public Clock add(Clock c)
{
int newMin = this.min + c.min;
int newH = this.h + c.h;
Clock newClock = new Clock(newMin, newH);
return newClock;
}
public String toString()
{
String theTime = "";
if (this.h < 10)
{
theTime += "0" + this.h;
}
else
{
theTime += this.h;
}
theTime += ":";
if (this.min < 10)
{
theTime += "0" + this.min;
}
else
{
theTime += this.min;
}
return theTime;
}
}
You could call this but it should be very first statement such as:
public Clock (String theTime)
{
this(
Integer.parseInt(theTime.substring(0,1)),
Integer.parseInt(theTime.substring(3,4))
);
}
Alternatively you could use a static factory method:
public static Clock parseHHMM(String theTime)
{
int hh = Integer.parseInt(theTime.substring(0,1));
int mm = Integer.parseInt(theTime.substring(3,4));
return new Clock(hh, mm);
}
I prefer the latter, it is common approach in Java, e.g. here.
There is also a problem with that line:
Clock testClock3 = new Clock(23:59);
If you want the argument to be treated as String, you should surround the value passed as argument with quotes, like this:
Clock testClock3 = new Clock("23:59");
, because when you don't change the look of parameter passed, it won't compile.
You could consider splitting theTime at the semicolon":" so as to obtain an array of two integers, the first being the hour and the second being the minutes. Take a look
public Clock (String theTime)
{
this(Integer.parseInt(theTime.split(":")[1],
Integer.parseInt(theTime.split(":")[0]);
}
hope this helps

Need time difference with string like "A Min ago" or "An Hour Ago" [duplicate]

This question already has answers here:
How to calculate "time ago" in Java?
(33 answers)
Closed 8 years ago.
I am new in Android Development.
I need one help to convert my current time with one static time.
Your help be appreciated.
I have one string like this
String created_at = "Wed Mar 03 19:37:35 +0000 2010";
I want to convert it like , which means difference between my current time and created_at string.
23 mins ago // Example
Thanks,
Dharmik
Just use the following utility class I've created and pass the two date objects in its constructor .Subsequently use the getDifferenceString() method to obtain the same.
public class TimeDifference {
int years;
int months;
int days;
int hours;
int minutes;
int seconds;
String differenceString;
public TimeDifference(Date curdate, Date olddate) {
float diff=curdate.getTime() - olddate.getTime();
if (diff >= 0) {
int yearDiff = Math.round( ( diff/ (365l*2592000000f))>=1?( diff/ (365l*2592000000f)):0);
if (yearDiff > 0) {
years = yearDiff;
setDifferenceString(years + (years == 1 ? " year" : " years") + " ago");
} else {
int monthDiff = Math.round((diff / 2592000000f)>=1?(diff / 2592000000f):0);
if (monthDiff > 0) {
if (monthDiff > 11)
monthDiff = 11;
months = monthDiff;
setDifferenceString(months + (months == 1 ? " month" : " months") + " ago");
} else {
int dayDiff = Math.round((diff / (86400000f))>=1?(diff / (86400000f)):0);
if (dayDiff > 0) {
days = dayDiff;
if(days==30)
days=29;
setDifferenceString(days + (days == 1 ? " day" : " days") + " ago");
} else {
int hourDiff = Math.round((diff / (3600000f))>=1?(diff / (3600000f)):0);
if (hourDiff > 0) {
hours = hourDiff;
setDifferenceString( hours + (hours == 1 ? " hour" : " hours") + " ago");
} else {
int minuteDiff = Math.round((diff / (60000f))>=1?(diff / (60000f)):0);
if (minuteDiff > 0) {
minutes = minuteDiff;
setDifferenceString(minutes + (minutes == 1 ? " minute" : " minutes") + " ago");
} else {
int secondDiff =Math.round((diff / (1000f))>=1?(diff / (1000f)):0);
if (secondDiff > 0)
seconds = secondDiff;
else
seconds = 1;
setDifferenceString(seconds + (seconds == 1 ? " second" : " seconds") + " ago");
}
}
}
}
}
}
}
public String getDifferenceString() {
return differenceString;
}
public void setDifferenceString(String differenceString) {
this.differenceString = differenceString;
}
public int getYears() {
return years;
}
public void setYears(int years) {
this.years = years;
}
public int getMonths() {
return months;
}
public void setMonths(int months) {
this.months = months;
}
public int getDays() {
return days;
}
public void setDays(int days) {
this.days = days;
}
public int getHours() {
return hours;
}
public void setHours(int hours) {
this.hours = hours;
}
public int getMinutes() {
return minutes;
}
public void setMinutes(int minutes) {
this.minutes = minutes;
}
public int getSeconds() {
return seconds;
}
public void setSeconds(int seconds) {
this.seconds = seconds;
}
}
its is simple do something like this ( Note I don't have java etc installed I have just typed it in Note on my ipad, so I am not sure if it works but it should be something like this) :
String dateString = "Wed Mar 03 19:37:35 2010";
SimpleDateFormat dateFormat = new SimpleDateFormat("E M d hh:mm:ss y");
Date convertedDate = new Date();
try {
convertedDate = dateFormat.parse(dateString);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// convert date to calnedar
Calendar previouseCal = Calendar.getInstance();
previouseCal.setTime(convertedDate );
// then get the current time
Calendar currentCal = Calendar.getInstance();
// then get the diffrence
long difference = currentCal.getTimeInMillis() - previouseCal.getTimeInMillis();
// if you need it in second then
int second = TimeUnit.MILLISECONDS.toSeconds(difference)
I hope that helps :)

Need assistance with attributes in Java

What I'm trying to do is access an object, in this case date1 which has 3 attributes day, month and year. I'm attempting to make a method called showTomorrow() which will display the objects information 1 day infront in String format. This means I cannot alter the attributes of the original object.
I've written the Data.java program and it's shown below, if someone could point me in the right direction or show me what it would be really helpfull.
This is what I'd essentially be running on my main method I believe.
**Date date1 = new Date(30, 12, 2013)** // instantiate a new object with those paramaters
**date1.showDate();** // display the original date
**date1.tomorrow();** // shows what that date would be 1 day infront
The problem is right now it's not displaying anything. I thought that by saying dayTomorrow = this.day++; I was adding it's default value + 1 day to the variable dayTomorrow.
public class Date
{
private int day;
private int month;
private int year;
private int dayTomorrow;
private int monthTomorrow;
private int yearTomorrow;
public Date()
{
day = 1;
month = 1;
year = 1970;
}
public Date(int inDay, int inMonth, int inYear)
{
day = inDay;
month = inMonth;
year = inYear;
}
public void setDate(int inDay, int inMonth, int inYear)
{
day = inDay;
month = inMonth;
year = inYear;
}
public String getDate()
{
String strDate;
strDate = day + "/" + month + "/" + year;
return strDate;
}
public String getTomorrow()
{
String strTomorrow;
strTomorrow = dayTomorrow + "/" + monthTomorrow + "/" + yearTomorrow;
return strTomorrow;
}
public String tomorrow()
{
dayTomorrow = this.day++;
monthTomorrow = this.month;
yearTomorrow = this.year;
if(dayTomorrow > 30)
{
dayTomorrow = 1;
monthTomorrow = this.month++;
}
if(monthTomorrow > 12)
{
monthTomorrow = 1;
yearTomorrow = this.year++;
}
return getTomorrow();
}
public void showDate()
{
System.out.print("\n\n THIS OBJECT IS STORING ");
System.out.print(getDate());
System.out.print("\n\n");
}
public void showTomorrow()
{
System.out.print("\n\n THE DATE TOMORROW IS ");
System.out.print(getTomorrow());
System.out.print("\n\n");
}
public boolean equals(Date inDate)
{
if(this.day == inDate.day && this.month == inDate.month && this.year == inDate.year)
{
return true;
}
else
{
return false;
}
}
}
You just need to use ++this.day, ++this.month and ++this.year. When you use this.day++ it returns the previous date value, not the new. Putting the ++ in the front solves the problem. Also, it changes the day value... you might want to change that to this.day + 1.
Are You calling showDate() after date1.tomorrow() to show your output?
or instead of date1.tomorrow(); call date1.showTomorrow();
Have a look at this : http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op1.html
post incremention ...
You could use the native date support in java but I figured you are just practicing right?
This should do the trick:
public class Date {
private int day = 1;
private int month = 1;
private int year = 1970;
private int dayTomorrow = day+1;
private int monthTomorrow;
private int yearTomorrow;
public Date()
{
tomorrow();
}
public Date(int inDay, int inMonth, int inYear)
{
day = inDay;
month = inMonth;
year = inYear;
tomorrow();
}
public void setDate(int inDay, int inMonth, int inYear)
{
day = inDay;
month = inMonth;
year = inYear;
}
public String getDate()
{
String strDate;
strDate = day + "/" + month + "/" + year;
return strDate;
}
public String getTomorrow()
{
String strTomorrow;
strTomorrow = dayTomorrow + "/" + monthTomorrow + "/" + yearTomorrow;
return strTomorrow;
}
public void tomorrow()
{
monthTomorrow = this.month;
yearTomorrow = this.year;
if(dayTomorrow > 30)
{
dayTomorrow = 1;
monthTomorrow = this.month++;
}
if(monthTomorrow > 12)
{
monthTomorrow = 1;
yearTomorrow = this.year++;
}
}
public void showDate()
{
System.out.print("\n\n THIS OBJECT IS STORING ");
System.out.print(getDate());
System.out.print("\n\n");
}
public void showTomorrow()
{
System.out.print("\n\n THE DATE TOMORROW IS ");
System.out.print(getTomorrow());
System.out.print("\n\n");
}
public boolean equals(Date inDate)
{
if(this.day == inDate.day && this.month == inDate.month && this.year == inDate.year)
{
return true;
}
else
{
return false;
}
}
}
Look carefully for any changes i've made ;)
Here's the main:
public static void main(String[] args) {
Date d = new Date();
d.showDate();
d.showTomorrow();
}

Generics and Performance question

I was wondering if anyone could look over a class I wrote, I am receiving generic warnings in Eclipse and I am just wondering if it could be cleaned up at all. All of the warnings I received are surrounded in ** in my code below.
The class takes a list of strings in the form of (hh:mm AM/PM) and converts them into HourMinute objects in order to find the first time in the list that comes after the current time.
I am also curious about if there are more efficient ways to do this. This works fine but the student in me just wants to find out how I could do this better.
public class FindTime {
private String[] hourMinuteStringArray;
public FindTime(String[] hourMinuteStringArray){
this.hourMinuteStringArray = hourMinuteStringArray;
}
public int findTime(){
HourMinuteList hourMinuteList = convertHMStringArrayToHMArray(hourMinuteStringArray);
Calendar calendar = new GregorianCalendar();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
HourMinute now = new HourMinute(hour,minute);
int nearestTimeIndex = findNearestTimeIndex(hourMinuteList, now);
return nearestTimeIndex;
}
private int findNearestTimeIndex(HourMinuteList hourMinuteList, HourMinute now){
HourMinute current;
int position = 0;
Iterator<HourMinute> iterator = **hourMinuteList.iterator()**;
while(iterator.hasNext()){
current = (HourMinute) iterator.next();
if(now.compareTo(current) == -1){
return position;
}
position++;
}
return position;
}
private static HourMinuteList convertHMStringArrayToHMArray(String[] times){
FindTime s = new FindTime(new String[1]);
HourMinuteList list = s.new HourMinuteList();
String[] splitTime = new String[3];
for(String time : times ){
String[] tempFirst = time.split(":");
String[] tempSecond = tempFirst[1].split(" ");
splitTime[0] = tempFirst[0];
splitTime[1] = tempSecond[0];
splitTime[2] = tempSecond[1];
int hour = Integer.parseInt(splitTime[0]);
int minute = Integer.parseInt(splitTime[1]);
HourMinute hm;
if(splitTime[2] == "AM"){
hm = s.new HourMinute(hour,minute);
}
else if((splitTime[2].equals("PM")) && (hour < 12)){
hm = s.new HourMinute(hour + 12,minute);
}
else{
hm = s.new HourMinute(hour,minute);
}
**list.add(hm);**
}
return list;
}
class **HourMinuteList** extends **ArrayList** implements RandomAccess{
}
class HourMinute implements **Comparable** {
int hour;
int minute;
public HourMinute(int hour, int minute) {
setHour(hour);
setMinute(minute);
}
int getMinute() {
return this.minute;
}
String getMinuteString(){
if(this.minute < 10){
return "0" + this.minute;
}else{
return "" + this.minute;
}
}
int getHour() {
return this.hour;
}
void setHour(int hour) {
this.hour = hour;
}
void setMinute(int minute) {
this.minute = minute;
}
#Override
public int compareTo(Object aThat) {
if (aThat instanceof HourMinute) {
HourMinute that = (HourMinute) aThat;
if (this.getHour() == that.getHour()) {
if (this.getMinute() > that.getMinute()) {
return 1;
} else if (this.getMinute() < that.getMinute()) {
return -1;
} else {
return 0;
}
} else if (this.getHour() > that.getHour()) {
return 1;
} else if (this.getHour() < that.getHour()) {
return -1;
} else {
return 0;
}
}
return 0;
}
}
If you have any questions let me know.
Thanks,
Rob
It's because you a not specify generics for your List and Comparable instances, that can support generics. You can rewrite your code with:
class HourMinuteList extends ArrayList<HourMinute> implements RandomAccess{
}
class HourMinute implements Comparable<HourMinute> {
public int compareTo(HourMinute aThat) {
....
}
}
Note: generics is not required, and not used at runtime, but it's better to use them because it helps you to avoid some bugs at your code.
I wouldn't use the HourMinute class, unless it has some other added value. If you only need to find the closest event time after a given point in time, convert your strings to Date (or to long values representing time), and store them in some sorted collection.
The conversion can be done with SimpleDateFormat.
If items are added dynamically, use TreeSet<Date>, together with ceiling(t) / higher(t) methods.
If the set of items is not dynamic, use an array Date[], together with Arrays.binarySearch(..).
Here is a (working) draft of the first approach:
public class TimedEventsMgr {
private TreeSet<Date> pointsInTime = new TreeSet<Date>();
private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd hh:mm a");
//timeStr: hh:mm AM/PM
public void add(String timeStr) throws ParseException{
Date time = sdf.parse("20000101 "+timeStr);
pointsInTime.add(time);
}
public Date closestFutureTime(Date time){
Calendar c = Calendar.getInstance();
c.setTime(time);
c.set(Calendar.YEAR, 2000);
c.set(Calendar.MONTH, 0); //January
c.set(Calendar.DATE, 1);
return pointsInTime.higher(c.getTime());
}
}

Categories