    001    /*
    002     * Asset.java
    003     * :tabSize=8:indentSize=8:noTabs=false:
    004     * :folding=explicit:collapseFolds=1:
    005     *
    006     * Copyright (C) 2000, 2005 Slava Pestov
    007     *
    008     * This program is free software; you can redistribute it and/or
    009     * modify it under the terms of the GNU General Public License
    010     * as published by the Free Software Foundation; either version 2
    011     * of the License, or any later version.
    012     *
    013     * This program is distributed in the hope that it will be useful,
    014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
    015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    016     * GNU General Public License for more details.
    017     *
    018     * You should have received a copy of the GNU General Public License
    019     * along with this program; if not, write to the Free Software
    020     * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    021     */
    022
    023    package sidekick;
    024
    025    import javax.swing.text.Position;
    026
    027    /**
    028     * A block of code within a file.  Assets correspond to nodes in the
    029     * Structure Browser and folds in the SideKick folding mode.
    030     */
    031    public abstract class Asset implements IAsset
    032    {
    033            //{{{ Instance variables
    034            public String name;
    035            public Position start, end;
    036            //}}}
    037
    038            //{{{ Asset constructor
    039            public Asset(String name)
    040            {
    041                    this.name = name;
    042            } //}}}
    043
    044            //{{{ getName() method
    045            /**
    046             * Returns the name of the Asset.
    047             */
    048            public String getName()
    049            {
    050                    return name;
    051            } //}}}
    052
    053            //{{{ getStart() method
    054            /**
    055             * Returns the starting position.
    056             */
    057            public Position getStart()
    058            {
    059                    return start;
    060            } //}}}
    061
    062            //{{{ getEnd() method
    063            /**
    064             * Returns the end position.
    065             */
    066            public Position getEnd()
    067            {
    068                    return end;
    069            } //}}}
    070
    071
    072            //{{{ setName() method
    073            /**
    074             * Set the name of the asset
    075             */
    076            public void setName(String name)
    077            {
    078                    this.name = name;
    079            } //}}}
    080
    081            //{{{ setStart() method
    082            /**
    083             * Set the start position
    084             */
    085            public void setStart(Position start)
    086            {
    087                    this.start = start;
    088            } //}}}
    089
    090            //{{{ setEnd() method
    091            /**
    092             * Set the end position
    093             */
    094            public void setEnd(Position end)
    095            {
    096                    this.end = end;
    097            } //}}}
    098    }