You can create a recursive function,
public void loopThrough(List<Region> regions) {
for(Region region : regions) {
if(region.hasSubRegion()) {
loopThrough(region.getSubRegions());
}
}
}
More Related Contents:
- get Index of last Element in list without using lastIndexOf() or any other Java/String- Methods [closed]
- Intersection and union of ArrayLists in Java
- Why am I not getting a java.util.ConcurrentModificationException in this example?
- How to convert List to Map?
- What is the difference between Set and List?
- How to print out all the elements of a List in Java?
- What is the difference between List and ArrayList? [duplicate]
- How can I access a folder inside of a resource folder from inside my jar File?
- How to initialize List object in Java?
- Working with a List of Lists in Java
- How to pick an item by its probability?
- Get unique values from ArrayList in Java
- Modifier static is only allowed in constant variable declarations
- List
- How to have Java method return generic list of any type?
- Is there a no-duplicate List implementation out there?
- how to get list of Databases “Schema” names of MySql using java JDBC
- What is the difference between List.of and Arrays.asList?
- Convert Iterator to List
- Removing Duplicate Values from ArrayList
- How to convert list data into json in java
- Arrays.asList(int[]) not working [duplicate]
- Component for filtering a list
- Check if one list contains element from the other
- How to generate the power-set of a given List?
- How to transform List to another List [duplicate]
- std::vector to java.util.Vector code generation with swig
- What’s the difference between unbounded wildcard type List and raw type List?
- Performance and Memory allocation comparison between List and Set
- Converting an int array to a String array