edu.udo.cs.ie.cowbots.logic.solver
Class ELPSource

Package class diagram package ELPSource
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.logic.solver.ELPSource

public class ELPSource
extends java.lang.Object

this class models an input source for asp solvers. an input source is either a program, a collection of facts, or a file (program on hard drive).


Field Summary
(package private)  ELP resELP
           
(package private)  java.util.Collection<? extends ELPLiteral> resFacts
           
(package private)  java.lang.String resFile
           
(package private)  int resType
           
static int SRC_ELP
           
static int SRC_FACT
           
static int SRC_FILE
           
 
Constructor Summary
ELPSource(java.util.Collection<? extends ELPLiteral> factSrc)
          this method constructs an elpsource based on a collection of facts.
ELPSource(ELP elpSrc)
          this method constructs an elpsource based on an elp instance.
ELPSource(java.lang.String fileName)
          this method constructs an elpsource based on a filename.
 
Method Summary
private  void addFacts(java.io.BufferedWriter bw)
          helper function to add facts to an output stream
 void addResource(java.io.BufferedWriter bw)
          adds a source (either elp oder facts) to a buffered writer.
 java.lang.String getSrcFile()
          returns the path string of a program, if that source refers to a hard drive resource.
 int getType()
          returns the type (ELP,FACTS,FILE) of the elp source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SRC_FILE

public static final int SRC_FILE
See Also:
Constant Field Values

SRC_ELP

public static final int SRC_ELP
See Also:
Constant Field Values

SRC_FACT

public static final int SRC_FACT
See Also:
Constant Field Values

resFile

java.lang.String resFile

resELP

ELP resELP

resFacts

java.util.Collection<? extends ELPLiteral> resFacts

resType

int resType
Constructor Detail

ELPSource

public ELPSource(java.lang.String fileName)
this method constructs an elpsource based on a filename.

Parameters:
fileName - path and file of program

ELPSource

public ELPSource(ELP elpSrc)
this method constructs an elpsource based on an elp instance.

Parameters:
elpSrc - source program

ELPSource

public ELPSource(java.util.Collection<? extends ELPLiteral> factSrc)
this method constructs an elpsource based on a collection of facts.

Parameters:
factSrc - collection of facts
Method Detail

getType

public int getType()
returns the type (ELP,FACTS,FILE) of the elp source.

Returns:
type identifier

getSrcFile

public java.lang.String getSrcFile()
returns the path string of a program, if that source refers to a hard drive resource.

Returns:
path to program

addResource

public void addResource(java.io.BufferedWriter bw)
                 throws java.io.IOException
adds a source (either elp oder facts) to a buffered writer.

Parameters:
bw -
Throws:
java.io.IOException

addFacts

private void addFacts(java.io.BufferedWriter bw)
               throws java.io.IOException
helper function to add facts to an output stream

Parameters:
bw - buffered writer output target
Throws:
java.io.IOException