Class CellSet
java.lang.Object
org.stathissideris.ascii2image.text.CellSet
- All Implemented Interfaces:
Iterable<TextGrid.Cell>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(TextGrid.Cell cell) voidvoidvoidTakes into account character info from the gridBreaks that:booleancontains(TextGrid.Cell cell) static CellSetcopyCellSet(CellSet set) Deep copybooleanfind(int x, int y) find(TextGrid.Cell cell) findCellNextTo(TextGrid.Cell cell) Returns the first cell that is found to be next tocell.findCellsNextTo(TextGrid.Cell cell) Returns all the cells that are found to be next tocell.getFilledEquivalent(TextGrid textGrid) getFirst()intintgetMaxX()intgetMaxY()intgetMinX()intgetMinY()intintgetWidth()booleanhasCommonCells(CellSet otherSet) iterator()voidvoidremove(TextGrid.Cell cell) removeDuplicateSets(ArrayList<CellSet> list) intsize()voidsubtractSet(CellSet set) toString()voidtranslate(int dx, int dy) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
TYPE_CLOSED
public static final int TYPE_CLOSED- See Also:
-
TYPE_OPEN
public static final int TYPE_OPEN- See Also:
-
TYPE_MIXED
public static final int TYPE_MIXED- See Also:
-
TYPE_HAS_CLOSED_AREA
public static final int TYPE_HAS_CLOSED_AREA- See Also:
-
TYPE_UNDETERMINED
public static final int TYPE_UNDETERMINED- See Also:
-
-
Constructor Details
-
CellSet
public CellSet() -
CellSet
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<TextGrid.Cell>
-
add
-
addAll
-
size
public int size() -
getFirst
-
printAsGrid
public void printAsGrid() -
printDebug
public void printDebug() -
getCellsAsString
-
toString
-
copyCellSet
Deep copy- Parameters:
set-- Returns:
-
getType
-
translate
public void translate(int dx, int dy) -
find
-
contains
-
addSet
-
hasCommonCells
-
find
-
getFilledEquivalent
-
findCellNextTo
Returns the first cell that is found to be next tocell.- Parameters:
cell-- Returns:
-
findCellsNextTo
Returns all the cells that are found to be next tocell.- Parameters:
cell-- Returns:
-
appendSet
-
subtractSet
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getMaxX
public int getMaxX() -
getMinX
public int getMinX() -
getMaxY
public int getMaxY() -
getMinY
public int getMinY() -
remove
-
equals
-
removeDuplicateSets
-
breakIntoDistinctBoundaries
Takes into account character info from the grid- Returns:
- ArrayList of distinct BoundarySetS
-
breakIntoDistinctBoundaries
- Returns:
- ArrayList of distinct BoundarySetS
-
breakTrulyMixedBoundaries
Breaks that:+-----+ | | + ---+------------------- | | +-----+
into the following 3:+-----+ | | + + | | +-----+ --- -------------------- Parameters:
grid-- Returns:
- a list of boundaries that are either open or closed but not mixed
and they are equivalent to the
this
-
makeIntoGrid
-
makeScaledOneThirdEquivalent
-