Tuesday 15 March 2011

Java data overlap operation algorithm -


I am having trouble creating an algorithm for a particular task.

Say a map is - Maps & lt; Object, set & lt; String & gt; & Gt; . Each key represents the definition of specific car components.

Come, these values ​​are brought into the map:

 wheels = ["18", "16", "17", "19" .]; BodyColor = ["Green", "White", "Blue", ...]; Horsepower = ["100", "130", "145", "160" ...]; fuel type = ["gas" = "[" 2 "," 3 "," 4 "," 5 "]; "," Electric "," Diesel "," Fuel "] ... ... etc. (Keep the key values ​​added) 

These are all set-courses problem: Let's say we have this POJO: Public class CarProfile {Private string wheels; Private string bodyroller; Private string door; Private strings horse power; Private set gt; ;

Suppose the system has a population list & lt; Arpropile & gt; and it needs to be checked that the map is included in all possible possible relationships. Note that some fields can have a single value, while others may have their set or lists. I am struggling to find suitable solutions, is there any such general algorithm I am unable to find?

Thanks.

for a loop

  (int wheel: map.get S): {String bodyColor: map.get (bodyColor)} {for (string door number: get map (doorCount)) {list.add (new carprofile (wheel, bodycar, door coat, etc.) .)); }}   

}


No comments:

Post a Comment