Codota Logo
KCell.getType
Code IndexAdd Codota to your IDE (free)

How to use
getType
method
in
org.pentaho.di.core.spreadsheet.KCell

Best Java code snippets using org.pentaho.di.core.spreadsheet.KCell.getType (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

 stop = true;
} else {
 if ( cell.getType() != KCellType.EMPTY ) {
  if ( below.getType() == KCellType.BOOLEAN ) {
   fieldtype = ValueMetaInterface.TYPE_BOOLEAN;
  } else if ( below.getType() == KCellType.DATE ) {
   fieldtype = ValueMetaInterface.TYPE_DATE;
  } else if ( below.getType() == KCellType.LABEL ) {
   fieldtype = ValueMetaInterface.TYPE_STRING;
  } else if ( below.getType() == KCellType.NUMBER ) {
   fieldtype = ValueMetaInterface.TYPE_NUMBER;
  } else {
origin: pentaho/pentaho-kettle

@Test
public void testReadCells() throws Exception {
 KSheet sheet = getSampleSheet();
 KCell cell = sheet.getCell( 1, 2 );
 assertEquals( "One", cell.getValue() );
 assertEquals( KCellType.LABEL, cell.getType() );
 cell = sheet.getCell( 2, 2 );
 assertEquals( KCellType.DATE, cell.getType() );
 assertEquals( new Date( 1283817600000L ), cell.getValue() );
 cell = sheet.getCell( 1, 3 );
 assertEquals( "Two", cell.getValue() );
 assertEquals( KCellType.LABEL, cell.getType() );
}
origin: pentaho/pentaho-kettle

@Test
public void testNullDateCell() throws Exception {
 // cell had null value instead of being null
 final String sheetId = "1";
 final String sheetName = "Sheet 1";
 XSSFReader reader = mockXSSFReader( sheetId, SHEET_DATE_NO_V,
  mockSharedStringsTable( "Some Date" ),
  mockStylesTable(
   Collections.singletonMap( 2, 165 ),
   Collections.singletonMap( 165, "M/D/YYYY" ) ) );
 StaxPoiSheet spSheet = spy( new StaxPoiSheet( reader, sheetName, sheetId ) );
 doReturn( true ).when( spSheet ).isDateCell( any() );
 KCell cell = spSheet.getRow( 1 )[ 0 ];
 assertNotNull( cell );
 assertEquals( KCellType.DATE, cell.getType() );
 cell = spSheet.getRow( 2 )[ 0 ];
 assertNull( "cell must be null", cell );
}
origin: pentaho/pentaho-kettle

@Test
public void testInlineString() throws Exception {
 final String sheetId = "1";
 final String sheetName = "Sheet 1";
 XSSFReader reader = mockXSSFReader( sheetId, SHEET_INLINE_STRINGS,
  mock( SharedStringsTable.class ),
  mock( StylesTable.class ) );
 StaxPoiSheet spSheet = new StaxPoiSheet( reader, sheetName, sheetId );
 KCell[] rowCells = spSheet.getRow( 0 );
 assertEquals( "Test1", rowCells[ 0 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 0 ].getType() );
 assertEquals( "Test2", rowCells[ 1 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 1 ].getType() );
 rowCells = spSheet.getRow( 1 );
 assertEquals( "value 1 1", rowCells[ 0 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 0 ].getType() );
 assertEquals( "value 2 1", rowCells[ 1 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 1 ].getType() );
 rowCells = spSheet.getRow( 2 );
 assertEquals( "value 1 2", rowCells[ 0 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 0 ].getType() );
 assertEquals( "value 2 2", rowCells[ 1 ].getValue() );
 assertEquals( KCellType.STRING_FORMULA, rowCells[ 1 ].getType() );
}
origin: pentaho/pentaho-kettle

assertEquals( KCellType.LABEL, row[ 1 ].getType() );
assertEquals( "One", row[ 1 ].getValue() );
assertEquals( KCellType.DATE, row[ 2 ].getType() );
assertEquals( new Date( 1283817600000L ), row[ 2 ].getValue() );
assertEquals( KCellType.NUMBER, row[ 3 ].getType() );
assertEquals( Double.valueOf( "75" ), row[ 3 ].getValue() );
assertEquals( KCellType.BOOLEAN, row[ 4 ].getType() );
assertEquals( Boolean.TRUE, row[ 4 ].getValue() );
assertEquals( KCellType.NUMBER_FORMULA, row[ 5 ].getType() );
assertEquals( Double.valueOf( "75" ), row[ 5 ].getValue() );
assertEquals( KCellType.LABEL, row[ 1 ].getType() );
assertEquals( "Two", row[ 1 ].getValue() );
assertEquals( KCellType.DATE, row[ 2 ].getType() );
assertEquals( new Date( 1283904000000L ), row[ 2 ].getValue() );
assertEquals( KCellType.NUMBER, row[ 3 ].getType() );
assertEquals( Double.valueOf( "42" ), row[ 3 ].getValue() );
assertEquals( KCellType.BOOLEAN, row[ 4 ].getType() );
assertEquals( Boolean.FALSE, row[ 4 ].getValue() );
assertEquals( KCellType.NUMBER_FORMULA, row[ 5 ].getType() );
assertEquals( Double.valueOf( "117" ), row[ 5 ].getValue() );
assertEquals( KCellType.LABEL, row[ 1 ].getType() );
assertEquals( "Three", row[ 1 ].getValue() );
assertEquals( KCellType.DATE, row[ 2 ].getType() );
assertEquals( new Date( 1283990400000L ), row[ 2 ].getValue() );
assertEquals( KCellType.NUMBER, row[ 3 ].getType() );
assertEquals( Double.valueOf( "93" ), row[ 3 ].getValue() );
assertEquals( KCellType.BOOLEAN, row[ 4 ].getType() );
origin: pentaho/pentaho-kettle

@Test
public void testNoUsedRangeSpecified() throws Exception {
 final String sheetId = "1";
 final String sheetName = "Sheet 1";
 SharedStringsTable sharedStringsTableMock =
  mockSharedStringsTable( "Report ID", "Report ID", "Approval Status", "Total Report Amount", "Policy",
   "ReportIdValue_1", "ReportIdValue_1", "ApprovalStatusValue_1", "PolicyValue_1" );
 XSSFReader reader =
  mockXSSFReader( sheetId, SHEET_NO_USED_RANGE_SPECIFIED, sharedStringsTableMock, mock( StylesTable.class ) );
 StaxPoiSheet spSheet = new StaxPoiSheet( reader, sheetName, sheetId );
 // The first row is empty - it should have empty rowCells
 KCell[] rowCells = spSheet.getRow( 0 );
 assertEquals( 0, rowCells.length );
 // The second row - is the header - just skip it
 rowCells = spSheet.getRow( 1 );
 assertEquals( 0, rowCells.length );
 // The row3 - is the first row with data - validating it
 rowCells = spSheet.getRow( 2 );
 assertEquals( KCellType.LABEL, rowCells[ 0 ].getType() );
 assertEquals( "ReportIdValue_1", rowCells[ 0 ].getValue() );
 assertEquals( KCellType.LABEL, rowCells[ 1 ].getType() );
 assertEquals( "ReportIdValue_1", rowCells[ 1 ].getValue() );
 assertEquals( KCellType.LABEL, rowCells[ 2 ].getType() );
 assertEquals( "ApprovalStatusValue_1", rowCells[ 2 ].getValue() );
 assertEquals( KCellType.NUMBER, rowCells[ 3 ].getType() );
 assertEquals( 2623.0, rowCells[ 3 ].getValue() );
 assertEquals( KCellType.LABEL, rowCells[ 4 ].getType() );
 assertEquals( "PolicyValue_1", rowCells[ 4 ].getValue() );
}
origin: pentaho/pentaho-kettle

 return;
switch ( cell.getType() ) {
 case BOOLEAN:
  if ( !( v.getType() == ValueMetaInterface.TYPE_STRING || v.getType() == ValueMetaInterface.TYPE_NONE || v
   .getType().getDescription(), cell.getContents() ) );
origin: pentaho/pentaho-kettle

KCellType cellType = cell.getType();
if ( KCellType.BOOLEAN == cellType || KCellType.BOOLEAN_FORMULA == cellType ) {
 r[rowcolumn] = cell.getValue();
   } else {
    if ( log.isDetailed() ) {
     KCellType ct = cell.getType();
     logDetailed( BaseMessages.getString( PKG, "ExcelInput.Log.UnknownType", ( ( ct != null ) ? ct
      .toString() : "null" ), cell.getContents() ) );
org.pentaho.di.core.spreadsheetKCellgetType

Popular methods of KCell

  • getContents
  • getValue
  • getRow

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • JOptionPane (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now