org.foray.common.util
Class CharacterUtils

java.lang.Object
  extended by org.foray.common.util.CharacterUtils

public final class CharacterUtils
extends Object

Utilities related to char and Character.


Method Summary
static boolean isAttachedLeadingPunctuation(int c)
          Indicates whether a given char is an attached leading punctuation mark or not.
static boolean isAttachedTrailingPunctuation(int c)
          Indicates whether a given char is an attached trailing punctuation mark or not.
static boolean isDetachablePunctuation(int c)
          Indicates whether a given char is a punctuation mark or not.
static boolean isDetachedPunctuation(int c)
          Indicates whether a given char is a punctuation mark or not.
static char[] toArray(List<Character> list)
          Converts a List of Character instances into an array of chars.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toArray

public static char[] toArray(List<Character> list)
Converts a List of Character instances into an array of chars.

Parameters:
list - The List of Character instances to be converted to an array.
Returns:
The array of chars.

isAttachedLeadingPunctuation

public static boolean isAttachedLeadingPunctuation(int c)
Indicates whether a given char is an attached leading punctuation mark or not. Attached leading punctuation marks are those which, when they immediately precede a word, should not be separated from that word during line-breaking.

Parameters:
c - The char to be tested.
Returns:
True if c is an attached leading punctuation character.

isAttachedTrailingPunctuation

public static boolean isAttachedTrailingPunctuation(int c)
Indicates whether a given char is an attached trailing punctuation mark or not. Attached trailing punctuation marks are those which, when they immediately follow a word, should not be separated from that word during line-breaking.

Parameters:
c - The char to be tested.
Returns:
True if c is an attached punctuation character.

isDetachablePunctuation

public static boolean isDetachablePunctuation(int c)
Indicates whether a given char is a punctuation mark or not.

Parameters:
c - The char to be tested.
Returns:
True if c is an attached punctuation character.

isDetachedPunctuation

public static boolean isDetachedPunctuation(int c)
Indicates whether a given char is a punctuation mark or not.

Parameters:
c - The char to be tested.
Returns:
True if c is an attached punctuation character.


Copyright © 2017. All rights reserved.