public class TimeDataComponent extends DataComponent
A specific DataComponent implementation that handles very specific roles for setting up time loops. These time loops are delegated on the Datastructure. There are two specific time modes. The first one is regular, or when the user wants to specify the start time, the end time, and the number of steps inbetween. The other mode is explicit, which specifies that the user can put a series of values to represent time steps. The time steps must be in order and valid, since this component will not verify if the values inserted for explicit are numerical or parsed correctly. It is assumed the user will put these values in order where there is a space to separate the values between each setting.
There will be five entries allocated at startup (mode, start, finish, nstep, and values). Keep in mind that the TimeDataComponent is only responsible for those values. If other entries are added or removed, this will lead to undefined behavior. As such, the only operations that work are retrieving entries.
iComponentVisitor
iComponentListener
component
Constructor and Description |
---|
TimeDataComponent()
The nullary constructor.
|
TimeDataComponent(java.lang.String type)
A parameterized constructor that takes a type (Explicit or Regular) as a
passed parameter.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IComponentVisitor visitor)
(non-Javadoc)
|
void |
addEntry(Entry newEntry)
Overrides and does nothing.
|
void |
addEntry(Entry newEntry,
java.lang.String... parentNames)
Overrides and does nothing.
|
void |
clearEntries()
Overrides and does nothing.
|
java.lang.Object |
clone()
This operation provides a deep copy of the TimeDataComponent.
|
void |
copy(TimeDataComponent otherDataComponent)
This operation performs a deep copy of the attributes of another
TimeDataComponent into the current TimeDataComponent.
|
void |
deleteEntry(java.lang.String entryName)
Overrides and does nothing.
|
boolean |
equals(java.lang.Object otherDataComponent)
This operation is used to check equality between the DataComponent and
another DataComponent.
|
int |
hashCode()
Returns the hashcode of the object.
|
java.util.ArrayList<Entry> |
retrieveAllEntries()
Overrides DataComponent's implementation of retrieveAllEntries.
|
contains, copy, retrieveEntry, retrieveReadyEntries, update, update
copy, getDescription, getId, getName, register, setDescription, setId, setName, unregister
getClass, notify, notifyAll, toString, wait, wait, wait
register, unregister
getDescription, getId, getName, setDescription, setId, setName
public TimeDataComponent(java.lang.String type)
A parameterized constructor that takes a type (Explicit or Regular) as a passed parameter. If the parameter is not specified as "EXPLICIT" or "REGULAR", then it will default to nullary constructor.
type
- public TimeDataComponent()
The nullary constructor. Defaults object to mode of Regular and creates required entries as necessary.
public void copy(TimeDataComponent otherDataComponent)
This operation performs a deep copy of the attributes of another TimeDataComponent into the current TimeDataComponent.
otherDataComponent
- The other DataComponent from which information should be copied.
public java.lang.Object clone()
This operation provides a deep copy of the TimeDataComponent.
clone
in interface Identifiable
clone
in class DataComponent
The deep-copy clone of this DataComponent.
public void addEntry(Entry newEntry)
Overrides and does nothing.
addEntry
in class DataComponent
newEntry
- The new Entry that will be added to the Form.
public void addEntry(Entry newEntry, java.lang.String... parentNames)
Overrides and does nothing.
addEntry
in class DataComponent
newEntry
- The new Entry that should be added to the form.
parentNames
- The list of Entry names for those Entries on which the new Entry is dependent.
public void clearEntries()
Overrides and does nothing.
clearEntries
in class DataComponent
public void deleteEntry(java.lang.String entryName)
Overrides and does nothing.
deleteEntry
in class DataComponent
entryName
- The name of the Entry to delete.
public java.util.ArrayList<Entry> retrieveAllEntries()
Overrides DataComponent's implementation of retrieveAllEntries. This will return a list of entries in a shallow copied list. This way, entries can not be added or removed indirectly via getter method.
retrieveAllEntries
in class DataComponent
The list of all Entries stored in the Form.
public boolean equals(java.lang.Object otherDataComponent)
This operation is used to check equality between the DataComponent and another DataComponent. It returns true if the DataComponents are equal and false if they are not.
equals
in interface Identifiable
equals
in class DataComponent
otherDataComponent
- The other DataComponent to which this component should be compared.
True if the DataComponents are equal, false otherwise.
Identifiable.equals(Object otherObject)
public int hashCode()
hashCode
in interface Identifiable
hashCode
in class DataComponent
The hashcode.
Identifiable.hashCode()
public void accept(IComponentVisitor visitor)
accept
in interface Component
accept
in class DataComponent
visitor
- The visitor
Component.accept(IComponentVisitor visitor)