java.lang.Object
java.lang.Record
org.aya.pretty.doc.Doc.Union
- Enclosing interface:
Doc
public static record Doc.Union(@NotNull Doc shorterOne, @NotNull Doc longerOne)
extends Record
implements Doc
The first lines of first document should be shorter than the
first lines of the second one, so the layout algorithm can pick the one
that fits best. Used to implement layout alternatives for 'softline' and 'group'.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aya.pretty.doc.Doc
Doc.Cat, Doc.Column, Doc.Empty, Doc.FlatAlt, Doc.HyperLinked, Doc.Line, Doc.Nest, Doc.Nesting, Doc.PageWidth, Doc.PlainText, Doc.SpecialSymbol, Doc.Styled, Doc.Union -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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 thelongerOnerecord component.@NotNull DocReturns the value of theshorterOnerecord 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
asSeq, commonRender, debugRender, isEmpty, isNotEmpty, render, renderToHtml, renderToHtml, renderToString, renderToTeX, renderWithPageWidth, toDoc
-
Constructor Details
-
Union
Creates an instance of aUnionrecord class.- Parameters:
shorterOne- the value for theshorterOnerecord componentlongerOne- the value for thelongerOnerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
shorterOne
Returns the value of theshorterOnerecord component.- Returns:
- the value of the
shorterOnerecord component
-
longerOne
Returns the value of thelongerOnerecord component.- Returns:
- the value of the
longerOnerecord component
-