# JaxB Elemente in LinkedHashSet werden nicht wiededergegeben



## aze (18. Dez 2009)

Hi.Ich habe in meinen Programm einige Objekte die ich mit JaxB in XMl Datein  und auch umgekehrt von XML Datein in Objekte umwandeln möchte.

Das Umwandeln vom Objekt in XMl Datei geht Problemlos.Nur bei der Umwandlunge von der XML Datei in ein Objekt gibt es Probleme.

Das Objekt von dem ich spreche ist ein Gebiß,das Zähne besitzt ,die wiederum Flächen besitzen.Die Flächen können Befunde haben ,die ich mit einer LinkedHashSet speichere(LinkedHashSet weil die Reihenfolge der Injezierung der Befunde eine Rolle spielt und jeder Befund nur einmal vorkommen darf)

Beim Umwandeln von XML Datei in Obejekt sind alle LinkedHashsets leer,obwohl in der XML Datei steht,dass dies bei einigen Zähnen nicht der Fall ist.


----------



## fastjack (18. Dez 2009)

Kannst Du noch einige Details posten ? z.B. Schema-Auszug etc ?


----------



## aze (21. Dez 2009)

Hier mal eine XML Datei,die erzeugt wird.Ein Schema benutze ich nicht.:

[XML]

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
- <ns2:denture xmlns:ns2="de.crosssoft.ToothManager3D.Model.Denture">
- <lowerJaw>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>26</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <filling>3</filling> 
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>25</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>24</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>16</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>17</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>18</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>31</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>30</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>29</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>28</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>27</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>19</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>20</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>21</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>22</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>23</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
  </lowerJaw>
- <upperJaw>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>2</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <filling>3</filling> 
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>1</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>0</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>8</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>9</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <AnteriorTooth>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>10</pos> 
- <insialArea>
  <surface>15</surface> 
  </insialArea>
- <labialAreaOne>
  <surface>17</surface> 
  </labialAreaOne>
- <labialAreaTwo>
  <surface>18</surface> 
  </labialAreaTwo>
  </AnteriorTooth>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>7</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>6</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>5</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>4</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <filling>3</filling> 
  <surface>1</surface> 
  </mesialArea>
  <pos>3</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>11</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>12</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>13</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>14</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
- <SideCutter>
  <approximalState /> 
  <completefilling>-1</completefilling> 
  <completefinding>-1</completefinding> 
- <distalArea>
  <surface>0</surface> 
  </distalArea>
- <insideArea>
  <surface>10</surface> 
  </insideArea>
  <interdentalState /> 
- <mesialArea>
  <surface>1</surface> 
  </mesialArea>
  <pos>15</pos> 
- <bukkalArea>
  <surface>5</surface> 
  </bukkalArea>
- <okklusalArea>
  <surface>2</surface> 
  </okklusalArea>
  </SideCutter>
  </upperJaw>
  </ns2:denture>

[/XML]


----------



## aze (21. Dez 2009)

Hier ist mal der Code vom Model:

Das Gebiß:


```
@XmlRootElement(namespace = "de.crosssoft.ToothManager3D.Model.Denture")
public class Denture {

    private Jaw upperJaw;

    private Jaw lowerJaw;


    public Denture()
    {

    upperJaw = new Jaw(JawKind.UpperJaw);

    lowerJaw = new Jaw(JawKind.LowerJaw);

    }

    public Jaw getLowerJaw()
    {
        return lowerJaw;
    }

    public void setLowerJaw(Jaw lowerJaw)
    {
        this.lowerJaw = lowerJaw;
    }

    public Jaw getUpperJaw()
    {
        return upperJaw;
    }

    public void setUpperJaw(Jaw upperJaw)
    {
        this.upperJaw = upperJaw;
    }

    public AbstractTooth findTeeth(int pos)
    {
        AnteriorTooth[] upperAnteriorTeeth = upperJaw.getAnteriorToothArray();
        SideCutter[] upperSidecutter = upperJaw.getSicecutterArray();

        AnteriorTooth[] lowerAnteriorTeeth =  lowerJaw.getAnteriorToothArray();
        SideCutter[] lowerSidecutter = lowerJaw.getSicecutterArray();

        
        for(int i = 0 ; i < upperAnteriorTeeth.length ; i++ )
        {
            if(upperAnteriorTeeth[i].getPos() == pos)
                return upperAnteriorTeeth[i];

        }


        for(int i = 0 ; i < lowerAnteriorTeeth.length ; i++ )
        {
            if(lowerAnteriorTeeth[i].getPos() == pos)
                return lowerAnteriorTeeth[i];

        }


        for(int i = 0 ; i < upperSidecutter.length ; i++ )
        {
            if(upperSidecutter[i].getPos() == pos)
                return upperSidecutter[i];

        }


        for(int i = 0 ; i < lowerSidecutter.length ; i++ )
        {
            if(lowerSidecutter[i].getPos() == pos)
                return lowerSidecutter[i];

        }
        
        try
        {
            throw new ToothNotFoundException();

        } 
            catch (ToothNotFoundException ex)
            {
                ex.printStackTrace();
            }

            finally
            {

                return null;

            }

        

      

    }
}
```


