impl_interface.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # File Name: impl_interface.py
  2. # Modified Date: April 15, 2017
  3. # Description: This class contains abstract behaviours.
  4. # Method Level Comment: Java Convention (I am not certain of Python convention because there is no body for functions.)
  5. __author__ = "Inyoung Choung"
  6. from abc import ABCMeta, abstractclassmethod
  7. # this class is an abstract interface
  8. class ImplInterface(object):
  9. ___metaclass__= ABCMeta
  10. # this is abstract method to validate empty fields.
  11. @abstractclassmethod
  12. def validate_emptyfields(self): pass
  13. # this is abstract method to convert weight types.
  14. @abstractclassmethod
  15. def convert(self, weightT1, weightT2, weight2): pass
  16. # this is abstract method to calculate price.
  17. @abstractclassmethod
  18. def calculate(self): pass
  19. # this is abstract method to display message to user.
  20. @abstractclassmethod
  21. def display_message(self): pass
  22. # this is abstract method to returns result.
  23. @abstractclassmethod
  24. def get_result(self): pass
  25. # this is abstract method to sort a list.
  26. @abstractclassmethod
  27. def sort(self, list): pass
  28. # this is abstract method to write a list to a file.
  29. @abstractclassmethod
  30. def writefile(self, path, stuff_to_print): pass