uk.ac.starlink.ttools.task
Class LineEnder

java.lang.Object
  extended by uk.ac.starlink.ttools.task.LineEnder

public class LineEnder
extends Object

Defines how line endings are handled when formatting stilts commands.

Since:
19 Sep 2017
Author:
Mark Taylor

Field Summary
static LineEnder BACKSLASH
          Backslash followed by carriage return (Un*x shells).
static LineEnder BACKTICK
          Backtick followed by carriage return (Windows PowerShell).
static LineEnder CARET
          Caret followed by carriage return (DOS CMD).
static LineEnder ONELINE
          No line breaks, just one long line.
static LineEnder[] OPTIONS
          All options.
static LineEnder PLAIN
          Just a carriage return.
 
Constructor Summary
LineEnder(String name, String eol)
          Constructor.
 
Method Summary
 String getEndOfLine()
          Returns the end of line text.
 boolean includesNewline()
          Indicates whether a newline forms part of the EOL string.
 String toString()
          Returns name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAIN

public static final LineEnder PLAIN
Just a carriage return.


BACKSLASH

public static final LineEnder BACKSLASH
Backslash followed by carriage return (Un*x shells).


CARET

public static final LineEnder CARET
Caret followed by carriage return (DOS CMD).


BACKTICK

public static final LineEnder BACKTICK
Backtick followed by carriage return (Windows PowerShell).


ONELINE

public static final LineEnder ONELINE
No line breaks, just one long line.


OPTIONS

public static final LineEnder[] OPTIONS
All options.

Constructor Detail

LineEnder

public LineEnder(String name,
                 String eol)
Constructor.

Parameters:
name - instance name, suitable for presentation to users
eol - end of line text
Method Detail

getEndOfLine

public String getEndOfLine()
Returns the end of line text.

Returns:
text separating two lines

includesNewline

public boolean includesNewline()
Indicates whether a newline forms part of the EOL string.

Returns:
true iff end of line includes a newline character

toString

public String toString()
Returns name.

Overrides:
toString in class Object


Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.