Class: PrefixTreeNode

Inherits:
Object
  • Object
show all
Defined in:
lib/prefix_tree_node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ PrefixTreeNode

Returns a new instance of PrefixTreeNode.



7
8
9
10
11
12
# File 'lib/prefix_tree_node.rb', line 7

def initialize(value)
  @value = value
  @word  = false
  @next  = []
  @children = Array.new(26)
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children.



5
6
7
# File 'lib/prefix_tree_node.rb', line 5

def children
  @children
end

#is_endObject

Returns the value of attribute is_end.



5
6
7
# File 'lib/prefix_tree_node.rb', line 5

def is_end
  @is_end
end

#nextObject (readonly)

Returns the value of attribute next.



4
5
6
# File 'lib/prefix_tree_node.rb', line 4

def next
  @next
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/prefix_tree_node.rb', line 4

def value
  @value
end

#wordObject

Returns the value of attribute word.



5
6
7
# File 'lib/prefix_tree_node.rb', line 5

def word
  @word
end