Class FieldSet

    • Constructor Detail

      • FieldSet

        public FieldSet()
        Creates a new empty set of fields.
      • FieldSet

        public FieldSet​(Integer fieldID)
        Creates a set with one field.
        Parameters:
        fieldID - The id of the field.
      • FieldSet

        public FieldSet​(int... fieldIDs)
        Creates a set with the given fields.
        Parameters:
        fieldIDs - The IDs of the fields.
      • FieldSet

        public FieldSet​(int[] fieldIDs,
                        boolean marker)
        Creates a set with the given fields.
        Parameters:
        fieldIDs - The IDs of the fields.
    • Method Detail

      • addFields

        public FieldSet addFields​(int... fieldIDs)
      • contains

        public boolean contains​(Integer columnIndex)
      • size

        public int size()
      • toFieldList

        public FieldList toFieldList()
        Turns the FieldSet into an ordered FieldList.
        Returns:
        An ordered FieldList.
      • toArray

        public int[] toArray()
        Transforms the field set into an array of field IDs. Whether the IDs are ordered or unordered depends on the specific subclass of the field set.
        Returns:
        An array of all contained field IDs.
      • isValidSubset

        public boolean isValidSubset​(FieldSet set)
        Checks if the given set of fields is a valid subset of this set of fields. For unordered sets, this is the case if all of the given set's fields are also part of this field.

        Subclasses that describe field sets where the field order matters must override this method to implement a field ordering sensitive check.

        Parameters:
        set - The set that is a candidate subset.
        Returns:
        True, if the given set is a subset of this set, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • clone

        public FieldSet clone()
        Since instances of FieldSet are strictly immutable, this method does not actually clone, but it only returns the original instance.
        Overrides:
        clone in class Object
        Returns:
        This objects reference, unmodified.
      • getDescriptionPrefix

        protected String getDescriptionPrefix()
      • getDescriptionSuffix

        protected String getDescriptionSuffix()