public Set<BwCategory> getCategories() { return entity.getCategories(); }
@Override @NoProxy public boolean hasCategory(final BwCategory val) { Set cats = getCategories(); if (cats == null) { return false; } return cats.contains(val); }
@Override @NoProxy public boolean removeCategory(final BwCategory val) { Set cats = getCategories(); if (cats == null) { return false; } return cats.remove(val); }
public Set<BwCategory> getMasterCollection() { return getTarget().getCategories(); } };
@Override @NoProxy @NoDump public int getNumCategories() { Set<BwCategory> c = getCategories(); if (c == null) { return 0; } return c.size(); }
@Override @NoProxy public Set<BwCategory> copyCategories() { if (getNumCategories() == 0) { return null; } TreeSet<BwCategory> ts = new TreeSet<BwCategory>(); for (BwCategory cat: getCategories()) { ts.add(cat); } return ts; }
@Override @NoProxy public Set<BwCategory> cloneCategories() { if (getNumCategories() == 0) { return null; } TreeSet<BwCategory> ts = new TreeSet<BwCategory>(); for (BwCategory cat: getCategories()) { ts.add((BwCategory)cat.clone()); } return ts; }
@Override @NoProxy public boolean addCategory(final BwCategory val) { if (val == null) { throw new RuntimeException("Attempting to store null"); } Set<BwCategory> cats = getCategories(); if (cats == null) { cats = new TreeSet<>(); setCategories(cats); } if (!cats.contains(val)) { cats.add(val); return true; } return false; }
public Set<BwCategory> getCategories() { Set<BwCategory> c = super.getCategories(); if (c == null) { c = new OverrideSet<BwCategory>(BwEvent.ProxiedFieldIndex.pfiCategories, ref, this) { public void setOverrideCollection(Set<BwCategory> val) { ref.setCategories(val); setChangeFlag(true); } public Set<BwCategory> getOverrideCollection() { return ref.getCategories(); } public void copyIntoOverrideCollection() { Set<BwCategory> mstr = getMasterCollection(); if (mstr != null) { Set<BwCategory> over = getOverrideCollection(); over.addAll(mstr); } } public Set<BwCategory> getMasterCollection() { return getTarget().getCategories(); } }; super.setCategories(c); } return c; }
public void setCategories(Set<BwCategory> val) { if (val instanceof OverrideSet) { val = ((OverrideSet<BwCategory>)val).getOverrideCollection(); } int res = doSet(ProxiedFieldIndex.pfiCategories, false, getTarget().getCategories(), ref.getCategories(), val); if (res == setRefNull) { ref.setCategories(null); } if (res == setRefVal) { ref.setCategories(val); } }
private static boolean checkCategory(final IcalCallback cb, final ChangeTable chg, final BwEvent ev, final String lang, final String val) throws CalFacadeException { final BwString sval = new BwString(lang, val); final BwCategory cat = cb.findCategory(sval); if (cat == null) { return false; } final Set<BwCategory> cats = ev.getCategories(); if (cats != null) { for (final BwCategory c : cats) { if (c.getWord().equals(sval)) { // Already present return true; } } } ev.addCategory(cat); chg.addValue(PropertyIndex.PropertyInfoIndex.CATEGORIES, cat); return true; }
for (BwCategory cat: val.getCategories()) { CategoriesPropType c = new CategoriesPropType();
for (BwCategory cat: val.getCategories()) { prop = new Categories(); TextList cl = ((Categories)prop).getCategories();
for (BwCategory cat: ev.getCategories()) { if (stringMatch(cat.getWordVal(), val)) { return true;
originalVals = ev.getCategories(); if (checkMulti(ent, originalVals, update)) { ev.setCategories((Set)ent.getAddedValues());
ts.append("categories", getCategories());