john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Resource INCOMPLETE

//2012-03-16 johnpfeiffer       INCOMPLETE requires Block

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.ListIterator;

class Resource
{
    private static String uuid;
    private static ArrayList <Block> blocks;

    Resource( String id )
    {
        if( !id.isEmpty() )
        {
            this.uuid = id;
            blocks = new ArrayList();
        }else
        {       throw new IllegalArgumentException( "Must have an identifier" );
        }
    }
    String getId()
    {   return uuid;
    }

    void addBlock( Block b )
    {       blocks.add( b );
    }

    void displayBlocks( PrintWriter out )
    {
        ListIterator <Block> it = blocks.listIterator() ;
    while ( it.hasNext() )
    {
        Block temp = it.next();
        out.println( temp.getId() );
    }
    }


    int getBlockCount()
    {   return blocks.size();
    }

}

  • « Tomcat port 80 authbind instead of iptables windows jre home variable
  • BlockTest »

Published

Mar 17, 2012

Category

java-classes

~69 words

Tags

  • classes 92
  • incomplete 22
  • java 252
  • resource 3