se.entitymanager.logic
Class EntityByNameComparator

java.lang.Object
  extended by se.entitymanager.logic.EntityByNameComparator
All Implemented Interfaces:
java.util.Comparator

public class EntityByNameComparator
extends java.lang.Object
implements java.util.Comparator

A Comparator for entities.

This comparator compares entities by their name.

See Also:
EntityInterface

Field Summary
private  LogicFacade logicFacade
          The LogicFacade used to determine the names of the entities.
 
Constructor Summary
EntityByNameComparator(LogicFacade logicFacade)
          Constructs a Comparator for entities.
 
Method Summary
 int compare(java.lang.Object entity1, java.lang.Object entity2)
          Compares two given entities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

logicFacade

private LogicFacade logicFacade
The LogicFacade used to determine the names of the entities.

See Also:
LogicFacade
Constructor Detail

EntityByNameComparator

public EntityByNameComparator(LogicFacade logicFacade)
Constructs a Comparator for entities.

The names of the entities will be determined through the given logic facade.

Parameters:
logicFacade - the logic facade to determine the names
Method Detail

compare

public int compare(java.lang.Object entity1,
                   java.lang.Object entity2)
Compares two given entities.

Both objects must be instances of EntityInterface.

Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(java.lang.Object, java.lang.Object)