PageRenderTime 42ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/webportal/src/main/java/org/ala/spatial/util/Layer.java

http://alageospatialportal.googlecode.com/
Java | 86 lines | 36 code | 17 blank | 33 comment | 0 complexity | dc10e985e4b5423ea95a48e442444833 MD5 | raw file
  1. package org.ala.spatial.util;
  2. /**
  3. * Data structure to house database Layer attributes.
  4. *
  5. * Suitable as a reference to a database table as well as
  6. * an environmental data file (e.g. WorldClim grid files)
  7. *
  8. * @author Adam Collins
  9. */
  10. public class Layer extends java.lang.Object {
  11. /**
  12. * table for file name
  13. */
  14. public String name;
  15. /**
  16. * short text for UI
  17. */
  18. public String display_name;
  19. public String getName() {
  20. return name;
  21. }
  22. public String getDisplay_name() {
  23. return display_name;
  24. }
  25. public String getDescription() {
  26. return description;
  27. }
  28. public String getType() {
  29. return type;
  30. }
  31. public Field[] getFields() {
  32. return fields;
  33. }
  34. /**
  35. * detailed description for UI
  36. */
  37. public String description;
  38. /**
  39. * catagory of 'contextual' or 'environmental'
  40. */
  41. public String type;
  42. /**
  43. * associated table fields
  44. */
  45. public Field [] fields;
  46. /**
  47. * Constructor for this data structure
  48. * @param _name table or file name as String
  49. * @param _display_name text as String for UI, keep it short
  50. * @param _description more detailed text for UI as String
  51. * @param _type one of 'contextual' or 'environmental' as String
  52. * not enforced here.
  53. * @param _fields array of accessible table fields as Field []
  54. * @see Field
  55. */
  56. public Layer(String _name, String _display_name, String _description,
  57. String _type, Field[] _fields){
  58. name = _name;
  59. display_name = _display_name;
  60. description = _description;
  61. type = _type;
  62. fields = _fields;
  63. }
  64. @Override
  65. public boolean equals(Object obj) {
  66. Layer that = (Layer) obj;
  67. return (this.display_name.equals(that.display_name));
  68. }
  69. }