repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
phax/ph-commons | ph-cli/src/main/java/com/helger/cli/HelpFormatter.java | HelpFormatter.printUsage | public void printUsage (@Nonnull final PrintWriter aPW, final int nWidth, final String sCmdLineSyntax)
{
final int nArgPos = sCmdLineSyntax.indexOf (' ') + 1;
printWrapped (aPW, nWidth, getSyntaxPrefix ().length () + nArgPos, getSyntaxPrefix () + sCmdLineSyntax);
} | java | public void printUsage (@Nonnull final PrintWriter aPW, final int nWidth, final String sCmdLineSyntax)
{
final int nArgPos = sCmdLineSyntax.indexOf (' ') + 1;
printWrapped (aPW, nWidth, getSyntaxPrefix ().length () + nArgPos, getSyntaxPrefix () + sCmdLineSyntax);
} | [
"public",
"void",
"printUsage",
"(",
"@",
"Nonnull",
"final",
"PrintWriter",
"aPW",
",",
"final",
"int",
"nWidth",
",",
"final",
"String",
"sCmdLineSyntax",
")",
"{",
"final",
"int",
"nArgPos",
"=",
"sCmdLineSyntax",
".",
"indexOf",
"(",
"'",
"'",
")",
"+"... | Print the sCmdLineSyntax to the specified writer, using the specified
width.
@param aPW
The printWriter to write the help to
@param nWidth
The number of characters per line for the usage statement.
@param sCmdLineSyntax
The usage statement. | [
"Print",
"the",
"sCmdLineSyntax",
"to",
"the",
"specified",
"writer",
"using",
"the",
"specified",
"width",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-cli/src/main/java/com/helger/cli/HelpFormatter.java#L755-L760 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.registerMimeTypeContent | @Nonnull
public EChange registerMimeTypeContent (@Nonnull final MimeTypeContent aMimeTypeContent)
{
ValueEnforcer.notNull (aMimeTypeContent, "MimeTypeContent");
return m_aRWLock.writeLocked ( () -> m_aMimeTypeContents.addObject (aMimeTypeContent));
} | java | @Nonnull
public EChange registerMimeTypeContent (@Nonnull final MimeTypeContent aMimeTypeContent)
{
ValueEnforcer.notNull (aMimeTypeContent, "MimeTypeContent");
return m_aRWLock.writeLocked ( () -> m_aMimeTypeContents.addObject (aMimeTypeContent));
} | [
"@",
"Nonnull",
"public",
"EChange",
"registerMimeTypeContent",
"(",
"@",
"Nonnull",
"final",
"MimeTypeContent",
"aMimeTypeContent",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aMimeTypeContent",
",",
"\"MimeTypeContent\"",
")",
";",
"return",
"m_aRWLock",
".",
... | Register a new MIME content type.
@param aMimeTypeContent
The content type to register. May not be <code>null</code>.
@return {@link EChange#CHANGED} if the object was successfully registered. | [
"Register",
"a",
"new",
"MIME",
"content",
"type",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L144-L150 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.unregisterMimeTypeContent | @Nonnull
public EChange unregisterMimeTypeContent (@Nullable final MimeTypeContent aMimeTypeContent)
{
if (aMimeTypeContent == null)
return EChange.UNCHANGED;
return m_aRWLock.writeLocked ( () -> m_aMimeTypeContents.removeObject (aMimeTypeContent));
} | java | @Nonnull
public EChange unregisterMimeTypeContent (@Nullable final MimeTypeContent aMimeTypeContent)
{
if (aMimeTypeContent == null)
return EChange.UNCHANGED;
return m_aRWLock.writeLocked ( () -> m_aMimeTypeContents.removeObject (aMimeTypeContent));
} | [
"@",
"Nonnull",
"public",
"EChange",
"unregisterMimeTypeContent",
"(",
"@",
"Nullable",
"final",
"MimeTypeContent",
"aMimeTypeContent",
")",
"{",
"if",
"(",
"aMimeTypeContent",
"==",
"null",
")",
"return",
"EChange",
".",
"UNCHANGED",
";",
"return",
"m_aRWLock",
"... | Unregister an existing MIME content type.
@param aMimeTypeContent
The content type to unregister. May not be <code>null</code>.
@return {@link EChange#CHANGED} if the object was successfully
unregistered. | [
"Unregister",
"an",
"existing",
"MIME",
"content",
"type",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L160-L167 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.getMimeTypeFromBytes | @Nullable
public IMimeType getMimeTypeFromBytes (@Nullable final byte [] aBytes, @Nullable final IMimeType aDefault)
{
if (aBytes == null || aBytes.length == 0)
return aDefault;
return m_aRWLock.readLocked ( () -> {
for (final MimeTypeContent aMTC : m_aMimeTypeContents)
if (aMTC.matches... | java | @Nullable
public IMimeType getMimeTypeFromBytes (@Nullable final byte [] aBytes, @Nullable final IMimeType aDefault)
{
if (aBytes == null || aBytes.length == 0)
return aDefault;
return m_aRWLock.readLocked ( () -> {
for (final MimeTypeContent aMTC : m_aMimeTypeContents)
if (aMTC.matches... | [
"@",
"Nullable",
"public",
"IMimeType",
"getMimeTypeFromBytes",
"(",
"@",
"Nullable",
"final",
"byte",
"[",
"]",
"aBytes",
",",
"@",
"Nullable",
"final",
"IMimeType",
"aDefault",
")",
"{",
"if",
"(",
"aBytes",
"==",
"null",
"||",
"aBytes",
".",
"length",
"... | Try to determine the MIME type from the given byte array.
@param aBytes
The byte array to parse. May be <code>null</code> or empty.
@param aDefault
The default MIME type to be returned, if no matching MIME type was
found. May be <code>null</code>.
@return The supplied default value, if no matching MIME type was found.... | [
"Try",
"to",
"determine",
"the",
"MIME",
"type",
"from",
"the",
"given",
"byte",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L233-L247 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java | MimeTypeDeterminator.reinitialize | public void reinitialize ()
{
m_aRWLock.writeLocked ( () -> {
m_aMimeTypeContents.clear ();
_registerDefaultMimeTypeContents ();
});
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Reinitialized " + MimeTypeDeterminator.class.getName ());
} | java | public void reinitialize ()
{
m_aRWLock.writeLocked ( () -> {
m_aMimeTypeContents.clear ();
_registerDefaultMimeTypeContents ();
});
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Reinitialized " + MimeTypeDeterminator.class.getName ());
} | [
"public",
"void",
"reinitialize",
"(",
")",
"{",
"m_aRWLock",
".",
"writeLocked",
"(",
"(",
")",
"->",
"{",
"m_aMimeTypeContents",
".",
"clear",
"(",
")",
";",
"_registerDefaultMimeTypeContents",
"(",
")",
";",
"}",
")",
";",
"if",
"(",
"LOGGER",
".",
"i... | Reset the MimeTypeContent cache to the initial state.
@see #registerMimeTypeContent(MimeTypeContent)
@see #unregisterMimeTypeContent(MimeTypeContent) | [
"Reset",
"the",
"MimeTypeContent",
"cache",
"to",
"the",
"initial",
"state",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeTypeDeterminator.java#L266-L275 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/math/CombinationGeneratorFlexible.java | CombinationGeneratorFlexible.iterateAllCombinations | public void iterateAllCombinations (@Nonnull final ICommonsList <DATATYPE> aElements,
@Nonnull final Consumer <? super ICommonsList <DATATYPE>> aCallback)
{
ValueEnforcer.notNull (aElements, "Elements");
ValueEnforcer.notNull (aCallback, "Callback");
for (int nSlotCo... | java | public void iterateAllCombinations (@Nonnull final ICommonsList <DATATYPE> aElements,
@Nonnull final Consumer <? super ICommonsList <DATATYPE>> aCallback)
{
ValueEnforcer.notNull (aElements, "Elements");
ValueEnforcer.notNull (aCallback, "Callback");
for (int nSlotCo... | [
"public",
"void",
"iterateAllCombinations",
"(",
"@",
"Nonnull",
"final",
"ICommonsList",
"<",
"DATATYPE",
">",
"aElements",
",",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"ICommonsList",
"<",
"DATATYPE",
">",
">",
"aCallback",
")",
"{",
"ValueEn... | Iterate all combination, no matter they are unique or not.
@param aElements
List of elements.
@param aCallback
Callback to invoke | [
"Iterate",
"all",
"combination",
"no",
"matter",
"they",
"are",
"unique",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/math/CombinationGeneratorFlexible.java#L73-L92 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/math/CombinationGeneratorFlexible.java | CombinationGeneratorFlexible.getCombinations | @Nonnull
@ReturnsMutableCopy
public ICommonsSet <ICommonsList <DATATYPE>> getCombinations (@Nonnull final ICommonsList <DATATYPE> aElements)
{
ValueEnforcer.notNull (aElements, "Elements");
final ICommonsSet <ICommonsList <DATATYPE>> aAllResults = new CommonsHashSet <> ();
iterateAllCombinations (aEl... | java | @Nonnull
@ReturnsMutableCopy
public ICommonsSet <ICommonsList <DATATYPE>> getCombinations (@Nonnull final ICommonsList <DATATYPE> aElements)
{
ValueEnforcer.notNull (aElements, "Elements");
final ICommonsSet <ICommonsList <DATATYPE>> aAllResults = new CommonsHashSet <> ();
iterateAllCombinations (aEl... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"ICommonsSet",
"<",
"ICommonsList",
"<",
"DATATYPE",
">",
">",
"getCombinations",
"(",
"@",
"Nonnull",
"final",
"ICommonsList",
"<",
"DATATYPE",
">",
"aElements",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"("... | Generate all combinations without duplicates.
@param aElements
the elements to distribute to the specified slots (may be empty!)
@return a set of slot allocations representing all possible combinations | [
"Generate",
"all",
"combinations",
"without",
"duplicates",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/math/CombinationGeneratorFlexible.java#L101-L110 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/map/AbstractSoftMap.java | AbstractSoftMap._processQueue | private void _processQueue ()
{
SoftValue <K, V> aSoftValue;
while ((aSoftValue = GenericReflection.uncheckedCast (m_aQueue.poll ())) != null)
{
m_aSrcMap.remove (aSoftValue.m_aKey);
}
} | java | private void _processQueue ()
{
SoftValue <K, V> aSoftValue;
while ((aSoftValue = GenericReflection.uncheckedCast (m_aQueue.poll ())) != null)
{
m_aSrcMap.remove (aSoftValue.m_aKey);
}
} | [
"private",
"void",
"_processQueue",
"(",
")",
"{",
"SoftValue",
"<",
"K",
",",
"V",
">",
"aSoftValue",
";",
"while",
"(",
"(",
"aSoftValue",
"=",
"GenericReflection",
".",
"uncheckedCast",
"(",
"m_aQueue",
".",
"poll",
"(",
")",
")",
")",
"!=",
"null",
... | Here we go through the ReferenceQueue and remove garbage collected
SoftValue objects from the HashMap by looking them up using the
SoftValue.m_aKey data member. | [
"Here",
"we",
"go",
"through",
"the",
"ReferenceQueue",
"and",
"remove",
"garbage",
"collected",
"SoftValue",
"objects",
"from",
"the",
"HashMap",
"by",
"looking",
"them",
"up",
"using",
"the",
"SoftValue",
".",
"m_aKey",
"data",
"member",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/map/AbstractSoftMap.java#L292-L299 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/collection/map/AbstractSoftMap.java | AbstractSoftMap.put | @Override
public V put (final K aKey, final V aValue)
{
// throw out garbage collected values first
_processQueue ();
final SoftValue <K, V> aOld = m_aSrcMap.put (aKey, new SoftValue <> (aKey, aValue, m_aQueue));
return aOld == null ? null : aOld.get ();
} | java | @Override
public V put (final K aKey, final V aValue)
{
// throw out garbage collected values first
_processQueue ();
final SoftValue <K, V> aOld = m_aSrcMap.put (aKey, new SoftValue <> (aKey, aValue, m_aQueue));
return aOld == null ? null : aOld.get ();
} | [
"@",
"Override",
"public",
"V",
"put",
"(",
"final",
"K",
"aKey",
",",
"final",
"V",
"aValue",
")",
"{",
"// throw out garbage collected values first",
"_processQueue",
"(",
")",
";",
"final",
"SoftValue",
"<",
"K",
",",
"V",
">",
"aOld",
"=",
"m_aSrcMap",
... | Here we put the key, value pair into the HashMap using a SoftValue object. | [
"Here",
"we",
"put",
"the",
"key",
"value",
"pair",
"into",
"the",
"HashMap",
"using",
"a",
"SoftValue",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/map/AbstractSoftMap.java#L304-L311 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.write | @Override
public void write (final int c)
{
final int nNewCount = m_nCount + 1;
if (nNewCount > m_aBuf.length)
m_aBuf = Arrays.copyOf (m_aBuf, Math.max (m_aBuf.length << 1, nNewCount));
m_aBuf[m_nCount] = (char) c;
m_nCount = nNewCount;
} | java | @Override
public void write (final int c)
{
final int nNewCount = m_nCount + 1;
if (nNewCount > m_aBuf.length)
m_aBuf = Arrays.copyOf (m_aBuf, Math.max (m_aBuf.length << 1, nNewCount));
m_aBuf[m_nCount] = (char) c;
m_nCount = nNewCount;
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"final",
"int",
"c",
")",
"{",
"final",
"int",
"nNewCount",
"=",
"m_nCount",
"+",
"1",
";",
"if",
"(",
"nNewCount",
">",
"m_aBuf",
".",
"length",
")",
"m_aBuf",
"=",
"Arrays",
".",
"copyOf",
"(",
"m_aB... | Writes a character to the buffer. | [
"Writes",
"a",
"character",
"to",
"the",
"buffer",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L80-L88 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.write | @Override
public void write (@Nonnull final char [] aBuf, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
ValueEnforcer.isArrayOfsLen (aBuf, nOfs, nLen);
if (nLen > 0)
{
final int nNewCount = m_nCount + nLen;
if (nNewCount > m_aBuf.length)
m_aBuf = Arrays.copyOf (m_aBuf,... | java | @Override
public void write (@Nonnull final char [] aBuf, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
ValueEnforcer.isArrayOfsLen (aBuf, nOfs, nLen);
if (nLen > 0)
{
final int nNewCount = m_nCount + nLen;
if (nNewCount > m_aBuf.length)
m_aBuf = Arrays.copyOf (m_aBuf,... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aBuf",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen",
")",
"{",
"ValueEnforcer",
".",
"isArrayOfsLen",
"(",
"a... | Writes characters to the buffer.
@param aBuf
the data to be written
@param nOfs
the start offset in the data
@param nLen
the number of chars that are written | [
"Writes",
"characters",
"to",
"the",
"buffer",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L100-L113 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.write | @Override
public void write (@Nonnull final String sStr, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
if (nLen > 0)
{
final int newcount = m_nCount + nLen;
if (newcount > m_aBuf.length)
{
m_aBuf = Arrays.copyOf (m_aBuf, Math.max (m_aBuf.length << 1, newcount));
... | java | @Override
public void write (@Nonnull final String sStr, @Nonnegative final int nOfs, @Nonnegative final int nLen)
{
if (nLen > 0)
{
final int newcount = m_nCount + nLen;
if (newcount > m_aBuf.length)
{
m_aBuf = Arrays.copyOf (m_aBuf, Math.max (m_aBuf.length << 1, newcount));
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"@",
"Nonnull",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nOfs",
",",
"@",
"Nonnegative",
"final",
"int",
"nLen",
")",
"{",
"if",
"(",
"nLen",
">",
"0",
")",
"{",
"final",
"i... | Write a portion of a string to the buffer.
@param sStr
String to be written from
@param nOfs
Offset from which to start reading characters
@param nLen
Number of characters to be written | [
"Write",
"a",
"portion",
"of",
"a",
"string",
"to",
"the",
"buffer",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L125-L138 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.toByteArray | @Nonnull
@ReturnsMutableCopy
public byte [] toByteArray (@Nonnull final Charset aCharset)
{
return StringHelper.encodeCharToBytes (m_aBuf, 0, m_nCount, aCharset);
} | java | @Nonnull
@ReturnsMutableCopy
public byte [] toByteArray (@Nonnull final Charset aCharset)
{
return StringHelper.encodeCharToBytes (m_aBuf, 0, m_nCount, aCharset);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"StringHelper",
".",
"encodeCharToBytes",
"(",
"m_aBuf",
",",
"0",
",",
"m_nCount",
",",
"aCharset",
... | Returns a copy of the input data as bytes in the correct charset.
@param aCharset
The charset to be used. May not be <code>null</code>.
@return an array of bytes. Never <code>null</code>. | [
"Returns",
"a",
"copy",
"of",
"the",
"input",
"data",
"as",
"bytes",
"in",
"the",
"correct",
"charset",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L278-L283 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java | NonBlockingCharArrayWriter.getAsString | @Nonnull
public String getAsString (@Nonnegative final int nLength)
{
ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, m_nCount);
return new String (m_aBuf, 0, nLength);
} | java | @Nonnull
public String getAsString (@Nonnegative final int nLength)
{
ValueEnforcer.isBetweenInclusive (nLength, "Length", 0, m_nCount);
return new String (m_aBuf, 0, nLength);
} | [
"@",
"Nonnull",
"public",
"String",
"getAsString",
"(",
"@",
"Nonnegative",
"final",
"int",
"nLength",
")",
"{",
"ValueEnforcer",
".",
"isBetweenInclusive",
"(",
"nLength",
",",
"\"Length\"",
",",
"0",
",",
"m_nCount",
")",
";",
"return",
"new",
"String",
"(... | Converts input data to a string.
@param nLength
The number of characters to convert. Must be ≤ than
{@link #getSize()}.
@return the string. | [
"Converts",
"input",
"data",
"to",
"a",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingCharArrayWriter.java#L350-L355 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/cache/Cache.java | Cache.createCache | @Nonnull
@ReturnsMutableCopy
@OverrideOnDemand
@CodingStyleguideUnaware
protected ICommonsMap <KEYTYPE, VALUETYPE> createCache ()
{
return hasMaxSize () ? new SoftLinkedHashMap <> (m_nMaxSize) : new SoftHashMap <> ();
} | java | @Nonnull
@ReturnsMutableCopy
@OverrideOnDemand
@CodingStyleguideUnaware
protected ICommonsMap <KEYTYPE, VALUETYPE> createCache ()
{
return hasMaxSize () ? new SoftLinkedHashMap <> (m_nMaxSize) : new SoftHashMap <> ();
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"@",
"OverrideOnDemand",
"@",
"CodingStyleguideUnaware",
"protected",
"ICommonsMap",
"<",
"KEYTYPE",
",",
"VALUETYPE",
">",
"createCache",
"(",
")",
"{",
"return",
"hasMaxSize",
"(",
")",
"?",
"new",
"SoftLinkedHashMap",
... | Create a new cache map. This is the internal map that is used to store the
items.
@return Never <code>null</code>. | [
"Create",
"a",
"new",
"cache",
"map",
".",
"This",
"is",
"the",
"internal",
"map",
"that",
"is",
"used",
"to",
"store",
"the",
"items",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/cache/Cache.java#L123-L130 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/cache/Cache.java | Cache.getFromCache | public VALUETYPE getFromCache (final KEYTYPE aKey)
{
VALUETYPE aValue = getFromCacheNoStats (aKey);
if (aValue == null)
{
// No old value in the cache
m_aRWLock.writeLock ().lock ();
try
{
// Read again, in case the value was set between the two locking
// sections
... | java | public VALUETYPE getFromCache (final KEYTYPE aKey)
{
VALUETYPE aValue = getFromCacheNoStats (aKey);
if (aValue == null)
{
// No old value in the cache
m_aRWLock.writeLock ().lock ();
try
{
// Read again, in case the value was set between the two locking
// sections
... | [
"public",
"VALUETYPE",
"getFromCache",
"(",
"final",
"KEYTYPE",
"aKey",
")",
"{",
"VALUETYPE",
"aValue",
"=",
"getFromCacheNoStats",
"(",
"aKey",
")",
";",
"if",
"(",
"aValue",
"==",
"null",
")",
"{",
"// No old value in the cache",
"m_aRWLock",
".",
"writeLock"... | Here Nonnull but derived class may be Nullable | [
"Here",
"Nonnull",
"but",
"derived",
"class",
"may",
"be",
"Nullable"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/cache/Cache.java#L190-L227 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java | ByteBufferOutputStream.getAsByteArray | @Nonnull
@ReturnsMutableCopy
public byte [] getAsByteArray ()
{
final byte [] aArray = m_aBuffer.array ();
final int nOfs = m_aBuffer.arrayOffset ();
final int nLength = m_aBuffer.position ();
return ArrayHelper.getCopy (aArray, nOfs, nLength);
} | java | @Nonnull
@ReturnsMutableCopy
public byte [] getAsByteArray ()
{
final byte [] aArray = m_aBuffer.array ();
final int nOfs = m_aBuffer.arrayOffset ();
final int nLength = m_aBuffer.position ();
return ArrayHelper.getCopy (aArray, nOfs, nLength);
} | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"byte",
"[",
"]",
"getAsByteArray",
"(",
")",
"{",
"final",
"byte",
"[",
"]",
"aArray",
"=",
"m_aBuffer",
".",
"array",
"(",
")",
";",
"final",
"int",
"nOfs",
"=",
"m_aBuffer",
".",
"arrayOffset",
"(",... | Get everything as a big byte array, without altering the ByteBuffer. This
works only if the contained ByteBuffer has a backing array.
@return The content of the buffer as a byte array. Never <code>null</code>. | [
"Get",
"everything",
"as",
"a",
"big",
"byte",
"array",
"without",
"altering",
"the",
"ByteBuffer",
".",
"This",
"works",
"only",
"if",
"the",
"contained",
"ByteBuffer",
"has",
"a",
"backing",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java#L174-L183 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java | ByteBufferOutputStream.writeTo | public void writeTo (@Nonnull @WillNotClose final OutputStream aOS, final boolean bClearBuffer) throws IOException
{
ValueEnforcer.notNull (aOS, "OutputStream");
aOS.write (m_aBuffer.array (), m_aBuffer.arrayOffset (), m_aBuffer.position ());
if (bClearBuffer)
m_aBuffer.clear ();
} | java | public void writeTo (@Nonnull @WillNotClose final OutputStream aOS, final boolean bClearBuffer) throws IOException
{
ValueEnforcer.notNull (aOS, "OutputStream");
aOS.write (m_aBuffer.array (), m_aBuffer.arrayOffset (), m_aBuffer.position ());
if (bClearBuffer)
m_aBuffer.clear ();
} | [
"public",
"void",
"writeTo",
"(",
"@",
"Nonnull",
"@",
"WillNotClose",
"final",
"OutputStream",
"aOS",
",",
"final",
"boolean",
"bClearBuffer",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aOS",
",",
"\"OutputStream\"",
")",
";",
"... | Write everything to the passed output stream and optionally clear the
contained buffer. This works only if the contained ByteBuffer has a backing
array.
@param aOS
The output stream to write to. May not be <code>null</code>.
@param bClearBuffer
<code>true</code> to clear the buffer, <code>false</code> to not do
it. If... | [
"Write",
"everything",
"to",
"the",
"passed",
"output",
"stream",
"and",
"optionally",
"clear",
"the",
"contained",
"buffer",
".",
"This",
"works",
"only",
"if",
"the",
"contained",
"ByteBuffer",
"has",
"a",
"backing",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java#L341-L348 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java | ByteBufferOutputStream.getAsString | @Nonnull
public String getAsString (@Nonnull final Charset aCharset)
{
return new String (m_aBuffer.array (), m_aBuffer.arrayOffset (), m_aBuffer.position (), aCharset);
} | java | @Nonnull
public String getAsString (@Nonnull final Charset aCharset)
{
return new String (m_aBuffer.array (), m_aBuffer.arrayOffset (), m_aBuffer.position (), aCharset);
} | [
"@",
"Nonnull",
"public",
"String",
"getAsString",
"(",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"return",
"new",
"String",
"(",
"m_aBuffer",
".",
"array",
"(",
")",
",",
"m_aBuffer",
".",
"arrayOffset",
"(",
")",
",",
"m_aBuffer",
".",
... | Get the content as a string without modifying the buffer. This works only
if the contained ByteBuffer has a backing array.
@param aCharset
The charset to use. May not be <code>null</code>.
@return The String representation. | [
"Get",
"the",
"content",
"as",
"a",
"string",
"without",
"modifying",
"the",
"buffer",
".",
"This",
"works",
"only",
"if",
"the",
"contained",
"ByteBuffer",
"has",
"a",
"backing",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java#L358-L362 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java | ByteBufferOutputStream.write | public void write (@Nonnull final ByteBuffer aSrcBuffer)
{
ValueEnforcer.notNull (aSrcBuffer, "SourceBuffer");
if (m_bCanGrow && aSrcBuffer.remaining () > m_aBuffer.remaining ())
_growBy (aSrcBuffer.remaining ());
m_aBuffer.put (aSrcBuffer);
} | java | public void write (@Nonnull final ByteBuffer aSrcBuffer)
{
ValueEnforcer.notNull (aSrcBuffer, "SourceBuffer");
if (m_bCanGrow && aSrcBuffer.remaining () > m_aBuffer.remaining ())
_growBy (aSrcBuffer.remaining ());
m_aBuffer.put (aSrcBuffer);
} | [
"public",
"void",
"write",
"(",
"@",
"Nonnull",
"final",
"ByteBuffer",
"aSrcBuffer",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSrcBuffer",
",",
"\"SourceBuffer\"",
")",
";",
"if",
"(",
"m_bCanGrow",
"&&",
"aSrcBuffer",
".",
"remaining",
"(",
")",
">"... | Write the content from the passed byte buffer to this output stream.
@param aSrcBuffer
The buffer to use. May not be <code>null</code>. | [
"Write",
"the",
"content",
"from",
"the",
"passed",
"byte",
"buffer",
"to",
"this",
"output",
"stream",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/ByteBufferOutputStream.java#L398-L406 | train |
phax/ph-commons | ph-less-commons/src/main/java/com/helger/lesscommons/homoglyphs/HomoglyphBuilder.java | HomoglyphBuilder.build | @Nonnull
public static Homoglyph build (@Nonnull final IReadableResource aRes) throws IOException
{
ValueEnforcer.notNull (aRes, "Resource");
return build (aRes.getReader (StandardCharsets.ISO_8859_1));
} | java | @Nonnull
public static Homoglyph build (@Nonnull final IReadableResource aRes) throws IOException
{
ValueEnforcer.notNull (aRes, "Resource");
return build (aRes.getReader (StandardCharsets.ISO_8859_1));
} | [
"@",
"Nonnull",
"public",
"static",
"Homoglyph",
"build",
"(",
"@",
"Nonnull",
"final",
"IReadableResource",
"aRes",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aRes",
",",
"\"Resource\"",
")",
";",
"return",
"build",
"(",
"aRes",... | Parses the specified resource and uses it to construct a populated
Homoglyph object.
@param aRes
the path to a file containing a list of homoglyphs (see the bundled
char_codes.txt file for an example of the required format)
@return a Homoglyph object populated using the contents of the specified
file
@throws IOExcepti... | [
"Parses",
"the",
"specified",
"resource",
"and",
"uses",
"it",
"to",
"construct",
"a",
"populated",
"Homoglyph",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-less-commons/src/main/java/com/helger/lesscommons/homoglyphs/HomoglyphBuilder.java#L81-L86 | train |
phax/ph-commons | ph-less-commons/src/main/java/com/helger/lesscommons/homoglyphs/HomoglyphBuilder.java | HomoglyphBuilder.build | @Nonnull
public static Homoglyph build (@Nonnull @WillClose final Reader aReader) throws IOException
{
ValueEnforcer.notNull (aReader, "reader");
try (final NonBlockingBufferedReader aBR = new NonBlockingBufferedReader (aReader))
{
final ICommonsList <IntSet> aList = new CommonsArrayList <> ();
... | java | @Nonnull
public static Homoglyph build (@Nonnull @WillClose final Reader aReader) throws IOException
{
ValueEnforcer.notNull (aReader, "reader");
try (final NonBlockingBufferedReader aBR = new NonBlockingBufferedReader (aReader))
{
final ICommonsList <IntSet> aList = new CommonsArrayList <> ();
... | [
"@",
"Nonnull",
"public",
"static",
"Homoglyph",
"build",
"(",
"@",
"Nonnull",
"@",
"WillClose",
"final",
"Reader",
"aReader",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aReader",
",",
"\"reader\"",
")",
";",
"try",
"(",
"final... | Consumes the supplied Reader and uses it to construct a populated Homoglyph
object.
@param aReader
a Reader object that provides access to homoglyph data (see the
bundled char_codes.txt file for an example of the required format)
@return a Homoglyph object populated using the data returned by the Reader
object
@throws... | [
"Consumes",
"the",
"supplied",
"Reader",
"and",
"uses",
"it",
"to",
"construct",
"a",
"populated",
"Homoglyph",
"object",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-less-commons/src/main/java/com/helger/lesscommons/homoglyphs/HomoglyphBuilder.java#L100-L126 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setFormattedOutput | public static void setFormattedOutput (@Nonnull final Marshaller aMarshaller, final boolean bFormattedOutput)
{
_setProperty (aMarshaller, Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.valueOf (bFormattedOutput));
} | java | public static void setFormattedOutput (@Nonnull final Marshaller aMarshaller, final boolean bFormattedOutput)
{
_setProperty (aMarshaller, Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.valueOf (bFormattedOutput));
} | [
"public",
"static",
"void",
"setFormattedOutput",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"final",
"boolean",
"bFormattedOutput",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_FORMATTED_OUTPUT",
",",
"Boolean",
"... | Set the standard property for formatting the output or not.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFormattedOutput
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"formatting",
"the",
"output",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L130-L133 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setSchemaLocation | public static void setSchemaLocation (@Nonnull final Marshaller aMarshaller, @Nullable final String sSchemaLocation)
{
_setProperty (aMarshaller, Marshaller.JAXB_SCHEMA_LOCATION, sSchemaLocation);
} | java | public static void setSchemaLocation (@Nonnull final Marshaller aMarshaller, @Nullable final String sSchemaLocation)
{
_setProperty (aMarshaller, Marshaller.JAXB_SCHEMA_LOCATION, sSchemaLocation);
} | [
"public",
"static",
"void",
"setSchemaLocation",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nullable",
"final",
"String",
"sSchemaLocation",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_SCHEMA_LOCATION",
",",... | Set the standard property for setting the namespace schema location
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sSchemaLocation
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"setting",
"the",
"namespace",
"schema",
"location"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L148-L151 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setNoNamespaceSchemaLocation | public static void setNoNamespaceSchemaLocation (@Nonnull final Marshaller aMarshaller,
@Nullable final String sSchemaLocation)
{
_setProperty (aMarshaller, Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, sSchemaLocation);
} | java | public static void setNoNamespaceSchemaLocation (@Nonnull final Marshaller aMarshaller,
@Nullable final String sSchemaLocation)
{
_setProperty (aMarshaller, Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION, sSchemaLocation);
} | [
"public",
"static",
"void",
"setNoNamespaceSchemaLocation",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nullable",
"final",
"String",
"sSchemaLocation",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_NO_NAMESPACE_... | Set the standard property for setting the no-namespace schema location
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sSchemaLocation
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"setting",
"the",
"no",
"-",
"namespace",
"schema",
"location"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L167-L171 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setFragment | public static void setFragment (@Nonnull final Marshaller aMarshaller, final boolean bFragment)
{
_setProperty (aMarshaller, Marshaller.JAXB_FRAGMENT, Boolean.valueOf (bFragment));
} | java | public static void setFragment (@Nonnull final Marshaller aMarshaller, final boolean bFragment)
{
_setProperty (aMarshaller, Marshaller.JAXB_FRAGMENT, Boolean.valueOf (bFragment));
} | [
"public",
"static",
"void",
"setFragment",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"final",
"boolean",
"bFragment",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_FRAGMENT",
",",
"Boolean",
".",
"valueOf",
"("... | Set the standard property for marshalling a fragment only.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFragment
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"marshalling",
"a",
"fragment",
"only",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L187-L190 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setSunIndentString | public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString)
{
final String sPropertyName = SUN_INDENT_STRING;
_setProperty (aMarshaller, sPropertyName, sIndentString);
} | java | public static void setSunIndentString (@Nonnull final Marshaller aMarshaller, @Nullable final String sIndentString)
{
final String sPropertyName = SUN_INDENT_STRING;
_setProperty (aMarshaller, sPropertyName, sIndentString);
} | [
"public",
"static",
"void",
"setSunIndentString",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nullable",
"final",
"String",
"sIndentString",
")",
"{",
"final",
"String",
"sPropertyName",
"=",
"SUN_INDENT_STRING",
";",
"_setProperty",
"(",
... | Set the Sun specific property for the indent string.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sIndentString
the value to be set | [
"Set",
"the",
"Sun",
"specific",
"property",
"for",
"the",
"indent",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L205-L209 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setSunCharacterEscapeHandler | public static void setSunCharacterEscapeHandler (@Nonnull final Marshaller aMarshaller,
@Nonnull final Object aCharacterEscapeHandler)
{
final String sPropertyName = SUN_ENCODING_HANDLER2;
_setProperty (aMarshaller, sPropertyName, aCharacterEscapeHandler);
... | java | public static void setSunCharacterEscapeHandler (@Nonnull final Marshaller aMarshaller,
@Nonnull final Object aCharacterEscapeHandler)
{
final String sPropertyName = SUN_ENCODING_HANDLER2;
_setProperty (aMarshaller, sPropertyName, aCharacterEscapeHandler);
... | [
"public",
"static",
"void",
"setSunCharacterEscapeHandler",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nonnull",
"final",
"Object",
"aCharacterEscapeHandler",
")",
"{",
"final",
"String",
"sPropertyName",
"=",
"SUN_ENCODING_HANDLER2",
";",
"... | Set the Sun specific encoding handler. Value must implement
com.sun.xml.bind.marshaller.CharacterEscapeHandler
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param aCharacterEscapeHandler
the value to be set | [
"Set",
"the",
"Sun",
"specific",
"encoding",
"handler",
".",
"Value",
"must",
"implement",
"com",
".",
"sun",
".",
"xml",
".",
"bind",
".",
"marshaller",
".",
"CharacterEscapeHandler"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L227-L232 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setSunXMLHeaders | public static void setSunXMLHeaders (@Nonnull final Marshaller aMarshaller, @Nonnull final String sXMLHeaders)
{
final String sPropertyName = SUN_XML_HEADERS;
_setProperty (aMarshaller, sPropertyName, sXMLHeaders);
} | java | public static void setSunXMLHeaders (@Nonnull final Marshaller aMarshaller, @Nonnull final String sXMLHeaders)
{
final String sPropertyName = SUN_XML_HEADERS;
_setProperty (aMarshaller, sPropertyName, sXMLHeaders);
} | [
"public",
"static",
"void",
"setSunXMLHeaders",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"@",
"Nonnull",
"final",
"String",
"sXMLHeaders",
")",
"{",
"final",
"String",
"sPropertyName",
"=",
"SUN_XML_HEADERS",
";",
"_setProperty",
"(",
"aMars... | Set the Sun specific XML header string.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param sXMLHeaders
the value to be set | [
"Set",
"the",
"Sun",
"specific",
"XML",
"header",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L293-L297 | train |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.isSunJAXB2Marshaller | public static boolean isSunJAXB2Marshaller (@Nullable final Marshaller aMarshaller)
{
if (aMarshaller == null)
return false;
final String sClassName = aMarshaller.getClass ().getName ();
return sClassName.equals (JAXB_EXTERNAL_CLASS_NAME);
} | java | public static boolean isSunJAXB2Marshaller (@Nullable final Marshaller aMarshaller)
{
if (aMarshaller == null)
return false;
final String sClassName = aMarshaller.getClass ().getName ();
return sClassName.equals (JAXB_EXTERNAL_CLASS_NAME);
} | [
"public",
"static",
"boolean",
"isSunJAXB2Marshaller",
"(",
"@",
"Nullable",
"final",
"Marshaller",
"aMarshaller",
")",
"{",
"if",
"(",
"aMarshaller",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"sClassName",
"=",
"aMarshaller",
".",
"getClass"... | Check if the passed Marshaller is a Sun JAXB v2 marshaller. Use this method
to determined, whether the Sun specific methods may be invoked or not.
@param aMarshaller
The marshaller to be checked. May be <code>null</code>.
@return <code>true</code> if the passed marshaller is not <code>null</code>
and is of the Sun cla... | [
"Check",
"if",
"the",
"passed",
"Marshaller",
"is",
"a",
"Sun",
"JAXB",
"v2",
"marshaller",
".",
"Use",
"this",
"method",
"to",
"determined",
"whether",
"the",
"Sun",
"specific",
"methods",
"may",
"be",
"invoked",
"or",
"not",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L356-L362 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getWithLocale | @Nonnull
public static DateTimeFormatter getWithLocale (@Nonnull final DateTimeFormatter aFormatter,
@Nullable final Locale aDisplayLocale)
{
DateTimeFormatter ret = aFormatter;
if (aDisplayLocale != null)
ret = ret.withLocale (aDisplayLocale);
retu... | java | @Nonnull
public static DateTimeFormatter getWithLocale (@Nonnull final DateTimeFormatter aFormatter,
@Nullable final Locale aDisplayLocale)
{
DateTimeFormatter ret = aFormatter;
if (aDisplayLocale != null)
ret = ret.withLocale (aDisplayLocale);
retu... | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getWithLocale",
"(",
"@",
"Nonnull",
"final",
"DateTimeFormatter",
"aFormatter",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"DateTimeFormatter",
"ret",
"=",
"aFormatter",
";",
"if",
... | Assign the passed display locale to the passed date time formatter.
@param aFormatter
The formatter to be modified. May not be <code>null</code>.
@param aDisplayLocale
The display locale to be used. May be <code>null</code>.
@return The modified date time formatter. Never <code>null</code>. | [
"Assign",
"the",
"passed",
"display",
"locale",
"to",
"the",
"passed",
"date",
"time",
"formatter",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L227-L235 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getFormatterDate | @Nonnull
public static DateTimeFormatter getFormatterDate (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (new CacheKey... | java | @Nonnull
public static DateTimeFormatter getFormatterDate (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (new CacheKey... | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getFormatterDate",
"(",
"@",
"Nonnull",
"final",
"FormatStyle",
"eStyle",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
",",
"@",
"Nonnull",
"final",
"EDTFormatterMode",
"eMode",
")",
"{",
"ret... | Get the date formatter for the passed locale.
@param eStyle
The format style to be used. May not be <code>null</code>.
@param aDisplayLocale
The display locale to be used. May be <code>null</code>.
@param eMode
Print or parse? May not be <code>null</code>.
@return The created date formatter. Never <code>null</code>.
@... | [
"Get",
"the",
"date",
"formatter",
"for",
"the",
"passed",
"locale",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L257-L263 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getFormatterTime | @Nonnull
public static DateTimeFormatter getFormatterTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (new CacheKey... | java | @Nonnull
public static DateTimeFormatter getFormatterTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (new CacheKey... | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getFormatterTime",
"(",
"@",
"Nonnull",
"final",
"FormatStyle",
"eStyle",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
",",
"@",
"Nonnull",
"final",
"EDTFormatterMode",
"eMode",
")",
"{",
"ret... | Get the time formatter for the passed locale.
@param eStyle
The format style to be used. May not be <code>null</code>.
@param aDisplayLocale
The display locale to be used. May be <code>null</code>.
@param eMode
Print or parse? May not be <code>null</code>.
@return The created time formatter. Never <code>null</code>.
@... | [
"Get",
"the",
"time",
"formatter",
"for",
"the",
"passed",
"locale",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L277-L283 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java | PDTFormatter.getFormatterDateTime | @Nonnull
public static DateTimeFormatter getFormatterDateTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (... | java | @Nonnull
public static DateTimeFormatter getFormatterDateTime (@Nonnull final FormatStyle eStyle,
@Nullable final Locale aDisplayLocale,
@Nonnull final EDTFormatterMode eMode)
{
return _getFormatter (... | [
"@",
"Nonnull",
"public",
"static",
"DateTimeFormatter",
"getFormatterDateTime",
"(",
"@",
"Nonnull",
"final",
"FormatStyle",
"eStyle",
",",
"@",
"Nullable",
"final",
"Locale",
"aDisplayLocale",
",",
"@",
"Nonnull",
"final",
"EDTFormatterMode",
"eMode",
")",
"{",
... | Get the date time formatter for the passed locale.
@param eStyle
The format style to be used. May not be <code>null</code>.
@param aDisplayLocale
The display locale to be used. May be <code>null</code>.
@param eMode
Print or parse? May not be <code>null</code>.
@return The created date time formatter. Never <code>null... | [
"Get",
"the",
"date",
"time",
"formatter",
"for",
"the",
"passed",
"locale",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/PDTFormatter.java#L297-L303 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/codec/QuotedPrintableCodec.java | QuotedPrintableCodec.writeEncodeQuotedPrintableByte | public static final void writeEncodeQuotedPrintableByte (final int b,
@Nonnull final OutputStream aOS) throws IOException
{
final char cHigh = StringHelper.getHexCharUpperCase ((b >> 4) & 0xF);
final char cLow = StringHelper.getHexCharUpperCase (b & 0... | java | public static final void writeEncodeQuotedPrintableByte (final int b,
@Nonnull final OutputStream aOS) throws IOException
{
final char cHigh = StringHelper.getHexCharUpperCase ((b >> 4) & 0xF);
final char cLow = StringHelper.getHexCharUpperCase (b & 0... | [
"public",
"static",
"final",
"void",
"writeEncodeQuotedPrintableByte",
"(",
"final",
"int",
"b",
",",
"@",
"Nonnull",
"final",
"OutputStream",
"aOS",
")",
"throws",
"IOException",
"{",
"final",
"char",
"cHigh",
"=",
"StringHelper",
".",
"getHexCharUpperCase",
"(",... | Encodes byte into its quoted-printable representation.
@param b
byte to encode
@param aOS
the output stream to write to
@throws IOException
In case writing to the OutputStream failed | [
"Encodes",
"byte",
"into",
"its",
"quoted",
"-",
"printable",
"representation",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/codec/QuotedPrintableCodec.java#L103-L111 | train |
phax/ph-commons | ph-collection/src/main/java/com/helger/collection/map/IntFloatMap.java | IntFloatMap._getReadIndex | @CheckForSigned
private int _getReadIndex (final int key)
{
int idx = MapHelper.phiMix (key) & m_nMask;
if (m_aKeys[idx] == key)
{
// we check FREE prior to this call
return idx;
}
if (m_aKeys[idx] == FREE_KEY)
{
// end of chain already
return -1;
}
final int ... | java | @CheckForSigned
private int _getReadIndex (final int key)
{
int idx = MapHelper.phiMix (key) & m_nMask;
if (m_aKeys[idx] == key)
{
// we check FREE prior to this call
return idx;
}
if (m_aKeys[idx] == FREE_KEY)
{
// end of chain already
return -1;
}
final int ... | [
"@",
"CheckForSigned",
"private",
"int",
"_getReadIndex",
"(",
"final",
"int",
"key",
")",
"{",
"int",
"idx",
"=",
"MapHelper",
".",
"phiMix",
"(",
"key",
")",
"&",
"m_nMask",
";",
"if",
"(",
"m_aKeys",
"[",
"idx",
"]",
"==",
"key",
")",
"{",
"// we ... | Find key position in the map.
@param key
Key to look for
@return Key position or -1 if not found | [
"Find",
"key",
"position",
"in",
"the",
"map",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-collection/src/main/java/com/helger/collection/map/IntFloatMap.java#L276-L299 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java | LocaleHelper.getLocaleDisplayName | @Nonnull
public static String getLocaleDisplayName (@Nullable final Locale aLocale, @Nonnull final Locale aContentLocale)
{
ValueEnforcer.notNull (aContentLocale, "ContentLocale");
if (aLocale == null || aLocale.equals (LOCALE_INDEPENDENT))
return ELocaleName.ID_LANGUAGE_INDEPENDENT.getDisplayText (a... | java | @Nonnull
public static String getLocaleDisplayName (@Nullable final Locale aLocale, @Nonnull final Locale aContentLocale)
{
ValueEnforcer.notNull (aContentLocale, "ContentLocale");
if (aLocale == null || aLocale.equals (LOCALE_INDEPENDENT))
return ELocaleName.ID_LANGUAGE_INDEPENDENT.getDisplayText (a... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getLocaleDisplayName",
"(",
"@",
"Nullable",
"final",
"Locale",
"aLocale",
",",
"@",
"Nonnull",
"final",
"Locale",
"aContentLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aContentLocale",
",",
"\"ContentLoc... | Get the display name of the passed language in the currently selected UI
language.
@param aLocale
The locale from which the display name is required. May be
<code>null</code>.
@param aContentLocale
The locale in which the name of the locale is required. If aLocale
is "de" and display locale is "de" the result would be... | [
"Get",
"the",
"display",
"name",
"of",
"the",
"passed",
"language",
"in",
"the",
"currently",
"selected",
"UI",
"language",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java#L146-L156 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java | LocaleHelper.getAllLocaleDisplayNames | @Nonnull
@ReturnsMutableCopy
public static ICommonsMap <Locale, String> getAllLocaleDisplayNames (@Nonnull final Locale aContentLocale)
{
ValueEnforcer.notNull (aContentLocale, "ContentLocale");
return new CommonsHashMap <> (LocaleCache.getInstance ().getAllLocales (),
F... | java | @Nonnull
@ReturnsMutableCopy
public static ICommonsMap <Locale, String> getAllLocaleDisplayNames (@Nonnull final Locale aContentLocale)
{
ValueEnforcer.notNull (aContentLocale, "ContentLocale");
return new CommonsHashMap <> (LocaleCache.getInstance ().getAllLocales (),
F... | [
"@",
"Nonnull",
"@",
"ReturnsMutableCopy",
"public",
"static",
"ICommonsMap",
"<",
"Locale",
",",
"String",
">",
"getAllLocaleDisplayNames",
"(",
"@",
"Nonnull",
"final",
"Locale",
"aContentLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aContentLocale",
... | Get all possible locale names in the passed locale
@param aContentLocale
the locale ID in which the language list is required
@return The mapping from the input locale to the display text. The result
map is not ordered. | [
"Get",
"all",
"possible",
"locale",
"names",
"in",
"the",
"passed",
"locale"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java#L180-L189 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java | LocaleHelper.getLocaleFromString | @Nonnull
public static Locale getLocaleFromString (@Nullable final String sLocaleAsString)
{
if (StringHelper.hasNoText (sLocaleAsString))
{
// not specified => getDefault
return SystemHelper.getSystemLocale ();
}
String sLanguage;
String sCountry;
String sVariant;
int i1 =... | java | @Nonnull
public static Locale getLocaleFromString (@Nullable final String sLocaleAsString)
{
if (StringHelper.hasNoText (sLocaleAsString))
{
// not specified => getDefault
return SystemHelper.getSystemLocale ();
}
String sLanguage;
String sCountry;
String sVariant;
int i1 =... | [
"@",
"Nonnull",
"public",
"static",
"Locale",
"getLocaleFromString",
"(",
"@",
"Nullable",
"final",
"String",
"sLocaleAsString",
")",
"{",
"if",
"(",
"StringHelper",
".",
"hasNoText",
"(",
"sLocaleAsString",
")",
")",
"{",
"// not specified => getDefault",
"return",... | Convert a String in the form "language-country-variant" to a Locale object.
Language needs to have exactly 2 characters. Country is optional but if
present needs to have exactly 2 characters. Variant is optional.
@param sLocaleAsString
The string representation to be converted to a Locale.
@return Never <code>null</co... | [
"Convert",
"a",
"String",
"in",
"the",
"form",
"language",
"-",
"country",
"-",
"variant",
"to",
"a",
"Locale",
"object",
".",
"Language",
"needs",
"to",
"have",
"exactly",
"2",
"characters",
".",
"Country",
"is",
"optional",
"but",
"if",
"present",
"needs... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleHelper.java#L234-L295 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper._getWithLeadingOrTrailing | @Nonnull
private static String _getWithLeadingOrTrailing (@Nullable final String sSrc,
@Nonnegative final int nMinLen,
final char cGap,
final boolean bLeading)
{
... | java | @Nonnull
private static String _getWithLeadingOrTrailing (@Nullable final String sSrc,
@Nonnegative final int nMinLen,
final char cGap,
final boolean bLeading)
{
... | [
"@",
"Nonnull",
"private",
"static",
"String",
"_getWithLeadingOrTrailing",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"@",
"Nonnegative",
"final",
"int",
"nMinLen",
",",
"final",
"char",
"cGap",
",",
"final",
"boolean",
"bLeading",
")",
"{",
"if",
... | Get the result string with at least the desired length, and fill the lead or
trail with the provided char
@param sSrc
Source string. May be <code>null</code> or empty.
@param nMinLen
The destination minimum length. Should be > 0 to have an impact.
@param cGap
The character to use to fill the gap
@param bLeading
<co... | [
"Get",
"the",
"result",
"string",
"with",
"at",
"least",
"the",
"desired",
"length",
"and",
"fill",
"the",
"lead",
"or",
"trail",
"with",
"the",
"provided",
"char"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L450-L484 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithLeading | @Nonnull
public static String getWithLeading (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cFront)
{
return _getWithLeadingOrTrailing (sSrc, nMinLen, cFront, true);
} | java | @Nonnull
public static String getWithLeading (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cFront)
{
return _getWithLeadingOrTrailing (sSrc, nMinLen, cFront, true);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithLeading",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"@",
"Nonnegative",
"final",
"int",
"nMinLen",
",",
"final",
"char",
"cFront",
")",
"{",
"return",
"_getWithLeadingOrTrailing",
"(",
"sSrc",
"... | Get a string that is filled at the beginning with the passed character until
the minimum length is reached. If the input string is empty, the result is a
string with the provided len only consisting of the passed characters. If the
input String is longer than the provided length, it is returned unchanged.
@param sSrc
... | [
"Get",
"a",
"string",
"that",
"is",
"filled",
"at",
"the",
"beginning",
"with",
"the",
"passed",
"character",
"until",
"the",
"minimum",
"length",
"is",
"reached",
".",
"If",
"the",
"input",
"string",
"is",
"empty",
"the",
"result",
"is",
"a",
"string",
... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L500-L504 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithLeading | @Nonnull
public static String getWithLeading (final int nValue, @Nonnegative final int nMinLen, final char cFront)
{
return _getWithLeadingOrTrailing (Integer.toString (nValue), nMinLen, cFront, true);
} | java | @Nonnull
public static String getWithLeading (final int nValue, @Nonnegative final int nMinLen, final char cFront)
{
return _getWithLeadingOrTrailing (Integer.toString (nValue), nMinLen, cFront, true);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithLeading",
"(",
"final",
"int",
"nValue",
",",
"@",
"Nonnegative",
"final",
"int",
"nMinLen",
",",
"final",
"char",
"cFront",
")",
"{",
"return",
"_getWithLeadingOrTrailing",
"(",
"Integer",
".",
"toString",
... | Get a string that is filled at the beginning with the passed character until
the minimum length is reached. If the input String is longer than the
provided length, it is returned unchanged.
@param nValue
Source string. May be <code>null</code>.
@param nMinLen
Minimum length. Should be > 0.
@param cFront
The charact... | [
"Get",
"a",
"string",
"that",
"is",
"filled",
"at",
"the",
"beginning",
"with",
"the",
"passed",
"character",
"until",
"the",
"minimum",
"length",
"is",
"reached",
".",
"If",
"the",
"input",
"String",
"is",
"longer",
"than",
"the",
"provided",
"length",
"i... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L520-L524 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithTrailing | @Nonnull
public static String getWithTrailing (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cEnd)
{
return _getWithLeadingOrTrailing (sSrc, nMinLen, cEnd, false);
} | java | @Nonnull
public static String getWithTrailing (@Nullable final String sSrc, @Nonnegative final int nMinLen, final char cEnd)
{
return _getWithLeadingOrTrailing (sSrc, nMinLen, cEnd, false);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithTrailing",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"@",
"Nonnegative",
"final",
"int",
"nMinLen",
",",
"final",
"char",
"cEnd",
")",
"{",
"return",
"_getWithLeadingOrTrailing",
"(",
"sSrc",
",... | Get a string that is filled at the end with the passed character until the
minimum length is reached. If the input string is empty, the result is a
string with the provided len only consisting of the passed characters. If the
input String is longer than the provided length, it is returned unchanged.
@param sSrc
Source... | [
"Get",
"a",
"string",
"that",
"is",
"filled",
"at",
"the",
"end",
"with",
"the",
"passed",
"character",
"until",
"the",
"minimum",
"length",
"is",
"reached",
".",
"If",
"the",
"input",
"string",
"is",
"empty",
"the",
"result",
"is",
"a",
"string",
"with"... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L560-L564 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getHexEncoded | @Nonnull
public static String getHexEncoded (@Nonnull final String sInput, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sInput, "Input");
ValueEnforcer.notNull (aCharset, "Charset");
return getHexEncoded (sInput.getBytes (aCharset));
} | java | @Nonnull
public static String getHexEncoded (@Nonnull final String sInput, @Nonnull final Charset aCharset)
{
ValueEnforcer.notNull (sInput, "Input");
ValueEnforcer.notNull (aCharset, "Charset");
return getHexEncoded (sInput.getBytes (aCharset));
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getHexEncoded",
"(",
"@",
"Nonnull",
"final",
"String",
"sInput",
",",
"@",
"Nonnull",
"final",
"Charset",
"aCharset",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sInput",
",",
"\"Input\"",
")",
";",
"Value... | Convert a string to a byte array and than to a hexadecimal encoded string.
@param sInput
The source string. May not be <code>null</code>.
@param aCharset
The charset to use. May not be <code>null</code>.
@return The String representation of the byte array of the string. | [
"Convert",
"a",
"string",
"to",
"a",
"byte",
"array",
"and",
"than",
"to",
"a",
"hexadecimal",
"encoded",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L601-L608 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLeadingCharCount | @Nonnegative
public static int getLeadingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
final int nMax = s.length ();
while (ret < nMax && s.charAt (ret) == c)
++ret;
}
return ret;
} | java | @Nonnegative
public static int getLeadingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
final int nMax = s.length ();
while (ret < nMax && s.charAt (ret) == c)
++ret;
}
return ret;
} | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getLeadingCharCount",
"(",
"@",
"Nullable",
"final",
"String",
"s",
",",
"final",
"char",
"c",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"final",
"int",
"nMax",
"=",... | Get the number of specified chars, the passed string starts with.
@param s
The string to be parsed. May be <code>null</code>.
@param c
The char to be searched.
@return Always ≥ 0. | [
"Get",
"the",
"number",
"of",
"specified",
"chars",
"the",
"passed",
"string",
"starts",
"with",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L839-L850 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getTrailingCharCount | @Nonnegative
public static int getTrailingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
int nLast = s.length () - 1;
while (nLast >= 0 && s.charAt (nLast) == c)
{
++ret;
--nLast;
}
}
return ret;
} | java | @Nonnegative
public static int getTrailingCharCount (@Nullable final String s, final char c)
{
int ret = 0;
if (s != null)
{
int nLast = s.length () - 1;
while (nLast >= 0 && s.charAt (nLast) == c)
{
++ret;
--nLast;
}
}
return ret;
} | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getTrailingCharCount",
"(",
"@",
"Nullable",
"final",
"String",
"s",
",",
"final",
"char",
"c",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"int",
"nLast",
"=",
"s",
... | Get the number of specified chars, the passed string ends with.
@param s
The string to be parsed. May be <code>null</code>.
@param c
The char to be searched.
@return Always ≥ 0. | [
"Get",
"the",
"number",
"of",
"specified",
"chars",
"the",
"passed",
"string",
"ends",
"with",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L861-L875 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getImplodedMapped | @Nonnull
public static <ELEMENTTYPE> String getImplodedMapped (@Nonnull final String sSep,
@Nullable final ELEMENTTYPE [] aElements,
@Nonnull final Function <? super ELEMENTTYPE, String> aMapper)
{
Va... | java | @Nonnull
public static <ELEMENTTYPE> String getImplodedMapped (@Nonnull final String sSep,
@Nullable final ELEMENTTYPE [] aElements,
@Nonnull final Function <? super ELEMENTTYPE, String> aMapper)
{
Va... | [
"@",
"Nonnull",
"public",
"static",
"<",
"ELEMENTTYPE",
">",
"String",
"getImplodedMapped",
"(",
"@",
"Nonnull",
"final",
"String",
"sSep",
",",
"@",
"Nullable",
"final",
"ELEMENTTYPE",
"[",
"]",
"aElements",
",",
"@",
"Nonnull",
"final",
"Function",
"<",
"?... | Get a concatenated String from all elements of the passed array, separated by
the specified separator string.
@param sSep
The separator to use. May not be <code>null</code>.
@param aElements
The container to convert. May be <code>null</code> or empty.
@param aMapper
The mapping function to convert from ELEMENTTYPE to ... | [
"Get",
"a",
"concatenated",
"String",
"from",
"all",
"elements",
"of",
"the",
"passed",
"array",
"separated",
"by",
"the",
"specified",
"separator",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L1335-L1346 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.explode | public static void explode (final char cSep,
@Nullable final String sElements,
@Nonnull final Consumer <? super String> aConsumer)
{
explode (cSep, sElements, -1, aConsumer);
} | java | public static void explode (final char cSep,
@Nullable final String sElements,
@Nonnull final Consumer <? super String> aConsumer)
{
explode (cSep, sElements, -1, aConsumer);
} | [
"public",
"static",
"void",
"explode",
"(",
"final",
"char",
"cSep",
",",
"@",
"Nullable",
"final",
"String",
"sElements",
",",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"String",
">",
"aConsumer",
")",
"{",
"explode",
"(",
"cSep",
",",
"sE... | Split the provided string by the provided separator and invoke the consumer
for each matched element. The number of returned items is unlimited.
@param cSep
The separator to use.
@param sElements
The concatenated String to convert. May be <code>null</code> or empty.
@param aConsumer
The non-<code>null</code> consumer ... | [
"Split",
"the",
"provided",
"string",
"by",
"the",
"provided",
"separator",
"and",
"invoke",
"the",
"consumer",
"for",
"each",
"matched",
"element",
".",
"The",
"number",
"of",
"returned",
"items",
"is",
"unlimited",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2013-L2018 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getExploded | @Nonnull
@CodingStyleguideUnaware
public static <COLLTYPE extends Collection <String>> COLLTYPE getExploded (@Nonnull final String sSep,
@Nullable final String sElements,
... | java | @Nonnull
@CodingStyleguideUnaware
public static <COLLTYPE extends Collection <String>> COLLTYPE getExploded (@Nonnull final String sSep,
@Nullable final String sElements,
... | [
"@",
"Nonnull",
"@",
"CodingStyleguideUnaware",
"public",
"static",
"<",
"COLLTYPE",
"extends",
"Collection",
"<",
"String",
">",
">",
"COLLTYPE",
"getExploded",
"(",
"@",
"Nonnull",
"final",
"String",
"sSep",
",",
"@",
"Nullable",
"final",
"String",
"sElements"... | Take a concatenated String and return the passed Collection of all elements
in the passed string, using specified separator string.
@param <COLLTYPE>
The collection type to be used and returned
@param sSep
The separator to use. May not be <code>null</code>.
@param sElements
The concatenated String to convert. May be <... | [
"Take",
"a",
"concatenated",
"String",
"and",
"return",
"the",
"passed",
"Collection",
"of",
"all",
"elements",
"in",
"the",
"passed",
"string",
"using",
"specified",
"separator",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2139-L2148 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.explode | public static void explode (@Nonnull final String sSep,
@Nullable final String sElements,
@Nonnull final Consumer <? super String> aConsumer)
{
explode (sSep, sElements, -1, aConsumer);
} | java | public static void explode (@Nonnull final String sSep,
@Nullable final String sElements,
@Nonnull final Consumer <? super String> aConsumer)
{
explode (sSep, sElements, -1, aConsumer);
} | [
"public",
"static",
"void",
"explode",
"(",
"@",
"Nonnull",
"final",
"String",
"sSep",
",",
"@",
"Nullable",
"final",
"String",
"sElements",
",",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"String",
">",
"aConsumer",
")",
"{",
"explode",
"(",
... | Split the provided string by the provided separator and invoke the consumer
for each matched element.
@param sSep
The separator to use. May not be <code>null</code>.
@param sElements
The concatenated String to convert. May be <code>null</code> or empty.
@param aConsumer
The non-<code>null</code> consumer that is invok... | [
"Split",
"the",
"provided",
"string",
"by",
"the",
"provided",
"separator",
"and",
"invoke",
"the",
"consumer",
"for",
"each",
"matched",
"element",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2162-L2167 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getIndexOf | public static int getIndexOf (@Nullable final String sText,
@Nonnegative final int nFromIndex,
@Nullable final String sSearch)
{
return sText != null &&
sSearch != null &&
(sText.length () - nFromIndex) >= sSearch.length () ? sT... | java | public static int getIndexOf (@Nullable final String sText,
@Nonnegative final int nFromIndex,
@Nullable final String sSearch)
{
return sText != null &&
sSearch != null &&
(sText.length () - nFromIndex) >= sSearch.length () ? sT... | [
"public",
"static",
"int",
"getIndexOf",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nonnegative",
"final",
"int",
"nFromIndex",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sSearch",
... | Get the first index of sSearch within sText starting at index nFromIndex.
@param sText
The text to search in. May be <code>null</code>.
@param nFromIndex
The index to start searching in the source string
@param sSearch
The text to search for. May be <code>null</code>.
@return The first index of sSearch within sText or... | [
"Get",
"the",
"first",
"index",
"of",
"sSearch",
"within",
"sText",
"starting",
"at",
"index",
"nFromIndex",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2695-L2702 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastIndexOf | public static int getLastIndexOf (@Nullable final String sText, @Nullable final String sSearch)
{
return sText != null && sSearch != null && sText.length () >= sSearch.length () ? sText.lastIndexOf (sSearch)
: STRING_NOT_FOUND;
... | java | public static int getLastIndexOf (@Nullable final String sText, @Nullable final String sSearch)
{
return sText != null && sSearch != null && sText.length () >= sSearch.length () ? sText.lastIndexOf (sSearch)
: STRING_NOT_FOUND;
... | [
"public",
"static",
"int",
"getLastIndexOf",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sSearch",
"!=",
"null",
"&&",
"sText",
".",
"length",
"(",
... | Get the last index of sSearch within sText.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@return The last index of sSearch within sText or {@value #STRING_NOT_FOUND}
if sSearch was not found or if any parameter was <code>null</code>.
@se... | [
"Get",
"the",
"last",
"index",
"of",
"sSearch",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2715-L2719 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getIndexOf | public static int getIndexOf (@Nullable final String sText, final char cSearch)
{
return sText != null && sText.length () >= 1 ? sText.indexOf (cSearch) : STRING_NOT_FOUND;
} | java | public static int getIndexOf (@Nullable final String sText, final char cSearch)
{
return sText != null && sText.length () >= 1 ? sText.indexOf (cSearch) : STRING_NOT_FOUND;
} | [
"public",
"static",
"int",
"getIndexOf",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sText",
".",
"length",
"(",
")",
">=",
"1",
"?",
"sText",
".",
"indexOf",
"(",... | Get the first index of cSearch within sText.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The character to search for. May be <code>null</code>.
@return The first index of sSearch within sText or {@value #STRING_NOT_FOUND}
if cSearch was not found or if any parameter was <code>null</cod... | [
"Get",
"the",
"first",
"index",
"of",
"cSearch",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2755-L2758 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastIndexOf | public static int getLastIndexOf (@Nullable final String sText, final char cSearch)
{
return sText != null && sText.length () >= 1 ? sText.lastIndexOf (cSearch) : STRING_NOT_FOUND;
} | java | public static int getLastIndexOf (@Nullable final String sText, final char cSearch)
{
return sText != null && sText.length () >= 1 ? sText.lastIndexOf (cSearch) : STRING_NOT_FOUND;
} | [
"public",
"static",
"int",
"getLastIndexOf",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sText",
".",
"length",
"(",
")",
">=",
"1",
"?",
"sText",
".",
"lastIndexOf"... | Get the last index of cSearch within sText.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The character to search for. May be <code>null</code>.
@return The last index of sSearch within sText or {@value #STRING_NOT_FOUND}
if cSearch was not found or if any parameter was <code>null</code>... | [
"Get",
"the",
"last",
"index",
"of",
"cSearch",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2790-L2793 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getIndexOfIgnoreCase | public static int getIndexOfIgnoreCase (@Nullable final String sText,
@Nonnegative final int nFromIndex,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText !... | java | public static int getIndexOfIgnoreCase (@Nullable final String sText,
@Nonnegative final int nFromIndex,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText !... | [
"public",
"static",
"int",
"getIndexOfIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nonnegative",
"final",
"int",
"nFromIndex",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",... | Get the first index of sSearch within sText ignoring case starting at index
nFromIndex.
@param sText
The text to search in. May be <code>null</code>.
@param nFromIndex
The index to start searching in the source string
@param sSearch
The text to search for. May be <code>null</code>.
@param aSortLocale
The locale to be ... | [
"Get",
"the",
"first",
"index",
"of",
"sSearch",
"within",
"sText",
"ignoring",
"case",
"starting",
"at",
"index",
"nFromIndex",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2852-L2864 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastIndexOfIgnoreCase | public static int getLastIndexOfIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null &&
sSearch != null &&
sText.length (... | java | public static int getLastIndexOfIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null &&
sSearch != null &&
sText.length (... | [
"public",
"static",
"int",
"getLastIndexOfIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",... | Get the last index of sSearch within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return The last index of sSearch within sText or {@value #STRING_NOT_FOUN... | [
"Get",
"the",
"last",
"index",
"of",
"sSearch",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2879-L2886 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getIndexOfIgnoreCase | public static int getIndexOfIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sText.length () >= 1 ? sText.toLowerCase (aSortLocale)
... | java | public static int getIndexOfIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sText.length () >= 1 ? sText.toLowerCase (aSortLocale)
... | [
"public",
"static",
"int",
"getIndexOfIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sText",
".",
"lengt... | Get the first index of cSearch within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The char to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return The first index of sSearch within sText or {@value #STRING_NOT_FO... | [
"Get",
"the",
"first",
"index",
"of",
"cSearch",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2931-L2938 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastIndexOfIgnoreCase | public static int getLastIndexOfIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sText.length () >= 1
... | java | public static int getLastIndexOfIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sText.length () >= 1
... | [
"public",
"static",
"int",
"getLastIndexOfIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"sText",
"!=",
"null",
"&&",
"sText",
".",
"l... | Get the last index of cSearch within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The char to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return The last index of sSearch within sText or {@value #STRING_NOT_FOUN... | [
"Get",
"the",
"last",
"index",
"of",
"cSearch",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L2980-L2988 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.contains | public static boolean contains (@Nullable final String sText, @Nullable final String sSearch)
{
return getIndexOf (sText, sSearch) != STRING_NOT_FOUND;
} | java | public static boolean contains (@Nullable final String sText, @Nullable final String sSearch)
{
return getIndexOf (sText, sSearch) != STRING_NOT_FOUND;
} | [
"public",
"static",
"boolean",
"contains",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"return",
"getIndexOf",
"(",
"sText",
",",
"sSearch",
")",
"!=",
"STRING_NOT_FOUND",
";",
"}"
] | Check if sSearch is contained within sText.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@return <code>true</code> if sSearch is contained in sText,
<code>false</code> otherwise.
@see String#contains(CharSequence) | [
"Check",
"if",
"sSearch",
"is",
"contained",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3028-L3031 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsIgnoreCase | public static boolean containsIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return getIndexOfIgnoreCase (sText, sSearch, aSortLocale) != STRING_NOT_FOUND;
} | java | public static boolean containsIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return getIndexOfIgnoreCase (sText, sSearch, aSortLocale) != STRING_NOT_FOUND;
} | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"getIndexOfIgnoreCase",
"(",
"sT... | Check if sSearch is contained within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return <code>true</code> if sSearch is contained in sText,
<code>false</c... | [
"Check",
"if",
"sSearch",
"is",
"contained",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3062-L3067 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsIgnoreCase | public static boolean containsIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return getIndexOfIgnoreCase (sText, cSearch, aSortLocale) != STRING_NOT_FOUND;
} | java | public static boolean containsIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return getIndexOfIgnoreCase (sText, cSearch, aSortLocale) != STRING_NOT_FOUND;
} | [
"public",
"static",
"boolean",
"containsIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"getIndexOfIgnoreCase",
"(",
"sText",
",",
"cSearch... | Check if cSearch is contained within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The char to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return <code>true</code> if sSearch is contained in sText,
<code>false</c... | [
"Check",
"if",
"cSearch",
"is",
"contained",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3082-L3087 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsAny | public static boolean containsAny (@Nullable final char [] aInput, @Nonnull final char [] aSearchChars)
{
ValueEnforcer.notNull (aSearchChars, "SearchChars");
if (aInput != null)
for (final char cIn : aInput)
if (ArrayHelper.contains (aSearchChars, cIn))
return true;
return false;... | java | public static boolean containsAny (@Nullable final char [] aInput, @Nonnull final char [] aSearchChars)
{
ValueEnforcer.notNull (aSearchChars, "SearchChars");
if (aInput != null)
for (final char cIn : aInput)
if (ArrayHelper.contains (aSearchChars, cIn))
return true;
return false;... | [
"public",
"static",
"boolean",
"containsAny",
"(",
"@",
"Nullable",
"final",
"char",
"[",
"]",
"aInput",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aSearchChars",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSearchChars",
",",
"\"SearchChars\"",
"... | Check if any of the passed searched characters is contained in the input char
array.
@param aInput
The input char array. May be <code>null</code>.
@param aSearchChars
The char array to search. May not be <code>null</code>.
@return <code>true</code> if at least any of the search char is contained in
the input char arra... | [
"Check",
"if",
"any",
"of",
"the",
"passed",
"searched",
"characters",
"is",
"contained",
"in",
"the",
"input",
"char",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3100-L3109 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsAny | public static boolean containsAny (@Nullable final String sInput, @Nonnull final char [] aSearchChars)
{
return sInput != null && containsAny (sInput.toCharArray (), aSearchChars);
} | java | public static boolean containsAny (@Nullable final String sInput, @Nonnull final char [] aSearchChars)
{
return sInput != null && containsAny (sInput.toCharArray (), aSearchChars);
} | [
"public",
"static",
"boolean",
"containsAny",
"(",
"@",
"Nullable",
"final",
"String",
"sInput",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aSearchChars",
")",
"{",
"return",
"sInput",
"!=",
"null",
"&&",
"containsAny",
"(",
"sInput",
".",
"toCharArray... | Check if any of the passed searched characters in contained in the input
string.
@param sInput
The input string. May be <code>null</code>.
@param aSearchChars
The char array to search. May not be <code>null</code>.
@return <code>true</code> if at least any of the search char is contained in
the input char array, <code... | [
"Check",
"if",
"any",
"of",
"the",
"passed",
"searched",
"characters",
"in",
"contained",
"in",
"the",
"input",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3122-L3125 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getOccurrenceCount | @Nonnegative
public static int getOccurrenceCount (@Nullable final String sText, @Nullable final String sSearch)
{
int ret = 0;
final int nTextLength = getLength (sText);
final int nSearchLength = getLength (sSearch);
if (nSearchLength > 0 && nTextLength >= nSearchLength)
{
int nLastIndex ... | java | @Nonnegative
public static int getOccurrenceCount (@Nullable final String sText, @Nullable final String sSearch)
{
int ret = 0;
final int nTextLength = getLength (sText);
final int nSearchLength = getLength (sSearch);
if (nSearchLength > 0 && nTextLength >= nSearchLength)
{
int nLastIndex ... | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getOccurrenceCount",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"final",
"int",
"nTextLength",
"=",
"getLength",... | Count the number of occurrences of sSearch within sText.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@return A non-negative number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"sSearch",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3136-L3162 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getOccurrenceCountIgnoreCase | @Nonnegative
public static int getOccurrenceCountIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sSearch != null ? getOccurre... | java | @Nonnegative
public static int getOccurrenceCountIgnoreCase (@Nullable final String sText,
@Nullable final String sSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null && sSearch != null ? getOccurre... | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getOccurrenceCountIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"@",
"Nullable",
"final",
"String",
"sSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"sText... | Count the number of occurrences of sSearch within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param sSearch
The text to search for. May be <code>null</code>.
@param aSortLocale
The locale to be used for case unifying.
@return A non-negative number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"sSearch",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3175-L3183 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getOccurrenceCount | @Nonnegative
public static int getOccurrenceCount (@Nullable final String sText, final char cSearch)
{
int ret = 0;
final int nTextLength = getLength (sText);
if (nTextLength >= 1)
{
int nLastIndex = 0;
int nIndex;
do
{
// Start searching from the last result
... | java | @Nonnegative
public static int getOccurrenceCount (@Nullable final String sText, final char cSearch)
{
int ret = 0;
final int nTextLength = getLength (sText);
if (nTextLength >= 1)
{
int nLastIndex = 0;
int nIndex;
do
{
// Start searching from the last result
... | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getOccurrenceCount",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"final",
"int",
"nTextLength",
"=",
"getLength",
"(",
"sText",
")... | Count the number of occurrences of cSearch within sText.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The character to search for.
@return A non-negative number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"cSearch",
"within",
"sText",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3194-L3219 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getOccurrenceCountIgnoreCase | @Nonnegative
public static int getOccurrenceCountIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null ? getOccurrenceCount (sText.toLowerCase (aS... | java | @Nonnegative
public static int getOccurrenceCountIgnoreCase (@Nullable final String sText,
final char cSearch,
@Nonnull final Locale aSortLocale)
{
return sText != null ? getOccurrenceCount (sText.toLowerCase (aS... | [
"@",
"Nonnegative",
"public",
"static",
"int",
"getOccurrenceCountIgnoreCase",
"(",
"@",
"Nullable",
"final",
"String",
"sText",
",",
"final",
"char",
"cSearch",
",",
"@",
"Nonnull",
"final",
"Locale",
"aSortLocale",
")",
"{",
"return",
"sText",
"!=",
"null",
... | Count the number of occurrences of cSearch within sText ignoring case.
@param sText
The text to search in. May be <code>null</code>.
@param cSearch
The character to search for.
@param aSortLocale
The locale to be used for case unifying.
@return A non-negative number of occurrences. | [
"Count",
"the",
"number",
"of",
"occurrences",
"of",
"cSearch",
"within",
"sText",
"ignoring",
"case",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3232-L3238 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.trimLeadingWhitespaces | @Nullable
@CheckReturnValue
public static String trimLeadingWhitespaces (@Nullable final String s)
{
final int n = getLeadingWhitespaceCount (s);
return n == 0 ? s : s.substring (n, s.length ());
} | java | @Nullable
@CheckReturnValue
public static String trimLeadingWhitespaces (@Nullable final String s)
{
final int n = getLeadingWhitespaceCount (s);
return n == 0 ? s : s.substring (n, s.length ());
} | [
"@",
"Nullable",
"@",
"CheckReturnValue",
"public",
"static",
"String",
"trimLeadingWhitespaces",
"(",
"@",
"Nullable",
"final",
"String",
"s",
")",
"{",
"final",
"int",
"n",
"=",
"getLeadingWhitespaceCount",
"(",
"s",
")",
";",
"return",
"n",
"==",
"0",
"?"... | Remove any leading whitespaces from the passed string.
@param s
the String to be trimmed
@return the original String with all leading whitespaces removed | [
"Remove",
"any",
"leading",
"whitespaces",
"from",
"the",
"passed",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3247-L3253 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.trimTrailingWhitespaces | @Nullable
@CheckReturnValue
public static String trimTrailingWhitespaces (@Nullable final String s)
{
final int n = getTrailingWhitespaceCount (s);
return n == 0 ? s : s.substring (0, s.length () - n);
} | java | @Nullable
@CheckReturnValue
public static String trimTrailingWhitespaces (@Nullable final String s)
{
final int n = getTrailingWhitespaceCount (s);
return n == 0 ? s : s.substring (0, s.length () - n);
} | [
"@",
"Nullable",
"@",
"CheckReturnValue",
"public",
"static",
"String",
"trimTrailingWhitespaces",
"(",
"@",
"Nullable",
"final",
"String",
"s",
")",
"{",
"final",
"int",
"n",
"=",
"getTrailingWhitespaceCount",
"(",
"s",
")",
";",
"return",
"n",
"==",
"0",
"... | Remove any trailing whitespaces from the passed string.
@param s
the String to be cut
@return the original String with all trailing whitespaces removed | [
"Remove",
"any",
"trailing",
"whitespaces",
"from",
"the",
"passed",
"string",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3262-L3268 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getFirstChar | public static char getFirstChar (@Nullable final CharSequence aCS)
{
return hasText (aCS) ? aCS.charAt (0) : CGlobal.ILLEGAL_CHAR;
} | java | public static char getFirstChar (@Nullable final CharSequence aCS)
{
return hasText (aCS) ? aCS.charAt (0) : CGlobal.ILLEGAL_CHAR;
} | [
"public",
"static",
"char",
"getFirstChar",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"aCS",
")",
"{",
"return",
"hasText",
"(",
"aCS",
")",
"?",
"aCS",
".",
"charAt",
"(",
"0",
")",
":",
"CGlobal",
".",
"ILLEGAL_CHAR",
";",
"}"
] | Get the first character of the passed character sequence
@param aCS
The source character sequence
@return {@link CGlobal#ILLEGAL_CHAR} if the passed sequence was empty | [
"Get",
"the",
"first",
"character",
"of",
"the",
"passed",
"character",
"sequence"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3571-L3574 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getLastChar | public static char getLastChar (@Nullable final CharSequence aCS)
{
final int nLength = getLength (aCS);
return nLength > 0 ? aCS.charAt (nLength - 1) : CGlobal.ILLEGAL_CHAR;
} | java | public static char getLastChar (@Nullable final CharSequence aCS)
{
final int nLength = getLength (aCS);
return nLength > 0 ? aCS.charAt (nLength - 1) : CGlobal.ILLEGAL_CHAR;
} | [
"public",
"static",
"char",
"getLastChar",
"(",
"@",
"Nullable",
"final",
"CharSequence",
"aCS",
")",
"{",
"final",
"int",
"nLength",
"=",
"getLength",
"(",
"aCS",
")",
";",
"return",
"nLength",
">",
"0",
"?",
"aCS",
".",
"charAt",
"(",
"nLength",
"-",
... | Get the last character of the passed character sequence
@param aCS
The source character sequence
@return {@link CGlobal#ILLEGAL_CHAR} if the passed sequence was empty | [
"Get",
"the",
"last",
"character",
"of",
"the",
"passed",
"character",
"sequence"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3595-L3599 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.removeAll | @Nullable
public static String removeAll (@Nullable final String sInputString, @Nullable final String sRemoveString)
{
// Is input string empty?
if (hasNoText (sInputString))
return sInputString;
final int nRemoveLength = getLength (sRemoveString);
if (nRemoveLength == 0)
{
// Nothi... | java | @Nullable
public static String removeAll (@Nullable final String sInputString, @Nullable final String sRemoveString)
{
// Is input string empty?
if (hasNoText (sInputString))
return sInputString;
final int nRemoveLength = getLength (sRemoveString);
if (nRemoveLength == 0)
{
// Nothi... | [
"@",
"Nullable",
"public",
"static",
"String",
"removeAll",
"(",
"@",
"Nullable",
"final",
"String",
"sInputString",
",",
"@",
"Nullable",
"final",
"String",
"sRemoveString",
")",
"{",
"// Is input string empty?",
"if",
"(",
"hasNoText",
"(",
"sInputString",
")",
... | Remove all occurrences of the passed character from the specified input
string
@param sInputString
The input string where the character should be removed. If this
parameter is <code>null</code> or empty, no removing is done.
@param sRemoveString
The String to be removed. May be <code>null</code> or empty in which
case... | [
"Remove",
"all",
"occurrences",
"of",
"the",
"passed",
"character",
"from",
"the",
"specified",
"input",
"string"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4447-L4483 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithoutLeadingChars | @Nonnull
public static String getWithoutLeadingChars (@Nullable final String sStr, @Nonnegative final int nCount)
{
ValueEnforcer.isGE0 (nCount, "Count");
if (nCount == 0)
return sStr;
return getLength (sStr) <= nCount ? "" : sStr.substring (nCount);
} | java | @Nonnull
public static String getWithoutLeadingChars (@Nullable final String sStr, @Nonnegative final int nCount)
{
ValueEnforcer.isGE0 (nCount, "Count");
if (nCount == 0)
return sStr;
return getLength (sStr) <= nCount ? "" : sStr.substring (nCount);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithoutLeadingChars",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nCount",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nCount",
",",
"\"Count\"",
")",
";",
"i... | Get the passed string without the specified number of leading chars.
@param sStr
The source string. May be <code>null</code>.
@param nCount
The number of chars to remove.
@return An empty, non-<code>null</code> string if the passed string has a
length ≤ <code>nCount</code>. | [
"Get",
"the",
"passed",
"string",
"without",
"the",
"specified",
"number",
"of",
"leading",
"chars",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4666-L4674 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.getWithoutTrailingChars | @Nonnull
public static String getWithoutTrailingChars (@Nullable final String sStr, @Nonnegative final int nCount)
{
ValueEnforcer.isGE0 (nCount, "Count");
if (nCount == 0)
return sStr;
final int nLength = getLength (sStr);
return nLength <= nCount ? "" : sStr.substring (0, nLength - nCount);... | java | @Nonnull
public static String getWithoutTrailingChars (@Nullable final String sStr, @Nonnegative final int nCount)
{
ValueEnforcer.isGE0 (nCount, "Count");
if (nCount == 0)
return sStr;
final int nLength = getLength (sStr);
return nLength <= nCount ? "" : sStr.substring (0, nLength - nCount);... | [
"@",
"Nonnull",
"public",
"static",
"String",
"getWithoutTrailingChars",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnegative",
"final",
"int",
"nCount",
")",
"{",
"ValueEnforcer",
".",
"isGE0",
"(",
"nCount",
",",
"\"Count\"",
")",
";",
"... | Get the passed string without the specified number of trailing chars.
@param sStr
The source string. May be <code>null</code>.
@param nCount
The number of chars to remove.
@return An empty, non-<code>null</code> string if the passed string has a
length ≤ <code>nCount</code>. | [
"Get",
"the",
"passed",
"string",
"without",
"the",
"specified",
"number",
"of",
"trailing",
"chars",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L4700-L4709 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.removeMultiple | @Nonnull
public static String removeMultiple (@Nullable final String sInputString, @Nonnull final char [] aRemoveChars)
{
ValueEnforcer.notNull (aRemoveChars, "RemoveChars");
// Any input text?
if (hasNoText (sInputString))
return "";
// Anything to remove?
if (aRemoveChars.length == 0)
... | java | @Nonnull
public static String removeMultiple (@Nullable final String sInputString, @Nonnull final char [] aRemoveChars)
{
ValueEnforcer.notNull (aRemoveChars, "RemoveChars");
// Any input text?
if (hasNoText (sInputString))
return "";
// Anything to remove?
if (aRemoveChars.length == 0)
... | [
"@",
"Nonnull",
"public",
"static",
"String",
"removeMultiple",
"(",
"@",
"Nullable",
"final",
"String",
"sInputString",
",",
"@",
"Nonnull",
"final",
"char",
"[",
"]",
"aRemoveChars",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aRemoveChars",
",",
"\"Rem... | Optimized remove method that removes a set of characters from an input
string!
@param sInputString
The input string.
@param aRemoveChars
The characters to remove. May not be <code>null</code>.
@return The version of the string without the passed characters or an empty
String if the input string was <code>null</code>. | [
"Optimized",
"remove",
"method",
"that",
"removes",
"a",
"set",
"of",
"characters",
"from",
"an",
"input",
"string!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5196-L5215 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.iterateChars | public static void iterateChars (@Nullable final String sInputString, @Nonnull final ICharConsumer aConsumer)
{
ValueEnforcer.notNull (aConsumer, "Consumer");
if (sInputString != null)
{
final char [] aInput = sInputString.toCharArray ();
for (final char cInput : aInput)
aConsumer.acc... | java | public static void iterateChars (@Nullable final String sInputString, @Nonnull final ICharConsumer aConsumer)
{
ValueEnforcer.notNull (aConsumer, "Consumer");
if (sInputString != null)
{
final char [] aInput = sInputString.toCharArray ();
for (final char cInput : aInput)
aConsumer.acc... | [
"public",
"static",
"void",
"iterateChars",
"(",
"@",
"Nullable",
"final",
"String",
"sInputString",
",",
"@",
"Nonnull",
"final",
"ICharConsumer",
"aConsumer",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aConsumer",
",",
"\"Consumer\"",
")",
";",
"if",
"... | Iterate all characters and pass them to the provided consumer.
@param sInputString
Input String to use. May be <code>null</code> or empty.
@param aConsumer
The consumer to be used. May not be <code>null</code>. | [
"Iterate",
"all",
"characters",
"and",
"pass",
"them",
"to",
"the",
"provided",
"consumer",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L5225-L5235 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/url/URLProtocolRegistry.java | URLProtocolRegistry.registerProtocol | public void registerProtocol (@Nonnull final IURLProtocol aProtocol)
{
ValueEnforcer.notNull (aProtocol, "Protocol");
final String sProtocol = aProtocol.getProtocol ();
m_aRWLock.writeLocked ( () -> {
if (m_aProtocols.containsKey (sProtocol))
throw new IllegalArgumentException ("Another han... | java | public void registerProtocol (@Nonnull final IURLProtocol aProtocol)
{
ValueEnforcer.notNull (aProtocol, "Protocol");
final String sProtocol = aProtocol.getProtocol ();
m_aRWLock.writeLocked ( () -> {
if (m_aProtocols.containsKey (sProtocol))
throw new IllegalArgumentException ("Another han... | [
"public",
"void",
"registerProtocol",
"(",
"@",
"Nonnull",
"final",
"IURLProtocol",
"aProtocol",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aProtocol",
",",
"\"Protocol\"",
")",
";",
"final",
"String",
"sProtocol",
"=",
"aProtocol",
".",
"getProtocol",
"("... | Registers a new protocol
@param aProtocol
The protocol to be registered. May not be <code>null</code>.
@throws IllegalArgumentException
If another handler for this protocol is already installed. | [
"Registers",
"a",
"new",
"protocol"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/url/URLProtocolRegistry.java#L91-L104 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.isKnownEOFException | public static boolean isKnownEOFException (@Nullable final Class <?> aClass)
{
if (aClass == null)
return false;
final String sClass = aClass.getName ();
return sClass.equals ("java.io.EOFException") ||
sClass.equals ("org.mortbay.jetty.EofException") ||
sClass.equals ("org.ec... | java | public static boolean isKnownEOFException (@Nullable final Class <?> aClass)
{
if (aClass == null)
return false;
final String sClass = aClass.getName ();
return sClass.equals ("java.io.EOFException") ||
sClass.equals ("org.mortbay.jetty.EofException") ||
sClass.equals ("org.ec... | [
"public",
"static",
"boolean",
"isKnownEOFException",
"(",
"@",
"Nullable",
"final",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"if",
"(",
"aClass",
"==",
"null",
")",
"return",
"false",
";",
"final",
"String",
"sClass",
"=",
"aClass",
".",
"getName",
"... | Check if the passed class is a known EOF exception class.
@param aClass
The class to be checked. May be <code>null</code>.
@return <code>true</code> if it is a known EOF exception class. | [
"Check",
"if",
"the",
"passed",
"class",
"is",
"a",
"known",
"EOF",
"exception",
"class",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L117-L127 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.closeWithoutFlush | @Nonnull
public static ESuccess closeWithoutFlush (@Nullable @WillClose final AutoCloseable aCloseable)
{
if (aCloseable != null)
{
try
{
// close stream
aCloseable.close ();
return ESuccess.SUCCESS;
}
catch (final Exception ex)
{
if (!isKnownEOF... | java | @Nonnull
public static ESuccess closeWithoutFlush (@Nullable @WillClose final AutoCloseable aCloseable)
{
if (aCloseable != null)
{
try
{
// close stream
aCloseable.close ();
return ESuccess.SUCCESS;
}
catch (final Exception ex)
{
if (!isKnownEOF... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"closeWithoutFlush",
"(",
"@",
"Nullable",
"@",
"WillClose",
"final",
"AutoCloseable",
"aCloseable",
")",
"{",
"if",
"(",
"aCloseable",
"!=",
"null",
")",
"{",
"try",
"{",
"// close stream",
"aCloseable",
".",
"c... | Close the passed object, without trying to call flush on it.
@param aCloseable
The object to be closed. May be <code>null</code>.
@return {@link ESuccess#SUCCESS} if the object was successfully closed. | [
"Close",
"the",
"passed",
"object",
"without",
"trying",
"to",
"call",
"flush",
"on",
"it",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L136-L155 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.copyInputStreamToOutputStreamAndCloseOS | @Nonnull
public static ESuccess copyInputStreamToOutputStreamAndCloseOS (@WillClose @Nullable final InputStream aIS,
@WillClose @Nullable final OutputStream aOS)
{
try
{
return copyInputStreamToOutputStream (aIS, aOS, new byte [DEFAULT_... | java | @Nonnull
public static ESuccess copyInputStreamToOutputStreamAndCloseOS (@WillClose @Nullable final InputStream aIS,
@WillClose @Nullable final OutputStream aOS)
{
try
{
return copyInputStreamToOutputStream (aIS, aOS, new byte [DEFAULT_... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"copyInputStreamToOutputStreamAndCloseOS",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"InputStream",
"aIS",
",",
"@",
"WillClose",
"@",
"Nullable",
"final",
"OutputStream",
"aOS",
")",
"{",
"try",
"{",
"return"... | Pass the content of the given input stream to the given output stream. Both
the input stream and the output stream are automatically closed.
@param aIS
The input stream to read from. May be <code>null</code>. Automatically
closed!
@param aOS
The output stream to write to. May be <code>null</code>. Automatically
closed... | [
"Pass",
"the",
"content",
"of",
"the",
"given",
"input",
"stream",
"to",
"the",
"given",
"output",
"stream",
".",
"Both",
"the",
"input",
"stream",
"and",
"the",
"output",
"stream",
"are",
"automatically",
"closed",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L239-L251 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.getAvailable | public static int getAvailable (@Nullable final InputStream aIS)
{
if (aIS != null)
try
{
return aIS.available ();
}
catch (final IOException ex)
{
// Fall through
}
return 0;
} | java | public static int getAvailable (@Nullable final InputStream aIS)
{
if (aIS != null)
try
{
return aIS.available ();
}
catch (final IOException ex)
{
// Fall through
}
return 0;
} | [
"public",
"static",
"int",
"getAvailable",
"(",
"@",
"Nullable",
"final",
"InputStream",
"aIS",
")",
"{",
"if",
"(",
"aIS",
"!=",
"null",
")",
"try",
"{",
"return",
"aIS",
".",
"available",
"(",
")",
";",
"}",
"catch",
"(",
"final",
"IOException",
"ex"... | Get the number of available bytes in the passed input stream.
@param aIS
The input stream to use. May be <code>null</code>.
@return 0 in case of an error or if the parameter was <code>null</code>. | [
"Get",
"the",
"number",
"of",
"available",
"bytes",
"in",
"the",
"passed",
"input",
"stream",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L531-L543 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.copyReaderToWriterWithLimitAndCloseWriter | @Nonnull
public static ESuccess copyReaderToWriterWithLimitAndCloseWriter (@Nullable @WillClose final Reader aReader,
@Nullable @WillClose final Writer aWriter,
@Nonnegative final lo... | java | @Nonnull
public static ESuccess copyReaderToWriterWithLimitAndCloseWriter (@Nullable @WillClose final Reader aReader,
@Nullable @WillClose final Writer aWriter,
@Nonnegative final lo... | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"copyReaderToWriterWithLimitAndCloseWriter",
"(",
"@",
"Nullable",
"@",
"WillClose",
"final",
"Reader",
"aReader",
",",
"@",
"Nullable",
"@",
"WillClose",
"final",
"Writer",
"aWriter",
",",
"@",
"Nonnegative",
"final",... | Pass the content of the given reader to the given writer. The reader and the
writer are automatically closed!
@param aReader
The reader to read from. May be <code>null</code>. Automatically
closed!
@param aWriter
The writer to write to. May be <code>null</code>. Automatically
closed!
@param nLimit
The maximum number o... | [
"Pass",
"the",
"content",
"of",
"the",
"given",
"reader",
"to",
"the",
"given",
"writer",
".",
"The",
"reader",
"and",
"the",
"writer",
"are",
"automatically",
"closed!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L706-L723 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.getAllCharacters | @Nullable
public static char [] getAllCharacters (@Nullable @WillClose final Reader aReader)
{
if (aReader == null)
return null;
return getCopy (aReader).getAsCharArray ();
} | java | @Nullable
public static char [] getAllCharacters (@Nullable @WillClose final Reader aReader)
{
if (aReader == null)
return null;
return getCopy (aReader).getAsCharArray ();
} | [
"@",
"Nullable",
"public",
"static",
"char",
"[",
"]",
"getAllCharacters",
"(",
"@",
"Nullable",
"@",
"WillClose",
"final",
"Reader",
"aReader",
")",
"{",
"if",
"(",
"aReader",
"==",
"null",
")",
"return",
"null",
";",
"return",
"getCopy",
"(",
"aReader",
... | Read all characters from the passed reader into a char array.
@param aReader
The reader to read from. May be <code>null</code>.
@return The character array or <code>null</code> if the reader is
<code>null</code>. | [
"Read",
"all",
"characters",
"from",
"the",
"passed",
"reader",
"into",
"a",
"char",
"array",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L982-L989 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.getAllCharactersAsString | @Nullable
public static String getAllCharactersAsString (@Nullable @WillClose final Reader aReader)
{
if (aReader == null)
return null;
return getCopy (aReader).getAsString ();
} | java | @Nullable
public static String getAllCharactersAsString (@Nullable @WillClose final Reader aReader)
{
if (aReader == null)
return null;
return getCopy (aReader).getAsString ();
} | [
"@",
"Nullable",
"public",
"static",
"String",
"getAllCharactersAsString",
"(",
"@",
"Nullable",
"@",
"WillClose",
"final",
"Reader",
"aReader",
")",
"{",
"if",
"(",
"aReader",
"==",
"null",
")",
"return",
"null",
";",
"return",
"getCopy",
"(",
"aReader",
")... | Read all characters from the passed reader into a String.
@param aReader
The reader to read from. May be <code>null</code>.
@return The character array or <code>null</code> if the reader is
<code>null</code>. | [
"Read",
"all",
"characters",
"from",
"the",
"passed",
"reader",
"into",
"a",
"String",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L999-L1006 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.readStreamLines | public static void readStreamLines (@WillClose @Nullable final InputStream aIS,
@Nonnull @Nonempty final Charset aCharset,
@Nonnull final Consumer <? super String> aLineCallback)
{
if (aIS != null)
readStreamLines (aIS, aCharset, 0,... | java | public static void readStreamLines (@WillClose @Nullable final InputStream aIS,
@Nonnull @Nonempty final Charset aCharset,
@Nonnull final Consumer <? super String> aLineCallback)
{
if (aIS != null)
readStreamLines (aIS, aCharset, 0,... | [
"public",
"static",
"void",
"readStreamLines",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"InputStream",
"aIS",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnull",
"final",
"Consumer",
"<",
"?",
"super",
"String",
... | Read the complete content of the passed stream and pass each line separately
to the passed callback.
@param aIS
The input stream to read from. May be <code>null</code>.
@param aCharset
The character set to use. May not be <code>null</code>.
@param aLineCallback
The callback that is invoked for all read lines. Each pas... | [
"Read",
"the",
"complete",
"content",
"of",
"the",
"passed",
"stream",
"and",
"pass",
"each",
"line",
"separately",
"to",
"the",
"passed",
"callback",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1142-L1148 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.readStreamLines | public static void readStreamLines (@WillClose @Nullable final InputStream aIS,
@Nonnull @Nonempty final Charset aCharset,
@Nonnegative final int nLinesToSkip,
final int nLinesToRead,
... | java | public static void readStreamLines (@WillClose @Nullable final InputStream aIS,
@Nonnull @Nonempty final Charset aCharset,
@Nonnegative final int nLinesToSkip,
final int nLinesToRead,
... | [
"public",
"static",
"void",
"readStreamLines",
"(",
"@",
"WillClose",
"@",
"Nullable",
"final",
"InputStream",
"aIS",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"Charset",
"aCharset",
",",
"@",
"Nonnegative",
"final",
"int",
"nLinesToSkip",
",",
"final",
"... | Read the content of the passed stream line by line and invoking a callback on
all matching lines.
@param aIS
The input stream to read from. May be <code>null</code>.
@param aCharset
The character set to use. May not be <code>null</code>.
@param nLinesToSkip
The 0-based index of the first line to read. Pass in 0 to ind... | [
"Read",
"the",
"content",
"of",
"the",
"passed",
"stream",
"line",
"by",
"line",
"and",
"invoking",
"a",
"callback",
"on",
"all",
"matching",
"lines",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1213-L1249 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java | StreamHelper.skipFully | public static void skipFully (@Nonnull final InputStream aIS, @Nonnegative final long nBytesToSkip) throws IOException
{
ValueEnforcer.notNull (aIS, "InputStream");
ValueEnforcer.isGE0 (nBytesToSkip, "BytesToSkip");
long nRemaining = nBytesToSkip;
while (nRemaining > 0)
{
// May only return... | java | public static void skipFully (@Nonnull final InputStream aIS, @Nonnegative final long nBytesToSkip) throws IOException
{
ValueEnforcer.notNull (aIS, "InputStream");
ValueEnforcer.isGE0 (nBytesToSkip, "BytesToSkip");
long nRemaining = nBytesToSkip;
while (nRemaining > 0)
{
// May only return... | [
"public",
"static",
"void",
"skipFully",
"(",
"@",
"Nonnull",
"final",
"InputStream",
"aIS",
",",
"@",
"Nonnegative",
"final",
"long",
"nBytesToSkip",
")",
"throws",
"IOException",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aIS",
",",
"\"InputStream\"",
")",
... | Fully skip the passed amounts in the input stream. Only forward skipping is
possible!
@param aIS
The input stream to skip in.
@param nBytesToSkip
The number of bytes to skip. Must be ≥ 0.
@throws IOException
In case something goes wrong internally | [
"Fully",
"skip",
"the",
"passed",
"amounts",
"in",
"the",
"input",
"stream",
".",
"Only",
"forward",
"skipping",
"is",
"possible!"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/StreamHelper.java#L1369-L1399 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/concurrent/collector/ConcurrentCollectorMultiple.java | ConcurrentCollectorMultiple._perform | @Nonnull
private ESuccess _perform (@Nonnull final List <DATATYPE> aObjectsToPerform)
{
if (!aObjectsToPerform.isEmpty ())
{
try
{
// Perform the action on the objects, regardless of whether a
// "stop queue message" was received or not
m_aPerformer.runAsync (aObjectsToPe... | java | @Nonnull
private ESuccess _perform (@Nonnull final List <DATATYPE> aObjectsToPerform)
{
if (!aObjectsToPerform.isEmpty ())
{
try
{
// Perform the action on the objects, regardless of whether a
// "stop queue message" was received or not
m_aPerformer.runAsync (aObjectsToPe... | [
"@",
"Nonnull",
"private",
"ESuccess",
"_perform",
"(",
"@",
"Nonnull",
"final",
"List",
"<",
"DATATYPE",
">",
"aObjectsToPerform",
")",
"{",
"if",
"(",
"!",
"aObjectsToPerform",
".",
"isEmpty",
"(",
")",
")",
"{",
"try",
"{",
"// Perform the action on the obj... | Internal method to invoke the performed for the passed list of objects.
@param aObjectsToPerform
List of objects to be passed to the performer. Never
<code>null</code>. The length is at last
{@link #getMaxPerformCount()}.
@return {@link ESuccess} | [
"Internal",
"method",
"to",
"invoke",
"the",
"performed",
"for",
"the",
"passed",
"list",
"of",
"objects",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/collector/ConcurrentCollectorMultiple.java#L164-L191 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java | CSVParser._anyCharactersAreTheSame | private boolean _anyCharactersAreTheSame ()
{
return _isSameCharacter (m_cSeparatorChar, m_cQuoteChar) ||
_isSameCharacter (m_cSeparatorChar, m_cEscapeChar) ||
_isSameCharacter (m_cQuoteChar, m_cEscapeChar);
} | java | private boolean _anyCharactersAreTheSame ()
{
return _isSameCharacter (m_cSeparatorChar, m_cQuoteChar) ||
_isSameCharacter (m_cSeparatorChar, m_cEscapeChar) ||
_isSameCharacter (m_cQuoteChar, m_cEscapeChar);
} | [
"private",
"boolean",
"_anyCharactersAreTheSame",
"(",
")",
"{",
"return",
"_isSameCharacter",
"(",
"m_cSeparatorChar",
",",
"m_cQuoteChar",
")",
"||",
"_isSameCharacter",
"(",
"m_cSeparatorChar",
",",
"m_cEscapeChar",
")",
"||",
"_isSameCharacter",
"(",
"m_cQuoteChar",... | checks to see if any two of the three characters are the same. This is
because in openCSV the separator, quote, and escape characters must the
different.
@return <code>true</code> if any two of the three are the same. | [
"checks",
"to",
"see",
"if",
"any",
"two",
"of",
"the",
"three",
"characters",
"are",
"the",
"same",
".",
"This",
"is",
"because",
"in",
"openCSV",
"the",
"separator",
"quote",
"and",
"escape",
"characters",
"must",
"the",
"different",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java#L244-L249 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java | CSVParser.parseLineMulti | @Nullable
public ICommonsList <String> parseLineMulti (@Nullable final String sNextLine) throws IOException
{
return _parseLine (sNextLine, true);
} | java | @Nullable
public ICommonsList <String> parseLineMulti (@Nullable final String sNextLine) throws IOException
{
return _parseLine (sNextLine, true);
} | [
"@",
"Nullable",
"public",
"ICommonsList",
"<",
"String",
">",
"parseLineMulti",
"(",
"@",
"Nullable",
"final",
"String",
"sNextLine",
")",
"throws",
"IOException",
"{",
"return",
"_parseLine",
"(",
"sNextLine",
",",
"true",
")",
";",
"}"
] | Parses an incoming String and returns an array of elements. This method is
used when the data spans multiple lines.
@param sNextLine
current line to be processed
@return the tokenized list of elements, or <code>null</code> if nextLine is
<code>null</code>
@throws IOException
if bad things happen during the read | [
"Parses",
"an",
"incoming",
"String",
"and",
"returns",
"an",
"array",
"of",
"elements",
".",
"This",
"method",
"is",
"used",
"when",
"the",
"data",
"spans",
"multiple",
"lines",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java#L286-L290 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java | CSVParser.parseLine | @Nullable
public ICommonsList <String> parseLine (@Nullable final String sNextLine) throws IOException
{
return _parseLine (sNextLine, false);
} | java | @Nullable
public ICommonsList <String> parseLine (@Nullable final String sNextLine) throws IOException
{
return _parseLine (sNextLine, false);
} | [
"@",
"Nullable",
"public",
"ICommonsList",
"<",
"String",
">",
"parseLine",
"(",
"@",
"Nullable",
"final",
"String",
"sNextLine",
")",
"throws",
"IOException",
"{",
"return",
"_parseLine",
"(",
"sNextLine",
",",
"false",
")",
";",
"}"
] | Parses an incoming String and returns an array of elements. This method is
used when all data is contained in a single line.
@param sNextLine
Line to be parsed.
@return the tokenized list of elements, or <code>null</code> if nextLine is
<code>null</code>
@throws IOException
if bad things happen during the read | [
"Parses",
"an",
"incoming",
"String",
"and",
"returns",
"an",
"array",
"of",
"elements",
".",
"This",
"method",
"is",
"used",
"when",
"all",
"data",
"is",
"contained",
"in",
"a",
"single",
"line",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/csv/CSVParser.java#L303-L307 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLWriter.java | XMLWriter.getNodeAsString | @Nullable
public static String getNodeAsString (@Nonnull final Node aNode, @Nonnull final IXMLWriterSettings aSettings)
{
// start serializing
try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BYTES_PER_KILOBYTE))
{
if (writeToWriter (aNode, aWriter, aSettings)... | java | @Nullable
public static String getNodeAsString (@Nonnull final Node aNode, @Nonnull final IXMLWriterSettings aSettings)
{
// start serializing
try (final NonBlockingStringWriter aWriter = new NonBlockingStringWriter (50 * CGlobal.BYTES_PER_KILOBYTE))
{
if (writeToWriter (aNode, aWriter, aSettings)... | [
"@",
"Nullable",
"public",
"static",
"String",
"getNodeAsString",
"(",
"@",
"Nonnull",
"final",
"Node",
"aNode",
",",
"@",
"Nonnull",
"final",
"IXMLWriterSettings",
"aSettings",
")",
"{",
"// start serializing",
"try",
"(",
"final",
"NonBlockingStringWriter",
"aWrit... | Convert the passed DOM node to an XML string using the provided XML writer
settings.
@param aNode
The node to be converted to a string. May not be <code>null</code> .
@param aSettings
The XML writer settings to be used. May not be <code>null</code>.
@return The string representation of the passed node.
@since 8.6.3 | [
"Convert",
"the",
"passed",
"DOM",
"node",
"to",
"an",
"XML",
"string",
"using",
"the",
"provided",
"XML",
"writer",
"settings",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLWriter.java#L202-L220 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java | MockSupplier.createConstant | @Nonnull
public static MockSupplier createConstant (@Nonnull final Object aConstant)
{
ValueEnforcer.notNull (aConstant, "Constant");
return new MockSupplier (aConstant.getClass (), null, aParam -> aConstant);
} | java | @Nonnull
public static MockSupplier createConstant (@Nonnull final Object aConstant)
{
ValueEnforcer.notNull (aConstant, "Constant");
return new MockSupplier (aConstant.getClass (), null, aParam -> aConstant);
} | [
"@",
"Nonnull",
"public",
"static",
"MockSupplier",
"createConstant",
"(",
"@",
"Nonnull",
"final",
"Object",
"aConstant",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aConstant",
",",
"\"Constant\"",
")",
";",
"return",
"new",
"MockSupplier",
"(",
"aConstan... | Create a mock supplier for a constant value.
@param aConstant
The constant value to be returned. May not be <code>null</code>.
@return Never <code>null</code>. | [
"Create",
"a",
"mock",
"supplier",
"for",
"a",
"constant",
"value",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java#L212-L217 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java | MockSupplier.createNoParams | @Nonnull
public static <T> MockSupplier createNoParams (@Nonnull final Class <T> aDstClass,
@Nonnull final Supplier <T> aSupplier)
{
ValueEnforcer.notNull (aDstClass, "DstClass");
ValueEnforcer.notNull (aSupplier, "Supplier");
return new MockS... | java | @Nonnull
public static <T> MockSupplier createNoParams (@Nonnull final Class <T> aDstClass,
@Nonnull final Supplier <T> aSupplier)
{
ValueEnforcer.notNull (aDstClass, "DstClass");
ValueEnforcer.notNull (aSupplier, "Supplier");
return new MockS... | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"MockSupplier",
"createNoParams",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aDstClass",
",",
"@",
"Nonnull",
"final",
"Supplier",
"<",
"T",
">",
"aSupplier",
")",
"{",
"ValueEnforcer",
".",
... | Create a mock supplier for a factory without parameters.
@param aDstClass
The destination class to be mocked. May not be <code>null</code>.
@param aSupplier
The supplier/factory without parameters to be used. May not be
<code>null</code>.
@return Never <code>null</code>.
@param <T>
The type to be mocked | [
"Create",
"a",
"mock",
"supplier",
"for",
"a",
"factory",
"without",
"parameters",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java#L231-L238 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java | MockSupplier.create | @Nonnull
public static <T> MockSupplier create (@Nonnull final Class <T> aDstClass,
@Nonnull final Param [] aParams,
@Nonnull final Function <IGetterDirectTrait [], T> aSupplier)
{
ValueEnforcer.notNull (aDstClass, "DstC... | java | @Nonnull
public static <T> MockSupplier create (@Nonnull final Class <T> aDstClass,
@Nonnull final Param [] aParams,
@Nonnull final Function <IGetterDirectTrait [], T> aSupplier)
{
ValueEnforcer.notNull (aDstClass, "DstC... | [
"@",
"Nonnull",
"public",
"static",
"<",
"T",
">",
"MockSupplier",
"create",
"(",
"@",
"Nonnull",
"final",
"Class",
"<",
"T",
">",
"aDstClass",
",",
"@",
"Nonnull",
"final",
"Param",
"[",
"]",
"aParams",
",",
"@",
"Nonnull",
"final",
"Function",
"<",
"... | Create a mock supplier with parameters.
@param aDstClass
The destination class to be mocked. May not be <code>null</code>.
@param aParams
The parameter declarations to be used. May not be
<code>null</code>.
@param aSupplier
The generic function to be invoked. Must take an array of
{@link IGetterDirectTrait} and return... | [
"Create",
"a",
"mock",
"supplier",
"with",
"parameters",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mock/CommonsMock.java#L256-L265 | train |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/text/codepoint/AbstractCodepointIterator.java | AbstractCodepointIterator._peekChars | @Nullable
private char [] _peekChars (@Nonnegative final int nPos)
{
if (nPos < 0 || nPos >= limit ())
return null;
final char c1 = get (nPos);
if (Character.isHighSurrogate (c1) && nPos < limit ())
{
final char c2 = get (nPos + 1);
if (Character.isLowSurrogate (c2))
retur... | java | @Nullable
private char [] _peekChars (@Nonnegative final int nPos)
{
if (nPos < 0 || nPos >= limit ())
return null;
final char c1 = get (nPos);
if (Character.isHighSurrogate (c1) && nPos < limit ())
{
final char c2 = get (nPos + 1);
if (Character.isLowSurrogate (c2))
retur... | [
"@",
"Nullable",
"private",
"char",
"[",
"]",
"_peekChars",
"(",
"@",
"Nonnegative",
"final",
"int",
"nPos",
")",
"{",
"if",
"(",
"nPos",
"<",
"0",
"||",
"nPos",
">=",
"limit",
"(",
")",
")",
"return",
"null",
";",
"final",
"char",
"c1",
"=",
"get"... | Peek the specified chars in the iterator. If the codepoint is not
supplemental, the char array will have a single member. If the codepoint is
supplemental, the char array will have two members, representing the high
and low surrogate chars | [
"Peek",
"the",
"specified",
"chars",
"in",
"the",
"iterator",
".",
"If",
"the",
"codepoint",
"is",
"not",
"supplemental",
"the",
"char",
"array",
"will",
"have",
"a",
"single",
"member",
".",
"If",
"the",
"codepoint",
"is",
"supplemental",
"the",
"char",
"... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/text/codepoint/AbstractCodepointIterator.java#L109-L133 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/XPathHelper.java | XPathHelper.createNewXPathExpression | @Nonnull
public static XPathExpression createNewXPathExpression (@Nonnull final XPath aXPath,
@Nonnull @Nonempty final String sXPath)
{
ValueEnforcer.notNull (aXPath, "XPath");
ValueEnforcer.notNull (sXPath, "XPathExpression");
try
{
r... | java | @Nonnull
public static XPathExpression createNewXPathExpression (@Nonnull final XPath aXPath,
@Nonnull @Nonempty final String sXPath)
{
ValueEnforcer.notNull (aXPath, "XPath");
ValueEnforcer.notNull (sXPath, "XPathExpression");
try
{
r... | [
"@",
"Nonnull",
"public",
"static",
"XPathExpression",
"createNewXPathExpression",
"(",
"@",
"Nonnull",
"final",
"XPath",
"aXPath",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sXPath",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aXPath",
",",
... | Create a new XPath expression for evaluation.
@param aXPath
The pre-created XPath object. May not be <code>null</code>.
@param sXPath
The main XPath string to be evaluated
@return The {@link XPathExpression} object to be used.
@throws IllegalArgumentException
if the XPath cannot be compiled | [
"Create",
"a",
"new",
"XPath",
"expression",
"for",
"evaluation",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/XPathHelper.java#L414-L429 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLNameStartChar | public static boolean isInvalidXMLNameStartChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_NAME_START_CHAR_XML10.get (c);
case XML_11:
return INVALID_NAME_START_CHAR_XML11.get (c);
case HTML:
ret... | java | public static boolean isInvalidXMLNameStartChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_NAME_START_CHAR_XML10.get (c);
case XML_11:
return INVALID_NAME_START_CHAR_XML11.get (c);
case HTML:
ret... | [
"public",
"static",
"boolean",
"isInvalidXMLNameStartChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_NAME_START_CHAR_XML... | Check if the passed character is invalid for an element or attribute name
on the first position
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"an",
"element",
"or",
"attribute",
"name",
"on",
"the",
"first",
"position"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L643-L656 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLNameChar | public static boolean isInvalidXMLNameChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_NAME_CHAR_XML10.get (c);
case XML_11:
return INVALID_NAME_CHAR_XML11.get (c);
case HTML:
return INVALID_CHAR_... | java | public static boolean isInvalidXMLNameChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_NAME_CHAR_XML10.get (c);
case XML_11:
return INVALID_NAME_CHAR_XML11.get (c);
case HTML:
return INVALID_CHAR_... | [
"public",
"static",
"boolean",
"isInvalidXMLNameChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_NAME_CHAR_XML10",
".",... | Check if the passed character is invalid for an element or attribute name
after the first position
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"an",
"element",
"or",
"attribute",
"name",
"after",
"the",
"first",
"position"
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L668-L681 | train |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java | XMLCharHelper.isInvalidXMLTextChar | public static boolean isInvalidXMLTextChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_VALUE_CHAR_XML10.get (c);
case XML_11:
return INVALID_TEXT_VALUE_CHAR_XML11.get (c);
case HTML:
return INVALI... | java | public static boolean isInvalidXMLTextChar (@Nonnull final EXMLSerializeVersion eXMLVersion, final int c)
{
switch (eXMLVersion)
{
case XML_10:
return INVALID_VALUE_CHAR_XML10.get (c);
case XML_11:
return INVALID_TEXT_VALUE_CHAR_XML11.get (c);
case HTML:
return INVALI... | [
"public",
"static",
"boolean",
"isInvalidXMLTextChar",
"(",
"@",
"Nonnull",
"final",
"EXMLSerializeVersion",
"eXMLVersion",
",",
"final",
"int",
"c",
")",
"{",
"switch",
"(",
"eXMLVersion",
")",
"{",
"case",
"XML_10",
":",
"return",
"INVALID_VALUE_CHAR_XML10",
"."... | Check if the passed character is invalid for a text node.
@param eXMLVersion
XML version to be used. May not be <code>null</code>.
@param c
char to check
@return <code>true</code> if the char is invalid | [
"Check",
"if",
"the",
"passed",
"character",
"is",
"invalid",
"for",
"a",
"text",
"node",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/XMLCharHelper.java#L778-L791 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.