ua.gradsoft.termware
Class DefaultFacts

java.lang.Object
  extended by ua.gradsoft.termware.DefaultFacts
All Implemented Interfaces:
IFacts

public class DefaultFacts
extends Object
implements IFacts

this is Facts database, which accept next types of terms:


Nested Class Summary
static class DefaultFacts.MethodTransformer
          Transformer, wrapped arround method.
 
Constructor Summary
DefaultFacts()
           
DefaultFacts(String domainName)
           
 
Method Summary
 boolean check(Term t, TransformationContext ctx)
          Check term t.
 void clearLoggedEntities()
          clear entities to log
 String getDomainName()
           
 IEnv getEnv()
           
 boolean isLoggingMode()
          get logging mode
 void print(TransformationContext ctx, Term t)
          print term to standard output of transformation context.
 boolean println(TransformationContext ctx)
          println CR/LF
 boolean println(TransformationContext ctx, Term t)
          println term to standard output of transformation context
 void set(Term t, TransformationContext ctx)
          set fact (called from actions in right part of rules)
 void setCurrentStopFlag(TransformationContext ctx, boolean value)
          set stop flag of current transformation.
 void setEnv(IEnv env)
           
 void setLoggedEntities(Collection<String> s)
          set collection of entities to log
 void setLoggedEntity(String s)
          set entity to log.
 void setLoggingMode(boolean mode)
          enable/disable logging
 void unsetLoggedEntity(String s)
          unset entity to log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFacts

public DefaultFacts()
             throws TermWareException
Throws:
TermWareException

DefaultFacts

public DefaultFacts(String domainName)
             throws TermWareException
Throws:
TermWareException
Method Detail

getDomainName

public String getDomainName()

check

public boolean check(Term t,
                     TransformationContext ctx)
              throws TermWareException
Check term t.

Specified by:
check in interface IFacts
Parameters:
t - - term to check
ctx - - transformation context
Throws:
TermWareException

set

public void set(Term t,
                TransformationContext ctx)
         throws TermWareException
Description copied from interface: IFacts
set fact (called from actions in right part of rules)

Specified by:
set in interface IFacts
Throws:
TermWareException

getEnv

public IEnv getEnv()

setEnv

public void setEnv(IEnv env)

print

public void print(TransformationContext ctx,
                  Term t)
           throws TermWareException
print term to standard output of transformation context.

Throws:
TermWareException

println

public boolean println(TransformationContext ctx,
                       Term t)
                throws TermWareException
println term to standard output of transformation context

Throws:
TermWareException

println

public boolean println(TransformationContext ctx)
                throws TermWareException
println CR/LF

Throws:
TermWareException

setCurrentStopFlag

public void setCurrentStopFlag(TransformationContext ctx,
                               boolean value)
set stop flag of current transformation. (this will cause stop of term redusing in currenct system)


isLoggingMode

public boolean isLoggingMode()
Description copied from interface: IFacts
get logging mode

Specified by:
isLoggingMode in interface IFacts

setLoggingMode

public void setLoggingMode(boolean mode)
Description copied from interface: IFacts
enable/disable logging

Specified by:
setLoggingMode in interface IFacts

setLoggedEntity

public void setLoggedEntity(String s)
Description copied from interface: IFacts
set entity to log. (one of "All", "Facts" and so on)

Specified by:
setLoggedEntity in interface IFacts

unsetLoggedEntity

public void unsetLoggedEntity(String s)
Description copied from interface: IFacts
unset entity to log.

Specified by:
unsetLoggedEntity in interface IFacts

setLoggedEntities

public void setLoggedEntities(Collection<String> s)
Description copied from interface: IFacts
set collection of entities to log

Specified by:
setLoggedEntities in interface IFacts

clearLoggedEntities

public void clearLoggedEntities()
Description copied from interface: IFacts
clear entities to log

Specified by:
clearLoggedEntities in interface IFacts