org.stathissideris.ascii2image.text
Class GridPattern

java.lang.Object
  extended by org.stathissideris.ascii2image.text.TextGrid
      extended by org.stathissideris.ascii2image.text.GridPattern

public class GridPattern
extends TextGrid

This is a TextGrid (usually 3x3) that contains the equivalent of a 2D reqular expression (which uses custom syntax to make things more visual, but standard syntax is also possible). The custom syntax is: . means anything b means any boundary (any of - = / \ + | :) ! means not boundary (none of - = / \ + | :) - means - or = | means | or : [ means not | nor : ~ means not - nor = ^ means a boundary but not - nor = ( means a boundary but not | nor : s means a straight boundary (one of - = + | :) S means not a straight boundary (none of - = + | :) 1 means a cell that has entry point 1 2 means a cell that has entry point 2 3 means a cell that has entry point 3 etc. up to number 8 %1 means a cell that does not have entry point 1 etc. See below for an explanation of entry points +, \, / and the space are literal (as is any other character) Entry points

 1   2   3
  *--*--*
  |     |
 8*     *4
  |     |
  *--*--*
 7   6   5
 
We number the entry points for each cell as in the diagram above. If a cell is occupied by a character, we define as entry points the points of the above diagram that the character can touch with the end of its lines. For example - has entry points 8 and 4, | and : have entry points 2 and 6, / has 3 and 7, \ has 1 and 5, + has 2, 6, 8 and 4 etc.

Author:
Efstathios Sideris

Nested Class Summary
 
Nested classes/interfaces inherited from class org.stathissideris.ascii2image.text.TextGrid
TextGrid.Cell, TextGrid.CellColorPair, TextGrid.CellStringPair, TextGrid.CellTagPair
 
Constructor Summary
GridPattern()
           
GridPattern(String row1, String row2, String row3)
           
 
Method Summary
 boolean isMatchedBy(TextGrid grid)
           
static void main(String[] args)
           
 void setTo(String row1, String row2, String row3)
           
 void setUsesStandardSyntax(boolean b)
           
 boolean usesStandardSyntax()
           
 
Methods inherited from class org.stathissideris.ascii2image.text.TextGrid
add, addToMarkupTags, cellContainsDashedLineChar, clear, containsAtLeastOneDashedLine, copyCellsTo, equals, exactlyOneNeighbourIsBoundary, fillCellsWith, fillContinuousArea, fillContinuousArea, findArrowheads, findBoundariesExpandingFrom, findColorCodes, findMarkupTags, findStrings, followCell, followCell, followCorner, followCorner, followCorner1, followCorner1, followCorner2, followCorner2, followCorner3, followCorner3, followCorner4, followCorner4, followCrossOnLine, followIntersection, followIntersection, followLine, followLine, followLine, followStub, followStub, get, get, getAllBlanksBetweenCharacters, getAllBoundaries, getAllNonBlank, getCellTypeAsString, getDebugString, getEastOf, getEastOf, getHeight, getNorthOf, getNorthOf, getPointMarkersOnLine, getRow, getRows, getSouthOf, getSouthOf, getStringAt, getStringAt, getSubGrid, getTestingSubGrid, getWestOf, getWestOf, getWidth, hasBlankCells, hasEntryPoint, initialiseWithLines, initialiseWithText, isArrowhead, isBlank, isBlank, isBlankBetweenCharacters, isBoundary, isBoundary, isBoundary, isBullet, isBullet, isColumnBlank, isCorner, isCorner, isCorner1, isCorner2, isCorner3, isCorner4, isCross, isCrossOnLine, isEastArrowhead, isHorizontalCrossOnLine, isHorizontalLine, isHorizontalLine, isHorizontalLine, isHorizontalLinesEnd, isHorizontalStarOnLine, isIntersection, isIntersection, isInverseK, isInverseT, isK, isLine, isLinesEnd, isLinesEnd, isLoneDiagonal, isNormalCorner, isNormalCorner, isNorthArrowhead, isOnHorizontalLine, isOnVerticalLine, isOutOfBounds, isOutOfBounds, isPointCell, isRoundCorner, isRoundCorner, isSouthArrowhead, isStarOnLine, isStringsEnd, isStringsStart, isStub, isT, isVerticalCrossOnLine, isVerticalLine, isVerticalLine, isVerticalLine, isVerticalLinesEnd, isVerticalStarOnLine, isWestArrowhead, loadFrom, loadFrom, makeSameSizeAs, matches, matchesAll, matchesAny, matchesAny, otherStringsEndInTheSameColumn, otherStringsStartInTheSameColumn, printDebug, removeArrowheads, removeBoundaries, removeColorCodes, removeMarkupTags, removeNonText, replaceAll, replaceBullets, replaceHumanColorCodes, replacePointMarkersOnLine, replaceTypeOnLine, set, set, setRow, setRow, toString, writeStringTo, writeStringTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridPattern

public GridPattern()

GridPattern

public GridPattern(String row1,
                   String row2,
                   String row3)
Method Detail

usesStandardSyntax

public boolean usesStandardSyntax()

setUsesStandardSyntax

public void setUsesStandardSyntax(boolean b)

isMatchedBy

public boolean isMatchedBy(TextGrid grid)

setTo

public void setTo(String row1,
                  String row2,
                  String row3)

main

public static void main(String[] args)


Copyright © 2011. All Rights Reserved.