Produced by Araxis Merge on 6/11/2019 10:54:08 AM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\model\report\scheduled | DateRangeBoundaryType.java | Wed May 29 15:26:18 2019 UTC |
| 2 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\ccht\model\report\scheduled | DateRangeBoundaryType.java | Mon Jun 10 19:19:44 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 220 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.med.c cht.model. report.sch eduled; | |
| 2 | ||
| 3 | import jav a.text.Dat eFormat; | |
| 4 | import jav a.text.Sim pleDateFor mat; | |
| 5 | import jav a.util.Dat e; | |
| 6 | import jav a.util.Loc ale; | |
| 7 | ||
| 8 | import gov .va.med.fw .model.loo kup.Lookup ; | |
| 9 | ||
| 10 | /** | |
| 11 | * In a sc heduled re port, thes e type rep resent the various o ptions app licable to | |
| 12 | * the "Fr om Date" a nd "To Dat e" of the report dat a range. | |
| 13 | * | |
| 14 | * @author DNS | |
| 15 | */ | |
| 16 | public enu m DateRang eBoundaryT ype implem ents Looku p { | |
| 17 | CU RRENT_DAY( new Requir edMethods( ) { | |
| 18 | publ ic Date ca lculateDat e(Date sta rtDate, Da teRangeBou ndary drb) { | |
| 19 | return startDate ; | |
| 20 | } | |
| 21 | ||
| 22 | publ ic String getFriendl yDescripti on(DateRan geBoundary dateRange Boundary) { | |
| 23 | return "The curr ent day"; | |
| 24 | } | |
| 25 | }) , | |
| 26 | /* For examp le, "Janua ry 19, 201 0" */ | |
| 27 | SP ECIFIC_FIX ED_DATE(ne w Required Methods() { | |
| 28 | publ ic Date ca lculateDat e(Date sta rtDate, Da teRangeBou ndary drb) { | |
| 29 | return drb.getSp ecificFixe dDate(); | |
| 30 | } | |
| 31 | ||
| 32 | publ ic String getFriendl yDescripti on(DateRan geBoundary dateRange Boundary) { | |
| 33 | DateFo rmat df = SimpleDate Format.get DateInstan ce(DateFor mat.MEDIUM , Locale.U S); | |
| 34 | return df.format (dateRange Boundary.g etSpecific FixedDate( )); | |
| 35 | } | |
| 36 | }) , | |
| 37 | /* For examp le, "Exact ly 2 Weeks prior to current da y" */ | |
| 38 | EX ACT_UNITS_ PRIOR_TO_C URRENT_DAY (new Requi redMethods () { | |
| 39 | publ ic Date ca lculateDat e(Date sta rtDate, Da teRangeBou ndary drb) { | |
| 40 | return drb.getUn itPriorToC urrentDay( ).calculat eRelativeD ate(startD ate, | |
| 41 | drb.getNum UnitsPrior ToCurrentD ay() * -1) ; | |
| 42 | } | |
| 43 | ||
| 44 | publ ic String getFriendl yDescripti on(DateRan geBoundary drb) { | |
| 45 | Intege r numUnits PriorToCur rentDay = drb.getNum UnitsPrior ToCurrentD ay(); | |
| 46 | Simple TimeUnitTy pe unitPri orToCurren tDay = drb .getUnitPr iorToCurre ntDay(); | |
| 47 | return "Exactly " + numUni tsPriorToC urrentDay + " " | |
| 48 | + unitPrio rToCurrent Day.getNam e().toLowe rCase() | |
| 49 | + (numUnit sPriorToCu rrentDay ! = 1 ? "s" : "") + " prior to t he current day"; | |
| 50 | } | |
| 51 | }) , | |
| 52 | /* For examp le, "Secon d of Previ ous Month" */ | |
| 53 | FI XED_DAY_OF _PREVIOUS_ OR_CURRENT _UNIT(new RequiredMe thods() { | |
| 54 | publ ic Date ca lculateDat e(Date sta rtDate, Da teRangeBou ndary drb) { | |
| 55 | return drb.getMu ltiDayTime UnitType() .calculate Date(start Date, drb. getFixedDa teType(), | |
| 56 | drb.getUse PreviousDa tePeriod() ); | |
| 57 | } | |
| 58 | ||
| 59 | publ ic String getFriendl yDescripti on(DateRan geBoundary drb) { | |
| 60 | return "The " + drb.getFix edDateType ().getName ().toLower Case() + " of the " | |
| 61 | + (drb.get UsePreviou sDatePerio d() ? "pre vious" : " current") + " " | |
| 62 | + drb.getM ultiDayTim eUnitType( ).getName( ).toLowerC ase(); | |
| 63 | } | |
| 64 | }) ; | |
| 65 | ||
| 66 | pr ivate Requ iredMethod s dateCalc ulator; | |
| 67 | ||
| 68 | pr ivate Date RangeBound aryType(Re quiredMeth ods dateCa lculator) { | |
| 69 | this .dateCalcu lator = da teCalculat or; | |
| 70 | } | |
| 71 | ||
| 72 | pu blic Strin g getName( ) { | |
| 73 | retu rn name(); | |
| 74 | } | |
| 75 | ||
| 76 | pu blic Strin g getCode( ) { | |
| 77 | retu rn name(); | |
| 78 | } | |
| 79 | ||
| 80 | pu blic Strin g getDescr iption() { | |
| 81 | retu rn getName (); | |
| 82 | } | |
| 83 | ||
| 84 | pu blic Strin g getFrien dlyDescrip tion(DateR angeBounda ry dateRan geBoundary ) { | |
| 85 | retu rn dateCal culator.ge tFriendlyD escription (dateRange Boundary); | |
| 86 | } | |
| 87 | ||
| 88 | /* * | |
| 89 | * Returns a new date given a st arting dat e and a se t of param eters | |
| 90 | * describin g how to c hange that date (wit h variable length an d type bas ed | |
| 91 | * on the Da teRangeBou ndaryType used). | |
| 92 | * | |
| 93 | * @param st artDate | |
| 94 | * The star ting date | |
| 95 | * @param pa rams | |
| 96 | * The arra y of param eters as r equired by the type of | |
| 97 | * DateRang eBoundaryT ype used; see each s pecific va lue's | |
| 98 | * requirem ent above. | |
| 99 | * @return T he new cal culated da te | |
| 100 | * / | |
| 101 | pu blic Date calculateD ate(Date s tartDate, DateRangeB oundary dr b) { | |
| 102 | retu rn dateCal culator.ca lculateDat e(startDat e, drb); | |
| 103 | } | |
| 104 | ||
| 105 | pr ivate inte rface Requ iredMethod s { | |
| 106 | Date calculate Date(Date startDate, DateRange Boundary d rb); | |
| 107 | ||
| 108 | Stri ng getFrie ndlyDescri ption(Date RangeBound ary dateRa ngeBoundar y); | |
| 109 | } | |
| 110 | ||
| 111 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.