[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: [RDDL] Java Object Model

  • From: Jonathan Borden <jborden@m...>
  • To: Jeff Rafter <jeffrafter@e...>
  • Date: Mon, 29 Jan 2001 08:43:46 -0500

java list order alphanumeric
Jeff Rafter wrote:
>
> Potentially naive question:

potential not realized :-)

>
> Is the use of a SortedMap (TreeMap in general) simply for listing the keys
> or is there an explicit reason this interface was chosen.  Reading the
> TreeMap JavaDoc it says that it sorts the keys in natural order but can be
> modified with a comparator.   Is "natural order" the order by which the
> items were read into the cahce?  Or are they typically going to
> sorted with
> an order of importance-- one schema type before another?

I've used SortedMap simply to allow selection of resources based on
alphanumberic order. For example suppose:

<div id="foo">
	<rddl:resource ..>
	<rddl:resource ..>
	<rddl:resource ..>
</div>

or alternatively:

<rddl:resource id="bar">
	<rddl:resource ...>
	...
</rddl:resource>

The only meaning of such nesting is how a fragment id for the rddl:resource
is generated i.e.

	foo/1
	foo/2
	foo/3

and
	bar
	bar/1
	bar/2 etc.

(these are xpointers / child seq's according to XPointer)

this allows the simple idiom for obtaining the 'members of a collection'

	getResourcesFromIdRange("foo/0","foo/A");

that's just an implementation detail. It is not normative to RDDL. It has to
do with how an XPointer is generated to any node in any XML document. I'm
simply using XPointer to create collections.

>
> I am looking to implement the API in another language and am trying to
> figure out what type of List I should return as I don't have a SortedMap
> class.

	If the list inserts elements in alphanumeric order such an accessor is easy
to write. It just turns out that a Red-Black tree is the most efficient
mechanism I know to do this -- a pure hash map is great for key accession
but not good at range of key accession.

>
> Sorry if this message proves flammable... <grin/>
>

Not at all. This is all for the purpose of discussion.

-Jonathan


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.