@Override
 public boolean include(
     RowFilter.Entry<? extends PersonnelTableModel, ? extends Integer> entry) {
   Person p = entry.getModel().getPerson(entry.getIdentifier().intValue());
   if (!p.isActive()) {
     return false;
   }
   if (!prisoners && (p.isPrisoner() || p.isBondsman())) {
     return false;
   }
   if ((null != primaryRole) && (p.getPrimaryRole() != primaryRole.intValue())) {
     return false;
   }
   if ((null != expLevel) && (p.getExperienceLevel(false) != expLevel.intValue())) {
     return false;
   }
   if ((null != skill)) {
     Skill s = p.getSkill(skill);
     if (null == s) {
       int cost = SkillType.getType(skill).getCost(0);
       return (cost >= 0) && (cost <= p.getXp());
     } else {
       int cost = s.getCostToImprove();
       return (s.getLevel() < maxSkillLevel) && (cost >= 0) && (cost <= p.getXp());
     }
   }
   return true;
 }
 private boolean entryContainsWord(RowFilter.Entry entry, String word) {
   for (int i = 0; i < entry.getValueCount(); i++) {
     Object entryValue = entry.getValue(i);
     if (entryValue != null && Utils.containsIgnoreCase(entry.getValue(i).toString(), word)) {
       return true;
     }
   }
   return false;
 }
Beispiel #3
0
  /**
   * @see
   *     de.freese.mediathek.kodi.swing.components.rowfilter.AbstractRowFilterIndexed#include(javax.swing.RowFilter.Entry,
   *     int)
   */
  @Override
  protected boolean include(
      final javax.swing.RowFilter.Entry<? extends Object, ? extends Object> value,
      final int index) {
    this.matcher.reset(value.getStringValue(index));

    return this.matcher.find();
  }
 @Override
 public boolean include(RowFilter.Entry<? extends TableModel, ? extends Integer> entry) {
   int index = entry.getIdentifier();
   ThrustCurveMotorSet m = model.getMotorSet(index);
   return filterManufacturers(m)
       && filterUsed(m)
       && filterBySize(m)
       && filterByString(m)
       && filterByImpulseClass(m);
 }