Ein Kiefer:



```
public class Jaw
{

    private SideCutter[] _sicecutterArray;
    
    private AnteriorTooth[] _anteriorToothArray;

    enum JawKind {UpperJaw,LowerJaw}

    public Jaw()
    {


    }

    public Jaw(JawKind jawKind)
    {

        _sicecutterArray = new SideCutter[10];
    
        _anteriorToothArray = new AnteriorTooth[6];
        
        switch(jawKind)
        {



            case UpperJaw:
            {
                _sicecutterArray[0] = new SideCutter(7);
                _sicecutterArray[1] = new SideCutter(6);
                _sicecutterArray[2] = new SideCutter(5);
                _sicecutterArray[3] = new SideCutter(4);
                _sicecutterArray[4] = new SideCutter(3);
                _sicecutterArray[5] = new SideCutter(11);
                _sicecutterArray[6] = new SideCutter(12);
                _sicecutterArray[7] = new SideCutter(13);
                _sicecutterArray[8] = new SideCutter(14);
                _sicecutterArray[9] = new SideCutter(15);

                _anteriorToothArray[0] = new AnteriorTooth(2);
                _anteriorToothArray[1] = new AnteriorTooth(1);
                _anteriorToothArray[2] = new AnteriorTooth(0);
                _anteriorToothArray[3] = new AnteriorTooth(8);
                _anteriorToothArray[4] = new AnteriorTooth(9);
                _anteriorToothArray[5] = new AnteriorTooth(10);

                break;

            }

            case LowerJaw:
            {
                _sicecutterArray[0] = new SideCutter(31);
                _sicecutterArray[1] = new SideCutter(30);
                _sicecutterArray[2] = new SideCutter(29);
                _sicecutterArray[3] = new SideCutter(28);
                _sicecutterArray[4] = new SideCutter(27);
                _sicecutterArray[5] = new SideCutter(19);
                _sicecutterArray[6] = new SideCutter(20);
                _sicecutterArray[7] = new SideCutter(21);
                _sicecutterArray[8] = new SideCutter(22);
                _sicecutterArray[9] = new SideCutter(23);

                _anteriorToothArray[0] = new AnteriorTooth(26);
                _anteriorToothArray[1] = new AnteriorTooth(25);
                _anteriorToothArray[2] = new AnteriorTooth(24);
                _anteriorToothArray[3] = new AnteriorTooth(16);
                _anteriorToothArray[4] = new AnteriorTooth(17);
                _anteriorToothArray[5] = new AnteriorTooth(18);

                break;

            }
        }

    }

    @XmlElement( name = "AnteriorTooth" )
    public AnteriorTooth[] getAnteriorToothArray()
    {
        return _anteriorToothArray;
    }

    
    public void setAnteriorToothArray(AnteriorTooth[] _anteriorToothArray)
    {
        this._anteriorToothArray = _anteriorToothArray;
    }

    @XmlElement( name = "SideCutter" )
    public SideCutter[] getSicecutterArray()
    {
        return _sicecutterArray;
    }

    public void setSicecutterArray(SideCutter[] _sicecutterArray)
    {
        this._sicecutterArray = _sicecutterArray;
    }



}
```

