|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.nrao.sss.model.project.scan.ScanLoopElement
public abstract class ScanLoopElement
The abstract parent of both Scan
and ScanLoop
.
Note: This class was originally an interface but became an abstract class due to some JAXB restrictions on marshalling and unmarshalling to/from XML for interface classes. I was successful with this class as an interface while going to XML, but not coming from XML.
Version Info:
$Revision: 1911 $ |
$Date: 2009-01-21 10:27:48 -0700 (Wed, 21 Jan 2009) $ |
$Author: dharland $ |
Field Summary |
---|
Fields inherited from interface edu.nrao.sss.util.Identifiable |
---|
UNIDENTIFIED |
Fields inherited from interface edu.nrao.sss.model.UserAccountable |
---|
NULL_USER_ID |
Method Summary | |
---|---|
void |
appendComments(String additionalComments)
Adds additional comments to those already associated with this element. |
void |
clearId()
Resets this scan loop element's id to UNIDENTIFIED. |
ScanLoopElement |
clone()
Returns a scan loop element that is a copy of this one. |
boolean |
equals(Object o)
Returns true if o is equal to this scan loop element. |
String |
getComments()
Returns comments about this element. |
Long |
getCreatedBy()
Returns the ID of the user who created this object. |
Date |
getCreatedOn()
Returns the date on which this object was created. |
Long |
getId()
|
Long |
getLastUpdatedBy()
Returns the ID of the user who most recently updated this object. |
Date |
getLastUpdatedOn()
Returns the most recent date on which this object was updated. |
String |
getName()
Returns the name of this element. |
ProgramBlock |
getProgramBlock()
Returns the program block to which this scan belongs. |
Project |
getProject()
Returns the project to which this scan belongs. |
SchedulingBlock |
getSchedulingBlock()
Returns the scheduling block to which this scan loop element belongs, if any. |
int |
hashCode()
Returns a hash code value for this scan loop element. |
boolean |
hasSchedulingBlock()
Returns true if this scan loop element is connected, either directly or indirectly, to a non-null scheduling block. |
void |
reset()
Resets this element to its initial state. |
void |
setComments(String replacementComments)
Sets comments about this element. |
void |
setCreatedBy(Long userId)
Sets the ID of the user who created this object. |
void |
setCreatedOn(Date d)
Sets the date on which this object was created. |
void |
setId(Long id)
Do not use. |
void |
setLastUpdatedBy(Long userId)
Sets the ID of the user who most recently updated this object. |
void |
setLastUpdatedOn(Date d)
Sets the date on which this object was most recently updated. |
void |
setName(String newName)
Sets the name of this element. |
void |
setSchedulingBlock(SchedulingBlock newSchedBlock)
Sets the scheduling block to which this scan loop element belongs. |
String |
toString()
Returns a text representation of this scan loop element. |
abstract String |
toSummaryString()
Returns a short textual description of this scan loop element. |
String |
toXml()
Returns an XML representation of this scan loop element. |
void |
writeAsXmlTo(Writer writer)
Writes an XML representation of this scan loop element to writer . |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void reset()
public void setId(Long id)
public Long getId()
getId
in interface Identifiable
public void clearId()
public void setName(String newName)
If newName
is null or the empty string
(""), the request to change the name will be
denied and the current name will remain in place.
newName
- the new name of this element.public String getName()
public void setSchedulingBlock(SchedulingBlock newSchedBlock)
This method does not communicate back to newSchedBlock
about its new scan loop element. This is because the scheduling block does
not hold these elements directly, except for its single
scanSequence
, which is of type ScanLoop
.
This means that the model is not enforcing integrity in the
container / contained relationship that exists between
SchedulingBlock
and ScanLoopElement
.
Passing this method a schedulingBlock
of null has the
effect of disconnecting this element from any scheduling block.
newSchedBlock
- the scheduling block to which this element belongs.public SchedulingBlock getSchedulingBlock()
public boolean hasSchedulingBlock()
Scans should normally be contained directly within either a scheduling block or an execution block. The execution block, in turn, is normally contained within a scheduling block. Therefore, a scan loop element normally has a link to a scheduling block. However, there are some situations where this method will return false:
getSchedulingBlock()
and know that
it will return a non-null object.public ProgramBlock getProgramBlock()
public Project getProject()
public void setComments(String replacementComments)
replacementComments
- free-form text about this element.
These comments replace all previously set comments.
A null value will be replaced by the empty string ("").appendComments(String)
public void appendComments(String additionalComments)
additionalComments
- new, additional, comments about this element.setComments(String)
public String getComments()
appendComments(String)
,
setComments(String)
public void setCreatedBy(Long userId)
UserAccountable
If userId
is null, this object will be updated
not with null but with UserAccountable.NULL_USER_ID
instead.
setCreatedBy
in interface UserAccountable
userId
- the ID of the user who most recently updated this object.public void setCreatedOn(Date d)
UserAccountable
If d
is null it will be ignored and this method
will do nothing.
setCreatedOn
in interface UserAccountable
d
- the date on which this object was created.public void setLastUpdatedBy(Long userId)
UserAccountable
If userId
is null, this object will be updated
not with null but with UserAccountable.NULL_USER_ID
instead.
setLastUpdatedBy
in interface UserAccountable
userId
- the ID of the user who most recently updated this object.public void setLastUpdatedOn(Date d)
UserAccountable
If d
is null it will be ignored and this method
will do nothing.
setLastUpdatedOn
in interface UserAccountable
d
- the date on which this object was most recently updated.public Long getCreatedBy()
UserAccountable
If this object does not know the identity of the user who created
it, the returned ID will be UserAccountable.NULL_USER_ID
.
getCreatedBy
in interface UserAccountable
public Date getCreatedOn()
UserAccountable
getCreatedOn
in interface UserAccountable
public Long getLastUpdatedBy()
UserAccountable
If this object does not know the identity of the user who lasted
updated it, the returned ID will be UserAccountable.NULL_USER_ID
.
getLastUpdatedBy
in interface UserAccountable
public Date getLastUpdatedOn()
UserAccountable
getLastUpdatedOn
in interface UserAccountable
public String toString()
toString
in class Object
toSummaryString()
public abstract String toSummaryString()
public String toXml() throws JAXBException
JAXBException
- if anything goes wrong during the conversion to XML.writeAsXmlTo(Writer)
public void writeAsXmlTo(Writer writer) throws JAXBException
writer
.
writer
- the device to which XML is written.
JAXBException
- if anything goes wrong during the conversion to XML.public ScanLoopElement clone()
The returned element is, for the most part, a deep copy of this one. However, there are a few exceptions:
Identifiable.UNIDENTIFIED
.
If anything goes wrong during the cloning procedure,
a RuntimeException
will be thrown.
clone
in class Object
public boolean equals(Object o)
o
is equal to this scan loop element.
In order to be equal to this element, o
must be non-null and
of the same class as this element. Equality is determined by examining
the equality of corresponding attributes, with the following exceptions,
which are ignored when assessing equality:
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |