jInfer

cz.cuni.mff.ksi.jinfer.functionalDependencies
Class PathAnswer

java.lang.Object
  extended by cz.cuni.mff.ksi.jinfer.functionalDependencies.PathAnswer

public class PathAnswer
extends Object

Class representing answer of the path, i.e. it contains list of nodes that satisfies this path.


Constructor Summary
PathAnswer(List<Node> nodeList, boolean isValue)
          Constructor creating the PathAnswer.
PathAnswer(NodeList nodeList, boolean isValue)
          Constructor creating the PathAnswer.
 
Method Summary
 boolean equals(Object obj)
           
 List<Node> getNodeAnswers()
          Get list of all nodes that satisfies the path.
 Node getTupleNodeAnswer()
          Get node this answer contains.
 String getTupleValueAnswer()
          Get value of tje node this answer contains.
 List<String> getValueAnswers()
          Get list of string values of all nodes that satisfies the path.
 int hashCode()
           
 boolean hasMaxOneElement()
          Check if answer contains one or zero nodes.
 boolean hasOneElement()
          Check if answer contains exactly one node.
 boolean isEmpty()
          Check if the answer is empty, i.e.
 boolean isNodeAnswer()
          Check if this answer is node answer, i.e.
 boolean isValueAnswer()
          Check if this answer is a value answer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathAnswer

public PathAnswer(NodeList nodeList,
                  boolean isValue)
Constructor creating the PathAnswer. It gets as parameters NodeList containing nodes satisfying path and flag describing if the nodes are value nodes (text values of elements or attributes).

Parameters:
nodeList - NodeList of nodes that satisfies path.
isValue - flag representing if the answer point to value nodes.

PathAnswer

public PathAnswer(List<Node> nodeList,
                  boolean isValue)
Constructor creating the PathAnswer. It gets as parameters List containing nodes satisfying path and flag describing if the nodes are value nodes (text values of elements or attributes).

Parameters:
nodeList - List of nodes that satisfies path.
isValue - flag representing if the answer point to value nodes.
Method Detail

isEmpty

public boolean isEmpty()
Check if the answer is empty, i.e. number of nodes satisfying path is equal to zero.

Returns:
true if answer contains zero nodes.

hasMaxOneElement

public boolean hasMaxOneElement()
Check if answer contains one or zero nodes.

Returns:
true if answer contains one or zero nodes.

hasOneElement

public boolean hasOneElement()
Check if answer contains exactly one node.

Returns:
true if answer contains exactly one node.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getNodeAnswers

public List<Node> getNodeAnswers()
Get list of all nodes that satisfies the path.

Returns:
List of nodes that satisfies the path.

getValueAnswers

public List<String> getValueAnswers()
Get list of string values of all nodes that satisfies the path. This method is valid only if this path answer is a value answer, otherwise throws UnsupportedOperationException

Returns:
List of string values of all nodes that satisfies the path.

isNodeAnswer

public boolean isNodeAnswer()
Check if this answer is node answer, i.e. is not a value answer.

Returns:
true if this answer is a node answer.

isValueAnswer

public boolean isValueAnswer()
Check if this answer is a value answer.

Returns:
true if this answer is a value answer.

getTupleNodeAnswer

public Node getTupleNodeAnswer()
Get node this answer contains. If answer contains more then one node it throws UnsupportedOperationException. If this answer is empty return null.

Returns:
Node this answer contains.

getTupleValueAnswer

public String getTupleValueAnswer()
Get value of tje node this answer contains. This answer must be value type. If answer contains more then one node it throws UnsupportedOperationException. If this answer is empty return null.

Returns:
Value of the node this answer contains.

jInfer

Generated on Fri Dec 9 00:01:25 CET 2011