/*******************************************************************************
 *  Copyright 2017 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.hl7282.commoninterface;

import java.io.IOException;


/**
 * Defines all the methods for Delimiters. Delimiters are required for identifying DataType Components, Subcomponents.
 */
public interface IDelimiter 
{
	/**
	 * Retrieves Component Separator.
	 * @return char - ComponentSeparator
	 */
	char getComponentSeparator();
	
	/**
	 * Retrieves Escape character.
	 * @return char - EscapeSeparator
	 */
	char getEscapeCharacter();
	
	/**
	 * Retrieves field separator.
	 * @return char - FieldSeparator
	 */
	char getFieldSeparator();
	
	/**
	 * Retrieves Repetition separator.
	 * @return char - RepetitionSeparator
	 */
	char getRepetitionSeparator();
	
	/**
	 * Retrieves sub-component separator.
	 * @return char - SubComponentSeparator
	 */
	char getSubComponentSeparator();
	
	/**
	 * Retrieves truncation Character.
	 * @return char - TruncationCharacter 
	 */
	char getTruncationCharacter();
	
	/**
	 * Writes the Encoding characters field.
	 * This field contains the four characters in the following order: 
	 * the component separator, repetition separator, escape character, and subcomponent separator.
	 * @param objIHL7Stream Object of HL7Stream.
	 * @return int - Success / Fail
	 * @throws IOException 
	 */
	int writeDelimiters(IHL7Stream objIHL7Stream) throws IOException;
	
	/**
	 * Read delimiters from string.
	 * @param strEncodingChars String of encoding characters
	 * @return int - Fail if delimiters are not valid
	 * 			   - Number of characters read
	 */
	public int readDelimiters(String strEncodingChars);
}
