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