Ein abstrakter Zahn:


```
public abstract class AbstractTooth
{

    private MesialArea _mesialArea = new MesialArea();

    private DistalArea _distalArea = new DistalArea();

    private InsideArea _insideArea = new InsideArea();
    
    private ApproximalState _approximalState = new ApproximalState();
    
    private InterdentalState _interdentalState = new InterdentalState();

    LinkedHashSet<AbstractArea> allAreas = new LinkedHashSet<AbstractArea>();

    int _pos;

    int _completefinding = -1;

    int _completefilling = -1;

    public AbstractTooth()
    {

        initialAllAreas();

    }

    public int getCompletefilling()
    {
        return _completefilling;
    }

    public void setCompletefilling(int _completefilling)
    {
        this._completefilling = _completefilling;
    }

    public int getCompletefinding()
    {
        return _completefinding;
    }

    public void setCompletefinding(int _patialfinding)
    {
        this._completefinding = _patialfinding;
    }


    public int getPos()
    {
        return _pos;
    }

    public void setPos(int pos)
    {
        this._pos = pos;
    }

    public ApproximalState getApproximalState()
    {
        return _approximalState;
    }

    public void setApproximalState(ApproximalState _approximalState)
    {
        this._approximalState = _approximalState;
    }

    public InterdentalState getInterdentalState()
    {
        return _interdentalState;
    }

    public void setInterdentalState(InterdentalState _interdentalState)
    {
        this._interdentalState = _interdentalState;
    }

    public InsideArea getInsideArea()
    {
        return _insideArea;
    }

    public void setInsideArea(InsideArea _insideArea)
    {
        this._insideArea = _insideArea;
    }

    public DistalArea getDistalArea()
    {
        return _distalArea;
    }

    public void setDistalArea(DistalArea distalArea)
    {
        this._distalArea = distalArea;
    }

    public MesialArea getMesialArea()
    {
        return _mesialArea;
    }

    public void setMesialArea(MesialArea mesialArea)
    {
        this._mesialArea = mesialArea;
    }

    public LinkedHashSet<AbstractArea> getAllAreas()
    {

        return allAreas;

    }


    public void initialAllAreas()
    {
       
        allAreas.add(getDistalArea());
        allAreas.add(getInsideArea());
        allAreas.add(getMesialArea());

     

    }
   
    public AbstractArea getArea(int area)
    {

        switch(area)
        {
            case 0: return getDistalArea();

            case 1: return getMesialArea();

            case 10: return getInsideArea();

            case 19: return getInsideArea();
        }

        return getSpecialArea(area);
    }

    abstract public AbstractArea getSpecialArea(int area);

    public void clearAreas()
    {
        _distalArea.setFinding(new LinkedHashSet<Integer>());
        _distalArea.setFilling(new LinkedHashSet<Integer>());

        _mesialArea.setFinding(new LinkedHashSet<Integer>());
        _mesialArea.setFilling(new LinkedHashSet<Integer>());

        _insideArea.setFinding(new LinkedHashSet<Integer>());
        _insideArea.setFilling(new LinkedHashSet<Integer>());

        setCompletefilling(-1);

        setCompletefinding(-1);

        clearSpecialAreas();



    }

    public abstract void clearSpecialAreas();

}
```

Die konkreten Zähne :


