xbn.template
Class TemplateDataOrString

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.template.TemplateDataOrString
All Implemented Interfaces:
Named

public class TemplateDataOrString
extends XBNObject
implements Named

Analyzes source text that may or may not have gaps in it.

Source code:  TemplateDataOrString.java


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
TemplateDataOrString(ForLineRetrieval for_lineRetrieval)
          Create a TemplateDataOrString.
TemplateDataOrString(ForLineRetrieval for_lineRetrieval, TParseConfig tp_config)
          Create a TemplateDataOrString.
TemplateDataOrString(String s_name, ForLineRetrieval for_lineRetrieval, TParseConfig tp_config)
          Create a TemplateDataOrString.
 
Method Summary
 String getName()
          What is the name of this object?.
 String getString()
          Get the string that was passed into the constructor, but only if it is not a template.
 TemplateData getTemplateData()
          Get the TemplateData object derived from the source text.
 boolean isString()
          Does the source text (provided to the constructor) contain no gaps?
 boolean isTemplate()
          Does the source text (provided to the constructor) contain a template?
 String toString()
          Get some information about this TemplateDataOrString.
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TemplateDataOrString

public TemplateDataOrString(ForLineRetrieval for_lineRetrieval)
                     throws TemplateFormatException

Create a TemplateDataOrString.

Equal to TemplateDataOrString(for_lineRetrieval, (new TParseConfig()))


TemplateDataOrString

public TemplateDataOrString(ForLineRetrieval for_lineRetrieval,
                            TParseConfig tp_config)
                     throws TemplateFormatException

Create a TemplateDataOrString.

Equal to TemplateDataOrString(null, for_lineRetrieval, tp_config)


TemplateDataOrString

public TemplateDataOrString(String s_name,
                            ForLineRetrieval for_lineRetrieval,
                            TParseConfig tp_config)
                     throws TemplateFormatException

Create a TemplateDataOrString.

Parameters:
s_templateName - The name of the template.
for_lineRetrieval - The source text for this TemplateDataOrString. May not be null.
tp_config - The configuration defining a gap. May not be null.
Method Detail

isTemplate

public final boolean isTemplate()

Does the source text (provided to the constructor) contain a template?

Returns:
true If the source text contains at least one ~G~gap~EG~.
false If the source text contains no gaps.

isString

public final boolean isString()

Does the source text (provided to the constructor) contain no gaps?

Equal to !isTemplate()


getTemplateData

public TemplateData getTemplateData()

Get the TemplateData object derived from the source text.

Returns:
The TemplateData object representing the source text provided to the constructor, assuming it is a template.
null If the source text is not a template.

getString

public String getString()

Get the string that was passed into the constructor, but only if it is not a template.

Returns:
The exact source text as passed into the constructor, if it is not a template.
null If the source text is a Template.

toString

public String toString()

Get some information about this TemplateDataOrString.

Overrides:
toString in class Object

getName

public final String getName()
Description copied from interface: Named

What is the name of this object?. This identifier is used throughout the xbn.named package, particularly in NamedArray.

Specified by:
getName in interface Named



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo