test_class.file: unix4j-core/unix4j-base/src/test/java/org/unix4j/line/SimpleLineTest.java
test_class.identifier: SimpleLineTest
test_case.body: @Test
  	public void testSubSequence() {
  		final String CRLF = "" + Line.CR + Line.LF;  
  		final Line line = new SimpleLine("0123456789", CRLF);
  		//identity cut
  		Assert.assertSame(line, SimpleLine.subLine(line, 0, line.length(), false));
  		Assert.assertSame(line, SimpleLine.subLine(line, 0, line.length(), true));
  		//0 to content length now
  		Assert.assertEquals("", 					line.subSequence(0, 0));
  		Assert.assertEquals("0", 					line.subSequence(0, 1));
  		Assert.assertEquals("01",					line.subSequence(0, 2));
  		Assert.assertEquals("012",					line.subSequence(0, 3));
  		Assert.assertEquals("0123",					line.subSequence(0, 4));
  		Assert.assertEquals("01234",				line.subSequence(0, 5));
  		Assert.assertEquals("012345",				line.subSequence(0, 6));
  		Assert.assertEquals("0123456",				line.subSequence(0, 7));
  		Assert.assertEquals("01234567",				line.subSequence(0, 8));
  		Assert.assertEquals("012345678",			line.subSequence(0, 9));
  		Assert.assertEquals("0123456789",			line.subSequence(0, 10));
  		Assert.assertEquals("0123456789" + Line.CR,	line.subSequence(0, 11));
  		Assert.assertEquals("0123456789" + CRLF,	line.subSequence(0, 12));
  		Assert.assertEquals("123456789" + CRLF,		line.subSequence(1, 12));
  		Assert.assertEquals("23456789" + CRLF,		line.subSequence(2, 12));
  		Assert.assertEquals("3456789" + CRLF,		line.subSequence(3, 12));
  		Assert.assertEquals("456789" + CRLF,		line.subSequence(4, 12));
  		Assert.assertEquals("56789" + CRLF,			line.subSequence(5, 12));
  		Assert.assertEquals("6789" + CRLF,			line.subSequence(6, 12));
  		Assert.assertEquals("789" + CRLF,			line.subSequence(7, 12));
  		Assert.assertEquals("89" + CRLF,			line.subSequence(8, 12));
  		Assert.assertEquals("9" + CRLF,				line.subSequence(9, 12));
  		Assert.assertEquals("" + CRLF,				line.subSequence(10, 12));
  		Assert.assertEquals("" + Line.LF,			line.subSequence(11, 12));
  		Assert.assertEquals("",						line.subSequence(12, 12));
  		Assert.assertEquals("1", 			line.subSequence(1, 2));
  		Assert.assertEquals("9",			line.subSequence(9, 10));
  		Assert.assertEquals("9" + Line.CR,	line.subSequence(9, 11));
  		Assert.assertEquals("9" + CRLF,		line.subSequence(9, 12));
  		Assert.assertEquals("" + Line.CR,	line.subSequence(10, 11));
  		Assert.assertEquals(CRLF,			line.subSequence(10, 12));
  		Assert.assertEquals("" + Line.LF,	line.subSequence(11, 12));
  
  		//expecte exceptions for
  		final int[] start= {-1,  0, 1, 0, 0};
  		final int[] end  = { 0, -1, 0, line.getContentLength()+1, line.length()+1};
  		final boolean[] preserveEnding= { true, true, true, true, false};
  		for (int i = 0; i < start.length; i++) {
  			try {
  				SimpleLine.subLine(line, start[i], end[i], preserveEnding[i]);
  				Assert.fail("expected exception for illegal subLine input arguments: line.subLine(" + start[i] + ", " + end[i] + ", " + preserveEnding[i] + ") for line " + line);
  			} catch (IllegalArgumentException e) {
  				//ok, that's what we would expect
  			}
  		}
  	}
