Package org.eclipse.emf.cdo.common.branch

# Schnittstelle CDOBranch

Alle Superschnittstellen:
  `CDOBranchPoint`, `CDOBranchProvider`, `CDONameProvider`, `CDOTimeProvider`, `Comparable<CDOBranch>`, `IAdaptable`, `org.eclipse.net4j.util.container.IContainer<CDOBranch>`, `org.eclipse.net4j.util.event.INotifier`

Alle bekannten Unterschnittstellen:
  `InternalCDOBranch`

public interface CDOBranch extends CDOBranchPoint, CDONameProvider, org.eclipse.net4j.util.container.IContainer<CDOBranch>, Comparable<CDOBranch>, IAdaptable
Represents a stream of changes that is isolated from other streams of changes.

A branch starts at a fixed `base` point and ends at a floating `head` point. Between these two points there can be a number of other `branch points`:

- `Commit infos` are points in a branch that represent commit operations.
- `Branch tags` are named points in a branch.
- `Base points` of sub branches of a branch.

Seit:
  3.0
Autor:
  Eike Stepper
No Implement
  This interface is not intended to be implemented by clients.
No Extend
  This interface is not intended to be extended by clients.

## Verschachtelte Klassen - Übersicht

Verschachtelte Klassen
Modifizierer und Typ
Schnittstelle
Beschreibung
`static interface`
`CDOBranch.BranchDeletedEvent`
An `event` fired from a `branch` when it gets deleted.

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.container.IContainer

`org.eclipse.net4j.util.container.IContainer.Modifiable<E>, org.eclipse.net4j.util.container.IContainer.Persistable<E>, org.eclipse.net4j.util.container.IContainer.Persistence<E>`

## Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.eclipse.net4j.util.event.INotifier

`org.eclipse.net4j.util.event.INotifier.INotifier2`

## Feldübersicht

Felder
Modifizierer und Typ
Feld
Beschreibung
`static final int`
`MAIN_BRANCH_ID`
The fixed ID of the `main branch`.
`static final String`
`MAIN_BRANCH_NAME`
The fixed name of the `main branch`.
`static final String`
`PATH_SEPARATOR`
The string used to separate the segments of branch paths.

### Von Schnittstelle geerbte Felder org.eclipse.emf.cdo.common.branch.CDOBranchPoint

`INVALID_DATE, UNSPECIFIED_DATE`

## Methodenübersicht

Modifizierer und Typ
Methode
Beschreibung
`CDOBranch`
`createBranch(String name)`
Creates a sub branch of this branch with the given name, `based` at the `current time`.
`CDOBranch`
`createBranch(String name, long timeStamp)`
Creates a sub branch of this branch with the given name, `based` at the `branch point` in this branch with the given time stamp.
`CDOBranch[]`
`delete(org.eclipse.net4j.util.om.monitor.OMMonitor monitor)`
Deletes this branch and all its sub branches.
`void`
`fireDeletedEvent()`
`CDOBranchPoint`
`getBase()`
Returns the immutable base branch point of this branch, the point in the parent branch that marks the creation of this branch.
`CDOBranchPoint[]`
`getBasePath()`
Returns an array of the `base` branch points starting from the base of the `main branch` down to and including the base of this branch.
`CDOBranch`
`getBranch(String path)`
Returns the sub branch of this branch with the given relative path, or `null` if no sub branch with this path exists in this branch.
`CDOBranch[]`
`getBranches()`
Returns an array of the sub branches of this branch, never `null`.
`CDOBranchManager`
`getBranchManager()`
Returns the branch manager that manages this branch, never `null`.
`CDOBranchPoint`
`getHead()`
Returns the floating end point of this branch, a pair of this branch and the fixed special time stamp `unspecified`.
`int`
`getID()`
Returns the ID of this branch.
`String`
`getName()`
Returns the name of this branch as specified when it was created with `createBranch()` or `MAIN_BRANCH_NAME` if this branch is the `main branch`.
`String`
`getPathName()`
Returns the fully qualified path name of this branch, a concatenation of the names of all branches from the `main branch` to this branch, separated by `slashes` ("/" characters).
`CDOBranchPoint`
`getPoint(long timeStamp)`
Returns the branch point in this branch with the given time stamp.
`CDOBranchVersion`
`getVersion(int version)`
Returns the branch version in this branch with the given version number.
`boolean`
`isDeleted()`
Returns `true` if this branch has is deleted, `false` otherwise.
`boolean`
`isLocal()`
Returns `true` if this branch is a local branch, `false` otherwise.
`boolean`
`isMainBranch()`
Returns `true` if this branch is the `main branch`, `false` otherwise.
`void`
`rename(String newName)`
Veraltet.
As of 4.4 use `setName(String)`.
`void`
`setName(String name)`

### Von Schnittstelle geerbte Methoden org.eclipse.emf.cdo.common.branch.CDOBranchPoint

`getBranch, getTimeStamp`

### Von Schnittstelle geerbte Methoden java.lang.Comparable

`compareTo`

### Von Schnittstelle geerbte Methoden org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Von Schnittstelle geerbte Methoden org.eclipse.net4j.util.container.IContainer

