Produced by Araxis Merge on 12/5/2017 12:06:51 PM Central Standard 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 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCacheWebApp\main\src\gov\va\med\imaging\cache | GroupVO.java | Mon Dec 4 21:34:28 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\VixCacheWebApp\main\src\gov\va\med\imaging\cache | GroupVO.java | Mon Dec 4 22:07:18 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 316 |
| 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 | /** | |
| 2 | * | |
| 3 | */ | |
| 4 | package go v.va.med.i maging.cac he; | |
| 5 | ||
| 6 | import jav a.io.Seria lizable; | |
| 7 | import jav a.util.Arr ayList; | |
| 8 | import jav a.util.Col lection; | |
| 9 | import jav a.util.Col lections; | |
| 10 | import jav a.util.Has hSet; | |
| 11 | import jav a.util.Ite rator; | |
| 12 | import jav a.util.Lis t; | |
| 13 | import jav a.util.Set ; | |
| 14 | import jav a.util.Sor tedSet; | |
| 15 | import jav a.util.Tre eSet; | |
| 16 | ||
| 17 | /** | |
| 18 | * @author
|
|
| 19 | * | |
| 20 | */ | |
| 21 | public cla ss GroupVO | |
| 22 | extends Ab stractGrou pParent | |
| 23 | implements Serializa ble | |
| 24 | { | |
| 25 | pr ivate stat ic final l ong serialVers ionUID = 1L; | |
| 26 | Se t<Instance VO> instan ces = new HashSet<In stanceVO>( ); | |
| 27 | pr ivate CACH E_POPULATI ON_DEPTH d epth; | |
| 28 | pr ivate Stri ng semanti cTypeName; | |
| 29 | pr ivate Cach eGroupMeta data metad ata = null ; | |
| 30 | pr ivate Cach eItemPath path = nul l; | |
| 31 | ||
| 32 | pu blic Group VO(){} | |
| 33 | ||
| 34 | pu blic Group VO(String name, Cach eGroupMeta data metad ata, CACHE _POPULATIO N_DEPTH de pth, Strin g semantic TypeName) | |
| 35 | { | |
| 36 | supe r(name); | |
| 37 | this .metadata = metadata ; | |
| 38 | this .semanticT ypeName = semanticTy peName; | |
| 39 | this .depth = d epth; | |
| 40 | } | |
| 41 | ||
| 42 | pu blic Group VO(String name, Cach eGroupMeta data metad ata, CACHE _POPULATIO N_DEPTH de pth, Strin g semantic TypeName, CacheItemP ath path) | |
| 43 | { | |
| 44 | supe r(name); | |
| 45 | this .metadata = metadata ; | |
| 46 | this .semanticT ypeName = semanticTy peName; | |
| 47 | this .depth = d epth; | |
| 48 | this .path = pa th; | |
| 49 | } | |
| 50 | ||
| 51 | pu blic Cache GroupMetad ata getMet adata() { | |
| 52 | retu rn metadat a; | |
| 53 | } | |
| 54 | ||
| 55 | pu blic void setMetadat a(CacheGro upMetadata metadata) { | |
| 56 | this .metadata = metadata ; | |
| 57 | } | |
| 58 | ||
| 59 | /* * | |
| 60 | * Indicates a semanti c to be ap plied to t his group, the speci fics are d ependent o n the | |
| 61 | * individua l caches, the UI wil l use this as a CSS style name . | |
| 62 | * @return | |
| 63 | * / | |
| 64 | pu blic Strin g getSeman ticTypeNam e() {retur n semantic TypeName;} | |
| 65 | pu blic void setSemanti cTypeName( String sem anticTypeN ame) {this .semanticT ypeName = semanticTy peName;} | |
| 66 | ||
| 67 | pu blic boole an addInst ance(Insta nceVO inst ance){retu rn instanc es.add(ins tance);} | |
| 68 | pu blic boole an addAllI nstance(Co llection<I nstanceVO> instanceC ollection) {return in stances.ad dAll(insta nceCollect ion);} | |
| 69 | ||
| 70 | pu blic boole an removeI nstance(In stanceVO i nstance){r eturn inst ances.remo ve(instanc e);} | |
| 71 | pu blic boole an removeA llInstance (Collectio n<Instance VO> instan ceCollecti on){return instances .removeAll (instanceC ollection) ;} | |
| 72 | ||
| 73 | pu blic Itera tor<Instan ceVO> iter atorInstan ce(){retur n instance s.iterator ();} | |
| 74 | ||
| 75 | pu blic int g etInstance Count(){re turn this. instances. size();} | |
| 76 | ||
| 77 | pu blic List< InstanceVO > getInsta nces() | |
| 78 | { | |
| 79 | retu rn Collect ions.unmod ifiableLis t( new Arr ayList<Ins tanceVO>(t his.instan ces) ); | |
| 80 | } | |
| 81 | ||
| 82 | pu blic CACHE _POPULATIO N_DEPTH ge tDepth() | |
| 83 | { | |
| 84 | retu rn depth; | |
| 85 | } | |
| 86 | pu blic void setDepth(C ACHE_POPUL ATION_DEPT H depth) | |
| 87 | { | |
| 88 | this .depth = d epth; | |
| 89 | } | |
| 90 | @O verride | |
| 91 | pu blic int g etChildCou nt(){retur n getInsta nceCount() + getGrou pCount();} | |
| 92 | ||
| 93 | @O verride | |
| 94 | pu blic void merge(Abst ractNamedV O other) | |
| 95 | th rows Merge Exception | |
| 96 | { | |
| 97 | if(o ther insta nceof Grou pVO) | |
| 98 | { | |
| 99 | super. merge(othe r); | |
| 100 | if(thi s.getMetad ata() == n ull && ((G roupVO)oth er).getMet adata() != null) | |
| 101 | this.set Metadata( ((GroupVO) other).get Metadata() ); | |
| 102 | ||
| 103 | mergeC ollections (this, thi s.instance s, ((Group VO)other). instances) ; | |
| 104 | // ret ain the or iginal dep th | |
| 105 | } | |
| 106 | else | |
| 107 | throw new MergeE xception(" GroupVO is unable to merge wit h '" + oth er.toStrin g() + "'." ); | |
| 108 | ||
| 109 | } | |
| 110 | ||
| 111 | @O verride | |
| 112 | pu blic Cache ItemPath g etPath() | |
| 113 | { | |
| 114 | if ( path != nu ll) | |
| 115 | return path; | |
| 116 | else if( getPa rent() != null ) | |
| 117 | { | |
| 118 | CacheI temPath pa rentPath = getParent ().getPath (); | |
| 119 | path = parentPat h.createCh ildPath(th is.getName (), false) ; | |
| 120 | return path; | |
| 121 | } | |
| 122 | else | |
| 123 | { | |
| 124 | logger .error( "G roupVO.get Parent() r eturns nul l." ); | |
| 125 | return null; | |
| 126 | } | |
| 127 | } | |
| 128 | ||
| 129 | @O verride | |
| 130 | pu blic Abstr actNamedVO childWith Name(Strin g name) | |
| 131 | { | |
| 132 | Abst ractNamedV O child = this.searc hChildColl ection(get Groups(), name); | |
| 133 | retu rn child = = null ? | |
| 134 | this.s earchChild Collection (getInstan ces(), nam e) : | |
| 135 | child; | |
| 136 | } | |
| 137 | ||
| 138 | @O verride | |
| 139 | pu blic Sorte dSet<Abstr actNamedVO > getChild ren() | |
| 140 | { | |
| 141 | Sort edSet<Abst ractNamedV O> childre n = new Tr eeSet<Abst ractNamedV O>(); | |
| 142 | chil dren.addAl l( getGrou ps() ); | |
| 143 | chil dren.addAl l( getInst ances() ); | |
| 144 | ||
| 145 | retu rn childre n; | |
| 146 | } | |
| 147 | ||
| 148 | @O verride | |
| 149 | pu blic boole an removeC hild(Abstr actNamedVO child) | |
| 150 | { | |
| 151 | if(c hild insta nceof Inst anceVO) | |
| 152 | return removeIns tance((Ins tanceVO)ch ild); | |
| 153 | else if(child instanceof GroupVO) | |
| 154 | return remove((G roupVO)chi ld); | |
| 155 | else | |
| 156 | return false; | |
| 157 | } | |
| 158 | ||
| 159 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.