Class Style

    • Constructor Detail

      • Style

        public Style​(String style)
        Creates a new style segment with the specified name.
        Parameters:
        style - the style name
    • Method Detail

      • getName

        public String getName()
        Gets the name of this style.
        Returns:
        the name of this style
      • add

        public int add​(Segment segment)
        Adds a segment to this style.
        Parameters:
        segment - the segment to add
        Returns:
        the index of segment inside the group
      • getSegments

        public List<Segment> getSegments()
        Gets the segments in the scope of this style.
        Returns:
        a list of segments
      • peek

        public String peek()
        Description copied from interface: ResolvableText
        Peeks the value of this item. The returned string may be different from call to call.

        Note that after a call to ResolvableText.resolve(), this method should consistently return the same result.

        Specified by:
        peek in interface FollowingText
        Specified by:
        peek in interface ResolvableText
        Returns:
        the value, never null
      • isStatic

        public boolean isStatic()
        Description copied from interface: FollowingText
        Returns true if this item does not change.
        Specified by:
        isStatic in interface FollowingText
        Returns:
        true if this item is static, false otherwise