notio
Class MatchResult

java.lang.Object
  |
  +--notio.MatchResult

public class MatchResult
extends java.lang.Object

A class for reporting the results of a match operation. For most types of match, this is simply a boolean result, but for some match types, it also contains node mappings.


Constructor Summary
MatchResult(boolean resultFlag)
          Constructs a new MatchResult with the specified result flag.
MatchResult(NodeMapping[] newMappings)
          Constructs a new MatchResult with the specified mappings.
 
Method Summary
 NodeMapping[] getMappings()
          Returns the node mappings generated by the match (if any).
 int getNumberOfMatches()
          Returns the number of matches (mappings) found.
 boolean matchSucceeded()
          Returns true if one or matches were found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchResult

public MatchResult(boolean resultFlag)
Constructs a new MatchResult with the specified result flag.
Parameters:
resultFlag - a boolean value indicating whether the match was successful or not.

MatchResult

public MatchResult(NodeMapping[] newMappings)
Constructs a new MatchResult with the specified mappings. The array of mappings must not be null although it could be empty.
Parameters:
newMappings - an array of node mappings that describe the matches found.
Method Detail

matchSucceeded

public boolean matchSucceeded()
Returns true if one or matches were found.
Returns:
true if one or matches were found.

getNumberOfMatches

public int getNumberOfMatches()
Returns the number of matches (mappings) found. If the search succeeded but no mappings were generated, a 1 is returned. If the search fails, a 0 is returned.
Returns:
the number of matches found.

getMappings

public NodeMapping[] getMappings()
Returns the node mappings generated by the match (if any). If the match failed, this method will return null.
Returns:
an array containing node mappings generated by the match or null if the match failed.


Copyright 1998-2001 Finnegan Southey