home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161a.iso / handson / files / copyjava.exe / com / sun / java / swing / text / DefaultStyledDocument$ElementSpec.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-02-26  |  2.6 KB  |  94 lines

  1. package com.sun.java.swing.text;
  2.  
  3. public class DefaultStyledDocument$ElementSpec {
  4.    public static final short StartTagType = 1;
  5.    public static final short EndTagType = 2;
  6.    public static final short ContentType = 3;
  7.    public static final short JoinPreviousDirection = 4;
  8.    public static final short JoinNextDirection = 5;
  9.    public static final short OriginateDirection = 6;
  10.    private AttributeSet attr;
  11.    private int len;
  12.    private short type;
  13.    private short direction;
  14.    private int offs;
  15.    private char[] data;
  16.  
  17.    public DefaultStyledDocument$ElementSpec(AttributeSet var1, short var2) {
  18.       this(var1, var2, (char[])null, 0, 0);
  19.    }
  20.  
  21.    public DefaultStyledDocument$ElementSpec(AttributeSet var1, short var2, int var3) {
  22.       this(var1, var2, (char[])null, 0, var3);
  23.    }
  24.  
  25.    public DefaultStyledDocument$ElementSpec(AttributeSet var1, short var2, char[] var3, int var4, int var5) {
  26.       this.attr = var1;
  27.       this.type = var2;
  28.       this.data = var3;
  29.       this.offs = var4;
  30.       this.len = var5;
  31.       this.direction = 6;
  32.    }
  33.  
  34.    public void setType(short var1) {
  35.       this.type = var1;
  36.    }
  37.  
  38.    public short getType() {
  39.       return this.type;
  40.    }
  41.  
  42.    public void setDirection(short var1) {
  43.       this.direction = var1;
  44.    }
  45.  
  46.    public short getDirection() {
  47.       return this.direction;
  48.    }
  49.  
  50.    public AttributeSet getAttributes() {
  51.       return this.attr;
  52.    }
  53.  
  54.    public char[] getArray() {
  55.       return this.data;
  56.    }
  57.  
  58.    public int getOffset() {
  59.       return 0;
  60.    }
  61.  
  62.    public int getLength() {
  63.       return this.len;
  64.    }
  65.  
  66.    public String toString() {
  67.       String var1 = "??";
  68.       String var2 = "??";
  69.       switch (this.type) {
  70.          case 1:
  71.             var1 = "StartTag";
  72.             break;
  73.          case 2:
  74.             var1 = "EndTag";
  75.             break;
  76.          case 3:
  77.             var1 = "Content";
  78.       }
  79.  
  80.       switch (this.direction) {
  81.          case 4:
  82.             var2 = "JoinPrevious";
  83.             break;
  84.          case 5:
  85.             var2 = "JoinNext";
  86.             break;
  87.          case 6:
  88.             var2 = "Originate";
  89.       }
  90.  
  91.       return var1 + ":" + var2 + ":" + this.getLength();
  92.    }
  93. }
  94.