Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::Seg Class Reference

#include <Seg.h>

Inheritance diagram for alize::Seg:
Inheritance graph
[legend]
Collaboration diagram for alize::Seg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Seg ()
void setBegin (unsigned long b)
void setLength (unsigned long l)
virtual unsigned long begin () const
virtual unsigned long length () const
Segmerge (Seg &s)
Segsplit (unsigned long i)
Segduplicate () const
virtual String getClassName () const
virtual String toString () const
virtual SeggetSeg () const
Segduplicate (const K &, SegServer &ss) const
virtual void getExtremeBoundaries (const K &, unsigned long &b, unsigned long &e, bool &isDefined) const

Static Public Member Functions

static Segcreate (const K &, SegServer &ss, unsigned long b=0, unsigned long e=0, unsigned long lc=0, const String &s="", const String &sn="")

Private Member Functions

 Seg (SegServer &ss, unsigned long b=0, unsigned long e=0, unsigned long lc=0, const String &s="", const String &sn="")
 Seg (const Seg &)
const Segoperator= (const Seg &c)
bool operator== (const Seg &c) const
bool operator!= (const Seg &c) const

Private Attributes

unsigned long _begin
unsigned long _length

Friends

class TestSeg
class TestSegCluster
class TestSegServer

Detailed Description

Class for a segment.

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2004

Definition at line 81 of file Seg.h.


Constructor & Destructor Documentation

Seg::~Seg (  ) [virtual]

Definition at line 171 of file Seg.cpp.

Seg::Seg ( SegServer ss,
unsigned long  b = 0,
unsigned long  e = 0,
unsigned long  lc = 0,
const String s = "",
const String sn = "" 
) [explicit, private]

Definition at line 65 of file Seg.cpp.

Referenced by create().

alize::Seg::Seg ( const Seg  ) [private]

Member Function Documentation

unsigned long Seg::begin (  ) const [virtual]

Returns the number of the beginning feature of the segment

Returns:
the number of the beginning feature of the segment

Implements alize::SegAbstract.

Definition at line 118 of file Seg.cpp.

References _begin.

Referenced by merge().

Seg & Seg::create ( const K ,
SegServer ss,
unsigned long  b = 0,
unsigned long  e = 0,
unsigned long  lc = 0,
const String s = "",
const String sn = "" 
) [static]

Definition at line 69 of file Seg.cpp.

References alize::Object::assertMemoryIsAllocated(), and Seg().

Referenced by duplicate().

Seg & Seg::duplicate ( const K ,
SegServer ss 
) const
Seg & Seg::duplicate (  ) const

Duplicate a segment. The new segment is stored inside the segment server.

Returns:
the new segment

Definition at line 142 of file Seg.cpp.

References alize::SegServer::duplicateSeg(), and alize::SegAbstract::getServer().

Referenced by alize::SegServer::assign(), alize::SegServer::duplicateSeg(), and split().

String Seg::getClassName (  ) const [virtual]

Returns the name of the class

Returns:
the name of the class of the object as a String

Implements alize::SegAbstract.

Definition at line 158 of file Seg.cpp.

void Seg::getExtremeBoundaries ( const K ,
unsigned long &  b,
unsigned long &  e,
bool &  isDefined 
) const [virtual]

Implements alize::SegAbstract.

Definition at line 98 of file Seg.cpp.

References _begin, and _length.

Seg * Seg::getSeg (  ) const [virtual]

Do not use. Internal usage.

Implements alize::SegAbstract.

Definition at line 88 of file Seg.cpp.

References alize::SegAbstract::_current, and NULL.

Referenced by alize::SegCluster::getSeg().

unsigned long Seg::length (  ) const [virtual]

Returns the number of features (length) of the segment

Returns:
the number of features (length) of the segment

Implements alize::SegAbstract.

Definition at line 116 of file Seg.cpp.

References _length.

Seg & Seg::merge ( Seg s )

Merges two segments. The second segment is destroyed after merging.
If the data "string" are not the same, the second string is added to the first string.
If the data "srcName" are not the same, the source names are* concatenated.
The internal lists are concatenated
The label code of the second segment is ignored.

Parameters:
sthe segment to merge with this segment
Returns:
this segment

Definition at line 120 of file Seg.cpp.

References _begin, _length, alize::SegAbstract::_list, alize::SegAbstract::_srcName, alize::SegAbstract::_string, alize::XList::addLine(), begin(), alize::XList::getLine(), alize::XList::getLineCount(), alize::SegAbstract::getServer(), alize::SegAbstract::list(), and alize::SegServer::remove().

bool alize::Seg::operator!= ( const Seg c ) const [private]

not implemented

const Seg& alize::Seg::operator= ( const Seg c ) [private]

not implemented

bool alize::Seg::operator== ( const Seg c ) const [private]

not implemented

void Seg::setBegin ( unsigned long  b )

Sets the number of the first feature of the segment

Parameters:
bbeginning value

Definition at line 84 of file Seg.cpp.

References _begin.

Referenced by split().

void Seg::setLength ( unsigned long  l )

Sets the number of features (length) of the segment

Parameters:
lthe length

Definition at line 86 of file Seg.cpp.

References _length.

Referenced by split().

Seg & Seg::split ( unsigned long  i )

Splits this segment starting to a given feature and create a second segment in the server. If the original segment belongs to clusters, the second segment is added behind the original segment in the clusters. All the data (except begin and length) of the segment are duplicated in the second segment.

Parameters:
inumber of the feature used as the first feature of the second generated segment
Returns:
a reference to the new segment

Definition at line 144 of file Seg.cpp.

References _begin, _length, duplicate(), setBegin(), setLength(), and alize::String::valueOf().

String Seg::toString (  ) const [virtual]

This method is frequently overridden in the derived classes. If it is not, it returns the name of the class of the object and the address of the object

Returns:
a description of the object

Implements alize::SegAbstract.

Definition at line 160 of file Seg.cpp.

References _begin, alize::SegAbstract::_labelCode, _length, alize::SegAbstract::_srcName, alize::SegAbstract::_string, and alize::String::valueOf().


Friends And Related Function Documentation

friend class TestSeg [friend]

Reimplemented from alize::SegAbstract.

Definition at line 83 of file Seg.h.

friend class TestSegCluster [friend]

Reimplemented from alize::SegAbstract.

Definition at line 84 of file Seg.h.

friend class TestSegServer [friend]

Reimplemented from alize::SegAbstract.

Definition at line 85 of file Seg.h.


Member Data Documentation

unsigned long alize::Seg::_begin [private]

Definition at line 158 of file Seg.h.

Referenced by begin(), duplicate(), getExtremeBoundaries(), merge(), setBegin(), split(), and toString().

unsigned long alize::Seg::_length [private]

Definition at line 159 of file Seg.h.

Referenced by duplicate(), getExtremeBoundaries(), length(), merge(), setLength(), split(), and toString().


The documentation for this class was generated from the following files: