> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: PHXComponentBranch

**Package:** `com.phoenix_int.aserver`

**Class Hierarchy**

```text theme={null}
↳ java.lang.Object
  ↳ com.phoenix_int.aserver.PHXComponentBranch
```

**Declaration**

```java theme={null}
public class PHXComponentBranch
extends java.lang.Object
```

This class represents a branch on a revision history tree for a version controlled component. Includes functionality for reading/writing XML branch descriptions.

## Constructor Summary

| Constructor and Description |
| - |
| `PHXComponentBranch()` Constructs an empty branch |
| `PHXComponentBranch(org.w3c.dom.Element branchElement)` Constructs a branch based on an XML branch node |
| `PHXComponentBranch(java.lang.String name)` Constructs an empty named branch |

## Method Summary

| Modifier and Type | Method and Description |
| - | - |
| `void` | `addVersion(PHXComponentVersion v)` Adds a version to this branch |
| `PHXComponentBranch` | `findBranch(java.lang.String name)` Finds any sub-branch that is part of any version in this branch by name |
| `PHXComponentVersion` | `findVersion(java.lang.String name)` Finds a sub-version by the specified name |
| `void` | `fromXML(java.lang.String xmlString)` Reads in an XML description of a branch into this object |
| `java.lang.String` | `getName()` Gets the name of this branch |
| `int` | `getNumVersions()` Returns how many versions there are in this branch |
| `PHXComponentVersion` | `getParent()` Retrieves the parent version |
| `PHXComponentVersion` | `getVersion(int i)` Gets the i'th version |
| `java.util.Iterator` | `getVersions()` Returns an Iterator over the sub-versions |
| `void` | `insertVersion(PHXComponentVersion v, int location)` Inserts a version to this branch at a particular location |
| `void` | `setName(java.lang.String name)` Changes the branch name |
| `java.lang.String` | `toXML()` Converts this branch into an XML String |

### Methods inherited from class java.lang.Object

`clone`, `equals`, `finalize`, `getClass`, `hashCode`, `notify`, `notifyAll`, `toString`, `wait`, `wait`, `wait`

## Constructor Detail

### PHXComponentBranch

```java theme={null}
public PHXComponentBranch()
```

Constructs an empty branch

### PHXComponentBranch

```java theme={null}
public PHXComponentBranch(java.lang.String name)
```

Constructs an empty named branch

### PHXComponentBranch

```java theme={null}
public PHXComponentBranch(org.w3c.dom.Element branchElement)
                   throws java.io.IOException
```

Constructs a branch based on an XML branch node

**Throws:**

* `java.io.IOException`

## Method Detail

### getParent

```java theme={null}
public PHXComponentVersion getParent()
```

Retrieves the parent version

### setName

```java theme={null}
public void setName(java.lang.String name)
```

Changes the branch name

### getName

```java theme={null}
public java.lang.String getName()
```

Gets the name of this branch

### addVersion

```java theme={null}
public void addVersion(PHXComponentVersion v)
```

Adds a version to this branch

### insertVersion

```java theme={null}
public void insertVersion(PHXComponentVersion v,
                          int location)
```

Inserts a version to this branch at a particular location

### getNumVersions

```java theme={null}
public int getNumVersions()
```

Returns how many versions there are in this branch

### getVersions

```java theme={null}
public java.util.Iterator getVersions()
```

Returns an Iterator over the sub-versions

### getVersion

```java theme={null}
public PHXComponentVersion getVersion(int i)
```

Gets the i'th version

### findVersion

```java theme={null}
public PHXComponentVersion findVersion(java.lang.String name)
```

Finds a sub-version by the specified name

### findBranch

```java theme={null}
public PHXComponentBranch findBranch(java.lang.String name)
```

Finds any sub-branch that is part of any version in this branch by name

### fromXML

```java theme={null}
public void fromXML(java.lang.String xmlString)
             throws javax.xml.parsers.ParserConfigurationException,
                    org.xml.sax.SAXException,
                    java.io.IOException
```

Reads in an XML description of a branch into this object

**Throws:**

* `javax.xml.parsers.ParserConfigurationException`
* `org.xml.sax.SAXException`
* `java.io.IOException`

### toXML

```java theme={null}
public java.lang.String toXML()
```

Converts this branch into an XML String
