Package pt.tecnico.uilib.forms
Class Field<Type>
java.lang.Object
pt.tecnico.uilib.forms.Field<Type>
- Type Parameters:
Type- is the type of the data to be read in the field.
- Direct Known Subclasses:
FieldNone
This class represents an input field in a form.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Mark the Input as unreadbooleancleared()protected voiddirty()Mark the Input as readbooleanIs the input field read-only.abstract booleanEach Input must parse its own specific type of value, written in accordance with the specific regular expression.prompt()voidtoString()value()
-
Field Details
-
_value
value to be read
-
-
Constructor Details
-
Field
protected Field()Build an Input without a title -
Field
- Parameters:
prompt- the prompt for the requested valueregex- the regular expression to be matched
-
-
Method Details
-
prompt
- Returns:
- the description of the request
-
set
- Parameters:
value- the new value
-
value
- Returns:
- the value
-
clear
public void clear()Mark the Input as unread -
dirty
protected void dirty()Mark the Input as read -
cleared
public boolean cleared()- Returns:
- true if the Input is cleared
-
isReadOnly
public boolean isReadOnly()Is the input field read-only. -
parse
Each Input must parse its own specific type of value, written in accordance with the specific regular expression.- Parameters:
in- the string to be parsed- Returns:
- the status of parsing success
-
toString
-