Record Class Doc.FlatAlt
java.lang.Object
java.lang.Record
org.aya.pretty.doc.Doc.FlatAlt
- Enclosing interface:
Doc
public static record Doc.FlatAlt(@NotNull Doc defaultDoc, @NotNull Doc preferWhenFlatten)
extends Record
implements Doc
Lay out the defaultDoc 'Doc', but when flattened (via 'group'), prefer
the preferWhenFlatten.
The layout algorithms work under the assumption that the defaultDoc
alternative is less wide than the flattened preferWhenFlatten alternative.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aya.pretty.doc.Doc
Doc.Cat, Doc.CodeBlock, Doc.Column, Doc.Empty, Doc.EscapedText, Doc.FlatAlt, Doc.HyperLinked, Doc.Image, Doc.InlineCode, Doc.InlineMath, Doc.Line, Doc.List, Doc.MathBlock, Doc.Nest, Doc.Nesting, Doc.PageWidth, Doc.PlainText, Doc.SpecialSymbol, Doc.Styled, Doc.Tooltip, Doc.Union -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull DocReturns the value of thedefaultDocrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull DocReturns the value of thepreferWhenFlattenrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.pretty.doc.Doc
commonRender, debugRender, isEmpty, isNotEmpty, render, renderToAyaMd, renderToHtml, renderToHtml, renderToMd, renderToString, renderToString, renderToTerminal, renderToTerminal, renderToTeX, toDoc
-
Constructor Details
-
FlatAlt
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
defaultDoc
Returns the value of thedefaultDocrecord component.- Returns:
- the value of the
defaultDocrecord component
-
preferWhenFlatten
Returns the value of thepreferWhenFlattenrecord component.- Returns:
- the value of the
preferWhenFlattenrecord component
-