agg.attribute.view.impl
Class TupleFormat

java.lang.Object
  extended by agg.attribute.impl.AttrObject
      extended by agg.attribute.view.impl.TupleFormat
All Implemented Interfaces:
java.io.Serializable, java.util.Observer

public class TupleFormat
extends AttrObject
implements java.io.Serializable

Format of an attribute tuple. Usually, only attribute types have a format instance attached to them.

See Also:
Serialized Form

Field Summary
protected  SlotSequence allSlots
          A container with index positions (slots), containing indices for visible members only.
static int HIDDEN
          Constant, returned when a member index is not in the representation.
protected  SlotSequence visibleSlots
          A container with index positions (slots), containing indices for all tuple members.
 
Fields inherited from class agg.attribute.impl.AttrObject
classHandlerExpr, classObject, classString, initialized
 
Constructor Summary
TupleFormat(int size)
          Constructing with all parameters.
 
Method Summary
 void addMember(int index)
          Appends a new slot for 'index' in each of the position containers.
 void deleteMember(int index)
          Deletes the slot for 'index' in each of the position containers.
protected  void finalize()
           
 int getIndexAtTotalSlot(int slot)
          Returns the member index at the specified slot; If the boolean parameter is true, the slot is interpreted wrt the container with all members, otherwise wrt the container with the visible members only.
 int getIndexAtVisibleSlot(int slot)
          Returns the member index at the specified slot, wrt the visible position container.
protected  int getTotalSlot(int visibleSlot)
          Returns the slot for all members containing the same index as the specified slot for visible members.
 int getTotalSlotForIndex(int index)
          Returns the slot, from the container with all members, for the specified member index.
 int getVisibleSize()
          Returns the number of visible members.
protected  int getVisibleSlot(int totalSlot)
          Returns the slot for visible members containing the same index as the specified slot for all members, or 'HIDDEN'.
 int getVisibleSlotForIndex(int index)
          Returns the slot, from the container with visible members, for the specified member index.
protected  void insertIndexInVisible(int index)
          Inserting the index in the visible container, so that the order matches that of the total container.
 boolean isVisible(int slot)
          Testing if the member at a given slot is visible.
 void moveSlotInserting(int srcSlot, int destSlot)
          Moves the member at "srcSlot" to "destSlot", inserting-wise.
 boolean setVisible(boolean v, int slot)
          Setting, if the attribute member at the specified slot of this view should be visible or not.
 java.lang.String toString()
           
 
Methods inherited from class agg.attribute.impl.AttrObject
defaultToString, err, err, getInstRepr, log, log, log, logEnteredMethod, logPrintln, logPrintln, stdoutPrintOnEnter, stdoutPrintOnExit, update, warn, warn, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HIDDEN

public static final int HIDDEN
Constant, returned when a member index is not in the representation.

See Also:
Constant Field Values

visibleSlots

protected SlotSequence visibleSlots
A container with index positions (slots), containing indices for all tuple members.


allSlots

protected SlotSequence allSlots
A container with index positions (slots), containing indices for visible members only.

Constructor Detail

TupleFormat

public TupleFormat(int size)
Constructing with all parameters.

Parameters:
size - The initial number of slots.
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

addMember

public void addMember(int index)
Appends a new slot for 'index' in each of the position containers.


deleteMember

public void deleteMember(int index)
Deletes the slot for 'index' in each of the position containers.


getVisibleSize

public int getVisibleSize()
Returns the number of visible members.


isVisible

public boolean isVisible(int slot)
Testing if the member at a given slot is visible.


getIndexAtVisibleSlot

public int getIndexAtVisibleSlot(int slot)
Returns the member index at the specified slot, wrt the visible position container.


getIndexAtTotalSlot

public int getIndexAtTotalSlot(int slot)
Returns the member index at the specified slot; If the boolean parameter is true, the slot is interpreted wrt the container with all members, otherwise wrt the container with the visible members only.


getTotalSlotForIndex

public int getTotalSlotForIndex(int index)
Returns the slot, from the container with all members, for the specified member index.


getVisibleSlotForIndex

public int getVisibleSlotForIndex(int index)
Returns the slot, from the container with visible members, for the specified member index.


moveSlotInserting

public void moveSlotInserting(int srcSlot,
                              int destSlot)
Moves the member at "srcSlot" to "destSlot", inserting-wise. The slots refer to the container with all members. The slot order for visible members is adapted accordingly.


insertIndexInVisible

protected void insertIndexInVisible(int index)
Inserting the index in the visible container, so that the order matches that of the total container.


getVisibleSlot

protected int getVisibleSlot(int totalSlot)
Returns the slot for visible members containing the same index as the specified slot for all members, or 'HIDDEN'.


getTotalSlot

protected int getTotalSlot(int visibleSlot)
Returns the slot for all members containing the same index as the specified slot for visible members.


setVisible

public boolean setVisible(boolean v,
                          int slot)
Setting, if the attribute member at the specified slot of this view should be visible or not.

Returns:
true if a change was made, false otherwise.

toString

public java.lang.String toString()
Overrides:
toString in class AttrObject