Created
February 9, 2015 00:44
-
-
Save GaeaKat/7f08ffa608783c9d61dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nekokittygames.zmachine.blorb.IFF; | |
import com.sun.javaws.exceptions.InvalidArgumentException; | |
/** | |
* Single chunk in an IFF file, may contain more chunks | |
* | |
* | |
* Created by Katrina Swales on 09/02/2015. | |
*/ | |
public abstract class Chunk { | |
private String identifier; | |
private int size; | |
/** | |
* gets the chunk identifier | |
* @return identifying 4 letter string for chunk | |
*/ | |
public String getIdentifier() { | |
return identifier; | |
} | |
/** | |
* Sets 4 letter chunk ident | |
* @param identifier ident to set | |
* @throws IllegalArgumentException thrown if ident wished is not 4 characters | |
*/ | |
public void setIdentifier(String identifier){ | |
if(identifier.length()!=4) | |
throw new IllegalArgumentException("Identifier must have 4 letters"); | |
this.identifier = identifier; | |
} | |
/** | |
* Gets the size of the chunk | |
* @return size of chunk in bytes | |
*/ | |
public int getSize() { | |
return size; | |
} | |
/** | |
* Sets the size of the chunk | |
* @param size size of chunk in bytes | |
*/ | |
public void setSize(int size) { | |
this.size = size; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment