Class: Contender::Queue Abstract

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/contender/queue.rb

Overview

This class is abstract.

Direct Known Subclasses

LinkedQueue

Instance Method Summary collapse

Instance Method Details

#capacity_remainingInteger

This method is abstract.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


70
71
72
# File 'lib/contender/queue.rb', line 70

def capacity_remaining
  raise NotImplementedError
end

#clearundefined

This method is abstract.

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


42
43
44
# File 'lib/contender/queue.rb', line 42

def clear
  raise NotImplementedError
end

#delete(element) ⇒ Boolean

This method is abstract.

Parameters:

  • element (Object)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/contender/queue.rb', line 56

def delete(element)
  raise NotImplementedError
end

#drain_to(target, max_elements = FIXNUM_MAX) ⇒ Integer

This method is abstract.

Parameters:

  • target (Array)
  • max_elements (Integer) (defaults to: FIXNUM_MAX)

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/contender/queue.rb', line 64

def drain_to(target, max_elements = FIXNUM_MAX)
  raise NotImplementedError
end

#each {|Object| ... } ⇒ undefined

This method is abstract.

Yields:

  • (Object)

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


49
50
51
# File 'lib/contender/queue.rb', line 49

def each
  raise NotImplementedError
end

#empty?Boolean

Returns:

  • (Boolean)


83
84
85
# File 'lib/contender/queue.rb', line 83

def empty?
  size == 0
end

#offer(element, timeout = nil) ⇒ Boolean

This method is abstract.

Parameters:

  • element (Object)
  • timeout (Float) (defaults to: nil)

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/contender/queue.rb', line 10

def offer(element, timeout = nil)
  raise NotImplementedError
end

#peekObject

This method is abstract.

Returns:

  • (Object)

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/contender/queue.rb', line 36

def peek
  raise NotImplementedError
end

#poll(timeout = nil) ⇒ Object

This method is abstract.

Parameters:

  • timeout (Float) (defaults to: nil)

Returns:

  • (Object)

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/contender/queue.rb', line 24

def poll(timeout = nil)
  raise NotImplementedError
end

#put(element) ⇒ undefined

This method is abstract.

Parameters:

  • element (Object)

Returns:

  • (undefined)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/contender/queue.rb', line 17

def put(element)
  raise NotImplementedError
end

#sizeInteger Also known as: length

This method is abstract.

Returns:

  • (Integer)

Raises:

  • (NotImplementedError)


76
77
78
# File 'lib/contender/queue.rb', line 76

def size
  raise NotImplementedError
end

#takeObject

This method is abstract.

Returns:

  • (Object)

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/contender/queue.rb', line 30

def take
  raise NotImplementedError
end