How to Clone  inherited Object ?

According to the rule of cloning a object can be cloned only if
it implements Cloneable interface ? In the following example
class B extends class A which does not implement Cloneable interface,class B does implement Cloneable interface.
when I try to clone an object of class A in class B it is very
allowing to be cloned which is a contradictary?Please go through the
example and suggest what is wrong ?
class A
int v = 100;
public Object Clone()
return new A();
class B extends A implements Cloneable
public static void main(String args[])
A a = new A();
A b = null;
b = (A)a.clone();
System.out.println("Value of v1 :" +a.v1);
System.out.println("Value of v1 :" +b.v1);
Thanks for your valuable help

According to the rule of cloning a object can be
cloned only if
it implements Cloneable interface ? In the following
example
class B extends class A which does not implement
Cloneable interface,class B does implement Cloneable
interface.
when I try to clone an object of class A in class B it
is very
allowing to be cloned which is a contradictary?Please
go through the
example and suggest what is wrong ?
class A
int v = 100;
public Object Clone()
return new A();
class B extends A implements Cloneable
public static void main(String args[])
A a = new A();
A b = null;
b = (A)a.clone();
System.out.println("Value of v1 :" +a.v1);
System.out.println("Value of v1 :" +b.v1);
Thanks for your valuable helpApart the fact that like that program cannot function, you didn't clone anything. You've just created another instance of class A!
Cloning means to create a copy of an existing object with aonother one having exact members (name, value, behaviour) like the first one!
Try to replace this piece of code:
A a = new A();
a.v = 500;
A b = null;
b = (A)a.clone();
System.out.println("Value of a.v :" +a.v);
System.out.println("Value of b.v :" +b.v);
and write "Clone" method like this: "clone". See that you'll obtain:
Value of a.v :500
Value of a.v :100
good luck!
m

