*
* @return ChimeraModel
*/
+ @Override
public ChimeraModel getChimeraModel()
{
return this;
*
* @return user data
*/
+ @Override
public Object getUserData()
{
return userData;
* @param data
* user data to associate with this model
*/
+ @Override
public void setUserData(Object data)
{
this.userData = data;
*
* @return the selected state
*/
+ @Override
public boolean isSelected()
{
return selected;
* @param selected
* a boolean to set the selected state to
*/
+ @Override
public void setSelected(boolean selected)
{
this.selected = selected;
*
* @return the chains in this model as a list
*/
+ @Override
public List<ChimeraStructuralObject> getChildren()
{
return new ArrayList<ChimeraStructuralObject>(chainMap.values());
/**
* Checks if this model has selected children.
*/
+ @Override
public boolean hasSelectedChildren()
{
if (selected)
/**
* Return the Chimera specification for this model.
*/
+ @Override
public String toSpec()
{
if (subModelNumber == 0)
+ {
return ("#" + modelNumber);
+ }
return ("#" + modelNumber + "." + subModelNumber);
}
* Return a string representation for the model. Shorten if longer than 100
* characters.
*/
+ @Override
public String toString()
{
String modelName = "";
}
return nodeName;
}
+
+ @Override
+ public boolean equals(Object otherChimeraModel)
+ {
+ if (!(otherChimeraModel instanceof ChimeraModel))
+ {
+ return false;
+ }
+ ChimeraModel otherCM = ((ChimeraModel) otherChimeraModel);
+ return this.name.equals(otherCM.name)
+ && this.modelNumber == otherCM.modelNumber
+ && this.type == otherCM.type;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int hashCode = 1;
+ hashCode = hashCode * 37 + this.name.hashCode();
+ hashCode = hashCode * 37 + this.type.hashCode();
+ hashCode = (hashCode * 37) + modelNumber;
+ return hashCode;
+ }
}