public interface MemberFormatter
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";
}
}
}
Modifier and Type | Method and Description |
---|---|
String |
formatMember(Member member)
Returns the string to be displayed as a caption for a given member.
|
Copyright © 2020 Hitachi Vantara. All rights reserved.