src/share/classes/com/sun/jndi/toolkit/dir/LazySearchEnumerationImpl.java

Print this page




  52     private NamingEnumeration<Binding> candidates;
  53     private SearchResult nextMatch = null;
  54     private SearchControls cons;
  55     private AttrFilter filter;
  56     private Context context;
  57     private Hashtable<String, Object> env;
  58     private boolean useFactory = true;
  59 
  60     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  61         AttrFilter filter, SearchControls cons) throws NamingException {
  62             this.candidates = candidates;
  63             this.filter = filter;
  64 
  65             if(cons == null) {
  66                 this.cons = new SearchControls();
  67             } else {
  68                 this.cons = cons;
  69             }
  70     }
  71 

  72     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  73         AttrFilter filter, SearchControls cons,
  74         Context ctx, Hashtable<String, Object> env, boolean useFactory)
  75         throws NamingException {
  76 
  77             this.candidates = candidates;
  78             this.filter = filter;
  79             this.env = env;

  80             this.context = ctx;
  81             this.useFactory = useFactory;
  82 
  83             if(cons == null) {
  84                 this.cons = new SearchControls();
  85             } else {
  86                 this.cons = cons;
  87             }
  88     }
  89 
  90 
  91     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  92         AttrFilter filter, SearchControls cons,
  93         Context ctx, Hashtable<String, Object> env) throws NamingException {
  94             this(candidates, filter, cons, ctx, env, true);
  95     }
  96 
  97     public boolean hasMore() throws NamingException {
  98         // find and do not remove from list
  99         return findNextMatch(false) != null;




  52     private NamingEnumeration<Binding> candidates;
  53     private SearchResult nextMatch = null;
  54     private SearchControls cons;
  55     private AttrFilter filter;
  56     private Context context;
  57     private Hashtable<String, Object> env;
  58     private boolean useFactory = true;
  59 
  60     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  61         AttrFilter filter, SearchControls cons) throws NamingException {
  62             this.candidates = candidates;
  63             this.filter = filter;
  64 
  65             if(cons == null) {
  66                 this.cons = new SearchControls();
  67             } else {
  68                 this.cons = cons;
  69             }
  70     }
  71 
  72     @SuppressWarnings("unchecked")      // For Hashtable clone: env.clone()
  73     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  74         AttrFilter filter, SearchControls cons,
  75         Context ctx, Hashtable<String, Object> env, boolean useFactory)
  76         throws NamingException {
  77 
  78             this.candidates = candidates;
  79             this.filter = filter;
  80             this.env = (Hashtable<String, Object>)
  81                     ((env == null) ? null : env.clone());
  82             this.context = ctx;
  83             this.useFactory = useFactory;
  84 
  85             if(cons == null) {
  86                 this.cons = new SearchControls();
  87             } else {
  88                 this.cons = cons;
  89             }
  90     }
  91 
  92 
  93     public LazySearchEnumerationImpl(NamingEnumeration<Binding> candidates,
  94         AttrFilter filter, SearchControls cons,
  95         Context ctx, Hashtable<String, Object> env) throws NamingException {
  96             this(candidates, filter, cons, ctx, env, true);
  97     }
  98 
  99     public boolean hasMore() throws NamingException {
 100         // find and do not remove from list
 101         return findNextMatch(false) != null;