本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
652B

  1. // Copyright (c) 2015, Emir Pasic. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package binaryheap
  5. import "github.com/emirpasic/gods/containers"
  6. func assertSerializationImplementation() {
  7. var _ containers.JSONSerializer = (*Heap)(nil)
  8. var _ containers.JSONDeserializer = (*Heap)(nil)
  9. }
  10. // ToJSON outputs the JSON representation of the heap.
  11. func (heap *Heap) ToJSON() ([]byte, error) {
  12. return heap.list.ToJSON()
  13. }
  14. // FromJSON populates the heap from the input JSON representation.
  15. func (heap *Heap) FromJSON(data []byte) error {
  16. return heap.list.FromJSON(data)
  17. }
上海开阖软件有限公司 沪ICP备12045867号-1