864 }
865
866 protected HierContextEnumerator(Context context, int scope,
867 String contextName, boolean returnSelf) throws NamingException {
868 super(context, scope, contextName, returnSelf);
869 }
870
871 protected NamingEnumeration<Binding> getImmediateChildren(Context ctx)
872 throws NamingException {
873 return ((HierMemDirCtx)ctx).doListBindings(false);
874 }
875
876 protected ContextEnumerator newEnumerator(Context ctx, int scope,
877 String contextName, boolean returnSelf) throws NamingException {
878 return new HierContextEnumerator(ctx, scope, contextName,
879 returnSelf);
880 }
881 }
882 }
883
884 // CompundNames's HashCode() method isn't good enough for many string.
885 // The only prupose of this subclass is to have a more discerning
886 // hash function. We'll make up for the performance hit by caching
887 // the hash value.
888
889 final class HierarchicalName extends CompoundName {
890 private int hashValue = -1;
891
892 // Creates an empty name
893 HierarchicalName() {
894 super(new Enumeration<String>() {
895 public boolean hasMoreElements() {return false;}
896 public String nextElement() {throw new NoSuchElementException();}
897 },
898 HierarchicalNameParser.mySyntax);
899 }
900
901 HierarchicalName(Enumeration<String> comps, Properties syntax) {
902 super(comps, syntax);
903 }
904
905 HierarchicalName(String n, Properties syntax) throws InvalidNameException {
|
864 }
865
866 protected HierContextEnumerator(Context context, int scope,
867 String contextName, boolean returnSelf) throws NamingException {
868 super(context, scope, contextName, returnSelf);
869 }
870
871 protected NamingEnumeration<Binding> getImmediateChildren(Context ctx)
872 throws NamingException {
873 return ((HierMemDirCtx)ctx).doListBindings(false);
874 }
875
876 protected ContextEnumerator newEnumerator(Context ctx, int scope,
877 String contextName, boolean returnSelf) throws NamingException {
878 return new HierContextEnumerator(ctx, scope, contextName,
879 returnSelf);
880 }
881 }
882 }
883
884 // CompoundNames's HashCode() method isn't good enough for many string.
885 // The only purpose of this subclass is to have a more discerning
886 // hash function. We'll make up for the performance hit by caching
887 // the hash value.
888
889 final class HierarchicalName extends CompoundName {
890 private int hashValue = -1;
891
892 // Creates an empty name
893 HierarchicalName() {
894 super(new Enumeration<String>() {
895 public boolean hasMoreElements() {return false;}
896 public String nextElement() {throw new NoSuchElementException();}
897 },
898 HierarchicalNameParser.mySyntax);
899 }
900
901 HierarchicalName(Enumeration<String> comps, Properties syntax) {
902 super(comps, syntax);
903 }
904
905 HierarchicalName(String n, Properties syntax) throws InvalidNameException {
|