Class AltDataFilter

java.lang.Object
org.jjazz.chordleadsheet.api.item.AltDataFilter
All Implemented Interfaces:
Serializable

public class AltDataFilter extends Object implements Serializable
A filter used to decide whether the alternate data of a CLI_ChordSymbol should be used.

This is an immutable class.

See Also:
  • Constructor Details

    • AltDataFilter

      public AltDataFilter(List<String> values)
      Create a filter which accept a string if it is one of the specified values.
      Parameters:
      values - Must be a non empty list
    • AltDataFilter

      public AltDataFilter(AltDataFilter.Random r)
      Create a filter which just accepts strings randomly.
      Parameters:
      r -
  • Method Details

    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isRandom

      public boolean isRandom()
      True if filter accepts strings randomly.
      Returns:
    • getValues

      public List<String> getValues()
      Get the list of valid strings.
      Returns:
      Null if this filter is configured as a random filter.
    • accept

      public boolean accept(String str)
      Check if we accept the specified string.
      Parameters:
      str -
      Returns: