com.mapinfo.midev.language.filter

## Class SelectList

- java.lang.Object
- - com.mapinfo.midev.language.filter.SelectList

All Implemented Interfaces:
  Iterable

    public final class SelectList
    extends Object
    implements Iterable

Represents the list of attributes to return in a SQL SELECT clause.

### Constructor Summary

Constructors
Constructor and Description
`SelectList()` Create an empty select list.
`SelectList(List attributeList)` Create a select list with a list of query attributes.
`SelectList(QueryAttribute[] queryAttributes)` Create a select list with query attributes.
`SelectList(String[] attributeNames)` Create a select list with attribute names.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `add(QueryAttribute attribute)` Add an attribute to the select list.
`boolean` `add(String attributeName)` Add an attribute to the select list.
`boolean` `add(String attributeName, String alias)` Add an attribute and alias to the select list.
`boolean` `addAll(Collection queryAttributes)` Add all of the specified attributes to this select list.
`boolean` `addAll(SelectList selectList)` Add all of the specified attributes to this select list.
`void` `clear()` Remove all of the attributes from the select list.
`boolean` `contains(QueryAttribute attribute)` Returns `true` if this `SelectList` contains the specified attribute; `false` if not.
`boolean` `contains(String attributeName)` Returns `true` if this `SelectList` contains the specified attribute; `false` if not.
`boolean` `containsAlias()` Returns `true` if this `SelectList` contains an alias; `false` if not.
`boolean` `containsAll(SelectList selectList)` Determine whether or not this select list contains all the attributes in the specified select list.
`boolean` `equals(Object o)`
`QueryAttribute` `get(int index)` Returns the `QueryAttribute` at the specified location.
`SelectList` `getCopy()` Returns the copy of the SelectList.
`int` `hashCode()`
`int` `indexOf(QueryAttribute attribute)` Returns the of the specified `QueryAttribute` or -1 if it is not found.
`int` `indexOf(String attributeName)` Returns the index of the specified attribute name or -1 if it is not found.
`boolean` `isEmpty()` Returns `true` if this `SelectList` is empty; `false` if not.
`Iterator` `iterator()`
`QueryAttribute` `remove(int index)` Remove the `QueryAttribute` at the specified location.
`boolean` `remove(QueryAttribute attribute)` Remove an attribute from the select list.
`boolean` `remove(String attributeName)` Remove an attribute from the select list.
`int` `size()` Returns the number of attributes in the `SelectList`.
`QueryAttribute[]` `toArray()` Returns a QueryAttribute[] of all the attributes in the projection list.
`String` `toString()`

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

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

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

`forEach, spliterator`

### Constructor Detail

#### SelectList

    public SelectList()

Create an empty select list.

#### SelectList

    public SelectList(String[] attributeNames)

Create a select list with attribute names.

Parameters:
  `attributeNames` - Attribute names for the select list.

#### SelectList

    public SelectList(QueryAttribute[] queryAttributes)

Create a select list with query attributes. This is similar to `SelectList.SelectList(String...)` except that the `QueryAttribute` allows the specification of a attribute alias to be returned.

Parameters:
  `queryAttributes` - Attributes for the select list.

#### SelectList

    public SelectList(List attributeList)

Create a select list with a list of query attributes. This is similar to `SelectList.SelectList(String...)` except that the `QueryAttribute` allows the specification of a attribute alias to be returned.

Parameters:
  `attributeList` - Attributes for the select list.

### Method Detail

#### getCopy

    public SelectList getCopy()

Returns the copy of the SelectList.

Returns:
  the copy of the SelectList.

#### isEmpty

    public boolean isEmpty()

Returns `true` if this `SelectList` is empty; `false` if not.

Returns:
  `true` if this `SelectList` is empty; `false` if not.

#### contains

    public boolean contains(String attributeName)

Returns `true` if this `SelectList` contains the specified attribute; `false` if not. Containment test is case-insensitive.

