Consolidating Book objects

I'm an amateur programmer trying to write a fairly basic java application. Please excuse me if my terminology and/or code is sloppy. I've tried searching for this answer on a few forums (including this one) but can't seem to find a solution. I'm hoping someone here might recognize what I'm missing.
In a nutshell I have an array of JTextPane objects which I'm attempting to consolidate into a single Book object to facilitate printing or exporting to a pdf. I'm attempting to create a Book from each JTextPane, then appending each Book object to one 'master' Book object.
The problem is that the 'master' Book is incomplete. It contains the correct number of pages, but only content from the first Book is included. The remaining pages are blank. Any ideas or suggestions would be greatly appreciated.
Book _compiledBook = new Book(); //Create the 'master' book
//Program specific code.  Section objects house several objects including the JTextPanes I'm consolidating
ArrayList<Section> _sectionArray = TemplateGUI._sectionManager.getSectionArray();
//Cycle through my section object array
for (int $i=0; $i < _sectionArray.size(); $i++) {
        //Pull the JTextPane for each section
     JTextPane _targetPane = _sectionArray.get($i).getJTextPane();
        //Create a new book using the JTextPane, for simplicity's sake I have not included code for
        //the method that creates the Book object.  I have been able to test the code and confirm
        //that every Book object is correctly assembled at this point
     Book _newBook = createBook(_targetPane);
         //For each page in this Book
        for (int $j=0; $j < _newBook.getNumberOfPages(); $j++) {
                    //Append the page to the 'master' Book object
              _compiledBook.append(_newBook.getPrintable($j), _newBook.getPageFormat($j));
}

hi to all. i wanna create a vector which only is
consisted of objects of a previously created book
class. but when i use the constructor Vector books=new
Vector (Book c);
it gives error. what is the correct way to do this? The two replys are both helpful correct but lack documentation. What you want to do requires two steps.
The first step is to create a Vector object.
Vector books = new Vector();The second step is to load that object with the set of book objects. For each book object in the set, say with a for loop:
books.add(Book c);Now the Vector object "books" has a set of Book objects.

Similar Messages

  • Who has the book:Object-Oriented Programming with ABAP Objects

    Hello everyone
    Now i want to learn ABAP OO,and Lots' of guys told me that the book  Object-Oriented Programming with ABAP Objects is realy a good book.but i searched on the net,and could not got PDF of this book,could some one gave me the net address if you know where to download the book or send me to my Mailbox:<email id removed by moderator>,I will very glad to receive any response from you,
    of course,if you have some advise on how to learn ABAP OO or some other material ,hope you could share your meaning with me, hope to receive your response.
    Best regards!
    From Carl
    Moderator message : Moved to career center.
    Edited by: Vinod Kumar on Aug 27, 2011 9:21 AM

    I'm sure you're not asking for illegal, "free" downloads. You can legally purchase the book, also in electronic format, at sap-press.com
    Thomas

  • How to use different pageFormats while printing in the same book object.

    Hi All,
    I m able to print Multiple pages, but the problem is when i want print multple pages with different pageformates I mean One pages having 4X2" size and another one is 5X5", while print second page objects not appears properly
    Pls see the below code to get the problem.
    any works around this will be appreciated.
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.geom.Rectangle2D;
    import java.awt.print.Book;
    import java.awt.print.PageFormat;
    import java.awt.print.Paper;
    import java.awt.print.Printable;
    import java.awt.print.PrinterJob;
    public class MultiplePageFormatTest
    public static void main(String[] args)
      MultiplePageFormatTest example3 = new MultiplePageFormatTest();
      System.exit(0);
    private final static int POINTS_PER_INCH = 72;
    public MultiplePageFormatTest()
      PrinterJob printJob = PrinterJob.getPrinterJob();
      Book book = new Book();
      PageFormat documentPageFormat = new PageFormat();
      PageFormat documentPageFormat1 = new PageFormat();
      Paper paper = new Paper();
      Paper paper1 = new Paper();
      paper.setSize(4.5 * POINTS_PER_INCH, 2.5 * POINTS_PER_INCH);
      paper.setImageableArea(.25 * POINTS_PER_INCH, .25 * POINTS_PER_INCH,
       4 * POINTS_PER_INCH, 2 * POINTS_PER_INCH);
      documentPageFormat.setPaper(paper);
      paper1.setSize(5.5 * POINTS_PER_INCH, 5.5 * POINTS_PER_INCH);
      paper1.setImageableArea(.25 * POINTS_PER_INCH, .25 * POINTS_PER_INCH,
       5 * POINTS_PER_INCH, 5 * POINTS_PER_INCH);
      documentPageFormat1.setPaper(paper1);
      book.append(new Document(), documentPageFormat);
      book.append(new Document(), documentPageFormat1);
      printJob.setPageable(book);
      if (printJob.printDialog())
       try
        printJob.print();
       catch (Exception PrintException)
        PrintException.printStackTrace();
    private class Document implements Printable
      public int print(Graphics g, PageFormat pageFormat, int page)
       Graphics2D g2d = (Graphics2D) g;
       g2d.translate(pageFormat.getImageableX(), pageFormat
        .getImageableY());
       g2d.setPaint(Color.black);
       g2d.setStroke(new BasicStroke(
        2));
       Rectangle2D.Double border = new Rectangle2D.Double(
        0, 0, pageFormat.getImageableWidth(), pageFormat
         .getImageableHeight());
       g2d.draw(border);
       return (PAGE_EXISTS);
    }

    Hi,
    Till now this question is not answered.........
    Any Answer around this deeply apprciated.
    Edited by: DoraiRaj on Sep 29, 2009 3:55 AM

  • Why haven't I received the CD that was supposed to go with the book Objective-C

    Anyone had the same experience

    Please clarify your question. Give us information about your computer system and give details of the issue for which you are seeking resolution.
    cornelius

  • Compounding vs. Consolidated Infoobjects.

    Hi Experts,
    Basically I need to pull information for spent analysis reporting. I’ve come to a stage where I need to pull information from multiple source systems (8 R/3 systems and 4 Non-SAP systems). In order to do this I need to pull master data such as plant, company code, purchase org etc.. into BI from the different systems. My problem is that each system can use the same code for different objects. Such as,
    Plant Example:
                Plant 1000/R/3-1            -           Plant A
                Plant 1000/R/3-2            -           Plant B
    Therefore to do this and to ensure all plants are available I need to use one of the following options.
    1.       Compound source system to plant.
    Problem with this is all objects using plant will also have to be compounded to system id.
    2.       Add source system code to plant id.
    Plant is only a 4 character field. There will not be enough space to add system id unless I change the length.
    3.       Use consolidated info-objects
    I was planning on using standard cube 0PUR_C01 for reporting. Will have to replace all infoproviders using this with the consolidated infoobject.
    4.       Maintain a table with predefined plants and write a routine for plant/system id and populate.
    This might not work well for RRI. Also will have to maintain the table when new objects are added/changed.
    So a bit confused as which technique to use. Would really appreciate you’re input.
    Thanks and regards,
    Dilanke

    For characteristics, it really doesnt matter if they are either a BW or APO infoobject, however for a KEY FIGURE it does matter.
    Reason is if you are intending to LOCK/FIX the key figure in yourplanning books, based on say a CONSENSUS FORECASTING workflow then theKEY FIGURE must be created as a APO key figure. Also enclosed the screenshots to show you the difference.
    This is the simple rule to remember:
    Always create APO keyfigures (because they have more functionality) and we will have Acutual Key Figures and Planned Key Figures...
    Always create BW InfoCubes (APO InfoCubes are only used internally)
    You can refer Chapter 3 : Demand Planner of APO for learning more about the diff between the Administrative Work Benches and Infocubes...
    Cheers,
    Sandhya

  • Object Serialization(Materialization and Dematerialization)

    I've encountered some issues with mapping my objects to an RDBMS and am hoping for some advice.
    I've tried various O/R mapping frameworks like Castor(too complex and too slow for my liking), JRF(nice but very repetitive and difficult to extend) and then some, but have yet to find one which I'm comfortable with building an application on.
    Instead, I've chosen to do it the low-tech way, with each domain class, say Book for instance, having a Broker class which knows how to communicate with the chosen form of persistence. So, since I chose an RDBMS, Book class has a BookRelationalBroker class which knows how to materialize and dematerialize Book objects to and from a RDBMS. If so required, I can plug in a BookXMLBroker which knows how to serialize the object in the form of an xml data file.
    I've also implemented a primitive object caching system which (when enabled), caches objects requested so we only have to materialize it from the db once.
    Here are 2 issues I have with my system:
    It is amazingly tedious (not to mention inefficient) to recreate the entire object from the database. This is even more so because I've implemented the Event Notification pattern, such that when say a book is deleted, the members who have reserved it are notified. The whole point of the Event Notification mechanism is so that the object being watched does not need to know of the objects which need to be notified on a state change. However, I've found it necessary to re-attach all the listeners on an object when it is materialized from the DB, defeating the purpose of the pattern.
    Complex object relationships are mapped poorly and recursive materialization leads to slow response times. If a Group object has a Vector of Members and other Groups, then whenever a Group object is materialized, all its constituent Members and Group objects also need to be materialized. (I understand O/R frameworks solve this through lazy instantiation)
    I studied the Jive2 architecture and found that they approached this problem by accessing the DB directly for any complex object relationships. In other words, the Group object does not actually contain a Vector of Members and Groups. Instead, it has a method called say getMembers() which proceeds to retrieve the necessary data from the DB and then materialize these objects.
    I'm not too excited about this approach for 2 reasons:
    How object-oriented is this approach? Seems more like database-oriented programming to me.
    Every call to retrieve Members necessitates a call to the DB. The data isn't cached with the Group object because the Group object does not actually contain the necessary reference to the Members and Groups.
    Can anyone shed some light on this topic?

    How object-oriented is this approach? Seems more like database-oriented programming to me. There is a reason people still use Relational databases rather than OO DBs. First, is that the vast majority of data in the real world maps easily to a relational model, consequently there is no advantage to a OO model. Second, either because of this or simply because OO models are not computationally simple, OO databases tend to be slower than relational DBs.
    It sounds like you are trying to implement a OO DB model using a relational database. So you basically end up with two problems. The DB is not optimized for OO models, and you have to find a way to map it in the OO model itself. And this is slow and messy.
    To solve the slowness problem you could, just like EJB servers, cache the data in memory. Lot of work but if you want to do it then have fun.
    The second way is to give up. Realize that your data model is not inherently OO'd and just implement it efficiently as a relational model. Then provide an interface that loads it into the OO model. And where needed add pass through logic to allow the database itself to do things it is really good at - like queries.

  • Trying to understand the basic concept of object oriented programming.

    I am trying to understand the basic concept of object oriented programming.
    Object - a region of storage that define is defined by both state/behavior.
    ( An object is the actual thing that behavior affects.)
    State - Represented by a set of variables and the values they contain.
    (Is the location or movement or action that is the goal that the behavior is trying to accomplish.)
    Variables- (What does this mean?)
    Value - (What does this mean?)
    Behavior - Represented by a set of methods and the logic they implement.
    ( A set of methods that is built up to tell's the how object to change it's state. )
    Methods - A procedure that is executed when an object receives a message.
    ( A very basic comand.For example the method tells the object to move up, another method tells the method to go left. Thus making the object move up/left that combination is the behavior.)
    Class - A template from which the objects are created.
    ( I am very confused on what classes are.)
    - The definitions of the words I obtained from the "Osborne Teach Yourself Java". The () statements are how I interperate the Mechanisms (I do not know if Thats what you call them.) interact with each other. I understand my interpretation may be horribly wrong. I will incredibly appreciate all the support I may get from you.
    Thank you

    Object oriented programming is a replacement for the older idea of procedural programming (you can research procedural programming in google). As I understand it, in procedural programming, you have a step by step set of function calls to accomplish some task. Each function receives a data structure, manipulates it, and passes it to the next function. The problem with this is that each function preforms some action for the overall task and can't easily be reused by some other task. Its also harder to read the flow of what is happening with raw data structures flying all over the place.
    In object oriented programming, an object calls a function of another object and receives back, not a data structure, but another object. Objects contain a data structure that can only be accessed by its functions. An object is not so much a sub component of a bigger task, as it is a service that any other task can use for any purpose. Also, when you pass an object to the caller, the caller can ask questions about the data structure via its functions. The developer doesnt have to know what the previous function did to the data by reading up on any documentation, or having to reverse engineer the code.
    I suggest the best way of learning this is to code something like a library object.
    A library object contains a collection of book objects
    A book object contains a collection of chapter objects
    A chapter object contains a collection of paragraph objects
    A paragraph object contains a collection of sentence objects
    A sentence object contains a collection of word objects.
    Add functions to each object to provide a service
    Example: A library object should have a:
    public void addBook(Book book)
    public Book getBook(String title)
    public boolean isBookInLibrary(String title)
    The key is to add functions to provide a service to anyone who uses your object(s)
    For example, what functions (service) should a paragraph object provide?
    It shouldn't provide a function that tells how many words there are in a sentence. That function belongs to a sentence object.
    Lets say you want to add a new chapter to a book. The task is easy to read
    if you write your objects well:
    Sentence sentence1=new Sentence("It was a dark and stormy night");
    Sentence sentence2=new Sentence("Suddenly, a shot ran out");
    Paragraph paragraph=new Paragraph();
    paragraph.addSentence(sentence1);
    paragraph.addSentence(sentence2);
    Paragraphs paragraphs=new Paragraphs();
    paragraphs.addParagraph(paragraph);
    Library library= new Library();
    library.getBook("My Novel").addChapter("Chapter 1",paragraphs).
    Now, lets say you want to have a word count for the entire book.
    The book should ask each chapter how many words it contains.
    Each chapter should ask its paragraphs, each paragraph should ask
    its sentences. The total of words should ripple up and be tallied at each
    stage until it reaches the book. The book can then report the total.
    Only the sentence object actually counts words. The other objects just tallies the counts.
    Now, where would you assign a librarian? What object(s) and functions would you provide?
    If written well, the project is easily extensible.

  • Object oriented programming aspects in Oracle

    Dear All,
    Can you one explain me the aspects of Object Oriented Programming in Oracle. How to use oops concepts in Oracle Procedures, functions, packages, etc.
    Thanks,
    Moorthy.GS

    Oracle 9i introduces support for inheritance, method overriding and dynamic method dispatch (or "dynamic binding", or "virtual").
    A method call is dispatched to the nearest implementation, working back up the inheritance hierarchy from the current or specified type.
    See, for example, how we can implement the Template Design Pattern in PL/SQL, using inheritance, method overriding and dynamic method dispatch:
    http://www.quest-pipelines.com/pipelines/plsql/tips06.htm#OCTOBER
    Oracle 11g introduces support for "super" object-oriented keyword. One attempt to do this in PLSQL 9i/10g:
    Calling the Parent Object's Version of an Overridden Method
    http://www.quest-pipelines.com/pipelines/plsql/tips03.htm#JUNE
    I expect some OO improvements in the future (in Oracle 12oo ...):
    1. References between transient objects (instances of objects types) and (then) garbage collector
    2. Generic classes (templates, generics) like in Eiffel, C++, Java 5 (PL/SQL was modeled after ADA 83, and ADA 83 has generic packages)
    3. Multiple inheritance like in Eiffel (inner classes like in Java - no, please)
    4. Design By Contract like in Eiffel (C++ / Java 1.4 assert is not enough)
    Design by contract (DBC) is a method whose author is Bertrand Mayer, also maker of OOPL language Eiffel
    (Eiffel was designed in 1985, commercialy released in 1986, ISO-standardized in 2006).
    Simplified, DBC is based on principle that in each routine (procedure or function) with standard code,
    two additional parts – PRECONDITION and POSTCONDITION - need to be asserted.
    An additional assertion in class is called INVARIANT.
    Contract is based on routine's putting up an obligation to caller (to some other routine)
    to satisfy conditions of precondition and conditions of invariant, and hers (called routine's) obligation
    to satisfy conditions of postcondition and conditions of invariant.
    The object oriented Eiffel programming language was created to implement DBC.
    For now, other OO (object-oriented) languages don’t support directly the ideas behind DBC.
    However, precondition and postcondition are applicable to many programming languages, both OO and not OO.
    Invariants are applicable only in OOPL.
    This is my attempt to use DBC methodology (including invariants) in Oracle PL/SQL.
    Eiffel class interface (not like Java interface, but more like PL/SQL package specification)
    from Bertrand Meyer's book "Object oriented software construction", second edition (OOSC2), 1997, page 390-391:
    class interface STACK [G]
    creation make
    feature -- Initialization
      make (n: INTEGER) is -- Alocate stack for a maximum of n elements
        require
          non_negative_capacity: n >= 0
        ensure
          capacity_set: capacity = n
        end
    feature -- Access
      capacity: INTEGER -- Maximum number of stack elements
      count: INTEGER -- Number of stack elements
      item: G is -– Top element
        require
          not_empty: not empty
        end
    feature -- Status report
      empty: BOOLEAN is –- Is stack empty?
        ensure
          empty_definition: Result = (count = 0)
        end
      full: BOOLEAN is –- Is stack full?
        ensure
          full_definition: Result = (count = capacity)
        end
    feature -- Element change
      put (x: G) is –- Add x on top
        require
          not_full: not full
        ensure
          not_empty: not empty
          added_to_top: item = x
          one_more_item: count = old count + 1
        end
      remove is -– Remove top element
        require
          not_empty: not empty
        ensure
          not_full: not full
          one_fewer: count = old count - 1
        end
    invariant
      count_non_negative: 0 <= count
      count_bounded: count <= capacity
      empty_if_no_elements: empty = (count = 0)
    end -– class interface STACK
    -- PL/SQL "equivalent":
    -- Stack implementation - TABLE of INTEGER.
    -- Eiffel has generic classes (like C++ templates and better than Java generics).
    -- PL/SQL (now) has not generic classes or generic packages.
    CREATE OR REPLACE TYPE array_t AS TABLE OF INTEGER
    -- utility package:
    CREATE OR REPLACE PACKAGE dbc AS
      -- 0 = no check
      -- 1 = check preconditions
      -- 2 = check preconditions + postconditions
      -- 3 = check preconditions + postconditions + invariants
      c_no_check                  CONSTANT INTEGER := 0;
      c_check_preconditions       CONSTANT INTEGER := 1;
      c_check_pre_postconditions  CONSTANT INTEGER := 2;
      c_check_pre_post_invariants CONSTANT INTEGER := 3;
      FUNCTION check_preconditions       RETURN BOOLEAN;
      FUNCTION check_pre_postconditions  RETURN BOOLEAN;
      FUNCTION check_pre_post_invariants RETURN BOOLEAN;
      PROCEDURE set_level (p_level INTEGER);
      PROCEDURE display_error (p_error VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY dbc AS
      m_level INTEGER := c_no_check;
      FUNCTION check_preconditions RETURN BOOLEAN IS
      BEGIN
        IF m_level >= c_check_preconditions THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;  
      END;
      FUNCTION check_pre_postconditions RETURN BOOLEAN IS
      BEGIN
        IF m_level >= c_check_pre_postconditions THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;  
      END;
      FUNCTION check_pre_post_invariants RETURN BOOLEAN IS
      BEGIN
        IF m_level >= c_check_pre_post_invariants THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;  
      END;
      PROCEDURE set_level (p_level INTEGER) IS
      BEGIN
        IF p_level NOT IN
          (c_no_check, c_check_preconditions, c_check_pre_postconditions, c_check_pre_post_invariants)
        THEN
          RAISE_APPLICATION_ERROR (-20000, 'Wrong checking level');
        END IF;
        m_level := p_level;
      END;
      PROCEDURE display_error (p_error VARCHAR2) IS
      BEGIN
        RAISE_APPLICATION_ERROR (-20000, 'ERROR in method ' || p_error);
      END;
    END;
    CREATE OR REPLACE TYPE stack AS OBJECT (
      -- Maximum number of stack elements
      capacity INTEGER,
      -- Number of stack elements
      el_count INTEGER,
      -- Stack implementation
      stack_implementation array_t,
      -- Alocate stack for a maximum of n elements
      CONSTRUCTOR FUNCTION stack (n INTEGER) RETURN SELF AS RESULT,
      -- Top element
      MEMBER FUNCTION item (SELF IN OUT stack) RETURN INTEGER,
      -- Is stack empty?
      MEMBER FUNCTION empty RETURN BOOLEAN,
      -- Is stack full?
      MEMBER FUNCTION full RETURN BOOLEAN,
      -- Add x on top
      MEMBER PROCEDURE put (x INTEGER),
      -- Remove top element
      MEMBER PROCEDURE remove,
      -- INVARIANTS
      -- Note:
      -- If subprogram is declared in an object type body (in PL/SQL 8i/9i/10g)
      -- it must be defined in the object type specification too.
      MEMBER FUNCTION count_non_negative RETURN BOOLEAN,
      MEMBER FUNCTION count_bounded RETURN BOOLEAN,
      MEMBER FUNCTION empty_if_no_elements RETURN BOOLEAN,
      MEMBER PROCEDURE check_invariants
    ) NOT FINAL;
    CREATE OR REPLACE TYPE BODY stack AS
      CONSTRUCTOR FUNCTION stack (n INTEGER) RETURN SELF AS RESULT IS
      BEGIN
        IF dbc.check_preconditions AND n < 0 THEN
          dbc.display_error ('stack - PRE');
        END IF;
        check_invariants;
        capacity := n;
        stack_implementation := array_t();
        stack_implementation.EXTEND (n);
        IF dbc.check_pre_postconditions AND capacity <> n THEN
          dbc.display_error ('stack - POST');
        END IF;
        check_invariants;
      END;
      MEMBER FUNCTION item (SELF IN OUT stack) RETURN INTEGER IS
      BEGIN
        IF dbc.check_preconditions AND empty THEN
          dbc.display_error ('item - PRE');
        END IF;
        check_invariants;
        RETURN stack_implementation(el_count);
      END;
      MEMBER FUNCTION empty RETURN BOOLEAN IS
      BEGIN
        IF el_count = 0 THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;
      END;
      MEMBER FUNCTION full RETURN BOOLEAN IS
      BEGIN
        IF el_count = capacity THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;
      END;
      MEMBER PROCEDURE put (x INTEGER) IS
      BEGIN
        IF dbc.check_preconditions AND full THEN
          dbc.display_error ('put - PRE');
        END IF;
        check_invariants;
        el_count := el_count + 1;
        stack_implementation(el_count) := x;
        -- PL/SQL has not Eiffel's OLD
        -- one_more_item: count = old count + 1
        IF dbc.check_pre_postconditions AND (empty OR item <> x) THEN
          dbc.display_error ('put - POST');
        END IF;
        check_invariants;
      END;
      MEMBER PROCEDURE remove IS BEGIN
        IF dbc.check_preconditions AND empty THEN
          dbc.display_error ('remove - PRE');
        END IF;
        check_invariants;
        el_count := el_count - 1;
        -- PL/SQL has not Eiffel's OLD
        -- one_fewer: count = old count - 1
        IF dbc.check_pre_postconditions AND full THEN
          dbc.display_error ('remove - POST');
        END IF;
        check_invariants;
      END;
      -- INVARIANTS
      MEMBER FUNCTION count_non_negative RETURN BOOLEAN IS
      BEGIN
        IF el_count >= 0 THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;
      END;
      MEMBER FUNCTION count_bounded RETURN BOOLEAN IS
      BEGIN
        IF el_count <= capacity THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;
      END;
      MEMBER FUNCTION empty_if_no_elements RETURN BOOLEAN IS
      BEGIN
        IF empty AND (el_count = 0)
           OR
           NOT empty AND (el_count <> 0)
        THEN
          RETURN TRUE;
        ELSE
          RETURN FALSE;
        END IF;
      END;
      MEMBER PROCEDURE check_invariants IS
      BEGIN
        IF NOT dbc.check_pre_post_invariants THEN
          RETURN; -- without checking invariants
        END IF;
        IF NOT count_non_negative THEN
          dbc.display_error ('INVARIANT count_non_negative');
        END IF;
        IF NOT count_bounded THEN
          dbc.display_error ('INVARIANT count_bounded');
        END IF;
        IF NOT empty_if_no_elements THEN
          dbc.display_error ('INVARIANT empty_if_no_elements');
        END IF;
      END;
    END; -- class body STACK
    /Regards,
    Zlatko Sirotic

  • How to create an array object?(where am I wrong?)

    Output window tell :
    java.lang.NullPointerException
    at Class.main(Class.java:5)
    Exception in thread "main"
    here is the source code:
    public class Class {
    public static void main (String s[]){
    Book[] theFirst =new Book[3];
    theFirst[2].getNum();
    theFirst[2].getIsHere();
    theFirst[2].out();
    theFirst[2].getIsHere();
    theFirst[2].in();
    theFirst[2].getIsHere();
    class Book{
    private int num=0;
    String bookName,auName,pageNumber;
    private boolean isHere =true;
    Book(){
    num++;
    void getNum(){
    System.out.println("������������ "+num);
    void getIsHere(){
    System.out.println("��������? "+isHere);
    void out(){
    isHere=false;
    void in(){
    isHere=true;
    }

    You just allocated the array..but need to create Book Object
    Add this line of code, compile and run it...
    theFirst[2] = new Book();
    Manikandan
    Source Code
    public class Class {
    public static void main (String s[]){
    Book[] theFirst =new Book[3];
    theFirst[2] = new Book();
    theFirst[2].getNum();
    theFirst[2].getIsHere();
    theFirst[2].out();
    theFirst[2].getIsHere();
    theFirst[2].in();
    theFirst[2].getIsHere();
    class Book{
    private int num=0;
    String bookName,auName,pageNumber;
    private boolean isHere =true;
    Book(){
    num++;
    void getNum(){
    System.out.println("������������ "+num);
    void getIsHere(){
    System.out.println("��������? "+isHere);
    void out(){
    isHere=false;
    void in(){
    isHere=true;

  • Inserting Object link as reference object in Maint Order/Notification

    Dear all,
    I've mapped pipe line using obejct link,now when i create Maint Order or Notification system displays below mentioned message,
    Select a link object as reference object
    Message no. IH101
    Diagnosis
    You are trying to create an order or a notification for a link object, but have not yet selected an object.
    Procedure
    Place the cursor on a link object. This object will be entered in the notification or order as the object referred to.
    In std Screen RefObject thers is no ref object for Link,
    Please guide me how we can create Maint.Order/Notification against Object Link,as it is required to track cost as well as history of repairs in pipe line.
    Thanks in advance
    Regards
    Parshil
    Edited by: PM_in_SAP on Jul 27, 2010 9:19 AM

    Hi,
    i refer page no 18 of SAP book Object Networking (CS-BD/PM-EQM-ON) SAP AG Release 4.6C,
    To select a particular link from the list, (IN18)select the object link and choose one of the following options:
    Goto --> Change/Display --> link, You reach the object link data screen.
    Goto -->Create notification  --> Notification type
    You reach the screen where you can create a maintenance notification for the link. If a link object is entered for the selected link, the system automatically uses it as a reference object for the notification.
    Goto --> Create order
    You reach the screen where you can create a maintenance order for the link. If a link the system automatically uses it as a
    reference object for the order.
    Regards
    Parshil
    Edited by: PM_in_SAP on Jul 27, 2010 11:22 AM

  • How to make Book WSDL available for download?

    Hi,
    I would like to download Book WSDL v2.0. The Web service API document says "To download the Book WSDL, you must be given access to the Book object". However, i did not find any option inside "role management>record types access" to make it available for access.
    Can anyone explain how the BOOK WSDL can be enabled for download?
    Note: I am not using Trial Account.
    Thanks
    Ravish
    Edited by: 833189 on Mar 11, 2011 8:35 AM

    Thanks for input.
    I have ensured that "Company Profile > Company Data Visibility Settings > Display Book Selector" setting is enabled. I did not find any BOOK specific privilege under role management wizard.
    Can you please tell me the exact setting that i need to ensure for BOOK WSDL access?
    Note: My user's role is admin.

  • Confusion... Data Access Object and Collection Class

    Please help me...
    i have a Book class in the library system, so normally i would have a Collection class eg. BookCollection class which keeps an array/ arrayList of Book objects. In BookCollection class i have methods like
    "searchBook(BookID)" which would return me a Book object in the array.
    But now i'm confused with Data Access Object... In sequence diagrams there's a "Data Access class" which is used to retrieve data from and send data to a database. So, if i have the Data Access class, do i still need BookCollection class? Because BookCollection serves as a database also rite? ...

    I think you're in the right rail.
    The BookCollection class could be still usefull if you will need to manage search results with more than onne record (e.g.: search by author name).

  • Adding Objects to Object List on the Service Contract Line Item

    Hi,
    I want to add a new fields at the object list. This is identified as configurable when I click on Configure Page button. Now when I add click on new field it which object should I select to enhance Object List.
    << Moderator message - Please do not promise points >>
    Thanks and Regards,
    Edited by: Rob Burbank on Dec 16, 2010 3:59 PM

    As books is a list of String it can't accept a Book object !
    LinkedList<Book> books = new LinkedList<Book>();

  • Adding objects to linked list

    Hello everyone. Just working on a little program but have got a little stuck
    So here's one of my classes:
    import java.util.LinkedList;
    import java.util.ListIterator;
    import java.io.*;
    * A program that demonstrates the LinkedList class
    public class BookList
    LinkedList<String> books = new LinkedList<String>();
    ListIterator<String> iterator = books.listIterator();
        public BookList()
        public void DisplayBooks()
            iterator = books.listIterator();
            while (iterator.hasNext())
            System.out.println(iterator.next());
        public void AddBook(String author, String title){
            Book newBook = new Book(author, title);
            books.addFirst(newBook);
    }I want to be able to add a new book object to my linked list but it want compile. Any help would be very appreciated. Thanks in advanced.

    As books is a list of String it can't accept a Book object !
    LinkedList<Book> books = new LinkedList<Book>();

  • Adding objects to a Map

    Hi all
    I have created a program that add objects to a Map
    Code below shows the method used when added
    public String add(int bookNumber, String title, String releaseYear, String author)
    Book book = new Book(bookNumber, title, releaseYear, author);
    if (library.containsKey(new Integer(book.getBookNumber())))
    return "Failure - Book is already in the Library";
    library.put(new Integer(book.getBookNumber()), book);
    return "Success Book Added";
    Trouble is when it adds the book(object) to the collection(map) it adds it anywhere in the map, eg I could have a book in place 1001 then the next book in place 1056, is there anyway I can get the method to add the object in order EG. There is a book in 1001 and when I add another object it goes to place 1002
    Any help would be great
    Thank all for your time
    James

    I don't know why you'd care about where in the Map a paticular object is but if you want it sorted you could try a TreeMap. And if you want unique keys then use a HashMap.

Maybe you are looking for

  • Apps take a long time to open on mac?

    I have a June 2012 Macbook pro (15 inch base model-nonretina). Apps take ridiculously long to open in OSX (Mountain Lion). When I use bootcamp to go into Windows 7, however, my computer is fast, apps open quickly, and games run on high. It doesn't ma

  • WRT54GS dhcp problem

    Hello, At our office we use a WRT54GS router (firmware v7.50.5) . The configuration is pretty simple : uplink switch -> Linksys router -> wireless & wired network . The local network setup chosen is with dhcp enabled.The problem is that the dhcp acts

  • When is Apple going to fix Mac Mail?

    Under Panther Mac Mail was very good for me. The signatures left a lot to be desired but otherwise it was pretty nice. I have upgraded to Lion and the new Mac mail *****. I'm almost ready to switch to a different mail software. Try to cut and paste a

  • Best Practices for editing

    I have a large document (college course catalog) that I need to produce. I have a previous version in publisher. I need to have various individuals edit specific sections of the catalog. I am wondering if anybody has any suggestions on the best way t

  • What is a Mac Pro? Is it a computer?

    What is a Mac Pro? Is it a computer?