// Decompiled by DJ v2.6.6.51 Copyright 2000 Atanas Neshkov  Date: 6/15/2001 17:42:06
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   com/macromedia/generator/api/TextBuilder

package com.macromedia.generator.api;

import com.macromedia.generator.api.peer.TextBuilderPeer;

// Referenced classes of package com.macromedia.generator.api:
//            GenObject, GeneratorApiException, Buffer

public class TextBuilder extends GenObject
{

    public TextBuilder()
        throws GeneratorApiException
    {
        peer = TextBuilderPeer.New();
        if(peer == 0)
            throw new GeneratorApiException("unable to create peer");
        else
            return;
    }

    protected TextBuilder(int i)
        throws GeneratorApiException
    {
        peer = i;
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        else
            return;
    }

    public void build(Buffer buffer, Buffer buffer1)
        throws GeneratorApiException
    {
        if(peer == 0)
            throw new GeneratorApiException("invalid peer");
        if(buffer.peer == 0 || buffer1.peer == 0)
            throw new GeneratorApiException("invalid peer");
        int i = TextBuilderPeer.Build(peer, buffer.peer, buffer1.peer);
        if(i == 0)
            throw new GeneratorApiException("error building the Text buffer");
        else
            return;
    }

    protected void finalize()
        throws Throwable
    {
        if(peer != 0)
            TextBuilderPeer.Release(peer);
        peer = 0;
    }

    public void release()
    {
        if(peer != 0)
            TextBuilderPeer.Release(peer);
        peer = 0;
    }
}