/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.commoninterface;

import java.io.Serializable;

import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidItemException;
import cdac.medinfo.sdk.dcm30_04.utils.ICollectionIterable;


/**
 * This interface needs to be implemented by all implanter sequences .
 */
public interface IDataTypeSQ extends IDicomValue, ICollectionIterable<IItem>, Serializable
{
	/**
	 * Adds the item in the DataSet.
	 * @param objIItem instance of Item.
	 * @return int - shows status as success or failure.
	 */
	int addItem(IItem objIItem);

	/**
	 * Sets the TransferSyntax for the Item object. 
	 * @param objITransferSyntax instance of TransferSyntax.
	 */
	void setTransferSyntax(ITransferSyntax objITransferSyntax);

	/**
	 * Retrieves the TransferSyntax.
	 * @return ITransferSyntax - instance of TransferSyntax. 
	 */
	ITransferSyntax getTransferSyntax();

	/**
	 * Retrieves the length of value.
	 * @return int - integer value of length.
	 */
	int getValueLength();

	/**
	 * Sets the DictionaryReader.
	 * @param objIDictionaryReader instance of DictionaryReader.
	 */
	void setDictionaryReader(IDictionaryReader objIDictionaryReader);

	/**
	 * Retrieves the DictionaryReader
	 * @return IDictionaryReader - instance of DictionaryReader.
	 */
	IDictionaryReader getDictionaryReader();

	/*
	 * Now the iterator functionality is encapsulated in the abstract layer containing Java 
	 * Specific implementations.
	 * @see java.lang.Iterable#iterator()
	 */
	
	/**
	 * Validates the item according to the rules of DICOM standard
	 * @return int - shows status as success or failure.
	 * @throws InvalidItemException Signals Item Validation is failed.
	 */
	boolean validateForModule() throws InvalidItemException;
	
	
	/**
	 * Implementation of this method returns the Item of this Sequence.
	 * @return - IItem of this Sequence.
	 */ 
	public IItem getNewItem();
}
