concept slice in category java

appears as: slice, slices, slice
JavaFX in Action

This is an excerpt from Manning's book JavaFX in Action.

Listing 2.23. Sequence declaration using a slice

2.5.3. Sequence creation using slices ( [..<] )

The range syntax can be useful in many circumstances, but it’s not the only trick JavaFX Script has up its sleeve. For situations that demand more control, we can also take a slice from an existing sequence to create a new one, as listing 2.23 shows.

Listing 2.23. Sequence declaration using a slice

Here the double-dot syntax creates a slice of an existing sequence, source. The numbers defining the slice are element indexes, so in the case of slice1 the range [0..10] refers to the first 11 elements in source, resulting in the values 0 to 10.

Sequence creation using slices ( [..<] )

We can create a sequence range using a slice of indexes from another sequence. Here the .. syntax includes the end index in the range, while ..< excludes the end index.