View Javadoc
1 /* 2 * Created on 04.03.2004 3 * 4 * To change the template for this generated file go to 5 * Window>Preferences>Java>Code Generation>Code and Comments 6 */ 7 package org.xpcards.model; 8 9 import java.util.Enumeration; 10 11 /*** 12 * @author galu02 13 * 14 * To change the template for this generated type comment go to 15 * Window>Preferences>Java>Code Generation>Code and Comments 16 */ 17 public class Story extends ModelElement { 18 19 private int priority = 0; 20 private int risk = 0; 21 private int storyPoints = 1; 22 23 private ModelElementCollection tasks = null; 24 private String completionCriteria = null; 25 26 27 28 public String getTasksCategory() { 29 return "Tasks"; 30 } 31 32 33 /*** 34 * @return 35 */ 36 public Enumeration tasks() { 37 if (tasks == null) { 38 return null; 39 } 40 return tasks.elements(); 41 } 42 43 /*** 44 * @param element 45 */ 46 public void putTask(Task element) { 47 if ( element == null ) return; 48 if (tasks == null) { 49 tasks = new ModelElementCollection(this); 50 tasks.setCategory(getTasksCategory()); 51 } 52 if ( !tasks.containsValue(element) ) { 53 element.setParent(this); 54 tasks.putElement(element); 55 fireCollectionElementAdded(element, getTasksCategory(),false); 56 } 57 } 58 59 /*** 60 * @param element 61 */ 62 public void removeTask(Task element) { 63 if ( element == null ) return; 64 if (tasks == null) { 65 return; 66 } 67 if ( tasks.containsValue(element)) { 68 tasks.removeElement(element); 69 fireCollectionElementRemoved(element, getTasksCategory()); 70 } 71 72 } 73 74 75 76 77 78 /*** 79 * @return 80 */ 81 public String getCompletionCriteria() { 82 return completionCriteria; 83 } 84 85 /*** 86 * @param string 87 */ 88 public void setCompletionCriteria(String string) { 89 completionCriteria = string; 90 } 91 92 public String createTasksUniqueIndex(String prefix) { 93 if ( tasks == null ) { 94 tasks = new ModelElementCollection(this); 95 tasks.setCategory(getTasksCategory()); 96 } 97 return tasks.createUniqueIndex(prefix); 98 } 99 100 public ModelElementCollection[] getChildrenCollections() { 101 if ( tasks != null ) { 102 return new ModelElementCollection[] {tasks}; 103 } 104 105 return null; 106 } 107 108 109 /*** 110 * @return 111 */ 112 public int getPriority() { 113 return priority; 114 } 115 116 /*** 117 * @return 118 */ 119 public int getRisk() { 120 return risk; 121 } 122 123 /*** 124 * @return 125 */ 126 public int getStoryPoints() { 127 return storyPoints; 128 } 129 130 /*** 131 * @param i 132 */ 133 public void setPriority(int i) { 134 priority = i; 135 } 136 137 /*** 138 * @param i 139 */ 140 public void setRisk(int i) { 141 risk = i; 142 } 143 144 /*** 145 * @param i 146 */ 147 public void setStoryPoints(int i) { 148 storyPoints = i; 149 } 150 151 }

This page was automatically generated by Maven