[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-xml] ValidationConsumer Question...

From: David Brownell
Subject: Re: [Classpathx-xml] ValidationConsumer Question...
Date: Mon, 04 Mar 2002 17:28:06 -0800

Hi Jeff,

> I am working on a port of the ValidationConsumer to Pascal. Unfortunately
> Pascal does not have a cloneable interface. I am trying to understand the
> difference between the shallow and deep clone (used in the
> ChildrenRecognizer). My assumption is that the clone() method (used in
> shallow clone) will create an object that has the same values for:
>  consumer
>  components
>  name
>  next
>  flags

Yes.  If you think of the object as a C "struct", shallow clone is just
a memcpy of the struct contents.  It's what C++ would do by default.

Note that "same value" for an object pointer means the pointer is
copied ... a "deep" clone would clone the object too.

> The need for deepClone only occurs when the consumer needs to deep clone the
> components and possible the next recognizer. deepClone makes sense, it is
> more a question of what clone() will accomplish so that I can mimic it.

I'm not 100% satisfied with that ChildrenRecognizer state
machine, FWIW, but it seems to pass any test I've thrown at
it.  Validation of the other types of content models is clearly
correct, but that one's a bit hairy ... :)

- Dave

reply via email to

[Prev in Thread] Current Thread [Next in Thread]