Copyright (C) 2003,2004 dr. Cristiano Sadun

org.sadun.text.ffp
Class NotCondition

java.lang.Object
  extended byorg.sadun.text.ffp.NotCondition
All Implemented Interfaces:
FlatFileParser.Condition

public class NotCondition
extends java.lang.Object
implements FlatFileParser.Condition

A FlatFileParser.Condition that holds if and only if the condition passed at construction does not hold.

Author:
Cristiano Sadun

Constructor Summary
NotCondition(FlatFileParser.Condition condition)
          Create a condition that negates the given one.
 
Method Summary
 boolean holds(int logicalLineCount, int physicalLineCount, FlatFileParser.LineReader reader)
          The condition given at construction is evaluated: if it fails, this condition holds; otherwise not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sadun.text.ffp.FlatFileParser.Condition
toString
 

Constructor Detail

NotCondition

public NotCondition(FlatFileParser.Condition condition)
Create a condition that negates the given one.

Parameters:
condition - the condition to negate.
Method Detail

holds

public boolean holds(int logicalLineCount,
                     int physicalLineCount,
                     FlatFileParser.LineReader reader)
              throws java.io.IOException
The condition given at construction is evaluated: if it fails, this condition holds; otherwise not.

Specified by:
holds in interface FlatFileParser.Condition
Parameters:
logicalLineCount - the logical lines read so far
physicalLineCount - the physical lines read so far
reader - an object allowing to read lines on the file
Returns:
true if the conditions hold, false otherwise.
Throws:
java.io.IOException - if a I/O problem arises when reading lines
See Also:
FlatFileParser.Condition.holds(int, int, org.sadun.text.ffp.FlatFileParser.LineReader)

Copyright (C) 2003,2004 dr. Cristiano Sadun