Joda System API

org.joda.property.type
Interface StringProperty

All Superinterfaces:
java.lang.Comparable, DataProperty, ModelElement, Property, java.io.Serializable
All Known Implementing Classes:
DefaultStringProperty

public interface StringProperty
extends DataProperty, java.lang.Comparable

Interface for String properties.

Author:
Stephen Colebourne

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Field Summary
static java.lang.Class DEFAULT_TYPE
           
 
Method Summary
 void append(java.lang.Object appendValue)
          Append another string to this property's value.
 char charAt(int index)
          Returns the character at a particular index.
 boolean contains(java.lang.String searchString)
          Check for the presence of a particular string.
 void delete(int startIndex, int endIndex)
          Delete part of the string.
 void deleteCharAt(int index)
          Delete a character at a particular index.
 boolean endsWith(java.lang.String searchString)
          Check whether the property starts with particular string.
 boolean equalsValueIgnoreCase(java.lang.Object object)
          Check whether this string equals the one passed in ignoring case.
 java.lang.String get()
          Get the property's value.
 int indexOf(java.lang.String searchString)
          Get the index of a particular string, or -1 if not found
 int indexOf(java.lang.String searchString, int fromIndex)
          Get the index of a particular string, or -1 if not found
 void insert(int insertIndex, java.lang.Object appendValue)
          Insert another string into this property's value.
 boolean isEmpty()
          Is the string currently null or zero length
 int lastIndexOf(java.lang.String searchString)
          Get the last index of a particular string, or -1 if not found
 java.lang.String left(int length)
          Returns a string that is the leftmost characters of this string.
 int length()
          Get the length of the string.
 java.lang.String mid(int beginIndex, int length)
          Returns a string that is a substring of this string.
 void replace(java.lang.String searchString, java.lang.String replaceString)
          Replace one string with another in the property's value.
 java.lang.String right(int length)
          Returns a string that is the rightmost characters of this string.
 void setCharAt(int index, char character)
          Set a character at a particular index.
 void setToLowerCase()
          Set the property's value to lower case.
 void setToLowerCase(java.util.Locale locale)
          Set the property's value to lower case using the locale's rules.
 void setToUpperCase()
          Set the property's value to upper case.
 void setToUpperCase(java.util.Locale locale)
          Set the property's value to upper case using the locale's rules.
 boolean startsWith(java.lang.String searchString)
          Check whether the property ends with particular string.
 java.lang.String substring(int beginIndex)
          Returns a string that is a substring of this string.
 java.lang.String substring(int beginIndex, int endIndex)
          Returns a string that is a substring of this string.
 
Methods inherited from interface org.joda.property.type.DataProperty
toDataString
 
Methods inherited from interface org.joda.property.Property
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, getPropertyType, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, set, setModifiable, setReadOnly, toObject, toString
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

DEFAULT_TYPE

public static final java.lang.Class DEFAULT_TYPE
Method Detail

get

public java.lang.String get()
Get the property's value.

Returns:
the string's value

charAt

public char charAt(int index)
Returns the character at a particular index.

Parameters:
index - the index to obtain
Returns:
the specified character
Throws:
java.lang.StringIndexOutOfBoundsException - if the index is out of range
NullValuePropertyException - thrown if the property value is null

substring

public java.lang.String substring(int beginIndex)
Returns a string that is a substring of this string. The substring begins at the specified index and extends to the end of this string.

Parameters:
beginIndex - the beginning index, inclusive
Returns:
the specified substring
Throws:
java.lang.StringIndexOutOfBoundsException - if the index is out of range
NullValuePropertyException - thrown if the property value is null

substring

public java.lang.String substring(int beginIndex,
                                  int endIndex)
Returns a string that is a substring of this string. The substring begins at the specified index and extends to the end of this string.

Parameters:
beginIndex - the beginning index, inclusive
endIndex - the ending index, exclusive
Returns:
the specified substring
Throws:
java.lang.StringIndexOutOfBoundsException - if either index is out of range
NullValuePropertyException - thrown if the property value is null

left

public java.lang.String left(int length)
Returns a string that is the leftmost characters of this string. No exception is thrown if the specified number of characters is unavailable.

Parameters:
length - the length of string to obtain
Returns:
the specified substring
Throws:
NullValuePropertyException - thrown if the property value is null

