Initializing instance variables in a constructor that are used by super()
I have a class that extends a standard class (ie JButton, but it doesn't matter what class). The constructor takes a parameter that I set to an instance variable. There is an overloaded method of the standard class that needs to use the variable.
My problem is that since I must call super() first, my instance variable is not yet set, so when my overloaded method is called by the constructor it is unable to see the paramater value. How can my method see this value?
public class MyClass extends somejavaclass {
MyClass(int x) {
super();
myInt = x;
// This overrides something in somejavaclass and is called by the constructor
public void aJavaMethod() {
// do some logic with myInt, but it has not been set to my paramater value
int myInt;
}
If the variable in question is an object reference,
you could compare it to null. A true result would tell
you that it hadn't been initialized yet, and you could
write code to behave accordingly (for example calling
the init() method to do the initialization).That's a good solution but what if the instance in question is set in the sub-classes constructor?
This is a very annoying feature of Java, and one that
I have had to work around on several occasions. And as
far as I'm concerned it's an unnecessary feature: why
shouldn't a class be able to initialize its variables
before it calls the superclass's constructor? Other OO
languages permit that.I've wondered this also. I'd always assumed it was a way to make sure the super-class was completely initialized before anything tries to use it esp. to make sure the Object() constructor is finished before anything else happens.
How is this dealt with in C++ or does it just leave open potential for errors?
Similar Messages
-
Find USERS that are using a particulary Forms ??
It is possibile to find the USERS that are using the a FORMS in application server ??
I must update sometime a forms, but if the user is using the forms it is not possibile. Find the user i can call it for exit from teh form.
Thank's a lot.I'm not aware of such an information somewhere. We had a similar need (actually we needed something more), and we used DBMS_APPLICATION_INFO package, which updates CLIENT_INFO column in V$SESSION.
Bad news are : you have to change every Form to do that....but it's not difficult, you can add a call to that package in WHEN-NEW-FORM-INSTANCE trigger in each Form... -
How to find out FICO user exits that are used by User
How to find out the FICO user exits that are used by user.
Go to tcode CMOD. In the project field drop down your list there. Put a Z* there and run the list. These should be all the exits that are activated. Search for the ones that pertain to FI. You can also search by development class. You need a little ABAP knowledge to search easily. You get this by going to the tcode then to status then to the program then to the attributes. There you find the development class. Ie FBAS.
pls assign points if helpful as a way to say thanks. -
Can you FaceTime between 2 iPads that are using the same apple ID but separate emails?
Yes......I do so all the time.
-
How to identify reports that are using a specific universe object?
Any idea how to use BO Auditor or Metadata Manager to identify webi reports that are using a specific universe object or universe prompt in the report SQL?
Hi Samuel,
In case you are using BOXIR2 you can do this by editing the crystalenterprise.webi.xml file.
Replace the CrystalEnterprise.Webi.xml file (Take a backup) with the edited one.
Path where you can find this file- Tomcat/webapps/businessobjects/enterprise115/desktoplaunch/WEB-INF/classes/META-INF/CrystalEnterprise.Webapps/ePortfolio/plugins
Paste the Custom Documentation folder in Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\
May I know your email Id so that I can send you the edited crystalenterprise.webi.xml file.
Regards,
Sarbhjeet Kaur -
How do I get files from multiple DVDs that are using thesame file names?
How do I get files from multiple DVDs that are using thesame file names? Message says "file already exists in catalog"
Message was edited by: marcr56marcr56
I am viewing your question from different perspective, that is, the issue that you face when you are ripping VOBs from a second DVD-VIDEO on DVD disc using Premiere Elements,
It is best to give the Premiere Elements version and computer operating system that it is running on. In the absence of that, I will generalize.
Assuming that you are using
Premiere Elements 12
Add Media
"DVD Camera or Computer Drive"
Video Importer
Typically the Video Importer Save In: is C:\Users\Owner\Videos
Each of your DVD discs is going to have the same names for the ripped VOBs (VTS_01_1.VOB and so on depending on the duration of the movie). Consequently, after the ripping of the first DVD's VOBs and their save to Videos, you will end up with that "files already existing..." block for the ripping of the VOBs from the second DVD.
The answer is, for each DVD disc VOB ripping, to plan ahead and create and set for different folders in Videos in the Save In field of the Video Importer.
Please review and then let us know if that works for you. Please do not hesitate to ask if you need clarification on anything that I have written.
Thank you.
ATR. -
Editing a movie that was already cut together without transcoding .h264 footage to proresslt. I want to transcode full clips that are used in the edit, but not any of the leftovers. Is there an efficient way to this?
I'm thinking I can convert the files with Compressor and place them in a new folder with their original file names (not sure how to get compressor to do this yet) and then do a major "Reconnect Clip" afterwards.
Not sure if there's a more efficient way to get all the clips in the timeline to compressor. I want the full files, not a sequence export. I can go through one clip and a time and add the master file. I'd rather not.
The more automated processes the better.
Thank you. I'm currently working so I don't have the time to scour the forums. Help or links to help would be greatly appreciated.
Byeah Media reconnect can be an issue.
Will Media Manager convert files? Another thing I was thinking was to Media Manage the sequence out, copying all the used files to a new folder, and then running that through compressor. But it still leads to a massive reconnect. Fine tuning all those edits would be less involved than re-editing the whole thing, I hope. -
What are main events in that are used in ALV reports
hi gurus
what are main events in that are used in ALV reports....
regards
baskarhi
i think this will help u.
Events in alv and their FM The main events in alv and their FM and why we use these:
1. SLIS_PRINT_ALV.
2. SLIS_T_LISTHEADER.
3. SLIS_T_EVENT.
4. SLIS_T_SORTINFO_ALV.
5. SLIS_T_LAYOUT_ALV.
6. SLIS_T_FIELDCAT_ALV.
and in classic reports what is the sequence of events: === Events are
At selection-screen output.
Initialization.
At selection-screen on field
At selection-screen on end of field
At selection-screen on Radiobutton Group R1. (If you have any radio buttons)
At selection-screen on block b1. (If you have any blocks)
Start-of-selection.
Get node. (if the data is retreived from a logical database)
Get node late. (if the data is retreived from a logical database)
Top-of-page. (if the write statement is in the end-of-selection event or we can say that before the first write statement)
end-of-selection.
and fuction modules are
LISTHEADER - Is used to print the header information in the ALV List. Name, Date, Time, ALV Name and other details are called as Header information. EVENT - Basically this is the FM to handle Event's. When the user needs to do some event operation like when double clicking the a particular field we need to perform some operation. These events are captured by this FM. LAYOUT - This FM is used to define the layout of the List. There are many options available in this FM to define the Layout style. FIELDCAT - These are used to populate the List header. We can change them according to our req.
User-defined Text Output Event
Application
print_end_of_list
Define output text to be printed at the end of the entire list
print_top_of_list
Define output text to be printed at the beginning of the entire list
print_end_of_page
Define output text to be printed at the end of each page
print_top_of_page
Define output text to be printed at the beginning of each page
subtotal_text
Define self-defined subtotals texts
Mouse-controlled Actions in the Grid Control Event
Application
button_click
Query a click on a pushbutton in the ALV Grid Control
double_click
Query a double-click on a cell of the ALV Grid control
hotspot_click
Query a hotspot click on columns defined for this purpose in advance
onDrag
Collect information when elements of the ALV Grid Control are dragged
onDrop
Process information when elements of the ALV Grid Control are dropped
onDropComplete
Perform final actions after successful Drag&Drop
onDropGetFlavor
Distinguish between options for Drag&Drop behavior
Processing of Self-defined and Standard Functions Event
Application
before_user_command
Query self-defined and standard function codes
user_command
Query self-defined function codes
after_user_command
Query self-defined and standard function codes
Definition of Self-defined Functions Event
Application
toolbar
Change, delete or add GUI elements in the toolbar
menu_button
Define menus for menu buttons in the toolbar
context_menu_request
Change context menu
onf1
Define self-defined F1 help
All of these can be found under type group SLIS.
Events
SLIS_EV_ITEM_DATA_EXPAND TYPE SLIS_FORMNAME VALUE 'ITEM_DATA_EXPAND',
SLIS_EV_REPREP_SEL_MODIFY TYPE SLIS_FORMNAME VALUE 'REPREP_SEL_MODIFY', SLIS_EV_CALLER_EXIT_AT_START TYPE SLIS_FORMNAME VALUE 'CALLER_EXIT',
SLIS_EV_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND',
SLIS_EV_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
SLIS_EV_DATA_CHANGED TYPE SLIS_FORMNAME VALUE 'DATA_CHANGED',
SLIS_EV_TOP_OF_COVERPAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_COVERPAGE',
SLIS_EV_END_OF_COVERPAGE TYPE SLIS_FORMNAME VALUE 'END_OF_COVERPAGE',
SLIS_EV_FOREIGN_TOP_OF_PAGE TYPE SLIS_FORMNAME
VALUE 'FOREIGN_TOP_OF_PAGE', SLIS_EV_FOREIGN_END_OF_PAGE TYPE SLIS_FORMNAME
VALUE 'FOREIGN_END_OF_PAGE',
SLIS_EV_PF_STATUS_SET TYPE SLIS_FORMNAME VALUE 'PF_STATUS_SET',
SLIS_EV_LIST_MODIFY TYPE SLIS_FORMNAME VALUE 'LIST_MODIFY',
SLIS_EV_TOP_OF_LIST TYPE SLIS_FORMNAME VALUE 'TOP_OF_LIST',
SLIS_EV_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE',
SLIS_EV_END_OF_LIST TYPE SLIS_FORMNAME VALUE 'END_OF_LIST',
SLIS_EV_AFTER_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE 'AFTER_LINE_OUTPUT', SLIS_EV_BEFORE_LINE_OUTPUT TYPE SLIS_FORMNAME VALUE 'BEFORE_LINE_OUTPUT',
SLIS_EV_SUBTOTAL_TEXT TYPE SLIS_FORMNAME VALUE 'SUBTOTAL_TEXT'.
with regards
sravani
award points if found useful. -
How to find all oaf pages that are using a table in their VOs
Hello everyone,
I need to findout all the View Objects and Entity Objects that are using a table lets say A. Is there a smart way to find out all the VOs and EO's that are using my table?
Thanks
SunnyTechnically there would be only one EO for your table (if its Oracle code). VOs contain queries and there might be many which refer the table.
One option I can think of is doing a table name search in the various (EO and VO) directories on JAVATOP. Its the XML (99% cases) that would have the queries. Rest 1% having dynamic VOs, it would be difficult to determine.
Regards -
I am not able to Sync. My iPOD classic 80Gb. It tells that as iTunes can not read the contents-restore to factory settings- after restoring – it tells that it can not be restored bcause there are files that are used by other application. My iPOD appears in My Computer in drive H as a mass storage generick volume
Try disabilng the Enable Disk Use option from under the iPod's Summary tab, applying the changes, and seeing if that helps.
Otherwise, temporarily disabling any antivirus, security, firewall, or file indexing software that may be running on your system and then try restoring your iPod again.
B-rock -
I recently purchased the newest nano. I have 3 other nano's and iPad iPhone, oh and iPod touch. When I plug in nano to my mac I get the message "iPod cannot update because it contains files that are used by another application. How can manage this?
dedonred wrote:
"iPod cannot update because it contains files that are used by another application.
It means that nano was used on a third-party software or synced from different computer to sync music. Does that nano show in iTunes? If yes, then restore completely. If not, then you may need to head to Apple Store and see what they can do. -
My macbook pro keeps saying I have 450 gigabytes out of 500 that are used. But when I look on finder there are no files that are anywhere close to that amount. I went through and deleted files from my mac and now I only have 10 gigabytes of additional space free. My mac now says I have 440 gigs of other that is used. But does not make sense, do I have a virus?
Since you have not identified the OS your MBP is using, these extract may or may not assist you.
http://pondini.org/OSX/LionStorage.html
http://pondini.org/OSX/DiskSpace.html
You may also download from the Internet OmniDiskSweeper (free) and open it it will show all of the files on your MBP and the respective sizes.
ciao. -
To get all the objects that are used inside the class
Hi All,
All i wanna know is to get all the objects that are used inside the class.
Ex :
Class A{
Emp e;
public add(Dept d){
e.deptid = d.deptId;
in this class i have two objects, one Emp obj and another Dept object.
I wanna get the details abt this class Emp and Dept by simply parsing the file and by not loading this class in JVM.
Could any pls hel me out.??
thx.I wanna get the details abt this class Emp and Dept
by simply parsing the file and by not loading this
class in JVM.Your problem statement is vague and the constraint is IMO hypothetical. -
What is the industry type & material types that are used in AFS Industry ?
Hello PP members:
What is the common industry type & material types that are used in AFS (Apparel Footware Solution) industries
Thank YouHello Seshagiri:
Thank you for your reply
In addition what you have mentioned, I would like to add some more inputs ( I came to know after posting the issue)
I found that
Material type does not depend upon the industry type.
Material type defines whether product produced in inhouse or expternal procurement
(like FERT - Proc Type is X (Inhse), ROH - Proc Type is F (Ext) - MRP 2 View)
whether stock values are updated or not, due to inventory movements
Whether material is valuated or not ( most of the material are valuated, but some of the material types
are not valuated like KMAT (configurable material) & NLAG (Non Stock material)
What views that are associated with the material type
For details of material types the tcode is OMS2
Thank You -
Where can I find the Tables script that are used in the Documentation
Hello All,
Where can I find the Tables script that are used in the Documentation, Like Sales, Customers, employee, department.......
Appreciate any Help
Thanks & Regards
Madhu K10g
http://download.oracle.com/docs/cd/B19306_01/server.102/b14198/scripts.htm#sthref77
9i
http://download.oracle.com/docs/cd/B10501_01/server.920/a96539/scripts.htm#4216
Maybe you are looking for
-
How long should the Repository Creation Utility take for Oracle Portal?
I'm running the Oracle Repository Creation Utility (RCU) as a precursor to installing WebCenter, and the schema creation process is stuck on the "Portal" step. The first 10-12 steps each took less than 30 seconds to complete, and the last step has be
-
hi, i have done a file transfer program in Java which transfers a file from one PC to another. i want tht my file (any text document ) should get transfered in secured manner. Like there should be cryptography and authentication both involved. how sh
-
ODI Planning Attribute Dimension
I have an existing Product dimension that was created via ODI 10.1.5.6 to Planning 11.1.1.3.03 -- the Product Dim loads fine. Then I attached an attribute dimension called "Product Line" to it using custom attributes. I added four attributes to attac
-
How do you set the amount of time the screen stays lite after your last use?
How do you set the amount of time the screen stays lite after your last use?
-
"Account Info Needed" and Calendar entries disappear
This is a side problem in conjunction with the perpetual "Install Update" problem (see here: http://supportforums.blackberry.com/t5/BlackBerry-Link/10-1-0-4181-won-t-stop-trying-to-load-and-now... The BBQ10 device stops connecting to my desktop Out