org.springframework.beans.support
Class MutableSortDefinition

java.lang.Object
  extended byorg.springframework.beans.support.MutableSortDefinition
All Implemented Interfaces:
Serializable, SortDefinition

public class MutableSortDefinition
extends Object
implements SortDefinition, Serializable

Mutable implementation of SortDefinition. Supports toggling the ascending value on setting the same property again.

Since:
26.05.2003
Author:
Juergen Hoeller, Jean-Pierre Pawlak
See Also:
setToggleAscendingOnProperty(boolean), Serialized Form

Constructor Summary
MutableSortDefinition()
           
MutableSortDefinition(boolean toggleAscendingOnSameProperty)
           
MutableSortDefinition(SortDefinition source)
           
MutableSortDefinition(String property, boolean ignoreCase, boolean ascending)
           
 
Method Summary
 boolean equals(Object other)
           
 String getProperty()
          Return the name of the property to sort by.
 int hashCode()
           
 boolean isAscending()
          Return if ascending or descending.
 boolean isIgnoreCase()
          Return whether upper and lower case in String values should be ignored.
 boolean isToggleAscendingOnProperty()
           
 void setAscending(boolean ascending)
           
 void setIgnoreCase(boolean ignoreCase)
           
 void setProperty(String property)
          Set the sort property.
 void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableSortDefinition

public MutableSortDefinition()

MutableSortDefinition

public MutableSortDefinition(SortDefinition source)

MutableSortDefinition

public MutableSortDefinition(String property,
                             boolean ignoreCase,
                             boolean ascending)

MutableSortDefinition

public MutableSortDefinition(boolean toggleAscendingOnSameProperty)
Method Detail

setProperty

public void setProperty(String property)
Set the sort property. If the property was the same as the current, the sort is reversed if "toggleAscendingOnProperty" is activated, else simply ignored.


getProperty

public String getProperty()
Description copied from interface: SortDefinition
Return the name of the property to sort by.

Specified by:
getProperty in interface SortDefinition

setIgnoreCase

public void setIgnoreCase(boolean ignoreCase)

isIgnoreCase

public boolean isIgnoreCase()
Description copied from interface: SortDefinition
Return whether upper and lower case in String values should be ignored.

Specified by:
isIgnoreCase in interface SortDefinition

setAscending

public void setAscending(boolean ascending)

isAscending

public boolean isAscending()
Description copied from interface: SortDefinition
Return if ascending or descending.

Specified by:
isAscending in interface SortDefinition

setToggleAscendingOnProperty

public void setToggleAscendingOnProperty(boolean toggleAscendingOnProperty)

isToggleAscendingOnProperty

public boolean isToggleAscendingOnProperty()

equals

public boolean equals(Object other)

hashCode

public int hashCode()


Copyright (C) 2003-2004 The Spring Framework Project.