/*
 * $Id: LineBreak.java,v 1.1 2003/07/08 08:13:26 znerd Exp $
 */
package org.znerd.xmlenc;

/**
 * Enumeration type for line breaks.
 *
 * @version $Revision: 1.1 $ $Date: 2003/07/08 08:13:26 $
 * @author Jochen Schwoerer (j.schwoerer [at] web.de)
 * @author Ernst de Haan (<a href="mailto:znerd@FreeBSD.org">znerd@FreeBSD.org</a>)
 *
 * @since xmlenc 0.35
 */
public final class LineBreak {

   //-------------------------------------------------------------------------
   // Class fields
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Class functions
   //-------------------------------------------------------------------------

   //-------------------------------------------------------------------------
   // Constructors
   //-------------------------------------------------------------------------

   /**
    * Constructs a new <code>LineBreak</code> that consists of the specified
    * characters.
    *
    * @param lineBreak
    *    the characters the line break consists of.
    */
   private LineBreak(String lineBreak) {
      _lineBreak = lineBreak;
   }


   //-------------------------------------------------------------------------
   // Fields
   //-------------------------------------------------------------------------

   /**
    * The characters this line break consists of. This field is initialized by
    * the constructor.
    */
   private String _lineBreak;


   //-------------------------------------------------------------------------
   // Methods
   //-------------------------------------------------------------------------

   /**
    * Empty line break. This is equivalent to using no line breaks.
    */
   public static final LineBreak NONE = new LineBreak("");

   /**
    * Unix and MacOS/X line break. This represents the string <code>"\n"</code>.
    */
   public static final LineBreak UNIX = new LineBreak("\n");

   /**
    * DOS and Windows line break. This represents the string <code>"\r\n"</code>.
    */
   public static final LineBreak DOS = new LineBreak("\r\n");

   /**
    * MacOS line break. This represents the string <code>"\r"</code>.
    *
    * <p>This applies to all MacOS versions before MacOS/X. Use
    * {@link #UNIX} as the MacOS/X line break.
    */
   public static final LineBreak MACOS = new LineBreak("\r");

   public String toString() {
      return _lineBreak;
   }
};