Initial Version
This commit is contained in:
81
shared/lib/Resource/Range/RangeTally.php
Normal file
81
shared/lib/Resource/Range/RangeTally.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Resource\Range;
|
||||
|
||||
class RangeTally extends Range implements IRangeTally {
|
||||
|
||||
protected RangeAnchorType $anchor = RangeAnchorType::ABSOLUTE;
|
||||
protected string|int $position = 0;
|
||||
protected int $tally = 32;
|
||||
|
||||
/**
|
||||
* Returns the type of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function type(): RangeType {
|
||||
return RangeType::TALLY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the anchor type of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getAnchor(): RangeAnchorType {
|
||||
return $this->anchor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the anchor type of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setAnchor(RangeAnchorType $value): void {
|
||||
$this->anchor = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start position of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getPosition(): string|int {
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start position of the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setPosition(string|int $value): void {
|
||||
$this->position = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the count of items in the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getTally(): int {
|
||||
return $this->tally;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the count of items in the range
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function setTally(int $value): void {
|
||||
$this->tally = $value;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user