mondrian.olap
Interface MemberFormatter


public interface MemberFormatter

This interface provides an SPI to redefine the caption displayed for members.

For example, the following class displays members of the time dimension as "01-JAN-2005".

public class TimeMemberFormatter implements MemberFormatter {
    public String formatMember(Member member) {
        SimpleDateFormat inFormat =
            new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
        SimpleDateFormat outFormat =
            new SimpleDateFormat("dd-MMM-yyyy");
        try {
            Date date = inFormat.parse(in.getName());
            return outFormat.format(data);
        } catch (ParseException e) {
            e.printStackTrace();
            return "error";
        }
    }
}

Since:
6 October, 2004
Author:
hhaas
 

Method Summary
 String formatMember(Member m)
          Returns the string to be displayed as a caption for a given member.
 

Method Detail

formatMember

String formatMember(Member m)
Returns the string to be displayed as a caption for a given member.


SourceForge.net_Logo