How to Inherit Properly

Hi,
I have a probably dumb question about inheritance that I was hoping you could help me with.
I've got a base class MediaEvent with 2 sub classes MyEvent and MyShot that extend the base class. The sub classes have a few specialised methods each that aren't in the base class.
In another class (Example) I want to create one of the subClasses depending on a variable.
Pretty much I want to know if it's possible to use the sub-class methods if the object is declared as the base class?
The codes something like this:
public class Example
MediaEvent mediaEvent;
Example(int x)
if(x == 1)
mediaEvent = new MyEvent();
else
mediaEvent = new MyShot();
//Then in a different method altogether, I want to call a few methods from the mediaEvent base and depending on whether the variable was a 1 or not, a few methods from MyShot or MyEvent. i.e:
public void ExampleMethod2()
//call mediaEvent methods
//call MyShot or MyEvent methods
The problem is that since the global variable is of type MediaEvent, I can't access the sub-Classes methods. I have to create the subClass object in the constructor and use it in a different method so mediaEvent has to be a global variable.
Is there an easy way that I can overcome this problem or should I just have 2 different types of mediaEvent declared as the global variable and use an if within ExampleMethod2?
Sorry if this doesn't make any sense!
Andy

Thanks all.
After a few hours of messing about with it I decided
to do it in a different way with hopefully a better
design.
CheersGood luck - here are some other good resources:
Object-Oriented Programming Concepts
Object-oriented language basics
Don't Fear the OOP

