Class GridPattern
- java.lang.Object
-
- org.stathissideris.ascii2image.text.TextGrid
-
- 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 points1 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
Constructors Constructor Description GridPattern()
GridPattern(String row1, String row2, String row3)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, 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
-
-