1 32 33 package com.jeantessier.diff; 34 35 import java.util.*; 36 37 import org.apache.log4j.*; 38 39 import com.jeantessier.classreader.*; 40 import com.jeantessier.dependency.*; 41 42 45 public class PackageDifferences extends RemovableDifferences { 46 private Collection classDifferences = new LinkedList(); 47 48 51 PackageDifferences(String name, PackageNode oldPackage, PackageNode newPackage) { 52 super(name); 53 54 if (oldPackage != null) { 55 setOldDeclaration(oldPackage.getName()); 56 } 57 58 if (newPackage != null) { 59 setNewDeclaration(newPackage.getName()); 60 } 61 62 if (isModified()) { 63 Logger.getLogger(getClass()).debug(getName() + " declaration has been modified."); 64 } else { 65 Logger.getLogger(getClass()).debug(getName() + " declaration has not been modified."); 66 } 67 } 68 69 public Collection getClassDifferences() { 70 return classDifferences; 71 } 72 73 public boolean isModified() { 74 return super.isModified() || (getClassDifferences().size() != 0); 75 } 76 77 public void accept(Visitor visitor) { 78 visitor.visitPackageDifferences(this); 79 } 80 } 81 | Popular Tags |