com.mapinfo.midev.data

## Class LegendMetadata

- java.lang.Object
- - com.mapinfo.midev.data.LegendMetadata

All Implemented Interfaces:
  Iterable, Collection

    public final class LegendMetadata
    extends Object
    implements Collection

Metadata that can be used to generate a legend. `LegendMetadata` is composed of 0 or more `LegendAggregates`. A `LegendAggregate` is an aggregation of unique style and geometry type. Basically, a `LegendMetadata` is represented by the results of executing the following pseudo SQL:

       SELECT COUNT(*), styleColumn, Obj.geometryType, descriptionColumn from XX GROUP BY styleColumn, Obj.geometryType, descriptionColumn

A `LegendAggregate` is one row of the result set.

### Constructor Summary

Constructors
Constructor and Description
`LegendMetadata(Collection aggregates)` Creates a `LegendMetadata` from the specified `Collection<LegendAggregate>`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(LegendAggregate legendAggregate)`
`boolean` `addAll(Collection c)`
`void` `clear()`
`boolean` `contains(Object o)`
`boolean` `containsAll(Collection c)`
`boolean` `equals(Object o)`
`LegendAggregate` `getPredominant()` Returns the LegendAggregate with the largest count.
`int` `hashCode()`
`boolean` `isEmpty()`
`Iterator` `iterator()`
`boolean` `remove(Object o)`
`boolean` `removeAll(Collection c)`
`boolean` `retainAll(Collection c)`
`int` `size()`
`Object[]` `toArray()`
`Object[]` `toArray(Object[] a)`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Collection

`parallelStream, removeIf, spliterator, stream`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Constructor Detail

#### LegendMetadata

    public LegendMetadata(Collection aggregates)

Creates a `LegendMetadata` from the specified `Collection<LegendAggregate>`.

Parameters:
  `aggregates` - The LegendAggregates to create the LegendMetadata from.

### Method Detail

#### getPredominant

    public LegendAggregate getPredominant()

Returns the LegendAggregate with the largest count.

Returns:
  the LegendAggregate with the largest count.
See Also:
  `LegendAggregate.getCount()`

#### size

    public int size()

Specified by:
  `size` in interface `Collection`

#### isEmpty

    public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Collection`

#### contains

    public boolean contains(Object o)

Specified by:
  `contains` in interface `Collection`

#### iterator

    public Iterator iterator()

Specified by:
  `iterator` in interface `Iterable`
Specified by:
  `iterator` in interface `Collection`

#### toArray

    public Object[] toArray()

Specified by:
  `toArray` in interface `Collection`

#### toArray

    public Object[] toArray(Object[] a)

Specified by:
  `toArray` in interface `Collection`

#### add

    public boolean add(LegendAggregate legendAggregate)

Specified by:
  `add` in interface `Collection`

#### remove

    public boolean remove(Object o)

Specified by:
  `remove` in interface `Collection`

#### containsAll

    public boolean containsAll(Collection c)

Specified by:
  `containsAll` in interface `Collection`

#### addAll

    public boolean addAll(Collection c)

Specified by:
  `addAll` in interface `Collection`

#### removeAll

    public boolean removeAll(Collection c)

Specified by:
  `removeAll` in interface `Collection`

#### retainAll

    public boolean retainAll(Collection c)

Specified by:
  `retainAll` in interface `Collection`

#### clear

    public void clear()

Specified by:
  `clear` in interface `Collection`

#### equals

    public boolean equals(Object o)

Specified by:
  `equals` in interface `Collection`
Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Specified by:
  `hashCode` in interface `Collection`
Overrides:
  `hashCode` in class `Object`