/*******************************************************************************
 *  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.IOException;
import java.io.Serializable;

/**
 * This interface needs to be implemented by all classes which implements the necessary functionality of Tag class.
 */
public interface ITag extends Comparable, Serializable
{
	/**
	 * Reads the data from stream.
	 * @param objIDicomStream instance of DicomStream.
	 * @return int - shows status as success or failure.
	 * @throws IOException If Input/Output operation fails.
	 */
	int read(IDicomStream objIDicomStream) throws IOException;

	/**
	 * Writes the data to the stream.
	 * @param objIDicomStream instance of DicomStream.
	 * @return int - shows status as success or failure.
	 * @throws IOException If Input/Output operation fails.
	 */
	int write(IDicomStream objIDicomStream) throws IOException;

	/**
	 * Retrieves the element number.
	 * @return int - integer value of element.
	 */
	int getElementNumber();

	/**
	 * Retrieves the group number.
	 * @return int - integer value of group.
	 */
	int getGroupNumber();

	/**
	 * Checks the equality of two objects.
	 * @param obj instance of objects.
	 * @return boolean - shows status as success or failure.
	 */
	boolean equals(Object obj);
	
	/**
	 * Create similar object of this class.
	 * This does the deep copy and create a new instance of this class and return it.
	 * @return ITag - object of ITag.
	 */
	public Object clone();
	
	/**
	 *  Dumps the contents of the Tag that is Group Number and Element Number in readable form to the specified stream.
	 *  @param objIDicomStream - the Stream on which the Data is to be written.
	 *  @throws IOException - Exception is thrown indicating runtime failure of writing operation.
	 */
	public void dumpDICOMInfo(IDicomStream objIDicomStream) throws IOException;
}
