|
Copyright (C) 2003,2004 dr. Cristiano Sadun | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sadun.text.ffp.CountCondition
A condition which compares the numer of physical/logical lines read so far with a given number (pivot number), checking for a specific simple numeric relationship.
| Field Summary | |
static int |
EQUAL
Relation constant |
static int |
EVEN
Relation constant |
static int |
GREATER
Relation constant |
static int |
GREATER_OR_EQUAL
Relation constant |
static int |
LOGICAL_LINES
Constant to indicate that comparisons will occur with logical lines count. |
static int |
LOWER
Relation constant |
static int |
LOWER_OR_EQUAL
Relation constant |
static int |
ODD
Relation constant |
static int |
PHYSICAL_LINES
Constant to indicate that comparisons will occur with physical lines count. |
| Constructor Summary | |
CountCondition(int pivotNumber,
int relationType)
Create a condition of the given type (using one of the type constants), referring to the logical lines, and pivoted on the given number. |
|
CountCondition(int pivotNumber,
int lineType,
int relationType)
Create a condition of the given type (using one of the type constants), referring to either logical or physical lines, and pivoted on the given number. |
|
| Method Summary | |
int |
getLineType()
Return the line type used by this condition (one of LOGICAL_LINES or PHYSICAL_LINES). |
int |
getPivotNumber()
Return the number to use for comparisons (pivot number). |
int |
getRelationType()
Return the relation type used by this condition (one of LOWER, LOWER_OR_EQUAL, EQUAL,
GREATER, GREATER_OR_EQUAL, ODD or EVEN). |
boolean |
holds(int logicalLineCount,
int physicalLineCount,
FlatFileParser.LineReader reader)
The condition holds if the physical/logical line count (as defined at construction) has the specified relation type with the pivot
number.
|
java.lang.String |
toString()
Return a human-readable description of the condition. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int PHYSICAL_LINES
public static final int LOGICAL_LINES
public static final int LOWER
public static final int LOWER_OR_EQUAL
public static final int EQUAL
public static final int GREATER_OR_EQUAL
public static final int GREATER
public static final int ODD
public static final int EVEN
| Constructor Detail |
public CountCondition(int pivotNumber,
int lineType,
int relationType)
lineType - one of PHYSICAL_LINES or LOGICAL_LINESrelationType - one of LOWER, LOWER_OR_EQUAL, EQUAL,
GREATER, GREATER_OR_EQUAL, ODD or EVEN.
public CountCondition(int pivotNumber,
int relationType)
relationType - one of LOWER, LOWER_OR_EQUAL, EQUAL,
GREATER, GREATER_OR_EQUAL, ODD or EVEN.| Method Detail |
public boolean holds(int logicalLineCount,
int physicalLineCount,
FlatFileParser.LineReader reader)
relation type with the pivot
number.
For example, if the line type is LOGICAL_LINES, the relation type is LOWER and
the pivot number is 5, the condition will hold for the first 4 logical lines.
holds in interface FlatFileParser.ConditionlogicalLineCount - the logical lines read so farphysicalLineCount - the physical lines read so farreader - an object allowing to read lines on the file
public int getLineType()
LOGICAL_LINES or PHYSICAL_LINES).
LOGICAL_LINES or PHYSICAL_LINES).public int getRelationType()
LOWER, LOWER_OR_EQUAL, EQUAL,
GREATER, GREATER_OR_EQUAL, ODD or EVEN).
LOWER, LOWER_OR_EQUAL, EQUAL,
GREATER, GREATER_OR_EQUAL, ODD or EVEN).public int getPivotNumber()
public java.lang.String toString()
FlatFileParser.Condition
toString in interface FlatFileParser.Condition
|
Copyright (C) 2003,2004 dr. Cristiano Sadun | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||