Help understand interfaces
Hi.
I've never used interfaces before and little experience with classes. And i''ve recently read some stuff about interfaces in AS3 and can't make a good idea about what exactly they are and where should i use them.
Can someone enlight me on this topic?
Thanks a lot.
Hello,
I recommand you to read Colin Moock's "Essential Action Script 3.0" for the basic understanding of interfaces, then when you analyze "Action Script 3.0: Design Patterns" you will see the practial usage in good OOP practices. Anyway you can always think of interface as an API for the object - If some classes implemets some interface you are sure that objects (diffrent classes) will have interface methods - this is very useful because there's no polymorph in Action Script 3.0. Common usage is to "mark" something with interface: if some classes implemets some interface objects are type of this interface, so you can have i.e. an interface typed argument in method, and then you pass as argument (diffrent class) objects. In Action Script 3.0 interface is set of public methods signatures, also setters and getters. That's my quick impression in this wide topic (interfaces are internal part of OOP).
regards
jk
Similar Messages
-
hi dears.....
I could not understand Interface...
many books described interface , contains abstract method... and more...
in package java.sql.*... almost this package consist of interface..
but where does implement this abstract method of interface... i couldn't find this.
example1 ...
statement = connection.createStatement();
statement : Statement interface... and
connection : Connection interface...
connection.createStatement() <- this method is abstract and no class implement...
example 2 ...
in java.awt.peer package
FramePeer has abstract method setTitle(String title)
but it never implement... i guess..
please help me... to understand interface..
hava fun...~~It doesn't matter how the interfaces in java.sql are implemented, only that they are. For instance, if I am running code in an AppServer
DataSource ds = (DataSource) context.lookup("jdbc/MyDB");
Connection conn = ds.getConnection("usr", "pwd");
Statement stmt = conn.createStatement();Then I have got a statement object that behaves as the interface java.sql.Statement says it does. If my AppServer is IBM's WebSphere, then the likelihood is that it is some com.ibm... class that is implementing Connection. If it is WebLogic it will probably be a com.bea.wl..... class.
The whole point of an API is that it is irrelevant. -
I need help understanding where to start with the following study question. If you could give me some tips b/c the book is very vague and I am lost...
Thanks
Design a Java interface called Lockable that includes the following methods: setKey, lock, unlock, and locked. the setKey, lock, and unlock methods take an integer parameter that represents the key. The setKey method establishes the key. The lock and unlock methods lock and unlock the object but only if the key passed in is correct. The locked method returns a boolean that indicates whether or not the object is locked. A Lockable object represents an object whose regular methods are protected: if the object is locked, the methods cannot be invoked; if it is unlocked they can be invoked. Redesign and implement a version of the Coin class so that it is Lockable. Submit hard copy of a Rational Rose UML class diagram, the redesigned Coin class and test driver class.Heres the interface:public interface Lockable{
public void setKey(int key);
public void lock(int key);
public void unlock(int key);
public boolean locked();
}Sample Class:public class Coin implements Lockable{
private boolean locked;
private int key ;
public Coin(){
locked = false ;
key = 0 ;
public boolean locked(){
return locked ;
public void setKey(int key){
this.key = key ;
public void unlock(int key){
if(this.key == key){
locked = false ;
public void lock(int key){
if(this.key == key){
locked = true ;
public void sayHello(){
if(!locked) System.out.println("HelloWorld") ;
} -
I need help understanding how the Apple components connect to create a whole system across all my devices?
Is there a resource that describes current system and associated functionality?
For example:
Buy A, B, C to achieve "X"
You will need:
an internet provider which supports <specs>
add D to achieve "Y"
You will need:
an internet provider which supports <specs>
add "E" to achieve "Z"
You will need:
an internet provider which supports <specs>
For example, I am looking at the Gen 6 Airport extreme. For intended performance do I need broadband? if so what are the specs, or will basic internet service suffice? Do I need the internet provider's modem or does the Airport extreme replace that? And then I think, if I am doing this, I should also look at Apple TV....What do I need and Why? Then I look at the New Desk top coming out in the fall, and I think well, if I wait and get this, what does this component do for the system, and what becomes redundant? What does this awesome desktop do for my ability to sit and use a new macbook air when I travel or sit on the couch in my PJs?
If there was a place that plainly stated "if you buy the new dektop you can configure a system including only these components and achieve <this result> and by adding <additional components> you will achieve this result.
I have been to the genius store a few times, but I come out of there more confused unless I have SPECIFIC questions or already know what to buy.
A "System Configuration App" would be a really great sales tool--Just saying.I have no idea what "fully optimized" means.
No Apple device will let you watch broadcast TV. The Apple TV is a good option for watching streaming TV from iTunes, NetFlix and Hulu. If you want to watch from other sources, you may need to look at other devices.
Any Mac computer or iPad will allow you to surf the web.
What business software?
Time Capsule is a good option for back ups.
Update what across all devices?
For accessing documents from all devices, a service like Dropbox is your best bet.
I have no idea what "step as far away from an internet provider as possible" means. If you want Internet access, you need an Internet provider.
Lighting fast speed for what? Processor? The specs are listed for all devices in the Online Store. Internet? We're back to the service provider.
Technology changes. The only way to keep pace with it beyond a couple of years is to buy new stuff.
The bottom line is you need to look at the specs for devices availble and at your budget and decide what best meets your needs. If you are unable to do that on your own, there are lot of technology consultants out there who will, for a fee, look at your exact situation, make recommendations and even handle the purchase and set up. Perhaps that would be the best route for you.
Best of luck. -
Need help with interface development
Hi i need help with requirement below with developing interface between or online order system and sap plz lemme know what is bapi i use for creating customer, update and assigining partner id to costumer.
SAP Development
1. Using standards SAP functional module (with BAPI), create interface that will create/change Ordering party customer in SAP. Following fields are mandatory for customer creation:
MANDT Client
VKORG Sales organization
VTWEG Distribution Channel
SPART Division
KDGRP Customer Group (= ZORP)
KUNNR Customer number
NAME1 Name 1
NAME 2 Name 2 (if required)
SORTL Search term (short description)
ZZALTKN Search term 2 (old customer number)
LAND1 Country
ORT01 City
PSTLZ Zip Code
REGIO Region (state in USA)
STRAS Street
TELF1 Primary telephone number
TELFX Primary Fax number
ZZPRPLANS Payment Plan
CCINS Payment card: Card type
CCNUM Payment cards: Card number
CCDEF Payment Card: Default Card Indicator
ZBDGID Customer Budget ID
ZHOLD Budget Hold indicator
ZZCOSTCENT Cost Center
2. Upon successful customer creation system will issues S (success) message that customer has been created.
3. New ordering party customer created in step ½, will have to be assigned as new partner to its belonging Sold-to/Ship-to customer. Use standard SAP customer functional module in order to perform this partner ID assignment. Partner ID for ordering party should be ZO.
1.7 Enhancement Functionality
Apart from creating a new interface to do the required functionality, the Order Create Interface also has to be changed to accommodate a field to pass the Ordering Party Number on the Order. The technicalities of how we are going to implement the interface will be laid out in the Tech Specs.
Thanks
in advanceYou have double posted, please mark this one as "solved on my own" and refer to this thread
need help with interface development
Regards,
Rich Heilman -
Need help for interface to process employee expenses
need help for interface to process employee expenses
i have used the interface tables as
AP_INVOICES_INTERFACE
AP_INVOICE_LINES_INTERFACE
are they the right one
is there a concurrent program or any API for doing interfacehi,
i think what ever table are using for interfacing expenses correct.
but you have to enter invoice type as expense report.
Regards,
Srikanth -
I need some help with Interfaces since I'm really new to OOP.
I have 1 interface, 1 class implementing the interface and 1 main function. Here is the structure:
public interface t_action
public boolean isvalid(int a, int b);
public class sec implements t_action
public boolean isvalid(int a, int b)
/* Implmentation of this method */
public class main()
public static void main(string args[])
boolean valid = false;
/* Need to call isvalid in public class sec
and assign it to the "valid" variable above
}My Question is:
How do i call the method "isvalid" in class sec that implements the t_action interface? I need to assign it to my variable "valid" in class main
Any help is appreciated.
Thanks.
MAZ@McMaster EngineeringHey all...
Thanks for your contribution.
As I said earlier here: "I'm new to Java" so cut me some slack!!!
I've been doing C programming all my life so java is similar but quite foreign to me since I started learning it recently on my own
If this were a normal class and not an interface, it would be:
class_name myclass = new class_name();
myclass.isvalid(a, b);But why is it:
interface_name i = new class_implementing_interface();
i.isvalid(a,b);Thanks -
Import finished with few errors...Help understanding it!
Hi all,
Yesterday, I finished to do an import in oracle. I used the impdp command and got few errors after the import was done. Here are some bits from my log. It was very long but I shortened it with the most common errors. I would appreciate your help understanding what does each error mean, and whether there's a solution available.
Thanks!
El sql que falla es:
CREATE TABLESPACE "SYSAUX" DATAFILE SIZE 125829120 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT AUTO
ORA-39083: Fallo de creación del tipo de objeto TABLESPACE con el error:
ORA-02236: nombre de archivo no válido
El sql que falla es:
CREATE TABLESPACE "IN_SGC_BD" DATAFILE '+DISKGROUP_BD/sgtc/datafile/rsgtc_in_sgt_bd1' SIZE 132120576 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT MANUAL
Procesando el tipo de objeto DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
ORA-31684: El tipo de objeto PASSWORD_VERIFY_FUNCTION ya existe
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
ORA-39111: Se ha saltado el tipo de objeto dependiente OBJECT_GRANT:"SYSTEM", ya existe el tipo de objeto base SEQUENCE:"SYSTEM"."SDE_LOGFILE_LID_GEN"
ORA-39083: Fallo de creación del tipo de objeto SYNONYM con el error:
ORA-00995: falta el identificador de sinónimos o no es válido
BEGIN
dbms_resource_manager.create_consumer_group('AUTO_TASK_CONSUMER_GROUP','System maintenance task consumer group','ROUND-ROBIN');COMMIT; END;
Procesando el tipo de objeto DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
ORA-29393: el usuario JAIMESP no existe o no está conectado
El sql que falla es:
BEGIN
dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_USR','',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,30,600,5,'SGTC_SWITCH',NULL,TRUE,NULL,10240,1800,900,1800);
dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_EDITOR','',40,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,600,10,'SGTC_SWITCH',NULL,TRUE,NULL,512000,1800,600,3600);
dbms_r
ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
ORA-06550: línea 2, columna 72:
PLS-00103: Se ha encontrado el símbolo "CHECK" cuando se esperaba uno de los siguientes:
in like like2 like4 likec between member submultiset
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE
ORA-39151: La tabla "OUTLN"."OL$" existe. Todos los metadados dependientes y los datos se saltarán debido table_exists_action de saltar
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . "SIGELEC"."SDE_BLK_37" 4.976 KB 0 filas importadas
. . "SIGELEC"."SDE_BLK_38" 4.968 KB 0 filas importadas
. . "SGC_BD"."BDE_CRECOBJE" 5.234 KB 0 filas importadas
. . "SIGELEC"."D418" 4.851 KB 0 filas importadas
. . "SYSTEM"."DBM_TOPSQL" 6.125 KB 0 filas importadas
. . "SIGELEC"."F100" 5.562 KB 0 filas importadas
. . "SIGELEC"."F101" 5.593 KB 0 filas importadas
. . "SIGELEC"."F102" 14.77 KB 11 filas importadas
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
ORA-39082: El tipo de objeto ALTER_PROCEDURE:"SYSTEM"."GEN_ROLE_SGTC" se ha creado con advertencias de compilación
ORA-39083: Fallo de creación del tipo de objeto PACKAGE_BODY con el error:
ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOPROY@CRE
ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_ENERGIZA" se ha creado con advertencias de compilación
ORA-39083: Fallo de creación del tipo de objeto TRIGGER con el error:
ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOCONS@CRE
ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
El sql que falla es:
ALTER TRIGGER "SIGERED"."TR_CTRL_ENERGIZA" COMPILE PLSQL_OPTIMIZE_LEVEL= 2 PLSQL_CODE_TYPE= INTERPRETED PLSCOPE_SETTINGS= 'IDENTIFIERS:NONE'
ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_CONCLUYE" se ha creado con advertencias de compilación
El sql que falla es:
BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 165, LUSER=> 'SYSTEM', PUSER=> 'SYSTEM', CUSER=> 'SYSTEM', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+1/24', BROKEN=> FALSE, WHAT=> 'dbms_stats.gather_schema_stats(ownname => ''SIGERED'',options => ''GATHER'',estimate_percent => null,method_opt => ''FOR ALL COLUMNS SIZE 1'',cas
ORA-39083: Fallo de creación del tipo de objeto JOB con el error:
ORA-00001: restricción única (SYS.I_JOB_JOB) violada
El sql que falla es:
BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 47, LUSER=> 'SIGERED', PUSER=> 'SIGERED', CUSER=> 'SIGERED', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+01/24', BROKEN=> FALSE, WHAT=> 'SIGERED.RDPQ_PROYECTOS.PR_PROCESAR;', NLSENV=> 'NLS_LANGUAGE=''AMERICAN'' NLS_TERRITORY=''AMERICA'' NLS_CURRENCY=''$'' NLS_ISO_CURRENCY=''AMERI
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PASSWORD_HISTORY
ORA-39083: Fallo de creación del tipo de objeto PASSWORD_HISTORY con el error:
ORA-01858: se ha encontrado un carácter no numérico donde se esperaba uno numérico
El trabajo "SYS"."SYS_IMPORT_FULL_01" ha terminado con 2249 error(es) en 17:21:02Hello people,
I just run for the second time a full import, and it said it finished correctly.
The first time I run it, there was a message which said that the import had finished with 2249 errors (I checked my log and not all of them were errors but messages). I checked each single message and only had to solve a couple of things.
I first created a user in response to an ora-29393: user string does not exist or is not logged on.
The second thing I did was to run the utlrp.sql file in response to an ORA-39082. I did this according to this blog.
I know oracle is taking precedence each time I run an import. I don’t know if what I have done is okay or perhaps not all data was imported after all. This is the thread which I posted initially when errors came out.
Any reply is a supply.
Thanks loads -
Help understand how this works
Hows everyone doing, i need some help understand this. This is my first time using Lulu. From the reviews i'v read about it they tell me this is the #1 place to come to to get my books printed. Here the question, i have all 3 of my books ready to be uploaded do i just sent that in, then they send me the prints ? or so they self them for me. Sorry if this seems like a dumb question, but its my first time using this particular site.
Here's a quick overview:
You start the new book wizard. Click "Create," pick a book type and size (hardcover, paperback, etc.; 6x9, 8.5 x 11, etc.), and click "Make this book."
Hint: If you want the widest distribution for your book, pick a size / type that has a green checkmark next to it.
The wizard will guide you to name your book, apply an ISBN (or get a free one), upload your contents, and upload your cover or design a cover. It will guide you to set pricing and distribution, and many other options.
When you've done all that, your book will be available to order. You will see two prices: the one you pay, and the one other people pay. The one you pay is the printing cost per book. It may be anywhere from $2.50 to $20.00 or more, depending on options you pick -- probably coser to the low end.
On that first page, where it says "Create," there is a calculator that will figure roughly what your book will cost (printing costs), so you can plan your options around that calculator.
So you order as many books as you want, pick shipping, pay with a credit card, and in a few days, the books are on your doorstep.
I hope that helps. -
Help understanding ABAP Proxies
Can someone point me to documentation to help understand ABAP proxies? What they are, why I would use them and what are the considerations in using them over BAPI's or IDOCS? I had a recent discussion with someone who is choosing to not use them because of security considerations.
Hi Rick,
For ABAP proxy documentation refer...
http://help.sap.com/saphelp_nw04/helpdata/en/ab/585f3c482a7331e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/content.htm
For considerations in using proxy over BAPI's or IDOCS Refer...
/people/ravikumar.allampallam/blog/2005/08/14/choose-the-right-adapter-to-integrate-with-sap-systems
Regards
Anand -
Need some help understanding the way materialized views are applied through
Hi, I need some help understanding the way materialized views are applied through adpatch.
In patch 1, we have a mv with build mode immediate. When applying it PTS hang due to pool performance of mv refresh.
So we provide patch 2, with that mv build mode deferred, hoping it'll go through. But patch 2 hang too on the same mv.
How does this work? Is that because mv already exists in the database with build immediate, patch 2 will force it to refresh first before changing build mode? How to get over this?
Thanks,
WeiHi Hussein,
Thank you for the response.
Application release is 11.5.10.
Patch 1 is MSC11510: 8639586 ASCP ENGINE RUP#38 PATCH FOR 11.5.10 BRANCH
Patch 2 is MSC11510: 9001833 APCC MSC_PHUB_CUSTOMERS_MV WORKER IS STUCK ON "DB FILE SEQUENTIAL READ" 12 HOURS
The MV is APPS.MSC_PHUB_CUSTOMERS_MV
This happens at customer environment but not reproducable in our internal environment, as our testing data is much smaller.
Taking closer look in the logs, I saw actually when applying both patch 1 and patch 2, MV doesn't exist in the database. So seems my previous assumption is wrong. Still, strange that patch 2 contains only one file which is the MV.xdf, it took 7 hours and finally got killed.
-- patch 1 log
Materialized View Name is MSC_PHUB_CUSTOMERS_MV
Materialized View does not exist in the target database
Executing create Statement
Create Statement is
CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
TABLESPACE "APPS_TS_SUMMARY"
BUILD IMMEDIATE
USING INDEX
REFRESH FORCE ON DEMAND
WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS select distinct
from
dual
AD Worker error:
The above program failed. See the error messages listed
above, if any, or see the log and output files for the program.
Time when worker failed: Tue Feb 02 2010 10:01:46
Manager says to quit.
-- patch 2 log
Materialized View Name is MSC_PHUB_CUSTOMERS_MV
Materialized View does not exist in the target database
Executing create Statement
Create Statement is
CREATE MATERIALIZED VIEW "APPS"."MSC_PHUB_CUSTOMERS_MV"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 10 MAXTRANS 255 LOGGING
STORAGE(INITIAL 4096 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 4 FREELIST GROUPS 4 BUFFER_POOL DEFAULT)
TABLESPACE "APPS_TS_SUMMARY"
BUILD DEFERRED
USING INDEX
REFRESH COMPLETE ON DEMAND
WITH ROWID USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS select distinct
from dual
Start time for statement above is Tue Feb 02 10:05:06 GMT 2010
Exception occured ORA-00028: your session has been killed
ORA-00028: your session has been killed
ORA-06512: at "APPS.AD_MV", line 116
ORA-06512: at "APPS.AD_MV", line 258
ORA-06512: at line 1
java.sql.SQLException: ORA-00028: your session has been killed
ORA-00028: your session has been killed
ORA-06512: at "APPS.AD_MV", line 116
ORA-06512: at "APPS.AD_MV", line 258
ORA-06512: at line 1
Exception occured :No more data to read from socket
AD Run Java Command is complete.
Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA
AD Java
Version 11.5.0
NOTE: You may not use this utility for custom development
unless you have written permission from Oracle Corporation.
AD Worker error:
The above program failed. See the error messages listed
above, if any, or see the log and output files for the program.
Time when worker failed: Tue Feb 02 2010 19:51:27
Start time for statement above is Tue Feb 02 12:44:52 GMT 2010
End time for statement above is Tue Feb 02 19:51:29 GMT 2010
Thanks,
Wei -
Hello, please help, my interface is connected to the microphone and when i open Logic 9 it does´t work. But I opened garageband to check and it works fine. I can record voice with any effect... With Logic i see the sound passes in the interface but does not arrive in Logic. The Loops works fine and i can hear. Is just the sound to record the voice it does not work. What can i do ??? I used Logic before in the same computer and it worked fine. Thank you so much, I´m a begginer recording myself.
Make sure you go into preferences in Logic and set the audio input to be your interface and the audio output to be either built in output or the interface, if that is hooked up to something else. It sounds like Garageband has the audio interface set as the input but not Logic.
Also make sure you close all other applications except Logic to ensure it is not running in slave mode... -
Trying to Understand Interfaces
Hi all,
As you might expect, I am new to JAVA. I have read the basics tutorial on interfaces and also the object oriented programming basics tutorial. I understand that you can't implement methods or variables in interfaces, etc. Here is what I am struggling with:
A friend has written a class that uses the JNDI classes to query an LDAP service for person information and update database information. I notice that the query returns an object of type NamingEnumeration. But this is an interface, not a class. When he gets the items/elements from the Enumeration, he uses a (Attributes) to cast the results to their proper type.
So, if I am writing a class and want to implement the NamingEnumeration interface over my class... and if I want to retrieve that class by its NamingEnumeration interface, rather than its actual class...how would I create a method that does this.
My first attempt at creating this class went like this:
public class DocumentEnumeration extends DocumentCollection implements NamingEnumeration
If I called the .next method of my class, I would return a type Document. So far I don't know how to retrieve this DocumentEnumeration as a NamingEnumeration, and I received an error in my IDE about the constructor with arguments () is not visible. I did not understand this error either.
Any help would be appreciated,
JeffDrClap's responses are all correct and to the point. Let me add a preface. Forget everything you've read, close your eyes and say "interfaces are dead simple!" about a hundred times. They are.
An interface is a bundle of related capabilities. For example, I am a male homo sapiens (my class). I ski and play tennis - these are things I can do. As a Skier I have methods like buckleBoots(), getOnLift(), getOffLift() and skiDownHill(). All skiers implement these methods.
TennisPlayers implement a different set of methods: serve(), volley() and so on. Some TennisPlayers may also implement Skier and some Skiers may implement TennisPlayer, but if an object of class LiftAttendant is going to call our getOnLift() method, it doesn't care about serve() or volley(). It knows that we have the handful of methods that concern LiftAttendants.
Note that many different classes can implement an interface. Certainly some female homo sapiens implement Skier. I've also seen some apes and hot dogs implementing Skier.
The Runnable interface defines just one method: public void run(). A Runnable is any class that claims it implements Runnable. If the class declaration claims that it implements Runnable, the compiler won't generate a .class file unless the class defines a public void run() method. When you pass a Runnable to a Thread, the Thread knows exactly one thing about the Runnable, that it has a public void run() method which the Thread can call after it is started. The Thread has no clue what it might be running, but because the object is a Runnable it can correctly call whatever.run().
Why might a well-written method return an Interface type, not a class? Generality. The LiftAttendant need only know that an object has a getOnLift() method. So anything the implements Skier will be fine for the LiftAttendant.
So an interface defines a set of methods (as few as one) that, taken together, constitute a capability. A class that implements these methods can claim to implement the interface, and other objects that care about that capability can say they work with Skier, or Runnable or whatever, so that they can handle lots of different things, not worrying about all the other things their Objects might implement or be.
Very simple. Very powerful. -
Another TCP Reassembly Queue Issue - Help Understanding Sh IP Traffic Results
I recently started seeing the TCP Out-of-Order blurbs on my 1921/k9 routers logs. See following....
*Oct 28 06:41:32.793: %FW-4-TCP_OoO_SEG: Dropping TCP Segment: seq:-1475532578 1500 bytes is out-of-order; expected seq:2819411594. Reason: TCP reassembly queue overflow - session 192.168.10.11:58675 to 23.77.232.34:80 on zone-pair ccp-zp-in-out class ccp-protocol-http
*Oct 28 15:09:21.539: %FW-4-TCP_OoO_SEG: Dropping TCP Segment: seq:79628295 1488 bytes is out-of-order; expected seq:79600783. Reason: TCP reassembly queue overflow - session 192.168.10.25:55690 to 206.19.48.10:80 on zone-pair ccp-zp-in-out class ccp-protocol-http
*Oct 28 15:16:44.803: %FW-4-TCP_OoO_SEG: Dropping TCP Segment: seq:-1210068379 1500 bytes is out-of-order; expected seq:3084764253. Reason: TCP reassembly queue overflow - session 192.168.10.13:50591 to 107.167.193.162:80 on zone-pair ccp-zp-in-out class ccp-protocol-http
I temporarily disabled TCP Queue length logs (setting to 0) after having changed to several options including 128 and 1024 did not help. The output of Sh IP Traffic....
"Router#sh ip traffic
IP statistics:
Rcvd: 411466 total, 163659 local destination
0 format errors, 0 checksum errors, 2 bad hop count
0 unknown protocol, 1 not a gateway
0 security failures, 0 bad options, 0 with options
Opts: 0 end, 0 nop, 0 basic security, 0 loose source route
0 timestamp, 0 extended security, 0 record route
0 stream ID, 0 strict source route, 0 alert, 0 cipso, 0 ump
0 other
Frags: 0 reassembled, 0 timeouts, 0 couldn't reassemble
0 fragmented, 0 fragments, 0 couldn't fragment
Bcast: 162854 received, 415 sent
Mcast: 0 received, 0 sent
Sent: 5560 generated, 18211176 forwarded
Drop: 22 encapsulation failed, 0 unresolved, 0 no adjacency
2383 no route, 0 unicast RPF, 0 forced drop
0 options denied
Drop: 0 packets with source IP address zero
Drop: 0 packets with internal loop back IP address
0 physical broadcast
ICMP statistics:
Rcvd: 0 format errors, 0 checksum errors, 0 redirects, 0 unreachable
11 echo, 0 echo reply, 0 mask requests, 0 mask replies, 0 quench
0 parameter, 0 timestamp, 0 timestamp replies, 0 info request, 0 other
0 irdp solicitations, 0 irdp advertisements
0 time exceeded, 0 info replies
Sent: 2028 redirects, 2809 unreachable, 35 echo, 11 echo reply
0 mask requests, 0 mask replies, 0 quench, 0 timestamp, 0 timestamp replies
0 info reply, 2 time exceeded, 0 parameter problem
0 irdp solicitations, 0 irdp advertisements
BGP statistics:
Rcvd: 0 total, 0 opens, 0 notifications, 0 updates
0 keepalives, 0 route-refresh, 0 unrecognized
Sent: 0 total, 0 opens, 0 notifications, 0 updates
0 keepalives, 0 route-refresh
PIMv2 statistics: Sent/Received
Total: 0/0, 0 checksum errors, 0 format errors
Registers: 0/0 (0 non-rp, 0 non-sm-group), Register Stops: 0/0, Hellos: 0/0
Join/Prunes: 0/0, Asserts: 0/0, grafts: 0/0
Bootstraps: 0/0, Candidate_RP_Advertisements: 0/0
Queue drops: 0
State-Refresh: 0/0
IGMP statistics: Sent/Received
Total: 0/0, Format errors: 0/0, Checksum errors: 0/0
Host Queries: 0/0, Host Reports: 0/0, Host Leaves: 0/0
DVMRP: 0/0, PIM: 0/0
Queue drops: 0
TCP statistics:
Rcvd: 39 total, 0 checksum errors, 37 no port
Sent: 2 total
EIGRP-IPv4 statistics:
Rcvd: 0 total
Sent: 0 total
UDP statistics:
Rcvd: 163487 total, 0 checksum errors, 162603 no port
Sent: 695 total, 0 forwarded broadcasts
OSPF statistics:
Last clearing of OSPF traffic counters never
Rcvd: 0 total, 0 checksum errors
0 hello, 0 database desc, 0 link state req
0 link state updates, 0 link state acks
Sent: 0 total
0 hello, 0 database desc, 0 link state req
0 link state updates, 0 link state acks
ARP statistics:
Rcvd: 3651888 requests, 72 replies, 0 reverse, 0 other
Sent: 159 requests, 28560 replies (225 proxy), 0 reverse
Drop due to input queue full: 0"
Would someone be so kind as to help me understand a little about my IP Traffic and what might be going wrong? Thanks for any input. --TimWith Queue Length set to 1024:
Router>show ip inspect statistics
Interfaces configured for inspection 4294967294
Session creations since subsystem startup or last reset 0
Current session counts (estab/half-open/terminating) [0:0:0]
Maxever session counts (estab/half-open/terminating) [0:0:0]
Last session created never
Last statistic reset never
Last session creation rate 0
Maxever session creation rate 0
Last half-open session total 0
TCP reassembly statistics
received 0 packets out-of-order; dropped 0
peak memory usage 0 KB; current usage: 0 KB
peak queue length 0 -
Need help understanding instanceof
I understand that instanceof can be used to compare an object reference to see if it is of a particular class or interface. However, in creating the following test I was confounded as to why I would get the error I did. Can anyone help explain?
class A implements Runnable {
public void run() {
class B extends A {
public static void main(String args[]) {
B barr[] = new B[5];
if (barr instanceof B) System.out.println("barr is-a B");
if (barr instanceof A) System.out.println("barr is-a A");
if (barr instanceof Runnable) System.out.println("barr is-a Runnable");
if (barr instanceof Object) System.out.println("barr is-a Object");
}I got the following error while compiling:
iof.java:10: inconvertible types
found : B[]
required: B
if (barr instanceof B) System.out.println("barr is-a B");
^
iof.java:11: inconvertible types
found : B[]
required: A
if (barr instanceof A) System.out.println("barr is-a A");
^
iof.java:12: inconvertible types
found : B[]
required: java.lang.Runnable
if (barr instanceof Runnable) System.out.println("barr is-a Runnable");
^
3 errorsNow, shouldn't this be comparing the object being referenced (a B[] object) to the specified class/interface? Why would it complain? I know replacing barr with barr[0] will compile as it is comparing a specific object reference but why won't the array object refrence work?So, the comparison (barr instanceof A[]) will
return true;Yeah, but the question is, why does "barr instanceof B" give a compile-time error. This surprised me also, as I thought you could put anything on both sides of instanceof (except primitives, and I guess not null on the right) and it would be fine.
Change the declaration of barr to Object barr = new B[5]; and it will compile.
Why?
Well, I'm only guess here, but I imagine it's because, in your original code, the compiler knows that barr is a B[] (becuase that's what it's declared as), so it knows it can never be a B or an A. However, if you declare barr as an Object (or any superclass or superinterface of, say, A), then there is a possibility that barr could get a value that happens to refer to an A, and the compiler doesn't look at all the assignments, only the declared type.
I bet if you look at instanceof in the JLS, it will tell you (in more precise language than I can) the the thing on the RHS has to be assigment-compatible to the thing on the LHS. (Or is it vice versa?)
Maybe you are looking for
-
HT204266 why am I being charged for things I have not Purchase
I have just checked my bank account to fine money going out that I have not ok why is this
-
It costs ~£250 here, but ~£180 ($299) there? It doesn't seem fair! I can not understand what it is that is making it so much more expensive in the UK? Is there any way I can order one from America and get it shipped to the UK? That will still cost le
-
Connect my macbook to my LCD TV
Does somebody knows what cable i have to buy if i want to connect my Mac-screen to my LCD TV? On this way is it also possible to listen the music on my tv? Thanks a lot for your answers..
-
Hi, Is there a way to call an abap object oriented method asynchronously which would further help in parallel processing? Thanks, Subhrendu
-
Alpha channel movie issues?
I am starting this thread to see if there's a pattern here. I sell QT timers on my web site and someone e-mailed me today to say that the timer doesn't work in Keynote 4...the timers have a transparent background and for some reason, because of that,