Class InstanceOfRowFilter<M extends javax.swing.table.TableModel,​I extends java.lang.Integer>


  • public class InstanceOfRowFilter<M extends javax.swing.table.TableModel,​I extends java.lang.Integer>
    extends javax.swing.RowFilter<M,​I>
    A RowFilter that filters based on the Class type of the model data with behavior similar to the instanceof operator. Since TableModel does not necessarily return the correct class type for a table entry, this class requires a list of the model data being displayed in the table to be supplied in the constructor.

    Modified by: Joseph A. Huwaldt

    Version:
    January 31, 2014
    Author:
    Joseph A. Huwaldt Date: January 31, 2014
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.RowFilter

        javax.swing.RowFilter.ComparisonType, javax.swing.RowFilter.Entry<M extends java.lang.Object,​I extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      InstanceOfRowFilter​(java.util.List modelData, java.util.List<java.lang.Class> filterClasses)
      Construct a RowFilter using the specified list of model data objects and the specified list of Class objects to filter on.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean include​(javax.swing.RowFilter.Entry<? extends M,​? extends I> entry)
      Returns true if the specified entry should be shown; returns false if the entry should be hidden.
      • Methods inherited from class javax.swing.RowFilter

        andFilter, dateFilter, notFilter, numberFilter, orFilter, regexFilter
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InstanceOfRowFilter

        public InstanceOfRowFilter​(java.util.List modelData,
                                   java.util.List<java.lang.Class> filterClasses)
        Construct a RowFilter using the specified list of model data objects and the specified list of Class objects to filter on.
        Parameters:
        modelData - The model data to use for filtering.
        filterClasses - The Class types to use for filtering.
    • Method Detail

      • include

        public boolean include​(javax.swing.RowFilter.Entry<? extends M,​? extends I> entry)
        Returns true if the specified entry should be shown; returns false if the entry should be hidden.
        Specified by:
        include in class javax.swing.RowFilter<M extends javax.swing.table.TableModel,​I extends java.lang.Integer>
        Parameters:
        entry - a non-null object that wraps the underlying object from the model
        Returns:
        true if the entry should be shown