de.bea.domingo.mock
Class MockViewEntry

java.lang.Object
  extended by de.bea.domingo.mock.MockViewEntry
All Implemented Interfaces:
DBase, DViewEntry, java.io.Serializable

public final class MockViewEntry
extends java.lang.Object
implements DViewEntry

Transient mock implementation of interface DViewEntry.

Author:
Kurt Riede
See Also:
Serialized Form

Constructor Summary
MockViewEntry(DViewEntry entry)
          Constructor.
MockViewEntry(java.util.List columnValues, java.lang.String universalID, int childCount, boolean isCategory, boolean isDocument, boolean isTotal, boolean isConflict)
          Constructor.
 
Method Summary
 int getChildCount()
          The number of immediate children belonging to the current view entry.
 java.util.List getColumnValues()
          The value of each column in the view entry.
 int getDescendantCount()
          The number of descendants belonging to the current view entry.
 DDocument getDocument()
          The document associated with the view entry.
 int getIndentLevel()
          The indent level of a view entry within the view.
 java.lang.String getNoteID()
          The note ID of a view entry of type document.
 java.lang.String getPosition(char seperator)
          Returns the position of the entry in the view hierarchy, for example, "2.3" for the third document of the second category.
 int getSibblingCount()
          Deprecated. use method getSiblingCount() instead
 int getSiblingCount()
          The number of siblings belonging to the current view entry.
 java.lang.String getUniversalID()
          
 boolean isCategory()
          Indicates whether a view entry is a category.
 boolean isConflict()
          Indicates if a view entry is for a document on which a replication or save conflict occurred.
 boolean isDocument()
          Indicates whether a view entry is a document.
 boolean isTotal()
          Indicates whether a view entry is a total.
 boolean isValid()
          Indicates whether a view entry is a valid entry and not a deletion stub.
 java.lang.String toString()
          Returns a short description of an instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.bea.domingo.DBase
equals, hashCode
 

Constructor Detail

MockViewEntry

public MockViewEntry(java.util.List columnValues,
                     java.lang.String universalID,
                     int childCount,
                     boolean isCategory,
                     boolean isDocument,
                     boolean isTotal,
                     boolean isConflict)
Constructor.

Parameters:
columnValues - list of column values
universalID - universal ID
childCount - number of children
isCategory - if it is a category entry
isDocument - if it is a document entry
isTotal - if it is a total entry
isConflict - if it is a conflict entry

MockViewEntry

public MockViewEntry(DViewEntry entry)
Constructor.

Parameters:
entry - any object implementing the interface DViewEntry
Method Detail

getColumnValues

public java.util.List getColumnValues()
The value of each column in the view entry.

Specified by:
getColumnValues in interface DViewEntry
Returns:
list of Double, java.util.Calendar, or String.
See Also:
DViewEntry.getColumnValues()

getDocument

public DDocument getDocument()
The document associated with the view entry.

Returns null if the view entry is not a document. Returns null if the document is deleted after the ViewEntry object is created.

Specified by:
getDocument in interface DViewEntry
Returns:
the document.
See Also:
DViewEntry.getDocument()

isCategory

public boolean isCategory()
Indicates whether a view entry is a category.

Specified by:
isCategory in interface DViewEntry
Returns:
true if the entry is a category, false if the entry is not a category
See Also:
DViewEntry.isCategory()

isDocument

public boolean isDocument()
Indicates whether a view entry is a document.

Specified by:
isDocument in interface DViewEntry
Returns:
true if the entry is a document, false if the entry is not a document
See Also:
DViewEntry.isDocument()

isTotal

public boolean isTotal()
Indicates whether a view entry is a total.

Specified by:
isTotal in interface DViewEntry
Returns:
true if the entry is a total, false if the entry is not a total
See Also:
DViewEntry.isTotal()

getUniversalID

public java.lang.String getUniversalID()

Specified by:
getUniversalID in interface DViewEntry
Returns:
unid.
See Also:
DViewEntry.getUniversalID()

getChildCount

public int getChildCount()
The number of immediate children belonging to the current view entry.

Specified by:
getChildCount in interface DViewEntry
Returns:
number of immediate children belonging to the current view entry
See Also:
DViewEntry.getChildCount()

isConflict

public boolean isConflict()
Indicates if a view entry is for a document on which a replication or save conflict occurred.

Specified by:
isConflict in interface DViewEntry
Returns:
true if the entry is a conflict document, false if the entry is not a conflict document
See Also:
DViewEntry.isConflict()

toString

public java.lang.String toString()
Returns a short description of an instance.

Specified by:
toString in interface DBase
Overrides:
toString in class java.lang.Object
Returns:
short description of an instance
See Also:
Object.toString()

getDescendantCount

public int getDescendantCount()
The number of descendants belonging to the current view entry.

Specified by:
getDescendantCount in interface DViewEntry
Returns:
number of descendants
See Also:
DViewEntry.getDescendantCount()

getSiblingCount

public int getSiblingCount()
The number of siblings belonging to the current view entry.

The sibling count includes the current entry unless it is a total.

Specified by:
getSiblingCount in interface DViewEntry
Returns:
number of siblings
See Also:
DViewEntry.getSiblingCount()

getSibblingCount

public int getSibblingCount()
Deprecated. use method getSiblingCount() instead

The number of siblings belonging to the current view entry.

The sibling count includes the current entry unless it is a total.

Specified by:
getSibblingCount in interface DViewEntry
Returns:
number of siblings
See Also:
DViewEntry.getSibblingCount()

getIndentLevel

public int getIndentLevel()
The indent level of a view entry within the view.

The indent level corresponds to the number of levels in the position. Position 1 is indent level 0, position 1.1 is indent level 1, position 1.1.1 is indent level 2, and so on.

Specified by:
getIndentLevel in interface DViewEntry
Returns:
indent level
See Also:
DViewEntry.getIndentLevel()

isValid

public boolean isValid()
Indicates whether a view entry is a valid entry and not a deletion stub.

If a document is removed after a view entry collection containing it is created, you can use the corresponding view entry for navigation but cannot access the document. If the possibility of removal exists, you should check isValid before attempting to access the document.

Specified by:
isValid in interface DViewEntry
Returns:
true if a view entry is a valid entry and not a deletion stub
See Also:
DViewEntry.isValid()

getNoteID

public java.lang.String getNoteID()
The note ID of a view entry of type document.

This property returns the empty string for entries of type category and total.

Specified by:
getNoteID in interface DViewEntry
Returns:
noteID
See Also:
DViewEntry.getNoteID()

getPosition

public java.lang.String getPosition(char seperator)
Returns the position of the entry in the view hierarchy, for example, "2.3" for the third document of the second category.

Specified by:
getPosition in interface DViewEntry
Parameters:
seperator - The separator to be used in the return value.
Returns:
A series of integers (in String format) and separators. The integers indicate the positions of the view entry at each level, where 1 is the first position. The first integer indicates the first level and so on.
See Also:
DViewEntry.getPosition(char)


Domingo Java-API