Able to define methods for subclasses?

I was wondering if it was possible to define methods specific to subclasses.
For example, I have an abstract class as follows:
public abstract class Card {
}I also have two subclasses as follows:
public class StandardCard{
public class NumberCard{
}I wanted to create a compareTo() method that every subclass of card must implement, but I don't want to allow a subclass to be compared with a different subclass such as:
new StandardCard(King, Diamonds).compareTo(new NumberCard(1));So, is there a way to declare something as follows:
public abstract class Card {
public abstract int compareTo( /*same type as the dynamic type of the object*/ card);
}

Is there a way to check for the generic type of an object as well?
For example, I also wanted to assign values of card, but depending on the game a value might change. So I created an interface as follows:
public interface CardValueAssigner<T extends Card> {
     public int valueOf(T card);
}In the Card class, I have as follows:
public abstract class Card {
     public int getValue(CardValueAssigner<Card> assigner) {
          return assigner.valueOf(this);
}Is there a way to check the type of card that is within the ' < > ' of CardValueAssigner, or will I just have to create a method in every subclass.

Similar Messages

  • Use SAP defined methods instead of Logical Database(LDB)

    Hi All,
    I gonethrough some documents related to new HR ABAP programing without using logical database.  we can replace the logical databased with SAP defined methods for all the infotypes.  Appreciate if anyone let me know how do this.
    Thanks in advance.
    Thanks,
    -suresh

    Yes.. we can use the Infotype reader class.. you can use the following sample code & go from there.. fyi I wrote this on a 47 system..
    *& Report  ZP_INF_CL                                                   *
    *&  read an infotype using ABAP Objects                                *
    report  zp_inf_cl line-size 1000.
    infotypes: 0001,0008.
    parameters: p_infty type infty,
                p_pernr type pernr_d.
    constants: c_a type tclas value 'A',
               c_true value 'X'.
    data: w_infotype_reader type ref to if_hrpa_read_infotype,
          t_inftab type hrpad_prelp_tab,
          w_missing_auth type boole_d,
          w_data_exists  type boole_d,
          rec_infty like line of t_inftab.
    * init infotype reader
    call method cl_hrpa_read_infotype=>get_instance
      importing
        infotype_reader = w_infotype_reader.
    call method w_infotype_reader->read
      exporting
        tclas         = c_a
        pernr         = p_pernr
        infty         = p_infty
        begda         = sy-datum
        endda         = sy-datum
        no_auth_check = c_true
      importing
        infotype_tab  = t_inftab
        data_exists   = w_data_exists
        missing_auth  = w_missing_auth.
    loop at t_inftab into rec_infty.
      call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
        exporting
          prelp = rec_infty
        importing
          pnnnn = p0001.
      append p0001.
    endloop.
    loop at p0001.
      write:/ p0001-orgeh.
    endloop.
    ~Suresh

  • Not able to define the Simulator definition for adapter service

    Hi all,
    I am trying to define a simulator definition for adapter service(which is a synchronous adapter service) but I am not able to define the same. As soon as I input Name, serice Name, Service version, Process Name, PIP, Type and Service Type and click on "Next" or "Save And Return" I am getting the error as--
    "ORA-01555: snapshot too old: rollback segment number 3 with name "_SYSSMU3_2097677531$" too small ORA-06512: at line 1".
    Can any one suggest me why I am getting this error. I already had defined the simulators before, and at that time I didn't faced this error, but now I am not able to define the same.
    Pls help me to resolve this problem.

    Its an issue with your database rather than with CAVS. Try increasing your rollback segment space.

  • [svn:bz-trunk] 17982: Bug: BLZ-564 - Some classes in flex-messaging-core. jar define main methods for debugging purposes.

    Revision: 17982
    Revision: 17982
    Author:   [email protected]
    Date:     2010-10-01 00:39:15 -0700 (Fri, 01 Oct 2010)
    Log Message:
    Bug: BLZ-564 - Some classes in flex-messaging-core.jar define main methods for debugging purposes. This creates an unintended entry point and the main methods should be removed.
    QA: No - just removed main methods
    Doc: No
    Checkintests: No - just removed main methods
    Ticket Links:
        http://bugs.adobe.com/jira/browse/BLZ-564
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/services/messaging/selector/NumericValue.ja va
        blazeds/trunk/modules/core/src/flex/messaging/util/Base64.java
        blazeds/trunk/modules/core/src/flex/messaging/util/Hex.java
    Added Paths:
        blazeds/trunk/modules/core/test/src/flex/messaging/util/Basae64Test.java

  • Not able to do GR for STO delivery with packing.

