Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.pqt.autorib.rib
Class RIBStateRec  view RIBStateRec download RIBStateRec.java

java.lang.Object
  extended byorg.pqt.autorib.rib.RIBStateRec
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
RIBAttributeRec, RIBOptionRec

public class RIBStateRec
extends java.lang.Object
implements java.lang.Cloneable

This class is the parent of classes to implement the reading and storage of RIB Options and Attributes. It distinguishes two sorts of options or attributes, normal and special, the latter being attributes or options that are not unique per object or file (e.g. multiple instances of 'Option' RIB requests), and the former being attributes where a new instance of the attribute supercedes the last (Color for example).

It differentiates between different types of 'special' content, a feature that is used in the RIBAttributeRec subclass to separate Declare statements from the rest, so that they can be printed first.

Known subclasses are RIBOptionRec and RIBAttributeRec


Field Summary
(package private)  RIBStateRec inheritsFrom
          a reference to a StateRec from which to inherit - only used by AttributeRec
(package private)  java.util.Hashtable newContent
          a hashtable for storing unique options - Format, PixelFilter etc
(package private)  java.util.Vector[] newSpecialContent
          a vector used to store different types of special content
 
Constructor Summary
RIBStateRec(int dimension)
          Default constructor
RIBStateRec(RIBStateRec a)
          Constructed based on a previous staterec including the specialContent
RIBStateRec(RIBStateRec a, boolean copySpecialContent)
          Constructed based on a previous staterec
 
Method Summary
 java.lang.Object clone()
          clone this object
 void filteredWrite(java.io.Writer out, boolean[] filter)
          write out content filtering it first to eliminate some RIB calls
 void filteredWriteNonSpecial(java.io.Writer out, boolean[] filter)
          write out non-special (normal) content filtering it
 void filteredWriteSpecial(java.io.Writer out, boolean[] filter)
          Write out hall types of special content, filtering
 void filteredWriteSpecial(java.io.Writer out, boolean[] filter, int index)
          Write out the special content, filtering it
 RIBRequest get(int requestID)
          get the full parameters etc for a given RIB option or attribute, other than special options or attributes (i.e.
 boolean put(RIBRequest rq)
          See whether a particular RIB request is an option or an attribute and add it to the appropriate content (overidden in subclasses)
 void put(java.util.Vector v)
          look through a vector, finding any RIB Options, put these in the current RIBOptionRec removing them from the vector
 void write(java.io.Writer out)
          write out the content
 void writeNonSpecial(java.io.Writer out)
          write out the non special, or normal content
 void writeSpecial(java.io.Writer out)
          Write out the special content, but not special content inherited
 void writeSpecial(java.io.Writer out, int index)
          write out all the special content with the given type
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newContent

java.util.Hashtable newContent
a hashtable for storing unique options - Format, PixelFilter etc


newSpecialContent

java.util.Vector[] newSpecialContent
a vector used to store different types of special content


inheritsFrom

RIBStateRec inheritsFrom
a reference to a StateRec from which to inherit - only used by AttributeRec

Constructor Detail

RIBStateRec

public RIBStateRec(int dimension)
Default constructor


RIBStateRec

public RIBStateRec(RIBStateRec a,
                   boolean copySpecialContent)
Constructed based on a previous staterec


RIBStateRec

public RIBStateRec(RIBStateRec a)
Constructed based on a previous staterec including the specialContent

Method Detail

put

public boolean put(RIBRequest rq)
See whether a particular RIB request is an option or an attribute and add it to the appropriate content (overidden in subclasses)


put

public void put(java.util.Vector v)
look through a vector, finding any RIB Options, put these in the current RIBOptionRec removing them from the vector


get

public RIBRequest get(int requestID)
get the full parameters etc for a given RIB option or attribute, other than special options or attributes (i.e. this works for 'Color' but not 'Attribute');


write

public void write(java.io.Writer out)
           throws java.io.IOException
write out the content


filteredWrite

public void filteredWrite(java.io.Writer out,
                          boolean[] filter)
                   throws java.io.IOException
write out content filtering it first to eliminate some RIB calls


writeSpecial

public void writeSpecial(java.io.Writer out)
                  throws java.io.IOException
Write out the special content, but not special content inherited


writeSpecial

public void writeSpecial(java.io.Writer out,
                         int index)
                  throws java.io.IOException
write out all the special content with the given type


filteredWriteSpecial

public void filteredWriteSpecial(java.io.Writer out,
                                 boolean[] filter,
                                 int index)
                          throws java.io.IOException
Write out the special content, filtering it


filteredWriteSpecial

public void filteredWriteSpecial(java.io.Writer out,
                                 boolean[] filter)
                          throws java.io.IOException
Write out hall types of special content, filtering


writeNonSpecial

public void writeNonSpecial(java.io.Writer out)
                     throws java.io.IOException
write out the non special, or normal content


filteredWriteNonSpecial

public void filteredWriteNonSpecial(java.io.Writer out,
                                    boolean[] filter)
                             throws java.io.IOException
write out non-special (normal) content filtering it


clone

public java.lang.Object clone()
clone this object