### Home Classes Methods

### In Files

- lib/data-structures.rb

### Parent

Object

### Methods

- ::new
- #clone
- #hash

### Files

- LessThan5BlueLabels.txt
- AtLeast2LargeSegments.txt

### Class Index

Quicksearch

- AddLabelTool
- AllRulesAppliedGoal
- Area
- AreaConstraint
- Array
- BalancedBinaryTree
- BalancedBinaryTreeNode
- CloseObserver
- Constants
- Constraint
- CurrentLabelledShape
- DistinctShapeConstraint
- Execution
- Goal
- Grammar
- Label
- LabelledShape
- LineDescriptor
- LinearLinkedList
- LinearLinkedListNode
- NoLabelsGoal
- NoMoreRulesGoal
- NoScalesConstraint
- Numeric
- Object
- OrderedPoint
- PiList
- Point
- Project
- Robot
- Rule
- RuleGroupsObserver
- RuleLabelledShape
- RuleShapeObserver
- Segment
- ShaDeLayersObserver
- Shade
- ShadeUtils
- UndoObserver

No matching classes.

# LinearLinkedListNode

Author | Manuela Ruiz (mruiz@lcc.uma.es)

This class represents a node of a linear linked list

### Attributes

key[RW]

LineDescriptor, Label, Point or Segment

list[RW]

First node of the colinear line list or the’ points with same label’ list

_next[RW]

Next ListNode

### Public Class Methods

new(key, list, _next) click to toggle source

key | LineDescriptor or Label
list | first node of the colinear line list or the ‘points with same label’ list
_next | Next ListNode

Initializes the ListNode

        # File lib/data-structures.rb, line 50
    50:         def initialize(key, list, _next)

    51:                 @key, @list, @_next = key, list, _next

    52:         end

### Public Instance Methods

clone() click to toggle source

returns::a new LinearLinkedListNode, identical to this one, except for the field _next which is nil in the cloned one

        # File lib/data-structures.rb, line 56
    56:         def clone()

    57:                 new_list = nil

    58:                 if ((@list.kind_of? Fixnum) or !@list)

    59:                         new_list = @list

    60:                 else

    61:                         new_list = @list.clone

    62:                 end

    63:                 new_key = nil

    64:                 if @key.kind_of? Fixnum

    65:                         new_key = @key

    66:                 else

    67:                         new_key = @key.clone

    68:                 end

    69:                 return LinearLinkedListNode.new(new_key, new_list, nil)

    70:         end

hash() click to toggle source

returns | the hash code for this node

        # File lib/data-structures.rb, line 73
    73:         def hash

    74:                 return [@key.hash, @list.hash].hash

    75:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.