uk.ac.ebi.intenz.tools.sib.translator.rules
Class OrderedRules

java.lang.Object
  extended by uk.ac.ebi.intenz.tools.sib.translator.rules.OrderedRules
All Implemented Interfaces:
RuleGroup

public class OrderedRules
extends Object
implements RuleGroup

This singleton class stores regular expression rules to be used to transform text.

Each rule consists of a regular expression pattern and a replacement string. The rules will be applied in an arbitrary order.

These rules should only be applied on enzyme reaction data.

Version:
$Revision: 1.3 $ $Date: 2009/03/27 15:33:26 $
Author:
Michael Darsow

Method Summary
 String applyRules(String text)
          Applies the rules.
static OrderedRules getInstance()
          Returns the sole instance of this class.
 String reverseRules(String text)
          Applies the reverse rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static OrderedRules getInstance()
Returns the sole instance of this class.

If no instance is available yet then it will be created.

Returns:
the class's sole instance.

applyRules

public String applyRules(String text)
Applies the rules.

Specified by:
applyRules in interface RuleGroup
Parameters:
text - The text to be translated.
Returns:
the translated text.
Throws:
NullPointerException - if text is null.

reverseRules

public String reverseRules(String text)
Applies the reverse rules.

Specified by:
reverseRules in interface RuleGroup
Parameters:
text - The text to be translated.
Returns:
the translated text.
Throws:
NullPointerException - if text is null.


Copyright © 2013 EMBL-EBI. All Rights Reserved.