Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27386
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: building "path expressions" |
| Date | Thu, 23 Jan 2014 11:50:34 -0500 |
| Organization | A noiseless patient Spider |
| Lines | 35 |
| Message-ID | <lbrh8u$ogb$1@dont-email.me> (permalink) |
| References | <path-expressions-20140123173039@ram.dialup.fu-berlin.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Date | Thu, 23 Jan 2014 16:50:38 +0000 (UTC) |
| Injection-Info | mx05.eternal-september.org; posting-host="858a9d65d95f4ea4d355bd116aa2cdbf"; logging-data="25099"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ikVH/k2FSpJJJU2MVNVrE" |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
| In-Reply-To | <path-expressions-20140123173039@ram.dialup.fu-berlin.de> |
| Cancel-Lock | sha1:nxbYzzZ+HRtM1QEqcJ9HoaYw50w= |
| Xref | csiph.com comp.lang.java.programmer:27386 |
Show key headers only | View raw
On 1/23/2014 11:37 AM, Stefan Ram wrote:
> When creating an interface for a library, sometimes one wants the user
> to see nesting in a »path expression«, like for example »a.b.c.d.e.f.g.h«
> to convey the idea that h is a part of g, which is a part of f, and so on.
>
> I think it is funny that one can use either package names /or/ nested
> classes /or/ fields to implement such a path, without this choice being
> visible in the »path expression«. For example, one posssibility to
> implement a »path expression« »a.b.c.d.e.f.g.h« might be:
>
> package a.b.c;
> class G { int h = 8; }
> class F { G g = new G(); }
> class d { static class e { static F f = new F(); }}
> public final class Main
> { public static void main( String[] args )
ITYM "java.lang.String[]", also "class a.b.c.G",
"a.b.c.G g = new a.b.c.G();", etc. ;-)
> { java.lang.System.out.println( a.b.c.d.e.f.g.h ); }}
If it seems funny to you, your sense of humor is more
finely developed than mine. :)
Just for the record, note that the "a.b.c" part is
different from the rest. Packages have no hierarchical
relationship, that is, package "a.b.c" is unrelated to
"a.b.x" and even to "a.b". To put it another way, the
path "a.b.c.d.e.f.g.h" has six elements ("a.b.c" and five
more), not eight.
--
Eric Sosman
esosman@comcast-dot-net.invalid
Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread
Re: building "path expressions" Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-01-23 11:50 -0500
csiph-web