| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| MetaSetForm |
|
| 1.0;1 | ||||
| MetaSetForm$RateOp |
|
| 1.0;1 |
| 1 | /****************************************************************************** | |
| 2 | * MetaSetForm.java - A bean to wrap MetaSet in a form friendly package | |
| 3 | * | |
| 4 | * PicMan - The BuckoSoft Picture Manager in Java | |
| 5 | * Copyright(c) 2006 - Dick Balaska | |
| 6 | * | |
| 7 | */ | |
| 8 | package com.buckosoft.PicMan.web; | |
| 9 | ||
| 10 | import java.util.List; | |
| 11 | ||
| 12 | import com.buckosoft.BSAccount.web.BSAccountUserWebSession; | |
| 13 | import com.buckosoft.PicMan.domain.MetaSet; | |
| 14 | import com.buckosoft.PicMan.domain.Set; | |
| 15 | ||
| 16 | /** Wrap a MetaSet in a Spring form friendly package | |
| 17 | * @author Dick Balaska | |
| 18 | * @since 2006/07/04 | |
| 19 | */ | |
| 20 | 0 | public class MetaSetForm { |
| 21 | private MetaSet metaSet; | |
| 22 | private int maxRules; | |
| 23 | private Set set; | |
| 24 | private List<Set> sets; | |
| 25 | private BSAccountUserWebSession userWebSession; | |
| 26 | 0 | private boolean flipFlop = false; |
| 27 | ||
| 28 | 0 | public BSAccountUserWebSession getUserWebSession() { return(userWebSession); } |
| 29 | 0 | public void setUserWebSession(BSAccountUserWebSession us) { userWebSession = us; } |
| 30 | ||
| 31 | 0 | public boolean getFlipFlop() { flipFlop = !flipFlop; return(flipFlop); } |
| 32 | ||
| 33 | public class RateOp { | |
| 34 | private int value; | |
| 35 | private String name; | |
| 36 | 0 | RateOp(int v, String n) { |
| 37 | 0 | value = v; |
| 38 | 0 | name = n; |
| 39 | 0 | } |
| 40 | /** | |
| 41 | * @return the name | |
| 42 | */ | |
| 43 | public String getName() { | |
| 44 | 0 | return name; |
| 45 | } | |
| 46 | /** | |
| 47 | * @return the value | |
| 48 | */ | |
| 49 | public int getValue() { | |
| 50 | 0 | return value; |
| 51 | } | |
| 52 | ||
| 53 | } | |
| 54 | 0 | private RateOp[] rateOps = {new RateOp(0, ""), new RateOp(1, "<"), |
| 55 | new RateOp(2, ">"), new RateOp(3, "=="), new RateOp(4, "!=")}; | |
| 56 | ||
| 57 | 0 | private Integer[] rateSelectors = { |
| 58 | 0 | 9,8,7,6,5,4,3,2,1 |
| 59 | }; | |
| 60 | ||
| 61 | /** | |
| 62 | * @return Returns the rateSelectors. | |
| 63 | */ | |
| 64 | public Integer[] getRateSelectors() { | |
| 65 | 0 | return rateSelectors; |
| 66 | } | |
| 67 | ||
| 68 | /** | |
| 69 | * @return Returns the metaSet. | |
| 70 | */ | |
| 71 | public MetaSet getMetaSet() { | |
| 72 | 0 | return metaSet; |
| 73 | } | |
| 74 | ||
| 75 | /** | |
| 76 | * @param metaSet The metaSet to set. | |
| 77 | */ | |
| 78 | public void setMetaSet(MetaSet metaSet) { | |
| 79 | 0 | this.metaSet = metaSet; |
| 80 | 0 | } |
| 81 | /** | |
| 82 | * @return Returns the set. | |
| 83 | */ | |
| 84 | public Set getSet() { | |
| 85 | 0 | return set; |
| 86 | } | |
| 87 | /** | |
| 88 | * @param set The set to set. | |
| 89 | */ | |
| 90 | public void setSet(Set set) { | |
| 91 | 0 | this.set = set; |
| 92 | 0 | } |
| 93 | /** | |
| 94 | * @return the sets | |
| 95 | */ | |
| 96 | public List<Set> getSets() { | |
| 97 | 0 | return sets; |
| 98 | } | |
| 99 | /** | |
| 100 | * @param sets the sets to set | |
| 101 | */ | |
| 102 | public void setSets(List<Set> sets) { | |
| 103 | 0 | this.sets = sets; |
| 104 | 0 | } |
| 105 | /** | |
| 106 | * @return the rateOps | |
| 107 | */ | |
| 108 | public RateOp[] getRateOps() { | |
| 109 | 0 | return rateOps; |
| 110 | } | |
| 111 | /** Get the maximum number of rules in a MetaSet. | |
| 112 | * @return the maxRules | |
| 113 | */ | |
| 114 | public int getMaxRules() { | |
| 115 | 0 | return maxRules; |
| 116 | } | |
| 117 | /** Set the maximum number of rules in a MetaSet. | |
| 118 | * @param maxRules the maxRules to set | |
| 119 | */ | |
| 120 | public void setMaxRules(int maxRules) { | |
| 121 | 0 | this.maxRules = maxRules; |
| 122 | 0 | } |
| 123 | ||
| 124 | } |