TemplateCollectionModelEx (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, interface: TemplateCollectionModelEx

Package freemarker.template

# Interface TemplateCollectionModelEx

All Superinterfaces:
  `TemplateCollectionModel`, `TemplateModel`

All Known Implementing Classes:
  `DefaultNonListCollectionAdapter`

public interface TemplateCollectionModelEx extends TemplateCollectionModel
"collection" template language data type: Adds size/emptiness querybility to `TemplateCollectionModel`. The added extra operations are provided by all Java `Collection`-s, and this interface was added to make that accessible for templates too.

Since:
  2.3.22

- ## Field Summary

  ### Fields inherited from interface freemarker.template.TemplateModel

  `NOTHING`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isEmpty()`
  Returns if the collection contains any elements.
  `int`
  `size()`
  Returns the number items in this collection, or `Integer.MAX_VALUE`, if there are more than `Integer.MAX_VALUE` items.

  ### Methods inherited from interface freemarker.template.TemplateCollectionModel

  `iterator`

- ## Method Details

  - ### size

    int size() throws TemplateModelException
    Returns the number items in this collection, or `Integer.MAX_VALUE`, if there are more than `Integer.MAX_VALUE` items.
    Throws:
      `TemplateModelException`

  - ### isEmpty

    boolean isEmpty() throws TemplateModelException
    Returns if the collection contains any elements. This differs from `size() != 0` only in that the exact number of items need not be calculated.
    Throws:
      `TemplateModelException`