📄 textcontent.java
字号:
/* * TextContent.java * * Created on 2003年11月5日, 下午4:28 */package romulus;/** * This class is used to present the text content item and emphatic text content. * @author Romulus * @version 1.0 */public class TextContent implements ContentItem { /** Here is the actual content.*/ private String content = null; /** ident*/ private String ident = null; /** Here is the emphatic flag.*/ private boolean emph = false; /** Setter*/ void setContent(String con){ content = con; } void setEmphatic(boolean em){ emph = em; } /** Creates new TextContent * @param str The string of the text content. * @param isem True if it is the emphatic text content. */ TextContent(String ident, String str, boolean isem) throws RomulusException{ if(ident == null){ throw new RomulusException(RomulusException.IdentError); } this.ident = ident; content = str; emph = isem; } /** * Such method is used to get the Int_Type of the ContentItem. * @return Int_Type_XXXContent. */ public int getIntContentType() { if(emph){ return ContentItem.Int_Type_EmTextContent; } else{ return ContentItem.Int_Type_TextContent; } } /** * Such method is used to get the Str_Type of the ContentItem. * @return Str_Type_XXXContent. */ public String getStrContentType() { if(emph){ return ContentItem.Str_Type_EmTextContent; } else{ return ContentItem.Str_Type_TextContent; } } /** * Such type is used to get the actual content Object. * @return The actual content object. Will be a String. */ public Object getContent() { return content; } /** * Get the String description of the Content. * @return The String can be used to detail the ContentItem. */ public String getString() { return content; } public String getIdent(){ return ident; } public boolean isEmphatic(){ return emph; } /** The method used to accept the Visitor to do something. */ public void Accept(Visitor v) throws java.sql.SQLException, RomulusException{ v.VisitContentItem(this); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -