Peformed a code review and Javadoc review.

This commit is contained in:
Christian P. MOMON 2017-05-04 14:48:37 +02:00
parent 0845ab52e8
commit 06cf653dfc
11 changed files with 519 additions and 232 deletions

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2013-2017 Christian Pierre MOMON * Copyright (C) 2013-2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -21,14 +21,14 @@ package fr.devinsy.util.strings;
import java.util.Comparator; import java.util.Comparator;
/** /**
* * The Class StringLengthComparator.
*/ */
public class StringLengthComparator implements Comparator<String> public class StringLengthComparator implements Comparator<String>
{ {
private static StringLengthComparator instance; private static StringLengthComparator instance;
/** /* (non-Javadoc)
* * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/ */
@Override @Override
public int compare(final String alpha, final String bravo) public int compare(final String alpha, final String bravo)
@ -39,13 +39,10 @@ public class StringLengthComparator implements Comparator<String>
Integer alphaValue; Integer alphaValue;
if (alpha == null) if (alpha == null)
{ {
//
alphaValue = null; alphaValue = null;
} }
else else
{ {
//
alphaValue = alpha.length(); alphaValue = alpha.length();
} }
@ -53,13 +50,10 @@ public class StringLengthComparator implements Comparator<String>
Integer bravoValue; Integer bravoValue;
if (bravo == null) if (bravo == null)
{ {
//
bravoValue = null; bravoValue = null;
} }
else else
{ {
//
bravoValue = bravo.length(); bravoValue = bravo.length();
} }
@ -98,25 +92,18 @@ public class StringLengthComparator implements Comparator<String>
// //
if ((alpha == null) && (bravo == null)) if ((alpha == null) && (bravo == null))
{ {
//
result = 0; result = 0;
} }
else if (alpha == null) else if (alpha == null)
{ {
//
result = -1; result = -1;
} }
else if (bravo == null) else if (bravo == null)
{ {
//
result = +1; result = +1;
} }
else else
{ {
//
result = alpha.compareTo(bravo); result = alpha.compareTo(bravo);
} }
@ -125,8 +112,9 @@ public class StringLengthComparator implements Comparator<String>
} }
/** /**
* Instance.
* *
* @return * @return the string length comparator
*/ */
public static StringLengthComparator instance() public static StringLengthComparator instance()
{ {

View file

@ -1,7 +1,5 @@
/** /*
* Copyright (C) 2008-2010 Christian Pierre MOMON * Copyright (C) 2008-2010,2013-2015,2017 Christian Pierre MOMON
* Copyright (C) 2013-2015 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
* *
@ -323,9 +321,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param string * @param string
* @return * the string
* @return the string list
*/ */
public StringList appendln(final Collection<String> string) public StringList appendln(final Collection<String> string)
{ {
@ -338,9 +338,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param value * @param value
* @return * the value
* @return the string list
*/ */
public StringList appendln(final double value) public StringList appendln(final double value)
{ {
@ -353,9 +355,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param value * @param value
* @return * the value
* @return the string list
*/ */
public StringList appendln(final int value) public StringList appendln(final int value)
{ {
@ -368,9 +372,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param value * @param value
* @return * the value
* @return the string list
*/ */
public StringList appendln(final long value) public StringList appendln(final long value)
{ {
@ -383,9 +389,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param value * @param value
* @return * the value
* @return the string list
*/ */
public StringList appendln(final Object value) public StringList appendln(final Object value)
{ {
@ -398,9 +406,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param value * @param value
* @return * the value
* @return the string list
*/ */
public StringList appendln(final short value) public StringList appendln(final short value)
{ {
@ -413,9 +423,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param string * @param string
* @return * the string
* @return the string list
*/ */
public StringList appendln(final String string) public StringList appendln(final String string)
{ {
@ -428,9 +440,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Appendln.
* *
* @param strings * @param strings
* @return * the strings
* @return the string list
*/ */
public StringList appendln(final String... strings) public StringList appendln(final String... strings)
{ {
@ -461,9 +475,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Char at.
* *
* @param position * @param position
* @return * the position
* @return the char
*/ */
public char charAt(final StringListCharPosition position) public char charAt(final StringListCharPosition position)
{ {
@ -480,7 +496,7 @@ public class StringList extends ArrayList<String> implements CharSequence
* Deep copy and shallow copy have no sense about a list of immutable * Deep copy and shallow copy have no sense about a list of immutable
* objects. * objects.
* *
* @return * @return the string list
*/ */
@Override @Override
public StringList clone() public StringList clone()
@ -499,9 +515,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Contains any.
* *
* @param source * @param target
* @return * the target
* @return true, if successful
*/ */
public boolean containsAny(final Collection<String> target) public boolean containsAny(final Collection<String> target)
{ {
@ -541,9 +559,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Contains any.
* *
* @param source * @param target
* @return * the target
* @return true, if successful
*/ */
public boolean containsAny(final String... target) public boolean containsAny(final String... target)
{ {
@ -587,8 +607,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Contains blank.
* *
* @return * @return true, if successful
*/ */
public boolean containsBlank() public boolean containsBlank()
{ {
@ -621,8 +642,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Contains empty.
* *
* @return * @return true, if successful
*/ */
public boolean containsEmpty() public boolean containsEmpty()
{ {
@ -655,8 +677,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Contains null.
* *
* @return * @return true, if successful
*/ */
public boolean containsNull() public boolean containsNull()
{ {
@ -689,9 +712,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the by index.
* *
* @param id * @param id
* @return * the id
* @return the by index
*/ */
public String getByIndex(final int id) public String getByIndex(final int id)
{ {
@ -704,8 +729,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the first.
* *
* @return * @return the first
*/ */
public String getFirst() public String getFirst()
{ {
@ -746,8 +772,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the longest bytes line.
* *
* @return * @return the longest bytes line
*/ */
public String getLongestBytesLine() public String getLongestBytesLine()
{ {
@ -776,8 +803,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the longest line.
* *
* @return * @return the longest line
*/ */
public String getLongestLine() public String getLongestLine()
{ {
@ -806,8 +834,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the not blank.
* *
* @return * @return the not blank
*/ */
public StringList getNotBlank() public StringList getNotBlank()
{ {
@ -828,8 +857,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the not empty.
* *
* @return * @return the not empty
*/ */
public StringList getNotEmpty() public StringList getNotEmpty()
{ {
@ -850,8 +880,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the not null.
* *
* @return * @return the not null
*/ */
public StringList getNotNull() public StringList getNotNull()
{ {
@ -872,8 +903,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the shortest bytes line.
* *
* @return * @return the shortest bytes line
*/ */
public String getShortestBytesLine() public String getShortestBytesLine()
{ {
@ -902,8 +934,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Gets the shortest line.
* *
* @return * @return the shortest line
*/ */
public String getShortestLine() public String getShortestLine()
{ {
@ -932,9 +965,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Index of.
* *
* @param index * @param index
* @return * the index
* @return the string list char position
*/ */
public StringListCharPosition indexOf(final int index) public StringListCharPosition indexOf(final int index)
{ {
@ -971,8 +1006,10 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Index of next line not null.
* *
* @param startIndex * @param startIndex
* the start index
* @return the index of the next line not null, -1 otherwise. * @return the index of the next line not null, -1 otherwise.
*/ */
public int indexOfNextLineNotNull(final int startIndex) public int indexOfNextLineNotNull(final int startIndex)
@ -1008,9 +1045,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Checks if is out of bounds.
* *
* @param position * @param position
* @return * the position
* @return true, if is out of bounds
*/ */
public boolean isOutOfBounds(final StringListCharPosition position) public boolean isOutOfBounds(final StringListCharPosition position)
{ {
@ -1041,9 +1080,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Checks if is out of line.
* *
* @param position * @param position
* @return * the position
* @return true, if is out of line
*/ */
public boolean isOutOfLine(final StringListCharPosition position) public boolean isOutOfLine(final StringListCharPosition position)
{ {
@ -1070,9 +1111,11 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Checks if is out of list.
* *
* @param position * @param position
* @return * the position
* @return true, if is out of list
*/ */
public boolean isOutOfList(final StringListCharPosition position) public boolean isOutOfList(final StringListCharPosition position)
{ {
@ -1099,7 +1142,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* Iterator of char.
* *
* @return the iterator
*/ */
public Iterator<Character> iteratorOfChar() public Iterator<Character> iteratorOfChar()
{ {
@ -1114,6 +1159,8 @@ public class StringList extends ArrayList<String> implements CharSequence
/** /**
* Returns the length of the string list concatenation. Null strings are * Returns the length of the string list concatenation. Null strings are
* ignored. * ignored.
*
* @return the int
*/ */
@Override @Override
public int length() public int length()
@ -1137,7 +1184,7 @@ public class StringList extends ArrayList<String> implements CharSequence
* operation, the new string is the first of the list and the size list is * operation, the new string is the first of the list and the size list is
* 1. * 1.
* *
* @return * @return the string list
*/ */
public StringList merge() public StringList merge()
{ {
@ -1402,11 +1449,15 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* To string.
* *
* @param prefix * @param prefix
* the prefix
* @param separator * @param separator
* @param postifx * the separator
* @return * @param postfix
* the postfix
* @return the string
*/ */
public String toString(final String prefix, final String separator, final String postfix) public String toString(final String prefix, final String separator, final String postfix)
{ {
@ -1439,7 +1490,7 @@ public class StringList extends ArrayList<String> implements CharSequence
* Returns an array containing all of the strings in this list in proper * Returns an array containing all of the strings in this list in proper
* sequence (from first to last element). * sequence (from first to last element).
* *
* @return * @return the string[]
*/ */
public String[] toStringArray() public String[] toStringArray()
{ {
@ -1462,8 +1513,8 @@ public class StringList extends ArrayList<String> implements CharSequence
* concatenated too. * concatenated too.
* *
* @param separator * @param separator
* * the separator
* @return * @return the string
*/ */
public String toStringSeparatedBy(final String separator) public String toStringSeparatedBy(final String separator)
{ {
@ -1489,9 +1540,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* To string with bracket.
* *
* @param strings * @return the string
* @return
*/ */
public String toStringWithBracket() public String toStringWithBracket()
{ {
@ -1504,9 +1555,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* To string with brackets.
* *
* @param source * @return the string
* @return
*/ */
public String toStringWithBrackets() public String toStringWithBrackets()
{ {
@ -1526,8 +1577,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* To string with commas.
* *
* @return * @return the string
*/ */
public String toStringWithCommas() public String toStringWithCommas()
{ {
@ -1540,8 +1592,9 @@ public class StringList extends ArrayList<String> implements CharSequence
} }
/** /**
* To string with french commas.
* *
* @return * @return the string
*/ */
public String toStringWithFrenchCommas() public String toStringWithFrenchCommas()
{ {
@ -1558,8 +1611,8 @@ public class StringList extends ArrayList<String> implements CharSequence
* *
* @param out * @param out
* The {@code PrintWriter} where to write. * The {@code PrintWriter} where to write.
*
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public void writeInto(final java.io.PrintWriter out) throws IOException public void writeInto(final java.io.PrintWriter out) throws IOException
{ {
@ -1574,8 +1627,8 @@ public class StringList extends ArrayList<String> implements CharSequence
* *
* @param out * @param out
* The {@code Writer} where to write. * The {@code Writer} where to write.
*
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public void writeInto(final java.io.Writer out) throws IOException public void writeInto(final java.io.Writer out) throws IOException
{ {

View file

@ -1,6 +1,5 @@
/** /*
* Copyright (C) 2014-2015 Christian Pierre MOMON * Copyright (C) 2014-2015,2017 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
* *
@ -22,16 +21,18 @@ package fr.devinsy.util.strings;
import java.util.Iterator; import java.util.Iterator;
/** /**
* * The Class StringListCharIterator.
*/ */
public class StringListCharIterator implements Iterator<Character> public class StringListCharIterator implements Iterator<Character>
{ {
private StringList source; private StringList source;
private StringListCharPosition currentPosition;
private StringListCharPosition nextPosition; private StringListCharPosition nextPosition;
/** /**
* Instantiates a new string list char iterator.
* *
* @param source
* the source
*/ */
public StringListCharIterator(final StringList source) public StringListCharIterator(final StringList source)
{ {
@ -41,8 +42,8 @@ public class StringListCharIterator implements Iterator<Character>
this.nextPosition = new StringListCharPosition(); this.nextPosition = new StringListCharPosition();
} }
/** /* (non-Javadoc)
* * @see java.util.Iterator#hasNext()
*/ */
@Override @Override
public boolean hasNext() public boolean hasNext()
@ -69,8 +70,8 @@ public class StringListCharIterator implements Iterator<Character>
return result; return result;
} }
/** /* (non-Javadoc)
* * @see java.util.Iterator#next()
*/ */
@Override @Override
public Character next() public Character next()
@ -110,8 +111,9 @@ public class StringListCharIterator implements Iterator<Character>
} }
/** /**
* Next position.
* *
* @return * @return the string list char position
*/ */
public StringListCharPosition nextPosition() public StringListCharPosition nextPosition()
{ {

View file

@ -1,6 +1,5 @@
/** /*
* Copyright (C) 2013-2015 Christian Pierre MOMON * Copyright (C) 2013-2015,2017 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
* *
@ -31,10 +30,7 @@ public class StringListCharPosition
private int localCharIndex; private int localCharIndex;
/** /**
* * Instantiates a new string list char position.
* @param index
* @param stringIndex
* @param localIndex
*/ */
public StringListCharPosition() public StringListCharPosition()
{ {
@ -44,10 +40,14 @@ public class StringListCharPosition
} }
/** /**
* Instantiates a new string list char position.
* *
* @param index * @param index
* the index
* @param stringIndex * @param stringIndex
* the string index
* @param localIndex * @param localIndex
* the local index
*/ */
public StringListCharPosition(final int index, final int stringIndex, final int localIndex) public StringListCharPosition(final int index, final int stringIndex, final int localIndex)
{ {
@ -57,8 +57,10 @@ public class StringListCharPosition
} }
/** /**
* Instantiates a new string list char position.
* *
* @param source * @param source
* the source
*/ */
public StringListCharPosition(final StringListCharPosition source) public StringListCharPosition(final StringListCharPosition source)
{ {
@ -67,46 +69,84 @@ public class StringListCharPosition
this.localCharIndex = source.getLocalCharIndex(); this.localCharIndex = source.getLocalCharIndex();
} }
/**
* Gets the char index.
*
* @return the char index
*/
public int getCharIndex() public int getCharIndex()
{ {
return this.charIndex; return this.charIndex;
} }
/**
* Gets the local char index.
*
* @return the local char index
*/
public int getLocalCharIndex() public int getLocalCharIndex()
{ {
return this.localCharIndex; return this.localCharIndex;
} }
/**
* Gets the string index.
*
* @return the string index
*/
public int getStringIndex() public int getStringIndex()
{ {
return this.stringIndex; return this.stringIndex;
} }
/**
* Next.
*/
public void next() public void next()
{ {
this.charIndex += 1; this.charIndex += 1;
this.localCharIndex += 1; this.localCharIndex += 1;
} }
/**
* Next end of line.
*/
public void nextEndOfLine() public void nextEndOfLine()
{ {
this.localCharIndex = 0; this.localCharIndex = 0;
this.stringIndex += 1; this.stringIndex += 1;
} }
/**
* Sets the char index.
*
* @param charIndex
* the new char index
*/
public void setCharIndex(final int charIndex) public void setCharIndex(final int charIndex)
{ {
this.charIndex = charIndex; this.charIndex = charIndex;
} }
/**
* Sets the local char index.
*
* @param localCharIndex
* the new local char index
*/
public void setLocalCharIndex(final int localCharIndex) public void setLocalCharIndex(final int localCharIndex)
{ {
this.localCharIndex = localCharIndex; this.localCharIndex = localCharIndex;
} }
/**
* Sets the string index.
*
* @param stringIndex
* the new string index
*/
public void setStringIndex(final int stringIndex) public void setStringIndex(final int stringIndex)
{ {
this.stringIndex = stringIndex; this.stringIndex = stringIndex;
} }
} }

View file

@ -1,6 +1,5 @@
/** /*
* Copyright (C) 2013-2015 Christian Pierre MOMON * Copyright (C) 2013-2015,2017 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
* *
@ -23,14 +22,14 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
/** /**
* TODO CREATION STEP. * The Class StringListInputStream.
*/ */
public class StringListInputStream extends InputStream public class StringListInputStream extends InputStream
{ {
private StringList in; private StringList in;
/** /**
* * Instantiates a new string list input stream.
*/ */
public StringListInputStream() public StringListInputStream()
{ {
@ -38,7 +37,10 @@ public class StringListInputStream extends InputStream
} }
/** /**
* Instantiates a new string list input stream.
* *
* @param size
* the size
*/ */
public StringListInputStream(final int size) public StringListInputStream(final int size)
{ {
@ -46,7 +48,10 @@ public class StringListInputStream extends InputStream
} }
/** /**
* Instantiates a new string list input stream.
* *
* @param source
* the source
*/ */
public StringListInputStream(final StringList source) public StringListInputStream(final StringList source)
{ {

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2013-2017 Christian Pierre MOMON * Copyright (C) 2013-2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -23,6 +23,7 @@ import java.io.IOException;
import java.io.Reader; import java.io.Reader;
/** /**
* The Class StringListReader.
* *
* @author Christian Pierre MOMON (christian.momon@devinsy.fr) * @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/ */
@ -32,8 +33,10 @@ public class StringListReader extends Reader
private StringListCharIterator iterator; private StringListCharIterator iterator;
/** /**
* Instantiates a new string list reader.
* *
* @param in * @param in
* the in
*/ */
public StringListReader(final StringList in) public StringListReader(final StringList in)
{ {
@ -41,16 +44,16 @@ public class StringListReader extends Reader
this.iterator = new StringListCharIterator(in); this.iterator = new StringListCharIterator(in);
} }
/** /* (non-Javadoc)
* * @see java.io.Reader#close()
*/ */
@Override @Override
public void close() public void close()
{ {
} }
/** /* (non-Javadoc)
* * @see java.io.Reader#read(char[], int, int)
*/ */
@Override @Override
public synchronized int read(final char[] cbuf, final int off, final int len) throws IOException public synchronized int read(final char[] cbuf, final int off, final int len) throws IOException

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2013-2017 Christian Pierre MOMON * Copyright (C) 2013-2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -22,14 +22,14 @@ import java.io.IOException;
import java.io.Writer; import java.io.Writer;
/** /**
* * The Class StringListWriter.
*/ */
public class StringListWriter extends Writer public class StringListWriter extends Writer
{ {
private StringList out; private StringList out;
/** /**
* * Instantiates a new string list writer.
*/ */
public StringListWriter() public StringListWriter()
{ {
@ -37,7 +37,10 @@ public class StringListWriter extends Writer
} }
/** /**
* Instantiates a new string list writer.
* *
* @param initialCapacity
* the initial capacity
*/ */
public StringListWriter(final int initialCapacity) public StringListWriter(final int initialCapacity)
{ {
@ -45,7 +48,10 @@ public class StringListWriter extends Writer
} }
/** /**
* Instantiates a new string list writer.
* *
* @param target
* the target
*/ */
public StringListWriter(final StringList target) public StringListWriter(final StringList target)
{ {
@ -59,6 +65,9 @@ public class StringListWriter extends Writer
} }
} }
/* (non-Javadoc)
* @see java.io.Writer#close()
*/
/* /*
* *
*/ */
@ -68,6 +77,9 @@ public class StringListWriter extends Writer
} }
/* (non-Javadoc)
* @see java.io.Writer#flush()
*/
/* /*
* *
*/ */
@ -77,8 +89,8 @@ public class StringListWriter extends Writer
} }
/* /* (non-Javadoc)
* * @see java.lang.Object#toString()
*/ */
@Override @Override
public String toString() public String toString()
@ -92,8 +104,9 @@ public class StringListWriter extends Writer
} }
/** /**
* To string list.
* *
* @return * @return the string list
*/ */
public StringList toStringList() public StringList toStringList()
{ {
@ -105,16 +118,21 @@ public class StringListWriter extends Writer
return result; return result;
} }
/* /**
* Write.
* *
* @param c
* the c
* @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public void write(final char c) throws IOException public void write(final char c) throws IOException
{ {
this.out.append(c); this.out.append(c);
} }
/* /* (non-Javadoc)
* * @see java.io.Writer#write(char[], int, int)
*/ */
@Override @Override
public void write(final char[] cbuf, final int off, final int len) throws IOException public void write(final char[] cbuf, final int off, final int len) throws IOException
@ -137,8 +155,8 @@ public class StringListWriter extends Writer
this.out.append(new String(target)); this.out.append(new String(target));
} }
/* /* (non-Javadoc)
* * @see java.io.Writer#write(java.lang.String)
*/ */
@Override @Override
public void write(final String string) throws IOException public void write(final String string) throws IOException

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2014-2017 Christian Pierre MOMON * Copyright (C) 2014-2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -31,7 +31,7 @@ public class StringSet extends HashSet<String>
private static final long serialVersionUID = 6674838743930005326L; private static final long serialVersionUID = 6674838743930005326L;
/** /**
* * Instantiates a new string set.
*/ */
public StringSet() public StringSet()
{ {
@ -43,6 +43,7 @@ public class StringSet extends HashSet<String>
* they are returned by the collection's iterator. * they are returned by the collection's iterator.
* *
* @param source * @param source
* the source
*/ */
public StringSet(final Collection<String> source) public StringSet(final Collection<String> source)
{ {
@ -59,7 +60,10 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Instantiates a new string set.
* *
* @param initialCapacity
* the initial capacity
*/ */
public StringSet(final int initialCapacity) public StringSet(final int initialCapacity)
{ {
@ -67,7 +71,10 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Instantiates a new string set.
* *
* @param source
* the source
*/ */
public StringSet(final String[] source) public StringSet(final String[] source)
{ {
@ -84,7 +91,10 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Instantiates a new string set.
* *
* @param source
* the source
*/ */
public StringSet(final StringSet source) public StringSet(final StringSet source)
{ {
@ -102,6 +112,10 @@ public class StringSet extends HashSet<String>
/** /**
* Check null parameter before add. * Check null parameter before add.
*
* @param string
* the string
* @return true, if successful
*/ */
@Override @Override
public boolean add(final String string) public boolean add(final String string)
@ -124,7 +138,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Adds the.
* *
* @param strings
* the strings
* @return the string set
*/ */
public StringSet add(final StringSet strings) public StringSet add(final StringSet strings)
{ {
@ -148,7 +166,7 @@ public class StringSet extends HashSet<String>
* Deep copy and shallow copy have no sense about a list of immutable * Deep copy and shallow copy have no sense about a list of immutable
* objects. * objects.
* *
* @return * @return the string set
*/ */
@Override @Override
public StringSet clone() public StringSet clone()
@ -167,7 +185,9 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Length.
* *
* @return the int
*/ */
public int length() public int length()
{ {
@ -183,7 +203,9 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Merge.
* *
* @return the string set
*/ */
public StringSet merge() public StringSet merge()
{ {
@ -207,7 +229,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param character
* the character
* @return the string set
*/ */
public StringSet put(final char character) public StringSet put(final char character)
{ {
@ -222,7 +248,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param value
* the value
* @return the string set
*/ */
public StringSet put(final double value) public StringSet put(final double value)
{ {
@ -235,7 +265,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param value
* the value
* @return the string set
*/ */
public StringSet put(final int value) public StringSet put(final int value)
{ {
@ -248,7 +282,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param value
* the value
* @return the string set
*/ */
public StringSet put(final long value) public StringSet put(final long value)
{ {
@ -261,7 +299,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param value
* the value
* @return the string set
*/ */
public StringSet put(final Object value) public StringSet put(final Object value)
{ {
@ -280,6 +322,10 @@ public class StringSet extends HashSet<String>
/** /**
* Check null parameter before add. * Check null parameter before add.
*
* @param string
* the string
* @return the string set
*/ */
public StringSet put(final String string) public StringSet put(final String string)
{ {
@ -297,7 +343,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param strings
* the strings
* @return the string set
*/ */
public StringSet put(final String... strings) public StringSet put(final String... strings)
{ {
@ -318,7 +368,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param strings
* the strings
* @return the string set
*/ */
public StringSet put(final StringList strings) public StringSet put(final StringList strings)
{ {
@ -339,7 +393,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put.
* *
* @param strings
* the strings
* @return the string set
*/ */
public StringSet put(final StringSet strings) public StringSet put(final StringSet strings)
{ {
@ -360,7 +418,11 @@ public class StringSet extends HashSet<String>
} }
/** /**
* Put nullable.
* *
* @param value
* the value
* @return the string set
*/ */
public StringSet putNullable(final Object value) public StringSet putNullable(final Object value)
{ {
@ -381,8 +443,8 @@ public class StringSet extends HashSet<String>
return result; return result;
} }
/** /* (non-Javadoc)
* * @see java.util.AbstractCollection#toString()
*/ */
@Override @Override
public String toString() public String toString()
@ -396,8 +458,9 @@ public class StringSet extends HashSet<String>
} }
/** /**
* To string list.
* *
* @return * @return the string list
*/ */
public StringList toStringList() public StringList toStringList()
{ {

View file

@ -1,7 +1,5 @@
/** /*
* Copyright (C) 2008-2010 Christian Pierre MOMON * Copyright (C) 2008-2010,2013-2016,2017 Christian Pierre MOMON
* Copyright (C) 2013-2016 Christian Pierre MOMON
* Copyright (C) 2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
* *
@ -40,14 +38,13 @@ import org.apache.commons.lang3.StringUtils;
* The {@code StringUtils} class defines helper methods to string collection. * The {@code StringUtils} class defines helper methods to string collection.
* *
* Operations that are null safe. * Operations that are null safe.
*
*/ */
public class StringstUtils public class StringstUtils
{ {
public static final String DEFAULT_CHARSET_NAME = "UTF-8"; public static final String DEFAULT_CHARSET_NAME = "UTF-8";
/** /**
* * Instantiates a new stringst utils.
*/ */
private StringstUtils() private StringstUtils()
{ {
@ -92,10 +89,9 @@ public class StringstUtils
* *
* @param source * @param source
* The string to concatenate several time. * The string to concatenate several time.
*
* @param multiplier * @param multiplier
* The number of concatenate to produce. * The number of concatenate to produce.
* @return * @return the string
*/ */
public static String concatenate(final String source, final int multiplier) public static String concatenate(final String source, final int multiplier)
{ {
@ -108,9 +104,11 @@ public class StringstUtils
} }
/** /**
* Contains blank.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsBlank(final Collection<String> source) public static boolean containsBlank(final Collection<String> source)
{ {
@ -134,9 +132,11 @@ public class StringstUtils
} }
/** /**
* Contains blank.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsBlank(final String... source) public static boolean containsBlank(final String... source)
{ {
@ -156,9 +156,11 @@ public class StringstUtils
} }
/** /**
* Contains empty.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsEmpty(final Collection<String> source) public static boolean containsEmpty(final Collection<String> source)
{ {
@ -182,9 +184,11 @@ public class StringstUtils
} }
/** /**
* Contains empty.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsEmpty(final String... source) public static boolean containsEmpty(final String... source)
{ {
@ -204,9 +208,11 @@ public class StringstUtils
} }
/** /**
* Contains null.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsNull(final Collection<String> source) public static boolean containsNull(final Collection<String> source)
{ {
@ -230,9 +236,11 @@ public class StringstUtils
} }
/** /**
* Contains null.
* *
* @param source * @param source
* @return * the source
* @return true, if successful
*/ */
public static boolean containsNull(final String... source) public static boolean containsNull(final String... source)
{ {
@ -370,9 +378,13 @@ public class StringstUtils
} }
/** /**
* Gets the complement.
* *
* @param target * @param alpha
* @return * the alpha
* @param bravo
* the bravo
* @return the complement
*/ */
public static StringSet getComplement(final Collection<String> alpha, final Collection<String> bravo) public static StringSet getComplement(final Collection<String> alpha, final Collection<String> bravo)
{ {
@ -385,9 +397,13 @@ public class StringstUtils
} }
/** /**
* Gets the difference.
* *
* @param target * @param alpha
* @return * the alpha
* @param bravo
* the bravo
* @return the difference
*/ */
public static StringSet getDifference(final Collection<String> alpha, final Collection<String> bravo) public static StringSet getDifference(final Collection<String> alpha, final Collection<String> bravo)
{ {
@ -401,9 +417,13 @@ public class StringstUtils
} }
/** /**
* Gets the disjunction.
* *
* @param target * @param alpha
* @return * the alpha
* @param bravo
* the bravo
* @return the disjunction
*/ */
public static StringSet getDisjunction(final Collection<String> alpha, final Collection<String> bravo) public static StringSet getDisjunction(final Collection<String> alpha, final Collection<String> bravo)
{ {
@ -432,9 +452,13 @@ public class StringstUtils
} }
/** /**
* Gets the intersection of.
* *
* @param target * @param alpha
* @return * the alpha
* @param bravo
* the bravo
* @return the intersection of
*/ */
public static StringSet getIntersectionOf(final Collection<String> alpha, final Collection<String> bravo) public static StringSet getIntersectionOf(final Collection<String> alpha, final Collection<String> bravo)
{ {
@ -455,9 +479,13 @@ public class StringstUtils
} }
/** /**
* Gets the union of.
* *
* @param target * @param alpha
* @return * the alpha
* @param bravo
* the bravo
* @return the union of
*/ */
public static StringSet getUnionOf(final Collection<String> alpha, final Collection<String> bravo) public static StringSet getUnionOf(final Collection<String> alpha, final Collection<String> bravo)
{ {
@ -475,9 +503,13 @@ public class StringstUtils
} }
/** /**
* Load.
* *
* @param file * @param source
* the source
* @return the string list
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static StringList load(final File source) throws IOException public static StringList load(final File source) throws IOException
{ {
@ -490,9 +522,15 @@ public class StringstUtils
} }
/** /**
* Load.
* *
* @param file * @param file
* the file
* @param charsetName
* the charset name
* @return the string list
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static StringList load(final File file, final String charsetName) throws IOException public static StringList load(final File file, final String charsetName) throws IOException
{ {
@ -509,10 +547,13 @@ public class StringstUtils
} }
/** /**
* Load.
* *
* @param file * @param source
* @return * the source
* @return the string list
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static StringList load(final URL source) throws IOException public static StringList load(final URL source) throws IOException
{ {
@ -525,9 +566,15 @@ public class StringstUtils
} }
/** /**
* Load.
* *
* @param file * @param source
* the source
* @param charsetName
* the charset name
* @return the string list
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static StringList load(final URL source, final String charsetName) throws IOException public static StringList load(final URL source, final String charsetName) throws IOException
{ {
@ -544,9 +591,16 @@ public class StringstUtils
} }
/** /**
* Read.
* *
* @param file * @param out
* the out
* @param is
* the is
* @param charsetName
* the charset name
* @throws IOException * @throws IOException
* Signals that an I/O exception has occurred.
*/ */
public static void read(final StringList out, final InputStream is, final String charsetName) throws IOException public static void read(final StringList out, final InputStream is, final String charsetName) throws IOException
{ {
@ -592,10 +646,9 @@ public class StringstUtils
* *
* @param source * @param source
* The string to concatenate several time. * The string to concatenate several time.
*
* @param multiplier * @param multiplier
* The number of concatenate to produce. * The number of concatenate to produce.
* @return * @return the string list
*/ */
public static StringList repeat(final String source, final int multiplier) public static StringList repeat(final String source, final int multiplier)
{ {
@ -612,10 +665,16 @@ public class StringstUtils
} }
/** /**
* Save.
* *
* @param file * @param file
* @throws FileNotFoundException * the file
* @param source
* the source
* @throws UnsupportedEncodingException * @throws UnsupportedEncodingException
* the unsupported encoding exception
* @throws FileNotFoundException
* the file not found exception
*/ */
public static void save(final File file, final StringList source) throws UnsupportedEncodingException, FileNotFoundException public static void save(final File file, final StringList source) throws UnsupportedEncodingException, FileNotFoundException
{ {
@ -681,11 +740,17 @@ public class StringstUtils
} }
/** /**
* To string.
* *
* @param source
* the source
* @param prefix * @param prefix
* the prefix
* @param separator * @param separator
* the separator
* @param postfix * @param postfix
* @return * the postfix
* @return the string
*/ */
public static String toString(final String[] source, final String prefix, final String separator, final String postfix) public static String toString(final String[] source, final String prefix, final String separator, final String postfix)
{ {
@ -705,11 +770,17 @@ public class StringstUtils
} }
/** /**
* To string.
* *
* @param source
* the source
* @param prefix * @param prefix
* the prefix
* @param separator * @param separator
* the separator
* @param postfix * @param postfix
* @return * the postfix
* @return the string
*/ */
public static String toString(final StringList source, final String prefix, final String separator, final String postfix) public static String toString(final StringList source, final String prefix, final String separator, final String postfix)
{ {
@ -781,9 +852,8 @@ public class StringstUtils
/** /**
* Concatenates the string from an array to a string. * Concatenates the string from an array to a string.
* *
* @param strings * @param source
* The string array to convert. * the source
*
* @return If argument is null then returns an empty string, otherwise * @return If argument is null then returns an empty string, otherwise
* returns a string concatenation of the argument. * returns a string concatenation of the argument.
*/ */
@ -803,9 +873,13 @@ public class StringstUtils
} }
/** /**
* To string separated by.
* *
* @param source * @param source
* @return * the source
* @param separator
* the separator
* @return the string
*/ */
public static String toStringSeparatedBy(final Collection<String> source, final String separator) public static String toStringSeparatedBy(final Collection<String> source, final String separator)
{ {
@ -825,9 +899,13 @@ public class StringstUtils
} }
/** /**
* To string separated by.
* *
* @param strings * @param source
* @return * the source
* @param separator
* the separator
* @return the string
*/ */
public static String toStringSeparatedBy(final String[] source, final String separator) public static String toStringSeparatedBy(final String[] source, final String separator)
{ {
@ -847,9 +925,13 @@ public class StringstUtils
} }
/** /**
* To string separated by.
* *
* @param strings * @param source
* @return * the source
* @param separator
* the separator
* @return the string
*/ */
public static String toStringSeparatedBy(final StringList source, final String separator) public static String toStringSeparatedBy(final StringList source, final String separator)
{ {
@ -869,9 +951,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracket(final Collection<String> source) public static String toStringWithBracket(final Collection<String> source)
{ {
@ -891,9 +975,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracket(final String[] source) public static String toStringWithBracket(final String[] source)
{ {
@ -913,9 +999,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracket(final StringList source) public static String toStringWithBracket(final StringList source)
{ {
@ -935,9 +1023,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket not null.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracketNotNull(final Collection<String> source) public static String toStringWithBracketNotNull(final Collection<String> source)
{ {
@ -955,9 +1045,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket not null.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracketNotNull(final String[] source) public static String toStringWithBracketNotNull(final String[] source)
{ {
@ -975,9 +1067,11 @@ public class StringstUtils
} }
/** /**
* To string with bracket not null.
* *
* @param strings * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBracketNotNull(final StringList source) public static String toStringWithBracketNotNull(final StringList source)
{ {
@ -995,9 +1089,11 @@ public class StringstUtils
} }
/** /**
* To string with brackets.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBrackets(final Collection<String> source) public static String toStringWithBrackets(final Collection<String> source)
{ {
@ -1017,9 +1113,11 @@ public class StringstUtils
} }
/** /**
* To string with brackets.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBrackets(final String[] source) public static String toStringWithBrackets(final String[] source)
{ {
@ -1039,9 +1137,11 @@ public class StringstUtils
} }
/** /**
* To string with brackets.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithBrackets(final StringList source) public static String toStringWithBrackets(final StringList source)
{ {
@ -1061,9 +1161,11 @@ public class StringstUtils
} }
/** /**
* To string with commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithCommas(final Collection<String> source) public static String toStringWithCommas(final Collection<String> source)
{ {
@ -1083,9 +1185,11 @@ public class StringstUtils
} }
/** /**
* To string with commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithCommas(final String[] source) public static String toStringWithCommas(final String[] source)
{ {
@ -1105,9 +1209,11 @@ public class StringstUtils
} }
/** /**
* To string with commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithCommas(final StringList source) public static String toStringWithCommas(final StringList source)
{ {
@ -1127,9 +1233,11 @@ public class StringstUtils
} }
/** /**
* To string with french commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithFrenchCommas(final Collection<String> source) public static String toStringWithFrenchCommas(final Collection<String> source)
{ {
@ -1149,9 +1257,11 @@ public class StringstUtils
} }
/** /**
* To string with french commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithFrenchCommas(final String[] source) public static String toStringWithFrenchCommas(final String[] source)
{ {
@ -1171,9 +1281,11 @@ public class StringstUtils
} }
/** /**
* To string with french commas.
* *
* @param source * @param source
* @return * the source
* @return the string
*/ */
public static String toStringWithFrenchCommas(final StringList source) public static String toStringWithFrenchCommas(final StringList source)
{ {

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2013,2014,2017 Christian Pierre MOMON * Copyright (C) 2013,2014,2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -28,15 +28,16 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
/** /**
* The Class StringListTest.
* *
* @author Christian P. Momon * @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/ */
public class StringListTest public class StringListTest
{ {
static protected org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringListTest.class); static protected org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringListTest.class);
/** /**
* * Before.
*/ */
@Before @Before
public void before() public void before()
@ -46,7 +47,7 @@ public class StringListTest
} }
/** /**
* * Test char at 01.
*/ */
@Test @Test
public void testCharAt01() public void testCharAt01()
@ -75,7 +76,7 @@ public class StringListTest
} }
/** /**
* * Test char at 02.
*/ */
@Test @Test
public void testCharAt02() public void testCharAt02()
@ -108,7 +109,7 @@ public class StringListTest
} }
/** /**
* * Test char at exception 01.
*/ */
@Test(expected = IndexOutOfBoundsException.class) @Test(expected = IndexOutOfBoundsException.class)
public void testCharAtException01() public void testCharAtException01()
@ -129,7 +130,7 @@ public class StringListTest
} }
/** /**
* * Test char at exception 02.
*/ */
@Test(expected = IndexOutOfBoundsException.class) @Test(expected = IndexOutOfBoundsException.class)
public void testCharAtException02() public void testCharAtException02()
@ -150,7 +151,7 @@ public class StringListTest
} }
/** /**
* * Test char at exception 03.
*/ */
@Test(expected = IndexOutOfBoundsException.class) @Test(expected = IndexOutOfBoundsException.class)
public void testCharAtException03() public void testCharAtException03()
@ -171,7 +172,7 @@ public class StringListTest
} }
/** /**
* * Test constructor 01.
*/ */
@Test @Test
public void testConstructor01() public void testConstructor01()
@ -191,7 +192,7 @@ public class StringListTest
} }
/** /**
* * Test constructor 02.
*/ */
@Test @Test
public void testConstructor02() public void testConstructor02()
@ -209,7 +210,7 @@ public class StringListTest
} }
/** /**
* * Test iterator of char 01.
*/ */
@Test @Test
public void testIteratorOfChar01() public void testIteratorOfChar01()
@ -245,7 +246,7 @@ public class StringListTest
} }
/** /**
* * Test substring 01.
*/ */
@Test @Test
public void testSubstring01() public void testSubstring01()
@ -266,7 +267,7 @@ public class StringListTest
} }
/** /**
* * Test substring 02.
*/ */
@Test @Test
public void testSubstring02() public void testSubstring02()
@ -287,6 +288,7 @@ public class StringListTest
} }
/** /**
* Test substring 03.
*/ */
@Test @Test
public void testSubstring03() public void testSubstring03()
@ -307,6 +309,7 @@ public class StringListTest
} }
/** /**
* Test substring 04.
*/ */
@Test @Test
public void testSubstring04() public void testSubstring04()
@ -327,7 +330,7 @@ public class StringListTest
} }
/** /**
* * Test to string 01.
*/ */
@Test @Test
public void testToString01() public void testToString01()
@ -347,7 +350,7 @@ public class StringListTest
} }
/** /**
* * Test to string 02.
*/ */
@Test @Test
public void testToString02() public void testToString02()
@ -371,7 +374,7 @@ public class StringListTest
} }
/** /**
* * Test to string 03.
*/ */
@Test @Test
public void testToString03() public void testToString03()
@ -394,5 +397,4 @@ public class StringListTest
// //
logger.debug("===== test done."); logger.debug("===== test done.");
} }
} }

View file

@ -1,4 +1,4 @@
/** /*
* Copyright (C) 2013,2014,2017 Christian Pierre MOMON * Copyright (C) 2013,2014,2017 Christian Pierre MOMON
* *
* This file is part of devinsy-strings. * This file is part of devinsy-strings.
@ -29,15 +29,17 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
/** /**
* The Class StringsUtilsTest.
* *
* @author Christian P. Momon * @author Christian Pierre MOMON (christian.momon@devinsy.fr)
*/ */
public class StringsUtilsTest public class StringsUtilsTest
{ {
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringsUtilsTest.class); private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(StringsUtilsTest.class);
/** /**
* * Before.
*/ */
@Before @Before
public void before() public void before()
@ -47,7 +49,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains blank 01.
*/ */
@Test @Test
public void testContainsBlank01() public void testContainsBlank01()
@ -60,7 +62,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains blank 02.
*/ */
@Test @Test
public void testContainsBlank02() public void testContainsBlank02()
@ -73,7 +75,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains blank 03.
*/ */
@Test @Test
public void testContainsBlank03() public void testContainsBlank03()
@ -93,7 +95,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains empty 01.
*/ */
@Test @Test
public void testContainsEmpty01() public void testContainsEmpty01()
@ -105,7 +107,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains empty 02.
*/ */
@Test @Test
public void testContainsEmpty02() public void testContainsEmpty02()
@ -117,7 +119,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains empty 03.
*/ */
@Test @Test
public void testContainsEmpty03() public void testContainsEmpty03()
@ -135,7 +137,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains null 01.
*/ */
@Test @Test
public void testContainsNull01() public void testContainsNull01()
@ -146,7 +148,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains null 02.
*/ */
@Test @Test
public void testContainsNull02() public void testContainsNull02()
@ -157,7 +159,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test contains null 03.
*/ */
@Test @Test
public void testContainsNull03() public void testContainsNull03()
@ -173,7 +175,7 @@ public class StringsUtilsTest
} }
/** /**
* * Test find smallest 01.
*/ */
@Test @Test
public void testFindSmallest01() public void testFindSmallest01()
@ -188,5 +190,4 @@ public class StringsUtilsTest
source.set(1, null); source.set(1, null);
Assert.assertTrue(StringstUtils.containsNull(source)); Assert.assertTrue(StringstUtils.containsNull(source));
} }
} }