    Hi All,
    Hi All,
    I am not able to do GR for STO delivery.
    I am getting the following error:
    Data for creating a delivery is incomplete (Vendor)
    Message no. M7279
    Business scenario:
    STO between two plants of same company code with packing material.
    Sales Org(Supp)-4444
    Sales Org(Rec)- 3333
    Plant(Supp)-2003
    Plant(Rec)-2002
    ME21N->VL10B->PGI->VF01(Proforma)->MIGO w.r.t outbound delivery(error)
    Note: PGI with packing material-separate line item generated for packing material-movement type for main material-641 and for packing material-601)
    with regards
    Azeez.Mohd

    Hi,
    When the stock is going to be moved between two plants or two storage locations that are under single company code called as stock transfer order business process. Receiving plant raises the purchase order with supplying plant; supplying plant delivers the goods to the receiving plant by raising sales order.
    Config Steps
    Create Vendor: Transaction code: XK01
    Assign Plant to Vendor
    Go to change mode of Vendor [XK02]
    Specify Vendor number that we created in the previous step
    Define shipping data for plants
    Create material by maintaining u201CPurchasingu201D view: Transaction code: MM01
    Extend the material from XXXX to YYYY plants
    As we are extending material from plant XXXX into YYYY plant, system copies all the data into the new plant.So that we have to change the delivering plant in delivering plant field as YYYY in Sales: Sales organization data 1 view.
    Create Purchase order: Transaction code: ME21N
    Activities due for Shipping (Purchase order fast display): Transaction code: VL10B
    Display stock in transit: Transaction code: MB5T
    Goods receipt: Transaction code: MIGO
    Stock movement types: INTRAand INTER
     INTRA
    Stand order type (Document type) = UB
    Delivery type = NL
    Determination of document type:
    Supplying plant + Receiving plant = UB
    Supplying plant + UB = NL
    Movement types:
                      Issuing plant Receiving plant
    Single step    647                        101
    Two step        641                        101
     INTER
    Standard order type (Document type) = NB
    Delivery type = NLCC
    Determination of document type:
    Supplying plant + Receiving plant = NB
    Supplying plant + NB = NLCC
    Movement types:
                            Issuing plant Receiving plant
    Single step              645               101
    Two step                 643                101
    PBXX is the Gross price condition type for Stock Transfer Order
    Vendor = Supplying plant
    Customer = Receiving plant
    NOTE: In single step method updations takes place in both plats simultaneously.
    In two-step method updations should takes place manually.

  • Universal Entity EJB find/select method for single db table

    Hi there.
    I'm quite new in bea spheres and my question reflects my small knowledge:
    Is there any way to perform "universal" sql query on single database table via find/select methods? This means, that I would like to pass whole WHERE clause to these methods, not just some fields values.
    What do I mean?
    Normally we define find/select method that looks like this one:
    SELECT OBJECT(o) FROM Cities AS o WHERE population>=?1 AND state=?2
    We call this a method this way:
    finder1 (1000000, 'France')
    Method returns collection with objects holding data about cities in France with more than 1000000 inhabitans..
    But, I want to define method, that could be called this way:
    finder1 ("o.population>=1000000 AND o.state='France'")
    This method should be able to perform any query on 'Cities' database table.
    I tried with defining find method for following query:
    SELECT OBJECT(o) FROM Cities AS o WHERE ?1
    but it does not work, of course.
    Is there possibility to define method that could be called this way?
    I use Bea Weblogic Workshop 8.1 SP3
    Message was edited by akla at Oct 23, 2004 5:21 PM

    Hi,
    The 'Dynamic Query' feature of WebLogic 8.1's EJB container can help you here. This feature enables you to execute complete EJB QL queries that are constructed on the fly. Check the WebLogic 8.1 documentation for more details.
    -thorick

  • How to use pre-defined scenarios for RosettaNet with XI 3.0

    Hi all.
       I am working in Comgroup Shanghai co. ltd. which is partner of SAP China.
       We have a potential customer who use RosettaNet as their Supply Chain EDI system.
       I would like to make a demo for demostrate the pre-defined scenarios for RosettaNet RNIF 2.0 packages.
       Where can I find such guideline ? I have checked the article: implementing RosettaNet with XI 3.0, but it cannot help me.
       Another question is how I can develop my own scenarios for the RNIF standards which are not included in XI RosettaNet business package ?

