tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <l...@bellsouth.net>
Subject Off Topic: Java Narrowing Conversion Question
Date Fri, 05 Apr 2002 20:58:35 GMT
All, 

This is an off topic Java question but any help here will be greatly appreciated.

I have a class, TMSProjectMemberTask, that is a subclass of TMSAccountingTask.  When I try
to do a Narrowing Conversion cast I get a ClassCastExceptionError and I can't for the life
of me figure out why.

The Java Spec only says that a check will be done on narrowing conversions but doesn't say
what the check is on or what to do to fix this problem.  

Thanks in advance for any help provided.  I know this is off topic but this mail list is one
of the better groups out there and I'm kinda grasping at straws.

Lunch is on me for anyone who provides the answer :) serously!

Again, Thanks:

Lon Palmer

SUPER CLASS TMSAccountingTask
-----------------------------------------------------
public class TMSAccountingTask
{

  protected int m_iTaskID;
  protected int m_iOpeningProjectMemberID;
  public boolean isAllProjects = false;
  protected String m_sAbstract;
  protected String m_sTaskDescription;
  protected int m_iCatagory;


  /**
   * Constructors.
   */
  public TMSAccountingTask()
  {
  }

  // Getters and Setters...

  public void setCatagory( int iCat )
  {
    m_iCatagory = iCat;
  }

  public int getCatagory()
  {
    return m_iCatagory;
  }

  public void setID( int iTaskID )
  {
    m_iTaskID = iTaskID;
  }

  public int getID()
  {
    return m_iTaskID;
  }

  public void setOpener( int iProjMemberID )
  {
    m_iOpeningProjectMemberID = iProjMemberID;
  }

  public int getOpener()
  {
    return m_iOpeningProjectMemberID;
  }

  public void setDescription( String sDesc )
  {
    m_sTaskDescription = sDesc;
  }

  public String getDescription()
  {
    return m_sTaskDescription;
  }

  public void setAbstract( String sAbstract )
  {
    m_sAbstract = sAbstract;
  }

  public String getAbstract()
  {
    return m_sAbstract;
  }
}

SUB CLASS TMSProjectMemberTask
------------------------------------------------------
package com.tridentms;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2001</p>
 * <p>Company: </p>
 * @author unascribed
 * @version 1.0
 */

public class TMSProjectMemberTask extends TMSAccountingTask
{
  protected int m_iPMTaskID;
  protected int m_iProjectMemberID;
  protected java.util.Date TaskDate;
  protected double TaskHours;
  protected String m_sNotes;
  protected java.text.DateFormat dtef =
              new java.text.SimpleDateFormat( "YYYY-MM-DD HH:mm:ss" );

  public TMSProjectMemberTask()
  {
    super();
    // TaskDate = new java.util.Date();
  }

  public void setPMTaskID( int id )
  {
    m_iPMTaskID = id;
  }

  public int getPMTaskID()
  {
    return m_iPMTaskID;
  }

  public void setMemberID( int iMem )
  {
    this.m_iProjectMemberID = iMem;
  }

  public int getMemberID()
  {
    return m_iProjectMemberID;
  }

  public void setTaskDate( java.util.Date TaskDate )
  {
    this.TaskDate = TaskDate;
  }

  public java.util.Date getTaskDate()
  {
    return TaskDate;
  }

  public String getTaskDateString()
  {
    return dtef.format( TaskDate );
  }

  public void setTaskHours( double hours )
  {
    TaskHours = hours;
  }

  public double getTaskHours()
  {
    return TaskHours;
  }

  public void setNotes( String sNotes )
  {
    m_sNotes = sNotes;
  }

  public String getNotes()
  {
    return m_sNotes;
  }

}


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message