Skip to content

Type Hierarchy

Chris MacMackin edited this page Mar 13, 2016 · 14 revisions

##Hierarchy

The following type-hierarchy is propose, where italics indicate and abstract type.

Once this initial set of data structures has been implemented, thought might be put into implementing graph and tree types. Outside of this hierarchy, there will also be an iterator type. The container type, as well as descendant of it capable of holding all of the intrinsic types and these derived types, will be needed as well. Finally, various helper types, such as nodes, will be needed.

##Methods The methods for each derived type (excluding those which are inherited or simply implementation of inherited deferred methods) is provided below. If a type is not listed, it indicates that all of its methods are inherited or implementations of deferred methods. Method signatures are written in UML-style syntax.

###countable

  • size(): integer

###data_set

  • union(in other: data_set): data_set
  • intersection(in other: data_set): data_set
  • difference(in other: data_set): data_set
  • symmetric_difference(in other: data_set): data_set
  • is_disjoint(in other: data_set): logical
  • is_subset(in other: data_set): logical
  • is_proper_subset(in other: data_set): logical
  • is_superset(in other: data_set): logical
  • is_proper_superset(in other: data_set): logical
  • has(in value: class(*)): logical
  • is_empty(): logical
  • is_equal(in rhs: data_set): logical
  • peek(): container
  • filter(in test: procedure): data_set
  • enumerate(): array_list
  • min(in comparison: procedure): container
  • max(in comparison: procedure): container
  • nearest(in value: class(*), in subtraction: procedure): container_type
  • sum(in addition: procedure): container

###deque

  • pushleft(in value: class(*))
  • pushright(in value: class(*))
  • popleft(): container
  • popright(): container
  • peekleft(): container
  • peekright(): container

###dictionary

  • keys(): array_list
  • values(): array_list
  • set(in key: class(), in value: class())
  • key_type(): class(container)
  • value_type(): class(container)

###dynamic_set

  • add(in key: class(*))
  • add(in keys: class(), dimension())
  • add_iter(in keys: iterator)
  • remove(in key: class(*))
  • remove(in keys: class(), dimension())
  • remove_iter(in keys: iterator)
  • pop(): container
  • clear()

###iterable

  • iter(): iterator
  • contents_type(): class(container)

###iterator

  • has_next(): logical
  • next(): container
  • reset()
  • container_prototype(): class(container)

###list

  • append(in value: class(*))
  • get(in element: integer): container
  • set(in element: integer, in value: class(*))
  • set(in element: integer, dimension(), in value: class(), dimension(*))
  • get_index(in value: class(*)): integer
  • get_last_index(in value: class(*)): integer
  • slice(in start_element: integer, in end_element: integer): list
  • foreach(in action: procedure)
  • insert(in position: integer, in value: class(*))
  • remove(in value: class(*))
  • remove_all(in value: class(*))
  • delete(in element: integer)
  • delete(in elements: integer, dimension(*))
  • delete(in start_element: integer, in end_element: integer)
  • has(in value: class(*)): logical
  • sort(in comparison: procedure)
  • min(in comparison: procedure): container
  • max(in comparison: procedure): container
  • nearest(in value: class(*), in subtraction: procedure): container_type
  • sum(in addition: procedure): container
  • filter(in test: procedure): list

###map

  • get(in key: class(*)): container
  • update(in other: map)

###multimap

  • get(in key: class(*)): array_list
  • get_count(in key: class(*)): integer
  • remove_value(in key: class(), in value: class())
  • update(in other: map)
  • update(in other: multimap)

###multiset

  • get(in key: class(*)): integer

###ordered

  • push(in value:class(*))
  • pop(): container
  • peek(): container
  • extend(in values: class(), dimension())
  • extend(in values: iterator)
  • concat(in val2: ordered): ordered
  • clear()
  • is_fifo(): logical
Clone this wiki locally