O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4 LISTS, MAPS, AND RANGES

In this chapter, we introduce the list, map, and range. All are collections of references to other objects. The List and Map can reference objects of differing types. The Range represents a collection of integer values. The List and Map also grow dynamically. Each object referenced in a List is identified by an integer index. In contrast, a Map collection is indexed by a value of any kind. Because the class of the objects maintained by these collections is arbitrary, the elements of a List might be a Map and the elements of a Map might be a List. In this way, we can create data structures of arbitrary complexity. This is examined in Chapter 6 and in subsequent chapters.

4.1 LISTS

The List is a structure used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required