Module life.expert

Class RenderCollection<T>

  • Type Parameters:
    T - the type parameter

    public class RenderCollection<T>
    extends java.lang.Object
    Allows you to mark elements of a collection (for example, mark one of the elements with an asterisk) and output such a collection as a string. Builder pattern.
    RenderCollection.collection( sorted_list )
     	            .markElement( c , "*" )
     	            .markRange( a , b , "()" )
     	            .log(); **
    • Method Summary

      Modifier and Type Method Description
      RenderCollection<T> buildToLog()
      Log render collection.
      java.lang.String buildToString()
      Render to string string.
      RenderCollection<T> clearMarkElements()
      Clear mark elements render collection.
      RenderCollection<T> clearMarkRanges()
      Clear mark ranges render collection.
      static <E> RenderCollection<E> collection​(@NonNull java.util.Collection<E> collection)
      Collection render collection.
      RenderCollection<T> markElement​(int index, @NonNull java.lang.String property)
      Mark element render collection.
      RenderCollection<T> markElement​(@NonNull java.util.Map<java.lang.Integer,​java.lang.String> markElements)
      Mark element render collection.
      RenderCollection<T> markRange​(int left, int right, @NonNull java.lang.String brackets)
      Mark range render collection.
      RenderCollection<T> markRange​(@NonNull com.google.common.collect.Range<java.lang.Integer> range, @NonNull java.lang.String brackets)
      Mark range render collection.
      RenderCollection<T> markRanges​(@NonNull java.util.Map<com.google.common.collect.Range<java.lang.Integer>,​java.lang.String> markRanges)
      Mark ranges render collection.
      • Methods inherited from class java.lang.Object

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

      • collection

        public static <E> RenderCollection<E> collection​(@NonNull
                                                         @NonNull java.util.Collection<E> collection)
        Collection render collection.
        Type Parameters:
        E - the type parameter
        Parameters:
        collection - the collection
        Returns:
        the render collection
      • markElement

        public RenderCollection<T> markElement​(int index,
                                               @NonNull
                                               @NonNull java.lang.String property)
        Mark element render collection.
        Parameters:
        index - the index
        property - the property
        Returns:
        the render collection
      • markElement

        public RenderCollection<T> markElement​(@NonNull
                                               @NonNull java.util.Map<java.lang.Integer,​java.lang.String> markElements)
        Mark element render collection.
        Parameters:
        markElements - the mark elements
        Returns:
        the render collection
      • clearMarkElements

        public RenderCollection<T> clearMarkElements()
        Clear mark elements render collection.
        Returns:
        the render collection
      • markRange

        public RenderCollection<T> markRange​(@NonNull
                                             @NonNull com.google.common.collect.Range<java.lang.Integer> range,
                                             @NonNull
                                             @NonNull java.lang.String brackets)
        Mark range render collection.
        Parameters:
        range - the range
        brackets - the brackets
        Returns:
        the render collection
      • markRange

        public RenderCollection<T> markRange​(int left,
                                             int right,
                                             @NonNull
                                             @NonNull java.lang.String brackets)
        Mark range render collection.
        Parameters:
        left - the left
        right - the right
        brackets - the brackets
        Returns:
        the render collection
      • markRanges

        public RenderCollection<T> markRanges​(@NonNull
                                              @NonNull java.util.Map<com.google.common.collect.Range<java.lang.Integer>,​java.lang.String> markRanges)
        Mark ranges render collection.
        Parameters:
        markRanges - the mark ranges
        Returns:
        the render collection
      • clearMarkRanges

        public RenderCollection<T> clearMarkRanges()
        Clear mark ranges render collection.
        Returns:
        the render collection
      • buildToLog

        public RenderCollection<T> buildToLog()
        Log render collection.
        Returns:
        the render collection
      • buildToString

        public java.lang.String buildToString()
        Render to string string.
        Returns:
        the string