Package org.apache.cayenne.ashwood

## Class WeightedAshwoodEntitySorter

- java.lang.Object
- - org.apache.cayenne.ashwood.AshwoodEntitySorter
  - - org.apache.cayenne.ashwood.WeightedAshwoodEntitySorter

- All Implemented Interfaces:
    `EntitySorter`

      public class WeightedAshwoodEntitySorter
      extends AshwoodEntitySorter

  EntitySorter that takes into account entity "weights", and otherwise delegating to another (topological) sorter.
  Since:
    3.1, since 4.0 moved to cayenne-server from cayenne-lifecycle

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Map<DbEntity,​Integer>` | `entityWeights` |

    - ### Fields inherited from class org.apache.cayenne.ashwood.AshwoodEntitySorter

      `components, dbEntityComparator, entityResolver, objEntityComparator, reflexiveDbEntities`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WeightedAshwoodEntitySorter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `addWeightForEntity​(ObjEntity entity)` |
    `protected void` | `doIndexSorter()` | Reindexes internal sorter without synchronization.
    `protected Comparator<DbEntity>` | `getDbEntityComparator​(boolean dependantFirst)` |
    `protected Comparator<ObjEntity>` | `getObjEntityComparator​(boolean dependantFirst)` |

    - ### Methods inherited from class org.apache.cayenne.ashwood.AshwoodEntitySorter

      `findReflexiveMaster, indexSorter, isReflexive, setEntityResolver, sortDbEntities, sortObjectsForEntity, sortObjEntities`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### entityWeights

          protected Map<DbEntity,​Integer> entityWeights

  - ### Constructor Detail

    - #### WeightedAshwoodEntitySorter

          public WeightedAshwoodEntitySorter()

  - ### Method Detail

    - #### doIndexSorter

          protected void doIndexSorter()

      Description copied from class: `AshwoodEntitySorter`
      Reindexes internal sorter without synchronization.
      Overrides:
        `doIndexSorter` in class `AshwoodEntitySorter`

    - #### addWeightForEntity

          protected void addWeightForEntity​(ObjEntity entity)

    - #### getDbEntityComparator

          protected Comparator<DbEntity> getDbEntityComparator​(boolean dependantFirst)

      Overrides:
        `getDbEntityComparator` in class `AshwoodEntitySorter`

    - #### getObjEntityComparator

          protected Comparator<ObjEntity> getObjEntityComparator​(boolean dependantFirst)

      Overrides:
        `getObjEntityComparator` in class `AshwoodEntitySorter`