## org.klomp.snark
Class Piece

    java.lang.Object
      org.klomp.snark.Piece

All Implemented Interfaces:
  java.lang.Comparable

    public class Piece

extends java.lang.Object
implements java.lang.Comparable

Constructor Summary
`Piece(int id)`

Method Summary
`boolean` `addPeer(Peer peer)`
`int` `compareTo(java.lang.Object o)`
`boolean` `equals(java.lang.Object o)`
`int` `getId()`
`java.util.Set` `getPeers()`
`int` `hashCode()`
`boolean` `isRequested()`
`boolean` `removePeer(Peer peer)`
`void` `setRequested(boolean requested)`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Piece

    public Piece(int id)

Method Detail

### compareTo

    public int compareTo(java.lang.Object o)
                  throws java.lang.ClassCastException

  Specified by:
    `compareTo` in interface `java.lang.Comparable`
  Throws:
    `java.lang.ClassCastException`

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### getId

    public int getId()

### getPeers

    public java.util.Set getPeers()

### addPeer

    public boolean addPeer(Peer peer)

### removePeer

    public boolean removePeer(Peer peer)

### isRequested

    public boolean isRequested()

### setRequested

    public void setRequested(boolean requested)

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`