```
@XmlRootElement
public class AnteriorTooth extends AbstractTooth
{

    InsialArea _insialArea = new InsialArea();

    LabialArea _labialAreaOne = new LabialArea(1);

    LabialArea _labialAreaTwo = new LabialArea(2);

    public AnteriorTooth()
    {
        super();

        initialSpecialAreas();

    }

    public AnteriorTooth(int position)
    {
        super();

        _pos = position;

        initialSpecialAreas();
    }

     public LabialArea getLabialAreaTwo()
    {
        return _labialAreaTwo;
    }

    public void setLabialAreaTwo(LabialArea _labialAreaTwo)
    {
        this._labialAreaTwo = _labialAreaTwo;
    }

    public LabialArea getLabialAreaOne()
    {
        return _labialAreaOne;
    }

    public void setLabialAreaOne(LabialArea _labialArea)
    {
        this._labialAreaOne = _labialArea;
    }

    public InsialArea getInsialArea()
    {
        return _insialArea;
    }

    public void setInsialArea(InsialArea _insialArea)
    {
        this._insialArea = _insialArea;
    }

    @Override
    public AbstractArea getSpecialArea(int area)
    {

        switch(area)
        {

            case 15: return getInsialArea();

            case 17: return getLabialAreaOne();

            case 18 : return getLabialAreaTwo();

        }

        //TODO: Exception schreiben

        return null;

    }

    @Override
    public void clearSpecialAreas() 
    {

        _insialArea.setFilling(new LinkedHashSet<Integer>());
        _insialArea.setFinding(new LinkedHashSet<Integer>());

        _labialAreaOne.setFilling(new LinkedHashSet<Integer>());
        _labialAreaOne.setFinding(new LinkedHashSet<Integer>());

        _labialAreaTwo.setFilling(new LinkedHashSet<Integer>());
        _labialAreaTwo.setFinding(new LinkedHashSet<Integer>());

      
    }

   
    public void initialSpecialAreas()
    {

        allAreas.add(getInsialArea());

        allAreas.add(getLabialAreaOne());

        allAreas.add(getLabialAreaTwo());

    }

   

}


@XmlRootElement
public class SideCutter extends AbstractTooth
{

    private OkklusalArea _okklusalArea = new OkklusalArea();

    private BukkalArea _bukkalArea = new BukkalArea();

    public SideCutter()
    {

        super();

        initialSpecialAreas();

    }

    public SideCutter(int position)
    {

        super();

        _pos =position;

        initialSpecialAreas();

    }

    public BukkalArea getBukkalArea()
    {
        return _bukkalArea;
    }

    public void setBukkalArea(BukkalArea _bukkalArea)
    {
        this._bukkalArea = _bukkalArea;
    }

    public OkklusalArea getOkklusalArea()
    {
        return _okklusalArea;
    }

    public void setOkklusalArea(OkklusalArea _okklusalArea)
    {
        this._okklusalArea = _okklusalArea;
    }


    @Override
    public AbstractArea getSpecialArea(int area)
    {
        switch(area)
        {

            case 2: return getOkklusalArea();

            case 5: return getBukkalArea();

            case 16:  return getBukkalArea();

        }

        //TODO Exception schreiben

        return null;
    }

    @Override
    public void clearSpecialAreas()
    {
        _okklusalArea.setFinding(new LinkedHashSet<Integer>());
        _okklusalArea.setFilling(new LinkedHashSet<Integer>());

        _bukkalArea.setFinding(new LinkedHashSet<Integer>());
        _bukkalArea.setFilling(new LinkedHashSet<Integer>());

        

        
    }

    
    public void initialSpecialAreas()
    {
        allAreas.add(getBukkalArea());

        allAreas.add(getOkklusalArea());
    }
```

Und hier die abstrakte Fläche:


```
public abstract class AbstractArea
{ 

    private LinkedHashSet<Integer> finding = new LinkedHashSet<Integer>();

    private LinkedHashSet<Integer> filling = new LinkedHashSet<Integer>();

    protected int toothSurface;

    private String name;

    static int reihenfolge = 0;

    public AbstractArea()
    {

        

    }

    public AbstractArea(int surfaceCons,String name)
    {

        this.toothSurface = surfaceCons;
        
        this.name = name;
    }

    public String getName()
    {
        return name;
    }

    public int getSurface()
    {
        return toothSurface;
    }

    public void setSurface(int surface)
    {
        this.toothSurface = surface;
    }

  
    public LinkedHashSet<Integer> getFilling()
    {
        return filling;
    }

    public void setFilling(LinkedHashSet<Integer> _filling)
    {
        this.filling = _filling;
    }

   
    public LinkedHashSet<Integer> getFinding()
    {
        return finding;
    }

    public void setFinding(LinkedHashSet<Integer> _finding)
    {
        this.finding = _finding;
    }

    
    


}
```


----------

