since the path will be unique for each object it could serve as the key in a 
hash. 

mapPathToObj[obj1.path] = obj


only works for exact matches tho, if you are looking for substrings then you 
will need to iterate over the nodes.




________________________________
From: Dan Vega <[email protected]>
To: [email protected]
Sent: Monday, December 29, 2008 2:05:19 PM
Subject: [flexcoders] Searching Multi Demensional arrays


I have an infinite number of  objects & child objects that looks something like 
this below. I know this if it was just one level I could probably accomplish 
what i need but I am not sure how to do this. All of the "path" items are 
always going to be unique. Is there a way to search (drilling down as far as 
needed) and say give me the object where path = "xyz";


(Array)#0
  [0] (Object)#1
    children = (Array)#2
      [0] (Object)#3
        children = (Array)#4
        lastModified = 1230587039867
        name = "aaaa"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ aaaa"
      [1] (Object)#5
        lastModified = 1230580833728
        name = "another_one"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ another_one"
      [2] (Object)#6
        children = (Array)#7
        lastModified = 1230587312776
        name = "dan"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ dan"
      [3] (Object)#8
        lastModified = 1230581177910
        name = "ggg"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ ggg"
      [4] (Object)#9
        lastModified = 1230581240020
        name = "hjkl"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ hjkl"
      [5] (Object)#10
        lastModified = 1230580116200
        name = "lllll"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ lllll"
      [6] (Object)#11
        lastModified = 1230575547578
        name = "nnnnnnn"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ nnnnnnn"
      [7] (Object)#12
        lastModified = 1230575859098
        name = "test"
        parent = "C:\Program Files\Apache Software Foundation\Apache2. 
2\htdocs\ FFManager\ src\data"
        path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data\ test"
    mx_internal_ uid = "B8E4886E-A00D- 6D89-CBAA- 84C60F791112"
    name = "Home"
    path = "C:\Program Files\Apache Software Foundation\Apache2. 2\htdocs\ 
FFManager\ src\data"

Thank You
Dan Vega
danv...@gmail. com
http://www.danvega. org
    

Reply via email to