Package globus.glmap

Class GLMapValue


public class GLMapValue extends GLMapDrawObject
Holds a string value and optional highlight ranges.

Highlight information is typically produced by the offline search engine and can be rendered as a SpannableString via getSpanned(Object, Object, int).

  • Constructor Details

    • GLMapValue

      public GLMapValue(String value)
      Creates GLMapValue from a string.
      Parameters:
      value - string
  • Method Details

    • getString

      @Nullable public String getString()
      Returns plain text value
      Returns:
      plain text
    • getNumber

      public float getNumber()
      Returns number value
      Returns:
      number or NAN if not a number
    • getSpanned

      @NonNull public android.text.SpannableString getSpanned(Object normal, Object highlighted, int flags)
      Returns spannable text value
      Parameters:
      normal - attributes for normal text
      highlighted - attributes for highlighted text
      flags - flags for spans
      Returns:
      spannable string
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • truncate

      @NonNull public static String truncate(@NonNull String string, int lineMaxLen, int maxLines)
      Truncates a string and splits it into multiple lines.
      Parameters:
      string - string to modify
      lineMaxLen - max line length
      maxLines - max line count
      Returns:
      truncated string