Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package org.litesoft.core.simpletypes.temporal;

public abstract class YearFormatAccessor
{
    private static YearFormatAccessor sAccessor;
    private final YearFormatAccessor mNext;

    public static DateFormat deNull( DateFormat pDateFormat )
    {
        return (pDateFormat != null) ? pDateFormat : get();
    }

    public static synchronized DateFormat get()
    {
        for ( YearFormatAccessor zAccessor = sAccessor; zAccessor != null; zAccessor = zAccessor.mNext )
        {
            DateFormat zDateFormat = zAccessor.getDateFormat();
            if ( zDateFormat != null )
            {
                return zDateFormat;
            }
        }
        return DateFormat.DEFAULT_Y;
    }

    protected YearFormatAccessor()
    {
        mNext = sAccessor;
        sAccessor = this;
    }

    /**
     * Get the DateFormat appropriate for the current user or null if none specified
     *
     * @return
     */
    abstract protected DateFormat getDateFormat();
}

Commits for litesoft/trunk/Java/core/Anywhere/src/org/litesoft/core/simpletypes/temporal/YearFormatAccessor.java

Diff revisions: vs.
Revision Author Commited Message
851 GeorgeS picture GeorgeS Mon 08 Oct, 2012 00:05:32 +0000

Breaking the code as Temporal changes are implemented...