80 likes | 195 Views
This document explores the integration of traversal strategies within UAV context management using Java Collections Framework. It details the `DJ.Program.class.Frame` implementation, particularly focusing on the `updateAnnotations()` method, which utilizes lazy traversal over complex object structures. The traversal allows modifications while paused, making it suitable for dynamic UAV applications. We discuss the benefits of incorporating complex structures, alternative methods such as traverse, fetch, and gather, and highlight how these strategies can enhance efficiency and adaptability in UAV systems.
E N D
DJ Examplein UAV Context Karl Lieberherr
Frame Structure Frame X1 X2 X3 X4 X5 A X6 X7 B X8 Annotation
Frame Traversal Strategy from Frame through {A,B} to Annotation Frame X1 X2 X3 X4 X5 A X6 X7 B X8 Annotation
Selected Paths from Frame through {A,B} to Annotation Frame X1 X2 X3 X4 X5 A X6 X7 B X8 Annotation
DJ Program class Frame { public updateAnnotations(){ List annotations = Main.cg.asList(this, “from Frame through {A,B} to Annotation”); Iterator it = annotations.iterator(); while (it.hasNext()) { Annotation a = (Annotation) it.next(); // use set on iterator to // replace Annotation object } } }
asList • Adapts a traversal to the Java Collections Framework as a List object. • Lazy traversal. • Crosscutting lists: they cut across an object. • Can go forward and backward and modify object in place.
asList (continued) • Implementation uses a separate Java thread as a coroutine. • Modifications to the object structure while a traversal is paused can be seen when the traversal resumes.
Conclusion • If we add complex object structures to the UAV application the benefits of DJ become apparent. • asList is only one possible method to invoke on a ClassGraph object. • Alternatives: traverse, fetch, gather.