net.sf.parcinj
Class MatchingResult

java.lang.Object
  extended by net.sf.parcinj.MatchingResult

public final class MatchingResult
extends java.lang.Object

Immutable class representing the result of a Symbol.matches(Token) invocation. If matching isn't successful a human readable failure reason is provided.


Field Summary
static MatchingResult OK
          Successful matching result.
 
Method Summary
static MatchingResult failure(java.lang.String reason)
          Creates a matching failure for the specified reason.
 java.lang.String getFailureReason()
          Returns the reason of failure.
 boolean isSuccessful()
          Returns true if matching was successful.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final MatchingResult OK
Successful matching result.

Method Detail

failure

public static MatchingResult failure(java.lang.String reason)
Creates a matching failure for the specified reason. If reason isn't specified unknown is used.


isSuccessful

public final boolean isSuccessful()
Returns true if matching was successful.


getFailureReason

public final java.lang.String getFailureReason()
Returns the reason of failure.