org.mobicents.protocols.smpp.util
Class SMPPDateFormat
java.lang.Object
java.text.Format
org.mobicents.protocols.smpp.util.SMPPDateFormat
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SMPPDateFormat
- extends java.text.Format
Parse a String to an SMPPDate object.
- Version:
- $Id: SMPPDateFormat.java 463 2009-06-16 12:07:19Z orank $
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class java.text.Format |
java.text.Format.Field |
|
Method Summary |
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
|
int |
getYearModifier()
Get the value for the year modifier. |
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition pos)
Parse a string into an SMPPDate. |
void |
setYearModifier(int yearModifier)
Set the value for the year modifier. |
| Methods inherited from class java.text.Format |
clone, format, formatToCharacterIterator, parseObject |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_YEAR_MODIFIER
public static final int DEFAULT_YEAR_MODIFIER
- The default year modifier. The year modifier is the value used
to convert 2-digit years into their full version. Year modifier is
simply added to (or subtracted from) one form to get the other.
int twoDigitYear = fullYear - getYearModifier();
int fullYear = twoDigitYear + getYearModifier();
The default value for this is 2000, meaning the allowed
values for a 2-digit year (0 to 99) represent the years 2000 to 2099.
- See Also:
- Constant Field Values
SMPPDateFormat
public SMPPDateFormat()
format
public java.lang.StringBuffer format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
- Specified by:
format in class java.text.Format
parseObject
public java.lang.Object parseObject(java.lang.String source,
java.text.ParsePosition pos)
- Parse a string into an
SMPPDate.
- Specified by:
parseObject in class java.text.Format
- Parameters:
source - The string to parse.pos - The position to begin parsing from.
- Throws:
java.lang.NullPointerException - if source is null.
java.lang.IllegalArgumentException - if any of the parsed values exceed
their allowed range.
getYearModifier
public int getYearModifier()
- Get the value for the year modifier.
- Returns:
- The current value of the year modifier.
- See Also:
DEFAULT_YEAR_MODIFIER
setYearModifier
public void setYearModifier(int yearModifier)
- Set the value for the year modifier.
- Parameters:
yearModifier - The new value for year modifier.- See Also:
DEFAULT_YEAR_MODIFIER,
getYearModifier()
Copyright © 2010 Mobicents. All Rights Reserved.