Class LambdaUtil


  • public class LambdaUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LambdaUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.function.Predicate<T> alwaysFalse()  
      static <T> java.util.function.Predicate<T> alwaysTrue()  
      static java.lang.String ancestorDump​(Box bx)
      Ancestor dump to string including starting box and referenced layers.
      static java.util.stream.Stream<Box> ancestors​(Box bx)
      Null-safe way to look up the ancestor tree as a stream.
      static java.lang.String boxDescription​(Box box)
      Null-safe box description including object id, layer, containing layer and impl class.
      static java.lang.String descendantDump​(Box root)
      Creates an indented dump of the box tree.
      private static void descendantDump​(Box parent, int indent, java.util.List<LambdaUtil.DescendantContent> out)  
      static java.util.stream.Stream<Box> descendants​(Box parent)
      A stream of all descendant boxes not including InlineText or InlineBox objects.
      static java.util.List<Box> descendantsList​(Box parent)
      static java.lang.String layerDescription​(Layer layer)
      Null-safe layer description including object id, toString and master box description.
      static java.lang.String objectId​(java.lang.Object obj)
      Null-safe identity hash code.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LambdaUtil

        private LambdaUtil()
    • Method Detail

      • ancestors

        public static java.util.stream.Stream<Box> ancestors​(Box bx)
        Null-safe way to look up the ancestor tree as a stream. Does not include starting box. Will return a empty stream if either bx or bx.getParent() is null.
      • descendants

        public static java.util.stream.Stream<Box> descendants​(Box parent)
        A stream of all descendant boxes not including InlineText or InlineBox objects. This would usually only be called after layout is concluded as InlineBox objects are converted to one or more InlineLayoutBox during layout. Should be in breadth first order.
      • objectId

        public static java.lang.String objectId​(java.lang.Object obj)
        Null-safe identity hash code. Debug only.
      • boxDescription

        public static java.lang.String boxDescription​(Box box)
        Null-safe box description including object id, layer, containing layer and impl class. Debug only.
      • layerDescription

        public static java.lang.String layerDescription​(Layer layer)
        Null-safe layer description including object id, toString and master box description. Debug only.
      • ancestorDump

        public static java.lang.String ancestorDump​(Box bx)
        Ancestor dump to string including starting box and referenced layers. Debug only.
      • descendantDump

        public static java.lang.String descendantDump​(Box root)
        Creates an indented dump of the box tree. Includes both the pre-layout inline-content and if layout has been run, the after layout structure. Debug only.
      • alwaysTrue

        public static <T> java.util.function.Predicate<T> alwaysTrue()
      • alwaysFalse

        public static <T> java.util.function.Predicate<T> alwaysFalse()