Class ImmutableDotBracketSymbol

    • Method Detail

      • structure

        public char structure()
        Specified by:
        structure in class DotBracketSymbol
        Returns:
        The structure character (dot or bracket).
      • index

        public int index()
        Specified by:
        index in class DotBracketSymbol
        Returns:
        The index of this symbol.
      • withSequence

        public final ImmutableDotBracketSymbol withSequence​(char value)
        Copy the current immutable object by setting a value for the sequence attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for sequence
        Returns:
        A modified copy of the this object
      • withStructure

        public final ImmutableDotBracketSymbol withStructure​(char value)
        Copy the current immutable object by setting a value for the structure attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for structure
        Returns:
        A modified copy of the this object
      • withIndex

        public final ImmutableDotBracketSymbol withIndex​(int value)
        Copy the current immutable object by setting a value for the index attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for index
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableDotBracketSymbol that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: sequence, structure, index.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • of

        public static ImmutableDotBracketSymbol of​(char sequence,
                                                   char structure,
                                                   int index)
        Construct a new immutable DotBracketSymbol instance.
        Parameters:
        sequence - The value for the sequence attribute
        structure - The value for the structure attribute
        index - The value for the index attribute
        Returns:
        An immutable DotBracketSymbol instance
      • copyOf

        public static ImmutableDotBracketSymbol copyOf​(DotBracketSymbol instance)
        Creates an immutable copy of a DotBracketSymbol value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable DotBracketSymbol instance