Similar Messages

  • How do I properly zero out or erase the hard drives in my early 2009 Mac Pro 4,1 tower?

    How do I properly zero out or erase the hard drives in my early 2009 Mac Pro 4,1 tower?
    I assume there are already instructions on Apple.com someplace but haven't seen them yet… I have to one terabyte drives one the operating system the other is blank I want to start fresh I want to zero out both drives but I didn't want to make any mistakes
    I know I can use disk utility to 0 Out Dr., #2 that means I will have to take out the operating system hard drive out of my 2008 Mac Pro and put it into my 2009 Mac Pro to use the disk utility to zero out drive one the OS drive in my 2009 Mac Pro am my correct
    I just need a little bit a help I want to go slow so I don't make any mistakes with the sleds or with the erasing process which journaled to choose encrypted or not etc. etc.
    Furthermore is there instructions on the site on how to change the hard drive into a different sled because the sleds and my 2009 are different than my 2008 any advice
    Thank you

    I'm doing this because my friend told me that zeroing out the drive can nap bad sectors and also later for some kind of diagnostics usage of the drive or something like that he wasn't really clear
    My friend was really specific he said choose the option that writes zero's once over the drive that is plenty good enough I was inclined to use the maximum seven write ...I just want to make sure the drive has no bad sectors and that's it's it's zeroed out for possible future diagnostics usage or something that he said was usable later
    he also advised me to run a test on it but I don't have the software you mentioned or the software that he has… So I may have to take the drives over to his house unless you have some kind of free software that's easy to use that you could suggest that will not only zero out the drive but test the drive completely
    I am completely new to Mac I'm no dummy but at the same time I'm not super technically capable I mean I can surprise myself I'm pretty good but I need a good teacher… How expensive is this lifeguard software?
    Thank you

  • How do i properly erase an iphoto folder?

    unfortunately (and ironically), in my paranoia to not lose any photos, i've imported similar photos several times into iphoto. i then used iphoto diet, but it does strange things sometimes - in my experience, it doesn't always remove the proper duplicate (but the thumbnail), etc. so i've resorted to manually sorting each of 15K (ouch!) photos to remove the correct duplicate. i do this by sorting through the photos for different years. i've started working on 2004, and wanted to start with a clean slate and erase all the photos, then only import the orinigals i want, but iphoto 'residually' shows the saved thumbnails (i think they're thumbnails b/c they are only about 16kb, and don't open to full size - i get the 'white screen' that others have mentioned). i entered the iphoto folder (i know - a no no, but didn't know how else to erase 2004 photos) and deleted the 2004 folder.
    sorry for being so wordy - can you suggest a way to eliminate my 2004 photos in a way that would be iphoto-friendly ?
    thanks for any suggestions.
    -vince

    There are several ways to erase photos, slideshows and albuns from iPhoto.
    First of all, to make you more feel secure all you photos are actually in your iPhoto library- that means they have been copied to you pictures folder. Whatever you do with them, the originals are kept. I mean, if you have one photo in a certain album and if you erase it from that album, the original is kept in the Library and pictures folder. All iPhoto does is like an alias to the Library, so it is perfectly safe to erase an album or slideshow in iPhoto, since the real photos are in the Library, and the most real ones are still kept in the pictures folder on the finder.
    ..."how do i properly erase an iphoto folder?"- select it and press "delete" or on the "edit" menu--> "erase/delete/cut"... again... don't worry about the content of this folder/album, because they will remain either on the iPhoto Library and pictures folder on the Finder.
    Sorry to be so confusing...
    Hope I've been helpfull.
    Kisses from Portugal
    CV

  • How to inherit super class constructor in the sub class

    I have a class A and class B
    Class B extends Class A {
    // if i use super i can access the super classs variables and methods
    // But how to inherit super class constructor
    }

    You cannot inherit constructors. You need to define all the ones you need in the subclass. You can then call the corresponding superclass constructor. e.g
    public B() {
        super();
    public B(String name) {
        super(name);
    }

  • My macbook 13 inch says it is a 15 inch, how to change properly?

    my macbook 13 inch says it is a 15 inch, how to change properly?
    since i got osx istalled via an usb my macbook thinks that it is an 15 inch. while it is a 13 inch.
    i tried to reboot by shuting of my macbook. restarting it again while holding alt. and reinstalling osx via internet download.
    but nothing really changed. what to do now?
    sincerely,
    Felipe

    You didn't post a pic confirming that you screen is actully 13."  Do you have a measuring tape and or a ruler?  Place the tape or ruler diagonally across the screen.

  • How to download properly Illustrator Cs6? Thanks.

    how to download properly Illustrator Cs6? Thanks.

    You should go directly to the product page, and download a trial version.
    By the way, you're on the french forum here, don't hesitate to express yourself in french.

  • How to inherit automatically folder properties

    Hi there,
    is there any automatism provided such that if I have a folder A, where for example State Management is activated, and I create folder B within folder A, that on folder B State Management will be activated (here: with the same step definitions as in folder A) too? The same question for the other properties depending on activated RepServices, like Manual Ordering, Versioning etc.?
    I know how to "inherit" this step by step programatically (not too less work), but isn't this a standard feature?!?! At least I imagin that it is a standard request?!
    If not, how about implementing in the future...
    - a boolean property on a folder of type "inherits" or so
    - or to implement a standard "inheritance" repository service?
    Thanks in advance
    Detlev

    Hi again,
    SAP has introduced now with KMC SPS 14 the "Inheritance of the Versioning Settings When Creating New Folders", see http://help.sap.com/saphelp_nw04/helpdata/en/3a/d60a15803111d5992f00508b6b8b11/frameset.htm for details.
    Advantage: It is implemented now
    Disadvantage: It is not customizable in any way; still, ApprovalWorkflow, ManualOrdering and TimeDependentPublishing inheritance are not supported.
    Hope it helps
    Detlev

  • How to delete properly a group calendar ?

    Hello,
    How to delete properly a group calendar ?
    We have not problem to use webcalendar, but when we try to subscribe us with ical, we have encounters a access problem authorisation.
    There's only one group that make problem.
    The others work perfectly.
    Thanks, Chris

    _Calendaring Services : Enabling iCal Service for a Group_ : Web Group Calendars
    With a web browser, my Wiki group , "Calendar group"and blog service are fine. In "Calendar", i can create event with any date and time. but with iCal application when i try to subscribe to my group (http://ical.servername:8008/calendars/groups/mygroupname/calendar/), i have an error:
    "(sudoers)wikiserver as (groups)mygroupname"
    "REPORT /calendars/groups/mygroupname/calendar/ HTTP/1.1"
    "REPORT /calendars/groups/mygroupname/calendar/ HTTP/1.1"
    "(sudoers)wikiserver as (groups)mygroupname"
    "REPORT /calendars/groups/mygroupname/calendar/ HTTP/1.1"
    [caldav-8009] [AMP,client] GET /calendars/groups/mygroupname/calendar/ HTTP/1.1
    [caldav-8009] [AMP,client] Unauthenticated users not enabled with the 'calendar' SACL
    [caldav-8009] [AMP,client] Allow proxy: user 'wikiserver' as 'mygroupname'
    [caldav-8009] [AMP,client] REPORT /calendars/groups/mygroupname/calendar/ HTTP/1.1
    Message was edited by: eXpresso

  • How do I properly change a Mac's name?

    My laptop (a MacBook with Tiger) was assigned a name when I first activated it. I am using it as an airport router (using a mobile broadband system, via a "modem" connected to the laptop to access the internet) with two iMacs. One of the iMacs has the same name as the laptop. I found I had problems with the airport network, because of the common name.
    I changed the name of the laptop, using Sharing in Preferences to "Eric's Laptop". However, the name seen by the airport connection on both iMac's remains as it originally was, and I continue to have problems with the airport network.
    How do I properly change the name of the laptop so its network name is, indeed, changed?

    Thank you Baby Boomer, Texas Mac Man, and Neville Hillyer. I have taken those actions, now several times. They have not changed the laptop's name, _as seen_ on the AirPort drop-down on the right of my iMac menu bar, and the problem continues.
    When I first bought and activated the laptop and used it for this purpose, I ran into this same problem. After hours of frustration, since the laptop was still under warranty, I called Apple Service, and a helpful and knowledgeable support technician walked me through a very different and simple process that did change the name as seen by the other computers on the AirPort network. At that time, I asked why that information was not available anywhere for Mac customers, and he did not know. I (obviously) do not remember what that process was.

  • How to charge properly iphone 5s?

    how to charge properly iphone 5s since i i noticed that may will always drain  less than 5 hours.Currently playing online games only specifically clash of clans

    Hi avnetz2007,
    Welcome to Apple Support Communities.
    It sounds like you want to ensure you're charging your iOS device correctly because of a battery life sisue. The articles linked below provide a lot of great information about how to quickly and completely charge your device and improve the battery life.
    iPhone and iPod touch: Charging the battery
    http://support.apple.com/kb/HT1476
    Apple - Batteries - Maximizing Performance
    https://www.apple.com/batteries/maximizing-performance/
    I hope this helps.
    -Jason

  • How do you properly disconnect a vga monitor?

    I use a vga monitor at work about 2 to 3 times a week. I have a MBP 13, 2011.  I use it for powerpoint presentations.
    I was wondering how do you properly disconnect it once I'm done?
    I normally close out the application; turn off VGA, and then just disconnect.
    I feel like this may not be the proper way to do this.  I've looked for some sort of eject, but haven't found anything.
    Any feedback would be greatly appreciated.

    If you are switching between a monitor and a projector and the display resolutions are not the same as the MBP's then you should turn off the computer as well. I have found when using a projector that things tend to work best if the computer's display resolution is set to the resolution of the projector. It may not turn out to be necessary, but keep it in mind.

  • How to render properly to Blackberry 8800

    I've completed the ADF Mobile tutorial which works fine on the Blackberry emulator/simulator. Table rows appear in a table object and look great visually. However, when I run it from the actual Blackberry 8800 the rows appear unformatted without the table object. How do I properly render the output to the 8800 to visually appear like it does in the emulator?
    thanks
    John

    Hi, John, did you use the 8800 simulator when you developed the application as well? Different BlackBerry devices behaves a little bit differently - we would render plain HTML content to BlackBerry 4.5 and below devices because its JS engine is poor. 8800 is one such device. If you are using a simulator running 4.6 and above, then it would look different from how it would appear on the 8800 device.
    Also, on 8800, you would need to ensure a few options are checked - for example one option was to "support hTML tables". You would need to check this option, or the table may not display correctly.
    If you have additional issues, please just email me directly and I can help at [email protected]
    Thanks,
    Joe Huang

  • How do I properly archive or save projects so they could be used in the future

    Help would be greatly appreciated
    How do I properly archive or save projects so they could be used in the future, but yet delete or trash the events folder they came from, to clear hard drive space

    Hi to all of you Seniors and one junior [i.e. the the OP who started this thread]. I feel that this thread is a very vital subject relevant to practical and economical 'creativity oriented videography'!!!
    As a newcomer I always have tried to have a grasp over this matter and the insecurity of 'incomplete knowledge' has been a constant mental niggle.
    May I tell you that I have been struggling to 'hear' what I am now 'hearing' in this present discussion for over the past 10 months and have not been able to!!!
    I shout out a million cheers to all the participants, OP included, involved in this thread.
    May I request that this discussion be not allowed to die down but be used as a guidepost for all folks, especially those whose primary work is videography? By the time the this thread comes to an end, every reader should be able to make an 'informed and learned' decision of how to economically and safely preserve his work.
    Salty's observation regarding opting for SD looks attractive just because of the lack of a suitable [read economical] means of having your work in HD...but, if in the coming days, were there to be any pathbreaking discoveries in terms of data storage, and hugh capacity drives are available at 'throwaway prices' would we not for the rest of our lives regret having done our works in SD?
    Appleman's foray into this common problem, as to how it should be tackled, needs to be greatly lauded. Tom Wolsky's precise observations which obviate the need to check out and painfully realize some of the errors in Appleman's hypothesis neccessitate that the laurels, as usual, be handed over to him.
    Now having said what I felt after reading through this thread, I would like these clarifications:
    1] what is meant by having a backup of 'currentevent.fcpevent.'? How do we go about it. Where are we to store it? After doing this 'backup' can the 'currentevent.fcpevent.' file be deleted from the event folder?
    2] Some word of enlightenment regarding the meaning and usage of 'event metadata '...i.e. say after 3 years of having the 'projected related event data' in cold storage, were one have the need to put his project back again on to the timeline for further editing...what are the exact steps which one should take?
    DR.SOMANNA

  • How can I properly export video w/ bars to Rec709 (16-235 in 8-bit) from Premiere's RGB (0-255)?

    I have hit some real frustrations in working with Premiere to meet broadcast Rec709 standards for DVD & Blu-Ray. Avid Symphony works in a Rec709 space and clearly operates with its video signal from 16-235 (which matches IRE 7.5 to 100), but Premiere doesn't seem to have this understanding in its programming and engineering. Here are my issues:
    1) I can't manually enter in the digital values in the RGB Curve tool's points. Why would Premiere's engineers lock this basic feature out? It's in Photoshop.
    2) I can't properly export Premiere's color bars. In order to export to Rec709 standards, to get around issue #1, I hack into the RGB Curves preset XML file to lift the Master Curve's point 1 from 0 to 16 and set the final white point from 255 to 235. If I use Premiere's bars, on the waveform, I can see the sub-black values, but when I lift the blacks with the curves preset, it clips all sub-black values upon export. WHY?! To get around this problem, I import bars generated by a camera (for example, by a Sony EX-350, i.e. XDCAM footage). All of this wouldn't be an issue if there were an export function that specifies exporting to rec709's 16-235 values instead of 0-255, as Avid does.
    3) Particularly, the Waveform scope lies to me. The 7.5 IRE setup button does NOTHING for me, it's just a preview option that causes more confusion than clarity. Does Premiere map 0 out of 0-255 as 0 IRE or 7.5 IRE? I think it does the former and just uses that setup button to make you think that it's at 7.5. so if you do set it to 7.5, how then do you export it to match that option? Also, why can't the waveform scope have multiple options for the units - not just IRE, but also digital values (8-bit, 10-bit, linearized, etc.)?!
    4) Speaking of importing the bars and footage. To continue the example of the Sony EX-350 - it imports the bars automatically by putting the black values at 0 IRE, not 7.5 IRE.
    If Adobe wants industry professionals to take Premiere seriously, it needs to open up these options and clearly present what happens to tonal values in the image. It's very frustrating to figure out all of these problems and create cockamamy work-arounds.
    http://www.avsforum.com/avs-vb/showthread.php?t=1090642
    http://www.glennchan.info/articles/technical/setup/75IREsetup.html

    Steve,
    Thanks for your reply! However, I hope you don't take my response the wrong way, but, with no meaning of disrespect to you personally, the notion that curves are the wrong tool for numeric adjustments extremely infuriates me and displays a real lack of understanding of why a colorist or cinematographer such as myself would want to use curves in the first place.
    First, any LUT generation program or coloring program, such as Apple Color, gives complete access to numerical control to give precise, repeatable changes that you cannot get with the drag of a mouse. Photoshop, Avid Symphony, etc. all have curves tools with the ability to manually enter points.
    Second, on a user level, there should be no wrong tool for numeric adjustments, especially curves - they are the most precise means to obtain a specific contrast response. Levels or RGB corrector will only give gamma, pedestal, and gain operations, but curves gives every possible shape of a contrast response in between. If I wanted to create a very specific S-curve, I must use the curves tool to do so.
    Third, the question at hand is not Premiere Pro's ability to process natively in Rec709 with signal from 16-235 - Premiere's native ability to process all types of video input is the sole reason why I've switched to it as a platform. 'Sub-black values are not necessarily clamped'?! How then can I export a TIFF, for example, of Premiere's bars, with the sub-black values left intact? How do I even access these sub-black values, when all footage clips below 0 IRE? The primary question is, how does Premiere handle and export these IRE values with respect to digital values, whether they are 8-bit, 10-bit, 12-bit, etc.?
    Adobe's video workflow lacks a concise, cohesive FAQ or explanation of its numerical signal chain. At least, I have missed it and can't find it anywhere. If I want to properly color grade footage with a proper final output in mind, I need to know my end goals to take the proper intermediary steps.
    SteveHoeg wrote:
    Hey Tim - Premiere Pro can process natively in Rec709 with signal from 16-235 you do not need special adjustments. Curves are the wrong tool for numeric adjustments, try Levels or RGB Corrector. Sub black values are not necessarily clamped on export.  --sh

  • How Can I Properly Align Content in a Horizontal Accordion?

    I am having trouble aligning text after rotating the accordion widget horizontally. Everything is properly aligned and sized in the design page, but it becomes jumbled and the content area's width expands when I preview it in any browser. All I have done to the accordion widget after placing it is rotate it 90 degrees, remove all fill and strokes from every state of the accordion itself, and adjust the size the label and content area to my desired width and length. Only the content area has a white fill. "Can Close All" and "Overlap Items Below" are turned on and "Edit Together" is turned off.
    Any help or suggestions on how to fix this is greatly appreciated.
    How it looks in Muse.
    How it looks in the browser.

    Have you copied the text and used inside accordion container ? Please try to insert a text frame and then add the entries.
    Also the space between line or any margin setup can also cause this.
    Thanks,
    Sanjit

