   @delegatesMethods 'containsPoint', 'containsRange', 'intersectsRow', toProperty: 'range'
   @delegatesMethods 'clipPosition', 'clipRange', toProperty: 'manager'
 
+  # Private:
   constructor: (params) ->
     {@manager, @id, @range, @tailed, @reversed} = params
     {@valid, @invalidate, @persistent, @properties} = params

  matchesAttributes: (args...) ->
    @matchesParams(args...)

  matchesParams: (params) ->
    for key, value of params
      return false unless @matchesParam(key, value)
    true

  matchesParam: (key, value) ->
    switch key
      when 'startPosition'

    Object.freeze(@properties)
    @updateIntervals()

  # Private: Used by {Serializable} during serialization.
  serializeParams: ->
    range = @range.serialize()
    {@id, range, @tailed, @reversed, @valid, @invalidate, @persistent, @properties}

  # Private: Used by {Serializable} during deserialization.
  deserializeParams: (state) ->
    state.range = Range.deserialize(state.range)
    state

  # Public: Returns the current {Range} of the marker. The range is immutable.
  getRange: ->
    @range

  # Public: Sets the range of the marker.
  #
  # * range:
  #     A {Range} or range-compatible {Array}. The range will be clipped before.
  #     it is assigned.
  # * properties:
  #     An optional hash of properties to associate with the marker. The 'reversed'
  #     property is reserved and if true, will cause the marker to be in a reversed
  #     orientation.
  setRange: (range, properties) ->
    params = @extractParams(properties)
    params.tailed = true
    params.range = @clipRange(Range.fromObject(range, true))
    @update(params)

  # Public: Returns a {Point} representing the marker's current head position.
  getHeadPosition: ->
    if @reversed
      @range.start
    else
      @range.end

  # Public: Sets the head position of the marker.
  #
  # * position:
  #     A {Point} or point-compatible {Array}. The position will be clipped
  #     before it is assigned.
  # * properties:
  #     An optional hash of properties to associate with the marker.
  setHeadPosition: (position, properties) ->
    position = @clipPosition(Point.fromObject(position, true))
    params = @extractParams(properties)

    if @hasTail()
      if @isReversed()
