Class: ListNode
- Inherits:
-
Object
- Object
- ListNode
- Includes:
- Comparable
- Defined in:
- lib/simpleselect/listNode.rb
Overview
tipo nodo que actua como eslabón en la clase List
Instance Attribute Summary collapse
-
#next ⇒ ListNode
“puntero” al siguiente nodo de la lista.
-
#prev ⇒ ListNode
“puntero” al nodo anterior en la lista.
-
#value ⇒ object
contenido util que encapsulará.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(value) ⇒ ListNode
constructor
A new instance of ListNode.
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ ListNode
Returns a new instance of ListNode.
12 13 14 15 16 |
# File 'lib/simpleselect/listNode.rb', line 12 def initialize(value) @value=value @next = nil @prev = nil end |
Instance Attribute Details
#next ⇒ ListNode
“puntero” al siguiente nodo de la lista
6 7 8 |
# File 'lib/simpleselect/listNode.rb', line 6 def next @next end |
#prev ⇒ ListNode
“puntero” al nodo anterior en la lista
6 7 8 |
# File 'lib/simpleselect/listNode.rb', line 6 def prev @prev end |
#value ⇒ object
contenido util que encapsulará
6 7 8 |
# File 'lib/simpleselect/listNode.rb', line 6 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
8 9 10 |
# File 'lib/simpleselect/listNode.rb', line 8 def <=> (other) @value <=> other.value end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/simpleselect/listNode.rb', line 17 def to_s @value.to_s end |