Parameters:
  `attributeName` - the attribute to find.
Returns:
  `true` if this `SelectList` contains the specified attribute; `false` if not.

#### contains

    public boolean contains(QueryAttribute attribute)

Returns `true` if this `SelectList` contains the specified attribute; `false` if not. Containment test is case-insenitive.

Parameters:
  `attribute` - the attribute to find.
Returns:
  `true` if this `SelectList` contains the specified attribute; `false` if not.

#### iterator

    public Iterator iterator()

Specified by:
  `iterator` in interface `Iterable`

#### toArray

    public QueryAttribute[] toArray()

Returns a QueryAttribute[] of all the attributes in the projection list.

Returns:
  a QueryAttribute[] of all the attributes in the projection list.

#### add

    public boolean add(String attributeName)

Add an attribute to the select list.

Parameters:
  `attributeName` - The name of the attribute to be added.
Returns:
  `true` if the attribute was added successfully.

#### add

    public boolean add(String attributeName,
                       String alias)

Add an attribute and alias to the select list.

Parameters:
  `attributeName` - The name of the attribute to be added.
  `alias` - The alias for the attribute. This will be the name of the attribute in the result of the search.
Returns:
  `true` if the attribute was added successfully.

#### add

    public boolean add(QueryAttribute attribute)

Add an attribute to the select list.

Parameters:
  `attribute` - The attribute to be added.
Returns:
  `true` if the attribute was added successfully.

#### remove

    public boolean remove(String attributeName)

Remove an attribute from the select list.

Parameters:
  `attributeName` - The name of the attribute to be removed.
Returns:
  `true` if the attribute was removed successfully.

#### remove

    public boolean remove(QueryAttribute attribute)

Remove an attribute from the select list.

Parameters:
  `attribute` - The attribute to be removed.
Returns:
  `true` if the attribute was removed successfully.

#### containsAll

    public boolean containsAll(SelectList selectList)

Determine whether or not this select list contains all the attributes in the specified select list.

Parameters:
  `selectList` - Determine whether all these attributes are in the select list.
Returns:
  `true` if this select list contains all the attributes in the specified select list.

#### addAll

    public boolean addAll(SelectList selectList)

Add all of the specified attributes to this select list.

Parameters:
  `selectList` - Add these attributes.
Returns:
  `true` if all the attributes were added successfully.

#### addAll

    public boolean addAll(Collection queryAttributes)

Add all of the specified attributes to this select list.

Parameters:
  `queryAttributes` - Add these attributes.
Returns:
  `true` if all the attributes were added successfully.

#### clear

    public void clear()

Remove all of the attributes from the select list.

#### containsAlias

    public boolean containsAlias()

Returns `true` if this `SelectList` contains an alias; `false` if not.

Returns:
  `true` if this `SelectList` contains an alias; `false` if not.

#### size

    public int size()

Returns the number of attributes in the `SelectList`.

Returns:
  the number of attributes in the `SelectList`.

#### get

    public QueryAttribute get(int index)

Returns the `QueryAttribute` at the specified location.

Parameters:
  `index` - the index to get.
Returns:
  the `QueryAttribute` at the specified location.

#### remove

    public QueryAttribute remove(int index)

Remove the `QueryAttribute` at the specified location.

Parameters:
  `index` - the index to remove.
Returns:
  the `QueryAttribute` being removed.

#### indexOf

    public int indexOf(String attributeName)

Returns the index of the specified attribute name or -1 if it is not found.

Parameters:
  `attributeName` - the attribute to find.
Returns:
  the of the specified attribute name or -1 if it is not found.

#### indexOf

    public int indexOf(QueryAttribute attribute)

Returns the of the specified `QueryAttribute` or -1 if it is not found.

Parameters:
  `attribute` - the attribute to find.
Returns:
  the of the specified `QueryAttribute` or -1 if it is not found.

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`