August 2012
Intermediate to advanced
976 pages
30h 17m
English
As a final example of inheritance, we’ll extend our text-query application from §12.3 (p. 484). The classes we wrote in that section let us look for occurrences of a given word in a file. We’d like to extend the system to support more complicated queries. In our examples, we’ll run queries against the following simple story:
Alice Emma has long flowing red hair.Her Daddy says when the wind blowsthrough her hair, it looks almost alive,like a fiery bird in flight.A beautiful fiery bird, he tells her,magical but untamed."Daddy, shush, there is no such thing,"she tells him, at the same time wantinghim to tell her more.Shyly, she asks, "I mean, Daddy, is there?"
Our system should support the following queries:
• Word ...
Read now
Unlock full access