gr.uoa.di.madgik.searchlibrary.operatorlibrary.select
Class Binder

java.lang.Object
  extended by gr.uoa.di.madgik.searchlibrary.operatorlibrary.select.Binder

public class Binder
extends Object

Given some bindings as an input, replaces all references within a logical expression string that match a particular pattern.

Author:
john.gerbesiotis - DI NKUA

Constructor Summary
Binder(String expr)
          Constructor
Binder(String expr, String pattern)
          Constructor
 
Method Summary
 Set<String> getSubstitutions()
           
static void main(String[] args)
           
 String substitute(Map<String,String> bindings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Binder

public Binder(String expr)
Constructor

Parameters:
expr - The expression to be evaluated.

Binder

public Binder(String expr,
              String pattern)
Constructor

Parameters:
expr - The expression to be evaluated.
pattern - The pattern to be matched (e.g. [(\d+)])
Method Detail

getSubstitutions

public Set<String> getSubstitutions()
Returns:
A set of references that must be substituted.

substitute

public String substitute(Map<String,String> bindings)
Parameters:
bindings - The bindings between the references and the actual values that will take their place.
Returns:
The string after substitutions.

main

public static void main(String[] args)
                 throws IOException
Throws:
IOException


Copyright © 2013. All Rights Reserved.