> ## 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: PHXFileLoader

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

**Class Hierarchy**

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

***

**Declaration**

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

This is a utility class for loading data files. The class makes it easy to load files, line by line while ignoring comments (lines that begin with #).

Sample Usage:

```java theme={null}
PHXFileLoader fl;

try {
   fl = new PHXFileLoader( "myfile.dat" );
} catch ( IOException e ) {
   System.out.println( e );
}

String line = fl.nextLine();

while ( line != null ) {
   // process line
   ...
   line = fl.nextLine();
}

fl.close();
```

## Constructor Summary

| Constructor and Description |
| - |
| `PHXFileLoader(java.lang.String fileName)` |
| `PHXFileLoader(java.io.File file)` |
| `PHXFileLoader(java.io.StringReader inStream)` |
| `PHXFileLoader(java.io.InputStream inStream)` |

## Method Summary

| Modifier and Type | Method and Description |
| - | - |
| `void` | `close()` closes the file |
| `void` | `finalize()` |
| `java.lang.String` | `getFileName()` retrieves the file name |
| `int` | `getLineNumber()` returns the line number of the last line read. |
| `java.lang.String` | `getRemainder()` returns the rest of the file as a string |
| `java.lang.String` | `nextLine()` extracts the next non-comment line from the data file |
| `java.lang.String` | `readNextLine()` extracts the next line from the data file |

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

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

## Constructor Detail

### PHXFileLoader

```java theme={null}
public PHXFileLoader(java.lang.String fileName)
              throws java.io.IOException
```

**Parameters:**

* `fileName` - the file to load
  **Throws:**
* `java.io.IOException` - if there is a problem opening the file

### PHXFileLoader

```java theme={null}
public PHXFileLoader(java.io.File file)
              throws java.io.IOException
```

**Parameters:**

* `file` - the file to load

**Throws:**

* `java.io.IOException` - if there is a problem opening the file

### PHXFileLoader

```java theme={null}
public PHXFileLoader(java.io.StringReader inStream)
              throws java.io.IOException
```

**Throws:**

* `java.io.IOException`

### PHXFileLoader

```java theme={null}
public PHXFileLoader(java.io.InputStream inStream)
              throws java.io.IOException
```

**Throws:**

* `java.io.IOException`

## Method Detail

### finalize

```java theme={null}
public void finalize()
```

**Overrides:**

* `finalize` in class `java.lang.Object`

### close

```java theme={null}
public void close()
```

closes the file

### getFileName

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

retrieves the file name

**Returns:**

* the name of the file

### getLineNumber

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

returns the line number of the last line read. Indexing starts at 1

**Returns:**

* the last line number

### nextLine

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

extracts the next non-comment line from the data file

**Returns:**

* a non-comment line

### readNextLine

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

extracts the next line from the data file

**Returns:**

* a line

### getRemainder

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

returns the rest of the file as a string

**Returns:**

* the remaining contents of the file
