|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.g11ntoolkit.levblock.TokContext
The set of information that makes up the context of a string that has been tokenized for translation.
The context is made up of 2 parts each of which has 2 parts in the following structure:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
See License Agreement.
| Field Summary | |
private static java.util.logging.Logger |
log
The log used for all messages from this class. |
protected static java.util.ResourceBundle |
mrb
Message Resource Bundle. |
private java.lang.String |
useL
The linguistic part of the use attribute. |
private java.lang.String |
useT
The technical part of the use attribute. |
protected static java.util.ResourceBundle |
vrb
Variables Resource Bundle. |
private java.lang.String |
whereEI
The element identifier part of the where attribute. |
private java.lang.String |
whereFN
The file name part of the where attribute. |
private static java.util.ResourceBundle |
xrb
Constants, messages, and variables used by the tools and classes for XML processing. |
| Constructor Summary | |
TokContext()
Constructs an empty instance so it is ready to receive data via the set methods. |
|
TokContext(java.lang.String cs)
Constructs an instance from a string. |
|
TokContext(java.lang.String fn,
java.lang.String ei,
java.lang.String ul,
java.lang.String ut)
Constructs an instance using the specified information. |
|
| Method Summary | |
void |
debugDump()
Dumps the contents of the object to the console. |
boolean |
equals(java.lang.Object anotherContext)
Returns true if this context is equal to the specified object. |
boolean |
equals(TokContext anotherContext)
Returns true if this context is equal to the specified context. |
java.lang.String |
getElement()
Returns the element identifier part of the where attribute. |
java.lang.String |
getFileName()
Returns the file name part of the where attribute. |
java.lang.String |
getLinguisticUse()
Returns the linguistic use part of the use attribute. |
java.lang.String |
getTechnicalUse()
Returns the technical use part of the use attribute. |
int |
hashCode()
Returns a hash code for this entry. |
boolean |
isEmpty()
Returns true if all of the parts of the context are null, false, if any one part is not null. |
private java.lang.String[] |
parsePattern(java.lang.String pattern)
Parses the context pattern and returns a string array with its parts. |
void |
setElement(java.lang.String anElementId)
Sets the element identifier part of the where attribute. |
void |
setFileName(java.lang.String aFileName)
Sets the file name part of the where attribute. |
void |
setLinguisticUse(java.lang.String aUse)
Sets the linguistic use part of the use attribute. |
void |
setTechnicalUse(java.lang.String aUse)
Sets the technical use part of the use attribute. |
void |
setUse(java.lang.String aLinguisticUse,
java.lang.String aTechnicalUse)
Sets the use attribute. |
void |
setWhere(java.lang.String aFileName,
java.lang.String anElementId)
Sets the where attribute. |
java.lang.String |
toString()
Returns the a displayable string for this context. |
java.lang.String[] |
toStringArray()
Returns a string array of the elements of this context. |
void |
writeXML(java.io.Writer out)
Writes the contents of the object to the specified Writer in XML form. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static java.util.logging.Logger log
protected static java.util.ResourceBundle mrb
protected static java.util.ResourceBundle vrb
private static java.util.ResourceBundle xrb
private java.lang.String whereFN
private java.lang.String whereEI
private java.lang.String useL
private java.lang.String useT
| Constructor Detail |
public TokContext()
public TokContext(java.lang.String fn,
java.lang.String ei,
java.lang.String ul,
java.lang.String ut)
fn - a String specifying the file nameei - a String specifying the key idul - a String specifying the linguistic useut - a String specifying the technical use
public TokContext(java.lang.String cs)
throws MalformedContextPattern,
InvalidContextString
The string must conform to the context.display message in the messages.properties file.
cs - a String specifying the context in a string form
MalformedContextPattern - if the specified string is not a well formed context
InvalidContextString - if the specified string is an invalid context| Method Detail |
private java.lang.String[] parsePattern(java.lang.String pattern)
pattern - a String specifying the context in a string form
public void setWhere(java.lang.String aFileName,
java.lang.String anElementId)
aFileName - a String specifying a file nameanElementId - a String specifying a key idpublic void setFileName(java.lang.String aFileName)
aFileName - a String specifying the file name valuegetFileName()public java.lang.String getFileName()
setFileName(java.lang.String)public void setElement(java.lang.String anElementId)
anElementId - a String specifying the element valuegetElement()public java.lang.String getElement()
setElement(java.lang.String)
public void setUse(java.lang.String aLinguisticUse,
java.lang.String aTechnicalUse)
aLinguisticUse - a String specifying the linguistic use valueaTechnicalUse - a String specifying the technical use valuepublic void setLinguisticUse(java.lang.String aUse)
aUse - a String specifying the linguistic use valuegetLinguisticUse()public java.lang.String getLinguisticUse()
setLinguisticUse(java.lang.String)public void setTechnicalUse(java.lang.String aUse)
aUse - a String specifying the technical use valuegetTechnicalUse()public java.lang.String getTechnicalUse()
setTechnicalUse(java.lang.String)public boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String[] toStringArray()
The elements are returned in the following positions of the array:
public boolean equals(TokContext anotherContext)
All parts of the context must be equal to qualify for equality.
anotherContext - a TokContext object
TokContext object is equal to this objectpublic boolean equals(java.lang.Object anotherContext)
The specified object must be TokContext object and all parts of the context must be equal to qualify for equality.
equals in class java.lang.ObjectanotherContext - an Object specifying the object to compare this instance to
TokContext object and equal to this objectpublic int hashCode()
The hash code for an XL entry is defined as the sum of the hash code for the locale and the hash code for the string.
hashCode in class java.lang.Object
public void writeXML(java.io.Writer out)
throws java.io.IOException
Writer in XML form.
out - a Writer for the desired output
java.io.IOException - if the Writer detects any errorspublic void debugDump()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||