net.sf.jmimemagic
Class MagicMatch

java.lang.Object
  extended bynet.sf.jmimemagic.MagicMatch
All Implemented Interfaces:
java.lang.Cloneable

public class MagicMatch
extends java.lang.Object
implements java.lang.Cloneable

This class represents a single match test

Version:
$Revision: 1.10 $
Author:
$Author: arimus $

Constructor Summary
MagicMatch()
          constructor
 
Method Summary
 void addSubMatch(MagicMatch m)
          add a submatch to this magic match
protected  java.lang.Object clone()
          DOCUMENT ME!
 boolean descriptionMatches(java.lang.String desc)
          determine if this match or any submatches has the description
 long getBitmask()
          get the bitmask that will be applied for this magic match
 char getComparator()
          get the comparator for this magic match
 java.lang.String getDescription()
          get the description for this magic match
 java.lang.String getExtension()
          get the extension for this magic match
 int getLength()
          get the length we are restricting the comparison to for this magic match
 java.lang.String getMimeType()
          get the magic match for this magic match
 int getOffset()
          get the offset in the stream we are comparing to the test value for this magic match
 java.util.Map getProperties()
          get the properties for this magic match
 java.util.Collection getSubMatches()
          get all submatches for this magic match
 java.nio.ByteBuffer getTest()
          get the test value for this magic match
 java.lang.String getType()
          get the type of match for this magic match
 boolean mimeTypeMatches(java.lang.String desc)
          determine if this match or any submatches has the description
 java.lang.String print()
          print information about this match
 void setBitmask(java.lang.String value)
          set the bitmask that will be applied for this magic match
 void setComparator(java.lang.String value)
          set the comparator for this magic match
 void setDescription(java.lang.String value)
          set the description for this magic match
 void setExtension(java.lang.String value)
          set the extension for this magic match
 void setLength(int value)
          set the length we are restricting the comparison to for this magic match
 void setMimeType(java.lang.String value)
          set the mime type for this magic match
 void setOffset(int value)
          set the offset in the stream we are comparing to the test value for this magic match
 void setProperties(java.util.Map properties)
          set the properties for this magic match
 void setSubMatches(java.util.Collection a)
          set all submatches
 void setTest(java.nio.ByteBuffer value)
          set the test value for thie magic match
 void setType(java.lang.String value)
          set the type of match to perform for this magic match
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MagicMatch

public MagicMatch()
constructor

Method Detail

print

public java.lang.String print()
print information about this match

Returns:
DOCUMENT ME!

setMimeType

public void setMimeType(java.lang.String value)
set the mime type for this magic match

Parameters:
value - DOCUMENT ME!

getMimeType

public java.lang.String getMimeType()
get the magic match for this magic match

Returns:
the mime type for this magic match

setExtension

public void setExtension(java.lang.String value)
set the extension for this magic match

Parameters:
value - DOCUMENT ME!

getExtension

public java.lang.String getExtension()
get the extension for this magic match

Returns:
the extension for this magic match

setDescription

public void setDescription(java.lang.String value)
set the description for this magic match

Parameters:
value - DOCUMENT ME!

getDescription

public java.lang.String getDescription()
get the description for this magic match

Returns:
the description for thie magic match

setTest

public void setTest(java.nio.ByteBuffer value)
set the test value for thie magic match

Parameters:
value - DOCUMENT ME!

getTest

public java.nio.ByteBuffer getTest()
get the test value for this magic match

Returns:
DOCUMENT ME!

setOffset

public void setOffset(int value)
set the offset in the stream we are comparing to the test value for this magic match

Parameters:
value - DOCUMENT ME!

getOffset

public int getOffset()
get the offset in the stream we are comparing to the test value for this magic match

Returns:
the offset for this magic match

setLength

public void setLength(int value)
set the length we are restricting the comparison to for this magic match

Parameters:
value - DOCUMENT ME!

getLength

public int getLength()
get the length we are restricting the comparison to for this magic match

Returns:
DOCUMENT ME!

setType

public void setType(java.lang.String value)
set the type of match to perform for this magic match

Parameters:
value - DOCUMENT ME!

getType

public java.lang.String getType()
get the type of match for this magic match

Returns:
DOCUMENT ME!

setBitmask

public void setBitmask(java.lang.String value)
set the bitmask that will be applied for this magic match

Parameters:
value - DOCUMENT ME!

getBitmask

public long getBitmask()
get the bitmask that will be applied for this magic match

Returns:
the bitmask for this magic match

setComparator

public void setComparator(java.lang.String value)
set the comparator for this magic match

Parameters:
value - DOCUMENT ME!

getComparator

public char getComparator()
get the comparator for this magic match

Returns:
the comparator for this magic match

setProperties

public void setProperties(java.util.Map properties)
set the properties for this magic match

Parameters:
properties - DOCUMENT ME!

getProperties

public java.util.Map getProperties()
get the properties for this magic match

Returns:
the properties for this magic match

addSubMatch

public void addSubMatch(MagicMatch m)
add a submatch to this magic match

Parameters:
m - a magic match

setSubMatches

public void setSubMatches(java.util.Collection a)
set all submatches

Parameters:
a - a collection of submatches

getSubMatches

public java.util.Collection getSubMatches()
get all submatches for this magic match

Returns:
a collection of submatches

descriptionMatches

public boolean descriptionMatches(java.lang.String desc)
determine if this match or any submatches has the description

Parameters:
desc - DOCUMENT ME!
Returns:
whether or not the description matches

mimeTypeMatches

public boolean mimeTypeMatches(java.lang.String desc)
determine if this match or any submatches has the description

Parameters:
desc - DOCUMENT ME!
Returns:
whether or not the description matches

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
DOCUMENT ME!

Returns:
DOCUMENT ME!
Throws:
java.lang.CloneNotSupportedException - DOCUMENT ME!


Copyright © 2003-2006 none. All Rights Reserved.