/* --------------------------------------------------------- *
* __________ D E L T A S C R I P T *
* (_________() *
* / === / - A fast, dynamic scripting language *
* | == | - Version 4.13.11.0 *
* / === / - Developed by Adam R. Nelson *
* | = = | - 2011-2013 *
* / === / - Distributed under GNU LGPL v3 *
* (________() - http://github.com/ar-nelson/deltascript *
* *
* --------------------------------------------------------- */
package com.sector91.delta.script.objects.geom;
import com.sector91.delta.script.annotations.DSDynamicField;
import com.sector91.delta.script.annotations.DSInaccessible;
import com.sector91.delta.script.annotations.DSName;
import com.sector91.delta.script.annotations.DSType;
import com.sector91.delta.script.objects.DS_Object;
import com.sector91.delta.script.objects.DS_Vector;
import com.sector91.delta.script.objects.reflect.DS_JavaClass;
import com.sector91.geom.DimensionMismatchException;
@DSType("LineND")
public class DS_LineND extends DS_AbstractLine
{
public static final String TYPE_NAME = "LineND";
private static final DS_JavaClass DSCLASS = DS_JavaClass.fromClass(
DS_LineND.class);
private final DS_Vector start, end;
@DSInaccessible
public DS_LineND(DeltaScriptGeometry geom, DS_Vector start, DS_Vector end)
{
super(geom);
DimensionMismatchException.check("Line", start, end);
this.start = start;
this.end = end;
}
@DSName("dimensions") @DSDynamicField
public final int dimensions()
{return start.dimensions();}
@DSName("start") @DSDynamicField
@Override public final DS_Vector start()
{return start;}
@DSName("end") @DSDynamicField
@Override public final DS_Vector end()
{return end;}
@Override public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + end.hashCode();
result = prime * result + start.hashCode();
return result;
}
public boolean equals(DS_Object obj)
{
if (this == obj) return true;
if (getClass() != obj.getClass()) return false;
DS_LineND other = (DS_LineND)obj;
return end.equals(other.end) && start.equals(other.start);
}
public String getTypeName()
{return TYPE_NAME;}
@Override protected DS_JavaClass getDeltaScriptClass()
{return DSCLASS;}
}