Similar Messages

  • How to clone a user-defined object?

    Hello,
    I need to clone an Object[] array (propArray) that holds objects of Integer, Double, Boolean type, along with objects of user-defined ClassA, ClassB, ClassC type. The matter is that the ClassA object isn't being cloned, while the rest of the user-defined objects are cloned just fine.
    In more detail, ClassA has two properties:
    public class ClassA implements Cloneable{
       private String penaltyFor;
       private Penalty[] penaltyArray;
       protected Object clone(){
          try{
             ClassA o = (ClassA)super.clone();
             o.penaltyFor = this.penaltyFor;
    //         o.penaltyArray = (Penalty[])penaltyArray.clone();  //This ain't working.
             //But neither does this :(.
             int penCount = this.penaltyArray.length;
             o.penaltyArray = new Penalty[penCount];
             for(int i = 0; i < penCount; i++)
                o.penaltyArray[i] = (Penalty)this.penaltyArray.clone();
    return o;
    } catch(CloneNotSupportedException e){ throw new InternalError(); }
    The Penalty class contains properties of primitive type and here is its clone() method:
    public class Penalty implements Cloneable{
       private String penaltyDesc;
       private int lowLimit, upperLimit, penaltyValue;
       protected Object clone(){
          try{
             Penalty o = (Penalty)super.clone();
             o.penaltyDesc = this.penaltyDesc;
             o.lowLimit = this.lowLimit;
             o.upperLimit = this.upperLimit;
             o.penaltyValue = this.penaltyValue;
             return o;
          } catch(CloneNotSupportedException e){ throw new InternalError(); }
       }I don't know what else to try. I suppose the problem is the Penalty[] array, but I may be wrong. An alternative would be to use Copy Constructors, but it will cause too many changes to the code, since the clone() method is used for the propArray copy in many places and the ClassA object is a late addition to the propArray (unfortunately it wasn't planned to exist from the beginning).
    Thank's.

    class ClassA implements Cloneable{
       private String penaltyFor;
       private Penalty[] penaltyArray;
       public Object clone(){
          try{
             ClassA o = (ClassA) super.clone();
             if (penaltyArray!=null){
                o.penaltyArray = (Penalty[]) penaltyArray.clone();
                for(int i = 0; i < penaltyArray.length; i++) {
                    Penalty penalty = this.penaltyArray;
    if (penalty!=null)
    o.penaltyArray[i] = (Penalty) penalty.clone();
    return o;
    } catch(CloneNotSupportedException e){
    throw new InternalError();
    class Penalty implements Cloneable{
    private String penaltyDesc;
    private int lowLimit, upperLimit, penaltyValue;
    public Object clone(){
    try{
    return super.clone();
    } catch(CloneNotSupportedException e){
    throw new InternalError();
    If your Penalties are immutable, you don't need to clone them -- rather,
    make then unclonable, like Strings.

  • How To Clone Objects?

    Hi folks,
    I'd like to know, if there is a way to clone any object in ABAP? Using implemented interface method if_os_clone~clone is nice, but doesn't help me, because it works only for classes that have implemented corresponding interface. For example it doesn't help me to clone objects of class 'TYPE REF TO DATA'.

    You're right, 'TYPE REF TO DATA' isn't a class. Forget this point!
    DATA:
      object1 TYPE REF TO YCLASS,
      object2 TYPE REF TO YCLASS.
    CREATE OBJECT object1.
    object2 = object1.
    In this example object1 and object2 reference to the same instance. But I want to create a copy of object1, so that there are two separate instances of class YCLASS.

  • How to organize Data Objects and other Objects in SWCV

    Hi,
    I am looking for Best Practices on how to organize data objects in SWCV as well as other objects such as a Distribution Rules.
    We are planning to develop three occasionally connected applications with NW Mobile 7.1 this year and maybe additional one the following year. We will create multiple Standard Data Objects (e.g. Plant, Company Code, Reservations, ...) which are shared in the first set of transactions and in the future transactions.
    I have heard before to separate out Standard Data Objects from Distribution Models and have two different SWCV.
    Should I have a) one SWCV for all current and future Standard Data Objects and one for the distribution rtules or b) should I separate out common data objects into one SWCV, and all transaction-specific data object each into separate SWCV?
    Just wondering if there are any best practices available for this so that I won't run into problems in the future when we want to add more transactions/data objects?
    Any advise is appreciated.
    Thanks,
    W. Berger

    Hi Siva,
    Thanks for quick reply!!
    I have created say SWCV1 for Dataobjects.
    Now i want to create seperate SWCV2 for defining distribution model.
    How i should proceed..I cannot see the uses option while creating new SWCV2  ( Only option i see is  'backward compatibility checkbox : uses NW04/NW04s MI Application')
    where to check the following which you have mentioned?
    SWCV2 was created and inherited SWCV1 in uses tab of SWCV2.
    Thanks in advance!!
    Regards
    Devendra

  • Clone an Object

    Hey everyone,
    I just had a question about cloning an object.
    I have an object and within that object there is a field that holds a "date".
    I want to clone the object x number of times (x is user input) and each clone the "date" is the next day.
    So the second clone's "date" value would be the next day after the first clone's "date" value. I also want each clone stored into an array of that object.
    I have a date class and within that date class is a method called "nextDay" which changes the date to the next day.
    I hope that makes sense.
    Anyways, the way I went about it was this:
    Object original = new Object();
    drawCount = user input;
    Object[] array = new Object[drawCount];
    array[0] = original;
    if(drawCountInt > 1)
         for(int j = 1;j <= drawCountInt;j++)
            Object daClone = (Object) original.clone;
            daClone.date = daClone.date.nextDay();
    }Now that seems like it would work once.
    I am trying to figure out, how would I increment the date in a loop?
    I could not figure out a way to use the counter to maybe make the nextDay happen more often.
    I could not also find a way to make a clone of a clone inside a loop and just use the nextDay on that.
    How would I make a clone off the latest clone inside a for or while loop?
    Sorry if any of this seems a little unclear. Feel free to ask questions of course.

    So something like this then?
    if(drawCountInt > 1)
    {     Array[1] = (Object) original.clone;
             for(int j = 1;j <= drawCount;j++)
                       Array[j] = (Objectt) Array[j].clone;
                       Array[j].date = Array[j].date.nextDay();
    }

  • Why clone() in Object Class is protected

    hi,
    Why clone() in Object Class is protected
    Why finalize() in Object Class is protected
    Waiting for your reply
    suresh

    Why clone() in Object Class is protectedObject's clone() is meant to provide a generic cloning facility as the assistance for the types implementing Cloneable but not as a public ready-made method. Object's clone() should be overridden for those types to provide a meaningful implementation (maybe relying on Object's clone). Object's clone() being public were an invitation to try to clone every object, regardless of its being cloneable or not. For a type to be cloneable, it is necesary for this type in implement Cloneable, a no-method interface. While at writing the class and declaring it as Cloneable, it is not much more work to provide a clone() implementation. It is the responsibility of the author of a class to decide whether it should be cloneable and if yes, how it should be cloned.
    Why finalize() in Object Class is protected"finalize" is meant for the VM to invoke is as defined by the specification.
    Encapsulation implies everything should have the smallest scope, the most restrictve access which is still appropriate.

  • How to "Clone Components"

    I've got an aplication witch needs a lot of JButtons all of them with same Text and same Action.
    I created one, how to clone them ?
    Thanks.
    Wmiro

    hi
    for cloning you should override method clone() so that it return same object you desire and same properties as requried ...
    then you invoke this method ..
    it is good for speed and documentation purpose

  • How to clone X and Y axis?

    I have a barChart with overplot a lineChart, two different series
    barChart.getData().addAll(series1);
    lineChart.getData().addAll(series2);My question: is it possible, and how to, clone barChart axis so to get the same settings for lineChart?
    What I would like to have is a perfect axis settings overlapping.
    Thanks

    Hi bouye thanks for your kind reply: following your suggestion I have modified my code but still I have some problem.
    Below is a sample class, it plots a line chart and by clicking the Add Serie button it adds a scatter chart, and it is all fine.
    This class has three mouse events, one for each axis and one chat.
    Charts can be compressed / expanded by left mouse click and drag on X or Y axis, and chart can be moved left/right and up/down by left mouse click and drag anywhere on the chart.
    I get axis out of sync when move or compress/expand chart.
    Can you help me whit this issue?
    Thank you very much
    import java.util.Set;
    import javafx.application.Application;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Side;
    import javafx.scene.Group;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.Node;
    import javafx.scene.chart.*;
    import javafx.scene.control.Button;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.StackPane;
    public class RescalingSeries extends Application {
    StackPane               mainGraphStackPane = null;
    Button btnAdd;
    BorderPane pane;
    XYChart.Series series1 = new XYChart.Series();
    SimpleDoubleProperty rectinitX = new SimpleDoubleProperty();
    SimpleDoubleProperty rectinitY = new SimpleDoubleProperty();
    protected static Axis _duplicateAxis(Axis axis, Axis result) {
            result.setAnimated(axis.animatedProperty().get());
            result.setAutoRanging(axis.isAutoRanging());
            result.setLabel(axis.getLabel());
            result.setSide(axis.getSide());
            result.setTickLabelFill(axis.getTickLabelFill());
            result.setTickLabelFont(axis.getTickLabelFont());
            result.setTickLabelGap(axis.getTickLabelGap());
            result.setTickLength(axis.getTickLength());
            return result;
        protected static ValueAxis _duplicateValueAxis(ValueAxis axis, ValueAxis result) {
            _duplicateAxis(axis, result);
            result.setLowerBound(axis.getLowerBound());
            result.setUpperBound(axis.getUpperBound());
            result.setMinorTickCount(axis.getMinorTickCount());
            result.setMinorTickLength(axis.getMinorTickLength());
            result.setTickLabelFormatter(axis.getTickLabelFormatter());
            return result;
         * Duplicate a number axis.
         * @param axis The source axis.
         * @return A {@code NumberAxis}, never {@code null}.
        public static NumberAxis duplicateNumberAxis(NumberAxis axis) {
            NumberAxis result = new NumberAxis();
            _duplicateValueAxis(axis, result);
            result.setTickUnit(axis.getTickUnit());
            result.setForceZeroInRange(axis.isForceZeroInRange());
            return result;
         * Duplicate a category axis.
         * @param axis The source axis.
         * @return A {@code CategoryAxis}, never {@code null}.
        public static CategoryAxis duplicateCategoryAxis(CategoryAxis axis) {
            CategoryAxis result = new CategoryAxis(axis.getCategories());
            _duplicateAxis(axis, result);
            result.setStartMargin(axis.getStartMargin());
            result.setEndMargin(axis.getEndMargin());
            result.setGapStartAndEnd(axis.gapStartAndEndProperty().get());
            return result;
    @Override
    public void start(Stage stage) {
        final NumberAxis xAxisLC = new NumberAxis(1, 12, 1);
        final NumberAxis yAxisLC = new NumberAxis(0.53000, 0.53910, 0.0005);
        yAxisLC.setSide(Side.RIGHT);
        yAxisLC.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxisLC) {
            @Override
            public String toString(Number object) {
                return String.format("%7.5f", object);
        final LineChart<Number, Number> lineChart = new LineChart<>(xAxisLC, yAxisLC);
        lineChart.setCreateSymbols(false);
        lineChart.setAlternativeRowFillVisible(false);
        lineChart.setAnimated(true);
        lineChart.setLegendVisible(false);
        series1.getData().add(new XYChart.Data(1, 0.53185));
        series1.getData().add(new XYChart.Data(2, 0.532235));
        series1.getData().add(new XYChart.Data(3, 0.53234));
        series1.getData().add(new XYChart.Data(4, 0.538765));
        series1.getData().add(new XYChart.Data(5, 0.53442));
        series1.getData().add(new XYChart.Data(6, 0.534658));
        series1.getData().add(new XYChart.Data(7, 0.53023));
        series1.getData().add(new XYChart.Data(8, 0.53001));
        series1.getData().add(new XYChart.Data(9, 0.53589));
        series1.getData().add(new XYChart.Data(10, 0.53476));
        series1.getData().add(new XYChart.Data(11, 0.530123));
        series1.getData().add(new XYChart.Data(12, 0.531035));
        pane = new BorderPane();
        pane.setCenter(lineChart);
        mainGraphStackPane = new StackPane();
        mainGraphStackPane.getChildren().add(pane);
        Scene scene = new Scene(mainGraphStackPane, 800, 600);
        lineChart.getData().addAll(series1);
        stage.setScene(scene);        
        scene.setOnMouseClicked(mouseHandler);
        scene.setOnMouseDragged(mouseHandler);
        scene.setOnMouseEntered(mouseHandler);
        scene.setOnMouseExited(mouseHandler);
        scene.setOnMouseMoved(mouseHandler);
        scene.setOnMousePressed(mouseHandler);
        scene.setOnMouseReleased(mouseHandler);
        Group root = new Group();
        btnAdd = new Button();
        btnAdd.setText("Add serie");
        root.getChildren().add(btnAdd);
        pane.getChildren().add(root);             
        btnAdd.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {       
                NumberAxis xAxisBC = duplicateNumberAxis(xAxisLC);
                NumberAxis yAxisBC = duplicateNumberAxis(yAxisLC);
                ScatterChart<Number, Number> scatterChart = new ScatterChart<>(xAxisBC, yAxisBC);
                scatterChart.setAlternativeRowFillVisible(false);
                scatterChart.setAnimated(true);
                scatterChart.setLegendVisible(false);
                XYChart.Series series2 = new XYChart.Series();
                series2.getData().add(new XYChart.Data(1, 0.53185));
                series2.getData().add(new XYChart.Data(2, 0.532235));
                series2.getData().add(new XYChart.Data(3, 0.53234));
                series2.getData().add(new XYChart.Data(4, 0.538765));
                series2.getData().add(new XYChart.Data(5, 0.53442));
                series2.getData().add(new XYChart.Data(6, 0.534658));
                series2.getData().add(new XYChart.Data(7, 0.53023));
                series2.getData().add(new XYChart.Data(8, 0.53001));
                series2.getData().add(new XYChart.Data(9, 0.53589));
                series2.getData().add(new XYChart.Data(10, 0.53476));
                series2.getData().add(new XYChart.Data(11, 0.530123));
                series2.getData().add(new XYChart.Data(12, 0.531035));
                scatterChart.getData().addAll(series2);
                Set<Node> chartNode = scatterChart.lookupAll(".chart-plot-background");
                for(final Node chr : chartNode){
                    chr.setStyle("-fx-background-color: transparent;");                          
                chartNode = lineChart.lookupAll(".chart-plot-background");
                for(final Node chr : chartNode){
                    chr.setStyle("-fx-background-color: transparent");                           
                mainGraphStackPane.getChildren().add(scatterChart);
                xAxisBC.lowerBoundProperty().bind(xAxisLC.lowerBoundProperty());
                yAxisBC.lowerBoundProperty().bind(yAxisLC.lowerBoundProperty());     
        stage.show();
    EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent mouseEvent) {
            boolean XScaling=false;
            boolean YScaling=false;
           if (mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED || mouseEvent.getEventType() == MouseEvent.MOUSE_MOVED ){
                LineChart<Number, Number> lineChart = (LineChart<Number, Number>) pane.getCenter();
                NumberAxis yAxis = (NumberAxis) lineChart.getYAxis();
                NumberAxis xAxis = (NumberAxis) lineChart.getXAxis();
                double Tgap = xAxis.getWidth()/(xAxis.getUpperBound() - xAxis.getLowerBound());
                double newXlower=xAxis.getLowerBound(), newXupper=xAxis.getUpperBound();
                double newYlower=yAxis.getLowerBound(), newYupper=yAxis.getUpperBound();
                double xAxisShift = xAxis.localToScene(0, 0).getX();
                double yAxisShift = yAxis.localToScene(0, 0).getY();
                double yAxisStep=yAxis.getHeight()/(yAxis.getUpperBound()-yAxis.getLowerBound());
                double CurrentPrice=yAxis.getUpperBound()-((mouseEvent.getY()-yAxisShift)/yAxisStep);
                double Delta=0.3;
                if(mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED && mouseEvent.getX()<xAxisShift+yAxis.getHeight() && mouseEvent.getY()<yAxisShift+yAxis.getHeight() && (XScaling==false || YScaling==false)){
      //==================================================== X-Axis Moving ==================================
                    if(rectinitX.get() < mouseEvent.getX()){   
                        newXlower=xAxis.getLowerBound()-Delta;
                        newXupper=xAxis.getUpperBound()-Delta;
                    else if(rectinitX.get() > mouseEvent.getX()){   
                        newXlower=xAxis.getLowerBound()+Delta;
                        newXupper=xAxis.getUpperBound()+Delta;
                    xAxis.setLowerBound( newXlower );
                    xAxis.setUpperBound( newXupper );
    //===================================================== Y-Axis Moving ====================================
                    if(rectinitY.get() < mouseEvent.getY()){   
                        newYlower=yAxis.getLowerBound()+Delta/1000;
                        newYupper=yAxis.getUpperBound()+Delta/1000;
                    else if(rectinitY.get() > mouseEvent.getY()){   
                        newYlower=yAxis.getLowerBound()-Delta/1000;
                        newYupper=yAxis.getUpperBound()-Delta/1000;
                    yAxis.setLowerBound(newYlower);
                    yAxis.setUpperBound(newYupper);
    //----------------------------- Re-Scale the X-Axis when dragging below it ---------------------------------
                else if(mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED && mouseEvent.getY()>yAxisShift+yAxis.getHeight() ){
                    if(rectinitX.get() < mouseEvent.getX()){   
                        newXlower=xAxis.getLowerBound()+Delta;
                        newXupper=xAxis.getUpperBound()-Delta;
                    else if(rectinitX.get() > mouseEvent.getX()){   
                        newXlower=xAxis.getLowerBound()-Delta;
                        newXupper=xAxis.getUpperBound()+Delta;
                    xAxis.setLowerBound( newXlower );
                    xAxis.setUpperBound( newXupper );          
    //--------------------------------- Re-Scale the Y-Axis when dragging to the left of it --------------------------
                else if(mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED && mouseEvent.getX()> (xAxisShift + xAxis.getWidth())){
                    if(rectinitY.get() < mouseEvent.getY()){   
                        newYlower=yAxis.getLowerBound()-Delta/1000;
                        newYupper=yAxis.getUpperBound()+Delta/1000;
                    else if(rectinitY.get() > mouseEvent.getY()){   
                        newYlower=yAxis.getLowerBound()+Delta/1000;
                        newYupper=yAxis.getUpperBound()-Delta/1000;
                    yAxis.setLowerBound(newYlower);
                    yAxis.setUpperBound(newYupper);               
                rectinitX.set(mouseEvent.getX());
                rectinitY.set(mouseEvent.getY());
                if(mouseEvent.getEventType() == MouseEvent.MOUSE_MOVED && mouseEvent.getY()>yAxisShift && mouseEvent.getY()<yAxisShift+yAxis.getHeight() && mouseEvent.getX()>xAxisShift && mouseEvent.getX()<xAxisShift+xAxis.getWidth()){
                double XX=((mouseEvent.getX() - xAxisShift) / Tgap) + xAxis.getLowerBound();
                double YY=CurrentPrice;
                series1.setName(String.format("%.2g%n",XX) + ", " + String.format("%.4g%n",YY));
    public static void main(String[] args) {
        launch(args); 
    }

  • How to call request object of IPortalComponent in KM Scheduler application

    Hi
    We are reading RFC Table data using JCO Connection Pool(JCOClientPoolEntry. Please find the below teo line code.If we put this code in KM Scheduler application then its throwing error for the request objecct of IPortalComponenetRequest.
    IJCOClientPoolEntry jcoPoolEntry = null;
    jcoPoolEntry = clientService.getJCOClientPoolEntry(sysId, request);
    Can you please let me know how to use request object of IPortalComponent in KM Scheduler application?
    Thanks,
    Susmita

    Hello GopalY,
    In my experience its not possible to call OLE object in Webui. Maybe customer 3 party application will be supply some web service to handle credit card payments. I think this is the simple way to access 3party application.
    Regards,
    Zafer,

  • Hi,how can i transport objects from one server to other like (Dev To Qty)

    Hi Sir/madam,
       Can u explain how can i transport objects from one server to other like (Development To Quality To Production).
    Regards,
    Vishali.

    Hi Vishali,
    Step 1: Collect all Transports(with Packages) in Transports Tab(RSA1)- CTO
    Step 2: Release the subrequests first and then the main request by pressing Truck button
    Step 3: STMS or Customized transactions
    Object Collection In Transports:
    The respective Transports should have the following objects:
    1. Base Objects -
    a. Info Area
    b. Info object catalogs
    c. Info Objects
    2. Info Providers u2013
    a. Info Cubes
    b. Multi Providers
    c. Info Sets
    d. Data Store Objects
    e. Info Cube Aggregates
    3. Transfer Rules u2013
    a. Application Components
    b. Communication Structure
    c. Data Source replica
    d. Info Packages
    e. Transfer Rules
    f. Transformations
    g. Info Source Transaction data
    h. Transfer Structure
    i. Data sources (Active version)
    j. Routines & BW Formulas used in the Transfer routines
    k. Extract Structures
    l. (Note) If the transfer structures and related objects are being transferred without preceding
    Base Objects transport (e.g. while fixing an error) it is safer to transport the related Info
    Objects as well.
    4. Update Rules u2013
    a. Update rules
    b. Routines and formulas used in Update rules
    c. DTPs
    5. Process Chains u2013
    a. Process Chains
    b. Process Chain Starter
    c. Process Variants
    d. Event u2013 Administration Chains
    6. Report Objects u2013
    a. Reports
    b. Report Objects
    c. Web Templates
    Regards,
    Suman

  • How to delete all objects in a package?

    Hello,
    I've seen a similar question here. But is there a tool or a smart way to delete all objects in a dev class or a transport request?
    Best Regards
    Volker

    These are really 3 questions??
    1. To delete objects in a request there are a number of ways, here is one:
    Position cursor on modifiable request.
    Double click on request and choose 'Objects' tab
    Choose object line you want to delete and click 'Delete'
    Save your changes.
    2. To delete objects in a Dev Class:
    Go to work bench --> edit object, Class and give your class name, you will see delete option at the bottom of the screen.
    3. How to delete all objects in a package:
    here is a link with the steps you need for this: http://benxbrain.com/en/index.do?onInputProcessing(brai_object_thread)&001_threadid=0000161442&sysid=WP5&pgmid=R3TR&object=DOMA&obj_name=DEVCLASS&child_param=

  • How To Insert A object into Conext

    Hi Techies,
    I have 8 tables in my designer
    and I have two contexts at designer level
    And how to insert a object into a context that is not referencing any table.
    For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
    Thanks in Advance..

          Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
    Regards,
    Ajay

  • How to see the object while moving on the artboard?

    hello everyone;
    maybe a silly question; how to see the object while moving on the artboard? i dont wanna see only the objects bounding box(outline of the object). i wanna see the object it self. thank you.

    What have they gone and messed up now?
    When I drag an object (with bounding boxes turned on), the object moves and the bounding box stays still until I stop dragging, upon which it snaps to the object’s new position.
    If I don’t have bounding boxes turned on (as I usually work), the object moves when dragged.
    If what Bedri says is right, they’ve gone and mended something that wasn’t busted.

  • How to cast an Object into a specific type (Integer/String) at runtime

    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    Example:
    public class TestCode {
         public static Object func1()
    Integer i = new Integer(10); //or String str = new String("abc");
    Object temp= i; //or Object temp= str;
    return temp;
         public static void func2(Integer param1)
              //Performing some stuff
         public static void main(String args[])
         Object obj = func1();
    //cast obj into Integer at run time
         func2(Integer);
    Description:
    In example, func1() will be called first which will return an object. Returned object refer to an Integer object or an String object. Now at run time, I want to cast this object to the class its referring to (Integer or String).
    For e.g., if returned object is referring to Integer then cast that object into Integer and call func2() by passing Integer object.

    GDS123 wrote:
    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    There is only one way to have an object of an unknown type at compile time. That is to create the object's class at runtime using a classloader. Typically a URLClassloader.
    Look into
    Class.ForName(String)

  • How to set a object value bound to a session to JavaScript variable

    In a JSP, I store an object value in a HttpSession and I also write a Javascript function to display something on the screen. I need to use the Javascript function to display the object value which is stored in the session. How to set the object value to variable of the JavaScript function. Thanks.

    I write a class JavaScriptHelper to convert the object value to variable of the JavaScript;
    1.get the data to a javabean from database;
    2.convert the data to variable of the JavaScript as a String ;
    3.store the object in a HttpSession or Httprequest ;
    4.use in Jsp get the String (variable of the JavaScript )
    YourBean bean = (YourBean) request.getAttribute("model");
         if (bean != null) out.println(bean .getJsCode())
    convert function,(this is only for the matrix):
    public static String formatJsCode(Vector vector) {
    String sJsCode = "";
    //get js head
    sJsCode = getJsHeader();
    //define js array;
    sJsCode += "var data=new Array();\n";
    Vector v = null;
    String sTemp = "", sLine = "";
    for (int i = 0; i < vector.size(); i++) {
    v = (Vector) vector.get(i);
    sLine = "";
    for (int j = 0; j < v.size(); j++) {
    sTemp = (String) v.get(j);
    //replace " to \"
    sTemp = sTemp.replaceAll("\"", "\\\\\\\"");
    //escape Html Tag
    //sTemp = StringUtil.escapeHTMLTags(sTemp);
    //replace \r\n to <br>
    sTemp = sTemp.replaceAll("\r\n", "<br>");
    if (j != 0)
    sLine += ",";
    sLine += "\"" + sTemp + "\"";
    sJsCode += "data[" + i + "]=new Array(" + sLine + ");\n";
    //get js foot
    sJsCode += getJsFooter();
    return sJsCode;
    public static String getJsHeader(){
    return "<script language=\"JavaScript\">";
    public static String getJsFooter(){
    return "</script>";
    }

Maybe you are looking for

  • Converting a web-based text page to XMP

    I have a live, web-based text feed that contains all of the metadata I want to capture. I want to tag this metadata to video and image files, and I want that information to stay with the video and image files throughout the production process (ie. th

  • Error while deploying the Adapter Module

    Expets, i am getting below error in communication channel: Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name localejbs/WriteExcelFile, cannot re

  • Proxy vs redirection in CAS

    How does Proxy differs from redirection in CAS role in exchange 2010 Aditya Mediratta

  • HT3275 Time Machine only sees my external drive...

    I'm trying to backup my desktop hard drive, not the partitions in my external drive. When I go into TM preferences and "Select Disc" all I see are the partitions in my external drive. If I choose the one I have created called "Backup" I am asked if I

  • JDWP fatal error from thread.stop()

    I get this message FATAL ERROR in native method: JDWP "util.c" (Jan 20 2004), line 1209: Unexpected error, error code = 113 (JVMDI_ERROR_INTERNAL) from the target VM when I do thread.stop() on the debugger side. The debugger isn't bothered by the fat