Class CellSet
java.lang.Object
org.stathissideris.ascii2image.text.CellSet
- All Implemented Interfaces:
Iterable<TextGrid.Cell>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(TextGrid.Cell cell) void
void
void
Takes into account character info from the gridBreaks that:boolean
contains
(TextGrid.Cell cell) static CellSet
copyCellSet
(CellSet set) Deep copyboolean
find
(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()
int
int
getMaxX()
int
getMaxY()
int
getMinX()
int
getMinY()
int
int
getWidth()
boolean
hasCommonCells
(CellSet otherSet) iterator()
void
void
remove
(TextGrid.Cell cell) static ArrayList
removeDuplicateSets
(ArrayList list) int
size()
void
subtractSet
(CellSet set) toString()
void
translate
(int dx, int dy) Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
iterator
in 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
-