Implementation of Weighable

 

The table below indicates where methods are implemented and the time complexity of these methods.  Some methods are implemented in more than one place.  When this happens, each entry overrides the entries to its left. When an entry says "based on iterator" or "traverse iterator" or "uses size," then the time complexity depends on the iterator or size method.

 

 

Weighable Implementation

Weight

 

constructor ()

O(1)

 

constructor (double weight)

O(1)

 

 

 

int

compareTo (Object obj)

O(1)

boolean

equals (Object obj)

O(1)

double

getWeight()

O(1)

void

setWeight (double weight)

O(1)

String

toString ()

O(1)

 

martin@cc.wwu.edu
Disclaimer

Copyright Martin Osborne 1998-2001
  All rights reserved