Skip to content

Commit 3c3cb74

Browse files
committed
add: [NelsonMartell.Collections.] IList interface.
1 parent 7606059 commit 3c3cb74

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3+
* PHP interface «IList»
4+
*
5+
* Copyright © 2015 Nelson Martell (http://fb.me/nelson6e65)
6+
*
7+
* Licensed under The MIT License (MIT)
8+
* For full copyright and license information, please see the LICENSE
9+
* Redistributions of files must retain the above copyright notice.
10+
*
11+
* @copyright Copyright © 2015 Nelson Martell
12+
* @link https://github.com/nelson6e65/NelsonMartell
13+
* @package NelsonMartell.Collections
14+
* @license http://www.opensource.org/licenses/mit-license.php The MIT License (MIT)
15+
*
16+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17+
18+
19+
$_namespace = "NelsonMartell/Collections";
20+
$_class = "IList";
21+
22+
if (!defined($_namespace . '/' . $_class)):
23+
define($_namespace . '/' . $_class, true);
24+
25+
include('ICollection.php');
26+
27+
/* *
28+
* Representa una colección de objetos a los que se puede tener acceso por un índice.
29+
*
30+
* @package NelsonMartell.Collections
31+
* @author Nelson Martell (@yahoo.es: nelson6e65-dev)
32+
*
33+
* */
34+
interface IList extends ICollection {
35+
36+
/* *
37+
* Determina el índice de un elemento específico de la lista.
38+
* Si un objeto aparece varias veces en la lista, el método IndexOf siempre devolverá la
39+
* primera instancia encontrada.
40+
*
41+
* @param mixed $item Objeto que se va a buscar.
42+
* @return integer Índice de $item si se encuentra en la lista; en caso contrario, -1.
43+
* */
44+
public function IndexOf($item);
45+
46+
/* *
47+
* Inserta un elemento en la lista, en el índice especificado.
48+
*
49+
* @param integer $index Índice de base cero en el que debe insertarse $item.
50+
* @param mixed $item Objeto que se va a insertar.
51+
*
52+
* */
53+
public function Insert($index, $item);
54+
55+
/* *
56+
* Quita el elemento del índice especificado.
57+
*
58+
* @param integer $index Índice de base cero del elemento que se va a quitar.
59+
* */
60+
public function RemoveAt($index);
61+
62+
}
63+
64+
65+
endif;

0 commit comments

Comments
 (0)