ucar.unidata.util
Class DatedObject

java.lang.Object
  extended by ucar.unidata.util.DatedObject
All Implemented Interfaces:
DatedThing

public class DatedObject
extends Object
implements DatedThing

A utility class that implements DatedThing


Constructor Summary
DatedObject()
          Default ctor
DatedObject(Date date)
          Construct this object with just a date
DatedObject(Date date, Object object)
          Construct this object with a date and an object
 
Method Summary
 boolean equals(Object o)
          equals method
 Date getDate()
          Get the Date property.
 Object getObject()
          Get the Object property.
static List getObjects(List datedObjects)
          A utility method that takes a list of DatedObjects-s and returns a list of the objects
static List select(Date startDate, Date endDate, List datedThings)
          Select and return the DatedThings taht have dates between the two given dates.
 void setDate(Date value)
          Set the Date property.
 void setObject(Object value)
          Set the Object property.
static List sort(List datedThings, boolean ascending)
          Sort the given list of DatedThing-s
 String toString()
          to string
static List unwrap(List datedThings)
          A utility method that takes a list of DatedThing-s and returns a list of Date-s
static List wrap(List dates)
          A utility method that takes a list of dates and returns a list of DatedObjects
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DatedObject

public DatedObject()
Default ctor


DatedObject

public DatedObject(Date date)
Construct this object with just a date

Parameters:
date - the date

DatedObject

public DatedObject(Date date,
                   Object object)
Construct this object with a date and an object

Parameters:
date - the date
object - The object
Method Detail

select

public static List select(Date startDate,
                          Date endDate,
                          List datedThings)
Select and return the DatedThings taht have dates between the two given dates.

Parameters:
startDate - Start date
endDate - End date
datedThings - DatedThing-s to look at
Returns:
List of DatedThing-s that are between the given dates

wrap

public static List wrap(List dates)
A utility method that takes a list of dates and returns a list of DatedObjects

Parameters:
dates - List of dates to wrap
Returns:
A list of DatedObjects

unwrap

public static List unwrap(List datedThings)
A utility method that takes a list of DatedThing-s and returns a list of Date-s

Parameters:
datedThings - List of dates to unwrap
Returns:
A list of Dates

getObjects

public static List getObjects(List datedObjects)
A utility method that takes a list of DatedObjects-s and returns a list of the objects

Parameters:
datedObjects - List of objects
Returns:
A list of the objects the datedobjects hold

sort

public static List sort(List datedThings,
                        boolean ascending)
Sort the given list of DatedThing-s

Parameters:
datedThings - list to sort
ascending - sort order
Returns:
sorted list

equals

public boolean equals(Object o)
equals method

Overrides:
equals in class Object
Parameters:
o - object to check
Returns:
equals

setDate

public void setDate(Date value)
Set the Date property.

Parameters:
value - The new value for Date

getDate

public Date getDate()
Get the Date property.

Specified by:
getDate in interface DatedThing
Returns:
The Date

setObject

public void setObject(Object value)
Set the Object property.

Parameters:
value - The new value for Object

getObject

public Object getObject()
Get the Object property.

Returns:
The Object

toString

public String toString()
to string

Overrides:
toString in class Object
Returns:
to string


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.