1 32 33 package com.jeantessier.classreader; 34 35 import java.util.*; 36 37 public abstract class CollectorBase extends VisitorBase implements Collector { 38 private Collection collection; 39 40 public CollectorBase() { 41 this(new TreeSet()); 42 } 43 44 public CollectorBase(Collection collection) { 45 this.collection = collection; 46 } 47 48 protected void add(Object obj) { 49 collection.add(obj); 50 } 51 52 protected void remove(Object obj) { 53 collection.remove(obj); 54 } 55 56 public Collection getCollection() { 57 return collection; 58 } 59 } 60 | Popular Tags |