   matchesAttributes: (args...) ->
     @matchesParams(args...)
 
+  # Returns whether this marker matches the given parameters. The parameters
+  # are the same as {MarkerManager::findMarkers}.
   matchesParams: (params) ->
     for key, value of params
       return false unless @matchesParam(key, value)
     true
 
+  # Returns whether this marker matches the given parameter name and value.
+  # The parameters are the same as {MarkerManager::findMarkers}.
   matchesParam: (key, value) ->
     switch key
       when 'startPosition'

    else
      @getHeadPosition()

  setTailPosition: (position, params) ->
    position = @clipPosition(Point.fromObject(position, true))
    params = @extractParams(params)
    params.tailed = true

    if @reversed

  setAttributes: (args...) ->
    @setProperties(args...)

  # Public: Returns an {Object} containing any custom properties associated with
  # the marker.
  getProperties: ->
    @properties

  # Public: Merges an {Object} containing new properties into the marker's
  # existing properties.
  setProperties: (properties) ->
    @update(properties: extend({}, @getProperties(), properties))

  # Public: Creates and returns a new {Marker} with the same properties as this
  # marker.
  copy: (params) ->
    @manager.createMarker(extend(@toParams(), @extractParams(params)))

  # Public: Destroys the marker, causing it to emit the 'destroyed' event. Once
  # destroyed, a marker cannot be restored by undo/redo operations.
  destroy: ->
    @destroyed = true
    @manager.removeMarker(@id)
    @emit 'destroyed'

  # Private:
  extractParams: (params) ->
    params = @constructor.extractParams(params)
    params.properties = extend({}, @properties, params.properties) if params.properties?
    params

  # Public: Compares this marker to another based on their ranges.
  compare: (other) ->
    @range.compare(other.range)

