Results 1 to 9 of 9

Thread: Abstract class

  1. #1
    DeepakZenTech is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default Abstract class

    Hi .
    I am new in java plz let me know how i have to access Abstract class method.
    InstanceInfo is a abstract class I need to access their method so plz let me know how i can do this.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    An abstract class cannot be instantiated. You must write a concrete class that extends the abstract class. All abstract methods must be defined by the suibclass. All non-abstract methods are inherited as per usual.

  3. #3
    DeepakZenTech is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Hi i am using.
    XML Code:
    package bussinessprocess;
    import fuego.bis.svm.impl.SvmData.Feature;
    import fuego.lang.Time;
    import fuego.papi.Activity;
    import fuego.papi.CommunicationException;
    import fuego.papi.InstanceId;
    import fuego.papi.InstanceInfo;
    import fuego.papi.InstanceStamp;
    import fuego.papi.Process;
    import fuego.papi.ProcessService;
    import fuego.papi.ProcessServiceSession;
    import fuego.papi.OperationException;
    import fuego.papi.Task;
    import fuego.papi.collections.InstanceActivityPair;
    import fuego.papi.exception.InvalidVariableIdException;
    import java.util.Locale;
    
    
    
    public  class Main extends fuego.papi.InstanceInfo
    {
        
                public Activity getActivity() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                            public boolean isActivityCompleted() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public Time getActivityDeadline() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getActivityId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getActivityName() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getAuthor() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getAuthorId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public boolean isCompleted() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public Time getDeadline() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getDescription() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public boolean isException() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public boolean isExecuting() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public boolean isGrabbed() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                            public int getInternalState() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getNumberOfThreads() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getParentThreadIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getParticipantId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                            public int getParticipantIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public boolean isPending() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getPendingTaskIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                            public int getPriority() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public Process getProcess() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public Time getProcessDeadline() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getProcessId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public Time getReceptionTime() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public String getRoleId() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public int getRoleIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public boolean isRunning() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public boolean isSelected() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public InstanceStamp getStamp() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
               public InstanceActivityPair getInstanceActivityPair() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public int getTaskCount() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public int getTaskIn(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public int getTaskInternalStatus(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public String getTaskLastExecutionParticipant(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
              public Time getTaskLastExecutionTime(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public String getTaskParticipantId(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public int getTaskRetryCounter(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
              public boolean isTaskRunning(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public boolean isTaskSelected(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
              public String getTaskStatusDescription(int i, Locale locale) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public boolean isTaskValid(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public Task[] getTasks() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public Object getVar(String string, Locale locale) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public Object getVariable(String string, Locale locale) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
    
                public Object getExternalVariable(String string, Locale locale) throws InvalidVariableIdException {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Object getVar(String string) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Object getVariable(String string) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Object getExternalVariable(String string) throws InvalidVariableIdException {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Object getNormalVariable(String string) throws InvalidVariableIdException {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public boolean hasPendingTasks() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public boolean hasRepeatableTasks() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public boolean isAborted() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public InstanceStamp getStampForActivity(String string) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public int getStatus() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public String getStatusDescription(Locale locale) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public boolean isSuspended() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Task getTask(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Task getTask(String string) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
               
                public boolean isTaskCompleted(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public void invalidateTask(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getLastAttachmentIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
                
                public int getLastNoteIn() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
                
            public static void main(String[] args)
        {
        Main fb=new Main();
        String diff=fb.getDescription();
        String Name=fb.getActivityName();
        String be=fb.getActivityDeadline().toString();
        int tr=fb.getPriority();
    
    }
    }
    when i am try to compile it It's give error like.
    Exception in thread "main" java.lang.UnsupportedOperationException: Not supported yet.
    at bussinessprocess.Main.getDescription(Main.java:68)
    at bussinessprocess.Main.main(Main.java:337)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)

  4. #4
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    Java Code:
    public String getStatusDescription(Locale locale) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public boolean isSuspended() {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    
        
                public Task getTask(int i) {
                    throw new UnsupportedOperationException("Not supported yet.");
                }
    I wonder why.

  5. #5
    DeepakZenTech is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Hey,
    Actually when I am extend the class like.
    public class Main extends fuego.papi.InstanceInfo

    Its required method have to be implemented...
    I need to use the method or property of InstanceInfo abstract class so plz let me know how i can be achieve this .
    THANKX

  6. #6
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    What part of my first post did you not understand. If there is an abstract method in the abstract class then your class MUST provide an implementation of that method. At the moment all the methods in your class throw a new exception. Perhaps you should write code that actually does something in these methods.

  7. #7
    DeepakZenTech is offline Member
    Join Date
    Mar 2011
    Posts
    4
    Rep Power
    0

    Default

    Yes i am agree wid u.
    nw i m try to implement some code in dis method like.

    public String getDescription() {
    String g=getDescription();
    return g;
    }
    In main method i m using the code like.


    Main fb=new Main();
    String diff=fb.getDescription();

    Then its return the error like.
    Exception in thread "main" java.lang.StackOverflowError
    at bussinessprocess.Main.getDescription(Main.java:68)

  8. #8
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    Quote Originally Posted by DeepakZenTech View Post
    Yes i am agree wid u.
    nw i m try to implement some code in dis method like.
    I'm sorry but I don't speak childish drivel. If you cannot be bothered typing words out in full then I and many others cannot be bothered answering.

  9. #9
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Quote Originally Posted by DeepakZenTech View Post
    Yes i am agree wid u.
    nw i m try to implement some code in dis method like.

    public String getDescription() {
    String g=getDescription();
    return g;
    }
    ...
    dis tings a diffcult man. c here man, getDescription() calls d method getDescription. So if som1 calez getDescription() then dats going to call getDescription wch calez getDescription, wch calez getDescription, wch calez getDescription, wch calez getDescription ...

Similar Threads

  1. Need of an Abstract class ?
    By atul_kumar2038 in forum New To Java
    Replies: 3
    Last Post: 08-31-2010, 10:48 PM
  2. How can I call abstract class methods from another class
    By srinivas2828 in forum New To Java
    Replies: 13
    Last Post: 03-12-2010, 03:33 PM
  3. Replies: 6
    Last Post: 02-11-2009, 11:51 AM
  4. abstract class
    By makpandian in forum New To Java
    Replies: 1
    Last Post: 12-12-2008, 04:11 PM
  5. Replies: 0
    Last Post: 04-02-2008, 08:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •