Help in implementing interface

I'm a newbie to Java Programming, and I'm faced with a assignment thats require me to implement in JAVA...help desperatly needed.
I post the coding which i have to implement, and this is part of the many i needed to implement. I needed to sample solution to this and I will try to get on from there. Any reply is appreciated.
package graphs;
public interface Edge {
// Returns node that this edge starts from.
// Preconditions:
// None.
// Postconditions:
// None.
public Node fromNode();
// Returns node that this edge points to.
// Preconditions:
// None.
// Postconditions:
// None.
public Node toNode();
// Set the label of this edge.
// Precondtions:
// None.
// Postconditions:
// None.
public void setLabel(Object l);
// Returns the label of this edge.
// Precondtions:
// None.
// Postconditions:
// None.
public Object getLabel();
package graphs;
public interface Node {
public void setLabel(Object l);
public Object getLabel();
e.g of calling class
// Returns unique identity of edge e in the graph.
// Preconditions:
// + The edge e must be an edge of the graph ( hasEdge(e) == true )
// => throws NoSuchEdge on violation.
// Postconditions:
// - The returned integer is in the range 0 ... numEdges() -1
// ( Result >= 0 && Result < numEdges() ).
public int id(Edge e);
// Returns the edge with unique identity id in the graph.
// Preconditions:
// + The graph must contain at least one edge ( numEdges() > 0 )
// throws NoEdges on violation.
// + id must be in the range 0..numEdges() - 1 ( id >= 0 &&
// id < numEdges() ) throws IdOutOfRange on violation.
// Postconditions
// - The returned edge is an edge in the graph ( hasEdge(Result) == true ).
public Edge getEdge(int id);
Regards

package graphs;
public interface Edge {
// Returns node that this edge starts from.
// Preconditions:
// None.
// Postconditions:
// None.
public Node fromNode();
// Returns node that this edge points to.
// Preconditions:
// None.
// Postconditions:
// None.
public Node toNode();
// Set the label of this edge.
// Precondtions:
// None.
// Postconditions:
// None.
public void setLabel(Object l);
// Returns the label of this edge.
// Precondtions:
// None.
// Postconditions:
// None.
public Object getLabel();
package graphs;
public interface Node {
public void setLabel(Object l);
public Object getLabel();
package graphs;
// Interface for the graph ADT.
// Design by contract style assertions are used to specify semantic
// properties for classes implementing this interface.
// In the absence of language support for assertions, implementing
// classes should check the assertions - implmenting classes extending
// the GraphBase abstract class will automatically include such checks.
// * Nodes within a graph are identified by ids that are unique for
// all nodes in that graph.
// * The ids for nodes with a graph are the integers from 0 to numNodes()-1
// inclusive.
// * A given node is a member of one and only one graph.
// * Edges within a graph are identifed by the ids of the nodes associated
// with the edge
// and by ids that are unique for all edges in that graph.
// * The ids for edges with a graph are the integers from 0 to numEdges()-1
// inclusive.
// * A given edge is a member of one and only one graph.
// * There are no relationships between graphs.
// ALTERNATIVE SPECIFICATION (DO NOT IMPLEMENT)
// * Nodes within a graph are identified by ids that are unique for all
// nodes in that graph.
// * The ids for nodes within a graph are the integers from 0 to
// numNodes()-1 inclusive.
// * A node with id x is a member of any graph having at least x+1 nodes.
// * Edges within a graph are identifed by the ids of the nodes associated
// with the edge and by ids that are unique for all edges in that graph.
// * The ids for edges with a graph are the integers from 0 to numEdges()-1
// inclusive.
// * A given edge e is a member of any graph having:
// - the two nodes associated with e as members.
// - an edge from the first of those two nodes to the second of those
// two nodes.
// * Relationships between graphs may be defined as for sets.
// END OF ALTERNATIVE SPECIFICATION
public interface Graph {
// Number of vertices (nodes).
// Preconditions:
// None.
// Postconditions:
// - The return value >= 0 ( Result >= 0 ).
public int numNodes();
// Return number of edges in the graph.
// Preconditions:
// None.
// Postconditions:
// - The return value >= 0 ( Result >= 0 ).
public int numEdges();
// Indicates whether node n is in the graph.
// Preconditions:
// + The node n is non null ( n != null ).
// Postconditions:
// None.
public boolean hasNode(Node n);
// Indicates whether edge e is in the graph.
// Preconditions:
// + The edge e is non null ( e != null ) => throws NullEdge on violation.
// Postconditions:
// None.
public boolean hasEdge(Edge e);
// Indicates whether there is an edge from node n1 to node n2 in the graph.
// Preconditions:
// + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
// => throws NoSuchNode on violation.
// Postconditions:
// None.
public boolean hasEdge(Node n1, Node n2);
// Returns unique identity of node n in the graph.
// Preconditions:
// + The node n must be a node of the graph ( hasNode(n) == true )
// => throws NoSuchNode on violation.
// Postconditions:
// - The returned integer is in the range 0 ... numNodes() - 1
// ( Result >= 0 && Result < numNodes() ).
public int id(Node n);
// Returns the node with unique identity id in the graph.
// Preconditions:
// + id must be in the range 0..numNodes() - 1 ( id >= 0 &&
// id < numNodes() ) throws IdOutOfRange on violation.
// Postconditions:
// - The returned node is a node in the graph ( hasNode(Result) == true ).
public Node getNode(int id);
// Returns unique identity of edge e in the graph.
// Preconditions:
// + The edge e must be an edge of the graph ( hasEdge(e) == true )
// => throws NoSuchEdge on violation.
// Postconditions:
// - The returned integer is in the range 0 ... numEdges() -1
// ( Result >= 0 && Result < numEdges() ).
public int id(Edge e);
// Returns the edge with unique identity id in the graph.
// Preconditions:
// + The graph must contain at least one edge ( numEdges() > 0 )
// throws NoEdges on violation.
// + id must be in the range 0..numEdges() - 1 ( id >= 0 &&
// id < numEdges() ) throws IdOutOfRange on violation.
// Postconditions
// - The returned edge is an edge in the graph ( hasEdge(Result) == true ).
public Edge getEdge(int id);
// Returns the edge from node n1 to node n2 in the graph.
// Preconditions:
// + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
// => throws NoSuchNode on violation.
// + There must be an edge from n1 to n2 in the graph
// ( hasEdge(n1,n2) == true ) => throws NoSuchEdge on violation.
// Postconditions:
// - The returned edge is in the graph ( hasEdge(Result) == true ).
public Edge getEdge(Node n1, Node n2);
// Returns number of edges from node n.
// Precondions:
// The node n is in the graph ( hasNode(n) == true )
// => throws NoSuchNode on violation.
// Postconditions:
// - The return value is in the range 0 ... number of nodes in
// the graph ( Result >= 0 && Result <= numNodes() ).
public int outDegree(Node n);
// Returns number of edges to node n.
// Precondions:
// + The node n is in the graph ( hasNode(n) == true )
// => throws NoSuchNode on violation.
// Postconditions:
// - The return value is in the range 0 ... number of nodes in the
// graph ( Result >= 0 && Result <= numNodes() ).
public int inDegree(Node n);
// Returns first node in the graph (in order of addition).
// Preconditions:
// None.
// Postconditions:
// - The returned node is null if and only if there are no nodes in
// the graph ( ( Result == null ) == ( numNodes() == 0 ) )
// - The returned node is null or is contained in the graph
// ( Result == null || hasNode(Result) == true ).
// - The returned node has an id of 0
// ( Result == null || id(Result) == 0 ).
public Node firstNode();
// Returns first edge in the graph (in order of addtion).
// Preconditions:
// None.
// Postconditions:
// - The returned edge is null if and only if there are no edges in the
// graph ( ( Result == null ) == ( numEdges() == 0 ) )
// - The returned edge is null or is an edge of the graph
// ( Result == null || hasEdge(Result) == true ).
// - The returned edge is null or has an id of 0
// ( Result == null || id(Result) == 0 ).
public Edge firstEdge();
// Returns first edge from the node, n, which is the edge from source n
// with destination node having the smallest id.
// Preconditions:
// + The node n must be a node of the graph
// ( hasNode(n) == true ) => throws NoSuchNode on violation.
// Postconditions:
// - The returned edge is null if and only if there are no edges from
// the node n ( ( Result == null ) == ( outDegree(n) == 0 ) )
// - The returned edge is null or is an edge of the graph
// ( Result == null || hasEdge(Result) == true ).
// - The returned edge is null or points from the node n
// ( Result == null || Result.fromNode() == n ).
public Edge firstEdgeFrom(Node n);
// Returns first edge to the node, n, which is the edge to destination
// n with source node having the smallest id.
// Preconditions:
// + The node n must be a node of the graph
// ( hasNode(n) == true ) => throws NoSuchNode on violation.
// Postconditions:
// - The returned edge is null if and only if there are no edges to
// the node n ( ( Result == null ) == ( inDegree(n) == 0 ) )
// - The returned edge is an edge of the graph
// ( Result == null || hasEdge(Result) == true ).
// - The returned edge points from the node n
// ( Result == null || Result.fromNode() == n ).
public Edge firstEdgeTo(Node n);
// Returns last edge from the node, n, which is the edge from source n
// with destination node having the largest id.
// Preconditions:
// + The node n must be a node of the graph
// ( hasNode(n) == true ) => throws NoSuchNode on violation.
// Postconditions:
// - The returned edge is null if and only if there are no edges from
// the node n ( ( Result == null ) == ( outDegree(n) == 0 ) )
// - The returned edge is null or is an edge of the graph
// ( Result == null || hasEdge(Result) == true ).
// - The returned edge is null or points from the node n
// ( Result == null || Result.fromNode() == n ).
public Edge lastEdgeFrom(Node n);
// Returns last edge to the node, n, which is the edge to destination
// n with source node having the largest id.
// Preconditions:
// + The node n must be a node of the graph
// ( hasNode(n) == true ) => throws NoSuchNode on violation.
// Postconditions:
// - The returned edge is null if and only if there are no edges to
// the node n ( ( Result == null ) == ( inDegree(n) == 0 ) )
// - The returned edge is an edge of the graph
// ( Result == null || hasEdge(Result) == true ).
// - The returned edge points from the node n
// ( Result == null || Result.fromNode() == n ).
public Edge lastEdgeTo(Node n);
// Returns next node in the graph after node n or null if n is the last
// node.
// Preconditions:
// + The node n must be a node of the graph
// ( hasNode(n) == true ) => throws NoSuchNode on violation.
// Postconditions:
// - The returned node is null or is contained in the graph
// ( Result == null || hasNode(Result) == true ).
// - The returned node is null if and only if the node is the node
// having the maximum id
// ( ( Result == null) == ( id(Result) == numNodes() - 1 ) ).
// - The returned node is null or the id of the returned node is
// equal to the id of n + 1
// ( Result == null || id(Result) == id(n) + 1 ).
public Node nextNode(Node n);
// Returns next edge after e or null if e is the last edge.
// Preconditions:
// + The edge e must be an edge of the graph ( hasEdge(e) == true )
// => throws NoSuchEdge on violation.
// Postconditions:
// - The returned edge is null or is contained in the graph
// ( Result == null || hasEdge(Result) == true )
// - The returned edge is null if and only if e is the edge with the
// maximum id
// ( ( Result == null) == ( id(e) == numEdges() -1 ) ).
// - The returned edge is null or the id of the returned edge is equal
// to the id of e +1
// ( Result == null || id(Result) == id(e) + 1 ).
public Edge nextEdge(Edge e);
// Returns next edge from node n after e or null if e is the last such edge.
// Preconditions:
// + The node n must be an edge of the graph ( hasNode(n) == true )
// => throws NoSuchNode on violation.
// + The edge e must be an edge of the graph ( hasEdge(e) == true )
// => throws NoSuchEdge on violation.
// + The edge e must be an edge from the node n ( e.fromNode() == n )
// => throws NoSuchEdge on violation.
// Postconditions:
// - The returned edge is null or is contained in the graph
// ( Result == null || hasEdge(Result) == true )
// - The returned edge is null or is from the node n
// ( Result == null || Result.fromNode() == n ).
// - The returned edge is null or the id of the node to which the
// returned edge points is greater than the id of the node to
// which e points
// ( Result == null || id(Result.toNode()) > id(e.toNode()) ).
public Edge nextEdgeFrom(Node n, Edge e);
// Returns next edge to node n after e or null if e is the last such edge.
// Preconditions:
// + The node n must be an edge of the graph ( hasNode(n) == true )
// => throws NoSuchNode on violation.
// + The edge e must be an edge of the graph ( hasEdge(e) == true )
// => throws NoSuchEdge on violation.
// + The edge e must be an edge to the node n ( e.toNode() == n )
// => throws NoSuchEdge on violation.
// Postconditions:
// - The returned edge is null or is contained in the graph
// ( Result == null || hasEdge(Result) == true )
// - The returned edge is null or is to the node n
// ( Result == null || Result.toNode() == n ).
// - The returned edge is null or the id of the node from which the
// returned edge points is greater than the id of the node
// from which e points
// ( Result == null || id(Result.fromNode()) > id(e.fromNode()) ).
public Edge nextEdgeTo(Node n, Edge e);
// Create and add a node to the graph with label l.
// Preconditions:
// None.
// Postconditions:
// - The number of nodes has increased by one
// ( numNodes() == old( numNodes() + 1 ) ).
// - The returned node is in the graph ( hasNode(Result) ).
// - The id of the returned node is the maximum id for any node in
// the graph ( id(Result) == numNodes()-1 ).
public Node createNode(Object l);
// Create and adds an edge from node n1 to node n2 with label l
// Preconditions:
// + Both nodes must be in the graph ( hasNode(n1) && hasNode(n2) )
// => throws NoSuchNode on violation.
// + There must not already be such an edge in the graph
// ( hasEdge(n1,n2) == false ) => throws DuplicateEdge on violation.
// Postconditions:
// - The number of edges in the graph is increased by one
// ( numEdges() == old(numEdges()) + 1 )
// - The out degree of node n1 is increased by one
// ( outDegree(n1) == old(outDegree(n1)) + 1 )
// - The in degree of node n2 is increased by one
// ( inDegree(n2) == old(inDegree(n2)) + 1 )
// - The returned edge is from node n1 and to node n2
// ( Result.fromNode() == n1 && Result.toNode() == n2 )
// - The returned edge is in the graph ( hasEdge(Result) == true )
// - The returned edge has label lbl ( Result.getLabel().equal(l) ).
// - The id of the returned edge is the maximum id for any edge in
// the graph ( id(Result) == numEdges()-1 ).
// - The returned edge is either the last edge from node n1 or the next
// edge from node n1 after the returned edge points to a node
// having an id that is greater than the id of the node that
// the returned edge points to.
// ( ( nextEdgeFrom(n1,Result) == null ) ||
// ( id((nextEdgeFrom(n1,Result)).toNode())
// > id(Result.toNode()) ) )
// - The returned edge is either the last edge to node n2 or the next
// edge to node n2 after the returned edge points from a node
// having an id that is greater than the id of the node that
// the returned edge points from.
// ( ( nextEdgeTo(n2,Result) == null ) ||
// ( id((nextEdgeTo(n2,Result)).fromNode())
// > id(Result.fromNode()) ) )
// - The returned is either the first edge from node n1 or the id of the
// node the returned edge points to is greater than the id of the
// node the first edge from node n1 points to
// ( ( firstEdgeFrom(n1) == Result ) ||
// ( id((firstEdgeFrom(n1)).toNode())
// < id(Result.toNode()) ) )
// - The returned is either the first edge from node n1 or the id of the
// node the returned edge points to is greater than the id of the
// node the first edge from node n1 points to
// ( ( firstEdgeTo(n2) == Result ) ||
// ( id((firstEdgeTo(n2)).fromNode())
// < id(Result.fromNode()) ) )
public Edge createEdge(Node n1, Node n2, Object l);
import graphs.*;
public class Printer {
private static Graph make() {
     Graph g = new GraphBase(new GraphImp());
     // Create some nodes
     Node first = g.createNode(new Integer(1));
     Node second = g.createNode(new Integer(2));
     Node third = g.createNode(new Integer(3));
     Node fourth = g.createNode(new Integer(4));
     // Create some edges between the nodes
     Edge fs = g.createEdge(first, second, new Integer(1));
     Edge ff = g.createEdge(first, first, new Integer(2));
     Edge ft = g.createEdge(first, third, new Integer(4));
     Edge ts = g.createEdge(third, second, new Integer(3));
     Edge sf = g.createEdge(second, first, new Integer(5));
     Edge s4 = g.createEdge(second, fourth, new Integer(8));
     return g;
protected static void print(Graph g) {
     System.out.println("Nodes: " + g.numNodes() + " Edges: " + g.numEdges());
     // Print graph as a list of adjacency lists.
     System.out.println("\nAdjacency lists:");
     for ( Node node = g.firstNode(); node != null ; node = g.nextNode(node) ) {
     System.out.println("Node " + g.id(node) + " has:");
     // Print the node's out edges
     if ( g.outDegree(node) == 0 ) {
          System.out.println("\tNo out edges");
     } else {
          System.out.print("\t" + g.outDegree(node) + " out edge" + (g.outDegree(node) > 1 ? "s" : "") + ":");
          for ( Edge ed = g.firstEdgeFrom(node); ed != null ; ed = g.nextEdgeFrom(node,ed) ) {
          System.out.print(" (" + g.id(ed.fromNode()) + "->" + g.id(ed.toNode()) + ":" + ed.getLabel().toString() + ")");
          System.out.println("");
     // Print the node's in edges
     if ( g.inDegree(node) == 0 ) {
          System.out.println("\tNo in edges");
     } else {
          System.out.print("\t" + g.inDegree(node) + " in edge"+ (g.outDegree(node) > 1 ? "s" : "") +":");
          for ( Edge ed = g.firstEdgeTo(node); ed != null; ed = g.nextEdgeTo(node,ed) ) {
               System.out.print(" (" + g.id(ed.fromNode()) + "->" + g.id(ed.toNode()) + ":" + ed.getLabel().toString() + ")");
          System.out.println("");
     // Print graph as an adjacency matrix.
     System.out.println("\nAdjacency matrix:");
     for(int col = 0; col < g.numNodes(); col++ ) {
     System.out.print("\t" + col);
     System.out.println("");
     for(int row = 0; row < g.numNodes(); row++ ) {
     System.out.print(row);
     for(int col = 0; col < g.numNodes(); col++ ) {
     if ( g.hasEdge(g.getNode(row), g.getNode(col)) ) {
     System.out.print("\t" + g.getEdge(g.getNode(row), g.getNode(col)).getLabel().toString());
     } else {
     System.out.print("\t-");
     System.out.println("");
     // Print graph as a list of edges
     System.out.println("\nEdge list:");
     for( int edgeId = 0; edgeId < g.numEdges(); edgeId++ ) {
     Edge edge = g.getEdge(edgeId);
     System.out.println("Edge " + edgeId + " from " + g.id(edge.fromNode()) + " to " + g.id(edge.toNode()) + " with label " + edge.getLabel().toString());
public static void main(String[] args) {
     try {
     Graph g = make();
     print(g);          
     } catch(Error e) {
     System.err.println("### Execution terminated with errors ###");
Sorry.. I think the questions that's I posted is not complete... I have input more codes to make it more complete. And many thanks to the person that replied... many thanks and hope you can reply to this. Thanks again.
I need to implement only the GraphImp class and I think it should be
public class GraphImp implements Graph, Node, Edge
Implementing Node and Edge is onl used interally in GraphImp and need not to be public.
Any help is appreciated.. and if possible... good programmers out there... please drop me an email to my problem.... million million thanks..

Similar Messages

  • Implementing interface views

    I have to add a main view to the portfolio items and integrate  the view WI_DMS of the web dynpro component DMS_DPR to the same. When I try to do it, it says  'WI_DMS does not implement a valid interface". Is there any way to implement the valid interface dynamically? PLease help.

    >i have been using ( implementing ) interfaces in the components, for example i used iwd_value_help. however i still have no clarity how WD framework is able to communicate with the component implementing interface iwd_value_help.
    Web Dynpro can create a component usage based upon the interface type alone.  This is very similar to normal ABAP OO when you create/get an instance of a class but only know the interface.  Basically this is polymorphism at the component level.
    >the basic question here is, what is wd framework, is it class implementing interfaces generated when we create views and other stuff. and this class( WD fw ) is going to call these implemented methods of the interface??
    Simple answer: yes, exactly as you describe.  Everything relates back to generated and local classes.  The framework can interact with them becuase all the generated classes implement SAP provide framework interfaces.

  • Public class implements interface

    I am taking my first crack at interfaces: I have superclass A which is a parent of class B, which implements interface C. I need to use class B to make 3 variable instances within class A. I think I will use interface C to make calculations based on the 3 variables. Where do you recommend that I declare and set values for the 3 variables if I need to output the values at the top, in superclass A?
    I'm just a little unclear on pulling these objcts together... thanks in advance.

    I am taking my first crack at interfaces: I have
    superclass A which is a parent of class B, which
    implements interface C. I need to use class B to make
    3 variable instances within class A. I think I will
    use interface C to make calculations based on the 3
    variables. Where do you recommend that I declare and
    set values for the 3 variables if I need to output the
    values at the top, in superclass A?
    I'm just a little unclear on pulling these objcts
    together... thanks in advance. If your variables are going to be used by your superclass A then they had better be declared there. You can work with them whereever you want.
    I'm not sure what you are saying about "...use interface C to make calculations based on the 3 variables." You can't do calculations inside an interface. Furthermore, if B extends A and implements C then A and C are going to be completely separate entities. Any reference to C, even if it is actually an object of type B, will not be able to use anything in A--unless you cast it to B, in which case there is no use in making an interface at all.
    I probably just confused you, but oh well...
    Jeff

  • Perspective for Java technologies : implementing interface on late.

    In Java, to implements the adapter pattern's; we have to create a new class that have a link with the adaptee class and implements the adapter interface.
    class MyAdapter implements IAdapter
          public MyAdapter( Adaptee a );
    }or, if we need protected methods :
    class MyAdapter extends implements IAdapter
         public MyAdapter( Adaptee a );
    }then, to call the method void foo( IAdapter i ); ;
    we have to do xxx.foo( new MyAdapter( adaptee ) );it could be simpler if java allowed to implement interfaces after defining the java class.
    public class Adaptee
    }and then, in another file, something like,
    implementation of  IAdapter for class Adaptee
    }would be equivalent to
    public class Adaptee implements IAdapter
    }The advantage of the first method is that you can adapt very easy external classes from external jar file.
    thank's for coments.

    An interface is a contract which tells the compiler
    that a class that implements it implements a set of
    method signature which perform certain actions.That's right, but my idea is not to change the interface, but to change the external class, making it implements the existing interface.
    If you overlay an interface on someone else's class,
    the signature match (if there is one) could happen by
    coincidence. There's no guarantee that a method with
    a signature that matches one in your interface
    actually has the same function.I didn't say that an external class should be viewed as an interface without a specific implementation of this interface for the external class. But, instead of making a new class extending the first and implementing the interface, just define a specific implementation of the interface for this class, as if it was make at class declaration.

  • Implementation interface

    Hi guys. I have a test on array and inheritance and polymorphism. I didn't quite understand what is the benefit of implementing interfaces.
    Something like this:
    public class static Child extends Parent implement A,B,C
    Where A,B,C are interfaces.
    I need to get this straigth before the final test tomorrow. Thanks a lot.

    By implementing an interface, a class declares what it does. This means that the compiler and other classes can determine whether that class is suitable for some operations.
    So given your example Child which implements interfaces A, B, and C, there could be another class with method:
    public boolean doSomething(A aclass) {
    }This method can be given an instance of your "Child" class, or a different class which also implements the A interface.
    Interfaces say what a class does, as opposed to how it does it.

  • No implementation interfaces created using jaxb 2.0 ?

    Hi,
    I've downloaded the jaxb 2.0 RI and am trying to follow the short tutorial at http://java.sun.com/developer/technicalArticles/WebServices/jaxb/index.html.
    On trying to bind the schema via xsj,sh, which also is meant to generate the implementation interfaces (in an impl directory), I see these aren't created - the other classes are generated OK. Where or how should they be created ?
    thanks

    I am on the same boat. Have you found the answer to this?
    Thanks,
    Juan

  • Need help on implementing the BADI ME_GUI_PO_CUST

    Hi All,
    As per my requirement I need to do Enhancement for Unloading point field on PO.This filed will get all the department numbers applicable for the site on the line item.
    For this I need to Implement the BADI BADI ME_GUI_PO_CUST.
    The Method which needs to be Implemented is : TRANSPORT_TO_DYNP.
    Instructions have been given for the Screen design.
    Can anyone help me (with the sample code how) to Implement this method of the BADI in SE19.
    This BADI method is taking a view as an Input and I am not understanding how to proceed.
    Thanks and Regards,
    Smriti Singh

    Hi,
    my suggestion is to check the standard documentation of the interface IF_EX_ME_GUI_PO_CUST.
    After that you can check the method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP in the example implementation class CL_EXM_IM_ME_GUI_PO_CUST.
    Usefull links:
    [Re: Implementing badi ME_GUI_PO_CUST;
    [Re: ME21N - PO Enhancement using BADI;
    Kind Regards.
    Andrea

  • Implements interface

    Hello,
    I use JDK 5.0 with netbeans 4.0 beta 2
    I get an error when I implement an interface like in this following example:
    public class MyClass extends javax.swing.JPanel implements java.awt.event.KeyListener {
    public MyClass () {
    The text message is:
    MyClassMyClass is not abstract and does not override abstract method key released in java.awt.event.KeyListener
    Thank you for your help
    Claude

    An interface defines a contract with implementors of the interface. An interface may only contain public constants and public, abstract methods. An abstract method is a method declaration with no implementation (code) contained within.
    If you implement an interface in your class, you must exactly duplicate the interface's method signature, including name, any parameters and the return type. Now, you do not necessarily need to actually place any code in the method, but you do at least need to have the method present in your class.
    As an example:
    public interface Foo {
    public void bar()
    public class FooImpl implements Foo {
    final public void bar() {
    // optional code here
    - Saish
    "My karma ran over your dogma." - Anon

  • Need help on implementing all types of footers in one xmlp report

    Hi,
    I'm working on a XMLP report where i've requirement to print different footers as below.
    Footer1 -- First page only footer
    Footer2 -- Last page only footer
    Footer3 -- Regular footer which should be printed on all pages EXCEPT first and last
    Footer4 -- Different from all above and needs to be printed only when it is single page.
    Example#1 : If the output is of single page
    ---> Page starts
    Header
    body
    Footer4 (footer for single page output)
    Example: If the output is of multi page say 3 pages
    ---> Page 1 (first page)
    Header
    body
    Footer1 (first page only footer)
    ---> Page 2
    Header
    body
    Footer3 (regular footer for all pages EXCEPT first and last pages)
    ---> Page 3 (last page)
    Header
    body
    Footer2 (last page only footer)
    Is it possible to implement all these footers in one XMLP report? if yes, it would be a great help if someone shares the logic.
    Thanks,
    Venky

    Hi,
    my suggestion is to check the standard documentation of the interface IF_EX_ME_GUI_PO_CUST.
    After that you can check the method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP in the example implementation class CL_EXM_IM_ME_GUI_PO_CUST.
    Usefull links:
    [Re: Implementing badi ME_GUI_PO_CUST;
    [Re: ME21N - PO Enhancement using BADI;
    Kind Regards.
    Andrea

  • Design Question - Class Must Implement Interface

    I'm not sure how to describe this in summary, really. I'd say that I sort of want multiple inheritance, but I don't want to be shot. :-P So let me describe the situation:
    I have an interface, DataEditingComponent<T>. The idea is that anything implementing the interface is capable of allowing the user to edit an object of type T. For example, a DataEditingComponent<Integer> would allow the user to input an integer. A DataEditingComponent<Map<SomeObj,Integer>> might represent an object capable of editing a table describing the number of instances of SomeObj. You get the idea. DataEditingComponent<T> describes three methods: getEditingData():T, setEditingData(T):void, and getDefaultEditingData():T. I'm assuming you can guess what those do.
    Well, the practical application of this interface is in the use of a Swing application. It provides a very clean and standardized way of adjusting the contents of components which edit data. Obviously, a JTextField would work about as well as a DataEditingComponent<String>, but for more complicated components (DataEditingComponent<GameWorldMap>, for instance), the standardized interface is very helpful.
    Since in practice everything that ever implements DataEditingComponent<T> extends JComponent, it would be nice to declare this as a requirement somehow. However, given that JComponent is extended into a number of various subclasses, I can't just go making DataEditingComponent<T> an abstract subclass.
    So far, the only conclusion I've reached is that I can take each and every JComponent subclass and extend it into an abstract subclass which implements DataEditingComponent<T>... but that's very ugly and quickly leads to other problems. And presently, I'm left casting things from one to the other, with which I am also not happy.
    So... any way out of this? Have I done something wrong design-wise? Or am I just stuck in a language limitation?
    Thanks for reading!

    I'm not sure how to describe this in summary, really.
    I'd say that I sort of want multiple inheritance,
    but I don't want to be shot. :-P So let me
    describe the situation:
    I have an interface, DataEditingComponent<T>. The
    idea is that anything implementing the interface is
    capable of allowing the user to edit an object of
    type T. For example, a DataEditingComponent<Integer>
    would allow the user to input an integer. A
    DataEditingComponent<Map<SomeObj,Integer>> might
    represent an object capable of editing a table
    describing the number of instances of SomeObj. You
    get the idea. DataEditingComponent<T> describes
    three methods: getEditingData():T,
    setEditingData(T):void, and
    getDefaultEditingData():T. I'm assuming you can
    guess what those do.
    Well, the practical application of this interface is
    in the use of a Swing application. It provides a
    very clean and standardized way of adjusting the
    contents of components which edit data. Obviously, a
    JTextField would work about as well as a
    DataEditingComponent<String>, but for more
    complicated components
    (DataEditingComponent<GameWorldMap>, for instance),
    the standardized interface is very helpful.
    Since in practice everything that ever implements
    DataEditingComponent<T> extends JComponent, it would
    be nice to declare this as a requirement somehow.
    However, given that JComponent is extended into a
    number of various subclasses, I can't just go making
    DataEditingComponent<T> an abstract subclass.
    So far, the only conclusion I've reached is that I
    can take each and every JComponent subclass and
    extend it into an abstract subclass which implements
    DataEditingComponent<T>... but that's very ugly and
    quickly leads to other problems. And presently, I'm
    left casting things from one to the other, with which
    I am also not happy.
    So... any way out of this? Have I done something
    wrong design-wise? Or am I just stuck in a language
    limitation?Hmm. The component is part of the view. The data is part of the model. Putting them together seems to go against the whole Model-View-Controller concept. You may want to have a look at how Swing separates the editing from the rendering from the model for complicated widgets such as JTable. The editors hava methods such as getEditorComponent() which returns the Component used to edit the data. Everywhere you are currently adding DataEditingComponent instances to your GUI, you can instead call a getDataEditingComponent() method, which can require that the returned object is a JComponent.

  • Implementing interface using Oracle Fusion

    Hey All, my company is responding to a tender but one of the things it specifies is that if any middleware is required it should be implemented using Oracle Fusion.
    Up until this point I'd never even heard of Oracle Fusion but am trying to get up to speed fast, I need to know just enough to know we can do it and how hard it would be.
    To my question then, I guess they want us to use Fusion to build the interface between their existing app and ours, but Fusion seems to be a big stack of products... Can anybody point me to the specific product we would be using to build something like that, and some good resources to get an understanding of it. Also what is the learning curve like with this product suite?
    Any help appreciated.
    Martyn

    Hi Martyn,
    Fusion Middleware is a big stack but for integrations you can use SOA suite (or AIA). This in turn is a collection of multiple components. See below for some guidance.
    http://docs.oracle.com/cd/E21764_01/integration.1111/e10223/index.htm
    http://www.oracle.com/us/technologies/soa/soa-suite/oracle-soa-suite-11g-198758.pdf
    Regards,
    Neeraj Sehgal

  • Implement interface with static variable

    Hello all
    I want to create a class that has a static variable. In this class I also want to create a static function to change this static value. So I donot have to create any object when change the static variable.
    My problem is that this class should implement an interface (using facade pattern). As it implements an interface, it cannot have any static function in it.
    How I can overcome this problem. please help
    Many thanks
    shuhu

    My problem is that this class should implement an interface (using facade pattern).
    As it implements an interface, it cannot have any static function in it.Any class (including one that implements an interface) can have static methods.
    Do you mean you want the static method to be part of the interface? In this case you have a problem. Perhaps you should use an abstract class instead of an interface (the class could possibly implement the interface). Or perhaps you should rethink the need to have a static method.

  • Implementing interfaces and packages part deux

    Ok, I've been reading some more posts, and it seems like a lot of people have the same issues as I have right now.
    One suggestion that i read was to go into the directory that is the package name.
    That is if everything is in package Grid, then go into ./src/Grid directory and then do a javac *.java
    when I do that, all my code, even the one that implements an interface will compile. But when I don't do *.java within the /Grid directory, and lets say I am in the ./src directy and I do a javac Grid.Cell (where Cell is the class name), the program will not compile. Why is that...I haven't found a good answer as to why this isn't working yet. Please please help.

    I wont get into your directory structure bcz its makin me dizzy..
    hopefully it is ok.
    can you see a difference between these 2 lines that you say you have tried:
    javac *.java <<<< u said compiles
    javac Grid.Cell <<<< u said doesnt compile
    Two things come to mind:
    1.javac needs the .java extension to compile
    2.you need to be IN the directory where the source is to compile
    k?
    try it...

  • Class implementing interface using generics

    I have an interface that looks like this:
    public interface BinaryTree<T extends Comparable<? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty();
         public boolean search(T key);
         public void remove ( T key ) throws TreeException;
         public void insert(T key) throws TreeException;
         public void print ( TraverseOrder order);
         public int getSize();
    }My shell class that implements it looks like this:
    public interface BinaryTree<T extends Comparable<? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty(){
                      return true;
         public boolean search(T key) {
                      return true;
         public void remove ( T key ) throws TreeException {
         public void insert(T key) throws TreeException {
         public void print ( TraverseOrder order) {
         public int getSize() {
                        return 0;
    }Im getting 2 errors one being
    BST.java:1: > expected
    public class BST implements BinaryTree<T extends Comparable<? super T>> {
    and the other is an enum error. Im pretty sure the second enum error will be resolved by fixing the first error. Any help is apreciated. Thanks
    BLADE

    Yeah tottaly right but the code i posted is wrong sorry lets try one more time
    public interface BinaryTree<T extends Comparable><? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty();
         public boolean search(T key);
         public void remove ( T key ) throws TreeException;
         public void insert(T key) throws TreeException;
         public void print ( TraverseOrder order);
         public int getSize();
    public class BST implements BinaryTree<T extends Comparable><? super T>> {
         public enum TraverseOrder { PREORDER, INORDER, POSTORDER }
         public boolean isEmpty(){
                      return true;
         public boolean search(T key) {
                      return true;
         public void remove ( T key ) throws TreeException {
         public void insert(T key) throws TreeException {
         public void print ( TraverseOrder order) {
         public int getSize() {
                        return 0;
    }

  • Need help to implement datamart or datawarehouse

    Hi all,
    we want to improve our reporting activities, we have 3 production and relational oracle databases and we want to elaborate 1 database as reporting database with historized and aggregated data responding to our reporting needs.
    The database we are using are oracle database 10g.
    actually we still are doing query to retrieve informations from databases for reporting purpose, but fropm inetrnet search i know that we can implement datamart or datawarehouse to group all aggregated information for reporting.
    The information i need are: is there a tools in Oracle for Datawarehousing, Is Oracle Warehouse Builder is the right tools as the sources of our data are all from Oracle database and some flat files.
    Could yo advise what i'm going to use for that kind of reporting needs, can i use Oracle warehosue builder to develop ETl ...
    Do i need license to use Oracle Warehose Builder
    Thanks you for your help.

    For OWB and Database and Datawarehouse , I would recomend the Oracle ' Documentation
    http://www.oracle.sh.cn/nav/portal_6.htm
    Then for tutirials check this (Database and OWB)
    http://www.oracle.com/technology/obe/start/index.html
    For OBIEE
    http://download.oracle.com/docs/cd/E10415_01/doc/index.htm
    What is the meaning of OBIEE is it Oracle Business Intelligence Enterprsie EditionYes
    Cheers
    Nawneet
    (Mark the asnwer as helpful of correct if it is)

Maybe you are looking for