View Javadoc

1   /*
2    * @(#) SortDefinition.java Apr 14, 2004
3    * 
4    * Copyright (c) 2003 Delft University of Technology Jaffalaan 5, 2628 BX Delft,
5    * the Netherlands All rights reserved.
6    * 
7    * This software is proprietary information of Delft University of Technology
8    * The code is published under the General Public License
9    */
10  package nl.tudelft.simulation.introspection.sortable;
11  
12  /***
13   * The SortDefinition.
14   * <p>
15   * (c) copyright 2003-2004 <a href="http://www.simulation.tudelft.nl">Delft
16   * University of Technology </a>, the Netherlands. <br>
17   * See for project information <a
18   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
19   * License of use: <a href="http://www.gnu.org/copyleft/gpl.html">General Public
20   * License (GPL) </a>, no warranty <br>
21   * 
22   * @author <a
23   *         href="http://web.eur.nl/fbk/dep/dep1/Introduction/Staff/People/Lang">Niels
24   *         Lang </a><a
25   *         href="http://www.tbm.tudelft.nl/webstaf/peterja/index.htm">Peter
26   *         Jacobs </a>
27   * @version 1.1 Apr 15, 2004
28   * @since 1.4
29   */
30  public class SortDefinition implements Sortable.Definition
31  {
32  	/*** the fieldID */
33  	private int fieldID;
34  
35  	/*** whether sorting should occur ascending */
36  	private boolean ascending;
37  
38  	/***
39  	 * constructs a new SortDefinition
40  	 * 
41  	 * @param fieldID the fieldID
42  	 * @param ascending whether sorting should occur ascending
43  	 */
44  	public SortDefinition(final int fieldID, final boolean ascending)
45  	{
46  		this.fieldID = fieldID;
47  		this.ascending = ascending;
48  	}
49  
50  	/***
51  	 * @see nl.tudelft.simulation.introspection.sortable.Sortable.Definition#getFieldID()
52  	 */
53  	public int getFieldID()
54  	{
55  		return this.fieldID;
56  	}
57  
58  	/***
59  	 * @see nl.tudelft.simulation.introspection.sortable.Sortable.Definition
60  	 *      #isAcendingSort()
61  	 */
62  	public boolean isAcendingSort()
63  	{
64  		return this.ascending;
65  	}
66  
67  	/***
68  	 * @see nl.tudelft.simulation.introspection.sortable.Sortable.Definition
69  	 *      #setAscending(boolean)
70  	 */
71  	public void setAscending(final boolean ascending)
72  	{
73  		this.ascending = ascending;
74  	}
75  
76  	/***
77  	 * @see java.lang.Object#toString()
78  	 */
79  	public String toString()
80  	{
81  		return "Sort definition, fieldID: " + this.fieldID + ", ascending: "
82  				+ this.ascending;
83  	}
84  }