Package htsjdk.tribble.gff

# Class Gff3BaseData

java.lang.Object
htsjdk.tribble.gff.Gff3BaseData

All Implemented Interfaces:
  `Locatable`

public class Gff3BaseData extends Object implements Locatable

## Constructor Summary

Constructors
Constructor
Description
`Gff3BaseData(String contig, String source, String type, int start, int end, Double score, Strand strand, int phase, Map<String,List<String>> attributes)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
`List<String>`
`getAliases()`
`List<String>`
`getAttribute(String key)`
get the values as List for the `key`, or an empty list if this `key` is not present
`Map<String,List<String>>`
`getAttributes()`
`String`
`getContig()`
Gets the contig name for the contig this is mapped to.
`int`
`getEnd()`
`String`
`getId()`
`String`
`getName()`
`int`
`getPhase()`
`double`
`getScore()`
`String`
`getSource()`
`int`
`getStart()`
`Strand`
`getStrand()`
`String`
`getType()`
`Optional<String>`
`getUniqueAttribute(String key)`
Most attributes in a GFF file are present just one time in a line, e.g.
`boolean`
`hasAttribute(String key)`
Returns `true` if this record contains an attribute for the specified key.
`int`
`hashCode()`

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

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

### Methods inherited from interface htsjdk.samtools.util.Locatable

`contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf`

## Constructor Details

### Gff3BaseData

public Gff3BaseData(String contig, String source, String type, int start, int end, Double score, Strand strand, int phase, Map<String,List<String>> attributes)

## Method Details

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### getContig

public String getContig()
Description copied from interface: `Locatable`
Gets the contig name for the contig this is mapped to. May return null if there is no unique mapping.

Specified by:
  `getContig` in interface `Locatable`
Returns:
  name of the contig this is mapped to, potentially null

### getSource

public String getSource()

### getType

public String getType()

### getStart

public int getStart()

Specified by:
  `getStart` in interface `Locatable`
Returns:
  1-based start position, undefined if getContig() == null

### getEnd

public int getEnd()

Specified by:
  `getEnd` in interface `Locatable`
Returns:
  1-based closed-ended position, undefined if getContig() == null

### getScore

public double getScore()

### getStrand

public Strand getStrand()

### getPhase

public int getPhase()

### getAttributes

public Map<String,List<String>> getAttributes()

### getAttribute

public List<String> getAttribute(String key)
get the values as List for the `key`, or an empty list if this `key` is not present

Parameters:
  `key` - key whose presence in this map is to be tested
Returns:
  the values as List, or an empty list if this key is not present

### hasAttribute

public boolean hasAttribute(String key)
Returns `true` if this record contains an attribute for the specified key.

Parameters:
  `key` - key whose presence in this map is to be tested
Returns:
  `true` if this map contains an attribute for the specified key

### getUniqueAttribute

public Optional<String> getUniqueAttribute(String key)
Most attributes in a GFF file are present just one time in a line, e.g. : `gene_biotype`, `gene_name`, etc ... This function returns an `Optional.empty` if the `key` is not present, an `Optional.of(value)` if there is only one value associated to the `key`, or it throws an `IllegalArgumentException` if there is more than one value.

Parameters:
  `key` - key whose presence in the attributes is to be tested
Returns:
  `Optional<String>` if this map contains zero or one attribute for the specified key
Throws:
  `IllegalArgumentException` - if there is more than one value

### getId

public String getId()

### getName

public String getName()

### getAliases

public List<String> getAliases()