Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. //List-of XMLFragment
  2. interface LoIXMLFrag {}
  3.  
  4. //List-of Attribute
  5. interface ILoAttribute {}
  6.  
  7. interface IXMLFrag {}
  8.  
  9. //Empty list of Attributes
  10. class MtAttribute implements ILoAttribute {
  11. MtAttribute() {}
  12. }
  13.  
  14. //Non-empty list of Attributes
  15. class ConsAttribute implements ILoAttribute {
  16. Attribute first;
  17. ILoAttribute rest;
  18.  
  19. public ConsAttribute(Attribute first, ILoAttribute rest) {
  20. this.first = first;
  21. this.rest = rest;
  22. }
  23. }
  24.  
  25. class MtIXMLFrag implements LoIXMLFrag{
  26. MtIXMLFrag(){}
  27. }
  28.  
  29. class ConsIXMLFrag implements LoIXMLFrag{
  30. IXMLFrag first;
  31. LoIXMLFrag rest;
  32.  
  33. public ConsIXMLFrag(IXMLFrag first, LoIXMLFrag rest) {
  34. this.first = first;
  35. this.rest = rest;
  36. }
  37. }
  38.  
  39. class Plaintext implements IXMLFrag {
  40. String txt;
  41.  
  42. Plaintext(String txtString) {
  43. this.txt = txtString;
  44. }
  45. }
  46.  
  47. class Attribute implements IXMLFrag {
  48. String name;
  49. String value;
  50.  
  51. public Attribute(String name, String value) {
  52. this.name = name;
  53. this.value = value;
  54. }
  55. }
  56.  
  57. class Tag implements IXMLFrag {
  58. String name;
  59. ILoAttribute atts;
  60.  
  61. public Tag(String name, ILoAttribute atts) {
  62. this.name = name;
  63. this.atts = atts;
  64. }
  65.  
  66. }
  67.  
  68. class Tagged implements IXMLFrag {
  69. Tag tag;
  70. LoIXMLFrag content;
  71.  
  72. public Tagged(Tag tag, LoIXMLFrag content) {
  73. this.tag = tag;
  74. this.content = content;
  75. }
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement