<commit_before>/*
 * AndroidAdapters Copyright 2014 <NAME>
 *
 * This program is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU Lesser General Public License as published 
 * by the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/>. 
 */
package de.mrapp.android.adapter.datastructure.group;

import static de.mrapp.android.adapter.util.Condition.ensureNotNull;
import de.mrapp.android.adapter.datastructure.item.Item;
import de.mrapp.android.adapter.list.AbstractListAdapter;

/**
 * Represents a group, which categorizes multiple items of an adapter. It
 * contains the groups's data, an adapter, which manages the child items, a
 * selection state and may be enabled or disabled and expanded or collapsed.
 * 
 * @param <DataType>
 *            The type of the groups's data
 * @param <ChildDataType>
 *            The type of the child item's data
 * @param <ChildAdapterType>
 *            The type of the adapter, which manages the group's child items
 * 
 * @author <NAME>
 */
public class Group<DataType, ChildDataType, ChildAdapterType extends AbstractListAdapter<ChildDataType>>
		extends Item<DataType> {

	/**
	 * The constant serial version UID.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * True, if the group is expanded, false otherwise.
	 */
	private boolean expanded;

	/**
	 * The adapter, which manages the group's child items.
	 */
	private ChildAdapterType childAdapter;

	/**
	 * Creates a new group, which categorizes multiple items of an adapter.
	 * 
	 * @param data
	 *            The item's data, as an instance of the generic type DataType.
	 *            The data may not be null<commit_msg>Edited comments.<commit_after>/*
 * AndroidAdapters Copyright 2014 <NAME>
 *
 * This program is free software: you can redistribute it and/or modify 
 * it under the terms of the GNU Lesser General Public License as published 
 * by the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/>. 
 */
package de.mrapp.android.adapter.datastructure.group;

import static de.mrapp.android.adapter.util.Condition.ensureNotNull;
import de.mrapp.android.adapter.datastructure.item.Item;
import de.mrapp.android.adapter.list.AbstractListAdapter;

/**
 * A data structure, which categorizes multiple items of an adapter. A group has all
 * properties of an item, but it does furthermore refer to an adapter, which
 * manages the its child items and may be expanded or collapsed.
 * 
 * @param <DataType>
 *            The type of the groups's data
 * @param <ChildDataType>
 *            The type of the child items' data
 * @param <ChildAdapterType>
 *            The type of the adapter, which manages the group's child items
 * 
 * @author <NAME>
 */
public class Group<DataType, ChildDataType, ChildAdapterType extends AbstractListAdapter<ChildDataType>>
		extends Item<DataType> {

	/**
	 * The constant serial version UID.
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * True, if the group is expanded, false otherwise.
	 */
	private boolean expanded;

	/**
	 * The adapter, which manages the group's child items.
	 */
	private ChildAdapterType childAdapter;

	/**
	 * Creates a new data structure, which categorizes multiple items of an
	 * adapter.
	 * 
	 * @param data
	 *            The groups's data, as an instance of the generic type DataType.
	 *            The data may not be null
{'fraction_non_alphanumeric': 0.0768514205868654, 'fraction_numerical': 0.0027945971122496508, 'mean_word_length': 3.38265306122449, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4041946', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1099, 'n_words': 512}