/src/org/ooc/middle/UseDef.java

http://github.com/nddrylliog/ooc · Java · 113 lines · 88 code · 25 blank · 0 comment · 0 complexity · 34b1eb491e65b4589f41879b462c9fdf MD5 · raw file

  1. package org.ooc.middle;
  2. import java.util.ArrayList;
  3. import java.util.List;
  4. public class UseDef {
  5. public static class Requirement {
  6. String name;
  7. int[] version;
  8. UseDef useDef = null;
  9. public Requirement(String name, int[] version) {
  10. this.name = name;
  11. this.version = version;
  12. }
  13. @Override
  14. public String toString() {
  15. return name+" "+version[0];
  16. }
  17. public String getName() {
  18. return name;
  19. }
  20. public int[] getVersion() {
  21. return version;
  22. }
  23. public UseDef getUseDef() {
  24. return useDef;
  25. }
  26. public void setDef(UseDef def) {
  27. this.useDef = def;
  28. }
  29. }
  30. protected String identifier;
  31. protected String name = "";
  32. protected String description = "";
  33. final protected List<Requirement> requirements;
  34. final protected List<String> pkgs;
  35. final protected List<String> libs;
  36. final protected List<String> includes;
  37. final protected List<String> libPaths;
  38. final protected List<String> includePaths;
  39. public UseDef(String identifier) {
  40. this.identifier = identifier;
  41. this.requirements = new ArrayList<Requirement>();
  42. this.pkgs = new ArrayList<String>();
  43. this.libs = new ArrayList<String>();
  44. this.includes = new ArrayList<String>();
  45. this.libPaths = new ArrayList<String>();
  46. this.includePaths = new ArrayList<String>();
  47. }
  48. public String getIdentifier() {
  49. return identifier;
  50. }
  51. public void setIdentifier(String identifier) {
  52. this.identifier = identifier;
  53. }
  54. public String getName() {
  55. return name;
  56. }
  57. public void setName(String name) {
  58. this.name = name;
  59. }
  60. public String getDescription() {
  61. return description;
  62. }
  63. public void setDescription(String description) {
  64. this.description = description;
  65. }
  66. public List<Requirement> getRequirements() {
  67. return requirements;
  68. }
  69. public List<String> getPkgs() {
  70. return pkgs;
  71. }
  72. public List<String> getLibs() {
  73. return libs;
  74. }
  75. public List<String> getIncludes() {
  76. return includes;
  77. }
  78. public List<String> getLibPaths() {
  79. return libPaths;
  80. }
  81. public List<String> getIncludePaths() {
  82. return includePaths;
  83. }
  84. @Override
  85. public String toString() {
  86. return "Name: "+name+", Description: "+description+", Pkgs: "+pkgs+", Libs: "+libs;
  87. }
  88. }