memberformatter.java
来自「数据仓库展示程序」· Java 代码 · 共 52 行
JAVA
52 行
/*
// $Id: //open/mondrian/src/main/mondrian/olap/MemberFormatter.java#4 $
// This software is subject to the terms of the Common Public License
// Agreement, available at the following URL:
// http://www.opensource.org/licenses/cpl.html.
// Copyright (C) 2004-2005 TONBELLER AG
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
*/
package mondrian.olap;
/**
* This interface provides an SPI to redefine the caption displayed
* for members.
*
* <p>For example, the following class displays members of the time
* dimension as "01-JAN-2005".
*
* <blockquote>
* <code>
* public class TimeMemberFormatter implements MemberFormatter {<br/>
* public String formatMember(Member member) {<br/>
* SimpleDateFormat inFormat =<br/>
* new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");<br/>
* SimpleDateFormat outFormat =<br/>
* new SimpleDateFormat("dd-MMM-yyyy");<br/>
* try {<br/>
* Date date = inFormat.parse(in.getName());<br/>
* return outFormat.format(data);<br/>
* } catch (ParseException e) {<br/>
* e.printStackTrace();<br/>
* return "error";<br/>
* }<br/>
* }<br/>
* }<br/>
* </code>
* </blockquote>
*
* @author hhaas
* @since 6 October, 2004
* @version $Id: //open/mondrian/src/main/mondrian/olap/MemberFormatter.java#4 $
*/
public interface MemberFormatter {
/**
* Returns the string to be displayed as a caption for a given member.
*/
String formatMember(Member m);
}
// End MemberFormatter.java
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?