Home » commons-lang-2.4-src » org.apache.commons » lang »

org.apache.commons.lang

Sub Packages:

org.apache.commons.lang.builder   Assists in creating consistent equals(Object) , toString() , hashCode() , and compareTo(Object) methods.  
org.apache.commons.lang.enums   Provides an implementation of the C style enum in the Java world.  
org.apache.commons.lang.exception   Provides JDK 1.4 style Nested Exception functionality for those on prior Java versions.  
org.apache.commons.lang.math   Extends java.math for business mathematical classes.  
org.apache.commons.lang.mutable   Provides typed mutable wrappers to primitive values and Object.  
org.apache.commons.lang.text   Provides classes for handling and manipulating text, partly as an extension to java.text .  
org.apache.commons.lang.time   Provides classes and methods to work with dates and durations.  

Interfaces:

ClassUtilsTest.IA     code | html
ClassUtilsTest.IB     code | html
ClassUtilsTest.IC     code | html
ClassUtilsTest.ID     code | html
ClassUtilsTest.IE     code | html
ClassUtilsTest.IF     code | html
Entities.EntityMap     code | html

Abstract Classes:

Entities.MapIntMap     code | html

Classes:

ArrayUtils  

Operations on arrays, primitive arrays (like int[]) and primitive wrapper arrays (like Integer[]).

This class tries to handle null input gracefully. 

code | html
BitField  

Operations on bit-mapped fields.

 
code | html
BooleanUtils  

Operations on boolean primitives and Boolean objects.

This class tries to handle null input gracefully. 

code | html
CharEncoding  

Character encoding names required of every implementation of the Java platform. 

code | html
CharRange  

A contiguous range of characters, optionally negated.

Instances are immutable.

 
code | html
CharSet  

A set of characters.

Instances are immutable, but instances of subclasses may not be.

 
code | html
CharSetUtils  

Operations on CharSets.

This class handles null input gracefully. 

code | html
CharUtils  

Operations on char primitives and Character objects.

This class tries to handle null input gracefully. 

code | html
CharUtilsPerfTest   Tests the difference in performance between CharUtils and CharSet.  code | html
ClassUtils  

Operates on classes without using reflection.

This class handles invalid null inputs as best it can. 

code | html
ClassUtilsTest.CX     code | html
ClassUtilsTest.CY     code | html
ClassUtilsTest.Inner     code | html
DateFormatter     code | html
Entities  

Provides HTML and XML entity utilities. 

code | html
Entities.ArrayEntityMap     code | html
Entities.BinaryEntityMap     code | html
Entities.HashEntityMap     code | html
Entities.LookupEntityMap     code | html
Entities.PrimitiveEntityMap     code | html
Entities.TreeEntityMap     code | html
IllegalClassException  

Thrown when an object is an instance of an unexpected type (a class or interface). 

code | html
IncompleteArgumentException  

Thrown to indicate an incomplete argument to a method. 

code | html
IntHashMap  

A hash map that uses primitive ints for the key rather than objects.

Note that this class is for internal optimization purposes only, and may not be supported in future releases of Apache Commons Lang. 

code | html
IntHashMap.Entry  

Innerclass that acts as a datastructure to create a new entry in the table.

 
code | html
LocaleUtils  

Operations to assist when working with a Locale .

This class tries to handle null input gracefully. 

code | html
NotImplementedException  

Thrown to indicate that a block of code has not been implemented. 

code | html
NullArgumentException  

Thrown to indicate that an argument was null and should not have been. 

code | html
NumberRange  

Represents a range of Number objects.

This class uses double comparisons. 

code | html
NumberUtils  

Provides extra functionality for Java Number classes.

 
code | html
ObjectUtils  

Operations on Object.

This class tries to handle null input gracefully. 

code | html
ObjectUtils.Null  

Class used as a null placeholder where null has another meaning.

For example, in a HashMap the java.util.HashMap#get(java.lang.Object) method returns null if the Map contains null or if there is no matching key. 

code | html
RandomStringUtils  

Operations for random Strings.

Currently private high surrogate characters are ignored. 

code | html
SerializationException  

Exception thrown when the Serialization process fails.

The original error is wrapped within this one.

 
code | html
SerializationUtils  

Assists with the serialization process and performs additional functionality based on serialization.

  • Deep clone using serialization
  • Serialize managing finally and IOException
  • Deserialize managing finally and IOException

This class throws exceptions for invalid null inputs. 

code | html
StringEscapeUtils  

Escapes and unescapes Strings for Java, Java Script, HTML, XML, and SQL.

 
code | html
StringPrintWriter  

A PrintWriter that maintains a String as its backing store.

Usage:

StringPrintWriter out = new StringPrintWriter();
printTo(out);
System.out.println( out.getString() );

 
code | html
StringUtils  

Operations on java.lang.String that are null safe.

  • IsEmpty/IsBlank - checks if a String contains text
  • Trim/Strip - removes leading and trailing whitespace
  • Equals - compares two strings null-safe
  • startsWith - check if a String starts with a prefix null-safe
  • endsWith - check if a String ends with a suffix null-safe
  • IndexOf/LastIndexOf/Contains - null-safe index-of checks
  • IndexOfAny/LastIndexOfAny/IndexOfAnyBut/LastIndexOfAnyBut - index-of any of a set of Strings
  • ContainsOnly/ContainsNone/ContainsAny - does String contains only/none/any of these characters
  • Substring/Left/Right/Mid - null-safe substring extractions
  • SubstringBefore/SubstringAfter/SubstringBetween - substring extraction relative to other strings
  • Split/Join - splits a String into an array of substrings and vice versa
  • Remove/Delete - removes part of a String
  • Replace/Overlay - Searches a String and replaces one String with another
  • Chomp/Chop - removes the last part of a String
  • LeftPad/RightPad/Center/Repeat - pads a String
  • UpperCase/LowerCase/SwapCase/Capitalize/Uncapitalize - changes the case of a String
  • CountMatches - counts the number of occurrences of one String in another
  • IsAlpha/IsNumeric/IsWhitespace/IsAsciiPrintable - checks the characters in a String
  • DefaultString - protects against a null input String
  • Reverse/ReverseDelimited - reverses a String
  • Abbreviate - abbreviates a string using ellipsis
  • Difference - compares Strings and reports on their differences
  • LevensteinDistance - the number of changes needed to change one String into another

The StringUtils class defines certain words related to String handling.

  • null - null
  • empty - a zero-length string ("")
  • space - the space character (' ', char 32)
  • whitespace - the characters defined by Character#isWhitespace(char)
  • trim - the characters <= 32 as in String#trim()

StringUtils handles null input Strings quietly. 

code | html
SystemUtils  

Helpers for java.lang.System.

If a system property cannot be read due to security restrictions, the corresponding field in this class will be set to null and a message will be written to System.err.

 
code | html
UnhandledException  

Thrown when it is impossible or undesirable to consume or throw a checked exception.

This exception supplements the standard exception classes by providing a more semantically rich description of the problem.

UnhandledException represents the case where a method has to deal with a checked exception but does not wish to. 

code | html
Validate  

Assists in validating arguments.

The class is based along the lines of JUnit. 

code | html
WordUtils  

Operations on Strings that contain words.

This class tries to handle null input gracefully. 

code | html

All Test Cases:

AllLangTestSuite   Test suite for [lang].  code | html
ArrayUtilsAddTest   Tests ArrayUtils add methods.  code | html
ArrayUtilsRemoveTest   Tests ArrayUtils remove and removeElement methods.  code | html
ArrayUtilsTest   Unit tests org.apache.commons.lang.ArrayUtils code | html
BitFieldTest   Class to test BitField functionality  code | html
BooleanUtilsTest   Unit tests org.apache.commons.lang.BooleanUtils code | html
CharEncodingTest   Tests CharEncoding.  code | html
CharRangeTest   Unit tests org.apache.commons.lang.CharRange code | html
CharSetTest   Unit tests org.apache.commons.lang.CharSet code | html
CharSetUtilsTest   Unit tests org.apache.commons.lang.CharSetUtils code | html
CharUtilsTest   Unit tests org.apache.commons.lang.CharUtils code | html
ClassUtilsTest   Unit tests org.apache.commons.lang.ClassUtils code | html
EntitiesPerformanceTest     code | html
EntitiesTest   Unit tests for StringEscapeUtils code | html
IllegalClassExceptionTest   JUnit tests.  code | html
IncompleteArgumentExceptionTest   JUnit tests.  code | html
LangTestSuite   Test suite for the Lang package.  code | html
NotImplementedExceptionTest   JUnit tests.  code | html
NullArgumentExceptionTest   JUnit tests.  code | html
NumberRangeTest   Test cases for the NumberRange class.  code | html
NumberUtilsTest   Unit tests org.apache.commons.lang.NumberUtils code | html
ObjectUtilsTest   Unit tests org.apache.commons.lang.ObjectUtils code | html
RandomStringUtilsTest   Unit tests org.apache.commons.lang.RandomStringUtils code | html
SerializationUtilsTest   Unit tests org.apache.commons.lang.SerializationUtils code | html
StringEscapeUtilsTest   Unit tests for StringEscapeUtils code | html
StringUtilsEqualsIndexOfTest   Unit tests org.apache.commons.lang.StringUtils - Substring methods  code | html
StringUtilsIsTest   Unit tests org.apache.commons.lang.StringUtils - Substring methods  code | html
StringUtilsSubstringTest   Unit tests org.apache.commons.lang.StringUtils - Substring methods  code | html
StringUtilsTest   Unit tests org.apache.commons.lang.StringUtils code | html
StringUtilsTrimEmptyTest   Unit tests org.apache.commons.lang.StringUtils - Trim/Empty methods  code | html
SystemUtilsTest   Unit tests org.apache.commons.lang.SystemUtils code | html
UnhandledExceptionTest   JUnit tests.  code | html
ValidateTest   Unit tests org.apache.commons.lang.util.Validate code | html
WordUtilsTest   Unit tests for WordUtils class.  code | html