Package limn.print
Record Class Paper
java.lang.Object
java.lang.Record
limn.print.Paper
- Record Components:
name- what a person calls it; never blankwidth- its width in points, more than zeroheight- its height in points, more than zero
A sheet of paper: its name and its size in points (1/72 inch), portrait or landscape.
Document.of(Paper.A4);
Document.of(Paper.LETTER.landscape());
Document.of(Paper.of("Receipt", 80, 200)); // millimetres
Document.of(Paper.forLocale(Locale.getDefault()));
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaperISO A3, 297 by 420 millimetres.static final PaperISO A4, 210 by 297 millimetres.static final PaperISO A5, 148 by 210 millimetres.static final PaperISO A6, 105 by 148 millimetres.static final PaperISO B4, 250 by 353 millimetres.static final PaperISO B5, 176 by 250 millimetres.static final PaperLegal, 8.5 by 14 inches.static final PaperLetter, 8.5 by 11 inches.static final PaperTabloid, 11 by 17 inches. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static PaperThe paper a region uses: Letter in the regions that use it (the United States, Canada, Mexico, the Philippines and the others the Unicode locale data lists), A4 everywhere else and for a locale that names no region.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.floatbooleanname()Returns the value of thenamerecord component.static Paperstatic Paperportrait()final StringtoString()Returns a string representation of this record class.floatwidth()Returns the value of thewidthrecord component.float
-
Field Details
-
A3
ISO A3, 297 by 420 millimetres. -
A4
ISO A4, 210 by 297 millimetres. -
A5
ISO A5, 148 by 210 millimetres. -
A6
ISO A6, 105 by 148 millimetres. -
B4
ISO B4, 250 by 353 millimetres. -
B5
ISO B5, 176 by 250 millimetres. -
LETTER
Letter, 8.5 by 11 inches. -
LEGAL
Legal, 8.5 by 14 inches. -
TABLOID
Tabloid, 11 by 17 inches.
-
-
Constructor Details
-
Method Details
-
of
- Parameters:
name- what a person calls itwidth- its width in millimetresheight- its height in millimetres- Returns:
- the paper
-
ofPoints
- Parameters:
name- what a person calls itwidth- its width in pointsheight- its height in points- Returns:
- the paper
-
forLocale
The paper a region uses: Letter in the regions that use it (the United States, Canada, Mexico, the Philippines and the others the Unicode locale data lists), A4 everywhere else and for a locale that names no region.- Parameters:
locale- a locale- Returns:
- Letter or A4
-
landscape
- Returns:
- this paper turned on its side: the longer side across; itself when it is already
-
portrait
- Returns:
- this paper upright: the longer side down; itself when it is already
-
isLandscape
public boolean isLandscape()- Returns:
- whether the paper is wider than it is tall
-
widthMillimetres
public float widthMillimetres()- Returns:
- the width in millimetres
-
heightMillimetres
public float heightMillimetres()- Returns:
- the height in millimetres
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
width
public float width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public float height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-