public PublicationRecord getPublicationRecord ( Date time ) { PublicationRecord nearest = null ; for ( PublicationRecord publicationRecord : publicationRecords ) { Date publicationTime = publicationRecord . getPublicationData ( ) . getPublicationTime ( ) ; if ( publicationTime . equals ( time ) || publicationTime . after ( time ) ) { if ( nearest == null ) { nearest = publicationRecord ; } else if ( publicationTime . before ( nearest . getPublicationData ( ) . getPublicationTime ( ) ) ) { nearest = publicationRecord ; } } } return nearest ; }
Returns the closest publication record to given time .