test_case.class_method_signature: SimpleLineTest.testSubSequence()
test_case.full_signature: @Test public void testSubSequence()
test_case.identifier: testSubSequence
test_case.invocations: assertSame subLine length assertSame subLine length assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence assertEquals subSequence getContentLength length subLine fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSubSequence()
focal_class.declarator: content
focal_class.modifier: private final
focal_class.original_string: private final CharSequence content;
focal_class.type: CharSequence
focal_class.var_name: content
focal_class.declarator: lineEnding
focal_class.modifier: private final
focal_class.original_string: private final CharSequence lineEnding;
focal_class.type: CharSequence
focal_class.var_name: lineEnding
focal_class.file: unix4j-core/unix4j-base/src/main/java/org/unix4j/line/SimpleLine.java
focal_class.identifier: SimpleLine
focal_class.interfaces: implements Line
focal_class.class_method_signature: SimpleLine.SimpleLine(CharSequence content)
focal_class.full_signature: public  SimpleLine(CharSequence content)
focal_class.identifier: SimpleLine
focal_class.modifiers: public
focal_class.parameters: (CharSequence content)
focal_class.signature:  SimpleLine(CharSequence content)
focal_class.class_method_signature: SimpleLine.SimpleLine(CharSequence content, char lineEnding)
focal_class.full_signature: public  SimpleLine(CharSequence content, char lineEnding)
focal_class.identifier: SimpleLine
focal_class.modifiers: public
focal_class.parameters: (CharSequence content, char lineEnding)
focal_class.signature:  SimpleLine(CharSequence content, char lineEnding)
focal_class.class_method_signature: SimpleLine.SimpleLine(CharSequence content, CharSequence lineEnding)
focal_class.full_signature: public  SimpleLine(CharSequence content, CharSequence lineEnding)
focal_class.identifier: SimpleLine
focal_class.modifiers: public
focal_class.parameters: (CharSequence content, CharSequence lineEnding)
focal_class.signature:  SimpleLine(CharSequence content, CharSequence lineEnding)
focal_class.class_method_signature: SimpleLine.length()
focal_class.full_signature: @Override public int length()
focal_class.identifier: length
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int length()
focal_class.class_method_signature: SimpleLine.charAt(int index)
focal_class.full_signature: @Override public char charAt(int index)
focal_class.identifier: charAt
focal_class.modifiers: @Override public
focal_class.parameters: (int index)
focal_class.return: char
focal_class.signature: char charAt(int index)
focal_class.class_method_signature: SimpleLine.subSequence(int start, int end)
focal_class.full_signature: @Override public CharSequence subSequence(int start, int end)
focal_class.identifier: subSequence
focal_class.modifiers: @Override public
focal_class.parameters: (int start, int end)
focal_class.return: CharSequence
focal_class.signature: CharSequence subSequence(int start, int end)
focal_class.class_method_signature: SimpleLine.getContent()
focal_class.full_signature: @Override public String getContent()
focal_class.identifier: getContent
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getContent()
focal_class.class_method_signature: SimpleLine.getContentLength()
focal_class.full_signature: @Override public int getContentLength()
focal_class.identifier: getContentLength
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getContentLength()
focal_class.class_method_signature: SimpleLine.getLineEnding()
focal_class.full_signature: @Override public String getLineEnding()
focal_class.identifier: getLineEnding
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLineEnding()
focal_class.class_method_signature: SimpleLine.getLineEndingLength()
focal_class.full_signature: @Override public int getLineEndingLength()
focal_class.identifier: getLineEndingLength
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getLineEndingLength()
focal_class.class_method_signature: SimpleLine.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: SimpleLine.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: SimpleLine.equals(Object obj)
focal_class.full_signature: @Override public boolean equals(Object obj)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object obj)
focal_class.return: boolean
focal_class.signature: boolean equals(Object obj)
focal_class.class_method_signature: SimpleLine.subLine(Line line, int start, int end, boolean preserveLineEnding)
focal_class.full_signature: public static Line subLine(Line line, int start, int end, boolean preserveLineEnding)
focal_class.identifier: subLine
focal_class.modifiers: public static
focal_class.parameters: (Line line, int start, int end, boolean preserveLineEnding)
focal_class.return: Line
focal_class.signature: Line subLine(Line line, int start, int end, boolean preserveLineEnding)
focal_method.body: @Override
  	public CharSequence subSequence(int start, int end) {
  		final int clen = content.length();
  		final int elen = lineEnding.length();
  		if (start < clen && end <= clen) {
  			return content.subSequence(start, end);
  		}
  		final int estart = start - clen;
  		final int eend = end - clen;
  		if (estart >= 0 && estart <= elen && eend >= 0 && eend <= elen) {
  			return lineEnding.subSequence(estart, eend);
  		}
  		// overlaps the two strings
  		final StringBuilder sb = new StringBuilder(clen + elen);
  		return sb.append(content).append(lineEnding).subSequence(start, end);
  	}
focal_method.class_method_signature: SimpleLine.subSequence(int start, int end)
focal_method.full_signature: @Override public CharSequence subSequence(int start, int end)
focal_method.identifier: subSequence
focal_method.invocations: length length subSequence subSequence subSequence append append
focal_method.modifiers: @Override public
focal_method.parameters: (int start, int end)
focal_method.return: CharSequence
focal_method.signature: CharSequence subSequence(int start, int end)