Changeset 14


Ignore:
Timestamp:
10/01/02 19:03:57 (21 years ago)
Author:
piso
Message:

Merged code from AbstractBuffer?.java.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/SystemBuffer.java

    r2 r14  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: SystemBuffer.java,v 1.1.1.1 2002-09-24 16:08:24 piso Exp $
     5 * $Id: SystemBuffer.java,v 1.2 2002-10-01 19:03:57 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626import java.io.InputStream;
    2727import java.io.UnsupportedEncodingException;
     28import java.util.List;
    2829
    2930// System buffers are NOT linked into the normal buffer ring.
    30 public class SystemBuffer extends AbstractBuffer implements Constants
     31public class SystemBuffer implements Constants
    3132{
     33    public static final int TYPE_SYSTEM           =  0;
     34    public static final int TYPE_NORMAL           =  1;
     35    public static final int TYPE_ARCHIVE          =  2;
     36    public static final int TYPE_DIRECTORY        =  3;
     37    public static final int TYPE_SHELL            =  4;
     38    public static final int TYPE_COMPILATION      =  5;
     39    public static final int TYPE_MAN              =  6;
     40    public static final int TYPE_OUTPUT           =  7;
     41    public static final int TYPE_IMAGE            =  8;
     42    public static final int TYPE_MAILBOX          =  9;
     43    public static final int TYPE_TELNET           = 10;
     44    public static final int TYPE_SSH              = 11;
     45    public static final int TYPE_LIST_OCCURRENCES = 12;
     46
     47    protected int type = TYPE_SYSTEM;
    3248    protected boolean isLoaded;
    3349    protected boolean readOnly;
     50    protected boolean forceReadOnly;
    3451    protected Mode mode;
    3552    protected String lineSeparator;
    3653    protected int lineCount;
    3754
    38     boolean forceReadOnly;
    39 
     55    private Line firstLine;
     56    private Line lastLine;
    4057    private File file;
    4158    private String loadEncoding;
    42     private Line lastLine;
     59    private List tags;
    4360    private View lastView;
    4461
     
    5269    }
    5370
     71    public final int getType()
     72    {
     73        return type;
     74    }
     75
     76    public final Line getFirstLine()
     77    {
     78        return firstLine;
     79    }
     80
     81    public final void setFirstLine(Line line)
     82    {
     83        firstLine = line;
     84    }
     85
     86    public final Position getEnd()
     87    {
     88        Line line = firstLine;
     89        if (line == null)
     90            return null;
     91        while (line.next() != null)
     92            line = line.next();
     93        return new Position(line, line.length());
     94    }
     95
    5496    public final File getFile()
    5597    {
     
    85127    {
    86128        return mode == null ? null : mode.toString();
     129    }
     130
     131    public final List getTags()
     132    {
     133        return tags;
     134    }
     135
     136    public final void setTags(List tags)
     137    {
     138        this.tags = tags;
     139    }
     140
     141    public final void setForceReadOnly(boolean b)
     142    {
     143        forceReadOnly = b;
    87144    }
    88145
Note: See TracChangeset for help on using the changeset viewer.