public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
public static class Answer { public IType type; AccessRestriction restriction; Answer(IType type, AccessRestriction restriction) { this.type = type; this.restriction = restriction; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }
private class Selector implements IJavaElementRequestor { public List<IPackageFragment> pkgFragments; public Selector(String moduleName) { this.pkgFragments = new ArrayList<>(); } @Override public void acceptField(IField field) { // do nothing } @Override public void acceptInitializer(IInitializer initializer) { // do nothing } @Override public void acceptMemberType(IType type) { // do nothing } @Override public void acceptMethod(IMethod method) { // do nothing } @Override public void acceptPackageFragment(IPackageFragment packageFragment) { this.pkgFragments.add(packageFragment);
private class Selector implements IJavaElementRequestor { public List<IPackageFragment> pkgFragments; public Selector(String moduleName) { this.pkgFragments = new ArrayList<>(); } @Override public void acceptField(IField field) { // do nothing } @Override public void acceptInitializer(IInitializer initializer) { // do nothing } @Override public void acceptMemberType(IType type) { // do nothing } @Override public void acceptMethod(IMethod method) { // do nothing } @Override public void acceptPackageFragment(IPackageFragment packageFragment) { this.pkgFragments.add(packageFragment);
public static class Answer { public IType type; AccessRestriction restriction; IClasspathEntry entry; Answer(IType type, AccessRestriction restriction, IClasspathEntry entry) { this.type = type; this.restriction = restriction; this.entry = entry; } public boolean ignoreIfBetter() { return this.restriction != null && this.restriction.ignoreIfBetter(); } /* * Returns whether this answer is better than the other awswer. * (accessible is better than discouraged, which is better than * non-accessible) */ public boolean isBetter(Answer otherAnswer) { if (otherAnswer == null) return true; if (this.restriction == null) return true; return otherAnswer.restriction != null && this.restriction.getProblemId() < otherAnswer.restriction.getProblemId(); } }