[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnu.xml.dom.DomText implements Text and NodeList.
From: |
Pedro Izecksohn |
Subject: |
Re: gnu.xml.dom.DomText implements Text and NodeList. |
Date: |
Tue, 10 Jan 2006 22:13:40 -0400 |
User-agent: |
KMail/1.7.2 |
Em Ter 10 Jan 2006 04:50, Chris Burdess escreveu:
>I would prefer:
>final class EmptyNodeList implements NodeList
>{
> static final EmptyNodeList instance = new EmptyNodeList();
> public final int getLength() {return 0;}
> public final Node item(int index) {return null;}
>}
>That way:
>1. you avoid the unnecessary overhead of a method call (getInstance).
OK.
>2. that which has no need to be public is not public.
Now I understood: If some user application uses gnu.xml.dom.EmptyNodeList, it
loses portability, so it should not be public.
And as it was verified that only DomCharacterData needs to be modified, it
could even be a static inner class, as proposed by Mark Wielaard.