    Hi Andy,
    See the instructions below after you installed the RosettaNet STK.
    Below given is the sample config for PIP3B2 Scenario. Part I is using STK and Part II is using 2 XI systems.
    <b>Part I. Test Using STK</b>
    In your XI ID:
    1) Define both the parties 1) Shipper(Your Partner) 2) Receiver(Your company) with identifiers like DUNS Number.
    2) In ID goto>Tools>Transfer Integration Scenarios from IR-->select the scenario "PIP3B2_Receiver" from the drop down list.
    3) Follow the 4 steps in the config wizard.
    4) While creating your CC, create it from the channel template delivered with the RosettaNet BP.
       4.1) Specify the URL for STK which should be in the following format
    http://<STK Server>:<port>/rosettanet/servlet/listenerServlet?userId=<Party Name>
       4.2)In the location fields, enter your location and your partner location.
    In your STK
    1) Start the RosettaNet STK.
    2) enter the UserID<Partner Name in XI>
    3) Select the Test Scenario, 3B2V01.01-AdvanceShipmentNotification-0001-Scenario-Shipper
    4) Enter Global Business ID(DUNS Number) and Location ID for both the partners. These fields should be same as in your R/3 Party configuration.
    5) Enter the URL as follows:
    http://<XI Server:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    If everything is configured correctly as mentioned, you should be able to test your single-action scenario.
    <b>Part II Test using another XI System</b>
    For these follow the steps above for XI Config.
    Configure one XI System as PIP3B2 Shipper using the Scenario "PIP3B2_Shipper" and config wizard as mentioned above.
    Configure the other XI as PIP3B2 Receiver using the scenario "PIP3B2_Receiver" and config wizard.
    In the Url field, specify the URL as follows:
    http://<XI host>:<J2EE_Port>/MessagingSystem/receive/RNIFAdapter/RNIF
    Hope this helps.
    Regards,
    Sam Raju

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • Error : FZ010 : Enter a payment method for incoming payments

    Hi,
    I am running F110 and paying intercompany vendors/customers.
    I am running payment run for Compony 0050 and paying my vendor VEND0060 and CUST0060.
    The balance of vend0060 is 2 million(credit) and  balance of CUST0060 is 1 million (Debit).
    So I am going in Reallocate and changing the bank details as getting exceptioin in CUST0060. But it gives out an error "Enter Payment method for incoming payments"
    We have just configured outgoing payment and actually as credit balance is more, it should not give this error.
    Does any one know solutin for this?
    Error in details:
    Enter a payment method for incoming payments
    Message no. FZ010
    Diagnosis
    The balance of the items to be paid requires a payment method for incoming payments. You specified a payment method that is defined for outgoing payments.
    System Response
    The payment method is rejected.
    Procedure
    Enter a payment method for incoming payments.
    Thanks
    JR

    In the master record of the customer/vendor, ensure that the appropriate payment methods are maintained.  If you click on F4 on the payment method field, you can see different methods available for Incoming Payments and different methods for Outgoing payments.
    Assign points accordingly.
    Thanks,
    Madhav Nanduri

  • Error in pre-export methods for request

    hi...
    while releasing the TR we are facing  this error  msg..." Error in pre-export methods for request" it is showing lock in fornt of the TR.neither be able to delete the TR ....
    do reply as soon as possible..

    Hi,
    I had the same error PU238.
    What I did was:
    Execute SE03 to unlock the object.
    Then execute the program 'RS_STREE_OBJECTS_TO_REQ_GET', not sure what it does.
    Afterwards, it worked perfectly.
    Hope that information helps you.
    Regards,

  • How to change the score method for ses crawler table result?

    Hi,all
    There is a customer urgent requirement,they want customize methods to score the result which come from database same table different column source for relevancy boosting.For example.there is a table t_table which have 3 column:name,short description,long description.Now i create 3 source for this table,every source has different content column.source 1's content column is name,source 2's content column is short description,source 3's content column is long description,is it possible for me to define the priority for those 3 source.For example,source 1 's priority is 50%,source 2 's priority is 30%,source 3 's priority is 20%.
    By the way,i wonder that exists a API to fetch the result set score attribute and primary key value?
    any advice is appreciate.

    Kevin, have replied via internal mailing list on this. There is an undocumented method for boosting relevance by section. It is considered experimental at the moment and the exact details may change before we include it as a standard feature.

  • I have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    i have a ipod touch 2nd generation 8gb 4.2.1 im new to itunes i made a itunes account but it says i need a payment method is there anyway i can use my paypal if not is there a way to not have to use a payment method for itunes store please help ty

    Create a NEW account using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Using those instructions you may also be able to select PayPal if that is allowed in your country.

  • Payment method for incoming payments

    Hi,
    I am trying to net off a customer balance against a vendor, however system is asking me to define a payment method for incoming payment for customer line items.
    could you please suggest me where to define payment method for incoming payments.
    Your prompt help is greatly appreciated.
    Thanks
    Ramesh.

    call transaction FBZP
    double click of "payment Method in country"
    here you defined the payment metod at country level & company code level
    plz assign point as way of thanks

  • Exception in Payment Proposal - Pmnt methods for this run are not specified

    Dear all,
    I want to ask if it is possible to run a payment proposal for AP transactions together with AR. The AR line items are used for clearing. Actually, this is the first time we execute proposal run which contains AP and AR respectively. And during the proposal, AR line item is an exception - 'Pmnt methods for this run are not specified in the master record or in item'. We already checked the master record, and there is a payment method. However, it was not captured during the payment proposal. Does it have something to do with the Document Type?
    Thank you once again for all your usual support.
    Regards,
    April

    To: Karthik, pushkaraj, JeCcas_DJ
    Thank you very much for your responses.
    I've checked already FBZP and Customer Master Record, payment methods were defined. Also, during the payment run, all line items have the same payment method, but only the AR transaction was not accepted.
    I think the problem is the same as what pushkaraj mentioned. We have payment method 'D' defined only for outgoing payments and not for incoming payments. I guess that is the problem.
    By the way, can I create another entry 'D' for payment method-incoming payments? Would there be conflict if I assigned same ID?
    Regards and thank you once again...
    April

  • Need help finding the default payment method for supplier site in R12

    I am using the following query to find out what the default payment method is for a supplier site.
    select pv.vendor_id ,
    pvs.vendor_site_id,
    iepa.ext_payee_id,
    ieppm.payment_method_code
    from ap_supplier_sites_all pvs
    ,ap_suppliers pv
    ,iby_external_payees_all iepa
    ,iby_ext_party_pmt_mthds ieppm
    where pv.pay_group_lookup_code = 'EMPLOYEE'
    and pv.vendor_type_lookup_code = 'EMPLOYEE'
    and pv.employee_id is not null
    and pv.employee_id =92584--p_person_id
    and pv.vendor_id= pvs.vendor_id
    and pvs.vendor_site_code = 'HOME'
    and pvs.pay_group_lookup_code <> 'ATTACHMENT'
    and ((pv.end_date_active is null) or (pv.end_date_active >= sysdate))
    and ((pvs.inactive_date is null) or (pvs.inactive_date>= sysdate))
    and pvs.pay_site_flag = 'Y'
    and pvs.vendor_site_id = iepa.supplier_site_id
    and iepa.ext_payee_id = ieppm.ext_pmt_party_id
    and ieppm.primary_flag = 'Y'
    and pv.segment1 = '131678'
    The problem is that I am returning two rows.
    I have gone in to the application and changed the default payment method from 'Check' to 'Electronic' and I am able to see the change on one of the records, however I am unable to determine how I'm supposed to narrow it down to just this record. I am pulling what hair I have left out!
    Please help.
    Chris

    Here is the generic query for some one who is faing problem like us.This query will return all the payment methods for all sites of a supplier
    SELECT ieppm.payment_method_code,ieppm.inactive_date
    FROM ap_supplier_sites_all assa,
    ap_suppliers ass,
    iby_external_payees_all iepa,
    iby_ext_party_pmt_mthds ieppm
    WHERE ass.vendor_id = assa.vendor_id
    AND assa.pay_site_flag = 'Y'
    AND assa.vendor_site_id = iepa.supplier_site_id
    AND iepa.ext_payee_id = ieppm.ext_pmt_party_id
    AND ass.segment1 = '10033' -- Supplier Number
    AND( (ieppm.inactive_date IS NULL)or (ieppm.inactive_date > sysdate)) ;

Maybe you are looking for

  • HT5552 Can I use my Russian debit card in American iTunes Store?

    I have a VISA card from a Russian bank, but I want to use American iTunes Store. Can I use the card for iTunes Store in US? Also, I already have 10$ on my account, and, as far as I know, i can't change my payment method right now. How do I chage it t

  • How to print out page number

    I want to print page number with every page how it possible..... So that I would come to know how many printed documents are left.... Please reply soon

  • Getting error message 0x00000bbb when I try to print

    Printer has stopped printing.  Getting subject error message   0x00000bbb

  • Alternate Access Mapping not working for Zone : Intranet

    One of our client want to set Alternate Access Mappint (intranet) with url "intranet.theirDomain.com" with local IP address. is it possible? subsequest to my previous question ( http://social.technet.microsoft.com/Forums/sharepoint/en-US/3f39711e-301

  • Movie control question...

    Ok, I'm pretty good with After Effects expressions, but action script is still a bit of a mystery to me. Here's what I want to do. I've got these 7 movies that activate when you roll over their hit spot. Each of the movies has an open that's about 10