mid

public java.lang.String mid(int beginIndex,
                            int length)
Returns a string that is a substring of this string. The substring begins at the specified index and extends to the end of this string. No exception is thrown if the specified number of characters is unavailable.

Parameters:
beginIndex - the beginning index, inclusive
length - the length of string to obtain
Returns:
the specified substring
Throws:
NullValuePropertyException - thrown if the property value is null

right

public java.lang.String right(int length)
Returns a string that is the rightmost characters of this string. No exception is thrown if the specified number of characters is unavailable.

Parameters:
length - the length of string to obtain
Returns:
the specified substring
Throws:
NullValuePropertyException - thrown if the property value is null

isEmpty

public boolean isEmpty()
Is the string currently null or zero length

Returns:
true if null or zero length

length

public int length()
Get the length of the string.

Returns:
the string's length
Throws:
NullValuePropertyException - thrown if the property value is null

equalsValueIgnoreCase

public boolean equalsValueIgnoreCase(java.lang.Object object)
Check whether this string equals the one passed in ignoring case. String, StringBuffer and PropertyTools can be passed in.

Returns:
true if the string starts with searchString

contains

public boolean contains(java.lang.String searchString)
Check for the presence of a particular string.

Parameters:
searchString - the string to search for
Returns:
true if the string is found

endsWith

public boolean endsWith(java.lang.String searchString)
Check whether the property starts with particular string.

Parameters:
searchString - the string to search for
Returns:
true if the string starts with searchString

startsWith

public boolean startsWith(java.lang.String searchString)
Check whether the property ends with particular string.

Parameters:
searchString - the string to search for
Returns:
true if the string ends with searchString

indexOf

public int indexOf(java.lang.String searchString)
Get the index of a particular string, or -1 if not found

Parameters:
searchString - the string to search for
Returns:
the index of the string, or -1 if not found

indexOf

public int indexOf(java.lang.String searchString,
                   int fromIndex)
Get the index of a particular string, or -1 if not found

Parameters:
searchString - the string to search for
fromIndex - the index to start the search at
Returns:
the index of the string, or -1 if not found

lastIndexOf

public int lastIndexOf(java.lang.String searchString)
Get the last index of a particular string, or -1 if not found

Parameters:
searchString - the string to search for
Returns:
the index of the string, or -1 if not found

setCharAt

public void setCharAt(int index,
                      char character)
Set a character at a particular index.

Parameters:
index - the index to set the value at
character - the character to set to
Throws:
NullValuePropertyException - thrown if the property value is null

deleteCharAt

public void deleteCharAt(int index)
Delete a character at a particular index.

Parameters:
index - the index to set the value at
Throws:
NullValuePropertyException - thrown if the property value is null

append

public void append(java.lang.Object appendValue)
Append another string to this property's value. The string is obtained by calling toString() on the object passed in. Appending null has no effect.

Parameters:
appendValue - a value to append to the property
Throws:
NullValuePropertyException - thrown if the property value is null

insert

public void insert(int insertIndex,
                   java.lang.Object appendValue)
Insert another string into this property's value. The string is obtained by calling toString() on the object passed in. Inserting null has no effect.

Parameters:
insertIndex - the index at which to insert
Throws:
NullValuePropertyException - thrown if the property value is null

delete

public void delete(int startIndex,
                   int endIndex)
Delete part of the string.

Parameters:
startIndex - the index at which to start, inclusive
endIndex - the index at which to end deleting, exclusive
Throws:
NullValuePropertyException - thrown if the property value is null

replace

public void replace(java.lang.String searchString,
                    java.lang.String replaceString)
Replace one string with another in the property's value.

Parameters:
searchString - the string to search for
replaceString - the string to replace it with
Throws:
NullValuePropertyException - thrown if the property value is null

setToLowerCase

public void setToLowerCase()
Set the property's value to lower case.


setToLowerCase

public void setToLowerCase(java.util.Locale locale)
Set the property's value to lower case using the locale's rules.

Parameters:
locale - the locale to use for conversion

setToUpperCase

public void setToUpperCase()
Set the property's value to upper case.


setToUpperCase

public void setToUpperCase(java.util.Locale locale)
Set the property's value to upper case using the locale's rules.

Parameters:
locale - the locale to use for conversion

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.