aspose file tools*
The moose likes Java in General and the fly likes n-dimensioned array in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "n-dimensioned array in Java" Watch "n-dimensioned array in Java" New topic
Author

n-dimensioned array in Java

Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
How, in general, does one write a Vector of Vectors in Java - along with the more general Vector of Vectors of Vectors ....

Sounds recursive, that may be the correct approach. Note - I realize this can easily hog resources and should be corralled to some extent.

In general and simplified terminology, I am working on combinatorics which will work all permutations of Set <-> Set hoping to implement a robust algorithm which will exhibit resiliency under unforseen loading in the hands of uninformed operators.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18715
    
  40

How, in general, does one write a Vector of Vectors in Java - along with the more general Vector of Vectors of Vectors ....


It's actually pretty straightforward...



Now... If you want to declare a vector that can hold any dimension, then you must not use generics, and use the instanceof operator to process each dimension.



Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
You may want to check out hpjava.org.


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
[Henry]: Now... If you want to declare a vector that can hold any dimension, then you must not use generics, and use the instanceof operator to process each dimension.

More generally, you may want to check out the composite pattern.


"I'm not back." - Bill Harding, Twister
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Okay, here is what I have so far. This is a precipitous edge work and I keep coming back to the fact that at any point, the dynamic size of the dispatch can be reduced to a dataSet and an algorithm. I am beginning to think I should focus my thoughts on making one efficient or I know it will work searching algorithm and one dataset type and just simplifiy to a grow and shrink metaphor that relies on the irreducible that at any dispatch point, there will be unknown sized dataset, one Collection to search for elements in the dataset and one algorithm to use to search for elements in the sample.

if(algorithm.find(term,dataset);

Here is what I have at the moment, I am in a spin and solicit views.



The code compiles.
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
The HPJava syntax for multiarrays is actually where I wanted to go with this, but in that I do not stand to gain by transitioning to another linguistic over the weekend, I can use the above syntax and am here at the moment on the basis that I have decided to use HashSet of HashSet to collect some data -- I need the scattering that hashing brings with it. Hashtable would probably do but what I am thinking as I try to avoid some self-referentials is:



If this gets me a hash set of hash sets of strings, then I could concievably pass:

I better quit thinking right there, I need to be able to call suppliedSet.next() and have strings without needing to call shuffle() on the set. The chaotic retireval is wanted to achieve handling by repetitive views without being forced to look at the entire dataset.

I.O.W. - sampling, as described in statistics.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: n-dimensioned array in Java