Maybe you are looking for

  • Using Multiple AD domains with ACS

    Hi, Is it possible to use multiple domains for authentication with ACS? I need to use AAA to authenticate remote users into a centralised location but the users will be from different domains and I was hoping to use a single applicance to cater for a

  • Is Embedded PL/SQL gateway installed

    Hi, I am trying to find out if my oracle "10gR2 standard edition" meets the requirements to install Apex 3.2.1. Is there a view to query if "Embedded pl/Sql gateway" is installed or "Oracle http server and mod_plsql" is installed. Can we query such r

  • Not Required Main Work Centre on Order Header Maintenance Order

    Hi Experts, I want to know about main work center on order header maintenance order. Standart SAP is main work center required, and i want to set main work center on order header is not required. How Can i set Main Work center on order header is not

  • Oracle.DataAccess.Client.OracleException: ORA-1031: insufficient privileges

    Hi, I am using Visual Studio 2003. I am creating a ASP.NET Web Application NOT Windows Application. I logged into Oracle as a DBA, but I got this message. I wasn't sure if I missed anything when working on the Web. Thanks for your help. Luan

  • Canon EOS 5D Mark II

    I installed the aperture update for this camera, but I still cannot import RAW (CR2) files from my camera into Aperture 2 Does anyone have a solution for that?