linked_list_int 0.1.0 → 3.0.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,31 +1,33 @@
1
1
  # linked_list_int [![Gem Version](https://badge.fury.io/rb/linked_list_int.svg)](https://badge.fury.io/rb/linked_list_int) ![Gem](https://img.shields.io/gem/dt/linked_list_int) [![Build Status](https://travis-ci.com/Diligent-Software-LLC/linked_list_int.svg?branch=master)](https://travis-ci.com/Diligent-Software-LLC/linked_list_int)
2
2
 
3
- A Linked-List data structure interface.
3
+ A LinkedList data structure library's interface.
4
4
 
5
5
  ## Installation
6
6
 
7
- - Refer the installation
8
- [page](https://docs.diligentsoftware.org/linked-list/packages).
7
+ - Refer Interface's
8
+ [Packages](https://docs.diligentsoftware.org/linkedlist-1/packages#interface).
9
9
 
10
10
  ## Documentation
11
11
 
12
- - Refer the documentation
13
- [page](https://docs.diligentsoftware.org/linked-list/interface) page.
12
+ - Refer Interface's
13
+ [Homepage](https://docs.diligentsoftware.org/linkedlist-1/interface).
14
14
 
15
15
  ## Contributing
16
16
 
17
17
  ### Donate
18
18
 
19
19
  Donations support continuous improvement and maintenance. The aim is a reliable,
20
- integrable, and endurable Linked-List library. Make a donation at the
21
- project's collective page: https://opencollective.com/linked-list.
22
- One-time and recurring donations are available at $1, $2, $4, $8, and $16.
23
- Greatly appreciated.
20
+ integrable, and endurable LinkedList library. Make a donation at the
21
+ project's collective page: https://opencollective.com/linkedlist. One-time and
22
+ recurring donations are available at $1, $2, $4, $8, and $16. Greatly
23
+ appreciated.
24
24
 
25
25
  ### Report Bugs
26
26
 
27
- Refer the [Bug Reporting Procedure](https://github.com/Diligent-Software-LLC/linked_list_int/issues/1).
27
+ - Refer the
28
+ [Bug Reporting Procedure](https://github.com/Diligent-Software-LLC/linked_list_int/issues/1).
28
29
 
29
30
  ### Fix Bugs
30
31
 
31
- Refer the [Bug Fixing Procedure](https://github.com/Diligent-Software-LLC/linked_list_int/issues/2).
32
+ - Refer the
33
+ [Bug Fixing Procedure](https://github.com/Diligent-Software-LLC/linked_list_int/issues/2).
@@ -1,169 +1,185 @@
1
1
  # Copyright (C) 2020 Diligent Software LLC. All rights reserved. Released
2
- # under the MIT License.
2
+ # under the GNU General Public License, Version 3. Refer LICENSE.txt.
3
3
 
4
- require "linked_list_int/version"
4
+ require_relative "linked_list_int/version"
5
5
 
6
6
  # LinkedListInt.
7
7
  # @abstract
8
- # A Linked-List data structure interface.
8
+ # @class_description
9
+ # A LinkedList data structure interface.
10
+ # @attr base [NodeAdapter]
11
+ # The list's base.
12
+ # @attr size [Integer]
13
+ # The list's element quantity.
9
14
  class LinkedListInt
10
15
 
11
- # initialize(node = nil).
12
- # @abstract
13
- # Constructor.
14
- # @param [Node, NilClass] node
15
- # A Node.
16
+ # initialize(d_or_n = nil).
17
+ # @description
18
+ # Initializes a list instance.
19
+ # @param d_or_n [DataType, Node, NodeAdapter]
20
+ # A {https://docs.diligentsoftware.org/data#data-types DataType} type
21
+ # instance, Node, or NodeAdapter instance.
16
22
  # @return [LinkedList]
17
- # A LinkedList
18
- def initialize(node = nil)
23
+ # A LinkedList instance.
24
+ def initialize(d_or_n = nil)
19
25
  end
20
26
 
21
- # copy_constructor().
22
- # @abstract
23
- # Copy constructor. Copies self.
24
- # @return [LinkedList] copy
25
- # self's copy. The copy is a different object, and its attributes refer
26
- # different objects.
27
- def copy_constructor()
27
+ # shallow_clone().
28
+ # @description
29
+ # Shallowly clones.
30
+ # @return [LinkedList]
31
+ # The clone.
32
+ def shallow_clone()
33
+ end
34
+
35
+ # clone_df().
36
+ # @description
37
+ # Deeply clones.
38
+ # @return [LinkedList]
39
+ # A deep clone. No Node references are identical. The data references are
40
+ # identical.
41
+ def clone_df()
28
42
  end
29
43
 
30
44
  # size().
31
- # @abstract
32
- # Getter. Gets the list size.
33
- # @return [Integer] @size
34
- # The Node count.
45
+ # @description
46
+ # Gets the list's size.
47
+ # @return [Integer]
48
+ # The element quantity.
35
49
  def size()
36
50
  end
37
51
 
38
- # empty?().
39
- # @abstract
40
- # Boolean method.
52
+ # exists(n = nil).
53
+ # @description
54
+ # Predicate. Verifies an object is a list element.
55
+ # @param n [.]
56
+ # Any object.
41
57
  # @return [TrueClass, FalseClass]
42
- # True in the case the size is zero. False otherwise.
43
- def empty?()
58
+ # True in the case 'n' is a list element. False otherwise.
59
+ def exists(n = nil)
44
60
  end
45
61
 
46
- # ==(ll = nil).
47
- # @abstract
48
- # Attribute equality operator.
49
- # @param [LinkedList, NilClass] ll
50
- # A LinkedList comparison object.
62
+ # empty().
63
+ # @description
64
+ # Predicate. Verifies size is 0.
51
65
  # @return [TrueClass, FalseClass]
52
- # True in the case the attribute object values are equal. False otherwise.
53
- def ==(ll = nil)
54
- end
55
-
56
- # ===(ll = nil).
57
- # @abstract
58
- # Case equality operator.
59
- # @param [LinkedList, NilClass] ll
60
- # A comparison LinkedList object.
61
- # @return [TrueClass, FalseClass] identical
62
- # True in the case the LinkedLists are the same list.
63
- def ===(ll = nil)
64
- end
65
-
66
- # inspect().
67
- # @abstract
68
- # Diagrammatically represents self.
69
- # @return [String] diagram
70
- # The LinkedList representation.
71
- def inspect()
72
- end
73
-
74
- # remove_at(index = nil).
75
- # @abstract
76
- # Removes the Node at index.
77
- # Irregular cases:
78
- # 1) index = 0, size > 1.
79
- # Resets the removal Node's front and back references nil. Reassigns base
80
- # the node at index 1. Resets the Node's front attribute nil. Decrements
81
- # size. Garbage collection cleans the removal Node.
82
- # 2) index = size - 1, size > 1.
83
- # Resets the removal Node's front and back attributes nil. Resets the node
84
- # at index - 1's back attribute nil. Decrements size. Reassigns base.
85
- # Garbage collection cleans the removed Node.
86
- # 3) index = 0, size = 1.
87
- # Resets the front and back attributes nil. Reassigns base nil. Decrements
88
- # size.
89
- # @param [Integer, NilClass] index
90
- # The removal location.
91
- def remove_at(index = nil)
92
- end
93
-
94
- # insert_at(index = nil, node = nil).
95
- # @abstract
96
- # Inserts the node at index.
97
- # Irregular cases:
98
- # 1) index = 0, size = 1.
99
- # Assigns base's back attribute node. Sets node's front attribute base.
100
- # Sets the base attribute node. Increments size.
101
- # 2) index = 0, size = 0.
102
- # Assigns base node. Increments size.
103
- # @param [Integer, NilClass] index
104
- # The list insert location.
105
- # @param [Node, NilClass] node
106
- # The insertion Node.
107
- def insert_at(index = nil, node = nil)
108
- end
109
-
110
- # at(index = nil).
111
- # @abstract
112
- # Gets the Node at index.
113
- # @param [Integer, NilClass] index
114
- # The list location.
115
- # @return [Node] copy
116
- # The Node at index's copy. self and copy are different objects, and their
117
- # attributes' objects are different objects.
118
- def at(index = nil)
119
- end
120
-
121
- # [](index = nil).
122
- # @abstract
123
- # Subscript operator. Gets the data value or object at the index.
124
- # @param [Integer, NilClass] index
125
- # The data's location.
126
- # @return [DataType] data
127
- # The data in the Node at index.
128
- def [](index = nil)
129
- end
130
-
131
- # []=(index = nil, data = nil).
132
- # @abstract
133
- # Subscript assignment operator. Sets the data attribute in Node at index.
134
- # @param [Integer, NilClass] index
135
- # The data's location.
136
- # @param [DataType] data
137
- # A data object.
138
- # @return [NilClass] nil
139
- def []=(index = nil, data = nil)
66
+ # True in the case the size is zero. False otherwise.
67
+ def empty()
140
68
  end
141
69
 
142
- private
70
+ # ==(object = nil).
71
+ # @description
72
+ # Equality operator.
73
+ # @param object [.]
74
+ # Any object. A comparison.
75
+ # @return [TrueClass, FalseClass]
76
+ # True in the case the lhs and rhs' attribute references are identical.
77
+ # False otherwise.
78
+ def ==(object = nil)
79
+ end
143
80
 
144
- # initialize_copy().
145
- # @abstract
146
- # Copies self.
147
- # @return [LinkedList] copy
148
- # self's copy. self and copy are different objects. self's and copy's
149
- # attributes are different objects.
150
- def initialize_copy()
81
+ # remove(n = nil).
82
+ # @description
83
+ # Removes the list's NodeAdapter 'n'.
84
+ # @param n [NodeAdapter]
85
+ # A list Node. The removal.
86
+ # @return [NilClass]
87
+ # nil.
88
+ # @raise [ArgumentError]
89
+ # In the case the argument was not found in the list.
90
+ def remove(n = nil)
151
91
  end
152
92
 
93
+ # insert(n1 = nil, n2 = nil).
94
+ # @description
95
+ # Inserts a Node after a specific Node.
96
+ # @param n1 [Node, NodeAdapter]
97
+ # A consequent. The insertion.
98
+ # @param n2 [NodeAdapter]
99
+ # A precession. An existing list Node.
100
+ # @return [NilClass]
101
+ # nil.
102
+ def insert(n1 = nil, n2 = nil)
103
+ end
104
+
105
+ protected
106
+
153
107
  # base().
154
- # @abstract
155
- # Getter. Gets the base Node's reference.
156
- # @return [Node] @base
108
+ # @description
109
+ # Gets base's reference.
110
+ # @return [NodeAdapter]
111
+ # 'base'.
157
112
  def base()
158
113
  end
159
114
 
160
- # base=(node = nil).
161
- # @abstract
162
- # Setter. Sets the base node.
163
- # @param [Node, NilClass] node
164
- # The Node becoming the base.
165
- def base=(node = nil)
115
+ # size=(i = nil).
116
+ # @description
117
+ # Sets 'size'.
118
+ # @param i [Integer]
119
+ # An integer list size.
120
+ # @return [Integer]
121
+ # The argument.
122
+ def size=(i = nil)
166
123
  end
167
124
 
168
- end
125
+ private
169
126
 
127
+ # initialize_node(dti = nil).
128
+ # @description
129
+ # Initializes a NodeAdapter instance.
130
+ # @param dti [DataType]
131
+ # The NodeAdapter's data setting.
132
+ # @return [NodeAdapter]
133
+ # The NodeAdapter instance.
134
+ def initialize_node(dti = nil)
135
+ end
136
+
137
+ # base=(n = nil).
138
+ # @description
139
+ # Sets 'base'.
140
+ # @param n [NodeAdapter]
141
+ # The instance becoming 'base'.
142
+ def base=(n = nil)
143
+ end
144
+
145
+ # increment_s().
146
+ # @description
147
+ # Increment operator. Increments size.
148
+ # @return [Integer]
149
+ # The list's size plus one.
150
+ def increment_s()
151
+ end
152
+
153
+ # decrement_s().
154
+ # @description
155
+ # Decrement operator. Decrements size.
156
+ # @return [Integer]
157
+ # The list's size less one.
158
+ def decrement_s()
159
+ end
160
+
161
+ # attach(n1 = nil, n2 = nil).
162
+ # @description
163
+ # Attaches two NodeAdapters.
164
+ # @param n1 [NodeAdapter]
165
+ # A precession.
166
+ # @param n2 [NodeAdapter]
167
+ # A consequent.
168
+ # @return [NilClass]
169
+ # nil.
170
+ def attach(n1 = nil, n2 = nil)
171
+ end
172
+
173
+ # detach(n1 = nil, n2 = nil).
174
+ # @description
175
+ # Detaches two linked NodeAdapters.
176
+ # @param n1 [NodeAdapter]
177
+ # A precession.
178
+ # @param n2 [NodeAdapter]
179
+ # A consequent.
180
+ # @return [NilClass]
181
+ # nil.
182
+ def detach(n1 = nil, n2 = nil)
183
+ end
184
+
185
+ end
@@ -1,9 +1,14 @@
1
1
  # Copyright (C) 2020 Diligent Software LLC. All rights reserved. Released
2
- # under the MIT License.
2
+ # under the GNU General Public License, Version 3. Refer LICENSE.txt.
3
3
 
4
4
  # LinkedListInt.
5
5
  # @abstract
6
- # A Linked-List data structure interface.
6
+ # @class_description
7
+ # A LinkedList data structure interface.
8
+ # @attr base [NodeAdapter]
9
+ # The list's base.
10
+ # @attr size [Integer]
11
+ # The list's element quantity.
7
12
  class LinkedListInt
8
- VERSION = ::VERSION
13
+ VERSION = '3.0.0'.freeze()
9
14
  end
@@ -1,42 +1,45 @@
1
- VERSION = "0.1.0"
1
+ require_relative 'lib/linked_list_int/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
 
5
+ # Required attributes.
5
6
  spec.name = "linked_list_int"
6
- spec.version = VERSION
7
- spec.authors = ["Bradley J. Tannor", "Diligent Software LLC"]
8
- spec.email = ["bradleytannor@gmail.com"]
9
- spec.summary = %q{A Linked-List data structure interface.}
10
- spec.description = %q{A Lnked-List data structure interface. Donations
11
- support continuous improvement and maintenance. The aim is a reliable,
12
- integrable, and endurable Linked-List library. Make a donation at the project's
13
- collective page: https://opencollective.com/linked-list. One-time and recurring
7
+ spec.version = LinkedListInt::VERSION
8
+ spec.authors = ["Diligent Software LLC"]
9
+ spec.email = ["contact@diligentsoftware.org"]
10
+ spec.summary = %q{A LinkedList data structure interface.}
11
+ spec.description = %q{A LnkedList data structure interface.
12
+ Donations support continuous improvement and maintenance. The aim is a reliable,
13
+ integrable, and endurable LinkedList library. Make a donation at the project's
14
+ collective page: https://opencollective.com/linkedlist. One-time and recurring
14
15
  donations are available at $1, $2, $4, $8, and $16. Greatly appreciated.}
15
- spec.homepage = "https://docs.diligentsoftware.org/linked-list"
16
- spec.license = "MIT"
16
+ spec.homepage =
17
+ "https://docs.diligentsoftware.org/linkedlist-1/interface"
18
+ spec.license = "GPL-3.0"
17
19
  spec.required_ruby_version = Gem::Requirement.new(">= 2.6.5")
18
20
 
21
+ # Metadata.
19
22
  spec.metadata['homepage_uri'] = spec.homepage
20
23
  spec.metadata['source_code_uri'] =
21
24
  "https://github.com/Diligent-Software-LLC/linked_list_int"
22
25
  spec.metadata['changelog_uri'] =
23
- "https://docs.diligentsoftware.org/linked-list#changelog"
26
+ "https://docs.diligentsoftware.org/linkedlist-1/" +
27
+ "packages#interface_changelog"
24
28
 
25
29
  # Specify which files should be added to the gem when it is released.
26
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
30
+ # The `git ls-files -z` loads the files in the RubyGem that have been added
31
+ # into git.
27
32
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
+ `git ls-files -z`.split("\x0").reject { |f|
34
+ f.match(%r{^(test|spec|features)/})
35
+ }
29
36
  end
30
37
  spec.bindir = "exe"
31
38
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
39
  spec.require_paths = ["lib"]
33
40
 
34
- # Development and testing dependencies
35
- spec.add_development_dependency 'bundler', '~> 2.1.2'
36
- spec.add_development_dependency 'simplecov', '~> 0.17.1'
37
-
38
- # Gem specific runtime dependencies
39
- # spec.add_runtime_dependency
41
+ # Development and testing dependencies.
42
+ spec.add_development_dependency 'bundler', '~> 2.1'
43
+ spec.add_development_dependency 'simplecov', '~> 0'
40
44
 
41
45
  end
42
-