`getElements, isEmpty`

### Von Schnittstelle geerbte Methoden org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Felddetails

### MAIN_BRANCH_ID

static final int MAIN_BRANCH_ID
The fixed ID of the `main branch`.

Siehe auch:
  - Konstantenfeldwerte

### MAIN_BRANCH_NAME

static final String MAIN_BRANCH_NAME
The fixed name of the `main branch`.

Siehe auch:
  - Konstantenfeldwerte

### PATH_SEPARATOR

static final String PATH_SEPARATOR
The string used to separate the segments of branch paths.

Siehe auch:
  - `getPathName()`
  - `getBranch(String)`
  - `CDOBranchManager.getBranch(String)`
  - Konstantenfeldwerte

## Methodendetails

### isMainBranch

boolean isMainBranch()
Returns `true` if this branch is the `main branch`, `false` otherwise.

### isLocal

boolean isLocal()
Returns `true` if this branch is a local branch, `false` otherwise.

Local branches are created on the fly when committing to a `clone` repository while it is in `offline` state and they do not participate in repository replication. They can not be created manually and they have negative `IDs`.

### isDeleted

boolean isDeleted()
Returns `true` if this branch has is deleted, `false` otherwise.

Seit:
  4.15

### getID

int getID()
Returns the ID of this branch.

The `main branch` has the fixed ID 0 (zero), `Local branches` have negative IDs and normal branches have positive IDs.

### getName

String getName() throws CDOBranchDoesNotExistException
Returns the name of this branch as specified when it was created with `createBranch()` or `MAIN_BRANCH_NAME` if this branch is the `main branch`.

Angegeben von:
  `getName` in Schnittstelle `CDONameProvider`
Löst aus:
  `CDOBranchDoesNotExistException`

### setName

void setName(String name) throws CDODuplicateBranchException

Löst aus:
  `CDODuplicateBranchException`
Seit:
  4.4

### getPathName

String getPathName()
Returns the fully qualified path name of this branch, a concatenation of the names of all branches from the `main branch` to this branch, separated by `slashes` ("/" characters). Example: "MAIN/team1/smith".

### getBasePath

CDOBranchPoint[] getBasePath()
Returns an array of the `base` branch points starting from the base of the `main branch` down to and including the base of this branch.

### getBase

CDOBranchPoint getBase() throws CDOBranchDoesNotExistException
Returns the immutable base branch point of this branch, the point in the parent branch that marks the creation of this branch.

The base of the `main branch` marks the creation of the `repository`.

Löst aus:
  `CDOBranchDoesNotExistException`
Siehe auch:
  - `getHead()`
  - `getPoint(long)`

### getHead

CDOBranchPoint getHead()
Returns the floating end point of this branch, a pair of this branch and the fixed special time stamp `unspecified`.

Siehe auch:
  - `getBase()`
  - `getPoint(long)`

### getPoint

CDOBranchPoint getPoint(long timeStamp)
Returns the branch point in this branch with the given time stamp.

This factory method never returns `null`.

Siehe auch:
  - `getBase()`
  - `getHead()`
  - `getVersion(int)`

### getVersion

CDOBranchVersion getVersion(int version)
Returns the branch version in this branch with the given version number.

This factory method never returns `null`.

Siehe auch:
  - `getPoint(long)`

### getBranchManager

CDOBranchManager getBranchManager()
Returns the branch manager that manages this branch, never `null`.

### getBranches

CDOBranch[] getBranches()
Returns an array of the sub branches of this branch, never `null`.

### getBranch

CDOBranch getBranch(String path)
Returns the sub branch of this branch with the given relative path, or `null` if no sub branch with this path exists in this branch.

The path name is the concatenation of the names of all branches from a direct sub branch of this branch, separated by `slashes` ("/" characters). Example: "team1/smith".

### createBranch

CDOBranch createBranch(String name, long timeStamp) throws CDODuplicateBranchException
Creates a sub branch of this branch with the given name, `based` at the `branch point` in this branch with the given time stamp.

Parameter:
  `name` - The name of the sub branch to be created. It must not contain the `path separator` character (slash).
  `timeStamp` - The time stamp in this branch that the sub branch to be created is supposed to be `based at`. It must not be before the base time stamp of this branch and it must be different from the fixed special time stamp `unspecified`
Löst aus:
  `CDODuplicateBranchException`
Siehe auch:
  - `createBranch(String)`

### createBranch

CDOBranch createBranch(String name) throws CDODuplicateBranchException
Creates a sub branch of this branch with the given name, `based` at the `current time`.

Löst aus:
  `CDODuplicateBranchException`

### delete

CDOBranch[] delete(org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
Deletes this branch and all its sub branches.

Gibt zurück:
  an array of the ids of all deleted branches in top-down order.
Seit:
  4.15

### fireDeletedEvent

void fireDeletedEvent()

Seit:
  4.15

### rename

@Deprecated void rename(String newName)
Veraltet.
As of 4.4 use `setName(String)`.
Renames this branch with the given new name.

Seit:
  4.3