fhm.edu.fem.calc.objects
Class NodeList

java.lang.Object
  extended by fhm.edu.fem.calc.objects.NodeList

public class NodeList
extends java.lang.Object

Class Description: This class acts as node list. It takes the node index from the node itself

Author:
Thomas Woellert (thomas@woellert.net), Stefan Weissbach (weissbst@gmx.de)

Field Summary
protected  java.util.ArrayList<Node> nodes
           
 
Constructor Summary
NodeList()
          Create a new node list
 
Method Summary
 void addAll(NodeList list)
          Add all nodes from the given list to this list
 void clear()
          Clear the list
 java.lang.Object clone()
          Clone Implementation
 boolean contains(Node node)
          Search for a specific node
 NodeList createAliasIDs(int aliasIDCounter, NodeList borderNodeList)
          Create the Alias IDs for all nodes in this list
 java.util.ArrayList<Node> getList()
           
 Node getNode(int nodeIndex)
          Retrieve a node with the given index from the list
 Node getNodeInCorrectOrder(int i)
          Retrieve the nodes in the correct order
 double getX(int nodeIndex)
          Retrieve the x-value of a specific node from the list
 double getY(int nodeIndex)
          Retrieve the y-value of a specific node from the list
 void setCenterNodeAtBeginning(Node node)
          Set the center node at the beginning of the list
 void setNode(Node node)
          Set a new node in the list.
 int size()
          Retrieve the number of nodes in the list
 java.lang.Object[] toArray()
          Convert this list to an array of nodes
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

protected java.util.ArrayList<Node> nodes
Constructor Detail

NodeList

public NodeList()
Create a new node list

Method Detail

addAll

public void addAll(NodeList list)
Add all nodes from the given list to this list

Parameters:
list, - the node list

clear

public void clear()
Clear the list


clone

public java.lang.Object clone()
Clone Implementation

Overrides:
clone in class java.lang.Object
Returns:
a clone of this list

contains

public boolean contains(Node node)
Search for a specific node

Parameters:
node, - the node to search
Returns:
boolean, true if it contains the list, false otherwise

createAliasIDs

public NodeList createAliasIDs(int aliasIDCounter,
                               NodeList borderNodeList)
Create the Alias IDs for all nodes in this list

Parameters:
int, - the start alias ID
borderNodeList, - the list of all border nodes
Returns:
NodeList, list containing nodes with an alias ID of != 0 only

getList

public java.util.ArrayList<Node> getList()
Returns:
Get the ArrayList

getNode

public Node getNode(int nodeIndex)
Retrieve a node with the given index from the list

Parameters:
nodeIndex -
Returns:
the found node or 'null' if no node has been found

getNodeInCorrectOrder

public Node getNodeInCorrectOrder(int i)
                           throws java.lang.IndexOutOfBoundsException
Retrieve the nodes in the correct order

Parameters:
i, - the index (not the node's index)
Returns:
the node
Throws:
java.lang.IndexOutOfBoundsException

getX

public double getX(int nodeIndex)
Retrieve the x-value of a specific node from the list

Parameters:
nodeIndex -
Returns:
the x-value

getY

public double getY(int nodeIndex)
Retrieve the y-value of a specific node from the list

Parameters:
nodeIndex -
Returns:
the y-value

setCenterNodeAtBeginning

public void setCenterNodeAtBeginning(Node node)
Set the center node at the beginning of the list

Parameters:
node, - the center node

setNode

public void setNode(Node node)
Set a new node in the list. It will be set at the index specified in the node

Parameters:
node, - the node to set

size

public int size()
Retrieve the number of nodes in the list

Returns:
the number of nodes

toArray

public java.lang.Object[] toArray()
Convert this list to an array of nodes

Returns:
the node array