Record Class IntersectionObserver.IntersectionEntry
java.lang.Object
java.lang.Record
org.vaadin.firitin.util.IntersectionObserver.IntersectionEntry
- Record Components:
isIntersecting- whether the target is currently intersecting the rootintersectionRatio- how much of the target is visible (0.0 to 1.0)
- Enclosing class:
IntersectionObserver
public static record IntersectionObserver.IntersectionEntry(boolean isIntersecting, double intersectionRatio)
extends Record
Information about a component's intersection with the root.
-
Constructor Summary
ConstructorsConstructorDescriptionIntersectionEntry(boolean isIntersecting, double intersectionRatio) Creates an instance of aIntersectionEntryrecord class. -
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.doubleReturns the value of theintersectionRatiorecord component.booleanReturns the value of theisIntersectingrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IntersectionEntry
public IntersectionEntry(boolean isIntersecting, double intersectionRatio) Creates an instance of aIntersectionEntryrecord class.- Parameters:
isIntersecting- the value for theisIntersectingrecord componentintersectionRatio- the value for theintersectionRatiorecord component
-
-
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 with thecomparemethod from their corresponding wrapper classes. -
isIntersecting
public boolean isIntersecting()Returns the value of theisIntersectingrecord component.- Returns:
- the value of the
isIntersectingrecord component
-
intersectionRatio
public double intersectionRatio()Returns the value of theintersectionRatiorecord component.- Returns:
- the value of the
intersectionRatiorecord component
-