title: Java Creating a vector with multiple ends
body: <p>I want to create two types of vectors (as classes): </p>
  
  <ul>
  <li>The first type is a regular vector with two components (a start and an ending point).</li>
  <li>The second type is also a vector but instead of having one it has <strong>two ending points</strong> you can switch between.</li>
  </ul>
  
  <p>My idea was to create an abstract superclass (e.g. <code>AbstractVector</code>) in which I define the common functions of the vectors:</p>
  
  <pre><code>abstract class AbstractVector {
      //Methods, e.g. length(), getter...
  }
  </code></pre>
  
  <p>Then my two subclasses <code>Vector</code> and (e.g. ) <code>TriVector</code> extend the above class. The problem I'm facing is handling of the two ending points in the TriVector class.
  I absolutely have no idea on how to do it or how to set up the abstract class correctly so I can have a normal vector and a vector with two endings between which I can switch (e.g. the <code>TriVector</code> class has a method <code>switch()</code> which switches between the two ending points).</p>
  
  <p>I hope somebody can help me or propose a better solution.</p>