Class Field

    • Constructor Detail

      • Field

        public Field()
        Constructor. Sets the name to null and the type to UNKNOWN.
      • Field

        public Field​(AbstractField field)
        Uses the values from the given field.
        Parameters:
        field - the field to use as basis
      • Field

        public Field​(String prefix,
                     String suffix,
                     DataType dt)
        Constructor.
        Parameters:
        prefix - the prefix of the compound field
        suffix - the prefix of the compound field
        dt - the type of the field, UNKNOWN is used if null
      • Field

        public Field​(String name,
                     DataType dt)
        Constructor.
        Parameters:
        name - the name of the field
        dt - the type of the field, UNKNOWN is used if null
    • Method Detail

      • newField

        public AbstractField newField​(String name,
                                      DataType dtype)
        Returns a new field.
        Specified by:
        newField in class AbstractField
        Parameters:
        name - the name of the field
        dtype - the data type of the field
        Returns:
        the new field
      • replacePrefix

        public AbstractField replacePrefix​(String prefix,
                                           DataType dt)
        Replaces the prefix of a Field and returns a new Field object. The Field must be a compound object, if not a clone of the field is returned.
        Specified by:
        replacePrefix in class AbstractField
        Parameters:
        prefix - the new prefix
        dt - the data type
        Returns:
        the generated field
      • replaceSuffix

        public AbstractField replaceSuffix​(String suffix,
                                           DataType dt)
        Replaces the suffix of a Field and returns a new Field object. The Field must be a compound object, if not a clone of the field is returned.
        Specified by:
        replaceSuffix in class AbstractField
        Parameters:
        suffix - the new suffix
        dt - the data type
        Returns:
        the generated field
      • isValid

        public static boolean isValid​(String s)
        Checks whether the field is valid.
        Parameters:
        s - the string to check
        Returns:
        true if valid format
        See Also:
        AbstractField.toParseableString()
      • parseField

        public static AbstractField parseField​(String s)
        Parses the given string and returns the field. The type of the field can be append with parentheses: name[type]. Otherwise, UNKNOWN is used as type.
        Parameters:
        s - the string to parse
        Returns:
        the parsed field
      • main

        public static void main​(String[] args)
        For testing only.
        Parameters:
        args - ignored