[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Space.java, 1.115, 1.116
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-01-29 15:03:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21646/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: added a getlevelstring method to give the string representation of the space level Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** Space.java 29 Jan 2007 11:57:04 -0000 1.115 --- Space.java 29 Jan 2007 15:03:36 -0000 1.116 *************** *** 1431,1435 **** */ public String toString() { ! return "[space " + getName() + "]"; } --- 1431,1435 ---- */ public String toString() { ! return "[ " + getLevelString() + getName() + "]"; } *************** *** 2542,2545 **** --- 2542,2547 ---- /** + * The level of the space, is one of the static final values that resemples + * space, element or part * @return Returns the level. */ *************** *** 2633,2636 **** --- 2635,2659 ---- } + /** + * Return the level of the space as a string + * @return The string representation of the space level + */ + public String getLevelString() { + if (getLevel() == Space.PROJECT_LEVEL) { + return "Project"; + } else if (getLevel() == Space.SPACE_LEVEL) { + return "Space"; + } else if (getLevel() == Space.ELEMENT_LEVEL) { + return "Element"; + } else if (getLevel() == Space.PART_LEVEL) { + return "Part"; + } else if (getLevel() == Space.NET_LEVEL) { + return "Net"; + } else { + log.error("Not a valid level"); + return ""; + } + } + } |