com.jrefinery.workbook
Class ColumnAttributes

java.lang.Object
  |
  +--com.jrefinery.workbook.ColumnAttributes
All Implemented Interfaces:
java.lang.Comparable

public class ColumnAttributes
extends java.lang.Object
implements java.lang.Comparable

Stores the attributes for a range of columns (or sometimes just one column).


Field Summary
protected  int endColumn
          The ending column number (startColumn to Worksheet.MAX_COLUMNS-1).
protected  boolean hardSize
          Not sure what this is (Gnumeric uses it for something).
protected  boolean hidden
          Flag that indicates whether this column is hidden.
protected  int marginA
          The left margin.
protected  int marginB
          The right margin.
protected  int startColumn
          The starting column number (0 to Worksheet.MAX_COLUMNS-1).
protected  double width
          The column width.
 
Constructor Summary
ColumnAttributes(int startColumn, int endColumn)
          Standard constructor: uses default values.
ColumnAttributes(int startColumn, int endColumn, double width)
          Standard constructor.
 
Method Summary
 int compareTo(java.lang.Object other)
          Implements the Comparable interface.
 int getEndColumn()
          Returns the end column.
 ColumnAttributes getSplitFromColumn(int split)
          Returns a new ColumnAttributes object, based on this one but only from the specified column.
 ColumnAttributes getSplitToColumn(int split)
          Returns a new ColumnAttributes object, based on this one but only up to the specified column.
 int getStartColumn()
          Returns the start column.
 ColumnAttributes getSubset(int c1, int c2)
          Returns a new ColumnAttributes object, based on this one but only for the specified range of columns.
 double getWidth()
          Returns the column width.
 void setWidth(double width)
          Sets the column width.
 void writeColInfo(java.io.PrintStream out, java.lang.String indent)
          Writes the columns element to the specified stream in the Gnumeric format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

startColumn

protected int startColumn
The starting column number (0 to Worksheet.MAX_COLUMNS-1).

endColumn

protected int endColumn
The ending column number (startColumn to Worksheet.MAX_COLUMNS-1).

width

protected double width
The column width.

marginA

protected int marginA
The left margin.

marginB

protected int marginB
The right margin.

hardSize

protected boolean hardSize
Not sure what this is (Gnumeric uses it for something).

hidden

protected boolean hidden
Flag that indicates whether this column is hidden.
Constructor Detail

ColumnAttributes

public ColumnAttributes(int startColumn,
                        int endColumn)
Standard constructor: uses default values.
Parameters:
startColumn - The start column.
endColumn - The end column.

ColumnAttributes

public ColumnAttributes(int startColumn,
                        int endColumn,
                        double width)
Standard constructor.
Parameters:
startColumn - The start column.
endColumn - The end column.
width - The column width.
Method Detail

getStartColumn

public int getStartColumn()
Returns the start column.
Returns:
The start column.

getEndColumn

public int getEndColumn()
Returns the end column.
Returns:
The end column.

getWidth

public double getWidth()
Returns the column width.
Returns:
The column width.

setWidth

public void setWidth(double width)
Sets the column width.
Parameters:
The - new column width.

getSplitToColumn

public ColumnAttributes getSplitToColumn(int split)
Returns a new ColumnAttributes object, based on this one but only up to the specified column.
Parameters:
split - The column.

getSplitFromColumn

public ColumnAttributes getSplitFromColumn(int split)
Returns a new ColumnAttributes object, based on this one but only from the specified column.
Parameters:
split - The column.

getSubset

public ColumnAttributes getSubset(int c1,
                                  int c2)
Returns a new ColumnAttributes object, based on this one but only for the specified range of columns.
Parameters:
c1 - The start column.
c2 - The end column.

compareTo

public int compareTo(java.lang.Object other)
Implements the Comparable interface.
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - The object to compare against.

writeColInfo

public void writeColInfo(java.io.PrintStream out,
                         java.lang.String indent)
Writes the columns element to the specified stream in the Gnumeric format.