Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.pivot.table.context
Class QuarterContext

java.lang.Object
  extended by com.citra.pivot.table.context.SingleColumnContext
      extended by com.citra.pivot.table.context.DateColumnContext
          extended by com.citra.pivot.table.context.QuarterContext
All Implemented Interfaces:
TableContext

public class QuarterContext
extends DateColumnContext

QuarterContext extracts quarters from Date values. The format used is set as: "'Q'{qtr}-yy".


Nested Class Summary
 
Nested classes/interfaces inherited from class com.citra.pivot.table.context.DateColumnContext
DateColumnContext.DateContext
 
Field Summary
protected  boolean showYear
          indicates whether year should be
 
Fields inherited from class com.citra.pivot.table.context.DateColumnContext
calendar, format
 
Fields inherited from class com.citra.pivot.table.context.SingleColumnContext
captionColumn, columnsByLocale, comparator, extractColumn, nameColumn
 
Constructor Summary
QuarterContext(int column)
          Constructs a QuarterContext.
QuarterContext(int column, boolean showYear)
          Constructs a QuarterContext.
 
Method Summary
 void applyFormat(DateColumnContext.DateContext di, List row, Locale locale)
          Changes the simple date format's pattern, if necessary.
 Object extractMemberValue(List row)
          Extracts a member value from a row that corresponds to the underlying table model.
 boolean getShowYear()
          Determines whether the year will be shown along with the quarter.
 void setShowYear(boolean showYear)
          Determines whether the year will be shown along with the quarter.
 
Methods inherited from class com.citra.pivot.table.context.DateColumnContext
compareMemberValues, getCaption, getDateFormat, getDescription, getName, hasField, setField
 
Methods inherited from class com.citra.pivot.table.context.SingleColumnContext
getColumnForLocale, setColumnForLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showYear

protected boolean showYear
indicates whether year should be

Constructor Detail

QuarterContext

public QuarterContext(int column)
Constructs a QuarterContext.


QuarterContext

public QuarterContext(int column,
                      boolean showYear)
Constructs a QuarterContext.

Method Detail

applyFormat

public void applyFormat(DateColumnContext.DateContext di,
                        List row,
                        Locale locale)
Changes the simple date format's pattern, if necessary.
You can override this method for most advanced configurations. Do not forget to call format.applyPattern(pattern); , when finished.

Overrides:
applyFormat in class DateColumnContext
Parameters:
di - the date info object which is formatted
row - the row to the table model
locale - the locale in which the format is applied

extractMemberValue

public Object extractMemberValue(List row)
Extracts a member value from a row that corresponds to the underlying table model.

Specified by:
extractMemberValue in interface TableContext
Overrides:
extractMemberValue in class DateColumnContext
Parameters:
row - the row to the table model
Returns:
the extracted value that will be used as the member value

getShowYear

public boolean getShowYear()
Determines whether the year will be shown along with the quarter.

Returns:
true if year will be displayed, false otherwise

setShowYear

public void setShowYear(boolean showYear)
Determines whether the year will be shown along with the quarter.

Parameters:
showYear - true if year will be displayed, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.